From: Boris BREZILLON <b.brezillon@overkiz.com> To: Nicolas Ferre <nicolas.ferre@atmel.com>, Ludovic Desroches <ludovic.desroches@atmel.com>, Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>, Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Mark Brown <broonie@kernel.org> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Boris BREZILLON <b.brezillon@overkiz.com> Subject: [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section Date: Thu, 18 Jul 2013 09:48:40 +0200 [thread overview] Message-ID: <1374133720-27362-1-git-send-email-b.brezillon@overkiz.com> (raw) In-Reply-To: <1374132753-15206-1-git-send-email-b.brezillon@overkiz.com> clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare) may sleep and thus cannot be called in critical section. This patch fix a bug introduced by commit 6f0d94790efe9f4481bbd7c174ef0e9b5e5db7c4 where clk_disable_unprepare was called with user_lock hold. Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com> --- drivers/misc/atmel-ssc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c index f7b90661..e068a76 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -66,14 +66,19 @@ EXPORT_SYMBOL(ssc_request); void ssc_free(struct ssc_device *ssc) { + bool disable_clk = true; + spin_lock(&user_lock); - if (ssc->user) { + if (ssc->user) ssc->user--; - clk_disable_unprepare(ssc->clk); - } else { + else { + disable_clk = false; dev_dbg(&ssc->pdev->dev, "device already free\n"); } spin_unlock(&user_lock); + + if (disable_clk) + clk_disable_unprepare(ssc->clk); } EXPORT_SYMBOL(ssc_free); -- 1.7.9.5
WARNING: multiple messages have this Message-ID (diff)
From: b.brezillon@overkiz.com (Boris BREZILLON) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section Date: Thu, 18 Jul 2013 09:48:40 +0200 [thread overview] Message-ID: <1374133720-27362-1-git-send-email-b.brezillon@overkiz.com> (raw) In-Reply-To: <1374132753-15206-1-git-send-email-b.brezillon@overkiz.com> clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare) may sleep and thus cannot be called in critical section. This patch fix a bug introduced by commit 6f0d94790efe9f4481bbd7c174ef0e9b5e5db7c4 where clk_disable_unprepare was called with user_lock hold. Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com> --- drivers/misc/atmel-ssc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c index f7b90661..e068a76 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -66,14 +66,19 @@ EXPORT_SYMBOL(ssc_request); void ssc_free(struct ssc_device *ssc) { + bool disable_clk = true; + spin_lock(&user_lock); - if (ssc->user) { + if (ssc->user) ssc->user--; - clk_disable_unprepare(ssc->clk); - } else { + else { + disable_clk = false; dev_dbg(&ssc->pdev->dev, "device already free\n"); } spin_unlock(&user_lock); + + if (disable_clk) + clk_disable_unprepare(ssc->clk); } EXPORT_SYMBOL(ssc_free); -- 1.7.9.5
next prev parent reply other threads:[~2013-07-18 7:48 UTC|newest] Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-07-18 7:32 [PATCH v4 0/5] ARM: at91: prepare transition to common clk framework Boris BREZILLON 2013-07-18 7:32 ` Boris BREZILLON 2013-07-18 7:34 ` [PATCH v4 1/5] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare Boris BREZILLON 2013-07-18 7:34 ` Boris BREZILLON 2013-07-18 7:38 ` [PATCH v4 2/5] mmc: atmel-mci: prepare clk before calling enable Boris BREZILLON 2013-07-18 7:38 ` Boris BREZILLON 2013-08-22 9:41 ` boris brezillon 2013-08-22 9:41 ` boris brezillon 2013-08-25 3:18 ` Chris Ball 2013-08-25 3:18 ` Chris Ball 2013-08-25 5:35 ` boris brezillon 2013-08-25 5:35 ` boris brezillon 2013-07-18 7:40 ` [PATCH v4 3/5] at91/avr32/atmel_lcdfb: " Boris BREZILLON 2013-07-18 7:40 ` Boris BREZILLON 2013-07-18 7:40 ` Boris BREZILLON 2013-08-30 7:18 ` Tomi Valkeinen 2013-08-30 7:18 ` Tomi Valkeinen 2013-08-30 7:18 ` Tomi Valkeinen 2013-07-18 7:43 ` [PATCH v4 4/5] USB: gadget: atmel_usba: " Boris BREZILLON 2013-07-18 7:43 ` Boris BREZILLON 2013-07-18 7:48 ` Boris BREZILLON [this message] 2013-07-18 7:48 ` [PATCH v4 5/5] ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section Boris BREZILLON 2013-07-18 9:53 ` Mark Brown 2013-07-18 9:53 ` Mark Brown 2013-07-18 10:21 ` boris brezillon 2013-07-18 10:21 ` boris brezillon 2013-07-18 10:58 ` Mark Brown 2013-07-18 10:58 ` Mark Brown 2013-07-18 11:33 ` boris brezillon 2013-07-18 11:33 ` boris brezillon 2013-07-18 11:25 ` Mark Brown 2013-07-18 11:25 ` Mark Brown 2013-07-18 11:34 ` boris brezillon 2013-07-18 11:34 ` boris brezillon 2013-07-18 7:58 ` [PATCH v4 1/5] ARM: at91/tc/clocksource: replace clk_enable/disable with clk_prepare_enable/disable_unprepare Boris BREZILLON 2013-07-18 7:58 ` Boris BREZILLON 2013-08-21 12:13 ` Nicolas Ferre 2013-08-21 12:13 ` Nicolas Ferre 2013-07-22 17:03 ` [PATCH v4 0/5] ARM: at91: prepare transition to common clk framework Jean-Christophe PLAGNIOL-VILLARD 2013-07-22 17:03 ` Jean-Christophe PLAGNIOL-VILLARD
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=1374133720-27362-1-git-send-email-b.brezillon@overkiz.com \ --to=b.brezillon@overkiz.com \ --cc=arnd@arndb.de \ --cc=broonie@kernel.org \ --cc=gregkh@linuxfoundation.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=ludovic.desroches@atmel.com \ --cc=nicolas.ferre@atmel.com \ --cc=plagnioj@jcrosoft.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.