From patchwork Wed Jul 11 20:56:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/5] pciehp: Don't enable presence notification while surprise removal is not supported. Date: Wed, 11 Jul 2012 10:56:22 -0000 From: Yinghai Lu X-Patchwork-Id: 170512 Message-Id: To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Kenji Kaneshige On Wed, Jul 11, 2012 at 1:48 PM, Bjorn Helgaas wrote: >> >> When hotplug surprise is supported, attention button may not there. >> So have to use present bit to trigger the sequence online work, and >> offline clean up work. > > Well, there is an "Attention Button Present" bit. Why wouldn't we use > that instead of trying to infer the button's presence from Hot-Plug > Surprise? so you want this ? handle_surprise_event(p_slot); that should keep current user expected behavior that kernel only bring the card online after press the button. --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index 27f4429..f103a4ca 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c @@ -463,7 +463,7 @@ static void interrupt_event_handler(struct work_struct *work) break; case INT_PRESENCE_ON: case INT_PRESENCE_OFF: - if (!HP_SUPR_RM(ctrl)) + if (ATTN_BUTTN(ctrl)) break; ctrl_dbg(ctrl, "Surprise Removal\n");