* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-23 11:47 ` Mark Brown
0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2021-04-23 11:47 UTC (permalink / raw)
To: Artem Lapkin
Cc: narmstrong, khilman, jbrunet, martin.blumenstingl, dri-devel,
linux-spi, linux-arm-kernel, linux-amlogic, linux-kernel,
christianshewitt, art, nick, gouwa
[-- Attachment #1.1: Type: text/plain, Size: 730 bytes --]
On Fri, Apr 23, 2021 at 11:42:47AM +0800, Artem Lapkin wrote:
> Problem: rmmod meson_gx_mmc - not stable without spi_master_suspend call
> and we can get stuck when try unload this module
> +++ b/drivers/spi/spi-meson-spifc.c
> @@ -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.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-23 11:47 ` Mark Brown
0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2021-04-23 11:47 UTC (permalink / raw)
To: Artem Lapkin
Cc: gouwa, narmstrong, martin.blumenstingl, khilman,
christianshewitt, linux-kernel, dri-devel, linux-spi, nick,
linux-amlogic, art, linux-arm-kernel, jbrunet
[-- Attachment #1.1: Type: text/plain, Size: 730 bytes --]
On Fri, Apr 23, 2021 at 11:42:47AM +0800, Artem Lapkin wrote:
> Problem: rmmod meson_gx_mmc - not stable without spi_master_suspend call
> and we can get stuck when try unload this module
> +++ b/drivers/spi/spi-meson-spifc.c
> @@ -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.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-23 11:47 ` Mark Brown
0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2021-04-23 11:47 UTC (permalink / raw)
To: Artem Lapkin
Cc: narmstrong, khilman, jbrunet, martin.blumenstingl, dri-devel,
linux-spi, linux-arm-kernel, linux-amlogic, linux-kernel,
christianshewitt, art, nick, gouwa
[-- Attachment #1.1: Type: text/plain, Size: 730 bytes --]
On Fri, Apr 23, 2021 at 11:42:47AM +0800, Artem Lapkin wrote:
> Problem: rmmod meson_gx_mmc - not stable without spi_master_suspend call
> and we can get stuck when try unload this module
> +++ b/drivers/spi/spi-meson-spifc.c
> @@ -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.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
2021-04-23 11:47 ` Mark Brown
` (2 preceding siblings ...)
(?)
@ 2021-04-23 23:57 ` Art Nikpal
2021-04-26 11:56 ` Mark Brown
-1 siblings, 1 reply; 25+ messages in thread
From: Art Nikpal @ 2021-04-23 23:57 UTC (permalink / raw)
To: Mark Brown
Cc: Gouwa Wang, Neil Armstrong, Martin Blumenstingl, Kevin Hilman,
Christian Hewitt, linux-kernel, dri-devel, linux-spi, nick,
linux-amlogic, Artem Lapkin, linux-arm-kernel, jbrunet
[-- Attachment #1.1: Type: text/plain, Size: 1578 bytes --]
> 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 ...
On Fri, Apr 23, 2021 at 7:48 PM Mark Brown <broonie@kernel.org> wrote:
> On Fri, Apr 23, 2021 at 11:42:47AM +0800, Artem Lapkin wrote:
> > Problem: rmmod meson_gx_mmc - not stable without spi_master_suspend call
> > and we can get stuck when try unload this module
>
> > +++ b/drivers/spi/spi-meson-spifc.c
> > @@ -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.
>
[-- Attachment #1.2: Type: text/html, Size: 2291 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
2021-04-23 23:57 ` Art Nikpal
2021-04-26 11:56 ` Mark Brown
(?)
@ 2021-04-26 11:56 ` Mark Brown
0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2021-04-26 11:56 UTC (permalink / raw)
To: Art Nikpal
Cc: Neil Armstrong, Kevin Hilman, jbrunet, Martin Blumenstingl,
dri-devel, linux-spi, linux-arm-kernel, linux-amlogic,
linux-kernel, Christian Hewitt, Artem Lapkin, nick, Gouwa Wang
[-- Attachment #1: Type: text/plain, Size: 590 bytes --]
On Sat, Apr 24, 2021 at 07:57:19AM +0800, Art Nikpal wrote:
> > 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!
As I said above unregister the controller at the start of the remove
function.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-26 11:56 ` Mark Brown
0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2021-04-26 11:56 UTC (permalink / raw)
To: Art Nikpal
Cc: Neil Armstrong, Kevin Hilman, jbrunet, Martin Blumenstingl,
dri-devel, linux-spi, linux-arm-kernel, linux-amlogic,
linux-kernel, Christian Hewitt, Artem Lapkin, nick, Gouwa Wang
[-- Attachment #1.1: Type: text/plain, Size: 590 bytes --]
On Sat, Apr 24, 2021 at 07:57:19AM +0800, Art Nikpal wrote:
> > 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!
As I said above unregister the controller at the start of the remove
function.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-26 11:56 ` Mark Brown
0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2021-04-26 11:56 UTC (permalink / raw)
To: Art Nikpal
Cc: Gouwa Wang, Neil Armstrong, Martin Blumenstingl, Kevin Hilman,
Christian Hewitt, linux-kernel, dri-devel, linux-spi, nick,
linux-amlogic, Artem Lapkin, linux-arm-kernel, jbrunet
[-- Attachment #1.1: Type: text/plain, Size: 590 bytes --]
On Sat, Apr 24, 2021 at 07:57:19AM +0800, Art Nikpal wrote:
> > 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!
As I said above unregister the controller at the start of the remove
function.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-26 11:56 ` Mark Brown
0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2021-04-26 11:56 UTC (permalink / raw)
To: Art Nikpal
Cc: Neil Armstrong, Kevin Hilman, jbrunet, Martin Blumenstingl,
dri-devel, linux-spi, linux-arm-kernel, linux-amlogic,
linux-kernel, Christian Hewitt, Artem Lapkin, nick, Gouwa Wang
[-- Attachment #1.1: Type: text/plain, Size: 590 bytes --]
On Sat, Apr 24, 2021 at 07:57:19AM +0800, Art Nikpal wrote:
> > 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!
As I said above unregister the controller at the start of the remove
function.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
2021-04-26 11:56 ` Mark Brown
(?)
(?)
@ 2021-04-30 8:49 ` Art Nikpal
-1 siblings, 0 replies; 25+ messages in thread
From: Art Nikpal @ 2021-04-30 8:49 UTC (permalink / raw)
To: Mark Brown
Cc: Neil Armstrong, Kevin Hilman, jbrunet, Martin Blumenstingl,
dri-devel, linux-spi, linux-arm-kernel, linux-amlogic,
linux-kernel, Christian Hewitt, Artem Lapkin, nick, Gouwa Wang
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
On Mon, Apr 26, 2021 at 7:57 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Sat, Apr 24, 2021 at 07:57:19AM +0800, Art Nikpal wrote:
>
> > > 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!
>
> As I said above unregister the controller at the start of the remove
> function.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-30 8:49 ` Art Nikpal
0 siblings, 0 replies; 25+ messages in thread
From: Art Nikpal @ 2021-04-30 8:49 UTC (permalink / raw)
To: Mark Brown
Cc: Neil Armstrong, Kevin Hilman, jbrunet, Martin Blumenstingl,
dri-devel, linux-spi, linux-arm-kernel, linux-amlogic,
linux-kernel, Christian Hewitt, Artem Lapkin, nick, Gouwa Wang
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
On Mon, Apr 26, 2021 at 7:57 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Sat, Apr 24, 2021 at 07:57:19AM +0800, Art Nikpal wrote:
>
> > > 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!
>
> As I said above unregister the controller at the start of the remove
> function.
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-30 8:49 ` Art Nikpal
0 siblings, 0 replies; 25+ messages in thread
From: Art Nikpal @ 2021-04-30 8:49 UTC (permalink / raw)
To: Mark Brown
Cc: Gouwa Wang, Neil Armstrong, Martin Blumenstingl, Kevin Hilman,
Christian Hewitt, linux-kernel, dri-devel, linux-spi, nick,
linux-amlogic, Artem Lapkin, linux-arm-kernel, jbrunet
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
On Mon, Apr 26, 2021 at 7:57 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Sat, Apr 24, 2021 at 07:57:19AM +0800, Art Nikpal wrote:
>
> > > 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!
>
> As I said above unregister the controller at the start of the remove
> function.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-30 8:49 ` Art Nikpal
0 siblings, 0 replies; 25+ messages in thread
From: Art Nikpal @ 2021-04-30 8:49 UTC (permalink / raw)
To: Mark Brown
Cc: Neil Armstrong, Kevin Hilman, jbrunet, Martin Blumenstingl,
dri-devel, linux-spi, linux-arm-kernel, linux-amlogic,
linux-kernel, Christian Hewitt, Artem Lapkin, nick, Gouwa Wang
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
On Mon, Apr 26, 2021 at 7:57 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Sat, Apr 24, 2021 at 07:57:19AM +0800, Art Nikpal wrote:
>
> > > 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!
>
> As I said above unregister the controller at the start of the remove
> function.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
2021-04-30 8:49 ` Art Nikpal
(?)
(?)
@ 2021-04-30 10:59 ` Mark Brown
-1 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2021-04-30 10:59 UTC (permalink / raw)
To: Art Nikpal
Cc: Neil Armstrong, Kevin Hilman, jbrunet, Martin Blumenstingl,
dri-devel, linux-spi, linux-arm-kernel, linux-amlogic,
linux-kernel, Christian Hewitt, Artem Lapkin, nick, Gouwa Wang
[-- Attachment #1: Type: text/plain, Size: 765 bytes --]
On Fri, Apr 30, 2021 at 04:49:35PM +0800, Art Nikpal wrote:
> 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.
> 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
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-30 10:59 ` Mark Brown
0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2021-04-30 10:59 UTC (permalink / raw)
To: Art Nikpal
Cc: Neil Armstrong, Kevin Hilman, jbrunet, Martin Blumenstingl,
dri-devel, linux-spi, linux-arm-kernel, linux-amlogic,
linux-kernel, Christian Hewitt, Artem Lapkin, nick, Gouwa Wang
[-- Attachment #1.1: Type: text/plain, Size: 765 bytes --]
On Fri, Apr 30, 2021 at 04:49:35PM +0800, Art Nikpal wrote:
> 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.
> 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
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.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-30 10:59 ` Mark Brown
0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2021-04-30 10:59 UTC (permalink / raw)
To: Art Nikpal
Cc: Gouwa Wang, Neil Armstrong, Martin Blumenstingl, Kevin Hilman,
Christian Hewitt, linux-kernel, dri-devel, linux-spi, nick,
linux-amlogic, Artem Lapkin, linux-arm-kernel, jbrunet
[-- Attachment #1.1: Type: text/plain, Size: 765 bytes --]
On Fri, Apr 30, 2021 at 04:49:35PM +0800, Art Nikpal wrote:
> 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.
> 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
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.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-30 10:59 ` Mark Brown
0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2021-04-30 10:59 UTC (permalink / raw)
To: Art Nikpal
Cc: Neil Armstrong, Kevin Hilman, jbrunet, Martin Blumenstingl,
dri-devel, linux-spi, linux-arm-kernel, linux-amlogic,
linux-kernel, Christian Hewitt, Artem Lapkin, nick, Gouwa Wang
[-- Attachment #1.1: Type: text/plain, Size: 765 bytes --]
On Fri, Apr 30, 2021 at 04:49:35PM +0800, Art Nikpal wrote:
> 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.
> 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
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.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
2021-04-23 11:47 ` Mark Brown
(?)
(?)
@ 2021-04-24 0:08 ` Art Nikpal
-1 siblings, 0 replies; 25+ messages in thread
From: Art Nikpal @ 2021-04-24 0:08 UTC (permalink / raw)
To: Mark Brown
Cc: Neil Armstrong, Kevin Hilman, jbrunet, Martin Blumenstingl,
dri-devel, linux-spi, linux-arm-kernel, linux-amlogic,
linux-kernel, Christian Hewitt, Artem Lapkin, nick, Gouwa Wang
> 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 ...
On Fri, Apr 23, 2021 at 7:48 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Fri, Apr 23, 2021 at 11:42:47AM +0800, Artem Lapkin wrote:
> > Problem: rmmod meson_gx_mmc - not stable without spi_master_suspend call
> > and we can get stuck when try unload this module
>
> > +++ b/drivers/spi/spi-meson-spifc.c
> > @@ -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.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-24 0:08 ` Art Nikpal
0 siblings, 0 replies; 25+ messages in thread
From: Art Nikpal @ 2021-04-24 0:08 UTC (permalink / raw)
To: Mark Brown
Cc: Neil Armstrong, Kevin Hilman, jbrunet, Martin Blumenstingl,
dri-devel, linux-spi, linux-arm-kernel, linux-amlogic,
linux-kernel, Christian Hewitt, Artem Lapkin, nick, Gouwa Wang
> 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 ...
On Fri, Apr 23, 2021 at 7:48 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Fri, Apr 23, 2021 at 11:42:47AM +0800, Artem Lapkin wrote:
> > Problem: rmmod meson_gx_mmc - not stable without spi_master_suspend call
> > and we can get stuck when try unload this module
>
> > +++ b/drivers/spi/spi-meson-spifc.c
> > @@ -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.
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-24 0:08 ` Art Nikpal
0 siblings, 0 replies; 25+ messages in thread
From: Art Nikpal @ 2021-04-24 0:08 UTC (permalink / raw)
To: Mark Brown
Cc: Gouwa Wang, Neil Armstrong, Martin Blumenstingl, Kevin Hilman,
Christian Hewitt, linux-kernel, dri-devel, linux-spi, nick,
linux-amlogic, Artem Lapkin, linux-arm-kernel, jbrunet
> 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 ...
On Fri, Apr 23, 2021 at 7:48 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Fri, Apr 23, 2021 at 11:42:47AM +0800, Artem Lapkin wrote:
> > Problem: rmmod meson_gx_mmc - not stable without spi_master_suspend call
> > and we can get stuck when try unload this module
>
> > +++ b/drivers/spi/spi-meson-spifc.c
> > @@ -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.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH] SPI: meson-spifc add missed calls to remove function
@ 2021-04-24 0:08 ` Art Nikpal
0 siblings, 0 replies; 25+ messages in thread
From: Art Nikpal @ 2021-04-24 0:08 UTC (permalink / raw)
To: Mark Brown
Cc: Neil Armstrong, Kevin Hilman, jbrunet, Martin Blumenstingl,
dri-devel, linux-spi, linux-arm-kernel, linux-amlogic,
linux-kernel, Christian Hewitt, Artem Lapkin, nick, Gouwa Wang
> 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 ...
On Fri, Apr 23, 2021 at 7:48 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Fri, Apr 23, 2021 at 11:42:47AM +0800, Artem Lapkin wrote:
> > Problem: rmmod meson_gx_mmc - not stable without spi_master_suspend call
> > and we can get stuck when try unload this module
>
> > +++ b/drivers/spi/spi-meson-spifc.c
> > @@ -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.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 25+ messages in thread