diff mbox

b43: LP-PHY: Fix reading old mode in the set TX power control routine

Message ID 4A85AD1B.1060008@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Gábor Stefanik Aug. 14, 2009, 6:29 p.m. UTC
Check the mode the hardware is in, not the mode we used the last time.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
Mark, please test if this fixes the TX power control WARN_ON you were seeing.

 drivers/net/wireless/b43/phy_lp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Larry Finger Aug. 14, 2009, 6:44 p.m. UTC | #1
Gábor Stefanik wrote:
> Check the mode the hardware is in, not the mode we used the last time.
> 
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> Mark, please test if this fixes the TX power control WARN_ON you were
> seeing.

It does not fix it here. I'll take a look at the specs.

Larry
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gábor Stefanik Aug. 17, 2009, 7:33 p.m. UTC | #2
2009/8/14 Gábor Stefanik <netrolller.3d@gmail.com>:
> Check the mode the hardware is in, not the mode we used the last time.
>
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> Mark, please test if this fixes the TX power control WARN_ON you were
> seeing.
>
> drivers/net/wireless/b43/phy_lp.c |    4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/phy_lp.c
> b/drivers/net/wireless/b43/phy_lp.c
> index 292ee51..76457f7 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -1015,9 +1015,9 @@ static void lpphy_set_tx_power_control(struct
> b43_wldev *dev,
>        struct b43_phy_lp *lpphy = dev->phy.lp;
>        enum b43_lpphy_txpctl_mode oldmode;
>
> -       oldmode = lpphy->txpctl_mode;
>        lpphy_read_tx_pctl_mode_from_hardware(dev);
> -       if (lpphy->txpctl_mode == mode)
> +       oldmode = lpphy->txpctl_mode;
> +       if (oldmode == mode)
>                return;
>        lpphy->txpctl_mode = mode;
>
> --
> 1.6.2.4
>

John, any news on this one? I can't see it in wireless testing.
John W. Linville Aug. 17, 2009, 7:56 p.m. UTC | #3
On Mon, Aug 17, 2009 at 09:33:06PM +0200, Gábor Stefanik wrote:
> 2009/8/14 Gábor Stefanik <netrolller.3d@gmail.com>:
> > Check the mode the hardware is in, not the mode we used the last time.
> >
> > Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> > ---
> > Mark, please test if this fixes the TX power control WARN_ON you were
> > seeing.
> >
> > drivers/net/wireless/b43/phy_lp.c |    4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/wireless/b43/phy_lp.c
> > b/drivers/net/wireless/b43/phy_lp.c
> > index 292ee51..76457f7 100644
> > --- a/drivers/net/wireless/b43/phy_lp.c
> > +++ b/drivers/net/wireless/b43/phy_lp.c
> > @@ -1015,9 +1015,9 @@ static void lpphy_set_tx_power_control(struct
> > b43_wldev *dev,
> >        struct b43_phy_lp *lpphy = dev->phy.lp;
> >        enum b43_lpphy_txpctl_mode oldmode;
> >
> > -       oldmode = lpphy->txpctl_mode;
> >        lpphy_read_tx_pctl_mode_from_hardware(dev);
> > -       if (lpphy->txpctl_mode == mode)
> > +       oldmode = lpphy->txpctl_mode;
> > +       if (oldmode == mode)
> >                return;
> >        lpphy->txpctl_mode = mode;
> >
> > --
> > 1.6.2.4
> >
> 
> John, any news on this one? I can't see it in wireless testing.

Larry said "It does not fix it here. I'll take a look at the specs"...
Gábor Stefanik Aug. 17, 2009, 8:03 p.m. UTC | #4
2009/8/17 John W. Linville <linville@tuxdriver.com>:
> On Mon, Aug 17, 2009 at 09:33:06PM +0200, Gábor Stefanik wrote:
>> 2009/8/14 Gábor Stefanik <netrolller.3d@gmail.com>:
>> > Check the mode the hardware is in, not the mode we used the last time.
>> >
>> > Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
>> > ---
>> > Mark, please test if this fixes the TX power control WARN_ON you were
>> > seeing.
>> >
>> > drivers/net/wireless/b43/phy_lp.c |    4 ++--
>> > 1 files changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/net/wireless/b43/phy_lp.c
>> > b/drivers/net/wireless/b43/phy_lp.c
>> > index 292ee51..76457f7 100644
>> > --- a/drivers/net/wireless/b43/phy_lp.c
>> > +++ b/drivers/net/wireless/b43/phy_lp.c
>> > @@ -1015,9 +1015,9 @@ static void lpphy_set_tx_power_control(struct
>> > b43_wldev *dev,
>> >        struct b43_phy_lp *lpphy = dev->phy.lp;
>> >        enum b43_lpphy_txpctl_mode oldmode;
>> >
>> > -       oldmode = lpphy->txpctl_mode;
>> >        lpphy_read_tx_pctl_mode_from_hardware(dev);
>> > -       if (lpphy->txpctl_mode == mode)
>> > +       oldmode = lpphy->txpctl_mode;
>> > +       if (oldmode == mode)
>> >                return;
>> >        lpphy->txpctl_mode = mode;
>> >
>> > --
>> > 1.6.2.4
>> >
>>
>> John, any news on this one? I can't see it in wireless testing.
>
> Larry said "It does not fix it here. I'll take a look at the specs"...

It did not fix the warning, but it is nevertheless a legitimate fix.
(I found this bug when I was looking for the source of the WARN_ON -
this is not the source of the WARN_ON, but still a bug.)

>
> --
> John W. Linville                Someday the world will need a hero, and you
> linville@tuxdriver.com                  might be all we have.  Be ready.
>
Larry Finger Aug. 17, 2009, 9:18 p.m. UTC | #5
Gábor Stefanik wrote:
> 2009/8/17 John W. Linville <linville@tuxdriver.com>:
>> On Mon, Aug 17, 2009 at 09:33:06PM +0200, Gábor Stefanik wrote:
>>> 2009/8/14 Gábor Stefanik <netrolller.3d@gmail.com>:
>>>> Check the mode the hardware is in, not the mode we used the last time.
>>>>
>>>> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
>>>> ---
>>>> Mark, please test if this fixes the TX power control WARN_ON you were
>>>> seeing.
>>>>
>>>> drivers/net/wireless/b43/phy_lp.c |    4 ++--
>>>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/net/wireless/b43/phy_lp.c
>>>> b/drivers/net/wireless/b43/phy_lp.c
>>>> index 292ee51..76457f7 100644
>>>> --- a/drivers/net/wireless/b43/phy_lp.c
>>>> +++ b/drivers/net/wireless/b43/phy_lp.c
>>>> @@ -1015,9 +1015,9 @@ static void lpphy_set_tx_power_control(struct
>>>> b43_wldev *dev,
>>>>        struct b43_phy_lp *lpphy = dev->phy.lp;
>>>>        enum b43_lpphy_txpctl_mode oldmode;
>>>>
>>>> -       oldmode = lpphy->txpctl_mode;
>>>>        lpphy_read_tx_pctl_mode_from_hardware(dev);
>>>> -       if (lpphy->txpctl_mode == mode)
>>>> +       oldmode = lpphy->txpctl_mode;
>>>> +       if (oldmode == mode)
>>>>                return;
>>>>        lpphy->txpctl_mode = mode;
>>>>
>>>> --
>>>> 1.6.2.4
>>>>
>>> John, any news on this one? I can't see it in wireless testing.
>> Larry said "It does not fix it here. I'll take a look at the specs"...
> 
> It did not fix the warning, but it is nevertheless a legitimate fix.
> (I found this bug when I was looking for the source of the WARN_ON -
> this is not the source of the WARN_ON, but still a bug.)

This patch is OK.

Larry
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 292ee51..76457f7 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -1015,9 +1015,9 @@  static void lpphy_set_tx_power_control(struct b43_wldev *dev,
 	struct b43_phy_lp *lpphy = dev->phy.lp;
 	enum b43_lpphy_txpctl_mode oldmode;
 
-	oldmode = lpphy->txpctl_mode;
 	lpphy_read_tx_pctl_mode_from_hardware(dev);
-	if (lpphy->txpctl_mode == mode)
+	oldmode = lpphy->txpctl_mode;
+	if (oldmode == mode)
 		return;
 	lpphy->txpctl_mode = mode;