Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp197744iol; Thu, 9 Jun 2022 01:53:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7za71NA+zaSYUkzU2LRXD560785bmsLxzb070Z/s7ru8P+JzX+oKs87oaOfYvptmtINOI X-Received: by 2002:a17:903:41c9:b0:164:57e:4b22 with SMTP id u9-20020a17090341c900b00164057e4b22mr38782807ple.2.1654764782583; Thu, 09 Jun 2022 01:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654764782; cv=none; d=google.com; s=arc-20160816; b=Dkpd//yj1SfnqaLu1Xs9hojfG2vusx0GgT92aFJKTD5SeKSA4hKrRM0M0SHuIx4o/n MZ2SCE5ggTt95Jo5M5HS4M7rYFwApANP32RaGXLjWonWc6ituKIDpcx073bhuoX2j9AN 3GoZt6+yOybPVI/fU4lenRFtZ180mxiOUJvyPd8DZ1AoZlPaQMA/ablKoCVJU8gCLaqf GQ07Ff0uqk+E5GJJgXfM3YVGHGH6Hyjc+sB6F5u/wJ1TXUSxC0oVTAqcpsMtss3UeN0D 5bfmjMXsMmLyR0dvnzo4AUZNJLzt47XynzVOrCD59L/ns53rdPnDSF6kfKLSi5cBfrz9 mhAQ== 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:dkim-signature; bh=e1UGClnaUgzCb1brsqptliKGNl+O+10vLwIjpGp/hgo=; b=OecmhbgRBtYSxh+rLc8tRmknxuG+n/vzqWuAuKj8oHv2VJ78RnOU6X7d3mHtmD95Qw 1zQPFq4y43Cfx0W5fbwyfHZ9Iaaa3LfOaiIuiOrzYioAbmZwJiiaLJLhhGgRJZa9uZsV NJDivPiGe3nEPV7CwALVntmm7qF1OcNmOcnVSza23T6n1kU+yiO9SyxVCtasuW1oiQ+4 541zzL1jJX77shAS+bqpLiC9RNx1wMiRYR7MuVoNrDApXvo35ncwAethMsGPayuLBXGm 2WgOYQyQZPDhXqKQsga6n+zSlJVSuW8e+7Crggc+WqWpEKBhvGI7bL7A9lhxAnXU8tVD Gp/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=C0wY5RdW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a170902ce8400b00163f8c2deabsi36667252plg.257.2022.06.09.01.52.51; Thu, 09 Jun 2022 01:53:02 -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; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=C0wY5RdW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240391AbiFIIAo (ORCPT + 99 others); Thu, 9 Jun 2022 04:00:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231955AbiFIIAn (ORCPT ); Thu, 9 Jun 2022 04:00:43 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C88E10E5; Thu, 9 Jun 2022 01:00:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1654761642; x=1686297642; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=e1UGClnaUgzCb1brsqptliKGNl+O+10vLwIjpGp/hgo=; b=C0wY5RdWQkUhd97+S7rwxYVJEBHn6ZtUYQCzNUGJwP7LAaMd3O3w3Wxa +k2jcpEmzXjtX7tEpVndayCAbuB9Dqvf9gKZneW/efbd5gWSxOmuSiuvb XQESL8+f1/eFBo0smLSOp/Eh7Mt2qgwdpS6RZH3aZiMvBMyFGP6J19Ifc A=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 09 Jun 2022 01:00:42 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2022 01:00:42 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 9 Jun 2022 01:00:12 -0700 Received: from [10.50.50.196] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 9 Jun 2022 01:00:08 -0700 Message-ID: <231dd355-acf3-626f-3da0-350281c660f5@quicinc.com> Date: Thu, 9 Jun 2022 13:30:04 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCHv2] iommu/arm-smmu-qcom: Add debug support for TLB sync timeouts Content-Language: en-US To: Vincent Knecht , Will Deacon , Robin Murphy , Joerg Roedel CC: , , , , , Rob Clark , Bjorn Andersson References: <20220526041403.9984-1-quic_saipraka@quicinc.com> <78f1adee5c6e0c3547c116d0e78fe5b70f9c15e1.camel@mailoo.org> From: Sai Prakash Ranjan In-Reply-To: <78f1adee5c6e0c3547c116d0e78fe5b70f9c15e1.camel@mailoo.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Hi Vincent, On 6/9/2022 2:52 AM, Vincent Knecht wrote: > Le jeudi 26 mai 2022 à 09:44 +0530, Sai Prakash Ranjan a écrit : >> TLB sync timeouts can be due to various reasons such as TBU power down >> or pending TCU/TBU invalidation/sync and so on. Debugging these often >> require dumping of some implementation defined registers to know the >> status of TBU/TCU operations and some of these registers are not >> accessible in non-secure world such as from kernel and requires SMC >> calls to read them in the secure world. So, add this debug support >> to dump implementation defined registers for TLB sync timeout issues. >> >> Signed-off-by: Sai Prakash Ranjan >> --- >> >> Changes in v2: >>  * Use scm call consistently so that it works on older chipsets where >>    some of these regs are secure registers. >>  * Add device specific data to get the implementation defined register >>    offsets. >> >> --- >>  drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 161 ++++++++++++++++++--- >>  drivers/iommu/arm/arm-smmu/arm-smmu.c      |   2 + >>  drivers/iommu/arm/arm-smmu/arm-smmu.h      |   1 + >>  3 files changed, 146 insertions(+), 18 deletions(-) > Hi Sai, and thanks for this patch ! > > I've encountered TLB sync timeouts with msm8939 SoC recently. > What would be needed to add to this patch so this SoC is supported ? > Like, where could one check the values to be used in an equivalent > of qcom_smmu_impl0_reg_offset values for this SoC (if any change needed) ? > Current values are not found by simply greping in downstream/vendor dtsi/dts files... These are implementation defined registers and some might not be present on older SoCs and sometimes they don't add this support in downstream kernels even if the registers are present. I looked up the IP doc for msm8939 and I could find only TBU_PWR_STATUS register and you can use the same offset for it as given in this patch. Thanks, Sai