lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240902161250.26846654@xps-13>
Date: Mon, 2 Sep 2024 16:12:50 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Frank Li <Frank.li@....com>
Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>, Boris Brezillon
 <boris.brezillon@...labora.com>, Parshuram Thombare <pthombar@...ence.com>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Boris Brezillon
 <bbrezillon@...nel.org>, Arnd Bergmann <arnd@...db.de>, Conor Culhane
 <conor.culhane@...vaco.com>, linux-i3c@...ts.infradead.org,
 linux-kernel@...r.kernel.org, imx@...ts.linux.dev
Subject: Re: [PATCH v3 03/11] i3c: master: Extend address status bit to 4
 and add I3C_ADDR_SLOT_EXT_INIT

Hi Frank,
  
> > > switch to this address if it is free.
> > >  *
> > > In step 1, i3c_bus_get_free_addr() is called. To optimize for step 2b, this
> > > function should return an address that is not pre-reserved by any target
> > > device with an assigned address in the device tree (DT).  
> >
> > This does not make sense, if you want to optimize for 2b, why not
> > selecting the assigned-address property in the first place if it's
> > available?  
> 
> This is my first idea. But I gived up this way.
> 
> Select an assigned-address here will involve a big change in i3c framework.
> There are no PID information in i3c_master_get_free_addr().
> 
> In DAA flow:
> - SVC is get PID first, the get_free_addr(). This case, we can use PID to
> get dt assigned address.(if change/add API)
> - But HCI, it is difference, hci_cmd_v2_daa(), get_free_addr() firstly then
> send out DAA command. So no PID information when call get_free_addr().
> 
> To cover both case, return a *real* free address here is simplest solution.

But this is a limitation of the HCI driver? So why not addressing this
in the HCI driver instead? It would greatly simplify the core logic
which becomes complex for wrong reasons.

> >  Also, I don't understand why you would care to specifically
> > *not* return an address that might be the default one for another
> > device in the first place.  
> 
> If devices A (want adddress 0xA), device B (want address 0xB), if both
> device send hot join at the same time. device B's PID less than device A,
> 
> Device B will be found firstly, call get_free_addr(), 0xA will be return
> if no this patch.
> 
> Device A, call try_get_freeaddr() to get 0xB.
> 
> So Devcie B will be assign to 0xA, and Device A will be assign to address 0xB.
> 
> After do_daa command, framework will add device B and device A into i3c bus.
> 
> When framework try to add device B to i3c bus, framework will try switch
> device B's address to 0xB from 0xA, but it will be fail because 0xB already
> assigned to device A.

Well, okay, but that's exactly the situation that will happen if these
devices are not described in your DT. I guess it's expected that a
device not described in your DT can be connected, thanks to the
hot-join feature. In this case you cannot know what is this device
preferred address and you might end-up in the exact same situation.

May I question the need for preferred addresses at all? Is this even
part of the spec? What is the use-case?

Thanks,
Miquèl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ