From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752477AbbKPUrM (ORCPT ); Mon, 16 Nov 2015 15:47:12 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:36780 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751935AbbKPUrG (ORCPT ); Mon, 16 Nov 2015 15:47:06 -0500 Date: Mon, 16 Nov 2015 12:47:02 -0800 From: Brian Norris To: Javier Martinez Canillas Cc: Mark Brown , Heiner Kallweit , linux-mtd@lists.infradead.org, Dmitry Torokhov , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Subject: Re: spi: OF module autoloading is still broken Message-ID: <20151116204702.GP8456@google.com> References: <56104E88.3040807@gmail.com> <20151112185926.GC8456@google.com> <20151113194031.GI8456@google.com> <20151113221228.GT12392@sirena.org.uk> <20151113225113.GJ8456@google.com> <20151113231410.GV12392@sirena.org.uk> <20151113234857.GK8456@google.com> <564A101F.9090807@osg.samsung.com> <20151116192434.GO8456@google.com> <564A35EB.5080008@osg.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <564A35EB.5080008@osg.samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Nov 16, 2015 at 05:00:43PM -0300, Javier Martinez Canillas wrote: > On 11/16/2015 04:24 PM, Brian Norris wrote: > I also didn't think about wilcards... I wonder why there are trailing > wildcards for a compatible string. After all a compatible string should > define a particular IP and there could be a foo,bar and foo,barbaz that > have different drivers and what prevents today the driver with alias > of:N*T*Cfoo,bar* to be loaded due a MODALIAS=of:NfooTCfoo,barbar ? > > So I think we need this regardless of my patch: > > diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c > index 5b96206e9aab..cd0002f4a199 100644 > --- a/scripts/mod/file2alias.c > +++ b/scripts/mod/file2alias.c > @@ -704,7 +704,6 @@ static int do_of_entry (const char *filename, void *symval, char *alias) > if (isspace (*tmp)) > *tmp = '_'; > > - add_wildcard(alias); > return 1; > } > ADD_TO_DEVTABLE("of", of_device_id, do_of_entry); (I'm also not an expert in this stuff, but...) That looks reasonable. You might refer to commit ac551828993e ("modpost: i2c aliases need no trailing wildcard") for inspiration. You might also modify the "always" in: /* Always end in a wildcard, for future extension */ static inline void add_wildcard(char *str) { ... } And of course, you probably should CC those who are responsible for the core device tree probing and device/driver interactions for something like this. > Now that I think about it, there is another issue and is that today spi:foo > defines a namespace while changing to of: will make the namespace flat so > a platform driver that has the same vendor and model will have the same > modalias. > > IOW, for board files will be platform:bar and i2c:bar while for OF will be > of:NfooTCfoo,bar in both cases. I wonder if we should reuse the type > for that and store the subsystem prefix there. What do you think? I'm not sure I understand all the issues here to be able to comment properly. But I bet someone else might. (For me, it might help if you had a more concrete example to speak of.) > Thanks a lot for pointing out all these issues. It is indeed harder than > I thought. No problem! > > I don't think you have problems only with bad FDTs. I think you have a > > problem with perfectly valid DTs. > > > > Agreed, I wonder if spi_uevent() shouldn't be changed to report both the > OF and old SPI modaliases to avoid breaking a lot of drivers but at the > same time allowing DT-only drivers to not need an SPI ID table. That's the solution I imagined, though I haven't tested it yet. I don't see much precedent for reporting multiple modaliases, so there could be some kind of ABI issues around that too. Regards, Brian