Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2863413rwr; Fri, 21 Apr 2023 15:50:48 -0700 (PDT) X-Google-Smtp-Source: AKy350aPCRqh8dPXB/2djUYIZaCalAqEZcHbrxHBDUmXPKgeMj1h08EwDALWhkmgnldytNDH70Bu X-Received: by 2002:a17:902:f54b:b0:1a3:e67a:4bd6 with SMTP id h11-20020a170902f54b00b001a3e67a4bd6mr7797394plf.5.1682117447728; Fri, 21 Apr 2023 15:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682117447; cv=none; d=google.com; s=arc-20160816; b=IuhX1PlLsZOx46gAl6YI3aY1cTUWLRMBa+Ivt0O9ayimhrL/q60PWc7hSX4+UZnwqd WJkosL42QNEmXfPamwBtmzdR1hxch6wxa9xlN6WGlWWZcQOCKWciFL4moSlS2M0O8Hl1 Q8JykJDl/BBpqOy2rorK7QL8mS2PmUOuseC/0xMCfSvndqr+xAch9iFzsGNdA9b/vnyC sN1GA6k3w/EeD/xaemZQJ1NGjW6quoB3VfQvxrpJqkrgFiApKGHLIJDAO/3fq5+R7tlD pryxxlB46QqRjGtHQcbQOwta9uX9uQyrEoQBM+apIIuTs6PP0iGm6nReGnHgIZ/OXo39 zTTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=grxtbYgBEZhFXTnkmUQSXwfMPjYR4qLeWhU06c7fEJo=; b=TaMoqBF5AF3/tJ+10OPHxhVMgnF8womI8WnxhtyPPOBmWnueA5Ui85sJTTUOv6ebac UCtEFHZqQ1RQxBx8QxbmZB+Ac8+FdM7wHf9h0tczGicHGtvY/l4A1Htanikq0S/CEQZ2 T4quYR+xjS1eipAqHIoaWUAiycTjkPXxUJasip0sSn5UljQ3cXN1DPbd06MJaTEIiu8w 0Dzn0cLgsBBfsAypOf4BCcQhhcbtlRJcmWaXmdyOqjkXG5CtIyrROYq5WkXsnXkoGYOQ BOUqhGad69nsp/23KQiGWyfrzkdoAgruHXWcORx/Cl8ue3I3SLswaRkCpVfXge+dnS/J oysQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=LdfV8328; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d4-20020a170902654400b001a5089fe47fsi5081840pln.326.2023.04.21.15.50.34; Fri, 21 Apr 2023 15:50:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=LdfV8328; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233924AbjDUWqe (ORCPT + 99 others); Fri, 21 Apr 2023 18:46:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233936AbjDUWqc (ORCPT ); Fri, 21 Apr 2023 18:46:32 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68FFC26A5 for ; Fri, 21 Apr 2023 15:46:30 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1a6e5be6224so524305ad.1 for ; Fri, 21 Apr 2023 15:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682117190; x=1684709190; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=grxtbYgBEZhFXTnkmUQSXwfMPjYR4qLeWhU06c7fEJo=; b=LdfV8328hCSEL7clgImntNqsjxIE6gpJx7G924HHBO4P0LLmlWh8r1f3M78lmOqsRH K+MZax8iX6iDU5iiSuYpt+qdLoo+bv2RWJAD+kVPJqPvLLMgJ3RmPEe00lXzp9BZEzih RDm/s5YUQ4LdcojdFDlLWMdzD/HNSCKxBhwEHbcStUiYbKSwSxZtLJqScw2X/tMQpNue 7Q0v7GD4Btpw/0sEet7FiJXs6P+S6HShG3YS6btnZHQB8FQwsnzh7dTn6/15dAZQLq7q pIDEvozCPbIlWuVAL0jx8yOg2gF0BVGzdzG/4ZTRpHyFG6Jwvwsesg6fu3nd9+s/ceqP w9wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682117190; x=1684709190; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=grxtbYgBEZhFXTnkmUQSXwfMPjYR4qLeWhU06c7fEJo=; b=eNGst2VJ3uueREpOgGMF7IVCARG8JW+CJrUqVp6ef9cmHn3KOWubkO0e7ML8pgDStl n8ncbhZjuAu1j/lUN51Qi2BKBa5T35Un4RmGYGmbulvzXZbuDttKWk4/h+6kp5xWK8vg EnPeX6yKyWemdNxcABe1ZEW9af7rCcheg+Lgb5HISxJhVO7fb2MQ85S0tT8sS1E76rom xDARdZsxO+aFKDSPz4HKQ/LJgHKpgOOSFi5xzTSJN4Gf6oQSrOOYyftw54QoWO20nsUw nwuQR1qGFwWfnl17cb7+PWXa0H0eaYkfQXsITonrAZOk4hffaE/nNAGcNaoT5fVek5Y8 U/Lg== X-Gm-Message-State: AAQBX9f/iE65zZ0oFOGYbToCbm/e/VXyFYJz95J/O6pXB3sYy2Ldwxem mgTV8Jw5siYML6hw+YN++nWAh9mclY+uiLzlAnOvyw== X-Received: by 2002:a17:902:ecc9:b0:198:af4f:de07 with SMTP id a9-20020a170902ecc900b00198af4fde07mr25570plh.7.1682117189428; Fri, 21 Apr 2023 15:46:29 -0700 (PDT) MIME-Version: 1.0 References: <20230416012421.255bfd19@slackpad.lan> In-Reply-To: From: Saravana Kannan Date: Fri, 21 Apr 2023 15:45:52 -0700 Message-ID: Subject: Re: [PATCH 1/3] ARM: dts: sun5i: chip: Enable bluetooth To: Jonathan McDowell Cc: Andre Przywara , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 21, 2023 at 1:28=E2=80=AFAM Jonathan McDowell wrote: > > On Thu, Apr 20, 2023 at 06:43:06PM -0700, Saravana Kannan wrote: > > On Thu, Apr 20, 2023 at 12:12=E2=80=AFPM Jonathan McDowell 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 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 D= TS was > > > > > initially added, but it does now, so enable it. > > > > > > > > > > Signed-off-by: Jonathan McDowell > > > > > --- > > > > > 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 =3D <&uart3_pg_pins>, > > > > > <&uart3_cts_rts_pg_pins>; > > > > > status =3D "okay"; > > > > > + > > > > > + bluetooth { > > > > > + compatible =3D "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 =3D <&axp_gpio 3 GPIO_ACTIVE_LOW>; > > > host-wake-gpios =3D <&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? Read your whole email and it's a strange issue. Also, going forward to avoid confusion, only reply to questions with respect to 6.3-rc7. > The bluetooth device (realtek,rtl8723bs-bt) never appears, apparently > because the UART it's attached to never loads - it doesn't even try to > load the firmware. > > > /devices_deferred should tell you what devices have deferred a= nd why. > > root@chip:~# cat /sys/kernel/debug/devices_deferred > serial0-0 Do you see this in 6.3-rc7 too? > > > 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? > > I originally tried on 6.1.21, which is where I got the "Failed to create > device link" message. I then moved to 6.3-rc7 as I saw there had been > further changes recently. There I just get the: > > serial serial0-0: deferred probe pending If the deferral is related to fw_devlink, you should see the reason for deferring in the devices_deferred file. So I don't think the issue is related to fw_devlink. > message. > > > 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). > > I have the following in my device tree: > > &uart3 { > pinctrl-names =3D "default"; > pinctrl-0 =3D <&uart3_pg_pins>, > <&uart3_cts_rts_pg_pins>; > status =3D "okay"; > > bluetooth { > compatible =3D "realtek,rtl8723bs-bt"; > device-wake-gpios =3D <&axp_gpio 3 GPIO_ACTIVE_LOW>; > host-wake-gpios =3D <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 *= / > }; > }; > > uart3 is a snps,dw-apb-uart, defined in arch/arm/boot/dts/sun5i.dtsi > > The UART and AXP209 device drivers are compiled into the kernel: > > CONFIG_PINCTRL_AXP209=3Dy > CONFIG_SERIAL_8250=3Dy > CONFIG_SERIAL_8250_DW=3Dy > > The bluetooth bits are modules (btrtl, hci_uart). > > If I remove the device-wake-gpios line then the Bluetooth device works > fine, and /sys/kernel/debug/devices_deferred is empty. > > Somehow it seems like the GPIO is being parsed as a dependency for the > serial port, even though the serial port + GPIO are both dependencies > for the bluetooth device. I'm fairly sure that fw_devlink isn't causing that. Because even without bluetooth, fw_devlink doesn't consider any suppliers listed in child DT nodes as mandatory suppliers. That has been the case since the beginning. > Even with that, given both are built-in I > don't understand why the serial port never completes setup. My guess is that the driver itself has some bug that's sensitive to device probe order even though it shouldn't. Can you add #define DEBUG 1 to the top of drivers/base/core.c and share the boot log? I can try and help debug it. -Saravana > > > 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. > > When I say it's optional I mean if it's not listed everything works > fine, but I don't believe there's anyway to express that in the DTS. > It's certainly not required for the serial port, just the bluetooth > device. > > J. > > -- > Web [ Don't be a stranger. ] > site: https:// [ ] Made by > www.earth.li/~noodles/ [ ] HuggieTag 0.0.24