From patchwork Thu Mar 23 11:26:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 74012 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2857408wrt; Thu, 23 Mar 2023 04:39:15 -0700 (PDT) X-Google-Smtp-Source: AK7set/mkBg8/xmQfWur1GU2vS7TPyoOyevmOURnCuID6gxnaDOcULHAUoAcYZPc13TvXQLzozVX X-Received: by 2002:a17:907:7050:b0:932:b7ce:27b4 with SMTP id ws16-20020a170907705000b00932b7ce27b4mr9902094ejb.27.1679571555295; Thu, 23 Mar 2023 04:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679571555; cv=none; d=google.com; s=arc-20160816; b=wNgMoYT6yvcBCJwf5+6xtn3/9L2HPvaGv/x8EEkhL/pKz2Ojz7AhBs5VOimHMwd739 x4efsKQna74gdDpwjgPExaPRmKSgtu3h2cGrvtqLbJzmSWpQ9ULDbWiKXebs5OgGDF+5 b9g93GkzNiCZFQVZJCiqmBBNIUk3UWHKiOLQNDbm+9H/iGi5E+Ascv9NMpFUMTkA8cEm 4b2LA2IKvdaX/bBSbjBwrx62AMPm9nxVCAda/3/JwB6RPxmJ+Q+PyNQN9wFUAOCwL/us RMFlrNg2DDfjCG94Fws76yTbqI3WcB4PI1gRyoToXQrrpChN/vgmf1sF0jzFSv7mTRg5 svbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZdgDBuT4R3jYSxR7mPDt2s0ue0mJFKZNVR81FCp1IBk=; b=gAkdpnqZYll8A9keO+EliSJBCUv6++oF91MhpbhZfv6Y5Ze7R+Ix+I9mMby2vBtkBh u5XNDNxAL76NUBln7nAhxPM2+RWQD0EEUu/WXkR/ukmI/4HhkLfqtmiPstMpDUmi1ZZJ CzEPvJckW4sVDxAy0InP6ukS/yHYbm6xTiKREcUnXxQfJIF5312TPKZ3SShH7K6ag8Ai Jn5uIUeBUPny9JlidBMQ6zcGG9t5x39jbCcztq1STqwUist1uThuGk2L9ROlbkOFnPMs tAYad4frLCCLKMsQ45ViexiF2w6dBa2lqji2A+yy03UsOyZeKjyw/420qpwXs4nhty65 xvkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fqAbpCsa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m27-20020a1709060d9b00b008f4625e4c16si17207008eji.577.2023.03.23.04.38.51; Thu, 23 Mar 2023 04:39:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fqAbpCsa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231676AbjCWL1A (ORCPT + 99 others); Thu, 23 Mar 2023 07:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231732AbjCWL0y (ORCPT ); Thu, 23 Mar 2023 07:26:54 -0400 Received: from out-46.mta0.migadu.com (out-46.mta0.migadu.com [IPv6:2001:41d0:1004:224b::2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B88E2E0E0 for ; Thu, 23 Mar 2023 04:26:45 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1679570800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZdgDBuT4R3jYSxR7mPDt2s0ue0mJFKZNVR81FCp1IBk=; b=fqAbpCsaP3fQqEmQ3WmwcgxofDhbTR9Foo+kABFooB5SEWA51oOArpWXh3+E22u+OvTuzl 4kB3mh11+EjwMt/cdDd8+Pd067J8e6UHBti+IDAsg28/AE1lDzENAJz/wauJWfkWbMKTQ+ TCjgMya52bHugLpy5CUatBZ8jTkvmz0= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yan-Hsuan Chuang , Ping-Ke Shih , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org Subject: [PATCH 4/5] wifi: rtw88: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 19:26:12 +0800 Message-Id: <20230323112613.7550-4-cai.huoqing@linux.dev> In-Reply-To: <20230323112613.7550-1-cai.huoqing@linux.dev> References: <20230323112613.7550-1-cai.huoqing@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TO_EQ_FM_DIRECT_MX autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761158422792746455?= X-GMAIL-MSGID: =?utf-8?q?1761158422792746455?= Remove pci_clear_master to simplify the code, the bus-mastering is also cleared in do_pci_disable_device, like this: ./drivers/pci/pci.c:2197 static void do_pci_disable_device(struct pci_dev *dev) { u16 pci_command; pci_read_config_word(dev, PCI_COMMAND, &pci_command); if (pci_command & PCI_COMMAND_MASTER) { pci_command &= ~PCI_COMMAND_MASTER; pci_write_config_word(dev, PCI_COMMAND, pci_command); } pcibios_disable_device(dev); }. And dev->is_busmaster is set to 0 in pci_disable_device. Signed-off-by: Cai Huoqing Reviewed-by: Simon Horman Reviewed-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw88/pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c index b4bd831c9845..60145d2f3e5a 100644 --- a/drivers/net/wireless/realtek/rtw88/pci.c +++ b/drivers/net/wireless/realtek/rtw88/pci.c @@ -1552,7 +1552,6 @@ static int rtw_pci_claim(struct rtw_dev *rtwdev, struct pci_dev *pdev) static void rtw_pci_declaim(struct rtw_dev *rtwdev, struct pci_dev *pdev) { - pci_clear_master(pdev); pci_disable_device(pdev); }