Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1160462imm; Fri, 28 Sep 2018 13:07:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV6220f87SB3aUzrSIZjbXABQC43fyL+OZvBF5si+MnrpO22XD9Vra3tvM3WuxQfXZSdnKp+u X-Received: by 2002:a62:7043:: with SMTP id l64-v6mr161947pfc.65.1538165232683; Fri, 28 Sep 2018 13:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538165232; cv=none; d=google.com; s=arc-20160816; b=HS+A/pyraXaCC8nHTWRsbLce3/xk3iwpTw9IBod/1MIdqkKzpYm1vCTF/AlM0J8Vfu +T6JqaMJK7xAUlIhNcW1Q5mueLcU4xCj0enU2SJdoy3+et6fWsCXnVuIWSfCDPqM2NIk aORt+skQhszJxoZiLDqDR38ZAMjGweu3T8DjY+8bGW8fOk1O/cUcg6mZ951arpzGIo5b PtdMGCDWjAExPXN8nQ4T2e9uhE9iI3c/ZZqxQGkwjZastkboRrQ1duyiK5/+M6IKeM6m mJsJxDNISHQicUqQifdDvcnPa0+BQFro81nxHq7KuVnUN+JShBspqmBh25iu0tJAw1U4 xlNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:to:from:subject:message-id; bh=+920BDbjZ/YSSkfd9h8aVt0sYSvCWvdC3WEtSVbjeeE=; b=pd7sP4A+ATR/D4fOtlmE/Al6CsfjZOOQgR0pKoKeGlh5vmNHKxiKearsaqN6F8Lr/r 9ZqqOOAbFfdPNffckko4bMl0RQa9o3exE217TSp/k/2G/wY5wsg0sXqopuW5UdpRYxQN b9QTN5h3sYSpxsZjcJeJLL+rfG/X/htCU51mwCttzos29lKnskLzgBTz642lGUDlGRtK an4r60kllNiaU6zbnZihnBrmnZpiG/Cx/53vXHiKqTmhxC0QjP9uKwC2LbbxoRZGM5jV M+OC/sGTtlLD5n/V/UDYT2tFpQ4dfjwvs7pbxx/15+OUwu5sLib65nsiihFEXVyQScie laMQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a10-v6si6296968pln.137.2018.09.28.13.06.57; Fri, 28 Sep 2018 13:07:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726783AbeI2CcL (ORCPT + 99 others); Fri, 28 Sep 2018 22:32:11 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:53925 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbeI2CcL (ORCPT ); Fri, 28 Sep 2018 22:32:11 -0400 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=localhost) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5z2E-0000yI-6l; Fri, 28 Sep 2018 22:06:46 +0200 Message-ID: <4c740fb03dec9dbd45264207da96fcd2051e634f.camel@pengutronix.de> Subject: Re: drivers binding to device node with multiple compatible strings From: Lucas Stach To: Frank Rowand , Li Yang , Rob Herring , Grant Likely , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , lkml , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linuxppc-dev Date: Fri, 28 Sep 2018 22:06:41 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-1.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Am Freitag, den 28.09.2018, 12:43 -0700 schrieb Frank Rowand: > + Frank > > On 09/27/18 15:25, 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? Not really contributing to the solution, but the hard question to answer is when do you know what the most specific driver is? The most specific driver might well be a module that can be loaded at any time, while there might already be other less specific drivers around. In general I would say that if your device is specific enough to warrant a whole new driver, it should not declare compatibility with the generic thing in the compatible, but then this is kind of exporting an Linux implementation detail to DT. Regards, Lucas