All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Yu Liao <liaoyu15@huawei.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, shannon.nelson@amd.com,
	liwei391@huawei.com
Subject: Re: [PATCH v2 net-next] pds_core: remove redundant pci_clear_master()
Date: Thu, 17 Aug 2023 11:05:57 +0300	[thread overview]
Message-ID: <20230817080557.GG22185@unreal> (raw)
In-Reply-To: <20230817025709.2023553-1-liaoyu15@huawei.com>

On Thu, Aug 17, 2023 at 10:57:09AM +0800, Yu Liao wrote:
> do_pci_disable_device() disable PCI bus-mastering as following:
> 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 pci_disable_device() sets dev->is_busmaster to 0.
> 
> pci_enable_device() is called only once before calling to
> pci_disable_device() and such pci_clear_master() is not needed. So remove
> redundant pci_clear_master().
> 
> Also rename goto label 'err_out_clear_master' to 'err_out_disable_device'.
> 
> Signed-off-by: Yu Liao <liaoyu15@huawei.com>
> ---
> v1 -> v2:
> - add explanation why pci_disable_device() disables PCI bus-mastering
> - rename goto label 'err_out_clear_master' to 'err_out_disable_device' 
> ---
>  drivers/net/ethernet/amd/pds_core/main.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

  parent reply	other threads:[~2023-08-17  8:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17  2:57 [PATCH v2 net-next] pds_core: remove redundant pci_clear_master() Yu Liao
2023-08-17  7:53 ` Simon Horman
2023-08-17  8:05 ` Leon Romanovsky [this message]
2023-08-17 15:55 ` Nelson, Shannon
2023-08-18 22:40 ` 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=20230817080557.GG22185@unreal \
    --to=leon@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=liaoyu15@huawei.com \
    --cc=liwei391@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shannon.nelson@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.