SPI: meson-spifc add missed calls to remove function
Subsystems (2)
PATCH 1/1 SPI: meson-spifc add missed calls to remove function
Problem: rmmod meson_gx_mmc - not stable without spi_master_suspend call and we can get stuck when try unload this module
rmmod meson_gx_mmc
...
[ 421.108614] Deleting MTD partitions on "spi0.0": [ 424.219862] spi_master spi0: Failed to power device: -13
...
lsmod | grep spispi_meson_spifc 16384 -1
Solution: just add spi_master_suspend(master) call
--- drivers/spi/spi-meson-spifc.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-meson-spifc.c +1 -0
@@ -359,6 +359,7 @@ static int meson_spifc_remove(struct platform_device *pdev)struct spi_master *master =platform_get_drvdata (pdev);struct meson_spifc *spifc =spi_master_get_devdata (master); +spi_master_suspend (master);pm_runtime_get_sync (&pdev->dev);clk_disable_unprepare (spifc->clk);pm_runtime_disable (&pdev->dev);
Signature · 1 line
2.25.1
Mark Brown
maintainerdrivers/spi/spi-meson-spifc.c static int meson_spifc_remove(struct platform_device *pdev) · line 365
Quoted 12 lines · Artem Lapkin
Problem: rmmod
meson_gx_mmc- not stable withoutspi_master_suspendcall and we can get stuck when try unload this module+++
b/drivers/spi/spi-meson-spifc.cdrivers/spi/spi-meson-spifc.c +1
-0@@ -359,6 +359,7 @@ static int meson_spifc_remove(struct platform_device *pdev)struct spi_master *master =platform_get_drvdata (pdev);struct meson_spifc *spifc =spi_master_get_devdata (master); +spi_master_suspend (master);pm_runtime_get_sync (&pdev->dev);clk_disable_unprepare (spifc->clk);pm_runtime_disable (&pdev->dev);
I would expect the driver to unregister the controller at the start of the remove function, suspend doesn't really make sense here.
Quoted 2 lines
I would expect the driver to unregister the controller at the start of the remove function, suspend doesn't really make sense here
It's strange - But without spi_master_suspend i have randomly stucks when i try unload this module - as was written before
i was test it (load/unload module in loop) and for me suspend make sense here
If anybody has another solution - or real problem not here - please write to me the right way!
PS: i have another way for solve this problem (may be it can help us fix problem in kernel)
# before unload module need echo -n spi0.0 > /sys/bus/spi/drivers/spi-nor/unbind # after unbind driver we can unload module without problem rmmod spi_meson_spifc # can stuck without unbind driver before ...
Quoted 10 lines · Mark Brown
Review static int meson_spifc_remove(struct platform_device
Quoted 5 lines · Artem Lapkin
Problem: rmmod
meson_gx_mmc- not stable withoutspi_master_suspendcall and we can get stuck when try unload this module+++
b/drivers/spi/spi-meson-spifc.c(quoted diff) +0
-0@@ -359,6 +359,7 @@ static int meson_spifc_remove(struct platform_device*pdev)
Quoted 3 lines
drivers/spi/spi-meson-spifc.c +0
-0struct spi_master *master =platform_get_drvdata (pdev);struct meson_spifc *spifc =spi_master_get_devdata (master);
Quoted 8 lines
drivers/spi/spi-meson-spifc.c static int meson_spifc_remove(struct platform_device *pdev) · line 365
Quoted 4 lines
drivers/spi/spi-meson-spifc.c +1
-0+spi_master_suspend (master);pm_runtime_get_sync (&pdev->dev);clk_disable_unprepare (spifc->clk);pm_runtime_disable (&pdev->dev);I would expect the driver to unregister the controller at the start of the remove function, suspend doesn't really make sense here.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Mark Brown
maintainerQuoted 10 lines · Art Nikpal
Quoted 2 lines
I would expect the driver to unregister the controller at the start of the remove function, suspend doesn't really make sense here
It's strange - But without
spi_master_suspendi have randomly stucks when i try unload this module - as was written before
i was test it (load/unload module in loop) and for me suspend make sense hereIf anybody has another solution - or real problem not here - please write to me the right way!
As I said above unregister the controller at the start of the remove function.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Yep! but
if i try call spi_master_put(master) or spi_unregister_controller(master); it's made Segmentation fault for me
what's wrong - may be somebody can help me
Quoted 16 lines · Mark Brown
Quoted 10 lines · Art Nikpal
Quoted 2 lines
I would expect the driver to unregister the controller at the start of the remove function, suspend doesn't really make sense here
It's strange - But without
spi_master_suspendi have randomly stucks when i try unload this module - as was written before
i was test it (load/unload module in loop) and for me suspend make sense hereIf anybody has another solution - or real problem not here - please write to me the right way!
As I said above unregister the controller at the start of the remove function.
Mark Brown
maintainerQuoted 1 line · Art Nikpal
Yep! but
Please don't top post, reply in line with needed context. This allows readers to readily follow the flow of conversation and understand what you are talking about and also helps ensure that everything in the discussion is being addressed.
Quoted 4 lines
if i try call
spi_master_put(master)orspi_unregister_controller(master); it's made Segmentation fault for mewhat's wrong - may be somebody can help me
Probably something is referencing the controller afer it was freed, I do notice that the current version of the driver uses devm_ to register the controller so you'd end up with a double free unless you either use devm_ when freeing or change to a normal registration.
Quoted 2 lines
I would expect the driver to unregister the controller at the start of the remove function, suspend doesn't really make sense here
It's strange - But without spi_master_suspend i have randomly stucks when i try unload this module - as was written before
i was test it (load/unload module in loop) and for me suspend make sense here
If anybody has another solution - or real problem not here - please help to find the right way!
PS: i have another way for solve this problem (may be it can help us fix problem in kernel)
# before unload module need echo -n spi0.0 > /sys/bus/spi/drivers/spi-nor/unbind # after unbind driver we can unload module without problem rmmod spi_meson_spifc # can stuck without unbind driver before ...
Quoted 10 lines · Mark Brown
Quoted 8 lines · Artem Lapkin
Problem: rmmod
meson_gx_mmc- not stable withoutspi_master_suspendcall and we can get stuck when try unload this module+++
b/drivers/spi/spi-meson-spifc.cdrivers/spi/spi-meson-spifc.c +0
-0@@ -359,6 +359,7 @@ static int meson_spifc_remove(struct platform_device *pdev)struct spi_master *master =platform_get_drvdata (pdev);struct meson_spifc *spifc =spi_master_get_devdata (master);
Quoted 7 lines
drivers/spi/spi-meson-spifc.c static int meson_spifc_remove(struct platform_device *pdev) · line 365
Quoted 4 lines
drivers/spi/spi-meson-spifc.c +1
-0+spi_master_suspend (master);pm_runtime_get_sync (&pdev->dev);clk_disable_unprepare (spifc->clk);pm_runtime_disable (&pdev->dev);I would expect the driver to unregister the controller at the start of the remove function, suspend doesn't really make sense here.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel