Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2483883pxb; Mon, 18 Jan 2021 20:46:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwj4X/ZR5lefPcckROGztfujM6lENDYKxU7PmHEHsqy5UTl/bIV8Hc6DuNlmYV0ZgyzrxaG X-Received: by 2002:a05:6402:5193:: with SMTP id q19mr1997309edd.264.1611031613196; Mon, 18 Jan 2021 20:46:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611031613; cv=none; d=google.com; s=arc-20160816; b=qzK3iHqkW83afKY1iM0JLxi/Q8iw/2b6VMuQDB/NaJFIK3RX6MELAgw+HA4Sd6FraK l7Tc0q4RRJSXV/hXBDWsECCLtC1SlwSj7xSLVYT8rl1UY+fMjAEca3DPh8A3mZ+DEqhD YgBxi8HunFm3Y15UAshHvG+inxWPSBfrPaE1JRGSmnaCWvNBRXhd621wfS/ET0RNWqAe O30MT0dLuMO/8tkwuY9tjrF7rmJJVko+9Be5Y4lFyUnfhN56LMZgB/aemlV5QM4znnNY KrgCEERZNHxMRLTcLZWL+gGX4lqk3O0MYnuo60dE6FAYgzBhOpNATbuZq5m3NBPgX+wx DhXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xTaZzJxa9hz7HMcJ1uJdp8YygMfpYJ7GSK+Jj3ISEo0=; b=BfUXZZxfCYyGr/+XsYXrT6aiisbiv2nAWfIabvaZmtqci6wXXjyxb5Q2IjPgCFisBJ DZaoSOW2erVHa+YmBbsVxo6ke44rmRKhJjmrksG6abyx1FXVSnKX7piVW/sNOWjz13IN uq0/OIlzESknaB2ydXUVjHYoTLQlKOaJv9e1R+kN2n9r2un13huLW+YkI2PgNBhZT3Hc rxPDd5NeRdU/Exr3fjQVpCqtTnTX+KmhWuGWq1x5v777p7vnUyElx8A8eCIsh82ttzpd iSTen4A5vKqffQXtVwvujM3cAkV4qh4hbBfX+RG5UzssLXaUpog1lZKGu7NSwVnf0tzp xHCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pEWe309k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k17si3461326edx.245.2021.01.18.20.46.24; Mon, 18 Jan 2021 20:46:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pEWe309k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393544AbhARQlx (ORCPT + 99 others); Mon, 18 Jan 2021 11:41:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:52038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390380AbhARQlU (ORCPT ); Mon, 18 Jan 2021 11:41:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3B0DE22BF3; Mon, 18 Jan 2021 16:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610988038; bh=vwCki1f6YIWIWNcCAyhuitSK8rQJU8G6+bsi8qQ/MdU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pEWe309kIfgkz1Eu1f+wPHYVHxOtbzsVNujPC1GJa6MsOa/BJy2t4/qijjlzLxdCo bfK8l/+BBd/F1Uk/pCenFp9kyjj1M5B/b/q7LTiehNbyvsZdvDd3iqUAW4GgmXwf3Q N9HEwIHKuAZLd3BmTeP/ZdUIbALOSIWhBNTdFrPo= Date: Mon, 18 Jan 2021 17:40:36 +0100 From: Greg Kroah-Hartman To: Andy Shevchenko 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: 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: <20210118152744.GW4077@smile.fi.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? That's how this was triggered in udev, "normal" operations work just fine. thanks, greg k-h