diff options
author | Junhao He <hejunhao3@huawei.com> | 2023-11-14 14:33:45 +0100 |
---|---|---|
committer | Suzuki K Poulose <suzuki.poulose@arm.com> | 2023-11-16 11:00:14 +0100 |
commit | 862c135bde8bc185e8aae2110374175e6a1b6ed5 (patch) | |
tree | 881238edfdc150ec802688d960a25c4a019be607 | |
parent | coresight: ultrasoc-smb: Config SMB buffer before register sink (diff) | |
download | linux-862c135bde8bc185e8aae2110374175e6a1b6ed5.tar.xz linux-862c135bde8bc185e8aae2110374175e6a1b6ed5.zip |
coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base
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 <hejunhao3@huawei.com>
Reviewed-by: James Clark <james.clark@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20231114133346.30489-4-hejunhao3@huawei.com
-rw-r--r-- | drivers/hwtracing/coresight/ultrasoc-smb.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |