dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Artem Lapkin <email2tema@gmail.com>
To: narmstrong@baylibre.com
Cc: gouwa@khadas.com, martin.blumenstingl@googlemail.com,
	khilman@baylibre.com, christianshewitt@gmail.com,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-spi@vger.kernel.org, broonie@kernel.org, nick@khadas.com,
	linux-amlogic@lists.infradead.org, art@khadas.com,
	linux-arm-kernel@lists.infradead.org, jbrunet@baylibre.com
Subject: [PATCH] SPI: meson-spifc add missed calls to remove function
Date: Fri, 23 Apr 2021 11:42:47 +0800	[thread overview]
Message-ID: <20210423034247.992052-1-art@khadas.com> (raw)

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 spi
spi_meson_spifc        16384 -1

Solution: just add spi_master_suspend(master) call

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 drivers/spi/spi-meson-spifc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-meson-spifc.c b/drivers/spi/spi-meson-spifc.c
index 8eca6f24c..8a97a6dbf 100644
--- a/drivers/spi/spi-meson-spifc.c
+++ 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);
-- 
2.25.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2021-04-23  3:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23  3:42 Artem Lapkin [this message]
2021-04-23 11:47 ` [PATCH] SPI: meson-spifc add missed calls to remove function Mark Brown
2021-04-23 23:57   ` Art Nikpal
2021-04-26 11:56     ` Mark Brown
2021-04-30  8:49       ` Art Nikpal
2021-04-30 10:59         ` Mark Brown
2021-04-24  0:08   ` Art Nikpal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210423034247.992052-1-art@khadas.com \
    --to=email2tema@gmail.com \
    --cc=art@khadas.com \
    --cc=broonie@kernel.org \
    --cc=christianshewitt@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gouwa@khadas.com \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.com \
    --cc=nick@khadas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).