Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4632415iob; Sun, 8 May 2022 19:58:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfkqOTvwUfJVBVwtSZJ/mGw7/bTWmnAF/3ov1FSwUHx3BE7tWrsBxqe8l1fQWeyTIEOPHe X-Received: by 2002:a17:902:9a0a:b0:158:a22a:5448 with SMTP id v10-20020a1709029a0a00b00158a22a5448mr14429191plp.20.1652065107860; Sun, 08 May 2022 19:58:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652065107; cv=none; d=google.com; s=arc-20160816; b=RU7kO67KtvY/x5h+JyRXAxathalEpEywkfya25dDuVe0NT8BT6FogVunzB8RBty/6f qZxwKbtMAsyEutXUlY8SLag6HKqfCpk5+gRpnPVU+YLVHRDMfpG5/Q2J2clFtEnpZ4PE XnMTFBIm64Ua0SQSx0tmh9YBKi08TxW0DHwe1QaSeVF7ksitAC7clOXYxUvU/zbcumbe YqxT7XHYc0S3cCUOgiK5gxUDSdAv/0V4REzjZKdZ3L+dwnbG0gsGGtLdDNEYdY/kLftb HIJPImpoXwpPX0EWtvP2DxqYQs9+GgnvOSWo6icTF0w6SljjQT6pp7+fyFFyy45bqVew nMUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=nEDjcO7csJheqO6bWjDm+F3VFBUm5M8pcP8iGWfrZ1o=; b=FMkj3hNaueUwRwHYZX2zSc4NHWM/8ZvCB+RNu202rQvuZrxqvh68YN/WxNheE5zoad WFuLtXcmkA8nmvzk3pqesBz4LTIe4t27Br9PLmXyiFXOa51eZdOo99dLOtl2FdFo+1k9 CF+l8QoBWdZ1A4g+FXyxdy/YJLS3Je4Ijh90oN8OPUiBCon71o/EPHhx05TnIb3bAocD z5TKg8lWLXXPWrg9qliD7IgTMsJOil6mbg7mz7VvcpqtMPjg2+QYjLLiGVBkNK9sVvGa mNcPFMjIkRskuTLjANIWX/Mjj4RboPdI1NSUTtVHOZo9oIGlNStAZ9BfypaIyKHw9V0g hghQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c65-20020a633544000000b003c64f412ed3si10506473pga.608.2022.05.08.19.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 19:58:27 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 689CE84A33; Sun, 8 May 2022 19:57:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238045AbiEESfc (ORCPT + 99 others); Thu, 5 May 2022 14:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385340AbiEESaW (ORCPT ); Thu, 5 May 2022 14:30:22 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C77C5D644; Thu, 5 May 2022 11:21:01 -0700 (PDT) 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.0.0) id 27807f26a92f6163; Thu, 5 May 2022 20:19:40 +0200 Received: from kreacher.localnet (unknown [213.134.161.219]) (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 v370.home.net.pl (Postfix) with ESMTPSA id D246266C2F5; Thu, 5 May 2022 20:19:39 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PCI Cc: LKML , Linux PM , Mika Westerberg , Bjorn Helgaas , Nathan Chancellor , Anders Roxell Subject: [PATCH v1 03/11] PCI/PM: Set current_state to D3cold if the device is not accessible Date: Thu, 05 May 2022 20:04:07 +0200 Message-ID: <10104376.nUPlyArG6x@kreacher> In-Reply-To: <4738492.GXAFRqVoOG@kreacher> References: <4738492.GXAFRqVoOG@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.161.219 X-CLIENT-HOSTNAME: 213.134.161.219 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfedugdduvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppedvudefrddufeegrdduiedurddvudelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudeiuddrvdduledphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepjedprhgtphhtthhopehlihhnuhigqdhptghisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhhikhgrrdifvghsthgvrhgsvghrgheslhhinhhugidrihhnthgv lhdrtghomhdprhgtphhtthhopehhvghlghgrrghssehkvghrnhgvlhdrohhrghdprhgtphhtthhopehnrghthhgrnheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprghnuggvrhhsrdhrohigvghllheslhhinhgrrhhordhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=7 Fuz1=7 Fuz2=7 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Make pci_power_up() and pci_set_low_power_state() change current_state to PCI_D3cold when the device is not accessible along the lines of pci_update_current_state(). Signed-off-by: Rafael J. Wysocki --- drivers/pci/pci.c | 2 ++ 1 file changed, 2 insertions(+) Index: linux-pm/drivers/pci/pci.c =================================================================== --- linux-pm.orig/drivers/pci/pci.c +++ linux-pm/drivers/pci/pci.c @@ -1207,6 +1207,7 @@ int pci_power_up(struct pci_dev *dev) if (PCI_POSSIBLE_ERROR(pmcsr)) { pci_err(dev, "Unable to change power state from %s to D0, device inaccessible\n", pci_power_name(dev->current_state)); + dev->current_state = PCI_D3cold; return -EIO; } @@ -1335,6 +1336,7 @@ static int pci_set_low_power_state(struc pci_err(dev, "Unable to change power state from %s to %s, device inaccessible\n", pci_power_name(dev->current_state), pci_power_name(state)); + dev->current_state = PCI_D3cold; return -EIO; }