From: "Rafael J. Wysocki" <rjw@sisk.pl> To: linux-sh@vger.kernel.org Cc: Linux PM mailing list <linux-pm@lists.linux-foundation.org>, LKML <linux-kernel@vger.kernel.org>, Magnus Damm <magnus.damm@gmail.com> Subject: [PATCH 2/2] sh-sci / PM: Use power.irq_safe Date: Sat, 20 Aug 2011 19:33:09 +0000 [thread overview] Message-ID: <201108202133.09222.rjw@sisk.pl> (raw) In-Reply-To: <201108202131.19479.rjw@sisk.pl> From: Rafael J. Wysocki <rjw@sisk.pl> Since sci_port_enable() and sci_port_disable() may be run with interrupts off and they execute pm_runtime_get_sync() and pm_runtime_put_sync(), respectively, the SCI device's power.irq_safe flags has to be used to indicate that it is safe to execute runtime PM callbacks for this device with interrupts off. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> --- drivers/tty/serial/sh-sci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) Index: linux/drivers/tty/serial/sh-sci.c =================================--- linux.orig/drivers/tty/serial/sh-sci.c +++ linux/drivers/tty/serial/sh-sci.c @@ -1582,11 +1582,15 @@ static int sci_startup(struct uart_port dev_dbg(port->dev, "%s(%d)\n", __func__, port->line); + pm_runtime_irq_safe(port->dev); + sci_port_enable(s); ret = sci_request_irq(s); - if (unlikely(ret < 0)) + if (unlikely(ret < 0)) { + pm_runtime_irq_unsafe(port->dev); return ret; + } sci_request_dma(port); @@ -1609,6 +1613,8 @@ static void sci_shutdown(struct uart_por sci_free_irq(s); sci_port_disable(s); + + pm_runtime_irq_unsafe(port->dev); } static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps,
WARNING: multiple messages have this Message-ID (diff)
From: "Rafael J. Wysocki" <rjw@sisk.pl> To: linux-sh@vger.kernel.org Cc: Linux PM mailing list <linux-pm@lists.linux-foundation.org>, LKML <linux-kernel@vger.kernel.org>, Magnus Damm <magnus.damm@gmail.com> Subject: [PATCH 2/2] sh-sci / PM: Use power.irq_safe Date: Sat, 20 Aug 2011 21:33:09 +0200 [thread overview] Message-ID: <201108202133.09222.rjw@sisk.pl> (raw) In-Reply-To: <201108202131.19479.rjw@sisk.pl> From: Rafael J. Wysocki <rjw@sisk.pl> Since sci_port_enable() and sci_port_disable() may be run with interrupts off and they execute pm_runtime_get_sync() and pm_runtime_put_sync(), respectively, the SCI device's power.irq_safe flags has to be used to indicate that it is safe to execute runtime PM callbacks for this device with interrupts off. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> --- drivers/tty/serial/sh-sci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) Index: linux/drivers/tty/serial/sh-sci.c =================================================================== --- linux.orig/drivers/tty/serial/sh-sci.c +++ linux/drivers/tty/serial/sh-sci.c @@ -1582,11 +1582,15 @@ static int sci_startup(struct uart_port dev_dbg(port->dev, "%s(%d)\n", __func__, port->line); + pm_runtime_irq_safe(port->dev); + sci_port_enable(s); ret = sci_request_irq(s); - if (unlikely(ret < 0)) + if (unlikely(ret < 0)) { + pm_runtime_irq_unsafe(port->dev); return ret; + } sci_request_dma(port); @@ -1609,6 +1613,8 @@ static void sci_shutdown(struct uart_por sci_free_irq(s); sci_port_disable(s); + + pm_runtime_irq_unsafe(port->dev); } static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps,
next prev parent reply other threads:[~2011-08-20 19:33 UTC|newest] Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-08-20 19:31 [PATCH 0/2] sh-sci / PM: Fix problem with runtime PM callbacks run with interrupts off Rafael J. Wysocki 2011-08-20 19:31 ` Rafael J. Wysocki 2011-08-20 19:32 ` [PATCH 1/2] PM / Runtime: Introduce pm_runtime_irq_unsafe() Rafael J. Wysocki 2011-08-20 19:32 ` Rafael J. Wysocki 2011-08-21 14:55 ` [linux-pm] " Alan Stern 2011-08-21 14:55 ` Alan Stern 2011-08-21 18:09 ` Rafael J. Wysocki 2011-08-21 18:09 ` [linux-pm] " Rafael J. Wysocki 2011-08-21 18:09 ` Rafael J. Wysocki 2011-08-21 14:55 ` Alan Stern 2011-08-20 19:32 ` Rafael J. Wysocki 2011-08-20 19:33 ` Rafael J. Wysocki [this message] 2011-08-20 19:33 ` [PATCH 2/2] sh-sci / PM: Use power.irq_safe Rafael J. Wysocki 2011-08-20 19:33 ` Rafael J. Wysocki 2011-08-21 19:09 ` [PATCH 0/2 v2] sh-sci / PM: Fix problem with runtime PM callbacks run with interrupts off Rafael J. Wysocki 2011-08-21 19:09 ` Rafael J. Wysocki 2011-08-21 19:09 ` Rafael J. Wysocki 2011-08-21 19:10 ` [PATCH 1/2 v2] PM: Change PM subsys_data lock type into spinlock Rafael J. Wysocki 2011-08-21 19:10 ` Rafael J. Wysocki 2011-08-22 6:18 ` [Replacement][PATCH 1/2 v2] PM: Use spinlock instead of mutex in clock management functions Rafael J. Wysocki 2011-08-22 6:18 ` Rafael J. Wysocki 2011-08-22 6:18 ` Rafael J. Wysocki 2011-08-21 19:10 ` [PATCH 1/2 v2] PM: Change PM subsys_data lock type into spinlock Rafael J. Wysocki 2011-08-21 19:11 ` [PATCH 2/2 v2] sh-sci / PM: Use power.irq_safe Rafael J. Wysocki 2011-08-21 19:11 ` Rafael J. Wysocki 2011-08-24 5:33 ` Paul Mundt 2011-08-24 5:33 ` Paul Mundt 2011-08-24 20:52 ` Rafael J. Wysocki 2011-08-24 20:52 ` Rafael J. Wysocki 2011-08-25 1:33 ` Paul Mundt 2011-08-25 1:33 ` Paul Mundt 2011-08-25 1:33 ` Paul Mundt 2011-08-24 20:52 ` Rafael J. Wysocki 2011-08-24 5:33 ` Paul Mundt 2011-08-21 19:11 ` Rafael J. Wysocki
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=201108202133.09222.rjw@sisk.pl \ --to=rjw@sisk.pl \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pm@lists.linux-foundation.org \ --cc=linux-sh@vger.kernel.org \ --cc=magnus.damm@gmail.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.