From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: jacobe.zang@wesion.com, bhelgaas@google.com,
brcm80211-dev-list.pdl@broadcom.com, brcm80211@lists.linux.dev,
christophe.jaillet@wanadoo.fr, conor+dt@kernel.org,
davem@davemloft.net, devicetree@vger.kernel.org,
duoming@zju.edu.cn, edumazet@google.com,
gregkh@linuxfoundation.org, krzk+dt@kernel.org, kuba@kernel.org,
kvalo@kernel.org, linux-kernel@vger.kernel.org,
linux-wireless@vger.kernel.org, megi@xff.cz,
minipli@grsecurity.net, netdev@vger.kernel.org,
pabeni@redhat.com, robh@kernel.org, saikrishnag@marvell.com,
stern@rowland.harvard.edu, yajun.deng@linux.dev
Subject: Re: [PATCH v11 0/4] Add AP6275P wireless support
Date: Tue, 20 Aug 2024 11:53:41 +0200 [thread overview]
Message-ID: <7c2c6d22-399b-42e7-8ac7-098f036e9e81@broadcom.com> (raw)
In-Reply-To: <xc5226th2sifhop3gnwnziok4lfl5s6yqbxq6wx4vygnuf4via@4475aaonnmaz>
On 8/19/2024 10:33 PM, Sebastian Reichel wrote:
> Hello,
>
> On Mon, Aug 19, 2024 at 09:35:12PM GMT, Arend van Spriel wrote:
>> On 8/19/2024 6:42 PM, Sebastian Reichel wrote:
>>> I tested this on RK3588 EVB1 and the driver is working fine. The DT
>>> bindings are not correct, though:
>>>
>>> linux/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dtb: wifi@0,0:
>>> compatible: 'oneOf' conditional failed, one must be fixed:
>>>
>>> ['pci14e4,449d', 'brcm,bcm4329-fmac'] is too long
>>> 'pci14e4,449d' is not one of ['brcm,bcm43143-fmac', 'brcm,bcm4341b0-fmac',
>>> 'brcm,bcm4341b4-fmac', 'brcm,bcm4341b5-fmac', 'brcm,bcm4329-fmac',
>>> 'brcm,bcm4330-fmac', 'brcm,bcm4334-fmac', 'brcm,bcm43340-fmac',
>>> 'brcm,bcm4335-fmac', 'brcm,bcm43362-fmac', 'brcm,bcm4339-fmac',
>>> 'brcm,bcm43430a0-fmac', 'brcm,bcm43430a1-fmac', 'brcm,bcm43455-fmac',
>>> 'brcm,bcm43456-fmac', 'brcm,bcm4354-fmac', 'brcm,bcm4356-fmac',
>>> 'brcm,bcm4359-fmac', 'brcm,bcm4366-fmac', 'cypress,cyw4373-fmac',
>>> 'cypress,cyw43012-fmac', 'infineon,cyw43439-fmac']
>>> from schema $id: http://devicetree.org/schemas/net/wireless/brcm,bcm4329-fmac.yaml#
>>>
>>> It's easy to see the problem in the binding. It does not expect a
>>> fallback string after the PCI ID based compatible. Either the
>>> pci14e4,449d entry must be added to the first enum in the binding,
>>> which has the fallback compatible, or the fallback compatible
>>> should not be added to DTS.
>>
>> Never understood why we ended up with such a large list. When the binding
>> was introduced there was one compatible, ie. brcm,bcm4329-fmac. People
>> wanted all the other flavors because it described a specific wifi chip and
>> no other reason whatsoever. The PCI ID based compatible do obfuscate that
>> info so those are even less useful in my opinion.
>>
>>> If the fallback compatible is missing in DTS, the compatible check in
>>> brcmf_of_probe() fails and the lpo clock is not requested resulting
>>> in the firmware startup failing. So that would require further
>>> driver changes.
>>
>> Right. The text based bindings file in 5.12 kernel clearly says:
>>
>> Required properties:
>>
>> - compatible : Should be "brcm,bcm4329-fmac".
>>
>> In 5.13 kernel this was replaced by the json-schema yaml file. The PCI ID
>> based enum which was added later does also list brcm,bcm4329-fmac so why
>> does that not work for the compatible list ['pci14e4,449d',
>> 'brcm,bcm4329-fmac']? Looking at the compatible property in yaml which I
>> stripped a bit for brevity:
>>
>> properties:
>> compatible:
>> oneOf:
>> - items:
>> - enum:
>> - brcm,bcm43143-fmac
>> - brcm,bcm4329-fmac
>> - infineon,cyw43439-fmac
>> - const: brcm,bcm4329-fmac
>> - enum:
>> - brcm,bcm4329-fmac
>> - pci14e4,43dc # BCM4355
>> - pci14e4,4464 # BCM4364
>> - pci14e4,4488 # BCM4377
>> - pci14e4,4425 # BCM4378
>> - pci14e4,4433 # BCM4387
>>
>> So how should I read this. Searching for some sort of syntax description I
>> found [1] which has an example schema with description that has a similarly
>> complicated compatible property. From that I think the above should be
>> changed to:
>>
>> properties:
>> compatible:
>> oneOf:
>> - items:
>> - enum:
>> - brcm,bcm43143-fmac
>> - - brcm,bcm4329-fmac
>> - infineon,cyw43439-fmac
>> - const: brcm,bcm4329-fmac
>> + - items:
>> - enum:
>> - - brcm,bcm4329-fmac
>> - pci14e4,43dc # BCM4355
>> - pci14e4,4464 # BCM4364
>> - pci14e4,4488 # BCM4377
>> - pci14e4,4425 # BCM4378
>> - pci14e4,4433 # BCM4387
>> + - const: brcm,bcm4329-fmac
>> + - const: brcm,bcm4329-fmac
>>
>> This poses a constraint in which the last string in the compatible list is
>> always 'brcm,bcm4329-fmac' even if it is the only string. At least that is
>> my understanding so if my understanding is wrong feel free to correct me on
>> this.
>>
>> [1] https://docs.kernel.org/devicetree/bindings/writing-schema.html
>
> Your proposed change should work as you describe. But it will result
> in DT check errors for some Apple devices, which followed the
> current binding and do not have the "brcm,bcm4329-fmac" fallback
> compatible:
>
> $ git grep -E "(pci14e4,43dc)|(pci14e4,4464)|(pci14e4,4488)|(pci14e4,4425)|(pci14e4,4433)" arch/
> arch/arm64/boot/dts/apple/t8103-jxxx.dtsi: compatible = "pci14e4,4425";
> arch/arm64/boot/dts/apple/t8112-j413.dts: compatible = "pci14e4,4433";
> arch/arm64/boot/dts/apple/t8112-j493.dts: compatible = "pci14e4,4425";
> I guess patch 3/4 from this series will also introduce some
> regressions for these devices by moving the check. What is the
> purpose of the compatible check in brcmf_of_probe() in the first
> place? Can it just be dropped?
>
> I see it was introduced 10 years ago in 61f663dfc1a09, probably to
> avoid a spurious error message for systems not having the IRQ
> described in DT? The current code exits quietly when none of the
> optional resources are defined.
It was introduced simply because the compatible property has a meaning
that goes beyond informational. It is a claim that the properties of the
node comply to the bindings specification. I would really want to keep
the sanity check event though all properties are optional. The
constraint keeps the compatible matching in the driver relatively simple.
Regards,
Arend
next prev parent reply other threads:[~2024-08-20 9:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-16 2:06 Jacobe Zang
2024-08-16 2:06 ` [PATCH v11 1/4] dt-bindings: net: wireless: brcm4329-fmac: add pci14e4,449d Jacobe Zang
2024-08-22 8:59 ` Kalle Valo
2024-08-16 2:06 ` [PATCH v11 2/4] dt-bindings: net: wireless: brcm4329-fmac: add clock description for AP6275P Jacobe Zang
2024-08-16 2:06 ` [PATCH v11 3/4] wifi: brcmfmac: Add optional lpo clock enable support Jacobe Zang
2024-08-16 16:18 ` Arend van Spriel
2024-08-16 2:06 ` [PATCH v11 4/4] wifi: brcmfmac: add flag for random seed during firmware download Jacobe Zang
2024-08-19 16:42 ` [PATCH v11 0/4] Add AP6275P wireless support Sebastian Reichel
2024-08-19 19:35 ` Arend van Spriel
2024-08-19 20:33 ` Sebastian Reichel
2024-08-20 9:53 ` Arend van Spriel [this message]
2024-08-20 10:04 ` Jacobe Zang
2024-08-20 10:00 ` Jacobe Zang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7c2c6d22-399b-42e7-8ac7-098f036e9e81@broadcom.com \
--to=arend.vanspriel@broadcom.com \
--cc=bhelgaas@google.com \
--cc=brcm80211-dev-list.pdl@broadcom.com \
--cc=brcm80211@lists.linux.dev \
--cc=christophe.jaillet@wanadoo.fr \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=duoming@zju.edu.cn \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jacobe.zang@wesion.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=megi@xff.cz \
--cc=minipli@grsecurity.net \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=saikrishnag@marvell.com \
--cc=sebastian.reichel@collabora.com \
--cc=stern@rowland.harvard.edu \
--cc=yajun.deng@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®