Re: [PATCH part1 v5 5/7] PCI: Add pci_dummy_ops to isolate pci device temporarily

2014-02-10 Thread Yijing Wang
+ spin_lock_irqsave(&pci_freeze_lock, flags); + ops = pci_bus_set_ops(bus, &pci_dummy_ops); + bus->save_ops = ops; + spin_unlock_irqrestore(&pci_freeze_lock, flags); >>> >>> Against what exactly are you locking here? >> >> I want to use this spin lock to serialize freeze dev

Re: [PATCH part1 v5 5/7] PCI: Add pci_dummy_ops to isolate pci device temporarily

2014-02-10 Thread Oliver Neukum
On Mon, 2014-02-10 at 15:59 +0800, Yijing Wang wrote: > Hi Oliver, >Thanks for your review and comments! > > >> +static DEFINE_SPINLOCK(pci_freeze_lock); > > > > The lock is used only here. > > Also be used in pci_bus_unfreeze_device(); Sorry, I meant only in this patch. > > > > >> +/**

Re: [PATCH part1 v5 5/7] PCI: Add pci_dummy_ops to isolate pci device temporarily

2014-02-10 Thread Yijing Wang
Hi Oliver, Thanks for your review and comments! >> +static DEFINE_SPINLOCK(pci_freeze_lock); > > The lock is used only here. Also be used in pci_bus_unfreeze_device(); > >> +/** >> + * pci_bus_freeze_device - freeze pci bus to access pci device >> + * @bus: the pci bus to freeze >> + * >> +

Re: [PATCH part1 v5 5/7] PCI: Add pci_dummy_ops to isolate pci device temporarily

2014-02-09 Thread Oliver Neukum
On Mon, 2014-02-10 at 12:04 +0800, Yijing Wang wrote: > +static DEFINE_SPINLOCK(pci_freeze_lock); The lock is used only here. > +/** > + * pci_bus_freeze_device - freeze pci bus to access pci device > + * @bus: the pci bus to freeze > + * > + * Replace pci bus ops by pci_dummy_ops, protect syste

[PATCH part1 v5 5/7] PCI: Add pci_dummy_ops to isolate pci device temporarily

2014-02-09 Thread Yijing Wang
Pci_dummy_ops does nothing when we use it to read/write pci_device. So we can isolate pci device by replace its bus pci_ops by pci_dummy_ops. This is preparation for the later patch. Signed-off-by: Yijing Wang --- drivers/pci/pci.c | 54 +++ in