Skip to content

Conversation

AnElderlyFox
Copy link
Contributor

Description:
This pull request restores the previous MCUX LPSPI driver to its original location and disables it by default, providing a stable alternative to the new driver.

Problem:
When using the i.MX RT1062 with Winbond W25N01GVZEIG NAND flash on zephyr:main, built with Zephyr SDK 0.17.4, the YAFFS2 filesystem mounts correctly with the new LPSPI driver, but the partition contents appear corrupted: files are displayed as directories, and data cannot be accessed.

Using the old driver resolves the issue, indicating that the new driver can behave unpredictably in some configurations. The problems likely manifest under high driver load, which makes them non-obvious and difficult to reproduce consistently. This unpredictability suggests that fixing or improving the new driver may require significant time.

Providing the old driver as a stable alternative ensures reliable operation during this period and allows users to compare the behavior of both drivers. This backup option is particularly useful for users who want the new features of the Zephyr RTOS but experience issues with the new driver.

Summary of changes:

  • Restore old driver:
    Restores the MCUX LPSPI driver from commit 42511c8 (before relocation to NXP folder). This provides a proven, stable alternative while the new driver matures.

  • Disable by default:
    The old driver is disabled by default to prevent conflicts with SPI_NXP_LPSPI.

How to use old driver:

CONFIG_SPI_NXP_LPSPI=n
CONFIG_SPI_MCUX_LPSPI=y

No changes occur unless the new driver is explicitly disabled and the old driver is enabled via configuration.

Copy link
Member

@decsny decsny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do not want to support and maintain two drivers. If you are having an issue with the current driver that is upstream, then make a bug report.

@AnElderlyFox
Copy link
Contributor Author

@decsny, it’s good that you don’t want to maintain the old driver — those who actually use it will take care of supporting it.

@pdgendt
Copy link
Contributor

pdgendt commented Oct 8, 2025

@decsny, it’s good that you don’t want to maintain the old driver — those who actually use it will take care of supporting it.

You can keep a copy in your downstream project?

@AnElderlyFox
Copy link
Contributor Author

@decsny, it’s good that you don’t want to maintain the old driver — those who actually use it will take care of supporting it.

You can keep a copy in your downstream project?

Yes, I can keep a copy downstream. Similarly, you can develop the new driver outside the main branch. Still, it would be fair to first hear from those who actually rely on the LPSPI driver before discarding the old version.

@decsny
Copy link
Member

decsny commented Oct 8, 2025

@AnElderlyFox it's in everyone's interest if you just make a bug report normally for whatever issue you're having. As far as I know the LPSPI driver in tree is stable and finally is enabling users who could not use LPSPI with Zephyr with the old version that didn't meet the API expectations that you are trying to re-add.

Also, it's not a "new driver", it's a new version of the same driver, that has just been worked on a lot in the last year by a lot of people to the point that it is indeed very different now, because there was tons of different use cases that needed support that the old version didn't allow for. At each point it was tested successful by all the test case available and whenever a bug was found that the test case doesn't catch we add a test case. And even add some test case without a known bug just in case when there was suspicion about missing edge cases of the API, which expose some bugs sometimes on many drivers, not just NXP LPSPI. So if you really want to help, submit a bug report with your use case so we can fix the bug and potentially add more test coverage if something is missing, which would improve all of Zephyr, not just LPSPI.

Similarly, you can develop the new driver outside the main branch.

You are suggesting we maintain and advertise a whole fork of zephyr for the single purpose of providing a SPI driver that actually works for most use cases? No, we put these fixes directly in upstream.

Fixes zephyrproject-rtos#97270.
Revert the old MCUX LPSPI driver to its original location to allow users
to choose which implementation to use. The new driver remains under
development and has shown instability and functional issues in
some configurations. Providing the previous version ensures a stable
and reliable option for users who prefer or require it.
The restored driver was taken from commit
<42511c80bacee5f072fc64b0c9d6dc068005e31b>
(before it was moved to the new location).

Signed-off-by: Isaev Denis <[email protected]>
Disabled the MCUX LPSPI driver by default to avoid conflicts with
the SPI_NXP_LPSPI driver. Added a dependency to ensure that the
MCUX LPSPI driver is not enabled when the new driver is selected.

Signed-off-by: Isaev Denis <[email protected]>
@AnElderlyFox AnElderlyFox force-pushed the revert_mcux_lpspi_driver branch from a989e63 to 6d6bfe8 Compare October 9, 2025 12:28
@zephyrbot zephyrbot requested a review from decsny October 9, 2025 12:30
Copy link

sonarqubecloud bot commented Oct 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants