Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp763895rdb; Thu, 22 Feb 2024 21:21:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVqh1TBvF3hBfsNGEsuaV8bpTorg+7NmO5Iy8Hf1tLhxgtplwHYbQMquWI0nXu0H9rpPmSNPG9ejTz7oN4375H73v03yybPwzPTMgiUSg== X-Google-Smtp-Source: AGHT+IE6xs7CKAZ73aI1nSazeTug6fXSC5y0bMMytb3VynTQOZnlkSur1eQ7c98Zl+nobWFddprY X-Received: by 2002:ac2:518e:0:b0:512:caa2:18db with SMTP id u14-20020ac2518e000000b00512caa218dbmr635576lfi.35.1708665663684; Thu, 22 Feb 2024 21:21:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708665663; cv=pass; d=google.com; s=arc-20160816; b=SJwZn7i8fq+NxJZDS4Nr7jK4VpHfZrL+BK4U6Y27gZ4xMsShvyg4tn49AUvfmf8fGb N8FH+7JIylXtisM8oWEuG1qcXGbncJqZ48+juGNVz4im9fUmNmSRaXii0ZjwDUz6lWU5 yugIZ+gLL05ApY2NQwF7/cLOswvcB9MCtYLlkBFhgZ34XvzI0Zba0QoM58VGqgnK0i3s WYdDvOwPRTzXasld6Gl7FwVEGpPV4hn2enzzzxM+Zl8cZ9jsSQh8lwH6o/HS4AeokL5u qyCwWgS2mrOZTn1gziq2i3B03Mho/pgfNk8N2uZ6O2MG7cVPPmeGrWYKjmON/gJiBW2p bKSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=XtP90d2oLGHAANc4Hry0XB7XCfCAgx7Z9UEZsQuUESs=; fh=bozUd4cG+LbBfkMIFoTFJVIdkIW0amMAKKlEZW9qCmw=; b=qZJ9nJq53oDI3++o+rKvZznuQomQHK6VyqQnJiVcT42tewTU92smsSagVMo0bRvRc7 rOuLGFsZEPj3I+3SAJOdeZVyNfBwN7rWWqdLrKbQfCYHbnrdpPvbEj7z9EF5odAgby8P 6B5a9nTd8opeEgEMLmWPHsEVBueSOX/Nb3oWPeLgHB1BcraBsKIyirsB5xuE7A2wDw5h IcKQwPAUCGO3INg9/iW+WD0EJtYCSa3D2XPJU4jIjcYxzi+19cvTTS5j9RevWVfcNQP0 wURLB4yXjwVdg0LUez4fA2BuC6HGdTpvf1j7le9ImxoVAPnONSWoPTrP0s4UPZFJk4o5 RCcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=aiV8mtXW; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77784-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jz6-20020a170906bb0600b00a3e34065e97si5303926ejb.125.2024.02.22.21.21.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 21:21:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=aiV8mtXW; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77784-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77784-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 478B41F263DC for ; Fri, 23 Feb 2024 05:21:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55DD611CAE; Fri, 23 Feb 2024 05:20:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="aiV8mtXW" 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 DBD11101FA; Fri, 23 Feb 2024 05:20:52 +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=1708665654; cv=none; b=GXZ4hgPIwoyste1+ICEvReuYXfKsEj6024pQTJNd+Udrw5YZoxkvMH+VmCGaygIkOyrddz7aKgjEMaWnryXqXkG6ONIKiMFbpOhmYBGC2MJQ0qbQu4drTWaRnSyKjxijzwjCzUySe2+aQe0lV4SHQcPyeXxrcpS/3n0aY3WhNF8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708665654; c=relaxed/simple; bh=Mhdw9Zu4ydEVNNkZDl6MlHFqITqdLsrXh+2UiUSmICM=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=cXUCRIX+ve8zm2zCkgm0FkJ2qvBdHl0MvFe4z4qB6vQiTjTTR5ku4rkGAonhag0nByN9mZ2ObnuVA+H40b/eOjgGr7N4FiLGO07ZFrtx1q5CPjIkadSF55+oPVyhsIYO7sSEmd5QWWXvp8L81aNKomyjaJa0Jlzf8xQXhImamTc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=aiV8mtXW; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41N3wLZw001771; Fri, 23 Feb 2024 05:20:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=XtP90d2oLGHAANc4Hry0XB7XCfCAgx7Z9UEZsQuUESs=; b=ai V8mtXWQ+ss7kaXUqUgc4Dyh54flRGB0gSiZf3MG9OzQBiexfm9XJENQTID2bJ6bz fZdU5hsNthYCgviFZJpllQh17SQhQJHUIufHQO/2XysxoDyJTZP5UW3D11gcDZGa DmT60KQ5oXQ4iQlMvJRXIqwncyzP/UAqz3cJorxDCHugg1SSR59hsC68vsZFTTvy mg4nYjIp9K2Au+3kN0ru+2u8RaGOopH5Yl0TcIV4axHXQgofJetUPoXkKZf0gFV8 /4saDP59GT2ZEAeeX6PcWnn5yDI160Qi459pJvlIkE+dcXEe/RRb+DqUy5+dWbwG XE6AgYctFu2e44Dy6sCQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3weasbst7w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Feb 2024 05:20:42 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41N5Kgms001975 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Feb 2024 05:20:42 GMT Received: from [10.216.26.154] (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 22 Feb 2024 21:20:37 -0800 Message-ID: Date: Fri, 23 Feb 2024 10:50:34 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH] thermal/drivers/tsens: Add suspend to RAM support for tsens To: Manaf Meethalavalappu Pallikunhi , Konrad Dybcio , Amit Kucheria , Thara Gopinath , Bjorn Andersson , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , , , , , "Raghavendra Kakarla" References: <20240122100726.16993-1-quic_priyjain@quicinc.com> <548e2f24-a51e-4593-9463-09506488c70e@linaro.org> <1cd754e5-fc5e-bd8b-1d70-8de40c9a85e7@quicinc.com> Content-Language: en-US From: Priyansh Jain In-Reply-To: <1cd754e5-fc5e-bd8b-1d70-8de40c9a85e7@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: cH7944HrqCUIXbrJjQXy0ezi4puFE66n X-Proofpoint-GUID: cH7944HrqCUIXbrJjQXy0ezi4puFE66n X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_15,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=1 mlxscore=1 suspectscore=0 mlxlogscore=186 impostorscore=0 bulkscore=0 phishscore=0 spamscore=1 clxscore=1011 lowpriorityscore=0 malwarescore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402230035 On 1/27/2024 9:07 PM, Manaf Meethalavalappu Pallikunhi wrote: > +Maulik and Raghavendra > > Hi Konrad, > > On 1/25/2024 4:38 PM, Konrad Dybcio wrote: >> >> >> On 1/24/24 16:25, Priyansh Jain wrote: >>> >>> >>> On 1/24/2024 6:04 PM, Konrad Dybcio wrote: >>>> >>>> >>>> On 1/24/24 11:42, Priyansh Jain wrote: >>>>> >>>>> >>>>> On 1/22/2024 8:02 PM, Konrad Dybcio wrote: >>>>>> On 22.01.2024 11:07, Priyansh Jain wrote: >>>>>>> Add suspend callback support for tsens which disables tsens >>>>>>> interrupts >>>>>>> in suspend to RAM callback. >>>>>> >>>>>> Would it not be preferrable to have the "critical overheat", wakeup- >>>>>> capable interrupts be enabled, even if the system is suspended? >>>>>> >>>>> >>>>> >>>>> As part of suspend to RAM, tsens hardware will be turned off and it >>>>> cannot generate any interrupt.Also system doesn't want to abort >>>>> suspend to RAM due to tsens interrupts since system is already >>>>> going into lowest >>>>> power state. Hence disabling tsens interrupt during suspend to RAM >>>>> callback. >>>> >>>> Is that a hardware limitation, or a software design choice? I'm not >>>> sure I want my phone to have thermal notifications disabled when >>>> it's suspended. >>> >>>> Konrad >>> >>> As part of suspend to RAM , entire SOC will be off, >> >> What do you mean by "entire SOC[sic] will be off"? Surely the memory >> controller must be on to keep refreshing the memory? Are you thinking >> of suspend-to-disk (hibernation), by chance? > > Yes, Memory will be in self refreshing  mode(Retained). But SOC will be off > > and will do cold boot to come out of S2R. > >> >>> this mode (suspend to RAM) is not intended for Mobile product. Tsens >>> interrupts are not >>> disabled as part of suspend to idle(suspend mode for mobile). >> >> That's clearly untrue, e.g. the PSCI firmware on SM8550 implements >> PSCI_SYSTEM_SUSPEND, which does S2R. > > IIUC, PSCI_SYSTEM_SUSPEND will be enabled only for S2R supported > products and will be removed it for others. > > Maulik/Raghavendra can comment more > Sorry for delayed response, we have discussed internally on this and came to the conclusion that disabling tsens interrupt in S2R path is not correct approach as S2R is being exercised on mobile kind of products as well. I will update the required changes in the next patch. Priyansh >> >> Konrad