From patchwork Thu Mar 23 11:26:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 74016 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2863155wrt; Thu, 23 Mar 2023 04:54:34 -0700 (PDT) X-Google-Smtp-Source: AK7set8Eh+71r5aPZ2ru4h75PSMBOxHcuwssht+O82Gb73w55RrE6zH7D4qelb1HsizU7F1+rDUv X-Received: by 2002:a62:1a52:0:b0:625:975f:525d with SMTP id a79-20020a621a52000000b00625975f525dmr6477001pfa.28.1679572474689; Thu, 23 Mar 2023 04:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679572474; cv=none; d=google.com; s=arc-20160816; b=JJXmlR8MkNw0grlQsV51iIMk2kPJIEPe1BprAuRQ+dyHv8Z5nixu9yfTJdWYAOUQrX D/OdMfw24DN1JKC+YkF2c2vFVgad6W+cd56GlgFRIiajqrB16DqcXBmyjStl/BRKPys1 6+UGLYHf+sYJPF8eu5wfsCKanhAZyXu1IOu9NPrvz1rjv+drgYMgd41+bsY/f84e/rem Amm1ugn8Wujm96F4VT2heZ4KfxTtgnSUQNlTzz4fW2/XxPWk4XB+Uno0IGh0a9QDGY5t B7VedOAT6eO/kxp9Kd/w2jmbd3cSQYegHCqsi6XzQY6U8YkmVxH8FUa9Nw7pW9Adzv4o fejQ== 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=tooTxJ1S3+bY95x8JLOzf8Cr/9M9iNd5ycqcB6CNt6g=; b=qsYD9Cro5IegYHCnIp5SOGmL+DWXIb6D3LDeQvUlBSICP7avrMvRs4CoMEqKQ8EtnJ p/tBGdwqViLGsnZ8/m+izwEaaxtBOHIcZHH5zhqPYE8HSUkk1OG0e+zmMtILKt+Ee7HE Ns1IOHIwOC2VCpPRphB5z9QdNaWqTImivq5PexXtNFI2TnmuUfsHZIyQMzqQ61ecfY72 xvTe5DAcqSjeCqEVtD23ARx06tFiFa4ooewd/srmQQy8hZGp447yLkL5p1iYZfrxRbc8 ihYyLYpQr+yh31WK7AZA/b2aUgdI1F8xe0xfSJ27dCFmd7lcXU6kvI/hCuUONAwlnf/u 486w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=MPPbcgSR; 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 d10-20020a056a00244a00b006260e021ddesi19016724pfj.175.2023.03.23.04.54.22; Thu, 23 Mar 2023 04:54:34 -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=MPPbcgSR; 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 S231575AbjCWL0k (ORCPT + 99 others); Thu, 23 Mar 2023 07:26:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231473AbjCWL0f (ORCPT ); Thu, 23 Mar 2023 07:26:35 -0400 Received: from out-37.mta0.migadu.com (out-37.mta0.migadu.com [91.218.175.37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ADCC2E820 for ; Thu, 23 Mar 2023 04:26:32 -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=1679570789; 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=tooTxJ1S3+bY95x8JLOzf8Cr/9M9iNd5ycqcB6CNt6g=; b=MPPbcgSRYJtn4/oTx7vmZtr+8RpDlRdnN6QgSqBa/GWRXPjE+iDrG+orCzV826kNoxLPEk WALEbdE/Q9zmZ6Wf/cfnOibc5KyJqwOgKHl8pp8J/W1dC2nV6lP4vNajVT+51eSBQxS3v1 paQWnioiLt/iK77rFsMewk9UnlTlWMo= 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 2/5] wifi: ath10k: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 19:26:10 +0800 Message-Id: <20230323112613.7550-2-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?1761159386957371538?= X-GMAIL-MSGID: =?utf-8?q?1761159386957371538?= 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 --- drivers/net/wireless/ath/ath10k/pci.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 728d607289c3..a7f44f6335fb 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -3406,15 +3406,12 @@ static int ath10k_pci_claim(struct ath10k *ar) if (!ar_pci->mem) { ath10k_err(ar, "failed to iomap BAR%d\n", BAR_NUM); ret = -EIO; - goto err_master; + goto err_region; } ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot pci_mem 0x%pK\n", ar_pci->mem); return 0; -err_master: - pci_clear_master(pdev); - err_region: pci_release_region(pdev, BAR_NUM); @@ -3431,7 +3428,6 @@ static void ath10k_pci_release(struct ath10k *ar) pci_iounmap(pdev, ar_pci->mem); pci_release_region(pdev, BAR_NUM); - pci_clear_master(pdev); pci_disable_device(pdev); }