From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vc0-f174.google.com ([209.85.220.174]:46942 "EHLO mail-vc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752242Ab2GKU2u convert rfc822-to-8bit (ORCPT ); Wed, 11 Jul 2012 16:28:50 -0400 Received: by vcbf11 with SMTP id f11so1043672vcb.19 for ; Wed, 11 Jul 2012 13:28:49 -0700 (PDT) MIME-Version: 1.0 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:28:49 -0700 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 Content-Type: text/plain; charset=windows-1252 Sender: linux-pci-owner@vger.kernel.org List-ID: On Wed, Jul 11, 2012 at 12:56 PM, Bjorn Helgaas wrote: > On Wed, Jul 11, 2012 at 12:49 PM, Yinghai Lu wrote: >> On Wed, Jul 11, 2012 at 11:15 AM, Bjorn Helgaas wrote: >>> >>> What's the connection with HP_SUPR_RM()? Is it just a coincidence >>> that chipsets that set the "Hot-Plug Surprise" bit don't have this >>> problem with the Presence Detect State bit? >>> >>> Using HP_SUPR_RM() seems like a totally bogus way to work around a >>> presence detect issue. >> >> then we should blame the spec. > > What specifically are you referring to? I see this Presence Detect State text: > > Presence Detect State – This bit indicates the presence of an > adapter in the slot, reflected by the logical “OR” of the Physical > Layer in-band presence detect mechanism and, if present, any > out-of-band presence detect mechanism defined for the slot’s > corresponding form factor. Note that the in-band presence > detect mechanism requires that power be applied to an adapter > for its presence to be detected. Consequently, form factors that > require a power controller for hot-plug must implement a > physical pin presence detect mechanism. > > But I don't yet see the connection with the Hot-Plug Surprise bit. Spec does not mention about surprise add clearly. > >> and if you do the above changing, when plug the card into system, >> kernel will bring that card online automatically without press >> attention button. >> that will be big change. > > I don't want to make a fundamental change in behavior like that. I'm > just trying to understand why we should handle Presence Detect > differently based on the Hot-Plug Surprise bit. 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. When hotplug surprise is not there, why should we handle Presence Bit change? > > The attention button is optional. What happens today when you plug a > card into a slot with no attention button? if the slot support hotplug surprise, that card will be online automatically. if the slot does not support hotplug surprise, but that slot have power control, then could use need sw interface /sys/..../power to turn on the power and bring that card online. Yinghai