Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1161152imm; Fri, 28 Sep 2018 13:07:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV63pV0Agc4pKY9F5zdXcMcjVWQKPUJj47jezZ+cF/uXjIUZIf4PCzehTd2mE3MVxbWWDfSrf X-Received: by 2002:a65:614a:: with SMTP id o10-v6mr133918pgv.387.1538165269517; Fri, 28 Sep 2018 13:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538165269; cv=none; d=google.com; s=arc-20160816; b=i6Gzz/7kRrd1Irbpubo5o4K1WZ0QK771q6egdDBw4phiF+Ml7aMRPXiuwxlx7DIsNu /7WAsKcQ77Ab7zbnueGqYgvL9fy8yVvTSbDroWzV4t+WyyE/EBcxOmxAgZed0HowBZwY 8mgJySWLbgpyFpd6TbbT/a/KpVFAQgIR7Et3DDgXGkVXxcpXQjnsOw5ws3EyCIvXzg4n dqd4wwu6Rs1caNCpBYOTyw86QuAAAjcz5gCFlZuXsuYnWn8hHqeFXunJT6nJa7JnH8IJ jfEHo9i8X27nOv2cy+tPCFgLtI603xRUuFu20GBZfq9k/kZgtLmCZZ0o3K5aLvxV64Lf H+Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=f9+liABHmlT9apfk2EvQcfM1q86DRXuMTF1fnQVUhrk=; b=VUlRQefHf7xMSSnPIwiUMnw+M50d/urEMb4IdckcfXAefHNwbvp36uXH6V24BKEEEj pejBY3WzVwB3ht+t/rNvMLyQrQ8CH0cgRfideNzomqKX8ShKIbsGSK1uZN7BcjSlha0O QdkaNotCHL48T56T8gyO3dKuo4z5ukwQJB6S2oHbq+tqn0TzyqTs242zAi/dgJyaN4H2 fGwzax8PtfDCvSLiBuHeLZwhWn+t4KPmB+Ey+FARaltTPhZG3sL4RGjnkx7FMv6o1vPN bRCTH8pZxnr7pVpPVwHcmAdI8xtgQhV8r62L4EJAiXHX7mEqxfCnP3qPwgr0YSO20z8M 5vLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MBL6cryp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si5382779plk.379.2018.09.28.13.07.34; Fri, 28 Sep 2018 13:07:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MBL6cryp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727085AbeI2Cck (ORCPT + 99 others); Fri, 28 Sep 2018 22:32:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:51340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbeI2Cck (ORCPT ); Fri, 28 Sep 2018 22:32:40 -0400 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9241720779; Fri, 28 Sep 2018 20:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538165239; bh=8ceWlt+FzbQiWADpwWjP3zubqEZymXgsNtv1I1R9vaU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MBL6cryp9Z6vYLJzamJ7TYaHFv4gyUJsPhqAzz0tvNjjePtrhydwp8gxrW3ZoMyJc cmHvEJJ1vMLpk75YkqS0mBNL2TbAIzfrC0RVzdyXs66txLQUHvtQau2u035pg0UkjR aDepIXyGpQMFgUXbwEt/xE572HWBCsnGWkErytMU= Received: by mail-qt1-f179.google.com with SMTP id c56-v6so3113021qtd.11; Fri, 28 Sep 2018 13:07:19 -0700 (PDT) X-Gm-Message-State: ABuFfogvTBFGxujOfasuWuQiyhc0X5dghlFIaK+esGtdT0GGqCWAaGaP 6dQEosMlILsZLxsvn+qOL4OHgFTqsg2v/2I8Tg== X-Received: by 2002:ac8:46d3:: with SMTP id h19-v6mr170261qto.188.1538165238817; Fri, 28 Sep 2018 13:07:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Rob Herring Date: Fri, 28 Sep 2018 15:07:05 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: drivers binding to device node with multiple compatible strings To: Yang-Leo Li Cc: Grant Likely , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linuxppc-dev , Frank Rowand Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 27, 2018 at 5:25 PM Li Yang 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