From patchwork Mon Feb 26 16:35:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 206773 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2198782dyb; Mon, 26 Feb 2024 08:48:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVNWND/ItGfrjBSU8JVh6ExGeufL38DQxHniHvpK7vHfzn7/D3mUdsLgz8/DG8qpQ40vjd+QltIKpzLsnAU+LAAFvWaJg== X-Google-Smtp-Source: AGHT+IHLz8CDX8k+tklx32ANY8XtSiLpwYoUVm+AEkA1EG/tff49HvOocu/4FI487pGMsug0mHSI X-Received: by 2002:a17:906:371a:b0:a3e:9ad2:b555 with SMTP id d26-20020a170906371a00b00a3e9ad2b555mr5427859ejc.24.1708966123304; Mon, 26 Feb 2024 08:48:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708966123; cv=pass; d=google.com; s=arc-20160816; b=tvRoEmz+5qCj8mvAsN/rkgCd/NMsb7Lqf51UZ57pPxmlkuQdcslv92EZ1xgxQFvDFl +7al9+9LblKFlMGFKhl4vIQUE0Ui6g9/sXXb8HtqQeSPRHrGLdy7UgVm8bwm3T9TNV3W jJ8MtcnIthzQs00/QQpZVwXP+J/4ulEu7efdYXfllaw8MUpHKv8sl3+nNKJiR31zo91k fzcXq8NyMhMXnCmj68bW1KRwPHW8zXO4KdXG1WfLpnZ8frIwWR+00wzTSalaSpGyUd+Q wrUEJxHnfORVk1xNWZC9uxys5lk+SLbZu5u7luptGCEef2R+HEUgNTAILF9gxPMDiVw1 Dv0w== 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=NQuOj0hlUdHDqHNupxytkXFMuRFJrbUDjSm2y06hW6s=; fh=s5Fc0MEg8Xcp85xwyejK4S4zs7msQB7g1OY0X3YpOJg=; b=pA0jb+H2pf/PN56sKXrnvfRYtVspjdyPlwFMTerSV02AAXxxL6yG6icZbLA5hMrLlO SgADNlEc4ARJtbXmZ8jmtTQ2gXBIoKFnhyvk6EnZXA6BUTXLUeAnCNxyZaCCge3mAvhL w1mpUwT5y8uN+x3KRwe9UBMQ7wrqB9W8foAPQM/h/bprNA2qH/AkEvCm5WV5sS9i04Xk NBDShj2Opm1RUbezsHpsjaDeFrxUTcrVhLAsTYksfynL0OxWOI2M2vC/gW8mSIVavsf1 fckOqvowkUow89HuN5KhVXWtGi6k1glOVABrXXiXpYNzQH2GDtv+wcddzjsnhVF7/gFm uFaw==; 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-81933-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81933-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d13-20020a170906304d00b00a3e60a2f52dsi2213000ejd.426.2024.02.26.08.48.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 08:48:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81933-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-81933-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81933-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id C504F1F27B51 for ; Mon, 26 Feb 2024 16:48:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 501C412F38F; Mon, 26 Feb 2024 16:47:12 +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 C3F9012CD9D; Mon, 26 Feb 2024 16:47:04 +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=1708966029; cv=none; b=p6iyCw4FnbxOSHYnhAcjDbN9Tmf32vAlBzvm9zi/XJ241Qr8y48DIdydPtnnpV3Rl9HAqoelNje7Pn/gLfvXpDiuaF1SYrSl+szOPy+x3fWup6Iz2Fdss/dguC1Ana+LUIkMz/AKpFl1efeZ71U+HRf6Yvx5OJm7gMZffIqnz4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708966029; c=relaxed/simple; bh=PFacI6m4BV3rHxOR399FTPDr5BTzRgPrKVoC8SRi458=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZeW3yFRYYP7k+85JqQwqyr/iuXEqRgbRr/0MNYe84os4WAaSqtEXidrqZIno7Kg5uLcJu8ybGxNQirVQnr7kKWsloxctHJSylkvXnDX9mq3zvKEJcDPS27HBoISKu4oWYXvSYd5JItj+eYKoAJD1CLfYWFsyUSWsA0a3+SI8FO8= 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 3e4fcb9c8cea8f7c; Mon, 26 Feb 2024 17:46:57 +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 AA54166A4D4; Mon, 26 Feb 2024 17:46:56 +0100 (CET) From: "Rafael J. Wysocki" To: Linux ACPI , Jonathan Cameron Cc: LKML , Mika Westerberg , "Rafael J. Wysocki" , "Russell King (Oracle)" Subject: [PATCH v2 1/5] ACPI: scan: Fix device check notification handling Date: Mon, 26 Feb 2024 17:35:27 +0100 Message-ID: <4872492.GXAFRqVoOG@kreacher> In-Reply-To: <6021126.lOV4Wx5bFT@kreacher> References: <6021126.lOV4Wx5bFT@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrgedvgdeltdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeeipdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhonhgrthhhrghnrdgtrghmvghrohhnsehhuhgrfigvihdrtghomhdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehmihhkrgdrfigvshhtvghrsggvrhhgsehlihhnuhigrdhinhhtvghl rdgtohhmpdhrtghpthhtoheprhgrfhgrvghlsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigsegrrhhmlhhinhhugidrohhrghdruhhk X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791980861420291021 X-GMAIL-MSGID: 1791980861420291021 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 --- v1 -> v2: Add R-by from Jonathan. --- 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); }