Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp519275imn; Thu, 28 Jul 2022 07:44:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tzjAnsP35seM3dNUOUlRfhWcRs+aUpln8syTWzpwAS+dK4zPTwG+C8MC2nRDMQ14vxDxtl X-Received: by 2002:a63:283:0:b0:412:50b7:e3eb with SMTP id 125-20020a630283000000b0041250b7e3ebmr23068219pgc.29.1659019494044; Thu, 28 Jul 2022 07:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659019494; cv=none; d=google.com; s=arc-20160816; b=WLc+j6wPX8T5e1CK/yxVmxAmMzvDAWUJXHVUxB8Iz1R0ONldgrR80psiXd2mC7Zw7s B2DuYccO9J9QFBm/SSlhiCRVrgecQRseN7DAD8eV8zLu8yIHGuml1zMN3kxOS3Vc+02Y yj2iBgWQNAvOet3Rd8Sqppjuwy+n9MFW3ETjJ6NQuOoteOXpb5+v3UUVdokwSxpF1vqu +xBQ3/1ZAyEH1fnDaVVDCRcbqSxdE5PRyj2fyrJYfB0eH0G1p15zWcYaOtbQV63l92pu saoNnUPI34s+2QZpENs1G0SG19JTjfSLpENFwEakFOiWnRKva7hMkAH9W/l0gsopktto GAig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=pdTl4dx+u3c0zl/8+GSl8LKZS6DiN4s4EsMarWr9mP8=; b=uojx6VlkRU7UBsXn3affI7oPqsDWW8nXzju9Kn+p50roDyPW7DGcZ32bL2RSoccwXA JMUzF+c0NBfhsYUivRUrQ7q3tHBOhfV5gzmCgVQhahSiysv1EGWMIzcfKry7Dto/dJyR 6klmDohLIP+SkcXmlJEaBoaBqcc6LFCvUXfxTN/i1psF/N2vKRq3erfuQ5CzO/sEQMwq quvj5hsP8wBvHOn9n7jDU6QhuEVsriuFpK4s0WfZUJX1qyy+wc836dLGEY2tf3c1wip0 /l1A4ji9F6Yq8eDrrT0Y3Gzxz0oEH/axtOFU3B1npXhGQsrX0jMSjydIypjp6RxJqI+g QYAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a63ec03000000b0041a6c242d8fsi1323152pgh.800.2022.07.28.07.44.34; Thu, 28 Jul 2022 07:44:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbiG1OMm (ORCPT + 99 others); Thu, 28 Jul 2022 10:12:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230183AbiG1OMe (ORCPT ); Thu, 28 Jul 2022 10:12:34 -0400 Received: from relay01.th.seeweb.it (relay01.th.seeweb.it [IPv6:2001:4b7a:2000:18::162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46D7C1AA for ; Thu, 28 Jul 2022 07:12:32 -0700 (PDT) Received: from [192.168.1.101] (abxi232.neoplus.adsl.tpnet.pl [83.9.2.232]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id A5AD91F740; Thu, 28 Jul 2022 16:12:28 +0200 (CEST) Message-ID: Date: Thu, 28 Jul 2022 16:12:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 5/5] thermal: qcom: tsens: Add reinit quirk support for sm6375 controller Content-Language: en-US To: Bhupesh Sharma , linux-pm@vger.kernel.org Cc: bhupesh.linux@gmail.com, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, daniel.lezcano@linaro.org, robh+dt@kernel.org, rafael@kernel.org, Amit Kucheria , Thara Gopinath References: <20220724122424.2509021-1-bhupesh.sharma@linaro.org> <20220724122424.2509021-6-bhupesh.sharma@linaro.org> From: Konrad Dybcio In-Reply-To: <20220724122424.2509021-6-bhupesh.sharma@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24.07.2022 14:24, Bhupesh Sharma wrote: > tsens controller(s) on Qualcomm sm6375 SoC might start in > an unknown state or start with TSENS_EN indicating > a 'disabled' state when they enter linux world. > > In such cases, it is useful to try and reinit them via > trustzone [via scm call(s)], at the very start. > > Add hooks for the same in the qcom tsens driver. > > Cc: Bjorn Andersson > Cc: Amit Kucheria > Cc: Thara Gopinath > Cc: linux-pm@vger.kernel.org > Cc: linux-arm-msm@vger.kernel.org > Signed-off-by: Bhupesh Sharma > --- This sadly doesn't work.. the issue on 6375 is that the controller is in some weird state at boot and this bit that's higher up: ret = regmap_field_read(priv->rf[TSENS_EN], &enabled); if (ret) goto err_put_device; if (!enabled) { dev_err(dev, "%s: device not enabled\n", __func__); ret = -ENODEV; goto err_put_device; } does not succeed. Moving the code added in the patch up or calling qcom_scm_tsens_reinit() or qcom_scm_tsens_reinit() and tsens_reenable_hw_after_scm(priv) directly before this enable check also fails. In fact, the latter crashes the platform.. I don't want to block this series, so I suggest the 6375 part can be dropped for now. Konrad