Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7043591rdb; Wed, 3 Jan 2024 02:41:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IH6SEOuA3w2WQIKKan6rr8/iyogr6QpV+boiWEcKqs4hSIdiDIjBoPdAlg5jX1fNT3sQyHc X-Received: by 2002:a50:d715:0:b0:54c:a432:4e8 with SMTP id t21-20020a50d715000000b0054ca43204e8mr11480632edi.35.1704278468886; Wed, 03 Jan 2024 02:41:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704278468; cv=none; d=google.com; s=arc-20160816; b=pPerM6iVvgzwtT18n2MWouoU8WwiBjnRur4cS5lhhBKBsL3SvCcERFB/hwMY02zbhp K9XvoRjtOtfHk3vzwsww11+lA5uMg2U0OhGN51fpM2x4IhmMH6NNXk6rdccrXWbplD2t Ou8+zmv1KQNkKxKcP4pCnOfg9jrWvKbhydaNNWGQaYg6N0xPKwBgAiFAp4tle1YDCrId jlslpVFeaaKNOyp8ejjEzhWyKN7JX2HF7wTc32dH/3EdiqU6uEEERwUMkjM8s1JprXFI n54Bw2Ng6cjgv83iLoO7TOgjyYYn+dUMJ4BZbAKEROXh6rRwx6IoxZpbbhIcfT4dZBrE hnGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6hP4XHwl2eO4qmnky3yapKQx1sSelnS1DsWn6FwWeIc=; fh=X0uUI4lpBa1T7qrv/c5l6KdOUHWChnAM7C+50EJo6Po=; b=Uju5o0rs66ltFsJk4m9Pubr7HoKXiKpoxH7i2bhPKUHYx05vEW0e+KxC0+/pz1hkxA rosXILiLPCnuwbZzsDWDUhODPcnCHyWjVP0itGa0kXOJ+cfaFSm7N32iUdyuaHX8AG6Y ramSgPCO4Lp3acfdbYWNRdnRRGqBprfoMX3wXUaKSmu+VNdswh0YkjCC3X3Flouqe6Hm /vTqO6VslgTdJk90+CwOH6gYwHo6tft7KfpD19zn+ALih2tsDgvdYXxH0gqx+n/Lpieb wIaWQQdkdgvm8fITXC8vNpxIP15cmmfSQUjGclDeceGPwNULlfDW1TdlfW7l3xnbfZ1i HJ8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pKmf45K6; spf=pass (google.com: domain of linux-kernel+bounces-15396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 a31-20020a509ea2000000b0054cfd045e4esi11950532edf.363.2024.01.03.02.41.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 02:41:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15396-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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pKmf45K6; spf=pass (google.com: domain of linux-kernel+bounces-15396-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15396-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 23ECF1F243BB for ; Wed, 3 Jan 2024 10:34:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97AB418C15; Wed, 3 Jan 2024 10:34:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="pKmf45K6" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C554218C07; Wed, 3 Jan 2024 10:34:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB253C433C7; Wed, 3 Jan 2024 10:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1704278041; bh=aWS2YME3848I0ynrLAlho7FFoHCPwzbm0vF7fMYm1is=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pKmf45K6HdKLWkwCnWBjoCLIEIx8ZjwReE5yynxg3/Qf7jwrID7nt62+qAvqexJUt gugqzkk1v8/V3sDUravrVz6JVtkypqNrKBDyJL+FQhshpEwI5t/3TUUsD5bBHXNctf 3BrHPWIFXPlo4HKXHmGFIX4yMCChL7NLj4J45qic= Date: Wed, 3 Jan 2024 11:33:58 +0100 From: Greg KH To: Ulf Hansson Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, Youngmin Nam , linux-kernel@vger.kernel.org, d7271.choe@samsung.com, janghyuck.kim@samsung.com, hyesoo.yu@samsung.com, Alan Stern Subject: Re: [PATCH v1 3/3] PM: sleep: Fix possible deadlocks in core system-wide PM code Message-ID: <2024010322-uneven-nanometer-7d6d@gregkh> References: <5754861.DvuYhMxLoT@kreacher> <6019796.lOV4Wx5bFT@kreacher> <13435856.uLZWGnKmhe@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Jan 03, 2024 at 11:17:18AM +0100, Ulf Hansson wrote: > On Tue, 2 Jan 2024 at 14:54, Rafael J. Wysocki wrote: > > > > On Tue, Jan 2, 2024 at 2:35 PM Ulf Hansson wrote: > > > > > > On Wed, 27 Dec 2023 at 21:41, Rafael J. Wysocki wrote: > > > > > > > > From: Rafael J. Wysocki > > > > > > > > It is reported that in low-memory situations the system-wide resume core > > > > code deadlocks, because async_schedule_dev() executes its argument > > > > function synchronously if it cannot allocate memory (an not only then) > > > > and that function attempts to acquire a mutex that is already held. > > > > > > > > Address this by changing the code in question to use > > > > async_schedule_dev_nocall() for scheduling the asynchronous > > > > execution of device suspend and resume functions and to directly > > > > run them synchronously if async_schedule_dev_nocall() returns false. > > > > > > > > Fixes: 09beebd8f93b ("PM: sleep: core: Switch back to async_schedule_dev()") > > > > Link: https://lore.kernel.org/linux-pm/ZYvjiqX6EsL15moe@perf/ > > > > Reported-by: Youngmin Nam > > > > Signed-off-by: Rafael J. Wysocki > > > > --- > > > > > > > > The commit pointed to by the Fixes: tag is the last one that modified > > > > the code in question, even though the bug had been there already before. > > > > > > > > Still, the fix will not apply to the code before that commit. > > > > > > An option could be to just do "Cc: stable@vger.kernel.org # v5.7+" > > > instead of pointing to a commit with a Fixes tag. > > > > Right, but one can argue that every commit with a "Cc: stable" tag is > > a fix, so it should carry a Fixes: tag too anyway. > > Yes, certainly. But in this case it's more questionable as it's not > really fixing the commit it points out. > > Note that, I have no strong opinion here, but maybe Greg has a preferred way? Either is fine with me, just to give me a good hint on how far back a commit should be backported to. thanks, greg k-h