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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 A4058C433E0 for ; Mon, 18 Jan 2021 16:51:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72A6C222BB for ; Mon, 18 Jan 2021 16:51:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393533AbhARQum (ORCPT ); Mon, 18 Jan 2021 11:50:42 -0500 Received: from mga09.intel.com ([134.134.136.24]:12201 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405467AbhARQr2 (ORCPT ); Mon, 18 Jan 2021 11:47:28 -0500 IronPort-SDR: jASLDhy09QTGmPWNFcnjWjAMApqEyoY39TFT/hqv7imN6P2d57B5mP2vJLWj9F4spsb9ZB5QTB fR9YSosXsvYA== X-IronPort-AV: E=McAfee;i="6000,8403,9868"; a="178974609" X-IronPort-AV: E=Sophos;i="5.79,356,1602572400"; d="scan'208";a="178974609" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2021 08:45:41 -0800 IronPort-SDR: L2k9qsWbf2hD5ZU/jAXnWYF3Es0/C6JMu4rm40iOpuWS/WV/Y2M0j5c+utuSw6lOTPHxz2aPvl tkCJaKMgWqkQ== X-IronPort-AV: E=Sophos;i="5.79,356,1602572400"; d="scan'208";a="402096256" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2021 08:45:39 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1l1Xfu-002MWN-4Q; Mon, 18 Jan 2021 18:46:42 +0200 Date: Mon, 18 Jan 2021 18:46:42 +0200 From: Andy Shevchenko To: Greg Kroah-Hartman Cc: Mika Westerberg , "Rafael J. Wysocki" , Kai-Heng Feng , lennart@poettering.net, ACPI Devel Maling List , LKML Subject: Re: Multiple MODALIAS= in uevent file confuses userspace Message-ID: <20210118164642.GE4077@smile.fi.intel.com> References: <20210118141238.GQ968855@lahna.fi.intel.com> <20210118144853.GP4077@smile.fi.intel.com> <20210118152744.GW4077@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Mon, Jan 18, 2021 at 05:40:36PM +0100, Greg Kroah-Hartman wrote: > On Mon, Jan 18, 2021 at 05:27:44PM +0200, Andy Shevchenko wrote: > > On Mon, Jan 18, 2021 at 03:58:18PM +0100, Greg Kroah-Hartman wrote: > > > On Mon, Jan 18, 2021 at 04:48:53PM +0200, Andy Shevchenko wrote: > > > > On Mon, Jan 18, 2021 at 03:26:28PM +0100, Greg Kroah-Hartman wrote: > > > > > On Mon, Jan 18, 2021 at 04:12:38PM +0200, Mika Westerberg wrote: > > > > > > On Mon, Jan 18, 2021 at 02:50:33PM +0100, Rafael J. Wysocki wrote: > > > > > > > On Mon, Jan 18, 2021 at 8:27 AM Kai-Heng Feng > > > > > > > wrote: > > > > > > > > On Sat, Jan 9, 2021 at 12:25 AM Kai-Heng Feng > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > Commit 8765c5ba19490 ("ACPI / scan: Rework modalias creation when > > > > > > > > > "compatible" is present") creates two modaliases for certain ACPI > > > > > > > > > devices. However userspace (systemd-udevd in this case) assumes uevent > > > > > > > > > file doesn't have duplicated keys, so two "MODALIAS=" breaks the > > > > > > > > > assumption. > > > > > > > > > > > > > > > > > > Based on the assumption, systemd-udevd internally uses hashmap to > > > > > > > > > store each line of uevent file, so the second modalias always replaces > > > > > > > > > the first modalias. > > > > > > > > > > > > > > > > > > My attempt [1] is to add a new key, "MODALIAS1" for the second > > > > > > > > > modalias. This brings up the question of whether each key in uevent > > > > > > > > > file is unique. If it's no unique, this may break may userspace. > > > > > > > > > > > > > > > > Does anyone know if there's any user of the second modalias? > > > > > > > > If there's no user of the second one, can we change it to OF_MODALIAS > > > > > > > > or COMPAT_MODALIAS? > > > > > > > > > > > > The only users I'm aware are udev and the busybox equivalent (udev, > > > > > > mdev) but I'm not sure if they use the second second modalias at all so > > > > > > OF_MODALIAS for the DT compatible string sounds like a good way to solve > > > > > > this. > > > > > > > > > > As udev seems to "break" with this (which is where we got the original > > > > > report from), I don't think you need to worry about that user :) > > > > > > > > > Does anyone use mdev anymore, and in any ACPI-supported systems? > > > > > > > > Yes, regularly. > > > > > > Ok, and how badly does it break when MODALIAS is multiple lines like > > > this? Or can it handle it? > > > > Since the mentioned change landed into v4.1 I never had a problem with my > > setup. From my point of view it doesn't affect anyhow mdev setup. > > Do you actually have a device with multiple entries and try to do a rule > based on it? I doubt I have any use case for that. It may explain why only now the problem was observed. > That's how this was triggered in udev, "normal" operations > work just fine. -- With Best Regards, Andy Shevchenko