lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e2cde177e82fbdf158732ad73ccdc6c5@kernel.org>
Date:   Tue, 18 Aug 2020 08:35:55 +0100
From:   Marc Zyngier <maz@...nel.org>
To:     Rob Herring <robh@...nel.org>
Cc:     Bjorn Helgaas <helgaas@...nel.org>,
        PCI <linux-pci@...r.kernel.org>,
        "open list:ARM/Rockchip SoC..." <linux-rockchip@...ts.infradead.org>,
        "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>,
        linux-kernel@...r.kernel.org,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Heiko Stuebner <heiko@...ech.de>,
        Shawn Lin <shawn.lin@...k-chips.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Android Kernel Team <kernel-team@...roid.com>
Subject: Re: [PATCH 1/2] PCI: rockchip: Work around missing device_type
 property in DT

On 2020-08-17 17:12, Rob Herring wrote:
> On Sun, Aug 16, 2020 at 4:40 AM Marc Zyngier <maz@...nel.org> wrote:
>> 
>> On Sun, 16 Aug 2020 00:22:28 +0100,
>> Bjorn Helgaas <helgaas@...nel.org> wrote:
>> >
>> > On Sat, Aug 15, 2020 at 01:51:11PM +0100, Marc Zyngier wrote:
>> > > Recent changes to the DT PCI bus parsing made it mandatory for
>> > > device tree nodes describing a PCI controller to have the
>> > > 'device_type = "pci"' property for the node to be matched.
>> > >
>> > > Although this follows the letter of the specification, it
>> > > breaks existing device-trees that have been working fine
>> > > for years.  Rockchip rk3399-based systems are a prime example
>> > > of such collateral damage, and have stopped discovering their
>> > > PCI bus.
>> > >
>> > > In order to paper over the blunder, let's add a workaround
>> > > to the pcie-rockchip driver, adding the missing property when
>> > > none is found at boot time. A warning will hopefully nudge the
>> > > user into updating their DT to a fixed version if they can, but
>> > > the insentive is obviously pretty small.
>> >
>> > s/insentive/incentive/ (Lorenzo or I can fix this up)
>> >
>> > > Fixes: 2f96593ecc37 ("of_address: Add bus type match for pci ranges parser")
>> > > Suggested-by: Roh Herring <robh+dt@...nel.org>
>> >
>> > s/Roh/Rob/ (similarly)
>> 
>> Clearly not my day when it comes to proofreading commit messages.
>> Thanks for pointing this out, and in advance for fixing it up.
>> 
>> >
>> > > Signed-off-by: Marc Zyngier <maz@...nel.org>
>> >
>> > This looks like a candidate for v5.9, since 2f96593ecc37 was merged
>> > during the v5.9 merge window, right?
>> 
>> Absolutely.
>> 
>> > I wonder how many other DTs are similarly broken?  Maybe Rob's DT
>> > checker has already looked?
>> 
>> I've just managed to run the checker, which comes up with all kinds of
>> goodies. Apart from the above, it also spots the following:
>> 
>> - arch/arm64/boot/dts/mediatek/mt7622.dtsi: Has a device_type property
>>   in its main PCIe node, but not in the child nodes. It isn't obvious
>>   to me whether that's a violation or not (the spec doesn't say
>>   whether the property should be set on a per-port basis). Rob?
> 
> The rule is bridge nodes should have 'device_type = "pci"'. But what's
> needed to fix these cases is setting device_type where we are parsing
> ranges or dma-ranges which we're not doing on the child ndes.
> Otherwise, I don't think it matters in this case unless you have child
> (grandchild here) nodes for PCI devices. If you did have child nodes,
> the address translation was already broken before this change.

Fair enough.

>> - arch/arm64/boot/dts/qcom/msm8996.dtsi: Only one out of the three
>>   PCIe nodes has the device_type property, probably broken similarly
>>   to rk3399.
> 
> The only upstream board is DB820c, so probably not as wide an impact...
> 
> There are also 92 (lots of duplicates due to multiple boards) more
> cases in arch/arm/. A log is here[1].

Mostly Broadcom stuff, apparently. I'll see if I can have a stab
at it (although someone will have to test it).

> 
>> I could move the workaround to drivers/pci/of.c, and have it called
>> from the individual drivers. I don't have the HW to test those though.
>> 
>> Thoughts?
> 
> I think we should go with my other suggestion of looking at the node
> name. Looks like just checking 'pcie' is enough. We can skip 'pci' as
> I don't see any cases.

I really dislike it.

Once we put this node name matching in, there is no incentive for
people to write their DT correctly at all. It also sound pretty
fragile (what if the PCIe node is named something else?).

My preference goes towards having point fixes in the affected drivers,
clearly showing that this is addressing a firmware bug.

         M.
-- 
Jazz is not dead. It just smells funny...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ