From patchwork Thu Mar 19 14:32:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Gruszka X-Patchwork-Id: 6050061 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8F32B9F2A9 for ; Thu, 19 Mar 2015 14:36:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CD6F520525 for ; Thu, 19 Mar 2015 14:36:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7720120435 for ; Thu, 19 Mar 2015 14:36:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752892AbbCSOg3 (ORCPT ); Thu, 19 Mar 2015 10:36:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37983 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751475AbbCSOg3 (ORCPT ); Thu, 19 Mar 2015 10:36:29 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2JEaNdE024919 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 19 Mar 2015 10:36:23 -0400 Received: from localhost (dhcp-27-129.brq.redhat.com [10.34.27.129]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2JEaMx3007336; Thu, 19 Mar 2015 10:36:22 -0400 Date: Thu, 19 Mar 2015 15:32:49 +0100 From: Stanislaw Gruszka To: Sebastian Andrzej Siewior Cc: Kalle Valo , linux-wireless@vger.kernel.org, Helmut Schaa Subject: [PATCH] rt2800usb: check Autorun mode on FW load only once Message-ID: <20150319143249.GB2516@redhat.com> References: <1426170946-13918-1-git-send-email-bigeasy@linutronix.de> <20150316160652.789B313FBE6@smtp.codeaurora.org> <20150316164100.GA6208@linutronix.de> <20150317083414.GA1276@linutronix.de> <20150318131124.GA11724@redhat.com> <550ACDF2.30507@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <550ACDF2.30507@linutronix.de> User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Seems H/W report correctly firmware Autorun value only at initialization stage. When we close interface and open it again, Autorun value is 0 and we try to load firmware what kills the device. To fix clear REQUIRE_FIRMWARE firmware flag, to do not load firmware again, once we discover Autorun mode. Reported-and-tested-by: Sebastian Andrzej Siewior Signed-off-by: Stanislaw Gruszka --- drivers/net/wireless/rt2x00/rt2800usb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 9a2f44a..3a6cae8 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c @@ -293,6 +293,7 @@ static int rt2800usb_write_firmware(struct rt2x00_dev *rt2x00dev, if (retval) { rt2x00_info(rt2x00dev, "Firmware loading not required - NIC in AutoRun mode\n"); + __clear_bit(REQUIRE_FIRMWARE, &rt2x00dev->cap_flags); } else { rt2x00usb_register_multiwrite(rt2x00dev, FIRMWARE_IMAGE_BASE, data + offset, length);