Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2578824rdb; Wed, 21 Feb 2024 12:05:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXEIPCoEXuoNuGqztQPBrPvAIf7wX33CWpJDqBLEJ73kuuASgNU9QCmcMRv70OnbzKOrdK8P8tPzftxJTQ+PBmo5bP/PWT4ZVVdTM5D7w== X-Google-Smtp-Source: AGHT+IET4NopY/AZ17KxC5WGWnvmdD3Z0zCZPMAp7VjxbGeHa4g2b0xdBEVcxxlY2h2HY/8K/EGT X-Received: by 2002:a05:6214:2023:b0:68f:2d80:c418 with SMTP id 3-20020a056214202300b0068f2d80c418mr27555805qvf.51.1708545923617; Wed, 21 Feb 2024 12:05:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708545923; cv=pass; d=google.com; s=arc-20160816; b=HK8ro2Chao0Xhlg3kbuVyC7z9TyjF4VAjVOrfm9/qihqahI6F1Q42NqD5afKsW1Lh2 K58MXKQfQnialk0XWCik52oJyTBk4oEvIC8EedkBTC9qL1cOhyYtPOUMSOuiWdzLpPrX iyXWrjsuWmbrbarCbkN2KSzoot99CnWgWRocUjjn0CuQRDnpVcoGSgtg+O2iIo8iWP0K J9X5unvJ+2HE2Y+ToHQQM0mXYZ+Kpxg6WGE2FgTgdi8IXGFtKX8cIOhqeggzXadJMEYx Sx8jLg9AHoFFAuxBdzP8wM21FEbavcmxkL4iID64MRswtw5y7aZDH39+3PS9aRrZap2H wNTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=uTnwWgntg8JlbgzacOBA8I5jMqM8rgs4FK0lOlPBe8I=; fh=s5Fc0MEg8Xcp85xwyejK4S4zs7msQB7g1OY0X3YpOJg=; b=GmxlCqz4cVlXlGdhcyG7KlYAxP0lZIyFgIATJfCbIau1mpfzCu94jjVoznpvPek3GR fShqayAwWP4cZfazwBfmSSQk4ENY59093a+z87HLYJrLd8PaD9nrPvVwWYpYXRMliNx2 WDnapncrbMMbHBWTYLnvirlmpCHHCerQ+qXzHdKk63l9SEuQXb11lfDdli6u1fbxBKel xm3Qx1PyHT6EPrsFZdg1sCYGq3IWrM2amEgttb0vvwEBNGmR9TlSTP7xqxes+/My+EhM wkQu//Mxu466TB7LRDRQrmq0wyJ4yoTdGQ9urc3gILprtrf5R9RBeCr6x17iijOdI3P0 0W7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-75446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75446-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m10-20020ad45dca000000b0068fab5b582esi1368398qvh.132.2024.02.21.12.05.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 12:05:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-75446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75446-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 758F01C240BF for ; Wed, 21 Feb 2024 20:05:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 46A941272A8; Wed, 21 Feb 2024 20:04:49 +0000 (UTC) Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C804E86636; Wed, 21 Feb 2024 20:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.96.170.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708545888; cv=none; b=cZ7LFVZ1smGn6f1JKEf+ICcPJhL2pX94TIU2g6k5inwQ2nc6T/Gyhio00nzRheE6wOjeAykNtfufLbz5Fg7CH4xrMYIOp8yTU1fhCmA1bEYgu5qSpm9qDJNWb6UHHl4QWw6u2licGKQ2Z9lc+QmAKGqM/RQ/Gla+W/+WB+PnGpI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708545888; c=relaxed/simple; bh=O76Kyj6+pIZBCaJtFD/N8mTlFGfeFfY2Ir+N2iw27Uo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZBB1mKpOSy0+AYqQCfXHGN19Kmg+q2LzfQiwdt7znD59PFOR9+vUzRaYlVk3nDCIWpsNfI1tSX4TlCnnskAitcz/JraA6Ug0vvQwL2UZ1KqkPYxvaNUQhAQCcb+Nus21dBUMUz3eBFCVuPoFhZA4Un6llRta4T4kJbZB++a+Gs0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net; spf=pass smtp.mailfrom=rjwysocki.net; arc=none smtp.client-ip=79.96.170.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.4.0) id aa8ad21d5d791cda; Wed, 21 Feb 2024 21:04:38 +0100 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id 688B066A243; Wed, 21 Feb 2024 21:04:38 +0100 (CET) From: "Rafael J. Wysocki" To: Linux ACPI , Jonathan Cameron Cc: LKML , Mika Westerberg , "Rafael J. Wysocki" , "Russell King (Oracle)" Subject: [PATCH v1 1/4] ACPI: scan: Fix device check notification handling Date: Wed, 21 Feb 2024 21:01:02 +0100 Message-ID: <4886572.GXAFRqVoOG@kreacher> In-Reply-To: <4562925.LvFx2qVVIh@kreacher> References: <4562925.LvFx2qVVIh@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrfedvgddufeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepiedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehjohhnrghthhgrnhdrtggrmhgvrhhonheshhhurgifvghirdgtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhhikhgrrdifvghsthgvrhgsvghrgheslhhinhhugidrihhnthgv lhdrtghomhdprhgtphhtthhopehrrghfrggvlheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugiesrghrmhhlihhnuhigrdhorhhgrdhukh X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 From: Rafael J. Wysocki It is generally invalid to fail a Device Check notification if the scan handler has not been attached to the given device after a bus rescan, because there may be valid reasons for the scan handler to refuse attaching to the device (for example, the device is not ready). For this reason, modify acpi_scan_device_check() to return 0 in that case without printing a warning. While at it, reduce the log level of the "already enumerated" message in the same function, because it is only interesting when debugging notification handling Fixes: 443fc8202272 ("ACPI / hotplug: Rework generic code to handle suprise removals") Signed-off-by: Rafael J. Wysocki --- drivers/acpi/scan.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) Index: linux-pm/drivers/acpi/scan.c =================================================================== --- linux-pm.orig/drivers/acpi/scan.c +++ linux-pm/drivers/acpi/scan.c @@ -314,18 +314,14 @@ static int acpi_scan_device_check(struct * again). */ if (adev->handler) { - dev_warn(&adev->dev, "Already enumerated\n"); - return -EALREADY; + dev_dbg(&adev->dev, "Already enumerated\n"); + return 0; } error = acpi_bus_scan(adev->handle); if (error) { dev_warn(&adev->dev, "Namespace scan failure\n"); return error; } - if (!adev->handler) { - dev_warn(&adev->dev, "Enumeration failure\n"); - error = -ENODEV; - } } else { error = acpi_scan_device_not_enumerated(adev); }