Re: [PATCH v7 01/10] i3c: Add core I3C infrastructure

From
Boris Brezillon <hidden>
Date
2018-09-18 07:00:09
Also in
linux-devicetree, linux-gpio, linux-i2c, lkml
Reply to
vitor, 2018-09-11
Hi Vitor,

Sorry for the late reply, I was not at the office last week.

On Tue, 11 Sep 2018 11:04:07 +0100
vitor [off-list ref] wrote:
Hi Boris,

On 05-09-2018 16:40, Boris Brezillon wrote:
quoted
+i3c_master_register_new_i3c_devs(struct i3c_master_controller *master)
+{
+	struct i3c_dev_desc *desc;
+	int ret;
+
+	if (!master->init_done)
+		return;
+  
If you have a hot-join and call i3c_master_do_daa this function will 
return without create the i3c_device.
Hm, you mean if hot-join happens when the I3C master is not yet
registered? That shouldn't be a problem since all devices will be
registered at the end of i3c_master_register(). Am I missing something?
Is this a problem you actually face or just something you found out
doing code inspection?
quoted
+	i3c_bus_for_each_i3cdev(master->bus, desc) {
+		if (desc->dev || !desc->info.dyn_addr || desc == master->this)
+			continue;
+
+		desc->dev = kzalloc(sizeof(*desc->dev), GFP_KERNEL);
+		if (!desc->dev)
+			continue;
+
+		desc->dev->bus = master->bus;
+		desc->dev->desc = desc;
+		desc->dev->dev.parent = &master->bus->dev;
+		desc->dev->dev.type = &i3c_device_type;
+		desc->dev->dev.bus = &i3c_bus_type;
+		desc->dev->dev.release = i3c_device_release;
+		dev_set_name(&desc->dev->dev, "%d-%llx", master->bus->id,
+			     desc->info.pid);
+
+		if (desc->boardinfo)
+			desc->dev->dev.of_node = desc->boardinfo->of_node;
+
+		ret = device_register(&desc->dev->dev);
+		if (ret)
+			dev_err(master->parent,
+				"Failed to add I3C device (err = %d)\n", ret);
+	}
+}
Regards,

Boris
Thread (2 messages) 2 messages, 2 authors, last reply 2018-09-18
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help