Linux-i3c Archive on lore.kernel.org
 help / color / Atom feed
From: "Przemysław Gaj" <pgaj@cadence.com>
To: Vitor Soares <Vitor.Soares@synopsys.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 v4 2/6] i3c: master: pre-reserve boardinfo->init_dyn_addr when available
Date: Wed, 11 Dec 2019 09:51:47 +0100
Message-ID: <20191211085146.GA10780@global.cadence.com> (raw)
In-Reply-To: <CH2PR12MB4216FBF6BA2155A47C76D180AE5B0@CH2PR12MB4216.namprd12.prod.outlook.com>

Hi Vitor,

The 12/10/2019 15:24, Vitor Soares wrote:
> 
> Hi Przemysław,
> 
> From: Przemysław Gaj <pgaj@cadence.com>
> Date: Tue, Dec 10, 2019 at 10:14:58
> 
> > It may be the case that SETDASA fails for some reason. Reserve
> > ->init_dyn_addr when it's defined to prevent assigning this address
> > to another slave device. This way when device shows up we don't
> > have to re-assign addresses.
> > 
> > Signed-off-by: Przemysław Gaj <pgaj@cadence.com>
> > ---
> >  drivers/i3c/master.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> > index 5c06c41e6660..fab6e0609fca 100755
> > --- a/drivers/i3c/master.c
> > +++ b/drivers/i3c/master.c
> > @@ -1263,7 +1263,8 @@ static void i3c_master_put_i3c_addrs(struct i3c_dev_desc *dev)
> >  					     I3C_ADDR_SLOT_FREE);
> >  
> >  	if (dev->boardinfo && dev->boardinfo->init_dyn_addr)
> > -		i3c_bus_set_addr_slot_status(&master->bus, dev->info.dyn_addr,
> > +		i3c_bus_set_addr_slot_status(&master->bus,
> > +					     dev->boardinfo->init_dyn_addr,
> >  					     I3C_ADDR_SLOT_FREE);
> >  }
> >  
> > @@ -1675,6 +1676,11 @@ static int i3c_master_bus_init(struct i3c_master_controller *master)
> >  				ret = -EBUSY;
> >  				goto err_detach_devs;
> >  			}
> > +
> > +			/* Reserve the slot. */
> > +			i3c_bus_set_addr_slot_status(&master->bus,
> > +						     i3cboardinfo->init_dyn_addr,
> > +						     I3C_ADDR_SLOT_I3C_DEV);
> >  		}
> >  
> >  		i3cdev = i3c_master_alloc_i3c_dev(master, &info);
> > -- 
> > 2.14.0
> 
> In my experience we should pre-reserve all DT DA entries and not use them 
> during the ENTDAA for safety reasons.
> That would be one of my next steps in this patch series.

Actually, I reserve DT DA address above. The only thing I will rework, I
won't free up the address. That will be documented in the code.

We can rework it later if really needed.

> 
> Best regards,
> Vitor Soares
> 

-- 
-- 
Regards,
Przemek

_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

  reply index

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 10:14 [PATCH v4 0/6] I3C device addresing adjustments Przemysław Gaj
2019-12-10 10:14 ` [PATCH v4 1/6] i3c: master: make sure ->boardinfo is initialized in add_i3c_dev_locked() Przemysław Gaj
2019-12-10 10:14 ` [PATCH v4 2/6] i3c: master: pre-reserve boardinfo->init_dyn_addr when available Przemysław Gaj
2019-12-10 13:29   ` Boris Brezillon
2019-12-10 15:24   ` Vitor Soares
2019-12-11  8:51     ` Przemysław Gaj [this message]
2019-12-10 10:14 ` [PATCH v4 3/6] i3c: master: make sure the PID is set before registering the device Przemysław Gaj
2019-12-10 10:15 ` [PATCH v4 4/6] dt-bindings: i3c: Make 'assigned-address' valid if static address == 0 Przemysław Gaj
2019-12-10 10:15 ` [PATCH v4 5/6] dt-bindings: i3c: add a note for no guarantee of 'assigned-address' use Przemysław Gaj
2019-12-10 10:15 ` [PATCH v4 6/6] i3c: master: dw: reattach device on first available location of address table Przemysław Gaj
2019-12-10 14:40   ` Vitor Soares
2019-12-10 14:43     ` Przemysław Gaj
2019-12-10 14:52     ` Boris Brezillon

Reply instructions:

You may reply publically 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=20191211085146.GA10780@global.cadence.com \
    --to=pgaj@cadence.com \
    --cc=Vitor.Soares@synopsys.com \
    --cc=bbrezillon@kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --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

Linux-i3c Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-i3c/0 linux-i3c/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-i3c linux-i3c/ https://lore.kernel.org/linux-i3c \
		linux-i3c@lists.infradead.org
	public-inbox-index linux-i3c

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-i3c


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git