All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: "Pandey, Radhey Shyam" <radheys@amd.com>
Cc: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>,
	gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, git@amd.com
Subject: Re: [PATCH 1/3] usb: typec: tipd: add error message for vendor ID read failure
Date: Tue, 19 May 2026 16:54:19 +0300	[thread overview]
Message-ID: <agxri7tZMHA1gyqz@kuha> (raw)
In-Reply-To: <a80587a6-7833-4af0-a882-1748cd6cad7e@amd.com>

On Mon, May 18, 2026 at 09:23:58PM +0530, Pandey, Radhey Shyam wrote:
> On 5/18/2026 3:49 PM, Heikki Krogerus wrote:
> > On Wed, May 13, 2026 at 11:58:48PM +0530, Radhey Shyam Pandey wrote:
> > > Log when the vendor ID read fails or returns zero, including the I2C error
> > > code and register value, to ease probe diagnostics.
> > > 
> > > Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
> > > ---
> > >   drivers/usb/typec/tipd/core.c | 7 +++++--
> > >   1 file changed, 5 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
> > > index 43faec794b95..b282366b5326 100644
> > > --- a/drivers/usb/typec/tipd/core.c
> > > +++ b/drivers/usb/typec/tipd/core.c
> > > @@ -1744,7 +1744,7 @@ static int tps6598x_probe(struct i2c_client *client)
> > >   	struct tps6598x *tps;
> > >   	struct fwnode_handle *fwnode;
> > >   	u32 status;
> > > -	u32 vid;
> > > +	u32 vid = 0;
> > 
> > Why is this necessary?
> 
> Thanks for the review.
> 
> When ret < 0, tps6598x_read32() → tps6598x_block_read() returns on
> error before writing *val. So vid is never set; passing it to
> dev_err with %#x would read an uninitialized u32(random log noise).
> 
> ret captures if I2C/regmap path reported an error and vid tells what
> came back when the transport layer did not fail. Hope that clarifies.

Okay, got it.

Thanks,

> Thanks,
> Radhey
> > 
> > >   	int ret;
> > >   	data = i2c_get_match_data(client);
> > > @@ -1772,8 +1772,11 @@ static int tps6598x_probe(struct i2c_client *client)
> > >   	if (!device_is_compatible(tps->dev, "ti,tps25750")) {
> > >   		ret = tps6598x_read32(tps, TPS_REG_VID, &vid);
> > > -		if (ret < 0 || !vid)
> > > +		if (ret < 0 || !vid) {
> > > +			dev_err(tps->dev, "failed to read vendor ID: %d, vid: %#x\n",
> > > +				ret, vid);
> > >   			return -ENODEV;
> > > +		}
> > >   	}
> > >   	/*
> > > -- 
> > > 2.44.4
> > 

-- 
heikki

  reply	other threads:[~2026-05-19 13:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 18:28 [PATCH 0/3] usb: typec: tipd: improve probe diagnostics and POWER_STATUS handling Radhey Shyam Pandey
2026-05-13 18:28 ` [PATCH 1/3] usb: typec: tipd: add error message for vendor ID read failure Radhey Shyam Pandey
2026-05-18 10:19   ` Heikki Krogerus
2026-05-18 15:53     ` Pandey, Radhey Shyam
2026-05-19 13:54       ` Heikki Krogerus [this message]
2026-05-19 16:23         ` Pandey, Radhey Shyam
2026-05-13 18:28 ` [PATCH 2/3] usb: typec: tipd: demote missing IRQ log to info for polling mode Radhey Shyam Pandey
2026-05-18 10:26   ` Heikki Krogerus
2026-05-18 15:56     ` Pandey, Radhey Shyam
2026-05-13 18:28 ` [PATCH 3/3] usb: typec: tipd: name TPS_REG_POWER_STATUS field masks Radhey Shyam Pandey
2026-05-18 10:34   ` Heikki Krogerus

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=agxri7tZMHA1gyqz@kuha \
    --to=heikki.krogerus@linux.intel.com \
    --cc=git@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=radheys@amd.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.