Message ID | 20230323090314.22431-7-cai.huoqing@linux.dev |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2801567wrt; Thu, 23 Mar 2023 02:12:40 -0700 (PDT) X-Google-Smtp-Source: AK7set+KjgFWQ3i8qlti1keW9sy261OsDx4Jp9FIQM9YPNnIf2853XpWUu5c8nZ3cKt0d3Onk4DA X-Received: by 2002:a17:903:22c6:b0:19c:ff35:35d1 with SMTP id y6-20020a17090322c600b0019cff3535d1mr7282679plg.6.1679562759774; Thu, 23 Mar 2023 02:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679562759; cv=none; d=google.com; s=arc-20160816; b=X2fMMgwIimTSP3KsDS3aWy3hQ32QgvC9Ygjy3Kf/NJP5qc4Fd4bow4f44LHqK8/vaP QtBiHyxbSksV86LC/cqFo836nvOiZvvWgJjQ+2wdvuN36nV6fLofZdRNqzBAO/DyHVMJ wJNbmovOOjpzv3tz32fF3T9UrYYmJckDxOUX6fRh5+WvvvtDc1ILdTmFkhh7hwT7fuXX d5yQ3SWt4Di162Q4pQJvH4jnZV/o+XDwFE5iSsSv0lcjNGSV9gyZQsd81dvomg0wDFuF Ke9N3Hq5BfGKdlBiaZbBh24AlnMZ8fACKaGwL5aN+WlJ1q8GU/yDfQwfwmakiE7MmTwd GuSg== 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=5nEaPllgZlxaf5JlJz0X6lv294PfQyE1/LsvcdyaxrU=; b=ntuICznhmm5nALCWfAZEVipP1Q9F9tnJb/us8G9AU8hXYuxy4A9ue5KnTNdQDfjz1R ecAUCvPdalrKEkF/dFMxzfblXeQzDT2fu8cucyPfOog5j0VzxnyGETQJ+TJzvkNjzAHA ewk+bNYCNhf5n3uje0UEnngz2gIBDSgUkL99vr9OkrKvihdhbTEIBEgNPIjzysDKGhIY 3tYqdMkkxY98UoXJSfy/4kS6sYwSjCLzf8TCxU4aKbP0vpruox+AkWeofmxtkweexhOO 2MiTTncad15ThWCk1kdKOlBcudi4gMlsBMdx3xkiuuuE5jxQkDevTLXejftFbmOUuF6C veAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="qhKtb/HZ"; 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 w2-20020a170902e88200b001a1dc272022si9150790plg.22.2023.03.23.02.12.27; Thu, 23 Mar 2023 02:12:39 -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="qhKtb/HZ"; 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 S231667AbjCWJFX (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Thu, 23 Mar 2023 05:05:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231315AbjCWJEy (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 23 Mar 2023 05:04:54 -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 1135B1B574 for <linux-kernel@vger.kernel.org>; Thu, 23 Mar 2023 02:04:41 -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=1679562279; 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=5nEaPllgZlxaf5JlJz0X6lv294PfQyE1/LsvcdyaxrU=; b=qhKtb/HZfXNjw65QQis9iDr7t12r8yC3e/GHiq2ISPlR53hm9nC2bBV57WUaDAiLAs978S ZB/Mibd2UwHRqjET0dnaGyZuc+OnYPxpYA6rADKF6JWQivgTJLZ0bKaSnsVXVYAnZdYUoF jeSQxTFo1iuIN6pZglrK93L10B3qGtM= From: Cai Huoqing <cai.huoqing@linux.dev> To: cai.huoqing@linux.dev Cc: Derek Chickles <dchickles@marvell.com>, Satanand Burla <sburla@marvell.com>, Felix Manlunas <fmanlunas@marvell.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Raju Rangoju <rajur@chelsio.com>, Dariusz Marcinkiewicz <reksio@newterm.pl>, Dimitris Michailidis <dmichail@fungible.com>, Yisen Zhuang <yisen.zhuang@huawei.com>, Salil Mehta <salil.mehta@huawei.com>, Saeed Mahameed <saeedm@nvidia.com>, Leon Romanovsky <leon@kernel.org>, "K. Y. Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, Shannon Nelson <shannon.nelson@amd.com>, Brett Creeley <brett.creeley@amd.com>, drivers@pensando.io, Bjorn Helgaas <bhelgaas@google.com>, Jesse Brandeburg <jesse.brandeburg@intel.com>, Guangbin Huang <huangguangbin2@huawei.com>, Jian Shen <shenjian15@huawei.com>, Hao Lan <lanhao@huawei.com>, Jie Wang <wangjie125@huawei.com>, Long Li <longli@microsoft.com>, Jiri Pirko <jiri@resnulli.us>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: [PATCH 7/8] ionic: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 17:03:06 +0800 Message-Id: <20230323090314.22431-7-cai.huoqing@linux.dev> In-Reply-To: <20230323090314.22431-1-cai.huoqing@linux.dev> References: <20230323090314.22431-1-cai.huoqing@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761149200762635758?= X-GMAIL-MSGID: =?utf-8?q?1761149200762635758?= |
Series |
[1/8] net: liquidio: Remove redundant pci_clear_master
|
|
Commit Message
Cai Huoqing
March 23, 2023, 9:03 a.m. UTC
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 <cai.huoqing@linux.dev>
---
drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 1 -
1 file changed, 1 deletion(-)
Comments
On 3/23/23 2:03 AM, Cai Huoqing wrote: > 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 <cai.huoqing@linux.dev> Thanks! sln Acked-by: Shannon Nelson <shannon.nelson@amd.com> > --- > drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c > index e508f8eb43bf..b8678da1cce5 100644 > --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c > +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c > @@ -392,7 +392,6 @@ static void ionic_remove(struct pci_dev *pdev) > ionic_port_reset(ionic); > ionic_reset(ionic); > ionic_dev_teardown(ionic); > - pci_clear_master(pdev); > ionic_unmap_bars(ionic); > pci_release_regions(pdev); > pci_disable_device(pdev); > -- > 2.34.1 >
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index e508f8eb43bf..b8678da1cce5 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -392,7 +392,6 @@ static void ionic_remove(struct pci_dev *pdev) ionic_port_reset(ionic); ionic_reset(ionic); ionic_dev_teardown(ionic); - pci_clear_master(pdev); ionic_unmap_bars(ionic); pci_release_regions(pdev); pci_disable_device(pdev);