2019-08-29 10:21:52

by Vitor Soares

[permalink] [raw]
Subject: [PATCH 0/4] i3c: remove device if failed on pre_assign_dyn_addr()

This patch series remove the devices that fail during
pre_assign_dyn_addr() and were being sent on DEFSVLS command.
With the change above, during the i3c_master_add_i3c_dev_locked() is
necessary to check if the device has i3c_boardinfo and try to assign the
i3c_dev_boardinfo->init_dyn_addr if there no oldev. This change will
allow to describe in DT device with preferable dynamic address but without
static address.

Vitor Soares (4):
"i3c: detach and free device if pre_assign_dyn_addr fails "
i3c: check i3c_boardinfo during i3c_master_add_i3c_dev_locked
update i3c bingins
i3c: master: dw: Reattach device on first empty location of DAT

Documentation/devicetree/bindings/i3c/i3c.txt | 13 ++++++++---
drivers/i3c/master.c | 33 ++++++++++++++++++++++++---
drivers/i3c/master/dw-i3c-master.c | 16 +++++++++++++
3 files changed, 56 insertions(+), 6 deletions(-)

--
2.7.4


2019-08-29 10:22:21

by Vitor Soares

[permalink] [raw]
Subject: [PATCH 3/4] dt-bindings: i3c: Make 'assigned-address' valid if static address != 0

The I3C devices without a static address can require a specific dynamic
address for priority reasons.

Let's update the binding document to make the 'assigned-address' property
valid if static address != 0 and add an example with this use case.

Signed-off-by: Vitor Soares <[email protected]>
---
Documentation/devicetree/bindings/i3c/i3c.txt | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/i3c/i3c.txt b/Documentation/devicetree/bindings/i3c/i3c.txt
index ab729a0..c851e75 100644
--- a/Documentation/devicetree/bindings/i3c/i3c.txt
+++ b/Documentation/devicetree/bindings/i3c/i3c.txt
@@ -98,9 +98,7 @@ Required properties

Optional properties
-------------------
-- assigned-address: dynamic address to be assigned to this device. This
- property is only valid if the I3C device has a static
- address (first cell of the reg property != 0).
+- assigned-address: dynamic address to be assigned to this device.


Example:
@@ -129,6 +127,15 @@ Example:

/*
* I3C device without a static I2C address but requiring
+ * specific dynamic address.
+ */
+ sensor@0,39200154004 {
+ reg = <0x0 0x6072 0x303904d2>;
+ assigned-address = <0xb>;
+ };
+
+ /*
+ * I3C device without a static I2C address but requiring
* resources described in the DT.
*/
sensor@0,39200154004 {
--
2.7.4

2019-08-29 10:54:38

by Boris Brezillon

[permalink] [raw]
Subject: Re: [PATCH 3/4] dt-bindings: i3c: Make 'assigned-address' valid if static address != 0

On Thu, 29 Aug 2019 12:19:34 +0200
Vitor Soares <[email protected]> wrote:

> The I3C devices without a static address can require a specific dynamic
> address for priority reasons.
>
> Let's update the binding document to make the 'assigned-address' property
> valid if static address != 0 and add an example with this use case.

^ you mean static address == 0, right?

Yes, it makes sense to support that case and do our best to assign the
requested address after DAA has taken place by explicitly executing
SETDA.

>
> Signed-off-by: Vitor Soares <[email protected]>
> ---
> Documentation/devicetree/bindings/i3c/i3c.txt | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/i3c/i3c.txt b/Documentation/devicetree/bindings/i3c/i3c.txt
> index ab729a0..c851e75 100644
> --- a/Documentation/devicetree/bindings/i3c/i3c.txt
> +++ b/Documentation/devicetree/bindings/i3c/i3c.txt
> @@ -98,9 +98,7 @@ Required properties
>
> Optional properties
> -------------------
> -- assigned-address: dynamic address to be assigned to this device. This
> - property is only valid if the I3C device has a static
> - address (first cell of the reg property != 0).
> +- assigned-address: dynamic address to be assigned to this device.

We should probably mention that we don't provide strong guarantees
here. We will try to assign this dynamic address to the device, but if
something fails (like another device owning the address and refusing to
give it up), the actual dynamic address will be different.
This clarification can be done in a separate patch.

>
>
> Example:
> @@ -129,6 +127,15 @@ Example:
>
> /*
> * I3C device without a static I2C address but requiring
> + * specific dynamic address.
> + */
> + sensor@0,39200154004 {
> + reg = <0x0 0x6072 0x303904d2>;
> + assigned-address = <0xb>;
> + };
> +
> + /*
> + * I3C device without a static I2C address but requiring
> * resources described in the DT.
> */
> sensor@0,39200154004 {

2019-08-29 14:09:22

by Vitor Soares

[permalink] [raw]
Subject: RE: [PATCH 3/4] dt-bindings: i3c: Make 'assigned-address' valid if static address != 0

Hi Boris,

From: Boris Brezillon <[email protected]>
Date: Thu, Aug 29, 2019 at 11:51:38

> On Thu, 29 Aug 2019 12:19:34 +0200
> Vitor Soares <[email protected]> wrote:
>
> > The I3C devices without a static address can require a specific dynamic
> > address for priority reasons.
> >
> > Let's update the binding document to make the 'assigned-address' property
> > valid if static address != 0 and add an example with this use case.
>
> ^ you mean static address == 0, right?

Indeed.

>
> Yes, it makes sense to support that case and do our best to assign the
> requested address after DAA has taken place by explicitly executing
> SETDA.
>
> >
> > Signed-off-by: Vitor Soares <[email protected]>
> > ---
> > Documentation/devicetree/bindings/i3c/i3c.txt | 13 ++++++++++---
> > 1 file changed, 10 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/i3c/i3c.txt b/Documentation/devicetree/bindings/i3c/i3c.txt
> > index ab729a0..c851e75 100644
> > --- a/Documentation/devicetree/bindings/i3c/i3c.txt
> > +++ b/Documentation/devicetree/bindings/i3c/i3c.txt
> > @@ -98,9 +98,7 @@ Required properties
> >
> > Optional properties
> > -------------------
> > -- assigned-address: dynamic address to be assigned to this device. This
> > - property is only valid if the I3C device has a static
> > - address (first cell of the reg property != 0).
> > +- assigned-address: dynamic address to be assigned to this device.
>
> We should probably mention that we don't provide strong guarantees
> here. We will try to assign this dynamic address to the device, but if
> something fails (like another device owning the address and refusing to
> give it up), the actual dynamic address will be different.
> This clarification can be done in a separate patch.

So, another patch on top of this one explaining that, right?

I would suggest to use a dynamic address, like 0x40 (mid priority), on
ENTDAA so lowers addresses (High Priority) can be used in DT or another
method.

What do you think about this?

>
> >
> >
> > Example:
> > @@ -129,6 +127,15 @@ Example:
> >
> > /*
> > * I3C device without a static I2C address but requiring
> > + * specific dynamic address.
> > + */
> > + sensor@0,39200154004 {
> > + reg = <0x0 0x6072 0x303904d2>;
> > + assigned-address = <0xb>;
> > + };
> > +
> > + /*
> > + * I3C device without a static I2C address but requiring
> > * resources described in the DT.
> > */
> > sensor@0,39200154004 {

Best regards,
Vitor Soares