From patchwork Sun Aug 2 18:30:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Roskin X-Patchwork-Id: 38783 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 n72IUDhN030299 for ; Sun, 2 Aug 2009 18:30:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884AbZHBSaL (ORCPT ); Sun, 2 Aug 2009 14:30:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751872AbZHBSaK (ORCPT ); Sun, 2 Aug 2009 14:30:10 -0400 Received: from c60.cesmail.net ([216.154.195.49]:33255 "EHLO c60.cesmail.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbZHBSaK (ORCPT ); Sun, 2 Aug 2009 14:30:10 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 02 Aug 2009 14:30:10 -0400 Received: from ct.roinet.com (c-69-141-194-35.hsd1.pa.comcast.net [69.141.194.35]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 0F7D034C6A; Sun, 2 Aug 2009 14:42:19 -0400 (EDT) Subject: [PATCH 1/2] rt61pci: fix module reloading To: linux-wireless@vger.kernel.org, John Linville , users@host1.serialmonkey.com From: Pavel Roskin Date: Sun, 02 Aug 2009 14:30:02 -0400 Message-ID: <20090802183002.16766.4142.stgit@ct.roinet.com> User-Agent: StGit/0.15-rc1-11-g9876 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Unloading rt61pci can leave the device in such state that reloading rt61pci would fail to reinitialize it. Bogus data would be read from the EEPROM and the RF version won't be recognized. It appears that unloading rt61pci with power saving enabled would have such effect. To initialize the device properly, SOFT_RESET_CSR should be set to the same value as rt61pci_config_ps() uses to wake up the device. Signed-off-by: Pavel Roskin Acked-by: Ivo van Doorn --- drivers/net/wireless/rt2x00/rt61pci.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) -- 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 --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index fb95b8c..e20dd74 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c @@ -2601,6 +2601,11 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev) int retval; /* + * Disable power saving. + */ + rt2x00pci_register_write(rt2x00dev, SOFT_RESET_CSR, 0x00000007); + + /* * Allocate eeprom data. */ retval = rt61pci_validate_eeprom(rt2x00dev);