From patchwork Fri Aug 14 18:29:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?G=C3=A1bor_Stefanik?= X-Patchwork-Id: 41479 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7EIToNT012029 for ; Fri, 14 Aug 2009 18:29:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755636AbZHNS3s (ORCPT ); Fri, 14 Aug 2009 14:29:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755344AbZHNS3s (ORCPT ); Fri, 14 Aug 2009 14:29:48 -0400 Received: from mail-bw0-f222.google.com ([209.85.218.222]:60960 "EHLO mail-bw0-f222.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755156AbZHNS3r (ORCPT ); Fri, 14 Aug 2009 14:29:47 -0400 Received: by bwz22 with SMTP id 22so1295212bwz.18 for ; Fri, 14 Aug 2009 11:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=pew8IFygoGJ9KDKC0fiYzklWHzzbIDkxUUcrJsybWiA=; b=iJXc9pXEgihL4x/AVALEZn/c8GIpPKgpLhhNlLO5ncNuR2B0tCYLQKHbtYIlRUrCOL VqkDRTS/tWbqLGZCXF1jheUoqhkk77K28dJNE29H+u8QNCA/UV/CirV2K6HZBGfWggyr DOhCxry2r13oltGHmWEIHTz+MZDyh3GMarW5E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=WQkjSWbLgxaCx4FHv+HfrJZApxaYFmdAcDxf2/cA3O9VUgc5B4t2PX8OlsrHoW1UZi A+iG8gcmZFbI32uBEq6XhOFGk749td8VgvjE6wfIHl92knRBO7szpVwwDy4UfOlVEe7+ 33kADMbPg3HIMV4aiZjdAURDkgg0MasK/rhlw= Received: by 10.103.122.5 with SMTP id z5mr682329mum.11.1250274587836; Fri, 14 Aug 2009 11:29:47 -0700 (PDT) Received: from ?192.168.1.5? (pool-02f2c.externet.hu [88.209.217.43]) by mx.google.com with ESMTPS id u9sm7867766muf.37.2009.08.14.11.29.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 14 Aug 2009 11:29:47 -0700 (PDT) Message-ID: <4A85AD1B.1060008@gmail.com> Date: Fri, 14 Aug 2009 20:29:47 +0200 From: =?UTF-8?B?R8OhYm9yIFN0ZWZhbmlr?= User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: John Linville , Michael Buesch , Larry Finger , Mark Huijgen CC: Broadcom Wireless , linux-wireless Subject: [PATCH] b43: LP-PHY: Fix reading old mode in the set TX power control routine Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Check the mode the hardware is in, not the mode we used the last time. Signed-off-by: Gábor Stefanik --- 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;