Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2724212rdb; Wed, 15 Nov 2023 08:47:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IEtX8pHLK10NHNTcEw2kLBF4d8PbQ161Lpk8ySAq4geeq8gVSfnKbrrEUeojXHeT160Vt9E X-Received: by 2002:a05:6a20:3d1b:b0:187:5a4d:7061 with SMTP id y27-20020a056a203d1b00b001875a4d7061mr3211962pzi.44.1700066858696; Wed, 15 Nov 2023 08:47:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700066858; cv=none; d=google.com; s=arc-20160816; b=b851his2Hw68MQgxijJQm1Dwi0pAlxRBQQqZj1n7P1lhl2P/N929FWre6VH3gTyiUV zKgVcuqGU8sm46JNxzFThs0jkTx8ru1Commy9IAAyqJLY8zhsflI2yrYpNd6W+Hkfwfs NnrhAdGogrMcze5/hJsO9RaTi8DSlNhIvRb1uGPrfMt9EeSeF3x179cALaVfDp1LNWPY Q6kMjx2N8Gt+88mOXV475dO1Qjl/q7JdFL88r0C7Z6eXFHPUG7dznJCsfIns2zdZqw7N 5/WwT9ngjMhtXawwc4BgRuwta4jpqMZqCTFBwJED2phk/PMNJMeQz5kE39222SPsSQ0j d5Rg== 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=9xfvqEVZquvaci+Xe2Y+r9oR9m/4vLxJ+2VNHKJLKZ4=; fh=dpSTCl+cmlocRsa2Bg6qC0+utd0H5QF9xg9r6tvDcA0=; b=iDsCnrTtWGPWuNRaXR1M9xJ6hCrwZUarOXlhlXOOrj37gWDHd/ahgtl0ssRkh/u2hJ 9KSLdV0qXXD0HxXSXRlivWZ+GnE2qRmiY+LokwMLCHSn9J//GVUbfgIjmuSziy/WANX4 JIgvSvQOvTin7CSG8U1CATShQ4Raf1QKq4CFNtiIzog2uCjgEMIgYMXi6IzP6FJWRzXo +GZWi+MHfT3b/wqfL2rK3M/bdoGoHUDvdjF0Y80kNYxlaLihuT47+IFTMe9XScja+kwk /0B6bK/b8xhhtFRJ/Dmtvo1pi1uB4XkcyNysGTpZXptGTGshUqSEAEi2/UsPq6ija58l O9uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o21-20020a63fb15000000b005655bf61e32si10051727pgh.23.2023.11.15.08.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 08:47:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 83C2082164DD; Wed, 15 Nov 2023 08:47:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229570AbjKOQrh (ORCPT + 99 others); Wed, 15 Nov 2023 11:47:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbjKOQrg (ORCPT ); Wed, 15 Nov 2023 11:47:36 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 096CAF9 for ; Wed, 15 Nov 2023 08:47:32 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6FB8BDA7; Wed, 15 Nov 2023 08:48:17 -0800 (PST) Received: from [192.168.1.3] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 875A33F641; Wed, 15 Nov 2023 08:47:30 -0800 (PST) Message-ID: <4a3c3369-456e-f3d3-0338-f170da69482b@arm.com> Date: Wed, 15 Nov 2023 16:47:29 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v3 3/4] coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base Content-Language: en-US To: Junhao He , suzuki.poulose@arm.com Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, jonathan.cameron@huawei.com, yangyicong@huawei.com, prime.zeng@hisilicon.com, u.kleine-koenig@pengutronix.de References: <20231114133346.30489-1-hejunhao3@huawei.com> <20231114133346.30489-4-hejunhao3@huawei.com> From: James Clark In-Reply-To: <20231114133346.30489-4-hejunhao3@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 08:47:37 -0800 (PST) On 14/11/2023 13:33, Junhao He wrote: > In smb_reset_buffer, the sdb->buf_hw_base variable is uninitialized > before use, which initializes it in smb_init_data_buffer. And the SMB > regiester are set in smb_config_inport. > So move the call after smb_config_inport. > > Fixes: 06f5c2926aaa ("drivers/coresight: Add UltraSoc System Memory Buffer driver") > Signed-off-by: Junhao He > --- > drivers/hwtracing/coresight/ultrasoc-smb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hwtracing/coresight/ultrasoc-smb.c b/drivers/hwtracing/coresight/ultrasoc-smb.c > index 2f2aba90a514..6e32d31a95fe 100644 > --- a/drivers/hwtracing/coresight/ultrasoc-smb.c > +++ b/drivers/hwtracing/coresight/ultrasoc-smb.c > @@ -477,7 +477,6 @@ static int smb_init_data_buffer(struct platform_device *pdev, > static void smb_init_hw(struct smb_drv_data *drvdata) > { > smb_disable_hw(drvdata); > - smb_reset_buffer(drvdata); > > writel(SMB_LB_CFG_LO_DEFAULT, drvdata->base + SMB_LB_CFG_LO_REG); > writel(SMB_LB_CFG_HI_DEFAULT, drvdata->base + SMB_LB_CFG_HI_REG); > @@ -587,6 +586,7 @@ static int smb_probe(struct platform_device *pdev) > if (ret) > return ret; > > + smb_reset_buffer(drvdata); > platform_set_drvdata(pdev, drvdata); > spin_lock_init(&drvdata->spinlock); > drvdata->pid = -1; Reviewed-by: James Clark