On Mon, Sep 24, 2018 at 06:10:01PM -0700, Benjamin Herrenschmidt wrote: > On Tue, 2018-09-18 at 17:57 -0600, Keith Busch wrote: > > .../... > > Any reason why you don't do cmpxchg as I originally suggested (sorry > I've been away and may have missed some previous emails) That was to block a device hot removal on error_detected and error_resume, or vice versa. > > -/* pci_dev priv_flags */ > > -#define PCI_DEV_DISCONNECTED 0 > > -#define PCI_DEV_ADDED 1 > > +/** > > + * pci_dev_set_io_state - Set the new error state if possible. > > + * > > + * @dev - pci device to set new error_state > > + * @new - the state we want dev to be in > > + * > > + * Must be called with device_lock held. > > This won't work for PowerPC EEH. We will change the state from a > readl() so at interrupt time or any other context. > > We really need the cmpxchg variant. These are private interfaces. EEH can't call them from any context.