From patchwork Wed Jul 11 20:56:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 170512 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44CA82C01B4 for ; Thu, 12 Jul 2012 06:56:25 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030191Ab2GKU4X (ORCPT ); Wed, 11 Jul 2012 16:56:23 -0400 Received: from mail-vc0-f174.google.com ([209.85.220.174]:46461 "EHLO mail-vc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754842Ab2GKU4X (ORCPT ); Wed, 11 Jul 2012 16:56:23 -0400 Received: by vcbf11 with SMTP id f11so1062003vcb.19 for ; Wed, 11 Jul 2012 13:56:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=4+RPRZswjSAn7FozAQlH7XN/XSk8FhIhRsjvoHAL5NY=; b=eU+cyip0sysErfkandPlbQWI6LBLj9+IyZ8jTKWEocipID4zg+Xn4/1rXbMEe1rEgE 43pCt+YceC7v+3VtKqWlOgmacpXdagkt81ID7nc16Y7Du0Xi3Qs35MkRsBMz9+CidW2I cFQAjoIDgYX/CbOjoR1b+ZjqG99bMm0DJe4zIYu7tooiI+wtpYCEinnfW5PQxzdTVWdZ F70XnzzSj8sXfQgMvflxjgdEHCLUY6B14M3j9maBZjlOvicot5BVHRS7vY33FBjUFqBz 5fRy4sAE4RBBaM4hRuBp0mgUJNojG1XEylnVs6MrgplT/K6e0bazBk8VOC5SRxRk71iH fDug== MIME-Version: 1.0 Received: by 10.52.71.137 with SMTP id v9mr20455935vdu.63.1342040182397; Wed, 11 Jul 2012 13:56:22 -0700 (PDT) Received: by 10.52.37.9 with HTTP; Wed, 11 Jul 2012 13:56:22 -0700 (PDT) In-Reply-To: References: <1340437325-29282-1-git-send-email-yinghai@kernel.org> <1340437325-29282-3-git-send-email-yinghai@kernel.org> <20120711162120.GA17988@google.com> Date: Wed, 11 Jul 2012 13:56:22 -0700 X-Google-Sender-Auth: ytdvziEyMsPkqIcVmy-zobj92VQ Message-ID: Subject: Re: [PATCH 2/5] pciehp: Don't enable presence notification while surprise removal is not supported. From: Yinghai Lu To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Kenji Kaneshige Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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");