-
Notifications
You must be signed in to change notification settings - Fork 8.1k
driver: spi: silabs_siwx91x_gspi: Add pm device support for gspi driver #94373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
driver: spi: silabs_siwx91x_gspi: Add pm device support for gspi driver #94373
Conversation
acb2e26 to
065dc37
Compare
| return ret; | ||
| } | ||
|
|
||
| cfg->reg->GSPI_CONFIG1_b.GSPI_MANUAL_CSN = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about setting the high-performance enable bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked it wasn't affecting the functionality as such
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will affect functionality when operating at high speed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have addressed it.
065dc37 to
7e30b65
Compare
| return ret; | ||
| } | ||
|
|
||
| cfg->reg->GSPI_CONFIG1_b.GSPI_MANUAL_CSN = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will affect functionality when operating at high speed
7e30b65 to
9dd86ee
Compare
e5de48e to
704902a
Compare
704902a to
08f5860
Compare
d40cc0f to
d0e2bd4
Compare
|
03b0e31 to
24e143f
Compare
|
|
||
| if (status >= 0 && status != DMA_STATUS_COMPLETE) { | ||
| return; | ||
| goto pm_put_exit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't want to put the device runtime if the DMA transfer is not completed. in that case, you could turn off the power domain and then killed the working uDMA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
|
|
||
| if (!spi_siwx91x_is_dma_enabled_instance(dev) && asynchronous) { | ||
| ret = -ENOTSUP; | ||
| goto pm_put_exit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you will never call the "pm_device_runtime_put" since you are in the case of an asynchronous transfer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
| if (ret) { | ||
| spi_context_release(&data->ctx, ret); | ||
| return ret; | ||
| goto pm_put_exit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here in the case you are in an asynchronous transfer
24e143f to
dd1fc5e
Compare
dd1fc5e to
cbfa627
Compare
|
Since SPI will use GPDMA instead of uDMA with #97534, I think we need to implement PM in GPDMA driver in order to have PM properly working with SPI. |
| } | ||
|
|
||
| if (!asynchronous) { | ||
| pm_device_runtime_put(dev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm misunderstanding something, this doesn't seem correct to me. If DMA is used for a blocking transfer, won't the runtime_put already have happened in the DMA complete callback? It seems to me like this should be done inside the else above, and not be related to asynchronous at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your correct. It's been addressed now
This commit enables the pm device driver support for the spi_silabs_siwx91x_gspi driver. Signed-off-by: S Mohamed Fiaz <[email protected]>
cbfa627 to
a0af92e
Compare
|
Seems like the raised issue has been addressed



This commit enables the pm device driver support for the spi_silabs_siwx91x_gspi driver.