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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 9CEAACA9EBC for ; Thu, 24 Oct 2019 20:24:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7AE3521655 for ; Thu, 24 Oct 2019 20:24:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727426AbfJXUYA convert rfc822-to-8bit (ORCPT ); Thu, 24 Oct 2019 16:24:00 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:52701 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727394AbfJXUX7 (ORCPT ); Thu, 24 Oct 2019 16:23:59 -0400 Received: from marcel-macpro.fritz.box (p4FEFC197.dip0.t-ipconnect.de [79.239.193.151]) by mail.holtmann.org (Postfix) with ESMTPSA id 865C3CECF6; Thu, 24 Oct 2019 22:32:58 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3594.4.19\)) Subject: Re: [PATCH] rfkill: allocate static minor From: Marcel Holtmann In-Reply-To: <20191024184408.GA260560@kroah.com> Date: Thu, 24 Oct 2019 22:23:57 +0200 Cc: Arnd Bergmann , Johannes Berg , "David S. Miller" , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <20191024174042.19851-1-marcel@holtmann.org> <20191024184408.GA260560@kroah.com> To: Greg KH X-Mailer: Apple Mail (2.3594.4.19) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. Regards Marcel