From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] ARM: at91: fix infinite loop in at91_irq_suspend/resume
Date: Wed, 13 Mar 2013 10:21:06 +0100 [thread overview]
Message-ID: <51404502.3070702@atmel.com> (raw)
In-Reply-To: <20130308155828.GC4590@game.jcrosoft.org>
On 03/08/2013 04:58 PM, Jean-Christophe PLAGNIOL-VILLARD :
> On 16:13 Fri 08 Mar , ludovic.desroches at atmel.com wrote:
>> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>>
>> Fix an infinite loop when suspending or resuming a device with AIC5 i.e. SAMA5
>> devices.
>>
>> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
I think that we can queue this one for "fixes".
I integrated it in at91-3.9-fixes branch. It means that you can drop
this one from your patch series.
Thanks, best regards.
>
> Best Regards,
> J.
>> ---
>> arch/arm/mach-at91/irq.c | 20 ++++++++------------
>> 1 file changed, 8 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/arm/mach-at91/irq.c b/arch/arm/mach-at91/irq.c
>> index 8e21026..e0ca591 100644
>> --- a/arch/arm/mach-at91/irq.c
>> +++ b/arch/arm/mach-at91/irq.c
>> @@ -92,23 +92,21 @@ static int at91_aic_set_wake(struct irq_data *d, unsigned value)
>>
>> void at91_irq_suspend(void)
>> {
>> - int i = 0, bit;
>> + int bit = -1;
>>
>> if (has_aic5()) {
>> /* disable enabled irqs */
>> - while ((bit = find_next_bit(backups, n_irqs, i)) < n_irqs) {
>> + while ((bit = find_next_bit(backups, n_irqs, bit + 1)) < n_irqs) {
>> at91_aic_write(AT91_AIC5_SSR,
>> bit & AT91_AIC5_INTSEL_MSK);
>> at91_aic_write(AT91_AIC5_IDCR, 1);
>> - i = bit;
>> }
>> /* enable wakeup irqs */
>> - i = 0;
>> - while ((bit = find_next_bit(wakeups, n_irqs, i)) < n_irqs) {
>> + bit = -1;
>> + while ((bit = find_next_bit(wakeups, n_irqs, bit + 1)) < n_irqs) {
>> at91_aic_write(AT91_AIC5_SSR,
>> bit & AT91_AIC5_INTSEL_MSK);
>> at91_aic_write(AT91_AIC5_IECR, 1);
>> - i = bit;
>> }
>> } else {
>> at91_aic_write(AT91_AIC_IDCR, *backups);
>> @@ -118,23 +116,21 @@ void at91_irq_suspend(void)
>>
>> void at91_irq_resume(void)
>> {
>> - int i = 0, bit;
>> + int bit = -1;
>>
>> if (has_aic5()) {
>> /* disable wakeup irqs */
>> - while ((bit = find_next_bit(wakeups, n_irqs, i)) < n_irqs) {
>> + while ((bit = find_next_bit(wakeups, n_irqs, bit + 1)) < n_irqs) {
>> at91_aic_write(AT91_AIC5_SSR,
>> bit & AT91_AIC5_INTSEL_MSK);
>> at91_aic_write(AT91_AIC5_IDCR, 1);
>> - i = bit;
>> }
>> /* enable irqs disabled for suspend */
>> - i = 0;
>> - while ((bit = find_next_bit(backups, n_irqs, i)) < n_irqs) {
>> + bit = -1;
>> + while ((bit = find_next_bit(backups, n_irqs, bit + 1)) < n_irqs) {
>> at91_aic_write(AT91_AIC5_SSR,
>> bit & AT91_AIC5_INTSEL_MSK);
>> at91_aic_write(AT91_AIC5_IECR, 1);
>> - i = bit;
>> }
>> } else {
>> at91_aic_write(AT91_AIC_IDCR, *wakeups);
>> --
>> 1.7.11.3
>>
>
>
--
Nicolas Ferre
next prev parent reply other threads:[~2013-03-13 9:21 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-08 15:13 [PATCH 0/4] SAMA5D3 support ludovic.desroches at atmel.com
2013-03-08 15:13 ` [PATCH 1/4] ARM: at91: add AT91_SAM9_TIME entry to select at91sam926x_time.c compilation ludovic.desroches at atmel.com
2013-03-08 15:13 ` [PATCH 2/4] ARM: at91: introduce the core type choice to split ARMv4/5 and ARMv7 arch ludovic.desroches at atmel.com
2013-03-08 15:58 ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 15:13 ` [PATCH 3/4] ARM: at91: fix infinite loop in at91_irq_suspend/resume ludovic.desroches at atmel.com
2013-03-08 15:58 ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-13 9:21 ` Nicolas Ferre [this message]
2013-03-08 15:13 ` [PATCH 4/4] ARM: at91: introduce SAMA5 support ludovic.desroches at atmel.com
2013-03-08 16:40 ` Joachim Eastwood
2013-03-08 16:52 ` Ludovic Desroches
[not found] ` <513a1756.e94aec0a.1f22.6694SMTPIN_ADDED_BROKEN@mx.google.com>
2013-03-08 17:18 ` Joachim Eastwood
2013-03-08 18:56 ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 21:27 ` Joachim Eastwood
2013-03-11 12:35 ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-13 14:35 ` Nicolas Ferre
2013-03-08 18:00 ` [PATCH 0/4] SAMA5D3 support Robert Nelson
2013-03-11 11:15 ` Ludovic Desroches
[not found] ` <513dbd6d.c99d2a0a.2f58.ffff9ac2SMTPIN_ADDED_BROKEN@mx.google.com>
2013-03-11 15:01 ` Robert Nelson
2013-03-11 11:19 ` [PATCH] ARM: at91: change name template in AT91_SOC_START macro ludovic.desroches at atmel.com
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=51404502.3070702@atmel.com \
--to=nicolas.ferre@atmel.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 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.