From: "Raj, Ashok" <ashok.raj@intel.com>
To: Jon Derrick <jonathan.derrick@intel.com>
Cc: linux-pci@vger.kernel.org, Bjorn Helgaas <helgaas@kernel.org>,
Lukas Wunner <lukas@wunner.de>,
Dan Williams <dan.j.williams@intel.com>,
Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@intel.com>,
Ashok Raj <ashok.raj@intel.com>
Subject: Re: [PATCH] PCI: pciehp: Ignore spurious link inactive change when off
Date: Fri, 9 Apr 2021 14:38:26 -0700 [thread overview]
Message-ID: <20210409213826.GB101733@otc-nc-03> (raw)
In-Reply-To: <20210409205935.41881-1-jonathan.derrick@intel.com>
On Fri, Apr 09, 2021 at 02:59:35PM -0600, Derrick, Jonathan wrote:
> When a specific x8 CEM card is bifurcated into x4x4 mode, and the
> upstream ports both support hotplugging on each respective x4 device, a
> slot management system for the CEM card requires both x4 devices to be
> sysfs removed from the OS before it can safely turn-off physical power.
> The implications are that Slot Control will display Powered Off status
> for the device where the device is actually powered until both ports
> have powered off.
>
> When power is removed from the first half, the link remains active to
> provide clocking while waiting for the second half to have power
> removed. When power is then removed from the second half, the first half
> starts shutdown sequence and will trigger a link status change event.
> This is misinterpreted as an enabling event due to positive presence
> detect and causes the first half to be re-enabled.
>
> The spurious enable can be resolved by ignoring link status change
> events when no link is active when in the off state.
>
> Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Although this seems like it should never happen with normal cards, it seems
harmless otherwise.
Reviewed by: Ashok Raj <ashok.raj@intel.com>
> ---
> drivers/pci/hotplug/pciehp_ctrl.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
> index 529c34808440..a2c5eef03e7d 100644
> --- a/drivers/pci/hotplug/pciehp_ctrl.c
> +++ b/drivers/pci/hotplug/pciehp_ctrl.c
> @@ -265,6 +265,11 @@ void pciehp_handle_presence_or_link_change(struct controller *ctrl, u32 events)
> cancel_delayed_work(&ctrl->button_work);
> fallthrough;
> case OFF_STATE:
> + if ((events & PCI_EXP_SLTSTA_DLLSC) && !link_active) {
> + mutex_unlock(&ctrl->state_lock);
> + break;
> + }
> +
> ctrl->state = POWERON_STATE;
> mutex_unlock(&ctrl->state_lock);
> if (present)
> --
> 2.26.2
>
--
Cheers,
Ashok
[Forgiveness is the attribute of the STRONG - Gandhi]
next prev parent reply other threads:[~2021-04-09 21:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-09 20:59 [PATCH] PCI: pciehp: Ignore spurious link inactive change when off Jon Derrick
2021-04-09 21:38 ` Raj, Ashok [this message]
2021-05-24 22:42 ` Bjorn Helgaas
2021-05-25 19:25 ` Lukas Wunner
2021-05-25 20:17 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210409213826.GB101733@otc-nc-03 \
--to=ashok.raj@intel.com \
--cc=dan.j.williams@intel.com \
--cc=helgaas@kernel.org \
--cc=jonathan.derrick@intel.com \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=sathyanarayanan.kuppuswamy@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).