Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3154199lqp; Tue, 26 Mar 2024 00:30:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqkFe+9bTACoEVkt39HA2KeHvneRuwcfDuWXGiaYYI2xpKq/DCw/aDMdxYObj5qIsWFpvnXz6EDf8jjakqRF7Vu1a/ids+0Flad/hbbw== X-Google-Smtp-Source: AGHT+IFloO2m5qlJNuaazapcGwJK/x/yc5kb6AC+mkVL8az3zGiaI3fTxcJsukiF1q5wvBjyL01+ X-Received: by 2002:a05:6512:2101:b0:515:9578:4a53 with SMTP id q1-20020a056512210100b0051595784a53mr7373804lfr.21.1711438243605; Tue, 26 Mar 2024 00:30:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711438243; cv=pass; d=google.com; s=arc-20160816; b=0oRjlJLpKsdIKZprzTqk9L1ZR15O8BM0eU+NSEOzcK9H8zsc+N74BvRri2xU9SJipL YIM4hZbmbNHMJshkAC66AZs5tsBkF3D/39+gMVLJcYbrVrdDoXaEPsUWBcLrL56yFlsx jgx441hun88ns7u4J1wJMhVa2IhmKxdbk0S4cnmCvRdrjd6RrTrwtTnV93rs3U4viWPx 4X78K8eegiUmdWTV5+RqAoct2Fd4ODDRfyHUfaEg+loSUyNZcl2J27eCTQIBA6isfAA5 K9MKjoKczcxeHpqtRX/17WYKqXcN2wOq75MSxijynMPyL7+o/aCbjNyMxi4n7IxhzwcT GKgA== 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:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=OQDARmuA9qghqlPbUPmWsGdH3pMdroUx/3+mtg0evH0=; fh=JazAmxUGjwFNbVikzx635MTf6e2NeN6sM0ugOiyqPRU=; b=f88DcVHt03Av5cWj3B6VA8dhSCKn8WQGvgJN14Jl0xugn3UdWVFjZwi7xEwnZ3z2qN /SbBu9P1O5BeZUrkbwL8WqmeBTYk6tVcjiklnF0dLChe7COZNO4LFKkGdbNLXNSYejx5 cbQdRNCJ6f+W/0uyY4lryWHu5eDvTzy+D/ndrmdKk85ThBpTpa5c9ygZXQAS8YaviTyp E1otdzytkqi76yqyw3IQ5LPmW+qN2dPRtreAxATREHPzpvXglGF7EvkfccPECxTp+r6P H1zLzNSsnxqEpVXRp9S+o9PX+l4dy81pCI8W8S9wTL1zc8dg2sQsOSuiGEQtBT+fA76m 7bvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=KDadHnYj; 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-118460-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118460-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id di12-20020a170906730c00b00a474ba1d1a3si2550167ejc.541.2024.03.26.00.30.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 00:30:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118460-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=@quicinc.com header.s=qcppdkim1 header.b=KDadHnYj; 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-118460-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118460-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 2857D1F3585C for ; Tue, 26 Mar 2024 07:30:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC23A132C37; Tue, 26 Mar 2024 07:30:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="KDadHnYj" 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 5920A130A65; Tue, 26 Mar 2024 07:30:19 +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=1711438221; cv=none; b=HDQCmNF5Bz8mevPfAeWICnmMBlhYPEkyjNR3s7n/wU5hFesmXp1lPBZTuiDL6x42cUQ2SifVXvSsQ0IiCyOK7LWMCKJypjML67bZYzUpy0TQC/mUb31LEYgRHhxo0zvJxfOUM+Z7AbAp/ITjasRtsozyCdTdRdSNDQ3cQOuUMUc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711438221; c=relaxed/simple; bh=CRjcQUa1O1VQEkrYah3aU2Dfmn8ieNgrULDmwX0FhP0=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=ErHi+er5u/5KTNEylCe8aTZIyMEjN5RFliAHD1OMqlXw/a7Lb2xf5sjlgxM/WHJirZaidvl5G2Qa8s7oIEAdWCtakpJTJ7aYiV9SKJx/cqiSM2RsO1snCUi8nzcotJ23yrp/9ypzpnqfgaIb93ZjkRUWnUeetkNSpGnkzVcK+F0= 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=KDadHnYj; 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 (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42Q5k0G7010711; Tue, 26 Mar 2024 07:30:09 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=OQDARmuA9qghqlPbUPmWsGdH3pMdroUx/3+mtg0evH0=; b=KD adHnYjqGppY7eCZWWLDkLQUWgcAsYiC8AIcYjjWh5QPXO7C6ymazrSC8S0ELzbi/ fdn6sVCmFncM8RDVKRarC62/ETS3ufa2Uf6saP3Rt5ZvPVO5XDKwDLSZee7uEiqf WkJQ/PPBkDed8Ft1ZFZ6UBkLgzZV/FjAF0j222U2lIKzaMMQHcAPHH8Ubx4oAG3t sPykcp0IcTue+Cy+U5VtRwmsEUk6boEINgBGAR08EUnRYpxyDUfi/0JN9f1Q9r5d TU/pvJyYx+9q0gdz8NMIA9UKLtACthIGbn0JGy+ovcRcr1I5slHdzCKCjA4hHgLt ZoyFv1UWCA3tbItmzKQw== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x3rghrake-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Mar 2024 07:30:09 +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 42Q7U8qE003245 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Mar 2024 07:30:08 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; Tue, 26 Mar 2024 00:30:05 -0700 Message-ID: Date: Tue, 26 Mar 2024 12:59:54 +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 v3] thermal/drivers/tsens: Add suspend to RAM support for tsens To: Amit Kucheria CC: Thara Gopinath , Bjorn Andersson , Konrad Dybcio , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , , , , References: <20240227160928.2671-1-quic_priyjain@quicinc.com> <06ab4347-3ed0-432a-cc36-49837d8a28de@quicinc.com> Content-Language: en-US From: Priyansh Jain In-Reply-To: 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-GUID: mFW-xWMYQRRI7meO7VJnxmielf6eQJfM X-Proofpoint-ORIG-GUID: mFW-xWMYQRRI7meO7VJnxmielf6eQJfM 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-03-26_04,2024-03-21_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 clxscore=1015 phishscore=0 suspectscore=0 bulkscore=0 mlxlogscore=991 impostorscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403210001 definitions=main-2403260050 On 3/21/2024 6:21 PM, Amit Kucheria wrote: > On Tue, Mar 19, 2024 at 4:19 PM Priyansh Jain wrote: >> >> >> >> On 3/17/2024 1:37 AM, Amit Kucheria wrote: >>> On Tue, Feb 27, 2024 at 9:40 PM Priyansh Jain wrote: >>>> >>>> As part of suspend to RAM, tsens hardware will be turned off. >>>> While resume callback, re-initialize tsens hardware. >>>> >>>> Signed-off-by: Priyansh Jain >>>> --- >>>> V2 -> V3: Remove suspend callback & interrupt enablement part from >>>> resume callback. >>>> V1 -> V2: Update commit text to explain the necessity of this patch >>>> >>>> drivers/thermal/qcom/tsens-v2.c | 1 + >>>> drivers/thermal/qcom/tsens.c | 40 +++++++++++++++++++++++++++++++++ >>>> drivers/thermal/qcom/tsens.h | 6 +++++ >>>> 3 files changed, 47 insertions(+) >>>> >>>> diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c >>>> index 29a61d2d6ca3..0cb7301eca6e 100644 >>>> --- a/drivers/thermal/qcom/tsens-v2.c >>>> +++ b/drivers/thermal/qcom/tsens-v2.c >>>> @@ -107,6 +107,7 @@ static const struct reg_field tsens_v2_regfields[MAX_REGFIELDS] = { >>>> static const struct tsens_ops ops_generic_v2 = { >>>> .init = init_common, >>>> .get_temp = get_temp_tsens_valid, >>>> + .resume = tsens_resume_common, >>>> }; >>> >>> Please add resume callbacks for the other tsens hardware too and make >>> sure that your reinit function handles them too. >>> >> We have discussed internally on this and we think that if someone wants >> to extend the support (and do the validation) of one of those old >> platforms they can add the resume ops for that platform. There are many >> versions of tsens hardware so we are bit skeptical to add reinit support >> for all these platforms with any validations(since S2R mode is not >> enabled for all these older platforms so it is not possible to validate). > > Then why does tsens_reinit refer to tsens_version(priv) >= VER_0_1 > when re-enabling the irq? > > Perhaps we should explicitly disable platforms that are not validated > for this functionality (.resume = NULL) and have the reinit function > only work for validated platforms (tsens_version >= VER_2_X)? > Sure i will update tsens_reinit to handle only tsens_version >= VER_2_X in next patch. Also will add (.resume = NULL ) for all the platforms for which this functionality is not validated in next patch. Regards, Priyansh > Regards, > Amit