From patchwork Fri Apr 24 16:03:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 6271921 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 12774BF4A6 for ; Fri, 24 Apr 2015 16:05:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30071202E5 for ; Fri, 24 Apr 2015 16:05:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 490A120253 for ; Fri, 24 Apr 2015 16:05:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966893AbbDXQEH (ORCPT ); Fri, 24 Apr 2015 12:04:07 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:33458 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964780AbbDXQD6 (ORCPT ); Fri, 24 Apr 2015 12:03:58 -0400 Received: by oblw8 with SMTP id w8so41163810obl.0; Fri, 24 Apr 2015 09:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=lVThqLO2Z+6hm3xO3+Pss0UByPiXzL6uhFfTwFjmzvM=; b=UO2HnmuK6ATMtSspB3KHj/XLCNxI5xnDJkdCvpTCoAIPrE3Y+wE4Fff437b12bVfrW UjdJOeisFhZEwQVJt71PmB/uY0+S63q9xjaHxu2S5vlemDHh3+9oM4r3RoPNsz5whzJq gf4A7sXHRhZNXJKzPKJlAZTGLfIToUUg0oOGQwCZnwWrM8FSsdrwZ5LIapwLkNo5epxi L3BY0KbumOoH7tqofH+U7rkxjHOGk8SEt9nNMPz5FbnZr8dl3YA4GzisbPOib3DvczR1 WTrQZg4oy6mD8cPo2goNh5lZwOtsuTe0kVIRtm+lWQ7dQ7YRNBBQib1aGFcLA9mcCpyw BB5A== X-Received: by 10.202.60.7 with SMTP id j7mr7569294oia.79.1429891437529; Fri, 24 Apr 2015 09:03:57 -0700 (PDT) Received: from linux.site.site (cpe-72-133-230-77.kc.res.rr.com. [72.133.230.77]) by mx.google.com with ESMTPSA id i6sm6643730oep.4.2015.04.24.09.03.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Apr 2015 09:03:56 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Larry Finger , netdev@vger.kernel.org, Stable , Bernhard Wiedemann , Takashi Iwai Subject: [PATCH for 4.1] rtlwifi: rtl8192cu: Fix kernel deadlock Date: Fri, 24 Apr 2015 11:03:37 -0500 Message-Id: <1429891417-1224-1-git-send-email-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.1.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_BLACK autolearn=ham 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 The USB mini-driver in rtlwifi, which is used by rtl8192cu, issues a call to usb_control_msg() with a timeout value of 0. In some instances where the interface is shutting down, this infinite wait results in a CPU deadlock. A one second timeout fixes this problem without affecting any normal operations. This bug is reported at https://bugzilla.novell.com/show_bug.cgi?id=927786. Reported-by: Bernhard Wiedemann Tested-by: Bernhard Wiedemann Signed-off-by: Larry Finger Cc: Stable Cc: Bernhard Wiedemann Cc: Takashi Iwai --- Kalle, I marked this patch for V4.1, and I hope that timing can be met. Thanks, Larry --- drivers/net/wireless/rtlwifi/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index 46ee956..27cd6ca 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c @@ -126,7 +126,7 @@ static int _usbctrl_vendorreq_sync_read(struct usb_device *udev, u8 request, do { status = usb_control_msg(udev, pipe, request, reqtype, value, - index, pdata, len, 0); /*max. timeout*/ + index, pdata, len, 1000); if (status < 0) { /* firmware download is checksumed, don't retry */ if ((value >= FW_8192C_START_ADDRESS &&