]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
PCI: pciehp: Leave power indicator on when enabling already-enabled slot
authorAshok Raj <ashok.raj@intel.com>
Sat, 19 Nov 2016 08:32:46 +0000 (00:32 -0800)
committerDhaval Giani <dhaval.giani@oracle.com>
Mon, 16 Jan 2017 21:10:11 +0000 (16:10 -0500)
If an error occurs when enabling a slot, pciehp_power_thread() turns off
the power indicator.  But if the only error is that the slot was already
enabled, we should leave the power indicator on.

Return success if called to enable an already-enabled slot.
This is in the same spirit of the special handling for EEXISTS when
pciehp_configure_device() determines the slot devices already exist.

Orabug: 25312751

Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
(cherry picked from commit c4ae2adedb38240be5a1a16588406980b948a3e7)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/pci/hotplug/pciehp_ctrl.c

index f052e951b23e808a551456bed69587ee8ccee513..8edcf86c3c3be58d45870e5b1e8ef014e0e94b69 100644 (file)
@@ -583,7 +583,7 @@ int pciehp_enable_slot(struct slot *p_slot)
                if (getstatus) {
                        ctrl_info(ctrl, "Already enabled on slot(%s)\n",
                                  slot_name(p_slot));
-                       return -EINVAL;
+                       return 0;
                }
        }