From patchwork Thu Mar 23 11:26:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 74026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2864591wrt; Thu, 23 Mar 2023 04:58:20 -0700 (PDT) X-Google-Smtp-Source: AK7set8NDFiC2vfl2iHB3kEzQzYBWl1ODMf3nWGP+0yhqk95ugPMIqncOcU5EOMwbDh32g5DLHsT X-Received: by 2002:a05:6a20:80c8:b0:da:dc14:33d with SMTP id d8-20020a056a2080c800b000dadc14033dmr2355135pza.53.1679572700305; Thu, 23 Mar 2023 04:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679572700; cv=none; d=google.com; s=arc-20160816; b=JLK1Pq/3IC5ZU13s7yj+E0HgP/pIR+Wr5H+e6FrtbAfHK1ZY5ZHK4x3WeRk/ujtqLC SvMCpbZnnu6Cc4z4NPYwNIYf77I6MK9psa9CEE7zxNOXFJkmj/cf9SQRxviIlEg6YlxF tTio9eoCW9022Xlzt6h/Ah/WE8j6tOuMtshw9ljgLFSsgwDF1CpWya1+cJn/r3h0bBx+ 6EPTS90lcStTjPOWxAaTyow4U02K1UGnYQ0BoNYQTwrNTesTeDkV6WotRxHXCgx8+jha QgTXsOlSBpxAWsR4K6FrXBY3M/hTsOAHhzyCYkvlkbzz31aIqz6Z5cQxIXljkjvQc1Ol ZaeQ== 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=rGX1VskIO2esd5iCrlayQqCszF4VgpeWWivrdPxtbg4=; b=DICfW20E2rjriFBYjxav8HRRDF96BPuhmyZ1BkROyoKacjdEsAUf0ZpfV8r56/9dQz 7pe2ls6VwytolEf3A/PllajBsAT5lc4wPKL5CW47UGSblwv1B2eBytDEvEZroppyqsO4 HUmY4FpbjKsq/x/1FlbePSlNqF2uB0vhKb8zjzdoR3NBHR7TM8tcIt7SJIGKmCbnKLeb u2Vcw6+Oejo9WjdjzIU+UndGSrtF2sMwxkzdoUD3YddHST+oyANeYmHZ0AM3PqkXa+H7 2Hu8TbmsOD7oQ1j9tCW5UZ9Vggurvh1FcQEr9XUQWT5T6RUV8IrG47DtcE60DEFyrt0c EH4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DEC0eNYJ; 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 f16-20020a63f110000000b0050f8d6d85fcsi3290561pgi.303.2023.03.23.04.58.08; Thu, 23 Mar 2023 04:58:20 -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=DEC0eNYJ; 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 S231460AbjCWL1O (ORCPT + 99 others); Thu, 23 Mar 2023 07:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231754AbjCWL1E (ORCPT ); Thu, 23 Mar 2023 07:27:04 -0400 Received: from out-49.mta0.migadu.com (out-49.mta0.migadu.com [91.218.175.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB7A72E835 for ; Thu, 23 Mar 2023 04:26:50 -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=1679570808; 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=rGX1VskIO2esd5iCrlayQqCszF4VgpeWWivrdPxtbg4=; b=DEC0eNYJuul660lvjxaoeqUvLhH6GgzbdTk1AxcCx2Kj5x96BZHZ6aIIUJVK+sncVZDQbr L9l0JBXZZCm4W/vQB+sibYpvqmQhuHR7E+rRTEisdt4Tig3SaANUsw7ODwTgZtri/miSV/ x9vbQkNC/yn23vno5LmkGylhSwUG/RI= 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 5/5] wifi: rtw89: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 19:26:13 +0800 Message-Id: <20230323112613.7550-5-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?1761159623843224853?= X-GMAIL-MSGID: =?utf-8?q?1761159623843224853?= 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 Acked-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c index ec8bb5f10482..75bd3ac4dd71 100644 --- a/drivers/net/wireless/realtek/rtw89/pci.c +++ b/drivers/net/wireless/realtek/rtw89/pci.c @@ -2694,7 +2694,6 @@ static int rtw89_pci_claim_device(struct rtw89_dev *rtwdev, static void rtw89_pci_declaim_device(struct rtw89_dev *rtwdev, struct pci_dev *pdev) { - pci_clear_master(pdev); pci_disable_device(pdev); }