diff mbox series

[1/8] net: liquidio: Remove redundant pci_clear_master

Message ID 20230323090314.22431-1-cai.huoqing@linux.dev (mailing list archive)
State Not Applicable
Headers show
Series [1/8] net: liquidio: Remove redundant pci_clear_master | expand

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

Comments

patchwork-bot+netdevbpf@kernel.org March 24, 2023, 9:20 a.m. UTC | #1
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!
diff mbox series

Patch

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