coresight: ultrasoc-smb: Config SMB buffer before register sink
authorJunhao He <hejunhao3@huawei.com>
Tue, 14 Nov 2023 13:33:44 +0000 (21:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2023 17:45:28 +0000 (18:45 +0100)
commitab5091e1ccb05c855c78f67f93538bb703f3f64f
tree51b57a1b1955e5786caf9a4903a480fbe25f7c76
parentace850bd8600328f8f56e41db88d7b232ab939d4
coresight: ultrasoc-smb: Config SMB buffer before register sink

[ Upstream commit 830a7f54db102c889a3fe1c0a225f369ac05f07f ]

The SMB dirver register the enable/disable sysfs interface in function
smb_register_sink(), however the buffer depends on the following
configuration to work well. So it'll be possible for user to access an
unreset one.

Move the config buffer operation to before register_sink().
Ignore the return value, if smb_config_inport() fails. That will
cause the hardwares disable trace path to fail, should not affect
SMB driver remove. So we make smb_remove() return success,

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-3-hejunhao3@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwtracing/coresight/ultrasoc-smb.c