From patchwork Tue Apr 4 06:18:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 96691 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp48338qgd; Mon, 3 Apr 2017 23:18:34 -0700 (PDT) X-Received: by 10.98.137.68 with SMTP id v65mr7409606pfd.125.1491286714485; Mon, 03 Apr 2017 23:18:34 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si746909pgf.57.2017.04.03.23.18.34; Mon, 03 Apr 2017 23:18:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752534AbdDDGSd (ORCPT + 6 others); Tue, 4 Apr 2017 02:18:33 -0400 Received: from mail-pg0-f49.google.com ([74.125.83.49]:36157 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752498AbdDDGSd (ORCPT ); Tue, 4 Apr 2017 02:18:33 -0400 Received: by mail-pg0-f49.google.com with SMTP id g2so140818313pge.3 for ; Mon, 03 Apr 2017 23:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PCYY+IhJASKbsIhTOvS70uMqhXXK8MAsIpBq+FYE6VI=; b=C+x/Onf5pzq4vuUOHynx9IpYnKK/AYlFeLXGwzZiubXRub07LUe+S7/WdoziF1yWt0 +f5D5awZlCZGd6ZRolEdWAWXVSPgS3LkcjHjYmXyqc8U56aEhKQJx6ndB8rSXSxi7MAt RnQaWZ6trK0TmbWFR/AQ5HIyCvV/txAM/BRuc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PCYY+IhJASKbsIhTOvS70uMqhXXK8MAsIpBq+FYE6VI=; b=q/wpqib7/BxLKcGxFgj+OsAe+XaG7e9jYExuDJvpJMuE//GwmFp++CbfpEGSc3/cd/ UMf/9mexR7/T0R8iJOSYGKVaLERCQMB8vCGbIg8Mm3vm8qD9CYDjhZX4yWiRr7KmqDDV eeHmQR3Vcx7PaaaiMO3Wv4xcrnIa08jj0piUy/wHSLwl+JgNZ4PXq9a1Wztaiy/Et3Of PeRVayE1J2R66AX882vJlsq2dXgfnqnRK0ptJKRDRfhFR3bd+XSvUwMO9fQ39fPXm1az /nsHiovOJPf9M0KkH5jR1EgBTXOt+IBbe/uuP0xyIdXwR9r6Esm7pPAM0HkzubavmJjS qJVg== X-Gm-Message-State: AFeK/H2gOgsAvzZtNlSJOPHN2K4LxKFdmZ54bEVhet9cjU1MOIDJlXGIU3SynRrEAiQF6btc X-Received: by 10.84.233.205 with SMTP id m13mr26568162pln.92.1491286712495; Mon, 03 Apr 2017 23:18:32 -0700 (PDT) Received: from localhost.localdomain ([106.51.240.246]) by smtp.gmail.com with ESMTPSA id m20sm29331500pgd.32.2017.04.03.23.18.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Apr 2017 23:18:32 -0700 (PDT) From: Amit Pundir To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Stanislaw Gruszka , Vishal Thanki , Kalle Valo Subject: [PATCH 29/33] rt2x00usb: do not anchor rx and tx urb's Date: Tue, 4 Apr 2017 11:48:08 +0530 Message-Id: <1491286688-31314-10-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491286688-31314-1-git-send-email-amit.pundir@linaro.org> References: <1491286688-31314-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Stanislaw Gruszka We might kill TX or RX urb during rt2x00usb_flush_entry(), what can cause anchor list corruption like shown below: [ 2074.035633] WARNING: CPU: 2 PID: 14480 at lib/list_debug.c:33 __list_add+0xac/0xc0 [ 2074.035634] list_add corruption. prev->next should be next (ffff88020f362c28), but was dead000000000100. (prev=ffff8801d161bb70). [ 2074.035670] Call Trace: [ 2074.035672] [] dump_stack+0x63/0x8c [ 2074.035674] [] __warn+0xd1/0xf0 [ 2074.035676] [] warn_slowpath_fmt+0x5f/0x80 [ 2074.035678] [] ? rt2x00usb_register_write_lock+0x3d/0x60 [rt2800usb] [ 2074.035679] [] __list_add+0xac/0xc0 [ 2074.035681] [] usb_anchor_urb+0x4c/0xa0 [ 2074.035683] [] rt2x00usb_kick_rx_entry+0xaf/0x100 [rt2x00usb] [ 2074.035684] [] rt2x00usb_clear_entry+0x22/0x30 [rt2x00usb] To fix do not anchor TX and RX urb's, it is not needed as during shutdown we kill those urbs in rt2x00usb_free_entries(). Cc: Vishal Thanki Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB") Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo (cherry picked from commit 93c7018ec16bb83399dd4db61c361a6d6aba0d5a) Signed-off-by: Amit Pundir --- drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 4 ---- 1 file changed, 4 deletions(-) -- 2.7.4 diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c index 6005e14..efe2501 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c @@ -319,10 +319,8 @@ static bool rt2x00usb_kick_tx_entry(struct queue_entry *entry, void *data) entry->skb->data, length, rt2x00usb_interrupt_txdone, entry); - usb_anchor_urb(entry_priv->urb, rt2x00dev->anchor); status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC); if (status) { - usb_unanchor_urb(entry_priv->urb); if (status == -ENODEV) clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); set_bit(ENTRY_DATA_IO_FAILED, &entry->flags); @@ -410,10 +408,8 @@ static bool rt2x00usb_kick_rx_entry(struct queue_entry *entry, void *data) entry->skb->data, entry->skb->len, rt2x00usb_interrupt_rxdone, entry); - usb_anchor_urb(entry_priv->urb, rt2x00dev->anchor); status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC); if (status) { - usb_unanchor_urb(entry_priv->urb); if (status == -ENODEV) clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);