Skip to content

Commit 7b7a224

Browse files
DhruvaG2000nmenon
authored andcommitted
firmware: ti_sci: Mark driver as non removable
The TI-SCI message protocol provides a way to communicate between various compute processors with a central system controller entity. It provides the fundamental device management capability and clock control in the SOCs that it's used in. The remove function failed to do all the necessary cleanup if there are registered users. Some things are freed however which likely results in an oops later on. Ensure that the driver isn't unbound by suppressing its bind and unbind sysfs attributes. As the driver is built-in there is no way to remove device once bound. We can also remove the ti_sci_remove call along with the ti_sci_debugfs_destroy as there are no callers for it any longer. Fixes: aa27678 ("firmware: Add basic support for TI System Control Interface (TI-SCI) protocol") Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Closes: https://lore.kernel.org/linux-arm-kernel/20230216083908.mvmydic5lpi3ogo7@pengutronix.de/ Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Dhruva Gole <d-gole@ti.com> Link: https://lore.kernel.org/r/20230921091025.133130-1-d-gole@ti.com Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent d8cce0d commit 7b7a224

1 file changed

Lines changed: 1 addition & 45 deletions

File tree

drivers/firmware/ti_sci.c

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,6 @@ static int ti_sci_debugfs_create(struct platform_device *pdev,
190190
return 0;
191191
}
192192

193-
/**
194-
* ti_sci_debugfs_destroy() - clean up log debug file
195-
* @pdev: platform device pointer
196-
* @info: Pointer to SCI entity information
197-
*/
198-
static void ti_sci_debugfs_destroy(struct platform_device *pdev,
199-
struct ti_sci_info *info)
200-
{
201-
if (IS_ERR(info->debug_region))
202-
return;
203-
204-
debugfs_remove(info->d);
205-
}
206193
#else /* CONFIG_DEBUG_FS */
207194
static inline int ti_sci_debugfs_create(struct platform_device *dev,
208195
struct ti_sci_info *info)
@@ -3445,43 +3432,12 @@ static int ti_sci_probe(struct platform_device *pdev)
34453432
return ret;
34463433
}
34473434

3448-
static int ti_sci_remove(struct platform_device *pdev)
3449-
{
3450-
struct ti_sci_info *info;
3451-
struct device *dev = &pdev->dev;
3452-
int ret = 0;
3453-
3454-
of_platform_depopulate(dev);
3455-
3456-
info = platform_get_drvdata(pdev);
3457-
3458-
if (info->nb.notifier_call)
3459-
unregister_restart_handler(&info->nb);
3460-
3461-
mutex_lock(&ti_sci_list_mutex);
3462-
if (info->users)
3463-
ret = -EBUSY;
3464-
else
3465-
list_del(&info->node);
3466-
mutex_unlock(&ti_sci_list_mutex);
3467-
3468-
if (!ret) {
3469-
ti_sci_debugfs_destroy(pdev, info);
3470-
3471-
/* Safe to free channels since no more users */
3472-
mbox_free_channel(info->chan_tx);
3473-
mbox_free_channel(info->chan_rx);
3474-
}
3475-
3476-
return ret;
3477-
}
3478-
34793435
static struct platform_driver ti_sci_driver = {
34803436
.probe = ti_sci_probe,
3481-
.remove = ti_sci_remove,
34823437
.driver = {
34833438
.name = "ti-sci",
34843439
.of_match_table = of_match_ptr(ti_sci_of_match),
3440+
.suppress_bind_attrs = true,
34853441
},
34863442
};
34873443
module_platform_driver(ti_sci_driver);

0 commit comments

Comments
 (0)