[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=W61ZHYJADiR1CYgS-aNisDR4KoEA3RW2_8kW3KUd1g5g@mail.gmail.com>
Date: Wed, 17 Jan 2024 13:52:08 -0800
From: Doug Anderson <dianders@...gle.com>
To: Johan Hovold <johan@...nel.org>
Cc: Matthias Kaehlcke <mka@...omium.org>, Johan Hovold <johan+linaro@...nel.org>,
Marcel Holtmann <marcel@...tmann.org>, Johan Hedberg <johan.hedberg@...il.com>,
Luiz Augusto von Dentz <luiz.dentz@...il.com>, Bjorn Andersson <quic_bjorande@...cinc.com>,
Konrad Dybcio <konrad.dybcio@...aro.org>, linux-bluetooth@...r.kernel.org,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org, Balakrishna Godavarthi <quic_bgodavar@...cinc.com>,
Stephen Boyd <swboyd@...gle.com>
Subject: Re: [PATCH] Bluetooth: qca: fix device-address endianness
Hi,
On Wed, Jan 10, 2024 at 12:12 AM Johan Hovold <johan@...nel.org> wrote:
>
> > > So the first question is whether there actually is any boot firmware out
> > > there which passes the BD_ADDR in reverse order?
> >
> > Yes, (at least) the boot firmware for sc7180-trogdor devices.
> >
> > hexdump -C /proc/device-tree/soc\@0/geniqup\@8c0000/serial\@88c000/bluetooth/local-bd-address
> > 00000000 8c fd f0 40 15 dc
>
> Indeed, this should have been LE order.
In case it adds any extra data points, we also do similar with the
WiFi MAC address and it also seems to be big endian.
lazor-rev9 /proc/device-tree/soc@...ifi@...00000 # hexdump -C local-mac-address
00000000 8c fd f0 3e 3e 86 |...>>.|
00000006
lazor-rev9 /proc/device-tree/soc@...ifi@...00000 # ifconfig wlan0 | grep ether
ether 8c:fd:f0:3e:3e:86 txqueuelen 1000 (Ethernet)
> > hciconfig
> > hci0: Type: Primary Bus: UART
> > BD Address: 8C:FD:F0:40:15:DC ACL MTU: 1024:8 SCO MTU: 240:8
> > UP RUNNING
> > RX bytes:1700 acl:0 sco:0 events:95 errors:0
> > TX bytes:128949 acl:0 sco:0 commands:578 errors:0
>
> And any user space tool overriding the address would currently need to
> provide the address in reverse order on Qualcomm platforms like this
> one (e.g. if generating the address for privacy reasons).
>
> > > > I suggest adding a quirk like 'local-bd-address-msb-quirk' or
> > > > 'qcom,local-bd-address-msb-quirk' to make sure existing devices keep
> > > > working properly.
> > >
> > > I don't think that would work. If this is something that we really need
> > > to handle, then there's probably no way around introducing new
> > > compatible strings for boot firmware that isn't broken while maintaining
> > > the current broken behaviour with respect to 'local-bd-address' for some
> > > of the current ones.
> >
> > I think it should work for sc7180-trogdor. For these devices the device tree
> > is bundled with the kernel image and can be updated. That might not be true
> > for other devices though.
>
> Thanks for confirming.
>
> I'm still hoping we can get away with not having to add quirks to
> Bluetooth core for broken Qualcomm boot firmware. Let's see if anyone
> knows of a use case that makes that impossible to avoid.
>
> Johan
Powered by blists - more mailing lists