From patchwork Wed Feb 21 20:01:02 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: 204415 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1268632dyc; Wed, 21 Feb 2024 12:05:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWUseFYqG+6gm7JZcaIpO3iaJT/+ClaTjb3tnUeb2Ds1vtxwoHfueWDQd97OxCywNgXk8NlywdH8HifVKXsquoDJWDDhg== X-Google-Smtp-Source: AGHT+IEyyB1wUsRGBt51R1UDczs/hbGJ1cjVu5FFe3LIagQmdRiZvlzjIWeoisaW0yfzJm9+KWPL X-Received: by 2002:ac8:5804:0:b0:42e:404e:238e with SMTP id g4-20020ac85804000000b0042e404e238emr1823832qtg.16.1708545941691; Wed, 21 Feb 2024 12:05:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708545941; cv=pass; d=google.com; s=arc-20160816; b=TqAXWmvEGRZFVflhP/FuHSQuukxMiO34Friz5gvKsPWcTZBtnjDGO/9RIOqiM9FMEy tAtQMNAeJUtJd+wtvod9dfvjrUpWbHiV6UMbHODT9HWC/L93w10NeVfn2esylEaXX77v wvmwKq4uKAyGCHfKdZ/n3AMqxqMlewBueglMRwKB7nS6/tP1D6DkjWflGlETlxLrZ2Xt zmehRlFkFzl/mA9yCCcFoNWYo5Tw6uxOgkZg+v0I4DwD2gP26kFJhne9qJ1AYeMD/29z 1Z5+nmutLim26NHN3hyRGqb+H1qpNfZTPdS0DBBcfCU05H2lm1fbYYa8BtzJx0szD1hX 5ceA== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75446-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c14-20020ac87d8e000000b0042e19bebcfdsi29765qtd.322.2024.02.21.12.05.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 12:05:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75446-ouuuleilei=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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75446-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 479621C24784 for ; Wed, 21 Feb 2024 20:05:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71E7F128364; Wed, 21 Feb 2024 20:04:50 +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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791540269626400202 X-GMAIL-MSGID: 1791540269626400202 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 Reviewed-by: Jonathan Cameron --- 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); }