Toshiba Corp.'s (TOSYY) path to reaching a compromise with flash memory JV partner Western Digital Corp. (WDC) - Get Report  regarding the sale of its giant flash memory unit has been more circuitous than I expected when predicting a resolution was on its way in June. Nonetheless, in spite of all the legal salvos and financial threats flung by the companies in recent months, Toshiba and Western now seem ready to bury the hatchet.

The reasons for this are pretty simple. Toshiba needs to unload its flash unit and realizes that Western's legal case for blocking any sale it doesn't want is pretty strong, and Western has strong incentives to both be on good terms with Toshiba and further grow its flash exposure.

Japan's Nikkei reports Toshiba and Western are discussing a deal in which Western would "contribute hundreds of billions of yen" (in effect, billions of dollars) in debt financing to a consortium buying Toshiba's flash unit, known as Toshiba Memory. The investment would eventually give Western a sub-20% stake in the business, but the company initially wouldn't have voting rights.

Both parties apparently want to move quickly. Western reportedly plans to finish its due diligence for Toshiba Memory by early next week, and Toshiba wants to ink a deal by month's end, after getting board approval. With antitrust reviews expected to take 6 to 9 months, Toshiba is reportedly hoping to close a deal by the end of its fiscal year, which concludes in March 2018.

Other consortium members are said to include P-E firm KKR and two state-backed Japanese funds; the group is said to have offered $17.3 billion overall for Toshiba Memory. The funds are already part of an $18 billion bid for the business that features P-E firm Bain Capital and South Korean memory giant SK Hynix, and which Toshiba said in late June was its "preferred" choice -- even though Western objected to the presence of SK Hynix, a major flash memory rival. Nonetheless, Nikkei reports the funds, taking the heed of Japanese regulators, are "likely to team up with whichever group offers the best prospects for an early sale."

And clearly, a deal that has Western's blessing is one that has the best odds of closing quickly. In May, the company filed an arbitration claim seeking to block the transfer of Toshiba's interests the transfer of the huge manufacturing and R&D JVs it operates in tandem with Western's SanDisk unit. With the JV agreements spelling out that neither party can transfer its interests without the other's consent, the odds of Western getting a favorable ruling would be pretty high.

And even if an arbitration court ruled in Toshiba's favor, a ruling would be unlikely to arrive before mid-2018. With Toshiba reportedly facing pressure from creditors to strike a deal by month's end and facing (due to Tokyo Stock Exchange rules governing a listed company's finances) the delisting of its shares if a sale isn't closed by March, that's a major issue.

More of What's Trending on TheStreet:

In late July, Western agreed to a deal requiring Toshiba to give Western two weeks' notice prior to the closing of any Toshiba Memory sale, a move that allowed Toshiba to continue sale talks while still giving Western time to legally respond to any deal it didn't approve of. A couple weeks later, Western obtained an injunction requiring Toshiba to prevent "certain employees" from accessing databases shared by the company and SanDisk, and also from "refusing to ship certain engineering [chip] wafers and samples" from Toshiba Memory plants that the JVs rely on. This, Western says, will let the JVs continue running smoothly.

The strength of Western's legal claims, together with the financial woes faced by Toshiba thanks to the billions in losses incurred by its Westinghouse nuclear plant unit, undoubtedly place a lot of pressure on Toshiba to make peace with Western. But Western, which once signaled it wanted a majority stake in Toshiba Memory, seems to be showing flexibility too.

That likely has much to do with how a drawn-out legal battle with Toshiba, one that could hurt the performance of the flash memory JVs and prevent their owners from collaborating on needed investments, isn't in Western's interests either. Especially not when the JVs are operating in a hotly competitive NAND flash market where Samsung, Hynix, Intel Corp. (INTC) - Get Report , Micron Technology Inc.  (MU) - Get Report and Chinese firms are making big investments. Toshiba's early-August declaration that it would spend $1.8 billion to build a new NAND fab without Western/SanDisk's help may have been a negotiating tactic at heart -- Western insisted the JV agreements give it a right to invest in the fab and get a portion of its output -- but did drive home how messy an extended battle could be for Western.

And just as importantly, the long-term decline facing Western's hard drive business as solid-state drives (SSDs) cannibalize sales of PC and "mission-critical" enterprise hard drives. In spite of strong demand for its high-capacity helium drives among cloud giants -- they drove share gains against archrival Seagate Technology PLC (STX) - Get Report  -- Western's total hard drive shipments fell by 800,000 annually in the June quarter to 39.3 million. Hard drive pressures also led Western to guide for September quarter revenue of $5.1 billion -- up 8% annually thanks to a booming NAND market, but below a $5.22 billion consensus.

All of this goes a long way towards explaining why Western's shares have risen over 7% since the first report pointing to a possible detente with Toshiba arrived on August 21. Obtaining a sub-20% stake in Toshiba Memory might fall short of Western's original goals, but it would still grow the company's flash exposure and give it a larger say in what the Toshiba/Western flash JVs end up doing. And it would put to rest a bitter dispute that has created a lot of worries about SanDisk's long-term performance.