Re: [Xen-devel] [PATCH 2/2] xen/pciback: When resetting thedevice don't disable twice.

From: Jan Beulich
Date: Wed Sep 26 2012 - 04:57:46 EST


>>> On 25.09.12 at 23:27, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> wrote:
> We call 'pci_disable_device' which sets the bus_master to zero
> and it also disables the PCI_COMMAND. There is no need to
> do it outside the PCI library.

Not really - pci_disable_device() only does anything if enable_cnt
drops to zero, and only clears the bus master flag in the command
word.

The code you delete fully zeros the command word unconditionally.
(I also noticed that the old [forward ported] code here forced
enable_cnt to zero.)

Hence the question is whether this really isn't a functional
change rather than mere cleanup.

Jan

> --- a/drivers/xen/xen-pciback/pciback_ops.c
> +++ b/drivers/xen/xen-pciback/pciback_ops.c
> @@ -114,10 +114,6 @@ void xen_pcibk_reset_device(struct pci_dev *dev)
> pci_disable_msi(dev);
> #endif
> pci_disable_device(dev);
> -
> - pci_write_config_word(dev, PCI_COMMAND, 0);
> -
> - dev->is_busmaster = 0;
> } else {
> pci_read_config_word(dev, PCI_COMMAND, &cmd);
> if (cmd & (PCI_COMMAND_INVALIDATE)) {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/