Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2126944pxb; Mon, 18 Jan 2021 08:54:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHSvP+PS1YCY742L3Tn0YPwY7wDtcymfVHy2P7vAJ1AEPK0KdhgM2qhbBjSEENP+UYaSWV X-Received: by 2002:a05:6402:1a55:: with SMTP id bf21mr321391edb.146.1610988877565; Mon, 18 Jan 2021 08:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610988877; cv=none; d=google.com; s=arc-20160816; b=MkzSBcFQgqCDvtyyMs6f8ekBbAS8RvMnXJMMgLVrHn4k4KIji4q6CqRSbzR080nI9A dAGMKcD2wQTxAs+SR/twxXxWcKpfZzY57bQhuYRHEn+dxZQ8NUw+N3XQuUIrj9j+/dTr EeKwG0NGq3mM7rJaZHN5cz7ofrVJqYOWUZnHaRsUVCQF09S3wWEC571V/ySayzBPCKr8 LIvnJeATOWEhJ6rzz6K3hV5z5O/KFF1d/WlnWgDFkymRjbrhm6g9q7Y/QudDDLBP1pHR KTOb7GX34zs65PYEsSxaeyBFq7ugpak3doG6+/2uLnSCuo0kgWGOPXdY+4MAl5PcpAHO eYZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=TgTRG9Oe1Mmto7IxBsILEQwgVz4mbXeM1t9fAFZ0WlA=; b=Zau3pwnwpmFpyYZBSPpxc/jNXzWZq+LYzejVyfo1RGUul5qzP5bV/hPItTDQhjNQZ2 HP2z0XOaXZ6dbn65w11CN7ChZu5ehMALUaINqiYMxqSsgGOOMaQyWlSc6uquSUyeHU1Q 9U7YDvYmrAfi7N/6vLwZ2JMB6PX1mnUQ2I/mA9YeK1zz+ecWlZzHrff1vKX/S2lGkjX9 bDUU7+ZX970wEMBxuGBWbSqAk5/Eru34XoIdpIuxnJgjG2tdTWlwK+xuMdq7T3mbxsv6 DZogMFPBoYC4I6i4l6r520RjBJryddOOtVixNFMlOI/onnqxxxiOjxxr4HY30WyaWHWy vBWg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si7381792ejn.166.2021.01.18.08.54.09; Mon, 18 Jan 2021 08:54:37 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393571AbhARQu7 (ORCPT + 99 others); Mon, 18 Jan 2021 11:50:59 -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-kernel@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