<div dir="ltr"><div dir="ltr">> I would expect the driver to unregister the controller at the start of<br><div>
> the remove function, suspend doesn't really make sense here</div><div><br></div><div>It's strange - But without <span>spi_master_suspend i have randomly stucks when i try unload this module - as was written before</span></div><div><span>i was test it (load/unload module in loop) and for me suspend make sense here</span></div><div><span><br></span></div><div><span>If anybody has another solution - or real problem not here - please write to me the right way!</span></div><div><span><br></span></div><div><span>PS: i have another way for solve this problem (may be it can help us fix problem in kernel)<br></span><div><br></div><div># before unload module need <br></div><div>echo -n spi0.0 > /sys/bus/spi/drivers/spi-nor/unbind</div><div># after unbind driver we can unload module without problem</div>rmmod spi_meson_spifc # can stuck without unbind driver before ...</div><div><span><br></span></div></div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 23, 2021 at 7:48 PM Mark Brown <<a href="mailto:broonie@kernel.org" target="_blank">broonie@kernel.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Apr 23, 2021 at 11:42:47AM +0800, Artem Lapkin wrote:<br>
> Problem: rmmod meson_gx_mmc - not stable without spi_master_suspend call<br>
> and we can get stuck when try unload this module<br>
<br>
> +++ b/drivers/spi/spi-meson-spifc.c<br>
> @@ -359,6 +359,7 @@ static int meson_spifc_remove(struct platform_device *pdev)<br>
> struct spi_master *master = platform_get_drvdata(pdev);<br>
> struct meson_spifc *spifc = spi_master_get_devdata(master);<br>
> <br>
> + spi_master_suspend(master);<br>
> pm_runtime_get_sync(&pdev->dev);<br>
> clk_disable_unprepare(spifc->clk);<br>
> pm_runtime_disable(&pdev->dev);<br>
<br>
I would expect the driver to unregister the controller at the start of<br>
the remove function, suspend doesn't really make sense here.<br>
</blockquote></div>