* [PATCH] e1000e: fix double release of mutex
@ 2008-12-11 21:58 Jeff Kirsher
2008-12-12 4:31 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Jeff Kirsher @ 2008-12-11 21:58 UTC (permalink / raw)
To: davem, akpm
Cc: frederik.deweerdt, e1000-devel, netdev, jesse.brandeburg,
linux-kernel, stable, tglx, zdenek.kabelac, Jeff Kirsher
During a reset, releasing the swflag after it failed to be acquired would
cause a double unlock of the mutex. Instead, test whether acquisition of
the swflag was successful and if not, do not release the swflag. The reset
must still be done to bring the device to a quiescent state.
This resolves [BUG 12200] BUG: bad unlock balance detected! e1000e
http://bugzilla.kernel.org/show_bug.cgi?id=12200
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000e/ich8lan.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index 92f2ace..f2a5963 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -1939,12 +1939,17 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
ctrl |= E1000_CTRL_PHY_RST;
}
ret_val = e1000_acquire_swflag_ich8lan(hw);
+ /* Whether or not the swflag was acquired, we need to reset the part */
hw_dbg(hw, "Issuing a global reset to ich8lan\n");
ew32(CTRL, (ctrl | E1000_CTRL_RST));
msleep(20);
- /* release the swflag because it is not reset by hardware reset */
- e1000_release_swflag_ich8lan(hw);
+ if (!ret_val) {
+ /* release the swflag because it is not reset by
+ * hardware reset
+ */
+ e1000_release_swflag_ich8lan(hw);
+ }
ret_val = e1000e_get_auto_rd_done(hw);
if (ret_val) {
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] e1000e: fix double release of mutex
2008-12-11 21:58 [PATCH] e1000e: fix double release of mutex Jeff Kirsher
@ 2008-12-12 4:31 ` David Miller
2008-12-12 4:51 ` Jeff Kirsher
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2008-12-12 4:31 UTC (permalink / raw)
To: jeffrey.t.kirsher
Cc: akpm, frederik.deweerdt, e1000-devel, netdev, jesse.brandeburg,
linux-kernel, stable, tglx, zdenek.kabelac
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 11 Dec 2008 13:58:07 -0800
> During a reset, releasing the swflag after it failed to be acquired would
> cause a double unlock of the mutex. Instead, test whether acquisition of
> the swflag was successful and if not, do not release the swflag. The reset
> must still be done to bring the device to a quiescent state.
>
> This resolves [BUG 12200] BUG: bad unlock balance detected! e1000e
> http://bugzilla.kernel.org/show_bug.cgi?id=12200
>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
If we're fixing a regression like this, you should make the
patch against net-2.6, and this one is against net-next-2.6
Please respin this for me, thanks Jeff.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] e1000e: fix double release of mutex
2008-12-12 4:31 ` David Miller
@ 2008-12-12 4:51 ` Jeff Kirsher
0 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2008-12-12 4:51 UTC (permalink / raw)
To: David Miller
Cc: e1000-devel, netdev, jesse.brandeburg, linux-kernel, tglx,
frederik.deweerdt, akpm, zdenek.kabelac, stable
On Thu, Dec 11, 2008 at 8:31 PM, David Miller <davem@davemloft.net> wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Thu, 11 Dec 2008 13:58:07 -0800
>
>> During a reset, releasing the swflag after it failed to be acquired would
>> cause a double unlock of the mutex. Instead, test whether acquisition of
>> the swflag was successful and if not, do not release the swflag. The reset
>> must still be done to bring the device to a quiescent state.
>>
>> This resolves [BUG 12200] BUG: bad unlock balance detected! e1000e
>> http://bugzilla.kernel.org/show_bug.cgi?id=12200
>>
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>
> If we're fixing a regression like this, you should make the
> patch against net-2.6, and this one is against net-next-2.6
>
> Please respin this for me, thanks Jeff.
> --
>
Doh! Sorry Dave. My bad, respinning now.
--
Cheers,
Jeff
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] e1000e: fix double release of mutex
@ 2008-12-12 5:20 Jeff Kirsher
2008-12-12 5:24 ` Jeff Kirsher
2008-12-12 5:28 ` David Miller
0 siblings, 2 replies; 6+ messages in thread
From: Jeff Kirsher @ 2008-12-12 5:20 UTC (permalink / raw)
To: davem; +Cc: netdev, stable, linux-kernel, Jeff Kirsher
During a reset, releasing the swflag after it failed to be acquired would
cause a double unlock of the mutex. Instead, test whether acquisition of
the swflag was successful and if not, do not release the swflag. The reset
must still be done to bring the device to a quiescent state.
This resolves [BUG 12200] BUG: bad unlock balance detected! e1000e
http://bugzilla.kernel.org/show_bug.cgi?id=12200
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000e/ich8lan.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index 523b971..d115a6d 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -1893,12 +1893,17 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
ctrl |= E1000_CTRL_PHY_RST;
}
ret_val = e1000_acquire_swflag_ich8lan(hw);
+ /* Whether or not the swflag was acquired, we need to reset the part */
hw_dbg(hw, "Issuing a global reset to ich8lan");
ew32(CTRL, (ctrl | E1000_CTRL_RST));
msleep(20);
- /* release the swflag because it is not reset by hardware reset */
- e1000_release_swflag_ich8lan(hw);
+ if (!ret_val) {
+ /* release the swflag because it is not reset by
+ * hardware reset
+ */
+ e1000_release_swflag_ich8lan(hw);
+ }
ret_val = e1000e_get_auto_rd_done(hw);
if (ret_val) {
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] e1000e: fix double release of mutex
2008-12-12 5:20 Jeff Kirsher
@ 2008-12-12 5:24 ` Jeff Kirsher
2008-12-12 5:28 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2008-12-12 5:24 UTC (permalink / raw)
To: davem; +Cc: netdev, stable, linux-kernel, Jeff Kirsher
On Thu, Dec 11, 2008 at 9:20 PM, Jeff Kirsher
<jeffrey.t.kirsher@intel.com> wrote:
> During a reset, releasing the swflag after it failed to be acquired would
> cause a double unlock of the mutex. Instead, test whether acquisition of
> the swflag was successful and if not, do not release the swflag. The reset
> must still be done to bring the device to a quiescent state.
>
> This resolves [BUG 12200] BUG: bad unlock balance detected! e1000e
> http://bugzilla.kernel.org/show_bug.cgi?id=12200
>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
>
> drivers/net/e1000e/ich8lan.c | 9 +++++++--
> 1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
> index 523b971..d115a6d 100644
> --- a/drivers/net/e1000e/ich8lan.c
> +++ b/drivers/net/e1000e/ich8lan.c
> @@ -1893,12 +1893,17 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
> ctrl |= E1000_CTRL_PHY_RST;
> }
> ret_val = e1000_acquire_swflag_ich8lan(hw);
> + /* Whether or not the swflag was acquired, we need to reset the part */
> hw_dbg(hw, "Issuing a global reset to ich8lan");
> ew32(CTRL, (ctrl | E1000_CTRL_RST));
> msleep(20);
>
> - /* release the swflag because it is not reset by hardware reset */
> - e1000_release_swflag_ich8lan(hw);
> + if (!ret_val) {
> + /* release the swflag because it is not reset by
> + * hardware reset
> + */
> + e1000_release_swflag_ich8lan(hw);
> + }
>
> ret_val = e1000e_get_auto_rd_done(hw);
> if (ret_val) {
>
> --
>
I meant to put [RESPIN] in the title, but I did not. So here is the respin.
--
Cheers,
Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] e1000e: fix double release of mutex
2008-12-12 5:20 Jeff Kirsher
2008-12-12 5:24 ` Jeff Kirsher
@ 2008-12-12 5:28 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2008-12-12 5:28 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, stable, linux-kernel
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 11 Dec 2008 21:20:26 -0800
> During a reset, releasing the swflag after it failed to be acquired would
> cause a double unlock of the mutex. Instead, test whether acquisition of
> the swflag was successful and if not, do not release the swflag. The reset
> must still be done to bring the device to a quiescent state.
>
> This resolves [BUG 12200] BUG: bad unlock balance detected! e1000e
> http://bugzilla.kernel.org/show_bug.cgi?id=12200
>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied, thanks for respinning this.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-12-12 5:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-11 21:58 [PATCH] e1000e: fix double release of mutex Jeff Kirsher
2008-12-12 4:31 ` David Miller
2008-12-12 4:51 ` Jeff Kirsher
-- strict thread matches above, loose matches on Subject: below --
2008-12-12 5:20 Jeff Kirsher
2008-12-12 5:24 ` Jeff Kirsher
2008-12-12 5:28 ` David Miller
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).