All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>,
	Jun Li <lijun.kernel@gmail.com>
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Linux USB List <linux-usb@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Eddie Hung <eddie.hung@mediatek.com>,
	Yun-Chien Yu <yun-chien.yu@mediatek.com>
Subject: Re: [PATCH] usb: xhci: skip re-check pending port event if hibernated
Date: Fri, 17 Dec 2021 17:40:15 +0800	[thread overview]
Message-ID: <609eb0eea02b2304f427d4f2e9c26de9f2149f06.camel@mediatek.com> (raw)
In-Reply-To: <e7a6e45e-68ce-54a5-9632-80244dd1e4c7@linux.intel.com>

On Tue, 2021-12-14 at 12:05 +0200, Mathias Nyman wrote:
> On 14.12.2021 10.00, Jun Li wrote:
> > Mathias Nyman <mathias.nyman@linux.intel.com> 于2021年12月11日周六
> > 01:56写道:
> > > 
> > > On 9.12.2021 9.22, Chunfeng Yun wrote:
> > > > When xHCI controller hibernated, the root hub lost power, if
> > > > controller
> > > > support Port Power Control (PPC), PP is not set at
> > > > xhci_resume() and
> > > > set by hub_reset_resume() later, so no need check pending port
> > > > event.
> > > > If PPC is not supported, device is disconneced, seems do not
> > > > send out
> > > > U3 LFPS wake signal, no need re-check again and drop 120ms
> > > > delay to
> > > > save resume time.
> > > > 
> > > > Reported-by: Yun-Chien Yu <yun-chien.yu@mediatek.com>
> > > > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > > > ---
> > > 
> > > Thanks, adding
> > 
> > Hi Mathias, Chunfeng
> > 
> > I have a question on this, if there is no any usb devices connected
> > before suspend, do we need this 120ms delay to check again?
> > So do we need one more condition to limit this like?
> > if (!pending_portevent && !hibernated && xhci_has_child_device())
> 
> The 120ms delay was added to make sure we catch the second wake
> signal
> from a device in case host missed the first U3 exit LFPS wakeup
> signal.
> 
> Even if no devices are connected this might be helpful if a device is
> connected while host is suspended.
> I haven't checked any timing for the link training during
> enumeration,
> but it also uses LFPS signalling, and connected device isn't visible
> to
> driver until link is successfully trained.
For xhci-mtk, roothub can't detect device until root hub set PortPower,
seems also the same for other xhci controllers that support Port Power
Control.
> 
> So the original 120ms delay patch might as a positive side effect
> ensure
> driver doesn't suspend host mid device enumeration.
this is in resume?

> 
> Could be looked into more, but I don't think we should this patch by
> Chunfeng
> 
> Thanks
> Mathias

WARNING: multiple messages have this Message-ID (diff)
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>,
	Jun Li <lijun.kernel@gmail.com>
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Linux USB List <linux-usb@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	 lkml <linux-kernel@vger.kernel.org>,
	Eddie Hung <eddie.hung@mediatek.com>,
	Yun-Chien Yu <yun-chien.yu@mediatek.com>
Subject: Re: [PATCH] usb: xhci: skip re-check pending port event if hibernated
Date: Fri, 17 Dec 2021 17:40:15 +0800	[thread overview]
Message-ID: <609eb0eea02b2304f427d4f2e9c26de9f2149f06.camel@mediatek.com> (raw)
In-Reply-To: <e7a6e45e-68ce-54a5-9632-80244dd1e4c7@linux.intel.com>

On Tue, 2021-12-14 at 12:05 +0200, Mathias Nyman wrote:
> On 14.12.2021 10.00, Jun Li wrote:
> > Mathias Nyman <mathias.nyman@linux.intel.com> 于2021年12月11日周六
> > 01:56写道:
> > > 
> > > On 9.12.2021 9.22, Chunfeng Yun wrote:
> > > > When xHCI controller hibernated, the root hub lost power, if
> > > > controller
> > > > support Port Power Control (PPC), PP is not set at
> > > > xhci_resume() and
> > > > set by hub_reset_resume() later, so no need check pending port
> > > > event.
> > > > If PPC is not supported, device is disconneced, seems do not
> > > > send out
> > > > U3 LFPS wake signal, no need re-check again and drop 120ms
> > > > delay to
> > > > save resume time.
> > > > 
> > > > Reported-by: Yun-Chien Yu <yun-chien.yu@mediatek.com>
> > > > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > > > ---
> > > 
> > > Thanks, adding
> > 
> > Hi Mathias, Chunfeng
> > 
> > I have a question on this, if there is no any usb devices connected
> > before suspend, do we need this 120ms delay to check again?
> > So do we need one more condition to limit this like?
> > if (!pending_portevent && !hibernated && xhci_has_child_device())
> 
> The 120ms delay was added to make sure we catch the second wake
> signal
> from a device in case host missed the first U3 exit LFPS wakeup
> signal.
> 
> Even if no devices are connected this might be helpful if a device is
> connected while host is suspended.
> I haven't checked any timing for the link training during
> enumeration,
> but it also uses LFPS signalling, and connected device isn't visible
> to
> driver until link is successfully trained.
For xhci-mtk, roothub can't detect device until root hub set PortPower,
seems also the same for other xhci controllers that support Port Power
Control.
> 
> So the original 120ms delay patch might as a positive side effect
> ensure
> driver doesn't suspend host mid device enumeration.
this is in resume?

> 
> Could be looked into more, but I don't think we should this patch by
> Chunfeng
> 
> Thanks
> Mathias
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>,
	Jun Li <lijun.kernel@gmail.com>
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Linux USB List <linux-usb@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	 lkml <linux-kernel@vger.kernel.org>,
	Eddie Hung <eddie.hung@mediatek.com>,
	Yun-Chien Yu <yun-chien.yu@mediatek.com>
Subject: Re: [PATCH] usb: xhci: skip re-check pending port event if hibernated
Date: Fri, 17 Dec 2021 17:40:15 +0800	[thread overview]
Message-ID: <609eb0eea02b2304f427d4f2e9c26de9f2149f06.camel@mediatek.com> (raw)
In-Reply-To: <e7a6e45e-68ce-54a5-9632-80244dd1e4c7@linux.intel.com>

On Tue, 2021-12-14 at 12:05 +0200, Mathias Nyman wrote:
> On 14.12.2021 10.00, Jun Li wrote:
> > Mathias Nyman <mathias.nyman@linux.intel.com> 于2021年12月11日周六
> > 01:56写道:
> > > 
> > > On 9.12.2021 9.22, Chunfeng Yun wrote:
> > > > When xHCI controller hibernated, the root hub lost power, if
> > > > controller
> > > > support Port Power Control (PPC), PP is not set at
> > > > xhci_resume() and
> > > > set by hub_reset_resume() later, so no need check pending port
> > > > event.
> > > > If PPC is not supported, device is disconneced, seems do not
> > > > send out
> > > > U3 LFPS wake signal, no need re-check again and drop 120ms
> > > > delay to
> > > > save resume time.
> > > > 
> > > > Reported-by: Yun-Chien Yu <yun-chien.yu@mediatek.com>
> > > > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > > > ---
> > > 
> > > Thanks, adding
> > 
> > Hi Mathias, Chunfeng
> > 
> > I have a question on this, if there is no any usb devices connected
> > before suspend, do we need this 120ms delay to check again?
> > So do we need one more condition to limit this like?
> > if (!pending_portevent && !hibernated && xhci_has_child_device())
> 
> The 120ms delay was added to make sure we catch the second wake
> signal
> from a device in case host missed the first U3 exit LFPS wakeup
> signal.
> 
> Even if no devices are connected this might be helpful if a device is
> connected while host is suspended.
> I haven't checked any timing for the link training during
> enumeration,
> but it also uses LFPS signalling, and connected device isn't visible
> to
> driver until link is successfully trained.
For xhci-mtk, roothub can't detect device until root hub set PortPower,
seems also the same for other xhci controllers that support Port Power
Control.
> 
> So the original 120ms delay patch might as a positive side effect
> ensure
> driver doesn't suspend host mid device enumeration.
this is in resume?

> 
> Could be looked into more, but I don't think we should this patch by
> Chunfeng
> 
> Thanks
> Mathias
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-12-17  9:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09  7:22 [PATCH] usb: xhci: skip re-check pending port event if hibernated Chunfeng Yun
2021-12-09  7:22 ` Chunfeng Yun
2021-12-09  7:22 ` Chunfeng Yun
2021-12-10 13:33 ` Mathias Nyman
2021-12-10 13:33   ` Mathias Nyman
2021-12-10 13:33   ` Mathias Nyman
2021-12-14  8:00   ` Jun Li
2021-12-14  8:00     ` Jun Li
2021-12-14  8:00     ` Jun Li
2021-12-14 10:05     ` Mathias Nyman
2021-12-14 10:05       ` Mathias Nyman
2021-12-14 10:05       ` Mathias Nyman
2021-12-15  2:09       ` Jun Li
2021-12-15  2:09         ` Jun Li
2021-12-15  2:09         ` Jun Li
2021-12-17  9:40       ` Chunfeng Yun [this message]
2021-12-17  9:40         ` Chunfeng Yun
2021-12-17  9:40         ` Chunfeng Yun

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=609eb0eea02b2304f427d4f2e9c26de9f2149f06.camel@mediatek.com \
    --to=chunfeng.yun@mediatek.com \
    --cc=eddie.hung@mediatek.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=lijun.kernel@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=mathias.nyman@linux.intel.com \
    --cc=matthias.bgg@gmail.com \
    --cc=yun-chien.yu@mediatek.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 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.