Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3597925rdb; Wed, 27 Dec 2023 12:42:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGMdX/jZ570g8Zgpga8+LHVBXaXz62qF9gfdwwEiC8M8FUnql2/eoqzA+oFkG+VGTE5fWkU X-Received: by 2002:a05:6512:3107:b0:50e:7736:c672 with SMTP id n7-20020a056512310700b0050e7736c672mr2049408lfb.23.1703709753581; Wed, 27 Dec 2023 12:42:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703709753; cv=none; d=google.com; s=arc-20160816; b=tdxDx6R+8075iXzzJSabF+/64ljKu8PEDyYxc74awRLD6rA0dBcZ0Ia13U71nyJrd5 h11Ho0Hx1R31rJeZYahuB3MaMGoGPuvBAL+uxqVc9M7ccq5FnJSrx8AQ/St8KuMwmsfr kCxdYJUUnDZf2ea05dJ5hHBUgc160BYriczcHbeijha/iU2+t1rfJDcHUBI8jmHYDQTC OQ5DdF/ioMYGZihtr5M+r/H+pn4EAVVR9oRummlmDlZt1+xBuNiTXRFF0v2E0G22k12j 4THcgE/xMBJpvEI4vEhaGyzfA4r5Vn+damBTi7m/dyF79DO+loCwedeQU0AgbqJWZaid nrrw== ARC-Message-Signature: i=1; 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=U+F+o+B/6Xq5Z63S74jmOKHytlVtgSl7aj22P0J1OQM=; fh=GJObpfi22GEDsdUJ/UPF0sV9R5wqW+3fN2C4DnWtGgw=; b=fUC/Ybn7KzRh9lLvullmCz6Dm02mXWPqvi3V2f+SAie5Wn4p+thBHD4xAfWLfPYOF4 Ov0LsyNI6sG8SY7dhyoM7P6i+iMVOtS9PGVL7QC+D8ZyqKGuIMxrddkg/OEGWjN33Uv/ Ww4r0ILftQXnyQTxBqMdaBNNowdgqDQYQcCNUEF1kgfSjQAuJifV6ixD0vHGyz40nLYX PE7HT7m3suxeasARHDJACSwkBE9sz3XDVnj6YeRzYbvHRt6JfEQDBvf7dd7H8JK73Ior S8aHUmT/apMB1eYBxEJ8y3ERqeizAu8/XHTDnf5Xyk9p+MJyFHZxatelZA0RqSFDMW2z ibxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12247-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gk2-20020a17090790c200b00a273e16b657si1049898ejb.82.2023.12.27.12.42.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 12:42:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12247-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 532571F22375 for ; Wed, 27 Dec 2023 20:42:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B1FB048CC2; Wed, 27 Dec 2023 20:41:49 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org 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 4D86E47F69; Wed, 27 Dec 2023 20:41:46 +0000 (UTC) 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 954e4a2bde97b9af; Wed, 27 Dec 2023 21:41:45 +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 AB00B668E17; Wed, 27 Dec 2023 21:41:44 +0100 (CET) From: "Rafael J. Wysocki" To: Greg KH , linux-pm@vger.kernel.org Cc: Youngmin Nam , rafael@kernel.org, linux-kernel@vger.kernel.org, d7271.choe@samsung.com, janghyuck.kim@samsung.com, hyesoo.yu@samsung.com, Alan Stern , Ulf Hansson Subject: [PATCH v1 0/3] PM: sleep: Fix possible device suspend-resume deadlocks Date: Wed, 27 Dec 2023 21:35:53 +0100 Message-ID: <6019796.lOV4Wx5bFT@kreacher> In-Reply-To: <5754861.DvuYhMxLoT@kreacher> References: <2023122701-mortify-deed-4e66@gregkh> <5754861.DvuYhMxLoT@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: gggruggvucftvghtrhhoucdtuddrgedvkedrvddvledgudegudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeefudduuedtuefgleffudeigeeitdeufeelvdejgefftdethffhhfethfeljefgteenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepuddtpdhrtghpthhtohepghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohephihouhhnghhmihhnrdhnrghmsehsrghmshhunhhgrdgtohhmpdhrtghpthhtoheprhgrfhgrvghlsehkvghrnhgv lhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegujedvjedurdgthhhovgesshgrmhhsuhhnghdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=10 Fuz1=10 Fuz2=10 Hi Everyone, As reported here https://lore.kernel.org/linux-pm/ZYvjiqX6EsL15moe@perf/ the device suspend-resume code running during system-wide PM transitions deadlock on low memory, because it attempts to acquire a mutex that's already held by it in those cases. This series addresses the issue by changing the resume code behavior to directly run the device PM functions synchronously if they cannot be scheduled for asynchronous executions (patch [3/3]). For this purpose, the async code is rearranged (patch [1/3]) and a new variant of async_schedule_dev() is introduced (patch [2/3]). Thanks!