linux-i3c.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Vitor Soares <Vitor.Soares@synopsys.com>
To: "Boris Brezillon" <boris.brezillon@collabora.com>,
	"Przemysław Gaj" <pgaj@cadence.com>
Cc: "linux-i3c@lists.infradead.org" <linux-i3c@lists.infradead.org>,
	"rafalc@cadence.com" <rafalc@cadence.com>,
	"bbrezillon@kernel.org" <bbrezillon@kernel.org>
Subject: RE: [PATCH] i3c: make sure the PID is set before registering the device
Date: Mon, 9 Dec 2019 12:20:03 +0000	[thread overview]
Message-ID: <CH2PR12MB42164BC8E6A616AF111D45B1AE580@CH2PR12MB4216.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20191209104711.5a549d31@collabora.com>

Hi Boris,

From: Boris Brezillon <boris.brezillon@collabora.com>
Date: Mon, Dec 09, 2019 at 09:47:11

> On Sun, 8 Dec 2019 15:18:34 +0100
> Przemysław Gaj <pgaj@cadence.com> wrote:
> 
> > From: Przemyslaw Gaj <pgaj@cadence.com>
> > 
> > Provisioned ID (PID) is the value with which device drivers are
> > matched. I check the value before registering the device.
> > 
> 
> Can this situation (having a device with a DA but without a valid PID)
> happen right now or is this something you need to support secondary
> masters who receive device DA (through DEFSVLS) without being able to
> query extra information until they own the bus?

This is the use case where a device fails the 
i3c_master_pre_assign_dyn_addr() and I already mention it on [1].
I still think the best way is to detach/free the devices that fails 
during i3c_master_pre_assign_dyn_addr().

> 
> > Signed-off-by: Przemyslaw Gaj <pgaj@cadence.com>
> > ---
> >  drivers/i3c/master.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> > index 043691656245..07ea8b0b7736 100644
> > --- a/drivers/i3c/master.c
> > +++ b/drivers/i3c/master.c
> > @@ -1449,7 +1449,8 @@ i3c_master_register_new_i3c_devs(struct i3c_master_controller *master)
> >  		return;
> >  
> >  	i3c_bus_for_each_i3cdev(&master->bus, desc) {
> > -		if (desc->dev || !desc->info.dyn_addr || desc == master->this)
> > +		if (desc->dev || !desc->info.dyn_addr ||
> > +		    desc == master->this || !desc->info.pid)
> >  			continue;
> >  
> >  		desc->dev = kzalloc(sizeof(*desc->dev), GFP_KERNEL);

Best regards,
Vitor Soares

[1] https://patchwork.kernel.org/patch/11132601/
_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

  reply	other threads:[~2019-12-09 12:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-08 14:18 [PATCH] i3c: make sure the PID is set before registering the device Przemysław Gaj
2019-12-09  9:47 ` Boris Brezillon
2019-12-09 12:20   ` Vitor Soares [this message]
2019-12-09 12:26     ` Boris Brezillon
2019-12-10 14:28       ` Vitor Soares
2019-12-10 14:42         ` Przemysław Gaj
2019-12-10 15:23           ` Vitor Soares
2019-12-11  9:33             ` Przemysław Gaj
2019-12-11 12:21               ` Vitor Soares

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=CH2PR12MB42164BC8E6A616AF111D45B1AE580@CH2PR12MB4216.namprd12.prod.outlook.com \
    --to=vitor.soares@synopsys.com \
    --cc=bbrezillon@kernel.org \
    --cc=boris.brezillon@collabora.com \
    --cc=linux-i3c@lists.infradead.org \
    --cc=pgaj@cadence.com \
    --cc=rafalc@cadence.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 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).