linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ajay Gupta <ajayg@nvidia.com>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"open list:I2C CONTROLLER DRIVER FOR NVIDIA GPU" 
	<linux-i2c@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] i2c: nvidia-gpu: Handle timeout correctly in gpu_i2c_check_status()
Date: Mon, 23 Mar 2020 16:47:17 +0000	[thread overview]
Message-ID: <BYAPR12MB2727B1862E56594E4B6A3E0ADCF00@BYAPR12MB2727.namprd12.prod.outlook.com> (raw)
In-Reply-To: <DA56E103-CAA7-4C28-9528-9EAFF2C717CD@canonical.com>

Kai-Heng

> -----Original Message-----
> From: Kai-Heng Feng <kai.heng.feng@canonical.com>
> Sent: Sunday, March 22, 2020 10:38 PM
> To: Ajay Gupta <ajayg@nvidia.com>
> Cc: Wolfram Sang <wsa@the-dreams.de>; Andy Shevchenko
> <andriy.shevchenko@linux.intel.com>; open list:I2C CONTROLLER DRIVER FOR
> NVIDIA GPU <linux-i2c@vger.kernel.org>; open list <linux-
> kernel@vger.kernel.org>
> Subject: Re: [PATCH] i2c: nvidia-gpu: Handle timeout correctly in
> gpu_i2c_check_status()
> 
> External email: Use caution opening links or attachments
> 
> 
> > On Mar 12, 2020, at 00:58, Kai-Heng Feng <kai.heng.feng@canonical.com>
> wrote:
> >
> > Nvidia card may come with a "phantom" UCSI device, and its driver gets
> > stuck in probe routine, prevents any system PM operations like suspend.
> >
> > Let's handle the unaccounted case that the target time equals to
> > jiffies in gpu_i2c_check_status(), so the UCSI driver can let the
> > probe fail as it should.
If status is not seen in 999.5 ms then I don't see any reason why it will come
exactly at 1000ms. In fact,  we expect status to be seen within 160ms as per
I2C_MST_I2C0_TIMING_TIMEOUT_CLK_CNT (16 cycle) and 
I2C_MST_I2C0_TIMING_SCL_PERIOD_100KHZ (10ms/cycle) programmed in 
I2C_MST_I2C0_TIMING Register. We already have enough extra time to look
For response.

Thanks
> nvpublic
> >
> > Fixes: c71bcdcb42a7 ("i2c: add i2c bus driver for NVIDIA GPU")
> > Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> 
> A gentle ping...
> 
> > ---
> > drivers/i2c/busses/i2c-nvidia-gpu.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c
> > b/drivers/i2c/busses/i2c-nvidia-gpu.c
> > index 62e18b4db0ed..1988e93c7925 100644
> > --- a/drivers/i2c/busses/i2c-nvidia-gpu.c
> > +++ b/drivers/i2c/busses/i2c-nvidia-gpu.c
> > @@ -88,7 +88,7 @@ static int gpu_i2c_check_status(struct gpu_i2c_dev
> *i2cd)
> >               usleep_range(500, 600);
> >       } while (time_is_after_jiffies(target));
> >
> > -     if (time_is_before_jiffies(target)) {
> > +     if (time_is_before_eq_jiffies(target)) {
> >               dev_err(i2cd->dev, "i2c timeout error %x\n", val);
> >               return -ETIMEDOUT;
> >       }
> > --
> > 2.17.1
> >


  reply	other threads:[~2020-03-23 16:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 16:58 [PATCH] i2c: nvidia-gpu: Handle timeout correctly in gpu_i2c_check_status() Kai-Heng Feng
2020-03-23  5:38 ` Kai-Heng Feng
2020-03-23 16:47   ` Ajay Gupta [this message]
2020-03-23 17:20     ` Kai-Heng Feng
2020-03-24  3:51       ` Ajay Gupta
2020-03-24 11:09 ` Wolfram Sang
2020-03-24 11:12   ` Kai-Heng Feng

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=BYAPR12MB2727B1862E56594E4B6A3E0ADCF00@BYAPR12MB2727.namprd12.prod.outlook.com \
    --to=ajayg@nvidia.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /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).