Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1033420rdb; Wed, 24 Jan 2024 02:51:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEt4tcv0dFiRNNtUWARhC4RVIScVcTxTYCeE+8hmubyQiH1wKAbFW3NZ9JtEy1jfWDG5+gS X-Received: by 2002:aa7:de0a:0:b0:55a:e43e:7063 with SMTP id h10-20020aa7de0a000000b0055ae43e7063mr1682224edv.8.1706093477212; Wed, 24 Jan 2024 02:51:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706093477; cv=pass; d=google.com; s=arc-20160816; b=Vi6srVNTW/r4pdSEcEhDO4TY96A+8Ev8jdglZBQR7RsB087ghQHb7PI6IxvE4DF1j4 O94zgHAU/vJ+QPGssyKbfrhIDYRNQz33TMqEus7U6I/Af9McdVNFvNdfmdwesiA3ODf1 uWzK+3ku61Nl0ojwzyNjhW+7SwGflAUmRJKJHfScs4RFHYv6TDyB12J7LO646duwea9F 4wYp75nKc4Cdmz6wQp3Hr7Hkjd5wCXZJyOrWPj4RUttJN3BhI9p4nzPC4uidFaz2Imys PVFeCeIZE51p63BWoKW6zEGHhgRIO+xma7g+vcyM+j1AP8RE4NepHcBCSoMalzBOjOxe 7bWg== 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:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=wEiM2j5nCvmikp4uX0I3tdM3maEln6y3gtRZhMBw3q8=; fh=z0UE/6sWPb/yjlRtwHkuZW67SiMGtFQeYkadsSSBtYQ=; b=yiQPqep+wbTm7a9D+tpfHdG7FlY6M9b4qIlH4nKkcPQx9BhwMuGUUFM0rdF7/6gm/2 CvXhZ6u9NnmXmYqQEqTgiaNKODXcYIi3j73a50j09bEia8lcJnUQhrBwxWqzzfg80U0N irllH/mFaZ71+5wnw9uHmf8ptrY7WAi/2HtEFFvxHRzlxWkwr1qQrakASseb7urS8mr1 lrMcSlZJkdSZcU71isAHBxttB/9vSlmj+ckBnRoARJJQhKP/NCOR/syRRApKpsmV+X7o pF1ZomnKHJp8+fy5SyWMs2C15HD22zSh5Y2BEEtJ4gjeht3xT8snJ2XlCVOkpINJYbz7 Dy6w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZdJu8i9z; 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-36807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36807-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 q35-20020a05640224a300b0055400f1f188si13733440eda.41.2024.01.24.02.51.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 02:51:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36807-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=ZdJu8i9z; 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-36807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36807-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 7C94C1F2D1F8 for ; Wed, 24 Jan 2024 10:43:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E6571A701; Wed, 24 Jan 2024 10:43:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ZdJu8i9z" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 D0AA6199B8; Wed, 24 Jan 2024 10:43:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706092984; cv=none; b=BNoiWS8hvTHLzdYAKBdFNRgXfH6jlM21vWmWQDNOahLPH0SsIpc9SXlWYt94K9IYAt6W0PcBd99opFzhj2U92ui5NISI4cnaLI+fg/9YEgQV9xddVGt8whFhb1N7+QeMHggLnVYYASDhTDGyFtbnW0ELLt3rKTpeIDqjyFB99Y8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706092984; c=relaxed/simple; bh=7kSJ0U2bWClpV/n7S8II5vylc0cHz5m7aSl9hci5/7s=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=jRnEbEgknW+szSA8NgJmT2SvqsNHKjdV0nZh/GtGhGM1rbcPlowSTjKOhVVxBQCArzeXuEeeWyd9tHMos/qTU1zzFcTdxW5d81Ml8OhH3DBoLYCXpKbQMMIMEgFBhyLTZBUXGLJYvQjG1/2IiclFpDUpv0FvYJFzZdavtrzCbds= 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=ZdJu8i9z; arc=none smtp.client-ip=205.220.180.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 (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40OALwj5015624; Wed, 24 Jan 2024 10:42:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=wEiM2j5nCvmikp4uX0I3tdM3maEln6y3gtRZhMBw3q8=; b=Zd Ju8i9zof3t04VpyXzL/YxFMHqj/OY0HLAlGLLJxgYZZOGUAe3gIUA+GVEw9aqIKC LQ9g+oCTA8XGEM02bca0bQxedRLJkXHqBM34viSTdc0DPwDYDIQE+1UB9jnoJ9sZ +G3UfaxxSa9ezr5A1g5VkdYfXJ1BHFiMaaD2BzFUX857CbV6zhnCSMUMjQ1M7i9B O2pi3xZuoGJvXYsh0KaRBNODov9XpyDD94GSDPcev3fXijTcG15+xeKBIJLaneRg 82YmVjcdHEMKhSFJH0v1d24kgDhoe2OEgNbsur6lU6EJqXnsc5ZeI4QTv/F77w16 lMuWEUqxvVMSi3+ElVbA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vtmhdsh9s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Jan 2024 10:42:54 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40OAgrQg022999 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Jan 2024 10:42:53 GMT Received: from [10.218.47.125] (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; Wed, 24 Jan 2024 02:42:49 -0800 Message-ID: Date: Wed, 24 Jan 2024 16:12:46 +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 Content-Language: en-US To: Konrad Dybcio , Amit Kucheria , Thara Gopinath , "Bjorn Andersson" , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , , , CC: References: <20240122100726.16993-1-quic_priyjain@quicinc.com> <548e2f24-a51e-4593-9463-09506488c70e@linaro.org> From: Priyansh Jain In-Reply-To: <548e2f24-a51e-4593-9463-09506488c70e@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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-GUID: YWI7aNZZ2KpX4qIUkiJRaoycbkyH2U8b X-Proofpoint-ORIG-GUID: YWI7aNZZ2KpX4qIUkiJRaoycbkyH2U8b 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-01-24_04,2024-01-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 impostorscore=0 mlxscore=0 phishscore=0 suspectscore=0 mlxlogscore=680 lowpriorityscore=0 clxscore=1015 priorityscore=1501 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401190000 definitions=main-2401240076 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. Regards, Priyansh >> Add resume callback support for tsens which reinitializes tsens hardware >> and enables back tsens interrupts in resume callback. >> >> Signed-off-by: Priyansh Jain >> --- > > [...] > > >> + >> +int tsens_suspend_common(struct tsens_priv *priv) >> +{ >> + switch (pm_suspend_target_state) { >> + case PM_SUSPEND_MEM: >> + if (priv->combo_irq > 0) { >> + disable_irq_nosync(priv->combo_irq); >> + disable_irq_wake(priv->combo_irq); >> + } >> + >> + if (priv->uplow_irq > 0) { >> + disable_irq_nosync(priv->uplow_irq); >> + disable_irq_wake(priv->uplow_irq); >> + } >> + >> + if (priv->crit_irq > 0) { >> + disable_irq_nosync(priv->crit_irq); >> + disable_irq_wake(priv->crit_irq); >> + } >> + break; >> + default: >> + break; >> + } > > if (pm_suspend_target_state != PM_SUSPEND_MEM) > return 0; > > > > [...] > >> >> + /* For saving irq number to re-use later */ > > This is rather self-explanatory > > Konrad