Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1789117ybc; Wed, 20 Nov 2019 04:13:04 -0800 (PST) X-Google-Smtp-Source: APXvYqwelYSSjik9UlKP8kK6Nu5w4eaNJJkxip8jNFMSWkkxbPmlijeHs/nhxIVItsIPIEopXSjB X-Received: by 2002:a17:906:22c9:: with SMTP id q9mr4958012eja.198.1574251983950; Wed, 20 Nov 2019 04:13:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574251983; cv=none; d=google.com; s=arc-20160816; b=WunBkHud7zSjXIBOUoIyBAP2E9shma6exSiV2W8ep5b268RoH1W2qRQCRtqhdjSi+W BshxxMPIQiHpYP+/VpWg8HJDpDoW55CUq4ySMHi0l+FWwI0l+ChZgRvbswlEyobNMjRA U2nZn8+t/k8zf327zWHazP7AiLNxLjtZ2kErMcx6PUZnVFojko9HX6pN8FHz2507t4xe OXa5jumzNPTi6ip4iojJVTbk5ORuSuQFTnaQuPnoLMdfCbMQhFd1oGdjHVHlWgO7QJZY GuiOYPKIziQsw0Y+xAeK/+jmJ58BnFl2kWXNg2pdrnFXpWSiaQCsg/6hviL2XoVu6R4b qGhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vs+jdvwIQor/Cu4wu979kFaF7syA3FMgi9ouPtqV9Aw=; b=a1EjnuN+vMrhNR3E8d9d4DGbCy/XubkwW29t5mOjXtF7jX8V0aGyDoKHXC1ESfPBS+ lPndCdfty8R6NUS6xaqk/bcwcKgOMEmGHvsyVxQTqGqV1LsGl0seef0n19uuOROlYUWC PfMjTpavnA3EAYMaDe8dTikYZ3UupgFBsGQH1toYSv5/Dr9FxXQ5iYPza5dUKrKLSQyo 6pZxQ5WKItb/G8r6TvGrvJ+t9KwGQCBw9ZR0c6sBuadhzYZVDQcmcuiJKGZpDIWDed1L nynZAI+Fs9H/aoDIehs6HJTOP4447tLSFWghXz3YVVKck+9/O6MosqYo1z9nSGHZqVCk 5+fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=NJev6Ggv; 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 u13si16354843eds.75.2019.11.20.04.12.38; Wed, 20 Nov 2019 04:13:03 -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; dkim=fail header.i=@nbd.name header.s=20160729 header.b=NJev6Ggv; 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 S1728308AbfKTLqt (ORCPT + 99 others); Wed, 20 Nov 2019 06:46:49 -0500 Received: from nbd.name ([46.4.11.11]:53566 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727934AbfKTLqt (ORCPT ); Wed, 20 Nov 2019 06:46:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vs+jdvwIQor/Cu4wu979kFaF7syA3FMgi9ouPtqV9Aw=; b=NJev6GgvqDd0bmflvlGSo85Mze rTRHdVKgQElUQeStufpc1I8LviE2riHpf8zSogKRF9Km+MyFbjMzSXRkoR+G7T+Vh4dvzi8KkoFPU 3sp2aKnTFkjusdJeTq5Do/Gw/l02XbuJ23SvyoZLRMar/8COsKNL4wfw3pQX9gmOlGgQ=; Received: from p4ff13fe7.dip0.t-ipconnect.de ([79.241.63.231] helo=maeck.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iXORc-0006fj-7Z; Wed, 20 Nov 2019 12:46:48 +0100 Received: by maeck.local (Postfix, from userid 501) id B886470ED734; Wed, 20 Nov 2019 12:46:47 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: Markus Theil Subject: [PATCH] mt76: use rcu_read_lock_bh in mt76_dma_rx_poll Date: Wed, 20 Nov 2019 12:46:47 +0100 Message-Id: <20191120114647.88967-1-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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); -- 2.24.0