All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mani, Rajmohan" <rajmohan.mani@intel.com>
To: Evan Green <evgreen@chromium.org>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	"Fine, Gil" <gil.fine@intel.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Prashant Malani <pmalani@google.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: RE: thunderbolt: Warning and 20 second delay in S4
Date: Tue, 13 Jul 2021 22:00:45 +0000	[thread overview]
Message-ID: <DM6PR11MB3963600521EF82346CB7F5D5F6149@DM6PR11MB3963.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CAE=gft4prWe-oD-042GT2F4zHiGBsNRH9pH040O9hipF9D5EfA@mail.gmail.com>

Hi Evan,

> Subject: Re: thunderbolt: Warning and 20 second delay in S4
> 
> Hi Raj,
> Sure. I've got a TGL chromebook with my own kernel. The chromebook has
> nothing but a servo v4 plugged into it via type-C.
> 
> I built the kernel by checking out next-20210709 from linux-next in the v5.4
> ChromeOS chroot directory, then doing "git checkout m/main -- chromeos", in
> order to get the configs. My chromeos-5.4 (where I pulled the configs from)
> happened to be on 04686c32716158 UPSTREAM:
> ASoC: rt5682-sdw: use first_hw_init flag on resume, though I don't think it
> matters.
> 
> From there, my build line is:
> USE="kgdb pcserial vtconsole " emerge-volteer chromeos-kernel-5_4
> 
> My commandline has "earlyprintk=ttyS0,115200n8 console=ttyS0,115200n8"
> so I get spew out of the serial port, but otherwise it should be standard. I'm
> also tracking this in b/192575702.
> 

tb_cfg_read_raw() and tb_cfg_write_raw() implementation makes use of
TB_CTL_RETRIES (4) retries with a timeout of TB_CFG_DEFAULT_TIMEOUT
(5 seconds) for the control read/write operations.

Per the latest USB4 spec, it is recommended to have 10 +/- 1 ms timeout
value for control packets within domain and 1 second for inter-domain.

You can try changing the TB_CFG_DEFAULT_TIMEOUT value to 100ms and
see if 400ms is manageable and you can get by with it.

Mika will be back by the end of next week. I will check with Mika and rest
of the team, to arrive at the ideal values and post a patch.

> -Evan
> 
> On Mon, Jul 12, 2021 at 5:16 PM Mani, Rajmohan
> <rajmohan.mani@intel.com> wrote:
> >
> > Hi Evan,
> >
> > > -----Original Message-----
> > > From: Evan Green <evgreen@chromium.org>
> > > Sent: Monday, July 12, 2021 4:46 PM
> > > To: Greg KH <gregkh@linuxfoundation.org>
> > > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>; Fine, Gil
> > > <gil.fine@intel.com>; Mani, Rajmohan <rajmohan.mani@intel.com>;
> > > linux- usb@vger.kernel.org; Prashant Malani <pmalani@google.com>;
> > > LKML <linux- kernel@vger.kernel.org>
> > > Subject: Re: thunderbolt: Warning and 20 second delay in S4
> > >
> > > On Fri, Jul 9, 2021 at 11:34 PM Greg KH <gregkh@linuxfoundation.org>
> wrote:
> > > >
> > > > On Fri, Jul 09, 2021 at 02:31:35PM -0700, Evan Green wrote:
> > > > > Hi Mika et al,
> > > > >
> > > > > I'm experimenting with suspending to disk (hibernate) on a
> > > > > Tigerlake Chromebook running the chromeos-5.4 kernel. I don't
> > > > > have any USB4 peripherals plugged in. I'm getting this warning,
> > > > > along with a 20 second stall, both when going down for hibernate and
> coming back up.
> > > >
> > > > 5.4 is pretty old, especially for thunderbolt issues, can you try
> > > > 5.13 please?
> > >
> > > Good idea. On 5.13.0-next-20210709, I see the warning and delay even
> > > at boot when runtime pm kicks in. This should make for an easier repro at
> least:
> > >
> > > [   18.832016] thunderbolt 0000:00:0d.2: 0: timeout reading config
> > > space 2 from 0x6
> > > [   18.840309] ------------[ cut here ]------------
> > > [   18.845466] thunderbolt 0000:00:0d.2: interrupt for RX ring 0 is
> > > already disabled
> > > [   18.853836] WARNING: CPU: 0 PID: 5 at drivers/thunderbolt/nhi.c:103
> > > ring_interrupt_active+0x1b7/0x1da
> > > ...
> > > [   18.977736] CPU: 0 PID: 5 Comm: kworker/0:0 Tainted: G     U
> > >     5.13.0-next-20210709 #18
> > > [   18.996804] Workqueue: pm pm_runtime_work
> > > [   19.001285] RIP: 0010:ring_interrupt_active+0x1b7/0x1da
> > > ...
> > > [   19.100302] Call Trace:
> > > [   19.103031]  tb_ring_stop+0x9d/0x17d
> > > [   19.107022]  tb_ctl_stop+0x33/0xa0
> > > [   19.110822]  tb_domain_runtime_suspend+0x35/0x3a
> > > [   19.115979]  nhi_runtime_suspend+0x1f/0x4c
> > > [   19.120557]  pci_pm_runtime_suspend+0x5a/0x173
> > > [   19.125533]  ? pci_pm_restore_noirq+0x73/0x73
> > > [   19.130411]  __rpm_callback+0x8a/0x10d
> > > [   19.134595]  rpm_callback+0x22/0x74
> > > [   19.138489]  ? pci_pm_restore_noirq+0x73/0x73
> > > [   19.143355]  rpm_suspend+0x21e/0x514
> > > [   19.147355]  pm_runtime_work+0x8a/0xa5
> > > [   19.151554]  process_one_work+0x1b7/0x368
> > > [   19.156027]  worker_thread+0x213/0x372
> > > [   19.160217]  kthread+0x147/0x15f
> > > [   19.163827]  ? pr_cont_work+0x58/0x58
> > > [   19.167928]  ? kthread_blkcg+0x31/0x31
> > > [   19.172113]  ret_from_fork+0x1f/0x30
> > > [   19.176105] ---[ end trace 438b7f20f6b4049d ]---
> >
> > I used to see these timeout errors, when there was a control
> > read/write issued to the thunderbolt/usb4 device, after the
> > thunderbolt driver is suspended.
> > Can you share the steps to reproduce this S4 issue in a Chrome device?
> >
> > Thanks
> > Raj

      reply	other threads:[~2021-07-13 22:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 21:31 thunderbolt: Warning and 20 second delay in S4 Evan Green
2021-07-10  6:34 ` Greg KH
2021-07-12 23:46   ` Evan Green
2021-07-13  0:16     ` Mani, Rajmohan
2021-07-13 20:50       ` Evan Green
2021-07-13 22:00         ` Mani, Rajmohan [this message]

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=DM6PR11MB3963600521EF82346CB7F5D5F6149@DM6PR11MB3963.namprd11.prod.outlook.com \
    --to=rajmohan.mani@intel.com \
    --cc=evgreen@chromium.org \
    --cc=gil.fine@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=pmalani@google.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.