From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: "David S. Miller" <davem@davemloft.net>
Cc: Matt Carlson <mcarlson@broadcom.com>,
Michael Chan <mchan@broadcom.com>,
netdev@vger.kernel.org, Maxim Levitsky <maximlevitsky@gmail.com>
Subject: [PATCH] tg3: Do not call device_set_wakeup_enable() under spin_lock_bh
Date: Tue, 26 Oct 2010 01:01:55 +0200 [thread overview]
Message-ID: <201010260101.56128.rjw@sisk.pl> (raw)
From: Rafael J. Wysocki <rjw@sisk.pl>
The tg3 driver calls device_set_wakeup_enable() under spin_lock_bh,
which causes a problem to happen after the recent core power
management changes, because this function can sleep now. Fix this
by moving the device_set_wakeup_enable() call out of the
spin_lock_bh-protected area.
Reported-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
Hi,
This fixes a regression from 2.6.36, please apply.
Thanks,
Rafael
---
drivers/net/tg3.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: linux-2.6/drivers/net/tg3.c
===================================================================
--- linux-2.6.orig/drivers/net/tg3.c
+++ linux-2.6/drivers/net/tg3.c
@@ -9732,16 +9732,16 @@ static int tg3_set_wol(struct net_device
!((tp->tg3_flags & TG3_FLAG_WOL_CAP) && device_can_wakeup(dp)))
return -EINVAL;
+ device_set_wakeup_enable(dp, wol->wolopts & WAKE_MAGIC);
+
spin_lock_bh(&tp->lock);
- if (wol->wolopts & WAKE_MAGIC) {
+ if (device_may_wakeup(dp))
tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
- device_set_wakeup_enable(dp, true);
- } else {
+ else
tp->tg3_flags &= ~TG3_FLAG_WOL_ENABLE;
- device_set_wakeup_enable(dp, false);
- }
spin_unlock_bh(&tp->lock);
+
return 0;
}
next reply other threads:[~2010-10-25 23:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-25 23:01 Rafael J. Wysocki [this message]
2010-10-26 18:34 ` [PATCH] tg3: Do not call device_set_wakeup_enable() under spin_lock_bh David Miller
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=201010260101.56128.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=davem@davemloft.net \
--cc=maximlevitsky@gmail.com \
--cc=mcarlson@broadcom.com \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox