Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp188797rdg; Thu, 12 Oct 2023 02:47:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFmVmFD4US7jybmyUPiIjOGH51XPoY4/+ZiWJHNEacxTHpi6vbd2NEF5shr7QaA7WbrmKu X-Received: by 2002:a25:8a0d:0:b0:d91:6d2e:6f17 with SMTP id g13-20020a258a0d000000b00d916d2e6f17mr20632068ybl.54.1697104058874; Thu, 12 Oct 2023 02:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697104058; cv=none; d=google.com; s=arc-20160816; b=TA4PVzJDkVAWgctfZM1IDJNVCM7qxXjjN1AAit87qUBg0dStJzlX3n9Oxjt/RafOS/ XPPZuPQefaCIU5YSgL6QKSd/vbuZ4Xf1FcgWL+Yk/Ykb9osDlOaGsTrVQzYBHiDA4bR2 NSysbHbLR9zBBzeI4wuPpSr56FHrNg5/rzu1w0e9cP19bTGiaLkYgkn4HzY/VO5kDnQD vkPtSJ8yMH/pzhhaiAoQl1DdMiPJU0xuYzKbd0T0wgMg4nfYc3oGtnZKasaIZ+op9nFG kscn9niycNiuiQ9LkUvAXJKeaRLbkTBIAlVoW6tFG9HesSzdD0qpZuKAGao72lV0iY9v GGBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ocaHFnXAh/dmVxSx/kePtDLMZoKFskKVe8OeuUuXhtQ=; fh=DAAgJLf4s0smpgJqxZKr7c0el7KScJ0FbfhkC9eFTa4=; b=MBbhIQVsah/LV+9EJmcA1uj6cVEFpAoaBWkI9zGu5jngSohAaStI14PTbpubOslG7u oU1nAVSKbZUd5xJGwGA/7tL94LEteLlRhYEsOpu/welmX98NeLIGvJIrfQITX3Q/Je2R +mg7YhwVUW0VIfaLwzvb9eIhYOHYyr89GTlZjtGxVdz6Hr19mxoiMc4r/4T7Hco0gzY6 vdxQUkzDAlHTDpo3QTEOEFEKupctuVMAsuNoUf0PPBt81eZqJM57gWpq8jy5UR4MCDEq 6eIl3c/BCScZxdICfkmYHYZTuRZA5AfmDHnItB9vRHTWjG6L2exptDTni4+VwAI+iSMA Y2qw== 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:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id p13-20020a056a000a0d00b0068fb6fc3ff1si14901670pfh.209.2023.10.12.02.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 02:47:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6D2008026454; Thu, 12 Oct 2023 02:47:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235616AbjJLJqn (ORCPT + 99 others); Thu, 12 Oct 2023 05:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232594AbjJLJqf (ORCPT ); Thu, 12 Oct 2023 05:46:35 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EF56B7 for ; Thu, 12 Oct 2023 02:46:32 -0700 (PDT) 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Thu, 12 Oct 2023 02:47:35 -0700 (PDT) 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; } -- 2.33.0