All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: typec: ucsi_ccg: use dev_info for timeout error
@ 2020-09-21 17:42 Ajay Gupta
  2020-09-21 18:54 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Ajay Gupta @ 2020-09-21 17:42 UTC (permalink / raw)
  To: heikki.krogerus; +Cc: linux-usb, Ajay Gupta

From: Ajay Gupta <ajayg@nvidia.com>

Timeout error may be seen due to missing USB Type-C UCSI controller
on some NVIDIA GPU card. Currently we don't have a correct way to
identify these cards.

Tools like Plymouth (splashscreen) doesn't like dev_err so
changing timeout status log to dev_info.

Bug information:
https://bugzilla.kernel.org/show_bug.cgi?id=206653

Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
---
 drivers/usb/typec/ucsi/ucsi_ccg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index bff96d64dddf..d69432df866e 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -252,7 +252,7 @@ static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8 *data, u32 len)
 		put_unaligned_le16(rab, buf);
 		status = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
 		if (status < 0) {
-			dev_err(uc->dev, "i2c_transfer failed %d\n", status);
+			dev_info(uc->dev, "i2c_transfer failed %d\n", status);
 			pm_runtime_put_sync(uc->dev);
 			return status;
 		}
@@ -289,7 +289,7 @@ static int ccg_write(struct ucsi_ccg *uc, u16 rab, const u8 *data, u32 len)
 	pm_runtime_get_sync(uc->dev);
 	status = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
 	if (status < 0) {
-		dev_err(uc->dev, "i2c_transfer failed %d\n", status);
+		dev_info(uc->dev, "i2c_transfer failed %d\n", status);
 		pm_runtime_put_sync(uc->dev);
 		kfree(buf);
 		return status;
@@ -1345,7 +1345,7 @@ static int ucsi_ccg_probe(struct i2c_client *client,
 	/* reset ccg device and initialize ucsi */
 	status = ucsi_ccg_init(uc);
 	if (status < 0) {
-		dev_err(uc->dev, "ucsi_ccg_init failed - %d\n", status);
+		dev_info(uc->dev, "ucsi_ccg_init failed - %d\n", status);
 		return status;
 	}
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: typec: ucsi_ccg: use dev_info for timeout error
  2020-09-21 17:42 [PATCH] usb: typec: ucsi_ccg: use dev_info for timeout error Ajay Gupta
@ 2020-09-21 18:54 ` Greg KH
  2020-09-21 20:50   ` Ajay Gupta
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2020-09-21 18:54 UTC (permalink / raw)
  To: Ajay Gupta; +Cc: heikki.krogerus, linux-usb, Ajay Gupta

On Mon, Sep 21, 2020 at 10:42:16AM -0700, Ajay Gupta wrote:
> From: Ajay Gupta <ajayg@nvidia.com>
> 
> Timeout error may be seen due to missing USB Type-C UCSI controller
> on some NVIDIA GPU card. Currently we don't have a correct way to
> identify these cards.

No unique id anywhere???  That feels like someone really messed up :(

> 
> Tools like Plymouth (splashscreen) doesn't like dev_err so
> changing timeout status log to dev_info.
> 
> Bug information:
> https://bugzilla.kernel.org/show_bug.cgi?id=206653
> 
> Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
> ---
>  drivers/usb/typec/ucsi/ucsi_ccg.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index bff96d64dddf..d69432df866e 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -252,7 +252,7 @@ static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8 *data, u32 len)
>  		put_unaligned_le16(rab, buf);
>  		status = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
>  		if (status < 0) {
> -			dev_err(uc->dev, "i2c_transfer failed %d\n", status);
> +			dev_info(uc->dev, "i2c_transfer failed %d\n", status);

It's an error, leave it an error.

If it's not an error, don't log it.

Or better yet, fix the hardware :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] usb: typec: ucsi_ccg: use dev_info for timeout error
  2020-09-21 18:54 ` Greg KH
@ 2020-09-21 20:50   ` Ajay Gupta
  2020-09-22  5:43     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Ajay Gupta @ 2020-09-21 20:50 UTC (permalink / raw)
  To: Greg KH, Ajay Gupta; +Cc: heikki.krogerus, linux-usb

Hi Greg

> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Monday, September 21, 2020 11:55 AM
> To: Ajay Gupta <ajaykuee@gmail.com>
> Cc: heikki.krogerus@linux.intel.com; linux-usb@vger.kernel.org; Ajay Gupta
> <ajayg@nvidia.com>
> Subject: Re: [PATCH] usb: typec: ucsi_ccg: use dev_info for timeout error
> 
> External email: Use caution opening links or attachments
> 
> 
> On Mon, Sep 21, 2020 at 10:42:16AM -0700, Ajay Gupta wrote:
> > From: Ajay Gupta <ajayg@nvidia.com>
> >
> > Timeout error may be seen due to missing USB Type-C UCSI controller on
> > some NVIDIA GPU card. Currently we don't have a correct way to
> > identify these cards.
> 
> No unique id anywhere???  That feels like someone really messed up :(
Yes, there is none.
> 
> >
> > Tools like Plymouth (splashscreen) doesn't like dev_err so changing
> > timeout status log to dev_info.
> >
> > Bug information:
> > https://bugzilla.kernel.org/show_bug.cgi?id=206653
> >
> > Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
> > ---
> >  drivers/usb/typec/ucsi/ucsi_ccg.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c
> > b/drivers/usb/typec/ucsi/ucsi_ccg.c
> > index bff96d64dddf..d69432df866e 100644
> > --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> > +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> > @@ -252,7 +252,7 @@ static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8
> *data, u32 len)
> >               put_unaligned_le16(rab, buf);
> >               status = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
> >               if (status < 0) {
> > -                     dev_err(uc->dev, "i2c_transfer failed %d\n", status);
> > +                     dev_info(uc->dev, "i2c_transfer failed %d\n",
> > + status);
> 
> It's an error, leave it an error.
> 
> If it's not an error, don't log it.
Looks like this is the best option we have.

Thanks
> nvpublic
> 
> Or better yet, fix the hardware :)
> 
> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: typec: ucsi_ccg: use dev_info for timeout error
  2020-09-21 20:50   ` Ajay Gupta
@ 2020-09-22  5:43     ` Greg KH
  2020-09-22 23:24       ` Ajay Gupta
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2020-09-22  5:43 UTC (permalink / raw)
  To: Ajay Gupta; +Cc: Ajay Gupta, heikki.krogerus, linux-usb

On Mon, Sep 21, 2020 at 08:50:04PM +0000, Ajay Gupta wrote:
> Hi Greg
> 
> > -----Original Message-----
> > From: Greg KH <gregkh@linuxfoundation.org>
> > Sent: Monday, September 21, 2020 11:55 AM
> > To: Ajay Gupta <ajaykuee@gmail.com>
> > Cc: heikki.krogerus@linux.intel.com; linux-usb@vger.kernel.org; Ajay Gupta
> > <ajayg@nvidia.com>
> > Subject: Re: [PATCH] usb: typec: ucsi_ccg: use dev_info for timeout error
> > 
> > External email: Use caution opening links or attachments
> > 
> > 
> > On Mon, Sep 21, 2020 at 10:42:16AM -0700, Ajay Gupta wrote:
> > > From: Ajay Gupta <ajayg@nvidia.com>
> > >
> > > Timeout error may be seen due to missing USB Type-C UCSI controller on
> > > some NVIDIA GPU card. Currently we don't have a correct way to
> > > identify these cards.
> > 
> > No unique id anywhere???  That feels like someone really messed up :(
> Yes, there is none.

Can you identify them by the failure of an i2c transfer?  Feels like
that would work :)

> > > Tools like Plymouth (splashscreen) doesn't like dev_err so changing
> > > timeout status log to dev_info.
> > >
> > > Bug information:
> > > https://bugzilla.kernel.org/show_bug.cgi?id=206653
> > >
> > > Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
> > > ---
> > >  drivers/usb/typec/ucsi/ucsi_ccg.c | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c
> > > b/drivers/usb/typec/ucsi/ucsi_ccg.c
> > > index bff96d64dddf..d69432df866e 100644
> > > --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> > > +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> > > @@ -252,7 +252,7 @@ static int ccg_read(struct ucsi_ccg *uc, u16 rab, u8
> > *data, u32 len)
> > >               put_unaligned_le16(rab, buf);
> > >               status = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
> > >               if (status < 0) {
> > > -                     dev_err(uc->dev, "i2c_transfer failed %d\n", status);
> > > +                     dev_info(uc->dev, "i2c_transfer failed %d\n",
> > > + status);
> > 
> > It's an error, leave it an error.
> > 
> > If it's not an error, don't log it.
> Looks like this is the best option we have.

It is an error, so we log it, that's fine.  We are correctly reporting
the fact that the hardware is broken and not working properly, don't
paper over that please.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] usb: typec: ucsi_ccg: use dev_info for timeout error
  2020-09-22  5:43     ` Greg KH
@ 2020-09-22 23:24       ` Ajay Gupta
  0 siblings, 0 replies; 5+ messages in thread
From: Ajay Gupta @ 2020-09-22 23:24 UTC (permalink / raw)
  To: Greg KH; +Cc: Ajay Gupta, heikki.krogerus, linux-usb

Hi Greg

> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Monday, September 21, 2020 10:44 PM
> To: Ajay Gupta <ajayg@nvidia.com>
> Cc: Ajay Gupta <ajaykuee@gmail.com>; heikki.krogerus@linux.intel.com;
> linux-usb@vger.kernel.org
> Subject: Re: [PATCH] usb: typec: ucsi_ccg: use dev_info for timeout error
> 
> External email: Use caution opening links or attachments
> 
> 
> On Mon, Sep 21, 2020 at 08:50:04PM +0000, Ajay Gupta wrote:
> > Hi Greg
> >
> > > -----Original Message-----
> > > From: Greg KH <gregkh@linuxfoundation.org>
> > > Sent: Monday, September 21, 2020 11:55 AM
> > > To: Ajay Gupta <ajaykuee@gmail.com>
> > > Cc: heikki.krogerus@linux.intel.com; linux-usb@vger.kernel.org; Ajay
> > > Gupta <ajayg@nvidia.com>
> > > Subject: Re: [PATCH] usb: typec: ucsi_ccg: use dev_info for timeout
> > > error
> > >
> > > External email: Use caution opening links or attachments
> > >
> > >
> > > On Mon, Sep 21, 2020 at 10:42:16AM -0700, Ajay Gupta wrote:
> > > > From: Ajay Gupta <ajayg@nvidia.com>
> > > >
> > > > Timeout error may be seen due to missing USB Type-C UCSI
> > > > controller on some NVIDIA GPU card. Currently we don't have a
> > > > correct way to identify these cards.
> > >
> > > No unique id anywhere???  That feels like someone really messed up
> > > :(
> > Yes, there is none.
> 
> Can you identify them by the failure of an i2c transfer?  Feels like that would
> work :)
Let me test it out and comeback.

> 
> > > > Tools like Plymouth (splashscreen) doesn't like dev_err so
> > > > changing timeout status log to dev_info.
> > > >
> > > > Bug information:
> > > > https://bugzilla.kernel.org/show_bug.cgi?id=206653
> > > >
> > > > Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
> > > > ---
> > > >  drivers/usb/typec/ucsi/ucsi_ccg.c | 6 +++---
> > > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c
> > > > b/drivers/usb/typec/ucsi/ucsi_ccg.c
> > > > index bff96d64dddf..d69432df866e 100644
> > > > --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> > > > +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> > > > @@ -252,7 +252,7 @@ static int ccg_read(struct ucsi_ccg *uc, u16
> > > > rab, u8
> > > *data, u32 len)
> > > >               put_unaligned_le16(rab, buf);
> > > >               status = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
> > > >               if (status < 0) {
> > > > -                     dev_err(uc->dev, "i2c_transfer failed %d\n", status);
> > > > +                     dev_info(uc->dev, "i2c_transfer failed
> > > > + %d\n", status);
> > >
> > > It's an error, leave it an error.
> > >
> > > If it's not an error, don't log it.
> > Looks like this is the best option we have.
> 
> It is an error, so we log it, that's fine.  We are correctly reporting the fact that
> the hardware is broken and not working properly, don't paper over that
> please.
Ok. 

Thanks
>nvpublic
> 
> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-22 23:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21 17:42 [PATCH] usb: typec: ucsi_ccg: use dev_info for timeout error Ajay Gupta
2020-09-21 18:54 ` Greg KH
2020-09-21 20:50   ` Ajay Gupta
2020-09-22  5:43     ` Greg KH
2020-09-22 23:24       ` Ajay Gupta

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.