On Thu, Oct 27, 2016 at 11:01:41AM +0200, Hannes Reinecke wrote: > On 10/27/2016 12:21 AM, Don Brace wrote: > > need to check if the device is already disabled first > > > > Reviewed-by: Scott Benesh <scott.benesh@xxxxxxxxxxxxx> > > Reviewed-by: Scott Teel <scott.teel@xxxxxxxxxxxxx> > > Signed-off-by: Don Brace <don.brace@xxxxxxxxxxxxx> > > --- > > drivers/scsi/hpsa.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c > > index d007ec1..798fb20 100644 > > --- a/drivers/scsi/hpsa.c > > +++ b/drivers/scsi/hpsa.c > > @@ -8456,7 +8456,8 @@ static void controller_lockup_detected(struct ctlr_info *h) > > spin_unlock_irqrestore(&h->lock, flags); > > dev_warn(&h->pdev->dev, "Controller lockup detected: 0x%08x after %d\n", > > lockup_detected, h->heartbeat_sample_interval / HZ); > > - pci_disable_device(h->pdev); > > + if (pci_is_enabled(h->pdev)) > > + pci_disable_device(h->pdev); > > fail_all_outstanding_cmds(h); > > } > > > > > Meh. > Why is pci_disable_device() not checking for it? It does: 1607 void pci_disable_device(struct pci_dev *dev) 1608 { [...] 1615 dev_WARN_ONCE(&dev->dev, atomic_read(&dev->enable_cnt) <= 0, 1616 "disabling already-disabled device"); [...] 1624 } 1625 EXPORT_SYMBOL(pci_disable_device); Which is the motivation behind this patch I think. Reviewed-by: Johannes Thumshirn <jthumshirn@xxxxxxx> -- Johannes Thumshirn Storage jthumshirn@xxxxxxx +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html