public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 6/8] net: mana: Remove redundant pci_clear_master
Date: Thu, 23 Mar 2023 17:03:05 +0800	[thread overview]
Message-ID: <20230323090314.22431-6-cai.huoqing@linux.dev> (raw)
In-Reply-To: <20230323090314.22431-1-cai.huoqing@linux.dev>

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/microsoft/mana/gdma_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
index f9b8f372ec8a..8f3f78b68592 100644
--- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
+++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
@@ -1439,7 +1439,6 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 release_region:
 	pci_release_regions(pdev);
 disable_dev:
-	pci_clear_master(pdev);
 	pci_disable_device(pdev);
 	dev_err(&pdev->dev, "gdma probe failed: err = %d\n", err);
 	return err;
@@ -1458,7 +1457,6 @@ static void mana_gd_remove(struct pci_dev *pdev)
 	vfree(gc);
 
 	pci_release_regions(pdev);
-	pci_clear_master(pdev);
 	pci_disable_device(pdev);
 }
 
-- 
2.34.1


  parent reply	other threads:[~2023-03-23  9:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23  9:03 [PATCH 1/8] net: liquidio: Remove redundant pci_clear_master Cai Huoqing
2023-03-23  9:03 ` [PATCH 2/8] net: hisilicon: " Cai Huoqing
2023-03-23  9:03 ` [PATCH 3/8] net: cxgb4vf: " Cai Huoqing
2023-03-23  9:03 ` [PATCH 4/8] net/fungible: " Cai Huoqing
2023-03-23 17:24   ` Dimitris Michailidis
2023-03-23  9:03 ` [PATCH 5/8] net/mlx5: " Cai Huoqing
2023-03-23  9:03 ` Cai Huoqing [this message]
2023-03-23  9:03 ` [PATCH 7/8] ionic: " Cai Huoqing
2023-03-23 16:32   ` Shannon Nelson
2023-03-23  9:03 ` [PATCH 8/8] ethernet: ec_bhf: " Cai Huoqing
2023-03-24  9:20 ` [PATCH 1/8] net: liquidio: " patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230323090314.22431-6-cai.huoqing@linux.dev \
    --to=cai.huoqing@linux.dev \
    --cc=bhelgaas@google.com \
    --cc=brett.creeley@amd.com \
    --cc=davem@davemloft.net \
    --cc=dchickles@marvell.com \
    --cc=decui@microsoft.com \
    --cc=dmichail@fungible.com \
    --cc=drivers@pensando.io \
    --cc=edumazet@google.com \
    --cc=fmanlunas@marvell.com \
    --cc=haiyangz@microsoft.com \
    --cc=huangguangbin2@huawei.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=lanhao@huawei.com \
    --cc=leon@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rajur@chelsio.com \
    --cc=reksio@newterm.pl \
    --cc=saeedm@nvidia.com \
    --cc=salil.mehta@huawei.com \
    --cc=sburla@marvell.com \
    --cc=shannon.nelson@amd.com \
    --cc=shenjian15@huawei.com \
    --cc=wangjie125@huawei.com \
    --cc=wei.liu@kernel.org \
    --cc=yisen.zhuang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox