[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqKRH8uEzSx6H6ZSRJF9Ecp4am1cNsxgQqf2OO5_aGR1zw@mail.gmail.com>
Date: Fri, 28 Sep 2018 15:07:05 -0500
From: Rob Herring <robh+dt@...nel.org>
To: Yang-Leo Li <leoyang.li@....com>
Cc: Grant Likely <grant.likely@...retlab.ca>,
devicetree@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@...ts.infradead.org>,
linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
Frank Rowand <frowand.list@...il.com>
Subject: Re: drivers binding to device node with multiple compatible strings
On Thu, Sep 27, 2018 at 5:25 PM Li Yang <leoyang.li@....com> wrote:
>
> Hi Rob and Grant,
>
> Various device tree specs are recommending to include all the
> potential compatible strings in the device node, with the order from
> most specific to most general. But it looks like Linux kernel doesn't
> provide a way to bind the device to the most specific driver, however,
> the first registered compatible driver will be bound.
>
> As more and more generic drivers are added to the Linux kernel, they
> are competing with the more specific vendor drivers and causes problem
> when both are built into the kernel. I'm wondering if there is a
> generic solution (or in plan) to make the most specific driver bound
> to the device. Or we have to disable the more general driver or
> remove the more general compatible string from the device tree?
It's been a known limitation for a long time. However, in practice it
doesn't seem to be a common problem. Perhaps folks just remove the
less specific compatible from their DT (though that's not ideal). For
most modern bindings, there's so many other resources beyond
compatible (clocks, resets, pinctrl, etc.) that there are few generic
drivers that can work.
I guess if we want to fix this, we'd need to have weighted matching in
the driver core and unbind drivers when we get a better match. Though
it could get messy if the better driver probe fails. Then we've got to
rebind to the original driver.
Do you have a specific case where you hit this?
Rob
Powered by blists - more mailing lists