From patchwork Thu Oct 12 09:47:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junhao He X-Patchwork-Id: 13418727 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4679CCDB482 for ; Thu, 12 Oct 2023 09:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c8BAxuXYmkBO+9PLYqjOhBejhkpiMxa36fd3Rjb9FRY=; b=aq/5pw4qhP5pxQ 4IAMoSm80tmhMr5lL32agK5ZrfEl2ZR1IlUfxWxzoK2cFlf7KAqB7HVps0fi6oISoVR5NJ0pq61BD c4j79RgnkK3wASxXDAMRdIYNfpxdl9nZG41ec8ERd/SQRx9LHGIq1qcRVEz6JLeJ3TP787E4u/s1Z gRz4NDP4Y3GqrWGwXvJXHrrAM1NQiYqXaK8vWN8m4RLMiskWbfB/6lDpVkLpkdjl94PdwdDfw+SVI dZGMEhZWvKnqIa/XukVqq7g22cmh5Vn5XtPCO2IoC3eDmQ5vkJbhfKfMWzd7JjMCz/N34YXaHsZEc TQlwJ1OZEHnIkg6RQloA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqsHM-000R7v-01; Thu, 12 Oct 2023 09:46:52 +0000 Received: from szxga03-in.huawei.com ([45.249.212.189]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qqsHE-000R2B-0h for linux-arm-kernel@lists.infradead.org; Thu, 12 Oct 2023 09:46:47 +0000 Received: from dggpeml500002.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4S5l6c23QYz1kv1T; Thu, 12 Oct 2023 17:42:32 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggpeml500002.china.huawei.com (7.185.36.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 12 Oct 2023 17:46:31 +0800 From: Junhao He To: , CC: , , , , , , , Subject: [PATCH 3/3] coresight: ultrasoc-smb: fix uninitialized before use buf_hw_base Date: Thu, 12 Oct 2023 17:47:06 +0800 Message-ID: <20231012094706.21565-4-hejunhao3@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20231012094706.21565-1-hejunhao3@huawei.com> References: <20231012094706.21565-1-hejunhao3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500002.china.huawei.com (7.185.36.158) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231012_024644_444056_AFE93C06 X-CRM114-Status: GOOD ( 10.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 e78edc3480ce..21ba473786e5 100644 --- a/drivers/hwtracing/coresight/ultrasoc-smb.c +++ b/drivers/hwtracing/coresight/ultrasoc-smb.c @@ -475,7 +475,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); @@ -597,6 +596,7 @@ static int smb_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, drvdata); + smb_reset_buffer(drvdata); return 0; }