Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752599AbdI2XXZ (ORCPT ); Fri, 29 Sep 2017 19:23:25 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:37040 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752505AbdI2XXY (ORCPT ); Fri, 29 Sep 2017 19:23:24 -0400 X-Google-Smtp-Source: AOwi7QB3+wLnX2I/Vozjg09jUqoHkYibUT07KSMx7/gvUfTBJHeZDqumIsLG9xMg1KfNTqyzuE/aUA== Date: Fri, 29 Sep 2017 16:23:20 -0700 From: Dmitry Torokhov To: "Ruhl, Michael J" Cc: "Williams, Dan J" , Greg Kroah-Hartman , Tejun Heo , Linux Kernel Mailing List , Guenter Roeck Subject: Re: [PATCH v2 1/7] driver core: emit uevents when device is bound to a driver Message-ID: <20170929232320.GA14362@dtor-ws> References: <20170720002436.29309-1-dmitry.torokhov@gmail.com> <20170720002436.29309-2-dmitry.torokhov@gmail.com> <14063C7AD467DE4B82DEDB5C278E8663875D4784@FMSMSX108.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14063C7AD467DE4B82DEDB5C278E8663875D4784@FMSMSX108.amr.corp.intel.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 Content-Length: 3118 Lines: 80 On Fri, Sep 29, 2017 at 07:40:15PM +0000, Ruhl, Michael J wrote: > > -----Original Message----- > > From: dan.j.williams@gmail.com [mailto:dan.j.williams@gmail.com] On > > Behalf Of Dan Williams > > Sent: Friday, September 29, 2017 3:37 PM > > To: Dmitry Torokhov > > Cc: Greg Kroah-Hartman ; Tejun Heo > > ; Linux Kernel Mailing List > kernel@vger.kernel.org>; Guenter Roeck ; Ruhl, > > Michael J > > Subject: Re: [PATCH v2 1/7] driver core: emit uevents when device is bound > > to a driver > > > > On Wed, Jul 19, 2017 at 5:24 PM, Dmitry Torokhov > > wrote: > > > There are certain touch controllers that may come up in either normal > > > (application) or boot mode, depending on whether firmware/configuration > > is > > > corrupted when they are powered on. In boot mode the kernel does not > > create > > > input device instance (because it does not necessarily know the > > > characteristics of the input device in question). > > > > > > Another number of controllers does not store firmware in a non-volatile > > > memory, and they similarly need to have firmware loaded before input > > device > > > instance is created. There are also other types of devices with similar > > > behavior. > > > > > > There is a desire to be able to trigger firmware loading via udev, but it > > > has to happen only when driver is bound to a physical device (i2c or spi). > > > These udev actions can not use ADD events, as those happen too early, so > > we > > > are introducing BIND and UNBIND events that are emitted at the right > > > moment. > > > > > > Also, many drivers create additional driver-specific device attributes > > > when binding to the device, to provide userspace with additional controls. > > > The new events allow userspace to adjust these driver-specific attributes > > > without worrying that they are not there yet. > > > > > > Signed-off-by: Dmitry Torokhov > > > > Hi Dmitry, > > > > Mike (cc'd) reports a regression with this change: > > > > --- > > > > Previously, if I did: > > > > # rmmod hfi1 > > > > The driver would be removed. > > > > With 4.14.0-rc2+, when I remove the driver, the PCI bus is > > automatically re-probed and the driver re-loaded. > > > > --- > > > > A bisect points to commit 1455cf8dbfd0 "driver core: emit uevents when > > device is bound to a driver". I'm sending this because I have this > > mail in my archive, but I'll let Mike follow up with any other > > details. > > My test environment is RedHat 7.3 GA + 4.14.0-rc2 kernel. > > Blacklisting the driver keeps it from being autoloaded, but this didn't seem correct. > > With the 4.13.x branch this did not occur Yeah, udev is being stupid. Either change ACTION=="remove" to ACTION!="add" in /lib/udev/rules.d/80-drivers.rules or pick this patch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-linus&id=6878e7de6af726de47f9f3bec649c3f49e786586 Thanks. -- Dmitry