Skip to content

Commit e067863

Browse files
committed
Merge tag 'ti-driver-soc-for-v6.10' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into soc/drivers
TI SoC driver updates for v6.10 Generic Cleanups/Fixes: - wkup_m3_ipc: Minor optimization to send NULL dummy message instead of empty pointer message - ti_sci: Register restart handler unconditionally * tag 'ti-driver-soc-for-v6.10' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: soc: ti: wkup_m3_ipc: Send NULL dummy message instead of pointer message firmware: ti_sci: Unconditionally register reset handler firmware: ti_sci: Use devm_register_restart_handler() Link: https://lore.kernel.org/r/20240501124300.i5jzeugdlrlnfg22@undrafted Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 1c9fc34 + ddbf320 commit e067863

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

drivers/firmware/ti_sci.c

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ struct ti_sci_desc {
8787
* struct ti_sci_info - Structure representing a TI SCI instance
8888
* @dev: Device pointer
8989
* @desc: SoC description for this instance
90-
* @nb: Reboot Notifier block
9190
* @d: Debugfs file entry
9291
* @debug_region: Memory region where the debug message are available
9392
* @debug_region_size: Debug region size
@@ -103,7 +102,6 @@ struct ti_sci_desc {
103102
*/
104103
struct ti_sci_info {
105104
struct device *dev;
106-
struct notifier_block nb;
107105
const struct ti_sci_desc *desc;
108106
struct dentry *d;
109107
void __iomem *debug_region;
@@ -122,7 +120,6 @@ struct ti_sci_info {
122120

123121
#define cl_to_ti_sci_info(c) container_of(c, struct ti_sci_info, cl)
124122
#define handle_to_ti_sci_info(h) container_of(h, struct ti_sci_info, handle)
125-
#define reboot_to_ti_sci_info(n) container_of(n, struct ti_sci_info, nb)
126123

127124
#ifdef CONFIG_DEBUG_FS
128125

@@ -3254,10 +3251,9 @@ devm_ti_sci_get_resource(const struct ti_sci_handle *handle, struct device *dev,
32543251
}
32553252
EXPORT_SYMBOL_GPL(devm_ti_sci_get_resource);
32563253

3257-
static int tisci_reboot_handler(struct notifier_block *nb, unsigned long mode,
3258-
void *cmd)
3254+
static int tisci_reboot_handler(struct sys_off_data *data)
32593255
{
3260-
struct ti_sci_info *info = reboot_to_ti_sci_info(nb);
3256+
struct ti_sci_info *info = data->cb_data;
32613257
const struct ti_sci_handle *handle = &info->handle;
32623258

32633259
ti_sci_cmd_core_reboot(handle);
@@ -3303,7 +3299,6 @@ static int ti_sci_probe(struct platform_device *pdev)
33033299
struct mbox_client *cl;
33043300
int ret = -EINVAL;
33053301
int i;
3306-
int reboot = 0;
33073302
u32 h_id;
33083303

33093304
desc = device_get_match_data(dev);
@@ -3327,8 +3322,6 @@ static int ti_sci_probe(struct platform_device *pdev)
33273322
}
33283323
}
33293324

3330-
reboot = of_property_read_bool(dev->of_node,
3331-
"ti,system-reboot-controller");
33323325
INIT_LIST_HEAD(&info->node);
33333326
minfo = &info->minfo;
33343327

@@ -3399,15 +3392,10 @@ static int ti_sci_probe(struct platform_device *pdev)
33993392

34003393
ti_sci_setup_ops(info);
34013394

3402-
if (reboot) {
3403-
info->nb.notifier_call = tisci_reboot_handler;
3404-
info->nb.priority = 128;
3405-
3406-
ret = register_restart_handler(&info->nb);
3407-
if (ret) {
3408-
dev_err(dev, "reboot registration fail(%d)\n", ret);
3409-
goto out;
3410-
}
3395+
ret = devm_register_restart_handler(dev, tisci_reboot_handler, info);
3396+
if (ret) {
3397+
dev_err(dev, "reboot registration fail(%d)\n", ret);
3398+
goto out;
34113399
}
34123400

34133401
dev_info(dev, "ABI: %d.%d (firmware rev 0x%04x '%s')\n",

drivers/soc/ti/wkup_m3_ipc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <linux/irq.h>
1717
#include <linux/module.h>
1818
#include <linux/of.h>
19-
#include <linux/omap-mailbox.h>
2019
#include <linux/platform_device.h>
2120
#include <linux/remoteproc.h>
2221
#include <linux/suspend.h>
@@ -314,7 +313,6 @@ static irqreturn_t wkup_m3_txev_handler(int irq, void *ipc_data)
314313
static int wkup_m3_ping(struct wkup_m3_ipc *m3_ipc)
315314
{
316315
struct device *dev = m3_ipc->dev;
317-
mbox_msg_t dummy_msg = 0;
318316
int ret;
319317

320318
if (!m3_ipc->mbox) {
@@ -330,7 +328,7 @@ static int wkup_m3_ping(struct wkup_m3_ipc *m3_ipc)
330328
* the RX callback to avoid multiple interrupts being received
331329
* by the CM3.
332330
*/
333-
ret = mbox_send_message(m3_ipc->mbox, &dummy_msg);
331+
ret = mbox_send_message(m3_ipc->mbox, NULL);
334332
if (ret < 0) {
335333
dev_err(dev, "%s: mbox_send_message() failed: %d\n",
336334
__func__, ret);
@@ -352,7 +350,6 @@ static int wkup_m3_ping(struct wkup_m3_ipc *m3_ipc)
352350
static int wkup_m3_ping_noirq(struct wkup_m3_ipc *m3_ipc)
353351
{
354352
struct device *dev = m3_ipc->dev;
355-
mbox_msg_t dummy_msg = 0;
356353
int ret;
357354

358355
if (!m3_ipc->mbox) {
@@ -361,7 +358,7 @@ static int wkup_m3_ping_noirq(struct wkup_m3_ipc *m3_ipc)
361358
return -EIO;
362359
}
363360

364-
ret = mbox_send_message(m3_ipc->mbox, &dummy_msg);
361+
ret = mbox_send_message(m3_ipc->mbox, NULL);
365362
if (ret < 0) {
366363
dev_err(dev, "%s: mbox_send_message() failed: %d\n",
367364
__func__, ret);

0 commit comments

Comments
 (0)