Hi, This patch is for cleanup of pciback_reset_device. is_enabled=0 and is_busmaster=0 are not necessary because pci_disable_device() do them. Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com> diff -r c6f637694b85 linux-2.6-xen-sparse/drivers/xen/pciback/pciback_ops.c --- a/linux-2.6-xen-sparse/drivers/xen/pciback/pciback_ops.c Fri Dec 15 11: 53:45 2006 +0000 +++ b/linux-2.6-xen-sparse/drivers/xen/pciback/pciback_ops.c Mon Dec 18 08: 58:43 2006 +0900 @@ -22,11 +22,7 @@ void pciback_reset_device(struct pci_dev /* Disable devices (but not bridges) */ if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) { pci_disable_device(dev); - pci_write_config_word(dev, PCI_COMMAND, 0); - - dev->is_enabled = 0; - dev->is_busmaster = 0; } else { pci_read_config_word(dev, PCI_COMMAND, &cmd); if (cmd & (PCI_COMMAND_INVALIDATE)) { Best Regards, Akio Takebe _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 18/12/06 9:21 am, "Akio Takebe" <takebe_akio@jp.fujitsu.com> wrote:> This patch is for cleanup of pciback_reset_device. > is_enabled=0 and is_busmaster=0 are not necessary > because pci_disable_device() do them.If you are zapping the command register then doesn''t it makes sense to zap the software flags relating to that at the same time, even if that sometimes happens to be redundant? It certainly means we can be sure they won''t get out of sync. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hi, Keir>On 18/12/06 9:21 am, "Akio Takebe" <takebe_akio@jp.fujitsu.com> wrote: > >> This patch is for cleanup of pciback_reset_device. >> is_enabled=0 and is_busmaster=0 are not necessary >> because pci_disable_device() do them. > >If you are zapping the command register then doesn''t it makes sense to zap >the software flags relating to that at the same time, even if that sometimes >happens to be redundant? It certainly means we can be sure they won''t get >out of sync. >I checked linux-2.6.19 and linux-2.6.18, both pci_disable_device()s do is_enabled=0 and is_busmaster=0. I think pci_write_config_word(dev, PCI_COMMAND, 0) is not also necessary, (though I''m not sure it.) So I think they in pciback_reset_device() are not necessary. But if you want to leave it for safe, I agree. :) Best Regards, Akio Takebe _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel