linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] net: liquidio: Remove redundant pci_clear_master
@ 2023-03-23  9:03 Cai Huoqing
  2023-03-23  9:03 ` [PATCH 2/8] net: hisilicon: " Cai Huoqing
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Cai Huoqing @ 2023-03-23  9:03 UTC (permalink / raw)
  To: cai.huoqing
  Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Raju Rangoju,
	Dariusz Marcinkiewicz, Dimitris Michailidis, Yisen Zhuang,
	Salil Mehta, Saeed Mahameed, Leon Romanovsky, K. Y. Srinivasan,
	Haiyang Zhang, Wei Liu, Dexuan Cui, Shannon Nelson,
	Brett Creeley, drivers, Bjorn Helgaas, Jesse Brandeburg,
	Guangbin Huang, Jian Shen, Hao Lan, Jie Wang, Long Li,
	Jiri Pirko, netdev, linux-kernel, linux-rdma, linux-hyperv

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/cavium/liquidio/lio_main.c    | 1 -
 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index fd7c80edb6e8..9bd1d2d7027d 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -1129,7 +1129,6 @@ static void octeon_destroy_resources(struct octeon_device *oct)
 
 		fallthrough;
 	case OCT_DEV_PCI_ENABLE_DONE:
-		pci_clear_master(oct->pci_dev);
 		/* Disable the device, releasing the PCI INT */
 		pci_disable_device(oct->pci_dev);
 
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
index ac196883f07e..e2921aec3da0 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
@@ -577,7 +577,6 @@ static void octeon_destroy_resources(struct octeon_device *oct)
 
 		fallthrough;
 	case OCT_DEV_PCI_ENABLE_DONE:
-		pci_clear_master(oct->pci_dev);
 		/* Disable the device, releasing the PCI INT */
 		pci_disable_device(oct->pci_dev);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/8] net: hisilicon: Remove redundant pci_clear_master
  2023-03-23  9:03 [PATCH 1/8] net: liquidio: Remove redundant pci_clear_master Cai Huoqing
@ 2023-03-23  9:03 ` Cai Huoqing
  2023-03-23  9:03 ` [PATCH 3/8] net: cxgb4vf: " Cai Huoqing
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Cai Huoqing @ 2023-03-23  9:03 UTC (permalink / raw)
  To: cai.huoqing
  Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Raju Rangoju,
	Dariusz Marcinkiewicz, Dimitris Michailidis, Yisen Zhuang,
	Salil Mehta, Saeed Mahameed, Leon Romanovsky, K. Y. Srinivasan,
	Haiyang Zhang, Wei Liu, Dexuan Cui, Shannon Nelson,
	Brett Creeley, drivers, Jesse Brandeburg, Bjorn Helgaas,
	Guangbin Huang, Jian Shen, Hao Lan, Jie Wang, Long Li,
	Jiri Pirko, netdev, linux-kernel, linux-rdma, linux-hyperv

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/hisilicon/hns3/hns3pf/hclge_main.c   | 7 ++-----
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 6 ++----
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 07ad5f35219e..c3851a6e10c0 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -11365,7 +11365,7 @@ static int hclge_pci_init(struct hclge_dev *hdev)
 	if (!hw->hw.io_base) {
 		dev_err(&pdev->dev, "Can't map configuration register space\n");
 		ret = -ENOMEM;
-		goto err_clr_master;
+		goto err_release_regions;
 	}
 
 	ret = hclge_dev_mem_map(hdev);
@@ -11378,8 +11378,7 @@ static int hclge_pci_init(struct hclge_dev *hdev)
 
 err_unmap_io_base:
 	pcim_iounmap(pdev, hdev->hw.hw.io_base);
-err_clr_master:
-	pci_clear_master(pdev);
+err_release_regions:
 	pci_release_regions(pdev);
 err_disable_device:
 	pci_disable_device(pdev);
@@ -11396,7 +11395,6 @@ static void hclge_pci_uninit(struct hclge_dev *hdev)
 
 	pcim_iounmap(pdev, hdev->hw.hw.io_base);
 	pci_free_irq_vectors(pdev);
-	pci_clear_master(pdev);
 	pci_release_mem_regions(pdev);
 	pci_disable_device(pdev);
 }
@@ -11743,7 +11741,6 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
 	hclge_devlink_uninit(hdev);
 err_pci_uninit:
 	pcim_iounmap(pdev, hdev->hw.hw.io_base);
-	pci_clear_master(pdev);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
 out:
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index e84e5be8e59e..f24046250341 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -2598,7 +2598,7 @@ static int hclgevf_pci_init(struct hclgevf_dev *hdev)
 	if (!hw->hw.io_base) {
 		dev_err(&pdev->dev, "can't map configuration register space\n");
 		ret = -ENOMEM;
-		goto err_clr_master;
+		goto err_release_regions;
 	}
 
 	ret = hclgevf_dev_mem_map(hdev);
@@ -2609,8 +2609,7 @@ static int hclgevf_pci_init(struct hclgevf_dev *hdev)
 
 err_unmap_io_base:
 	pci_iounmap(pdev, hdev->hw.hw.io_base);
-err_clr_master:
-	pci_clear_master(pdev);
+err_release_regions:
 	pci_release_regions(pdev);
 err_disable_device:
 	pci_disable_device(pdev);
@@ -2626,7 +2625,6 @@ static void hclgevf_pci_uninit(struct hclgevf_dev *hdev)
 		devm_iounmap(&pdev->dev, hdev->hw.hw.mem_base);
 
 	pci_iounmap(pdev, hdev->hw.hw.io_base);
-	pci_clear_master(pdev);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/8] net: cxgb4vf: Remove redundant pci_clear_master
  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 ` Cai Huoqing
  2023-03-23  9:03 ` [PATCH 4/8] net/fungible: " Cai Huoqing
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Cai Huoqing @ 2023-03-23  9:03 UTC (permalink / raw)
  To: cai.huoqing
  Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Raju Rangoju,
	Dariusz Marcinkiewicz, Dimitris Michailidis, Yisen Zhuang,
	Salil Mehta, Saeed Mahameed, Leon Romanovsky, K. Y. Srinivasan,
	Haiyang Zhang, Wei Liu, Dexuan Cui, Shannon Nelson,
	Brett Creeley, drivers, Jesse Brandeburg, Bjorn Helgaas,
	Guangbin Huang, Jian Shen, Hao Lan, Jie Wang, Long Li,
	Jiri Pirko, netdev, linux-kernel, linux-rdma, linux-hyperv

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/chelsio/cxgb4vf/cxgb4vf_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 63b2bd084130..9ba0864592e8 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -3258,7 +3258,6 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,
 
 err_release_regions:
 	pci_release_regions(pdev);
-	pci_clear_master(pdev);
 
 err_disable_device:
 	pci_disable_device(pdev);
@@ -3338,7 +3337,6 @@ static void cxgb4vf_pci_remove(struct pci_dev *pdev)
 	 * Disable the device and release its PCI resources.
 	 */
 	pci_disable_device(pdev);
-	pci_clear_master(pdev);
 	pci_release_regions(pdev);
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/8] net/fungible: Remove redundant pci_clear_master
  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 ` Cai Huoqing
  2023-03-23 17:24   ` Dimitris Michailidis
  2023-03-23  9:03 ` [PATCH 5/8] net/mlx5: " Cai Huoqing
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: Cai Huoqing @ 2023-03-23  9:03 UTC (permalink / raw)
  To: cai.huoqing
  Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Raju Rangoju,
	Dariusz Marcinkiewicz, Dimitris Michailidis, Yisen Zhuang,
	Salil Mehta, Saeed Mahameed, Leon Romanovsky, K. Y. Srinivasan,
	Haiyang Zhang, Wei Liu, Dexuan Cui, Shannon Nelson,
	Brett Creeley, drivers, Jesse Brandeburg, Bjorn Helgaas,
	Guangbin Huang, Jian Shen, Hao Lan, Jie Wang, Long Li,
	Jiri Pirko, netdev, linux-kernel, linux-rdma, linux-hyperv

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/fungible/funcore/fun_dev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/fungible/funcore/fun_dev.c b/drivers/net/ethernet/fungible/funcore/fun_dev.c
index 3680f83feba2..a7fbd4cd560a 100644
--- a/drivers/net/ethernet/fungible/funcore/fun_dev.c
+++ b/drivers/net/ethernet/fungible/funcore/fun_dev.c
@@ -746,7 +746,6 @@ void fun_dev_disable(struct fun_dev *fdev)
 	bitmap_free(fdev->irq_map);
 	pci_free_irq_vectors(pdev);
 
-	pci_clear_master(pdev);
 	pci_disable_device(pdev);
 
 	fun_unmap_bars(fdev);
@@ -821,7 +820,6 @@ int fun_dev_enable(struct fun_dev *fdev, struct pci_dev *pdev,
 disable_admin:
 	fun_disable_admin_queue(fdev);
 free_irq_mgr:
-	pci_clear_master(pdev);
 	bitmap_free(fdev->irq_map);
 free_irqs:
 	pci_free_irq_vectors(pdev);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/8] net/mlx5: Remove redundant pci_clear_master
  2023-03-23  9:03 [PATCH 1/8] net: liquidio: Remove redundant pci_clear_master Cai Huoqing
                   ` (2 preceding siblings ...)
  2023-03-23  9:03 ` [PATCH 4/8] net/fungible: " Cai Huoqing
@ 2023-03-23  9:03 ` Cai Huoqing
  2023-03-23  9:03 ` [PATCH 6/8] net: mana: " Cai Huoqing
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Cai Huoqing @ 2023-03-23  9:03 UTC (permalink / raw)
  To: cai.huoqing
  Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Raju Rangoju,
	Dariusz Marcinkiewicz, Dimitris Michailidis, Yisen Zhuang,
	Salil Mehta, Saeed Mahameed, Leon Romanovsky, K. Y. Srinivasan,
	Haiyang Zhang, Wei Liu, Dexuan Cui, Shannon Nelson,
	Brett Creeley, drivers, Bjorn Helgaas, Jesse Brandeburg,
	Guangbin Huang, Jian Shen, Hao Lan, Jie Wang, Long Li,
	Jiri Pirko, netdev, linux-kernel, linux-rdma, linux-hyperv

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/mellanox/mlx5/core/main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index d39c3476b6d1..597174ceadc9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -918,7 +918,6 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct pci_dev *pdev,
 	return 0;
 
 err_clr_master:
-	pci_clear_master(dev->pdev);
 	release_bar(dev->pdev);
 err_disable:
 	mlx5_pci_disable_device(dev);
@@ -933,7 +932,6 @@ static void mlx5_pci_close(struct mlx5_core_dev *dev)
 	 */
 	mlx5_drain_health_wq(dev);
 	iounmap(dev->iseg);
-	pci_clear_master(dev->pdev);
 	release_bar(dev->pdev);
 	mlx5_pci_disable_device(dev);
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/8] net: mana: Remove redundant pci_clear_master
  2023-03-23  9:03 [PATCH 1/8] net: liquidio: Remove redundant pci_clear_master Cai Huoqing
                   ` (3 preceding siblings ...)
  2023-03-23  9:03 ` [PATCH 5/8] net/mlx5: " Cai Huoqing
@ 2023-03-23  9:03 ` Cai Huoqing
  2023-03-23  9:03 ` [PATCH 7/8] ionic: " Cai Huoqing
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Cai Huoqing @ 2023-03-23  9:03 UTC (permalink / raw)
  To: cai.huoqing
  Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Raju Rangoju,
	Dariusz Marcinkiewicz, Dimitris Michailidis, Yisen Zhuang,
	Salil Mehta, Saeed Mahameed, Leon Romanovsky, K. Y. Srinivasan,
	Haiyang Zhang, Wei Liu, Dexuan Cui, Shannon Nelson,
	Brett Creeley, drivers, Bjorn Helgaas, Jesse Brandeburg,
	Guangbin Huang, Jian Shen, Hao Lan, Jie Wang, Long Li,
	Jiri Pirko, netdev, linux-kernel, linux-rdma, linux-hyperv

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 7/8] ionic: Remove redundant pci_clear_master
  2023-03-23  9:03 [PATCH 1/8] net: liquidio: Remove redundant pci_clear_master Cai Huoqing
                   ` (4 preceding siblings ...)
  2023-03-23  9:03 ` [PATCH 6/8] net: mana: " Cai Huoqing
@ 2023-03-23  9:03 ` 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
  7 siblings, 1 reply; 11+ messages in thread
From: Cai Huoqing @ 2023-03-23  9:03 UTC (permalink / raw)
  To: cai.huoqing
  Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Raju Rangoju,
	Dariusz Marcinkiewicz, Dimitris Michailidis, Yisen Zhuang,
	Salil Mehta, Saeed Mahameed, Leon Romanovsky, K. Y. Srinivasan,
	Haiyang Zhang, Wei Liu, Dexuan Cui, Shannon Nelson,
	Brett Creeley, drivers, Bjorn Helgaas, Jesse Brandeburg,
	Guangbin Huang, Jian Shen, Hao Lan, Jie Wang, Long Li,
	Jiri Pirko, netdev, linux-kernel, linux-rdma, linux-hyperv

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(-)

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 8/8] ethernet: ec_bhf: Remove redundant pci_clear_master
  2023-03-23  9:03 [PATCH 1/8] net: liquidio: Remove redundant pci_clear_master Cai Huoqing
                   ` (5 preceding siblings ...)
  2023-03-23  9:03 ` [PATCH 7/8] ionic: " Cai Huoqing
@ 2023-03-23  9:03 ` Cai Huoqing
  2023-03-24  9:20 ` [PATCH 1/8] net: liquidio: " patchwork-bot+netdevbpf
  7 siblings, 0 replies; 11+ messages in thread
From: Cai Huoqing @ 2023-03-23  9:03 UTC (permalink / raw)
  To: cai.huoqing
  Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Raju Rangoju,
	Dariusz Marcinkiewicz, Dimitris Michailidis, Yisen Zhuang,
	Salil Mehta, Saeed Mahameed, Leon Romanovsky, K. Y. Srinivasan,
	Haiyang Zhang, Wei Liu, Dexuan Cui, Shannon Nelson,
	Brett Creeley, drivers, Bjorn Helgaas, Jesse Brandeburg,
	Guangbin Huang, Jian Shen, Hao Lan, Jie Wang, Long Li,
	Jiri Pirko, netdev, linux-kernel, linux-rdma, linux-hyperv

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

diff --git a/drivers/net/ethernet/ec_bhf.c b/drivers/net/ethernet/ec_bhf.c
index 46e3a05e9582..c2c5c589a5e3 100644
--- a/drivers/net/ethernet/ec_bhf.c
+++ b/drivers/net/ethernet/ec_bhf.c
@@ -558,7 +558,6 @@ static int ec_bhf_probe(struct pci_dev *dev, const struct pci_device_id *id)
 err_release_regions:
 	pci_release_regions(dev);
 err_disable_dev:
-	pci_clear_master(dev);
 	pci_disable_device(dev);
 
 	return err;
@@ -577,7 +576,6 @@ static void ec_bhf_remove(struct pci_dev *dev)
 	free_netdev(net_dev);
 
 	pci_release_regions(dev);
-	pci_clear_master(dev);
 	pci_disable_device(dev);
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 7/8] ionic: Remove redundant pci_clear_master
  2023-03-23  9:03 ` [PATCH 7/8] ionic: " Cai Huoqing
@ 2023-03-23 16:32   ` Shannon Nelson
  0 siblings, 0 replies; 11+ messages in thread
From: Shannon Nelson @ 2023-03-23 16:32 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Raju Rangoju,
	Dariusz Marcinkiewicz, Dimitris Michailidis, Yisen Zhuang,
	Salil Mehta, Saeed Mahameed, Leon Romanovsky, K. Y. Srinivasan,
	Haiyang Zhang, Wei Liu, Dexuan Cui, Brett Creeley, drivers,
	Bjorn Helgaas, Jesse Brandeburg, Guangbin Huang, Jian Shen,
	Hao Lan, Jie Wang, Long Li, Jiri Pirko, netdev, linux-kernel,
	linux-rdma, linux-hyperv

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
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/8] net/fungible: Remove redundant pci_clear_master
  2023-03-23  9:03 ` [PATCH 4/8] net/fungible: " Cai Huoqing
@ 2023-03-23 17:24   ` Dimitris Michailidis
  0 siblings, 0 replies; 11+ messages in thread
From: Dimitris Michailidis @ 2023-03-23 17:24 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Raju Rangoju,
	Dariusz Marcinkiewicz, Dimitris Michailidis, Yisen Zhuang,
	Salil Mehta, Saeed Mahameed, Leon Romanovsky, K. Y. Srinivasan,
	Haiyang Zhang, Wei Liu, Dexuan Cui, Shannon Nelson,
	Brett Creeley, drivers, Jesse Brandeburg, Bjorn Helgaas,
	Guangbin Huang, Jian Shen, Hao Lan, Jie Wang, Long Li,
	Jiri Pirko, netdev, linux-kernel, linux-rdma, linux-hyperv

On Thu, Mar 23, 2023 at 2:04 AM Cai Huoqing <cai.huoqing@linux.dev> 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>

Acked-by: Dimitris Michailidis <dmichail@fungible.com>


> ---
>  drivers/net/ethernet/fungible/funcore/fun_dev.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/fungible/funcore/fun_dev.c b/drivers/net/ethernet/fungible/funcore/fun_dev.c
> index 3680f83feba2..a7fbd4cd560a 100644
> --- a/drivers/net/ethernet/fungible/funcore/fun_dev.c
> +++ b/drivers/net/ethernet/fungible/funcore/fun_dev.c
> @@ -746,7 +746,6 @@ void fun_dev_disable(struct fun_dev *fdev)
>         bitmap_free(fdev->irq_map);
>         pci_free_irq_vectors(pdev);
>
> -       pci_clear_master(pdev);
>         pci_disable_device(pdev);
>
>         fun_unmap_bars(fdev);
> @@ -821,7 +820,6 @@ int fun_dev_enable(struct fun_dev *fdev, struct pci_dev *pdev,
>  disable_admin:
>         fun_disable_admin_queue(fdev);
>  free_irq_mgr:
> -       pci_clear_master(pdev);
>         bitmap_free(fdev->irq_map);
>  free_irqs:
>         pci_free_irq_vectors(pdev);
> --
> 2.34.1
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/8] net: liquidio: Remove redundant pci_clear_master
  2023-03-23  9:03 [PATCH 1/8] net: liquidio: Remove redundant pci_clear_master Cai Huoqing
                   ` (6 preceding siblings ...)
  2023-03-23  9:03 ` [PATCH 8/8] ethernet: ec_bhf: " Cai Huoqing
@ 2023-03-24  9:20 ` patchwork-bot+netdevbpf
  7 siblings, 0 replies; 11+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-24  9:20 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: dchickles, sburla, fmanlunas, davem, edumazet, kuba, pabeni,
	rajur, reksio, dmichail, yisen.zhuang, salil.mehta, saeedm, leon,
	kys, haiyangz, wei.liu, decui, shannon.nelson, brett.creeley,
	drivers, bhelgaas, jesse.brandeburg, huangguangbin2, shenjian15,
	lanhao, wangjie125, longli, jiri, netdev, linux-kernel,
	linux-rdma, linux-hyperv

Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 23 Mar 2023 17:03:00 +0800 you 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;
> 
> [...]

Here is the summary with links:
  - [1/8] net: liquidio: Remove redundant pci_clear_master
    https://git.kernel.org/netdev/net-next/c/fc5aba60c244
  - [2/8] net: hisilicon: Remove redundant pci_clear_master
    https://git.kernel.org/netdev/net-next/c/fc3e07e83e8e
  - [3/8] net: cxgb4vf: Remove redundant pci_clear_master
    https://git.kernel.org/netdev/net-next/c/aae964bb7800
  - [4/8] net/fungible: Remove redundant pci_clear_master
    https://git.kernel.org/netdev/net-next/c/8b91d5b62ce8
  - [5/8] net/mlx5: Remove redundant pci_clear_master
    https://git.kernel.org/netdev/net-next/c/5b6f4bd24c8d
  - [6/8] net: mana: Remove redundant pci_clear_master
    https://git.kernel.org/netdev/net-next/c/2d59af830752
  - [7/8] ionic: Remove redundant pci_clear_master
    https://git.kernel.org/netdev/net-next/c/f686e9592734
  - [8/8] ethernet: ec_bhf: Remove redundant pci_clear_master
    https://git.kernel.org/netdev/net-next/c/3228150ba688

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-03-24  9:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 6/8] net: mana: " Cai Huoqing
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).