From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 BF0BC215F73 for ; Fri, 20 Dec 2024 15:15:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734707729; cv=none; b=nNUhMkPibttBYPdSjLzAyw0fHjfNgzDikwmqC4Am+JuT/6NZIBzZejIww73g9dLUTxRoEJVyiYdGIYmAX1Dm3OVp+uLaTYn5BX8E3dH+nbLS0x3G2JNcWindK4m5k2Ljirn9aH8+yCNZJqi8kbvDBRhDB0vW2GCuLzh0YK96Ph8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734707729; c=relaxed/simple; bh=kg49+uaoHpj7D++o6jRL1ADBtrJA1aWRF63Yb9kp8ZI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qy/SD/ykdcDSfiaJQov5Bm4e/LgWP72W6D3Z4iiSU6IfgdJsS7g/R7f1jNQIrEQNiZ+RlFJr+6tnLD5riJtL1lY9uD0oCG9FhHPjvW92YxjJFPq2RRvdmp78Aal9h6p/OL2OTs0VJ4D6PDmBi0CoT5YmM/ftxm4fUaylqTsOdvo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=CWkrGgGe; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="CWkrGgGe" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BKCj2ad014474 for ; Fri, 20 Dec 2024 15:15:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 9pdRk1FNEwE15r/NRpb5txdFYJ22rYoCmR29SeDLD9E=; b=CWkrGgGegK3PkMiY 21XQ7nuYVRZdULWoQulYqqX8aAHE8jbyNEdEg73YmDZVSxvnURpB4D4bUA+m/kTB LO1CY95KY8IVvkA7UHxeL2jUR6ya8zlQljpYX2cWDemMtBTBxIwyQT/J9CgWKBPW 9sUxYrb6RRpvNNOJWaxLc18BXplb1tD5Rb/YtnO2odLR1Hg4INSoaaBIxhhHsKuV /o5/i66CKjOmTe92spTR3caiejJbu24r8RB+RllT4HwZgBQbPp2iYU0wkl5Csv5z tCBy0CRXjZdO9bhgYqFHuT2Unuu0R/Lo0AnPZ0heF2W92bgaIriX8GZz9nI059b9 qGsaIA== Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43n8uvgbeu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 20 Dec 2024 15:15:26 +0000 (GMT) Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6d8f15481bbso5736376d6.1 for ; Fri, 20 Dec 2024 07:15:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734707725; x=1735312525; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9pdRk1FNEwE15r/NRpb5txdFYJ22rYoCmR29SeDLD9E=; b=tOTIRUSXZDqeG50cVyX5r9U1snECxCNGNuWOOMQzRDowxg1FDZDzVo6gqt9FZzudWZ KvFhzmMYAm8mXSgh2U5A/40y02yM67MsF8sdS8kxK3vIGqZW7PzWCTds5wOP2wfXuHFV oexARaPevdbZ7ZuinazqFRJZj8y2ssXAIkWwxV6nOZRxIjUmnRjxT0EY5x2IEmvoafAc tF+qkUKMksmgBrlMFM6ZN6HDv8hyFAlsoixH8mgTJ/97wI3wIlXOsMV39mVaq+cQiHYa +ajMLBufNz9aLhqcYYxxY3XOOkIKpLsUwKfipbS9oEC/I8Up3vpHCOlxhMgnolowH1Tb 1WPQ== X-Forwarded-Encrypted: i=1; AJvYcCWIR6sDkogqgW4dBQlGCQgTr7+jHlwj3DatIWLavZTb7LUF1jK3H3Sy0S/2sATYCqsDkCUohBp3XckQHZc=@vger.kernel.org X-Gm-Message-State: AOJu0Yymo+bq8uvjWfpeJRnR+2YU71f7GhAyWUIvdxA+EG4NqpZtwBZ6 zpTpqjJQg9lVwAJVqzkXtrIz77oL/4Epp2GnWSK8kCBPqjh84FspZnKt5J+aCodCKzN19XnEUb+ JdS/uYDRD/Kt0mTCmGQ0L7s5eRT6xynHWUB+OnUKAZX1jEYBWAUNL19lx5P0ZUrQ= X-Gm-Gg: ASbGncuTpdo7AhPw9Pl7bsdABDev3cBjdNGZU2nJXVYLw63ejFDY/sGT39z0DdEsoLY ahp8D2Q5ssenhzZATyaosOdUO+92iizTFWxANVBPPa55BOqij9Wefm1SZyAzrSXftBKlk1Ob9Zp q86mThca+BcrtBVrWd7oOX04m+Yj6Mce1JIVm/pZzNrrVW6JLqk4ElsKK7NCuqsnNGBR20DFi+7 puGROdgd3f8wFKsb58f6lhXEAOH7iG1gbfxcF+kszcPaeg3JK/mJUgnHqf0ZazywGl+qz7r24Wu TQ69C4SHqRO+2JjbS5XjlaMoVNgpCb4OHqA= X-Received: by 2002:a05:620a:2454:b0:7b6:c8a4:ba09 with SMTP id af79cd13be357-7b9ba7be496mr170654085a.9.1734707725180; Fri, 20 Dec 2024 07:15:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFD5koPpJL0wKEso3nr+u+1J+IrI3s+lO5cyWCeEsrPYRbTAkLqKhgQ19j1vhTaqjkKzFcUzQ== X-Received: by 2002:a05:620a:2454:b0:7b6:c8a4:ba09 with SMTP id af79cd13be357-7b9ba7be496mr170652685a.9.1734707724779; Fri, 20 Dec 2024 07:15:24 -0800 (PST) Received: from [192.168.65.90] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d80675a741sm1818444a12.12.2024.12.20.07.15.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Dec 2024 07:15:24 -0800 (PST) Message-ID: Date: Fri, 20 Dec 2024 16:15:21 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] nvme-pci: Shutdown the device if D3Cold is allowed by the user To: "Rafael J. Wysocki" , Christoph Hellwig Cc: Manivannan Sadhasivam , Ulf Hansson , "Rafael J. Wysocki" , Bjorn Helgaas , kbusch@kernel.org, axboe@kernel.dk, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, andersson@kernel.org, konradybcio@kernel.org, Len Brown , linux-pm@vger.kernel.org References: <20241205232900.GA3072557@bhelgaas> <20241209143821.m4dahsaqeydluyf3@thinkpad> <20241212055920.GB4825@lst.de> <13662231.uLZWGnKmhe@rjwysocki.net> <20241212151354.GA7708@lst.de> <20241214063023.4tdvjbqd2lrylb7o@thinkpad> <20241216162303.GA26434@lst.de> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: H0Wjb5VU4mY0SnKL2Q9HpMZbOarajGOh X-Proofpoint-ORIG-GUID: H0Wjb5VU4mY0SnKL2Q9HpMZbOarajGOh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 spamscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412200124 On 16.12.2024 5:42 PM, Rafael J. Wysocki wrote: > On Mon, Dec 16, 2024 at 5:23 PM Christoph Hellwig wrote: >> >> On Sat, Dec 14, 2024 at 12:00:23PM +0530, Manivannan Sadhasivam wrote: >>> We need a PM core API that tells the device drivers when it is safe to powerdown >>> the devices. The usecase here is with PCIe based NVMe devices but the problem is >>> applicable to other devices as well. >> >> Maybe I'm misunderstanding things, but I think the important part is >> to indicate when a suspend actually MUST put the device into D3. Because >> doing that should always be safe, but not always optimal. > > I'm not aware of any cases when a device must be put into D3cold > (which I think is what you mean) during system-wide suspend. > > Suspend-to-idle on x86 doesn't require this, at least not for > correctness. I don't think any platforms using DT require it either. That would be correct. The Qualcomm platform (or class of platforms) we're looking at with this specific issue requires PCIe (implying NVMe) shutdown for S2RAM. The S2RAM entry mechanism is unfortunately misrepresented as an S2Idle state by Linux as of today, and I'm trying really hard to convince some folks to let me describe it correctly, with little success so far.. That is the real underlying issue and once/if it's solved, this patch will not be necessary. > In theory, ACPI S3 or hibernation may request that, but I've never > seen it happen in practice. > > Suspend-to-idle on x86 may want devices to end up in specific power > states in order to be able to switch the entire platform into a deep > energy-saving mode, but that's never been D3cold so far. In our case the plug is only pulled in S2RAM, otherwise the best we can do is just turn off the devices individually to decrease the overall power draw (simplifying some small edge cases here, but that's mostly the story) Konrad