Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1870280ybc; Wed, 20 Nov 2019 05:30:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzEhfeYJSZTEmXgrng4PSqUdo3/NmpPxvCcV5e58bHrSmjHkby7wpL5DfYl0ztSv4kKPsXm X-Received: by 2002:a5d:448f:: with SMTP id j15mr3263463wrq.70.1574256609575; Wed, 20 Nov 2019 05:30:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574256609; cv=none; d=google.com; s=arc-20160816; b=TsKEbgfkqYKWHaGBw/2BjYSSi53wb0ey7PyAYHjdO9u6VLnIbu+ZyYEeHPnGTg9hZ9 irDZOBmiguj8C6QxvLv2hhnt6d0rUBuv4gKvl2wCWoHTRIy1sYifqed9iWGuI3XAbcsG 6mvPfDtX1wX+N/l2h/8E6/6AISBwiYqbivYy7YI1UTJOW3Ei2HNcaOhvA9wD4B7bHRc1 ITKudQxxtXGyy4dvx+tAWFTI7psC7JeQFSH/XC6E7A0WIRCeH3vHcC0LAGKfhitc4YJZ 2vSpW89XDnEJjRm6nxjCTx78XGCYLDYTx0wN6mYgvmw2lI+lDyuTF+j1kMRdwqb820xY QuaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:to:subject; bh=I7/VllyEbeWnT1Ek/gl2mbGwOww/2q50HR6EX8WhAnU=; b=PFgdV6zcegLN1BSDvXWwmr36ikVrblLZspYGkUKF8lc9CwKW8a4a8ssskwH8vuC89R 3mWUtWSrEWn83hwwihWe6BoLnPoHl73VXPIezXEHFr6kkOCdPksBEGXqEMuGVyt6Gh41 5Cdu14jHqtb60ryrd7ByYHLdIL5eki4BUXm7kQBsLn9WiLfJhxnhy92aNaqukTd6B9Bn Mrf3X0cCRZrdI3rroEluH6gzysAAfcfFpYB39rzKWjieLNjtBH+rkEdITfPzbYunkqy5 S6Rubd8m+CM9VjnfpY7WhZSxl+XCEIDVaQzwLe7gjZOWBKYbxlb9MbKC1UcwAPOTxeUK O23A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w27si18443345eda.296.2019.11.20.05.29.26; Wed, 20 Nov 2019 05:30:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729644AbfKTMPn convert rfc822-to-8bit (ORCPT + 99 others); Wed, 20 Nov 2019 07:15:43 -0500 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:47449 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728251AbfKTMPm (ORCPT ); Wed, 20 Nov 2019 07:15:42 -0500 Received: from [192.168.2.97] (unknown [141.24.207.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id 8368F58007B; Wed, 20 Nov 2019 13:15:39 +0100 (CET) Subject: Re: [PATCH] mt76: use rcu_read_lock_bh in mt76_dma_rx_poll To: Felix Fietkau , linux-wireless@vger.kernel.org References: <20191120114647.88967-1-nbd@nbd.name> <00ba1886-188f-f8f8-07f1-61a89bbdd768@tu-ilmenau.de> From: Markus Theil Autocrypt: addr=markus.theil@tu-ilmenau.de; keydata= mQINBFcopAYBEADBcwd5L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0 1TjzwC4byWLQT+C7yCTk8h9q0NwmCJ5yG7Fe7VUUpA+ZVLyMSt+tSpH8v3n+3I2AKoMAEQEA AYkCJQQYAQoADwUCVyikBgIbDAUJB4YfgAAKCRBt3CLaT/oEE7lZEACgrOxRaCQ7D5Rc4BOA N4VDIQqVch8X3pBE/k/v3UopkgmYnP4RlhegWr4wp2E6Vuyt8nwnZs3WhxQENfMjd5rV3WhG k5ib+pmLvtAht5j8jfP5+UKUTvX1a6oMi98PT8PuQ70oKM7T/KN+RpXIHoz/2Dgde1RQpwKC XWtkU9tBF87fE8FfwuqS6myOfd8zc6fOVV/fxmTXVC8qA7tB+0tOSDHB80GRYwnlumChOtOB Np8ABFWryE2e6mZZnp9Tpd1A74B45z6l445f5BixGLExAOoTJNA2k0JWx79/2Yi+pwTnQMzW QBLa48MnL3DUlVlahz1FZfGbA2U5NARS8iRdUhCaHL0Lph8HxWJwYA5w2afyCCwRD7xFo44V jsCNbqtZ6TrFARJdrbeWQl3RZ4Y+uuvN9mgvttVenAbx5d68IariYtXashucQeIMoqIloHTN sJDaupNm6+A9T3Re5yXmZsrWSxEEEGv1Bh+5DH6vauP0Ng0ebZ4c6jXfgLpPnAUWlV0rnmrJ q9141nbyLRYAhUXxiqajb+Zocp2Am4BF19rBUa1C78ooye9XShhuQvDTB6tZuiYWc24tiyqb IjR1hmG/zg8APhURAv/zUubaf4IA7v5YHVQqAbpUfb6ePlPVJBtVw2CwXFrGwnqDFh82La8D sGZPq8zmOtvOyZtafA== Message-ID: <92a53651-d309-4dfe-b14f-1d6aa63cafe5@tu-ilmenau.de> Date: Wed, 20 Nov 2019 13:15:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 11/20/19 1:03 PM, Felix Fietkau wrote: > On 2019-11-20 12:59, Markus Theil wrote: >> On 11/20/19 12:46 PM, Felix Fietkau wrote: >>> Fixes potential RCU issues and avoids calling ieee80211_rx_napi with softirq >>> enabled. >>> >>> Reported-by: Markus Theil >>> Signed-off-by: Felix Fietkau >>> --- >>> drivers/net/wireless/mediatek/mt76/dma.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c >>> index 6173c80189ba..ed0ee2d4a452 100644 >>> --- a/drivers/net/wireless/mediatek/mt76/dma.c >>> +++ b/drivers/net/wireless/mediatek/mt76/dma.c >>> @@ -528,7 +528,7 @@ mt76_dma_rx_poll(struct napi_struct *napi, int budget) >>> dev = container_of(napi->dev, struct mt76_dev, napi_dev); >>> qid = napi - dev->napi; >>> >>> - rcu_read_lock(); >>> + rcu_read_lock_bh(); >>> >>> do { >>> cur = mt76_dma_rx_process(dev, &dev->q_rx[qid], budget - done); >>> @@ -536,7 +536,7 @@ mt76_dma_rx_poll(struct napi_struct *napi, int budget) >>> done += cur; >>> } while (cur && done < budget); >>> >>> - rcu_read_unlock(); >>> + rcu_read_unlock_bh(); >>> >>> if (done < budget && napi_complete(napi)) >>> dev->drv->rx_poll_complete(dev, qid); >> This patch is incomplete. The same problem exists for usb. I'll send a fix for that. > How so? On usb, it is called from a tasklet already. > > - Felix I've noticed the bug I reported on USB devices. I've only seen that mt76_rx_aggr_reorder_work also accesses mt76_rx_complete. Maybe it only worked for me by accident. Of course, the tasklet should not run in parallel with multiple instances. Markus