Skip to contentSkip to conversation

media: ivsc: csi: remove name identifier

PATCH Superseded Wentong Wu 2 participants 5 messages Aug 24, 2023

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Wentong Wu

author
#0 lore raw

PATCH v2 1/3 media: ivsc: csi: remove name identifier

Remove name identifier to match the device with the defined UUID when load driver module.

---
v2:
- no change compared with v1

 drivers/media/pci/intel/ivsc/mei_csi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/pci/intel/ivsc/mei_csi.c +2 -3
index 264b85b..648c6a8 100644
@@ -30,7 +30,6 @@
 #include <media/v4l2-fwnode.h>
 #include <media/v4l2-subdev.h>
 
-#define MEI_CSI_DRIVER_NAME "ivsc_csi"
 #define MEI_CSI_ENTITY_NAME "Intel IVSC CSI"
 
 #define MEI_CSI_LINK_FREQ_400MHZ 400000000ULL
@@ -804,14 +803,14 @@ static void mei_csi_remove(struct mei_cl_device *cldev)
 			     0xAF, 0x93, 0x7b, 0x44, 0x53, 0xAC, 0x29, 0xDA)
 
 static const struct mei_cl_device_id mei_csi_tbl[] = {
-	{ MEI_CSI_DRIVER_NAME, MEI_CSI_UUID, MEI_CL_VERSION_ANY },
+	{ .uuid = MEI_CSI_UUID, .version = MEI_CL_VERSION_ANY },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(mei, mei_csi_tbl);
 
 static struct mei_cl_driver mei_csi_driver = {
 	.id_table = mei_csi_tbl,
-	.name = MEI_CSI_DRIVER_NAME,
+	.name = KBUILD_MODNAME,
 
 	.probe = mei_csi_probe,
 	.remove = mei_csi_remove,
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v2 2/3 media: ivsc: ace: remove name identifier

Remove name identifier to match the device with the defined UUID when load driver module.

---
v2:
- no changed compared with v1

 drivers/media/pci/intel/ivsc/mei_ace.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/media/pci/intel/ivsc/mei_ace.c +2 -4
index bc37f6d..7879f1f 100644
@@ -30,8 +30,6 @@
 #include <linux/uuid.h>
 #include <linux/workqueue.h>
 
-#define	MEI_ACE_DRIVER_NAME	"ivsc_ace"
-
 /* indicating driver message */
 #define	ACE_DRV_MSG		1
 /* indicating set command */
@@ -554,14 +552,14 @@ static const struct dev_pm_ops mei_ace_pm_ops = {
 			     0x9B, 0x78, 0x03, 0x61, 0x63, 0x5E, 0x24, 0x47)
 
 static const struct mei_cl_device_id mei_ace_tbl[] = {
-	{ MEI_ACE_DRIVER_NAME, MEI_ACE_UUID, MEI_CL_VERSION_ANY },
+	{ .uuid = MEI_ACE_UUID, .version = MEI_CL_VERSION_ANY },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(mei, mei_ace_tbl);
 
 static struct mei_cl_driver mei_ace_driver = {
 	.id_table = mei_ace_tbl,
-	.name = MEI_ACE_DRIVER_NAME,
+	.name = KBUILD_MODNAME,
 
 	.probe = mei_ace_probe,
 	.remove = mei_ace_remove,
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH v2 3/3 media: ivsc: ace: probe ace device after init IPU bridge

In reply to Wentong Wu

Probe ivsc ace device after IPU bridge has been initialized.

---
v2:
- call put_device() if IPU bridge hasn't been initialized

 drivers/media/pci/intel/ivsc/mei_ace.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/pci/intel/ivsc/mei_ace.c +3 -0
index 7879f1f..627ec40 100644
@@ -406,6 +406,9 @@ static int mei_ace_setup_dev_link(struct mei_ace *ace)
 	if (!csi_dev) {
 		ret = -EPROBE_DEFER;
 		goto err;
+	} else if (!dev_fwnode(csi_dev)) {
+		ret = -EPROBE_DEFER;
+		goto err_put;
 	}
 
 	/* setup link between mei_ace and mei_csi */
Signature · 1 line
2.7.4
maintainer
#3 lore raw

Re: [PATCH v2 3/3] media: ivsc: ace: probe ace device after init IPU bridge

Hi Wentong,

Thanks for the patch.

Quoted 1 line · Wentong Wu

Probe ivsc ace device after IPU bridge has been initialized.

This doesn't really match what the patch does: it puts csi_dev device if the device doesn't have a fwnode. Could you provide a better commit message please?

Quoted 26 lines

---
v2:
- call put_device() if IPU bridge hasn't been initialized

 drivers/media/pci/intel/ivsc/mei_ace.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/pci/intel/ivsc/mei_ace.c +3 -0
index 7879f1f..627ec40 100644
@@ -406,6 +406,9 @@ static int mei_ace_setup_dev_link(struct mei_ace *ace)
 	if (!csi_dev) {
 		ret = -EPROBE_DEFER;
 		goto err;
+	} else if (!dev_fwnode(csi_dev)) {
+		ret = -EPROBE_DEFER;
+		goto err_put;
 	}
 
 	/* setup link between mei_ace and mei_csi */
Signature · 1 line
2.7.4
Signature · 1 line
Sakari Ailus
#4 lore raw

RE: [PATCH v2 3/3] media: ivsc: ace: probe ace device after init IPU bridge

Hi Sakari,

Thanks for you review.

Quoted 10 lines

-----Original Message-----
From: Sakari Ailus <[email protected]>
Sent: Thursday, August 24, 2023 2:52 PM
To: Wu, Wentong <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH v2 3/3] media: ivsc: ace: probe ace device after init IPU bridge

Hi Wentong,

Quoted 8 lines

Thanks for the patch.

Quoted 1 line · Wentong Wu

Probe ivsc ace device after IPU bridge has been initialized.

This doesn't really match what the patch does: it puts csi_dev device if the device doesn't have a fwnode. Could you provide a better commit message please?

How about below commit message:

media: ivsc: ace: probe ace device after IPU bridge is initialized.

When probe ivsc ace device, acpi_dev_clear_dependencies() will clear the consumer and supplier relationship between camera sensor device and ivsc device. But the IPU bridge will setup the connection swnodes for ivsc device and camera sensor device based on this consumer and supplier relationship. This patch defers ivsc ace's probe to make sure IPU bridge is initialized before this consumer and supplier relationship between camera sensor device and IVSC device is cleared.

If acceptable, I will push the v3 patch. Thanks

BR,
Wentong

Quoted 32 lines

drivers/media/pci/intel/ivsc/mei_ace.c static int mei_ace_setup_dev_link(struct mei_ace

Quoted 16 lines

---
v2:
- call put_device() if IPU bridge hasn't been initialized

 drivers/media/pci/intel/ivsc/mei_ace.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/pci/intel/ivsc/mei_ace.c +0 -0
index 7879f1f..627ec40 100644
@@ -406,6 +406,9 @@ static int mei_ace_setup_dev_link(struct mei_ace

*ace)

Quoted 10 lines
drivers/media/pci/intel/ivsc/mei_ace.c +3 -1
 	if (!csi_dev) {
 		ret = -EPROBE_DEFER;
 		goto err;
+	} else if (!dev_fwnode(csi_dev)) {
+		ret = -EPROBE_DEFER;
+		goto err_put;
 	}
 
 	/* setup link between mei_ace and mei_csi */
--
Quoted 2 lines

2.7.4

--
Sakari Ailus