Re: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth
From: Saravana Kannan
Date: Thu Apr 20 2023 - 21:43:48 EST
On Thu, Apr 20, 2023 at 12:12 PM Jonathan McDowell <noodles@xxxxxxxx> wrote:
>
> On Sun, Apr 16, 2023 at 01:24:21AM +0100, Andre Przywara wrote:
> > On Sat, 15 Apr 2023 18:46:03 +0100
> > Jonathan McDowell <noodles@xxxxxxxx> wrote:
> >
> > > The C.H.I.P has an rtl8723bs device with the bluetooth interface hooked
> > > up on UART3. Support for this didn't exist in mainline when the DTS was
> > > initially added, but it does now, so enable it.
> > >
> > > Signed-off-by: Jonathan McDowell <noodles@xxxxxxxx>
> > > ---
> > > arch/arm/boot/dts/sun5i-r8-chip.dts | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > index fd37bd1f3920..4d72a181d8aa 100644
> > > --- a/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > +++ b/arch/arm/boot/dts/sun5i-r8-chip.dts
> > > @@ -255,6 +255,10 @@ &uart3 {
> > > pinctrl-0 = <&uart3_pg_pins>,
> > > <&uart3_cts_rts_pg_pins>;
> > > status = "okay";
> > > +
> > > + bluetooth {
> > > + compatible = "realtek,rtl8723bs-bt";
> > > + }
> >
> > As the kernel test robot already pointed out, there is a semicolon
> > missing here.
> > Otherwise looks good (dt-validate passes), but don't know if there are
> > any wakeup GPIOs connected (can't seem to find a schematic?).
>
> So there are wakeups, but if I add:
>
> device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_LOW>;
> host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
>
> then some odd sort of dependency issue happens where the serial port
> load is deferred waiting for the GPIO to appear, and then the device
> doesn't work.
When you say your device doesn't work, are you saying it never probes?
<debugfs>/devices_deferred should tell you what devices have deferred and why.
> Error in dmesg is:
>
> serial serial0-0: deferred probe pending
>
> on 6.3-rc and on 6.1 I get:
>
> dw-apb-uart 1c28c00.serial: Failed to create device link (0x180) with axp20x-gpio
This error message doesn't block anything. So I don't think this is
the cause of your blocking issue. But I still want to understand why
this error message is showing up.
> I'm not clear why it's trying to link the serial port to the GPIO; it
> seems that it should be the bluetooth device that depends on both the
> UART and the GPIO,
A fix for the device link error message went in on v6.3-rc3. Is that
the 6.3 version you tested this on?
Also, I tried looking into the UART driver
(drivers/tty/serial/8250/8250_dw.c) but it wasn't clear how it ends up
populating the bluetooth serial device. If you can point that out,
that'd be helpful (assuming 6.3-rc3 still shows that error message).
> and that the GPIO is actually optional so shouldn't
> hold up loading, but I can't see how that should be represented.
Optional dependencies should get ignored after the default
deferred_probe_timeout runs out and the supplier driver hasn't been
loaded yet.
-Saravana
> Adding Greg + Saravana in the hope they can tell me what I've done wrong
> here. The LED driver using a different GPIO line on the axp209 works
> fine, so the device is definitely loaded and working ok.