From patchwork Thu Mar 23 11:26:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 74018 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2863785wrt; Thu, 23 Mar 2023 04:56:20 -0700 (PDT) X-Google-Smtp-Source: AK7set/O+JTmRJPr6p7ioXukvdgNfUe0LgjFoGyi/jOd/RFqO9IF9GlPPwszpJ53dDRnE0uJx9xl X-Received: by 2002:a05:6a20:7a1f:b0:da:4e05:760 with SMTP id t31-20020a056a207a1f00b000da4e050760mr2281127pzh.55.1679572579884; Thu, 23 Mar 2023 04:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679572579; cv=none; d=google.com; s=arc-20160816; b=HWCzMY99OWR7DsrP0+J/JatKkP4J1cthdKPTptxG9NhVEOuVdm8X/AS3sAVqTVwTlB bMcePH68015wR6R9iQKKDi9h6dTkzw7aHgV1VzF1kccXTOVdT3xBGNOCiykImh309vWh ArkEXnsflCOhUBDCDDK4GrkR8KMnlHkJpLyDK61EVMfHZjpWr7DlIdCkopVfnY6Rk2Id ttGI4xH1kVCv1WrHQwkiPgqDKV4C5om4lxkv9ipcd/eDhKV+v7LNt9uh3e88KOwKDzv8 m3Z0X2gT4u7OfpNUsNPFRKlRtfajVPlWoCUf51D20RZNhUFC9sp1aC306BBgOH3OlAmU k0vg== 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=OTUWX3aTLswoFCHtkP0zXcRP9Ge0kmAhVIeOjF5/rGc=; b=q7o2OkEDbBzrM8SkGe2S6XNff8Q9e5UtIiTCneBShyMZKg+2v2fA8DgupQn/WyhNRF bE47SSEIFJBbdrYCn+qHp/exp1gphPx+EGEvnNfgQhOrG6lt54Y886WekTK69O0FTVof lllLjUtS2LJUxIpvbjIxC8WQQLEjxZi9nTMdoFVVHfRo305HAi9cjklKwILQiX9XUMaI O/Y/6mhU88CxIeGLQbLYyo791UObVS9LkvSl5+jlWhJ1u/Yc+/I1+jp4SI9FyMa+eYHg XaeOzJeNtaBFoSyjh4IfsQo/faAREdGi1LaCFO1iShcg/HlWCeOwYnwhE7yLvXKmvQAr r0NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=tGiiSgjv; 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 s35-20020a056a0017a300b0062624d7193dsi20189291pfg.70.2023.03.23.04.56.07; Thu, 23 Mar 2023 04:56:19 -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=tGiiSgjv; 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 S231629AbjCWL0n (ORCPT + 99 others); Thu, 23 Mar 2023 07:26:43 -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 S231573AbjCWL0k (ORCPT ); Thu, 23 Mar 2023 07:26:40 -0400 Received: from out-29.mta1.migadu.com (out-29.mta1.migadu.com [95.215.58.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39FC02DE63 for ; Thu, 23 Mar 2023 04:26:37 -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=1679570795; 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=OTUWX3aTLswoFCHtkP0zXcRP9Ge0kmAhVIeOjF5/rGc=; b=tGiiSgjvr0b+Z7aAWVjX2r/RSBTRbfF/dareLKLdicHxsBVQ+Zgy38C5/P8Iap3KDd/lpi etzTUrtxWpnsW2G4MBYbkdgMdil/d8miyjYW4eFjJCqX6Xr0L3JGtvmgwYf67neCzmGbMe PGsYNpHJG7jSQRcfAuPzg0tb3MaqB9w= 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 3/5] wifi: ath12k: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 19:26:11 +0800 Message-Id: <20230323112613.7550-3-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?1761159497553935060?= X-GMAIL-MSGID: =?utf-8?q?1761159497553935060?= 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/ath12k/pci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c index d32637b0113d..9ee47caf8485 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -755,14 +755,12 @@ static int ath12k_pci_claim(struct ath12k_pci *ab_pci, struct pci_dev *pdev) if (!ab->mem) { ath12k_err(ab, "failed to map pci bar %d\n", ATH12K_PCI_BAR_NUM); ret = -EIO; - goto clear_master; + goto release_region; } ath12k_dbg(ab, ATH12K_DBG_BOOT, "boot pci_mem 0x%pK\n", ab->mem); return 0; -clear_master: - pci_clear_master(pdev); release_region: pci_release_region(pdev, ATH12K_PCI_BAR_NUM); disable_device: @@ -778,7 +776,6 @@ static void ath12k_pci_free_region(struct ath12k_pci *ab_pci) pci_iounmap(pci_dev, ab->mem); ab->mem = NULL; - pci_clear_master(pci_dev); pci_release_region(pci_dev, ATH12K_PCI_BAR_NUM); if (pci_is_enabled(pci_dev)) pci_disable_device(pci_dev);