Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751139AbeAPOLg (ORCPT + 1 other); Tue, 16 Jan 2018 09:11:36 -0500 Received: from mail-wr0-f174.google.com ([209.85.128.174]:43476 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750796AbeAPOLf (ORCPT ); Tue, 16 Jan 2018 09:11:35 -0500 X-Google-Smtp-Source: ACJfBouuyA5zHEVWfb6hNtZ5Wpm2rY39Ca3JoxzyI1rbv4UMCLeTdumuaK5eKcQm9xWX5beaTI9fcA== Subject: Re: i2c: core: report OF style module alias for devices registered via OF To: Dmitry Mastykin Cc: Linux Kernel Mailing List , Wolfram Sang , linux-i2c@vger.kernel.org References: From: Javier Martinez Canillas Message-ID: Date: Tue, 16 Jan 2018 15:11:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hello Dmitry, On 01/16/2018 02:55 PM, Dmitry Mastykin wrote: > On Sun, 3 Dec 2017 22:40:50 +0100, Javier Martinez Canillas > wrote: > >> The buses should honor the firmware interface used to register the device, >> but the I2C core reports a MODALIAS of the form i2c: even for I2C >> devices registered via OF. >> >> This means that user-space will never get an OF stype uevent MODALIAS even >> when the drivers modules contain aliases exported from both the I2C and OF >> device ID tables. For example, an Atmel maXTouch Touchscreen registered by >> a DT node with compatible "atmel,maxtouch" has the following module alias: >> >> $ cat /sys/class/i2c-adapter/i2c-8/8-004b/modalias >> i2c:maxtouch >> >> So udev won't be able to auto-load a module for an OF-only device driver. >> Many OF-only drivers duplicate the OF device ID table entries in an I2C ID >> table only has a workaround for how the I2C core reports the module alias. >> >> This patch changes the I2C core to report an OF related MODALIAS uevent if >> the device was registered via OF. So for the previous example, after this >> patch, the reported MODALIAS for the Atmel maXTouch will be the following: >> >> $ cat /sys/class/i2c-adapter/i2c-8/8-004b/modalias >> of:NtrackpadTCatmel,maxtouch >> >> NOTE: This patch may break out-of-tree drivers that were relying on this >> behavior, and only had an I2C device ID table even when the device >> was registered via OF. There are no remaining drivers in mainline >> that do this, but out-of-tree drivers have to be fixed and define >> a proper OF device ID table to have module auto-loading working. >> > > Hello Javier, > thank you for your patch! > Thanks a lot for testing! Hopefully Wolfram will review/merge this soon, otherwise in the meantime drivers are going to add I2C device ID tables just as a workaround or new drivers won't include a OF device ID tables since these aren't really required today. I made sure that all the drivers in mainline were fixed before posting this, but haven't checked since then. Best regards, -- Javier Martinez Canillas Software Engineer - Desktop Hardware Enablement Red Hat