Skip to content

Commit

Permalink
PCI: pciehp: Handle surprise add even if surprise removal isn't suppo…
Browse files Browse the repository at this point in the history
…rted

The PCIe spec (r3.0, sec 7.8.9) says Hot-Plug Surprise indicates support
for surprise *removal*, but pciehp checked this to determine if it should
handle presence detect interrupts for device *addition*.

Allow surprise device addition even if the slot doesn't advertise support
for surprise removal.

Keith has a platform with slots for front-loading SFF devices.  The slots
do not have attention buttons and do not support surprise removal, but they
do have presence detect.  In that case, we still want to use presence
detect for device addition.

Keith's original patch handled surprise insertions only if Hot-Plug Capable
is set.  I think that test is superfluous because pciehp only claims slots
that advertise Hot-Plug Capable (see get_port_device_capability()).

Link: http://lkml.kernel.org/r/[email protected]
Based-on-patch-by: Keith Busch <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Acked-by: Rajat Jain <[email protected]>
  • Loading branch information
bjorn-helgaas committed Jan 21, 2015
1 parent 17f14b5 commit a93b506
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/pci/hotplug/pciehp_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,6 @@ static void interrupt_event_handler(struct work_struct *work)
pciehp_green_led_off(p_slot);
break;
case INT_PRESENCE_ON:
if (!HP_SUPR_RM(ctrl))
break;
ctrl_dbg(ctrl, "Surprise Insertion\n");
handle_surprise_event(p_slot);
break;
Expand Down

0 comments on commit a93b506

Please sign in to comment.