Hi, On Thu, Apr 25, 2024 at 9:13 AM Johan Hovold <johan@xxxxxxxxxx> wrote: > > On Thu, Apr 25, 2024 at 11:22:50PM +0800, Doug Anderson wrote: > > > Quick question. I haven't spent lots of time digging into the > > Bluetooth subsystem, but it seems like if the device tree property is > > there it should take precedence anyway, shouldn't it? In other words: > > if we think there is built-in storage for the MAC address but we also > > see a device tree property then we need to decide which of the two we > > are going to use. Are there any instances where there's a bogus DT > > property and we want the built-in storage to override it? > > I guess we could decide to implement something like that, but note that > a devicetree may have an all-zero address defined by default which the > boot firmware may or may not fill in. > > So we can't just use the presence of the address property as an > indication that the device has an address, but we could of course parse > it and see if it's non-zero first. (Actually, I think this bit about > checking for a non-zero address is already implemented.) This would make me feel safer. Given that you've now found that the MAC address is in the firmware, I worry that someone will update the firmware and change the default and we'll forget to update here. _Hopefully_ someone would notice before pushing the firmware out to the world, but it still seems like a more fragile solution than just seeing that there's a perfectly valid BT address in the device tree and using that. > Note however that we still need to determine when the controller address > is invalid for the common case where there is no devicetree property and > user space needs to provide an address before the controller can be used. Fair enough. -Doug