zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.51k stars 6.44k forks source link

drivers/flash/spi_nor.c wastes time on enter/exit DPD because it rounds up to milliseconds. #78307

Open llt-edyke opened 6 days ago

llt-edyke commented 6 days ago

Is your enhancement proposal related to a problem? Please describe. I'd like my flash operations to be as responsive as possible. The chip I've implemented the spi nor driver for has a 3us enter/exit DPD, but this gets rounded up to one millisecond, which poses a serious hit to performance.

Describe the solution you'd like The sleep time should be implemented using the smallest resolution possible.

Describe alternatives you've considered It would also be helpful to provide a means to signal that multiple flash operations are going to happen sequentially and that there is no need to put the device into DPD until the series of operations is complete.

github-actions[bot] commented 6 days ago

Hi @llt-edyke! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

nordicjm commented 5 days ago

Isn't that exactly what this Kconfig does? https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/flash/Kconfig.nor#L81

llt-edyke commented 5 days ago

Thanks for pointing that out. Didn't see that option in the nrf-sdk fork since it's behind...and that was implemented 2 weeks ago. So, that takes care of the back-to-back issue.

I would still like to see the delay upon DPD exit and before re-entering be in the microsecond range.