From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB45FC5DF61 for ; Tue, 5 Nov 2019 17:25:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 84128214B2 for ; Tue, 5 Nov 2019 17:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572974754; bh=N7w8Age/S1L622Rz8RbBU6vyXF/UF4h5r5mKG0dYiRw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=xrVKw+jVACYI8AM0GMxNCSxWzLrtJXQQ4Tt3GsQIJbYH6IrymBc5G/IndKIJvtp1X U1YNyXEpbdndFo6BMRfuLtyWq7YEaA8yPxUDcWwrfqJqz0YSi9RAOMWqtrWYsHOx39 s8HFS/eegXbNarrUnngVXfQ4JBOlYPgPoruHSwPI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389478AbfKERZw (ORCPT ); Tue, 5 Nov 2019 12:25:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:50852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730895AbfKERZv (ORCPT ); Tue, 5 Nov 2019 12:25:51 -0500 Received: from localhost (unknown [62.119.166.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 94142214B2; Tue, 5 Nov 2019 17:25:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572974750; bh=N7w8Age/S1L622Rz8RbBU6vyXF/UF4h5r5mKG0dYiRw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mmaPqWoH4jiRDUyASGcNfkVGttSk8WUcOyPKfY7xVkHVe5IAH+7tS/bqC5do51a8X ZZ1XKVaauQ085Uh/kEDH88NpgJxEQiRPV+D44L/IWDc11U6kwQbxsrNcEDerfn4Awj dJRm04jMaKluVkZ5IW9+mtbEQtTCSo5h0qj7+L6k= Date: Tue, 5 Nov 2019 18:25:25 +0100 From: Greg KH To: Marcel Holtmann Cc: Arnd Bergmann , Johannes Berg , "David S. Miller" , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH] rfkill: allocate static minor Message-ID: <20191105172525.GA2851576@kroah.com> References: <20191024174042.19851-1-marcel@holtmann.org> <20191024184408.GA260560@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Oct 24, 2019 at 10:23:57PM +0200, Marcel Holtmann wrote: > Hi Greg, > > >> udev has a feature of creating /dev/ device-nodes if it finds > >> a devnode: modalias. This allows for auto-loading of modules that > >> provide the node. This requires to use a statically allocated minor > >> number for misc character devices. > >> > >> However, rfkill uses dynamic minor numbers and prevents auto-loading > >> of the module. So allocate the next static misc minor number and use > >> it for rfkill. > > > > As rfkill has been around for a long time, what new use case is needing > > to auto-load this based on a major number? > > we have bug reports from iwd users where it fails opening /dev/rfkill. Since iwd can be actually started before the WiFi hardware is fully probed and all its drivers are loaded, we have a race-condition here if rfkill is not capable of auto-loading. > > The difference is really that iwd is a fully self-contained WiFi daemon compared to wpa_supplicant which is just some sort of helper. iwd is fully hot plug capable as well compared to wpa_supplicant. It looks like this is exposing the race condition for our users. Frankly, we should have fixed rfkill a long time ago when we fixed uinput, uhid etc, but seems we forgot it. I assume mainly because it magically got loaded in time by some module dependencies. You need a better email client, one with \n characters... Anyway, this sounds reasonable, I'll go queue this up for 5.5. thanks, greg k-h