All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Peter Chen <peter.chen@kernel.org>,
	Mario Limonciello <mario.limonciello@amd.com>
Cc: superm1@kernel.org, Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"open list:USB XHCI DRIVER" <linux-usb@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Kai-Heng Feng <kai.heng.feng@canonical.com>,
	mika.westerberg@linux.intel.com, stern@rowland.harvard.edu
Subject: Re: [PATCH 2/2] xhci: pci: Put XHCI controllers into D3hot at shutdown
Date: Wed, 28 Aug 2024 17:02:10 +0300	[thread overview]
Message-ID: <bd380d71-4ebe-4889-9ed8-aeefec2b2b0e@linux.intel.com> (raw)
In-Reply-To: <20240828071303.GA921051@nchen-desktop>

>>> Hi Mario & Mathias,
>>>
>>> According to xHCI spec v1.2: A.1.2 Power State Definitions:
>>>
>>> 	Software shall place each downstream USB port with power
>>> 	enabled into the Suspend or Disabled state before it
>>> 	attempts to move the xHC out of the D0 power state.
>>>
>>> But I have not found any USB core code does it, do you have any ideas
>>> about it?
>>>
>>> We have added the similar codes at non-PCI USB platform, but met above
>>> concerns. In fact, we met kernel dump that the thread usb-storage try
>>> to access the port status when the platform xHCI code has already put
>>> the controller to D3.
>>>
>>> Best regards,
>>> Peter
>>>
>>>
>>
>> This is pretty tangential to my patch.  But FWIW in case you missed we're
>> going to discard this patch in favor of another approach in PCI core.
>>
>> Regarding your point though If I'm not mistaken this should be handled by
>> the Linux parent/child device model.  Each of the ports should be children
>> of the hub they're connected to and the hub a child of the controller.  So
>> when doing any actions that start runtime PM on the host controller the
>> children need to first be in runtime PM.
>>
> 
> It seems there is no runtime PM suspend for xhci and USB core at
> .shutdown currently. Alan & Mathias, please correct me if I was wrong.
> 

I think you are right.  At shutdown we only halt the xHC.
We don't force ports to suspend or disable state.
We only put some selected xHC to D3

USB 2 ports might suspend themselves if there is no activity.

Doesn't seem like usb core hcd code, or hub driver does anything either.

Thanks
Mathias



  reply	other threads:[~2024-08-28 14:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-12 18:54 [PATCH 0/2] Put XHCI controllers into D3 at S4/S5 superm1
2024-07-12 18:54 ` [PATCH 1/2] xhci: pci: If no ports have wakeup enabled then disable PCI device at S4 superm1
2024-08-21  9:25   ` Mathias Nyman
2024-08-21 20:59     ` Mario Limonciello
2024-07-12 18:54 ` [PATCH 2/2] xhci: pci: Put XHCI controllers into D3hot at shutdown superm1
2024-08-22 15:28   ` Mathias Nyman
2024-08-27  6:32   ` Peter Chen
2024-08-27 18:44     ` Mario Limonciello
2024-08-28  7:13       ` Peter Chen
2024-08-28 14:02         ` Mathias Nyman [this message]
2024-08-28 14:09           ` Alan Stern
2024-08-20  2:06 ` [PATCH 0/2] Put XHCI controllers into D3 at S4/S5 Mario Limonciello
2024-08-22  7:15   ` Kai-Heng Feng
2024-08-22 19:21     ` Mario Limonciello

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=bd380d71-4ebe-4889-9ed8-aeefec2b2b0e@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mathias.nyman@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=peter.chen@kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=superm1@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.