Skip to contentSkip to conversation

i3c: mipi-i3c-hci: Convert DBG() prints to dev_dbg()

PATCH Applied Jarkko Nikula 3 participants 16 messages Aug 27, 2025 – Sep 15, 2025 I3C

lore
Share & tools
lore
#0 lore raw

cover i3c: mipi-i3c-hci: Convert DBG() prints to dev_dbg()

Hi

A recent error report and reporter's difficulties to enable interrupt status prints motivated me to (finally) convert all local DBG() prints to dev_dbg().

Jarkko Nikula (5):
i3c: mipi-i3c-hci: Change interrupt status prints to dev_dbg()
i3c: mipi-i3c-hci: Remove nonexistent ring interrupt
i3c: mipi-i3c-hci: Uniform ring number printouts
i3c: mipi-i3c-hci: Remove function enter DBG() printouts
i3c: mipi-i3c-hci: Convert remaining DBG() prints to dev_dbg()

 drivers/i3c/master/mipi-i3c-hci/cmd_v1.c   |  9 ++-
 drivers/i3c/master/mipi-i3c-hci/cmd_v2.c   |  7 ++-
 drivers/i3c/master/mipi-i3c-hci/core.c     | 34 +++-------
 drivers/i3c/master/mipi-i3c-hci/dma.c      | 27 ++++----
 drivers/i3c/master/mipi-i3c-hci/ext_caps.c | 11 ++--
 drivers/i3c/master/mipi-i3c-hci/hci.h      |  3 -
 drivers/i3c/master/mipi-i3c-hci/pio.c      | 73 +++++++++++++---------
 7 files changed, 81 insertions(+), 83 deletions(-)
Signature · 7 lines
2.47.2


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
#1 lore raw

PATCH 1/5 i3c: mipi-i3c-hci: Change interrupt status prints to dev_dbg()

Change interrupt status prints from local DBG() macro to dev_dbg() in order to make it easier to enable them without needing to recompile code with DEBUG defined.

While doing so, spell out the status register names as they are in the specification to make it easier to differentiate between different interrupt status registers.

Since dynamic debug prints can include the line number remove the "(in)" and "(out)" markers from the PIO interrupt status prints.

Prefix the ring interrupt status print using "Ring %d" instead of "rh%d" to make it uniform across all other prints showing the ring number.

---
 drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
 drivers/i3c/master/mipi-i3c-hci/dma.c  | 3 ++-
 drivers/i3c/master/mipi-i3c-hci/pio.c  | 7 ++++---
 3 files changed, 7 insertions(+), 5 deletions(-)
drivers/i3c/master/mipi-i3c-hci/core.c +1 -1
index 7a467ef65787..d532933ac7ab 100644
@@ -553,7 +553,7 @@ static irqreturn_t i3c_hci_irq_handler(int irq, void *dev_id)
 
 	val = reg_read(INTR_STATUS);
 	reg_write(INTR_STATUS, val);
-	DBG("INTR_STATUS = %#x", val);
+	dev_dbg(&hci->master.dev, "INTR_STATUS %#x", val);
 
 	if (val)
 		result = IRQ_HANDLED;
drivers/i3c/master/mipi-i3c-hci/dma.c +2 -1
index 09688ada4912..f5f5ab4db172 100644
@@ -760,7 +760,8 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci)
 
 		rh = &rings->headers[i];
 		status = rh_reg_read(INTR_STATUS);
-		DBG("rh%d status: %#x", i, status);
+		dev_dbg(&hci->master.dev, "Ring %d: RH_INTR_STATUS %#x",
+			i, status);
 		if (!status)
 			continue;
 		rh_reg_write(INTR_STATUS, status);
drivers/i3c/master/mipi-i3c-hci/pio.c +4 -3
index 2fc71e696911..cde883137bc7 100644
@@ -986,7 +986,8 @@ static bool hci_pio_irq_handler(struct i3c_hci *hci)
 
 	spin_lock(&pio->lock);
 	status = pio_reg_read(INTR_STATUS);
-	DBG("(in) status: %#x/%#x", status, pio->enabled_irqs);
+	dev_dbg(&hci->master.dev, "PIO_INTR_STATUS %#x/%#x",
+		status, pio->enabled_irqs);
 	status &= pio->enabled_irqs | STAT_LATENCY_WARNINGS;
 	if (!status) {
 		spin_unlock(&pio->lock);
@@ -1023,8 +1024,8 @@ static bool hci_pio_irq_handler(struct i3c_hci *hci)
 			pio->enabled_irqs &= ~STAT_CMD_QUEUE_READY;
 
 	pio_reg_write(INTR_SIGNAL_ENABLE, pio->enabled_irqs);
-	DBG("(out) status: %#x/%#x",
-	    pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));
+	dev_dbg(&hci->master.dev, "PIO_INTR_STATUS %#x/%#x",
+		pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));
 	spin_unlock(&pio->lock);
 	return true;
 }
Signature · 7 lines
2.47.2


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
reviewer Reviewed-by on v1 1/5
#2 lore raw

Re: [PATCH 1/5] i3c: mipi-i3c-hci: Change interrupt status prints to dev_dbg()

Quoted 8 lines · Jarkko Nikula

Change interrupt status prints from local DBG() macro to dev_dbg() in order to make it easier to enable them without needing to recompile code with DEBUG defined.

While doing so, spell out the status register names as they are in the specification to make it easier to differentiate between different interrupt status registers.

Quoted 7 lines

Since dynamic debug prints can include the line number remove the "(in)" and "(out)" markers from the PIO interrupt status prints.

Prefix the ring interrupt status print using "Ring %d" instead of "rh%d" to make it uniform across all other prints showing the ring number.

Quoted 66 lines
---
 drivers/i3c/master/mipi-i3c-hci/core.c | 2 +-
 drivers/i3c/master/mipi-i3c-hci/dma.c  | 3 ++-
 drivers/i3c/master/mipi-i3c-hci/pio.c  | 7 ++++---
 3 files changed, 7 insertions(+), 5 deletions(-)
drivers/i3c/master/mipi-i3c-hci/core.c +1 -1
index 7a467ef65787..d532933ac7ab 100644
@@ -553,7 +553,7 @@ static irqreturn_t i3c_hci_irq_handler(int irq, void *dev_id)
 
 	val = reg_read(INTR_STATUS);
 	reg_write(INTR_STATUS, val);
-	DBG("INTR_STATUS = %#x", val);
+	dev_dbg(&hci->master.dev, "INTR_STATUS %#x", val);
 
 	if (val)
 		result = IRQ_HANDLED;
drivers/i3c/master/mipi-i3c-hci/dma.c +2 -1
index 09688ada4912..f5f5ab4db172 100644
@@ -760,7 +760,8 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci)
 
 		rh = &rings->headers[i];
 		status = rh_reg_read(INTR_STATUS);
-		DBG("rh%d status: %#x", i, status);
+		dev_dbg(&hci->master.dev, "Ring %d: RH_INTR_STATUS %#x",
+			i, status);
 		if (!status)
 			continue;
 		rh_reg_write(INTR_STATUS, status);
drivers/i3c/master/mipi-i3c-hci/pio.c +4 -4
index 2fc71e696911..cde883137bc7 100644
@@ -986,7 +986,8 @@ static bool hci_pio_irq_handler(struct i3c_hci *hci)
 
 	spin_lock(&pio->lock);
 	status = pio_reg_read(INTR_STATUS);
-	DBG("(in) status: %#x/%#x", status, pio->enabled_irqs);
+	dev_dbg(&hci->master.dev, "PIO_INTR_STATUS %#x/%#x",
+		status, pio->enabled_irqs);
 	status &= pio->enabled_irqs | STAT_LATENCY_WARNINGS;
 	if (!status) {
 		spin_unlock(&pio->lock);
@@ -1023,8 +1024,8 @@ static bool hci_pio_irq_handler(struct i3c_hci *hci)
 			pio->enabled_irqs &= ~STAT_CMD_QUEUE_READY;
 
 	pio_reg_write(INTR_SIGNAL_ENABLE, pio->enabled_irqs);
-	DBG("(out) status: %#x/%#x",
-	    pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));
+	dev_dbg(&hci->master.dev, "PIO_INTR_STATUS %#x/%#x",
+		pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));
 	spin_unlock(&pio->lock);
 	return true;
 }
--

2.47.2

--
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c

Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
#3 lore raw

PATCH 2/5 i3c: mipi-i3c-hci: Remove nonexistent ring interrupt

In reply to Jarkko Nikula

Ring interrupt bit 7, INTR_WARN_INS_STOP_MODE was probably drafted at some point but is marked as reserved in the MIPI I3C HCI specification versions 1.1 and 1.2 that came out after the initial code and also in the earlier specification versions so remove it.

---
 drivers/i3c/master/mipi-i3c-hci/dma.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/i3c/master/mipi-i3c-hci/dma.c +0 -5
index f5f5ab4db172..8bc9de189543 100644
@@ -77,7 +77,6 @@
 #define INTR_TRANSFER_COMPLETION	BIT(11)
 #define INTR_RING_OP			BIT(10)
 #define INTR_TRANSFER_ERR		BIT(9)
-#define INTR_WARN_INS_STOP_MODE		BIT(7)
 #define INTR_IBI_RING_FULL		BIT(6)
 #define INTR_TRANSFER_ABORT		BIT(5)
 
@@ -278,7 +277,6 @@ static int hci_dma_init(struct i3c_hci *hci)
 						 INTR_TRANSFER_COMPLETION |
 						 INTR_RING_OP |
 						 INTR_TRANSFER_ERR |
-						 INTR_WARN_INS_STOP_MODE |
 						 INTR_IBI_RING_FULL |
 						 INTR_TRANSFER_ABORT);
 
@@ -795,9 +793,6 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci)
 							   RING_CTRL_RUN_STOP);
 			}
 		}
-		if (status & INTR_WARN_INS_STOP_MODE)
-			dev_warn_ratelimited(&hci->master.dev,
-				"ring %d: Inserted Stop on Mode Change\n", i);
 		if (status & INTR_IBI_RING_FULL)
 			dev_err_ratelimited(&hci->master.dev,
 				"ring %d: IBI Ring Full Condition\n", i);
Signature · 7 lines
2.47.2


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
reviewer Reviewed-by on v1 2/5
#4 lore raw

Re: [PATCH 2/5] i3c: mipi-i3c-hci: Remove nonexistent ring interrupt

Quoted 7 lines · Jarkko Nikula

Ring interrupt bit 7, INTR_WARN_INS_STOP_MODE was probably drafted at some point but is marked as reserved in the MIPI I3C HCI specification versions 1.1 and 1.2 that came out after the initial code and also in the earlier specification versions so remove it.

---

Quoted 41 lines
 drivers/i3c/master/mipi-i3c-hci/dma.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/i3c/master/mipi-i3c-hci/dma.c +0 -6
index f5f5ab4db172..8bc9de189543 100644
@@ -77,7 +77,6 @@
 #define INTR_TRANSFER_COMPLETION	BIT(11)
 #define INTR_RING_OP			BIT(10)
 #define INTR_TRANSFER_ERR		BIT(9)
-#define INTR_WARN_INS_STOP_MODE		BIT(7)
 #define INTR_IBI_RING_FULL		BIT(6)
 #define INTR_TRANSFER_ABORT		BIT(5)
 
@@ -278,7 +277,6 @@ static int hci_dma_init(struct i3c_hci *hci)
 						 INTR_TRANSFER_COMPLETION |
 						 INTR_RING_OP |
 						 INTR_TRANSFER_ERR |
-						 INTR_WARN_INS_STOP_MODE |
 						 INTR_IBI_RING_FULL |
 						 INTR_TRANSFER_ABORT);
 
@@ -795,9 +793,6 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci)
 							   RING_CTRL_RUN_STOP);
 			}
 		}
-		if (status & INTR_WARN_INS_STOP_MODE)
-			dev_warn_ratelimited(&hci->master.dev,
-				"ring %d: Inserted Stop on Mode Change\n", i);
 		if (status & INTR_IBI_RING_FULL)
 			dev_err_ratelimited(&hci->master.dev,
 				"ring %d: IBI Ring Full Condition\n", i);
--

2.47.2

--
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c

Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
#5 lore raw

PATCH 3/5 i3c: mipi-i3c-hci: Uniform ring number printouts

In reply to Jarkko Nikula

Use the same "Ring" prefix in all prints that print out the ring number.

---
 drivers/i3c/master/mipi-i3c-hci/dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i3c/master/mipi-i3c-hci/dma.c +2 -2
index 8bc9de189543..3fadacbda582 100644
@@ -775,7 +775,7 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci)
 			u32 ring_status;
 
 			dev_notice_ratelimited(&hci->master.dev,
-				"ring %d: Transfer Aborted\n", i);
+				"Ring %d: Transfer Aborted\n", i);
 			mipi_i3c_hci_resume(hci);
 			ring_status = rh_reg_read(RING_STATUS);
 			if (!(ring_status & RING_STATUS_RUNNING) &&
@@ -795,7 +795,7 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci)
 		}
 		if (status & INTR_IBI_RING_FULL)
 			dev_err_ratelimited(&hci->master.dev,
-				"ring %d: IBI Ring Full Condition\n", i);
+				"Ring %d: IBI Ring Full Condition\n", i);
 
 		handled = true;
 	}
Signature · 7 lines
2.47.2


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
reviewer Reviewed-by on v1 3/5
#6 lore raw

Re: [PATCH 3/5] i3c: mipi-i3c-hci: Uniform ring number printouts

Quoted 4 lines · Jarkko Nikula

Use the same "Ring" prefix in all prints that print out the ring number.

---

Quoted 33 lines
 drivers/i3c/master/mipi-i3c-hci/dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i3c/master/mipi-i3c-hci/dma.c +2 -3
index 8bc9de189543..3fadacbda582 100644
@@ -775,7 +775,7 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci)
 			u32 ring_status;
 
 			dev_notice_ratelimited(&hci->master.dev,
-				"ring %d: Transfer Aborted\n", i);
+				"Ring %d: Transfer Aborted\n", i);
 			mipi_i3c_hci_resume(hci);
 			ring_status = rh_reg_read(RING_STATUS);
 			if (!(ring_status & RING_STATUS_RUNNING) &&
@@ -795,7 +795,7 @@ static bool hci_dma_irq_handler(struct i3c_hci *hci)
 		}
 		if (status & INTR_IBI_RING_FULL)
 			dev_err_ratelimited(&hci->master.dev,
-				"ring %d: IBI Ring Full Condition\n", i);
+				"Ring %d: IBI Ring Full Condition\n", i);
 
 		handled = true;
 	}
--

2.47.2

--
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c

Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
#7 lore raw

PATCH 4/5 i3c: mipi-i3c-hci: Remove function enter DBG() printouts

In reply to Jarkko Nikula

These function enter DBG("") printouts are not very useful in error report point of view because they require code recompile. In which case they can be replaced with more informative debug prints if needed so remove them for now.

---
 drivers/i3c/master/mipi-i3c-hci/core.c | 16 ----------------
 1 file changed, 16 deletions(-)
drivers/i3c/master/mipi-i3c-hci/core.c +0 -16
index d532933ac7ab..9932945ecf06 100644
@@ -121,8 +121,6 @@ static int i3c_hci_bus_init(struct i3c_master_controller *m)
 	struct i3c_device_info info;
 	int ret;
 
-	DBG("");
-
 	if (hci->cmd == &mipi_i3c_hci_cmd_v1) {
 		ret = mipi_i3c_hci_dat_v1.init(hci);
 		if (ret)
@@ -159,8 +157,6 @@ static void i3c_hci_bus_cleanup(struct i3c_master_controller *m)
 	struct i3c_hci *hci = to_i3c_hci(m);
 	struct platform_device *pdev = to_platform_device(m->dev.parent);
 
-	DBG("");
-
 	reg_clear(HC_CONTROL, HC_CONTROL_BUS_ENABLE);
 	synchronize_irq(platform_get_irq(pdev, 0));
 	hci->io->cleanup(hci);
@@ -267,8 +263,6 @@ static int i3c_hci_daa(struct i3c_master_controller *m)
 {
 	struct i3c_hci *hci = to_i3c_hci(m);
 
-	DBG("");
-
 	return hci->cmd->perform_daa(hci);
 }
 
@@ -385,8 +379,6 @@ static int i3c_hci_attach_i3c_dev(struct i3c_dev_desc *dev)
 	struct i3c_hci_dev_data *dev_data;
 	int ret;
 
-	DBG("");
-
 	dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL);
 	if (!dev_data)
 		return -ENOMEM;
@@ -410,8 +402,6 @@ static int i3c_hci_reattach_i3c_dev(struct i3c_dev_desc *dev, u8 old_dyn_addr)
 	struct i3c_hci *hci = to_i3c_hci(m);
 	struct i3c_hci_dev_data *dev_data = i3c_dev_get_master_data(dev);
 
-	DBG("");
-
 	if (hci->cmd == &mipi_i3c_hci_cmd_v1)
 		mipi_i3c_hci_dat_v1.set_dynamic_addr(hci, dev_data->dat_idx,
 					     dev->info.dyn_addr);
@@ -424,8 +414,6 @@ static void i3c_hci_detach_i3c_dev(struct i3c_dev_desc *dev)
 	struct i3c_hci *hci = to_i3c_hci(m);
 	struct i3c_hci_dev_data *dev_data = i3c_dev_get_master_data(dev);
 
-	DBG("");
-
 	i3c_dev_set_master_data(dev, NULL);
 	if (hci->cmd == &mipi_i3c_hci_cmd_v1)
 		mipi_i3c_hci_dat_v1.free_entry(hci, dev_data->dat_idx);
@@ -439,8 +427,6 @@ static int i3c_hci_attach_i2c_dev(struct i2c_dev_desc *dev)
 	struct i3c_hci_dev_data *dev_data;
 	int ret;
 
-	DBG("");
-
 	if (hci->cmd != &mipi_i3c_hci_cmd_v1)
 		return 0;
 	dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL);
@@ -464,8 +450,6 @@ static void i3c_hci_detach_i2c_dev(struct i2c_dev_desc *dev)
 	struct i3c_hci *hci = to_i3c_hci(m);
 	struct i3c_hci_dev_data *dev_data = i2c_dev_get_master_data(dev);
 
-	DBG("");
-
 	if (dev_data) {
 		i2c_dev_set_master_data(dev, NULL);
 		if (hci->cmd == &mipi_i3c_hci_cmd_v1)
Signature · 7 lines
2.47.2


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
reviewer
#8 lore raw

Re: [PATCH 4/5] i3c: mipi-i3c-hci: Remove function enter DBG() printouts

Quoted 4 lines · Jarkko Nikula

These function enter DBG("") printouts are not very useful in error report point of view because they require code recompile. In which case they can be replaced with more informative debug prints if needed so remove them for now.

I think simple words should be enough

Remove useless empty DBG("") functions to clean up code.

Frank

Quoted 90 lines
---
 drivers/i3c/master/mipi-i3c-hci/core.c | 16 ----------------
 1 file changed, 16 deletions(-)
drivers/i3c/master/mipi-i3c-hci/core.c +0 -17
index d532933ac7ab..9932945ecf06 100644
@@ -121,8 +121,6 @@ static int i3c_hci_bus_init(struct i3c_master_controller *m)
 	struct i3c_device_info info;
 	int ret;
 
-	DBG("");
-
 	if (hci->cmd == &mipi_i3c_hci_cmd_v1) {
 		ret = mipi_i3c_hci_dat_v1.init(hci);
 		if (ret)
@@ -159,8 +157,6 @@ static void i3c_hci_bus_cleanup(struct i3c_master_controller *m)
 	struct i3c_hci *hci = to_i3c_hci(m);
 	struct platform_device *pdev = to_platform_device(m->dev.parent);
 
-	DBG("");
-
 	reg_clear(HC_CONTROL, HC_CONTROL_BUS_ENABLE);
 	synchronize_irq(platform_get_irq(pdev, 0));
 	hci->io->cleanup(hci);
@@ -267,8 +263,6 @@ static int i3c_hci_daa(struct i3c_master_controller *m)
 {
 	struct i3c_hci *hci = to_i3c_hci(m);
 
-	DBG("");
-
 	return hci->cmd->perform_daa(hci);
 }
 
@@ -385,8 +379,6 @@ static int i3c_hci_attach_i3c_dev(struct i3c_dev_desc *dev)
 	struct i3c_hci_dev_data *dev_data;
 	int ret;
 
-	DBG("");
-
 	dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL);
 	if (!dev_data)
 		return -ENOMEM;
@@ -410,8 +402,6 @@ static int i3c_hci_reattach_i3c_dev(struct i3c_dev_desc *dev, u8 old_dyn_addr)
 	struct i3c_hci *hci = to_i3c_hci(m);
 	struct i3c_hci_dev_data *dev_data = i3c_dev_get_master_data(dev);
 
-	DBG("");
-
 	if (hci->cmd == &mipi_i3c_hci_cmd_v1)
 		mipi_i3c_hci_dat_v1.set_dynamic_addr(hci, dev_data->dat_idx,
 					     dev->info.dyn_addr);
@@ -424,8 +414,6 @@ static void i3c_hci_detach_i3c_dev(struct i3c_dev_desc *dev)
 	struct i3c_hci *hci = to_i3c_hci(m);
 	struct i3c_hci_dev_data *dev_data = i3c_dev_get_master_data(dev);
 
-	DBG("");
-
 	i3c_dev_set_master_data(dev, NULL);
 	if (hci->cmd == &mipi_i3c_hci_cmd_v1)
 		mipi_i3c_hci_dat_v1.free_entry(hci, dev_data->dat_idx);
@@ -439,8 +427,6 @@ static int i3c_hci_attach_i2c_dev(struct i2c_dev_desc *dev)
 	struct i3c_hci_dev_data *dev_data;
 	int ret;
 
-	DBG("");
-
 	if (hci->cmd != &mipi_i3c_hci_cmd_v1)
 		return 0;
 	dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL);
@@ -464,8 +450,6 @@ static void i3c_hci_detach_i2c_dev(struct i2c_dev_desc *dev)
 	struct i3c_hci *hci = to_i3c_hci(m);
 	struct i3c_hci_dev_data *dev_data = i2c_dev_get_master_data(dev);
 
-	DBG("");
-
 	if (dev_data) {
 		i2c_dev_set_master_data(dev, NULL);
 		if (hci->cmd == &mipi_i3c_hci_cmd_v1)
--

2.47.2

--
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c

Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
#9 lore raw

PATCH 5/5 i3c: mipi-i3c-hci: Convert remaining DBG() prints to dev_dbg()

In reply to Jarkko Nikula

Get rid of local DBG() macro and convert remaining debug prints to dev_dbg() which can be controlled without code recompile when kernel is built with dynamic debug support.

---
 drivers/i3c/master/mipi-i3c-hci/cmd_v1.c   |  9 ++-
 drivers/i3c/master/mipi-i3c-hci/cmd_v2.c   |  7 ++-
 drivers/i3c/master/mipi-i3c-hci/core.c     | 16 +++---
 drivers/i3c/master/mipi-i3c-hci/dma.c      | 15 +++--
 drivers/i3c/master/mipi-i3c-hci/ext_caps.c | 11 ++--
 drivers/i3c/master/mipi-i3c-hci/hci.h      |  3 -
 drivers/i3c/master/mipi-i3c-hci/pio.c      | 66 +++++++++++++---------
 7 files changed, 72 insertions(+), 55 deletions(-)
drivers/i3c/master/mipi-i3c-hci/cmd_v1.c +6 -3
index dd636094b07f..eb8a3ae2990d 100644
@@ -317,7 +317,9 @@ static int hci_cmd_v1_daa(struct i3c_hci *hci)
 			break;
 		next_addr = ret;
 
-		DBG("next_addr = 0x%02x, DAA using DAT %d", next_addr, dat_idx);
+		dev_dbg(&hci->master.dev,
+			"next_addr = 0x%02x, DAA using DAT %d",
+			next_addr, dat_idx);
 		mipi_i3c_hci_dat_v1.set_dynamic_addr(hci, dat_idx, next_addr);
 		mipi_i3c_hci_dct_index_reset(hci);
 
@@ -349,8 +351,9 @@ static int hci_cmd_v1_daa(struct i3c_hci *hci)
 		}
 
 		i3c_hci_dct_get_val(hci, 0, &pid, &dcr, &bcr);
-		DBG("assigned address %#x to device PID=0x%llx DCR=%#x BCR=%#x",
-		    next_addr, pid, dcr, bcr);
+		dev_dbg(&hci->master.dev,
+			"assigned address %#x to device PID=0x%llx DCR=%#x BCR=%#x",
+			next_addr, pid, dcr, bcr);
 
 		mipi_i3c_hci_dat_v1.free_entry(hci, dat_idx);
 		dat_idx = -1;
drivers/i3c/master/mipi-i3c-hci/cmd_v2.c +4 -3
index 4493b2b067cb..efb4326a25b7 100644
@@ -261,7 +261,7 @@ static int hci_cmd_v2_daa(struct i3c_hci *hci)
 		if (ret < 0)
 			break;
 		next_addr = ret;
-		DBG("next_addr = 0x%02x", next_addr);
+		dev_dbg(&hci->master.dev, "next_addr = 0x%02x", next_addr);
 		xfer[0].cmd_tid = hci_get_tid();
 		xfer[0].cmd_desc[0] =
 			CMD_0_ATTR_A |
@@ -293,8 +293,9 @@ static int hci_cmd_v2_daa(struct i3c_hci *hci)
 		pid = (pid << 32) | device_id[0];
 		bcr = FIELD_GET(W1_MASK(55, 48), device_id[1]);
 		dcr = FIELD_GET(W1_MASK(63, 56), device_id[1]);
-		DBG("assigned address %#x to device PID=0x%llx DCR=%#x BCR=%#x",
-		    next_addr, pid, dcr, bcr);
+		dev_dbg(&hci->master.dev,
+			"assigned address %#x to device PID=0x%llx DCR=%#x BCR=%#x",
+			next_addr, pid, dcr, bcr);
 		/*
 		 * TODO: Extend the subsystem layer to allow for registering
 		 * new device and provide BCR/DCR/PID at the same time.
drivers/i3c/master/mipi-i3c-hci/core.c +8 -8
index 9932945ecf06..47e42cb4dbe7 100644
@@ -147,7 +147,7 @@ static int i3c_hci_bus_init(struct i3c_master_controller *m)
 		amd_set_resp_buf_thld(hci);
 
 	reg_set(HC_CONTROL, HC_CONTROL_BUS_ENABLE);
-	DBG("HC_CONTROL = %#x", reg_read(HC_CONTROL));
+	dev_dbg(&hci->master.dev, "HC_CONTROL = %#x", reg_read(HC_CONTROL));
 
 	return 0;
 }
@@ -192,8 +192,8 @@ static int i3c_hci_send_ccc_cmd(struct i3c_master_controller *m,
 	DECLARE_COMPLETION_ONSTACK(done);
 	int i, last, ret = 0;
 
-	DBG("cmd=%#x rnw=%d ndests=%d data[0].len=%d",
-	    ccc->id, ccc->rnw, ccc->ndests, ccc->dests[0].payload.len);
+	dev_dbg(&hci->master.dev, "cmd=%#x rnw=%d ndests=%d data[0].len=%d",
+		ccc->id, ccc->rnw, ccc->ndests, ccc->dests[0].payload.len);
 
 	xfer = hci_alloc_xfer(nxfers);
 	if (!xfer)
@@ -251,8 +251,8 @@ static int i3c_hci_send_ccc_cmd(struct i3c_master_controller *m,
 	}
 
 	if (ccc->rnw)
-		DBG("got: %*ph",
-		    ccc->dests[0].payload.len, ccc->dests[0].payload.data);
+		dev_dbg(&hci->master.dev, "got: %*ph",
+			ccc->dests[0].payload.len, ccc->dests[0].payload.data);
 
 out:
 	hci_free_xfer(xfer, nxfers);
@@ -277,7 +277,7 @@ static int i3c_hci_priv_xfers(struct i3c_dev_desc *dev,
 	unsigned int size_limit;
 	int i, last, ret = 0;
 
-	DBG("nxfers = %d", nxfers);
+	dev_dbg(&hci->master.dev, "nxfers = %d", nxfers);
 
 	xfer = hci_alloc_xfer(nxfers);
 	if (!xfer)
@@ -335,7 +335,7 @@ static int i3c_hci_i2c_xfers(struct i2c_dev_desc *dev,
 	DECLARE_COMPLETION_ONSTACK(done);
 	int i, last, ret = 0;
 
-	DBG("nxfers = %d", nxfers);
+	dev_dbg(&hci->master.dev, "nxfers = %d", nxfers);
 
 	xfer = hci_alloc_xfer(nxfers);
 	if (!xfer)
@@ -587,7 +587,7 @@ static int i3c_hci_init(struct i3c_hci *hci)
 	}
 
 	hci->caps = reg_read(HC_CAPABILITIES);
-	DBG("caps = %#x", hci->caps);
+	dev_dbg(&hci->master.dev, "caps = %#x", hci->caps);
 
 	size_in_dwords = hci->version_major < 1 ||
 			 (hci->version_major == 1 && hci->version_minor < 1);
drivers/i3c/master/mipi-i3c-hci/dma.c +9 -6
index 3fadacbda582..c401a9425cdc 100644
@@ -248,8 +248,9 @@ static int hci_dma_init(struct i3c_hci *hci)
 		regval = rh_reg_read(CR_SETUP);
 		rh->xfer_struct_sz = FIELD_GET(CR_XFER_STRUCT_SIZE, regval);
 		rh->resp_struct_sz = FIELD_GET(CR_RESP_STRUCT_SIZE, regval);
-		DBG("xfer_struct_sz = %d, resp_struct_sz = %d",
-		    rh->xfer_struct_sz, rh->resp_struct_sz);
+		dev_dbg(&hci->master.dev,
+			"xfer_struct_sz = %d, resp_struct_sz = %d",
+			rh->xfer_struct_sz, rh->resp_struct_sz);
 		xfers_sz = rh->xfer_struct_sz * rh->xfer_entries;
 		resps_sz = rh->resp_struct_sz * rh->xfer_entries;
 
@@ -523,11 +524,11 @@ static void hci_dma_xfer_done(struct i3c_hci *hci, struct hci_rh_data *rh)
 		ring_resp = rh->resp + rh->resp_struct_sz * done_ptr;
 		resp = *ring_resp;
 		tid = RESP_TID(resp);
-		DBG("resp = 0x%08x", resp);
+		dev_dbg(&hci->master.dev, "resp = 0x%08x", resp);
 
 		xfer = rh->src_xfers[done_ptr];
 		if (!xfer) {
-			DBG("orphaned ring entry");
+			dev_dbg(&hci->master.dev, "orphaned ring entry");
 		} else {
 			hci_dma_unmap_xfer(hci, xfer, 1);
 			xfer->ring_entry = -1;
@@ -630,7 +631,7 @@ static void hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh)
 
 		ring_ibi_status = rh->ibi_status + rh->ibi_status_sz * ptr;
 		ibi_status = *ring_ibi_status;
-		DBG("status = %#x", ibi_status);
+		dev_dbg(&hci->master.dev, "status = %#x", ibi_status);
 
 		if (ibi_status_error) {
 			/* we no longer care */
@@ -658,7 +659,9 @@ static void hci_dma_process_ibi(struct i3c_hci *hci, struct hci_rh_data *rh)
 
 	if (last_ptr == -1) {
 		/* this IBI sequence is not yet complete */
-		DBG("no LAST_STATUS available (e=%d d=%d)", enq_ptr, deq_ptr);
+		dev_dbg(&hci->master.dev,
+			"no LAST_STATUS available (e=%d d=%d)",
+			enq_ptr, deq_ptr);
 		return;
 	}
 	deq_ptr = last_ptr + 1;
drivers/i3c/master/mipi-i3c-hci/ext_caps.c +7 -4
index 2e9b23efdc45..7714f00ea9cc 100644
@@ -35,7 +35,7 @@ static int hci_extcap_hardware_id(struct i3c_hci *hci, void __iomem *base)
 	switch (hci->vendor_mipi_id) {
 	case MIPI_VENDOR_NXP:
 		hci->quirks |= HCI_QUIRK_RAW_CCC;
-		DBG("raw CCC quirks set");
+		dev_dbg(&hci->master.dev, "raw CCC quirks set");
 		break;
 	}
 
@@ -77,7 +77,8 @@ static int hci_extcap_xfer_modes(struct i3c_hci *hci, void __iomem *base)
 	for (index = 0; index < entries; index++) {
 		u32 mode_entry = readl(base);
 
-		DBG("mode %d: 0x%08x", index, mode_entry);
+		dev_dbg(&hci->master.dev, "mode %d: 0x%08x",
+			index, mode_entry);
 		/* TODO: will be needed when I3C core does more than SDR */
 		base += 4;
 	}
@@ -97,7 +98,8 @@ static int hci_extcap_xfer_rates(struct i3c_hci *hci, void __iomem *base)
 	dev_info(&hci->master.dev, "available data rates:\n");
 	for (index = 0; index < entries; index++) {
 		rate_entry = readl(base);
-		DBG("entry %d: 0x%08x", index, rate_entry);
+		dev_dbg(&hci->master.dev, "entry %d: 0x%08x",
+			index, rate_entry);
 		rate = FIELD_GET(XFERRATE_ACTUAL_RATE_KHZ, rate_entry);
 		rate_id = FIELD_GET(XFERRATE_RATE_ID, rate_entry);
 		mode_id = FIELD_GET(XFERRATE_MODE_ID, rate_entry);
@@ -268,7 +270,8 @@ int i3c_hci_parse_ext_caps(struct i3c_hci *hci)
 		cap_header = readl(curr_cap);
 		cap_id = FIELD_GET(CAP_HEADER_ID, cap_header);
 		cap_length = FIELD_GET(CAP_HEADER_LENGTH, cap_header);
-		DBG("id=0x%02x length=%d", cap_id, cap_length);
+		dev_dbg(&hci->master.dev, "id=0x%02x length=%d",
+			cap_id, cap_length);
 		if (!cap_length)
 			break;
 		if (curr_cap + cap_length * 4 >= end) {
drivers/i3c/master/mipi-i3c-hci/hci.h +0 -3
index 33bc4906df1f..249ccb13c909 100644
@@ -12,9 +12,6 @@
 
 #include <linux/io.h>
 
-/* Handy logging macro to save on line length */
-#define DBG(x, ...) pr_devel("%s: " x "\n", __func__, ##__VA_ARGS__)
-
 /* 32-bit word aware bit and mask macros */
 #define W0_MASK(h, l)  GENMASK((h) - 0,  (l) - 0)
 #define W1_MASK(h, l)  GENMASK((h) - 32, (l) - 32)
drivers/i3c/master/mipi-i3c-hci/pio.c +38 -28

175 lines not on this page · raw message

Signature · 7 lines
2.47.2


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
reviewer
#10 lore raw

Re: [PATCH 5/5] i3c: mipi-i3c-hci: Convert remaining DBG() prints to dev_dbg()

Quoted 14 lines · Jarkko Nikula

Get rid of local DBG() macro and convert remaining debug prints to dev_dbg() which can be controlled without code recompile when kernel is built with dynamic debug support.

---
 drivers/i3c/master/mipi-i3c-hci/cmd_v1.c   |  9 ++-
 drivers/i3c/master/mipi-i3c-hci/cmd_v2.c   |  7 ++-
 drivers/i3c/master/mipi-i3c-hci/core.c     | 16 +++---
 drivers/i3c/master/mipi-i3c-hci/dma.c      | 15 +++--
 drivers/i3c/master/mipi-i3c-hci/ext_caps.c | 11 ++--
 drivers/i3c/master/mipi-i3c-hci/hci.h      |  3 -
 drivers/i3c/master/mipi-i3c-hci/pio.c      | 66 +++++++++++++---------
 7 files changed, 72 insertions(+), 55 deletions(-)

...

Quoted 10 lines
drivers/i3c/master/mipi-i3c-hci/hci.h +0 -2
-#define DBG(x, ...) pr_devel("%s: " x "\n", __func__, ##__VA_ARGS__)
-
 /* 32-bit word aware bit and mask macros */
 #define W0_MASK(h, l)  GENMASK((h) - 0,  (l) - 0)
 #define W1_MASK(h, l)  GENMASK((h) - 32, (l) - 32)
drivers/i3c/master/mipi-i3c-hci/pio.c +0 -0
index cde883137bc7..01e7d2833301 100644

drivers/i3c/master/mipi-i3c-hci/pio.c static void hci_pio_cleanup(struct i3c_hci *hci) · line 217

Quoted 6 lines
drivers/i3c/master/mipi-i3c-hci/pio.c +1 -1
@@ -213,7 +213,7 @@ static void hci_pio_cleanup(struct i3c_hci *hci)
 	pio_reg_write(INTR_SIGNAL_ENABLE, 0x0);
 
 	if (pio) {
-		DBG("status = %#x/%#x",
+		dev_dbg(&hci->master.dev, "status = %#x/%#x",
 		    pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));

fix pio_reg_read() align to (

Frank

Quoted 193 lines
drivers/i3c/master/mipi-i3c-hci/pio.c +37 -28
 		BUG_ON(pio->curr_xfer);
 		BUG_ON(pio->curr_rx);
@@ -226,13 +226,17 @@ static void hci_pio_cleanup(struct i3c_hci *hci)
 
 static void hci_pio_write_cmd(struct i3c_hci *hci, struct hci_xfer *xfer)
 {
-	DBG("cmd_desc[%d] = 0x%08x", 0, xfer->cmd_desc[0]);
-	DBG("cmd_desc[%d] = 0x%08x", 1, xfer->cmd_desc[1]);
+	dev_dbg(&hci->master.dev, "cmd_desc[%d] = 0x%08x",
+		0, xfer->cmd_desc[0]);
+	dev_dbg(&hci->master.dev, "cmd_desc[%d] = 0x%08x",
+		1, xfer->cmd_desc[1]);
 	pio_reg_write(COMMAND_QUEUE_PORT, xfer->cmd_desc[0]);
 	pio_reg_write(COMMAND_QUEUE_PORT, xfer->cmd_desc[1]);
 	if (hci->cmd == &mipi_i3c_hci_cmd_v2) {
-		DBG("cmd_desc[%d] = 0x%08x", 2, xfer->cmd_desc[2]);
-		DBG("cmd_desc[%d] = 0x%08x", 3, xfer->cmd_desc[3]);
+		dev_dbg(&hci->master.dev, "cmd_desc[%d] = 0x%08x",
+			2, xfer->cmd_desc[2]);
+		dev_dbg(&hci->master.dev, "cmd_desc[%d] = 0x%08x",
+			3, xfer->cmd_desc[3]);
 		pio_reg_write(COMMAND_QUEUE_PORT, xfer->cmd_desc[2]);
 		pio_reg_write(COMMAND_QUEUE_PORT, xfer->cmd_desc[3]);
 	}
@@ -254,7 +258,8 @@ static bool hci_pio_do_rx(struct i3c_hci *hci, struct hci_pio_data *pio)
 		nr_words = min(xfer->data_left / 4, pio->rx_thresh_size);
 		/* extract data from FIFO */
 		xfer->data_left -= nr_words * 4;
-		DBG("now %d left %d", nr_words * 4, xfer->data_left);
+		dev_dbg(&hci->master.dev, "now %d left %d",
+			nr_words * 4, xfer->data_left);
 		while (nr_words--)
 			*p++ = pio_reg_read(XFER_DATA_PORT);
 	}
@@ -269,7 +274,7 @@ static void hci_pio_do_trailing_rx(struct i3c_hci *hci,
 	struct hci_xfer *xfer = pio->curr_rx;
 	u32 *p;
 
-	DBG("%d remaining", count);
+	dev_dbg(&hci->master.dev, "%d remaining", count);
 
 	p = xfer->data;
 	p += (xfer->data_len - xfer->data_left) / 4;
@@ -278,7 +283,8 @@ static void hci_pio_do_trailing_rx(struct i3c_hci *hci,
 		unsigned int nr_words = count / 4;
 		/* extract data from FIFO */
 		xfer->data_left -= nr_words * 4;
-		DBG("now %d left %d", nr_words * 4, xfer->data_left);
+		dev_dbg(&hci->master.dev, "now %d left %d",
+			nr_words * 4, xfer->data_left);
 		while (nr_words--)
 			*p++ = pio_reg_read(XFER_DATA_PORT);
 	}
@@ -321,7 +327,8 @@ static bool hci_pio_do_tx(struct i3c_hci *hci, struct hci_pio_data *pio)
 		nr_words = min(xfer->data_left / 4, pio->tx_thresh_size);
 		/* push data into the FIFO */
 		xfer->data_left -= nr_words * 4;
-		DBG("now %d left %d", nr_words * 4, xfer->data_left);
+		dev_dbg(&hci->master.dev, "now %d left %d",
+			nr_words * 4, xfer->data_left);
 		while (nr_words--)
 			pio_reg_write(XFER_DATA_PORT, *p++);
 	}
@@ -336,7 +343,7 @@ static bool hci_pio_do_tx(struct i3c_hci *hci, struct hci_pio_data *pio)
 		 */
 		if (!(pio_reg_read(INTR_STATUS) & STAT_TX_THLD))
 			return false;
-		DBG("trailing %d", xfer->data_left);
+		dev_dbg(&hci->master.dev, "trailing %d", xfer->data_left);
 		pio_reg_write(XFER_DATA_PORT, *p);
 		xfer->data_left = 0;
 	}
@@ -481,7 +488,7 @@ static bool hci_pio_process_resp(struct i3c_hci *hci, struct hci_pio_data *pio)
 		u32 resp = pio_reg_read(RESPONSE_QUEUE_PORT);
 		unsigned int tid = RESP_TID(resp);
 
-		DBG("resp = 0x%08x", resp);
+		dev_dbg(&hci->master.dev, "resp = 0x%08x", resp);
 		if (tid != xfer->cmd_tid) {
 			dev_err(&hci->master.dev,
 				"response tid=%d when expecting %d\n",
@@ -522,14 +529,15 @@ static bool hci_pio_process_resp(struct i3c_hci *hci, struct hci_pio_data *pio)
 		 * still exists.
 		 */
 		if (pio->curr_rx == xfer) {
-			DBG("short RX ?");
+			dev_dbg(&hci->master.dev, "short RX ?");
 			pio->curr_rx = pio->curr_rx->next_data;
 		} else if (pio->curr_tx == xfer) {
-			DBG("short TX ?");
+			dev_dbg(&hci->master.dev, "short TX ?");
 			pio->curr_tx = pio->curr_tx->next_data;
 		} else if (xfer->data_left) {
-			DBG("PIO xfer count = %d after response",
-			    xfer->data_left);
+			dev_dbg(&hci->master.dev,
+				"PIO xfer count = %d after response",
+				xfer->data_left);
 		}
 
 		pio->curr_resp = xfer->next_resp;
@@ -591,7 +599,7 @@ static int hci_pio_queue_xfer(struct i3c_hci *hci, struct hci_xfer *xfer, int n)
 	struct hci_xfer *prev_queue_tail;
 	int i;
 
-	DBG("n = %d", n);
+	dev_dbg(&hci->master.dev, "n = %d", n);
 
 	/* link xfer instances together and initialize data count */
 	for (i = 0; i < n; i++) {
@@ -611,8 +619,9 @@ static int hci_pio_queue_xfer(struct i3c_hci *hci, struct hci_xfer *xfer, int n)
 		if (!hci_pio_process_cmd(hci, pio))
 			pio->enabled_irqs |= STAT_CMD_QUEUE_READY;
 		pio_reg_write(INTR_SIGNAL_ENABLE, pio->enabled_irqs);
-		DBG("status = %#x/%#x",
-		    pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));
+		dev_dbg(&hci->master.dev, "status = %#x/%#x",
+			pio_reg_read(INTR_STATUS),
+			pio_reg_read(INTR_SIGNAL_ENABLE));
 	}
 	spin_unlock_irq(&pio->lock);
 	return 0;
@@ -686,10 +695,10 @@ static bool hci_pio_dequeue_xfer(struct i3c_hci *hci, struct hci_xfer *xfer, int
 	int ret;
 
 	spin_lock_irq(&pio->lock);
-	DBG("n=%d status=%#x/%#x", n,
-	    pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));
-	DBG("main_status = %#x/%#x",
-	    readl(hci->base_regs + 0x20), readl(hci->base_regs + 0x28));
+	dev_dbg(&hci->master.dev, "n=%d status=%#x/%#x", n,
+		pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));
+	dev_dbg(&hci->master.dev, "main_status = %#x/%#x",
+		readl(hci->base_regs + 0x20), readl(hci->base_regs + 0x28));
 
 	ret = hci_pio_dequeue_xfer_common(hci, pio, xfer, n);
 	spin_unlock_irq(&pio->lock);
@@ -733,8 +742,8 @@ static void hci_pio_err(struct i3c_hci *hci, struct hci_pio_data *pio,
 	mipi_i3c_hci_pio_reset(hci);
 	mipi_i3c_hci_resume(hci);
 
-	DBG("status=%#x/%#x",
-	    pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));
+	dev_dbg(&hci->master.dev, "status=%#x/%#x",
+		pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));
 }
 
 static void hci_pio_set_ibi_thresh(struct i3c_hci *hci,
@@ -749,7 +758,7 @@ static void hci_pio_set_ibi_thresh(struct i3c_hci *hci,
 	if (regval != pio->reg_queue_thresh) {
 		pio_reg_write(QUEUE_THLD_CTRL, regval);
 		pio->reg_queue_thresh = regval;
-		DBG("%d", thresh_val);
+		dev_dbg(&hci->master.dev, "%d", thresh_val);
 	}
 }
 
@@ -773,7 +782,8 @@ static bool hci_pio_get_ibi_segment(struct i3c_hci *hci,
 		/* extract the data from the IBI port */
 		nr_words = thresh_val;
 		ibi->seg_cnt -= nr_words * 4;
-		DBG("now %d left %d", nr_words * 4, ibi->seg_cnt);
+		dev_dbg(&hci->master.dev, "now %d left %d",
+			nr_words * 4, ibi->seg_cnt);
 		while (nr_words--)
 			*p++ = pio_reg_read(IBI_PORT);
 	}
@@ -791,7 +801,7 @@ static bool hci_pio_get_ibi_segment(struct i3c_hci *hci,
 		hci_pio_set_ibi_thresh(hci, pio, 1);
 		if (!(pio_reg_read(INTR_STATUS) & STAT_IBI_STATUS_THLD))
 			return false;
-		DBG("trailing %d", ibi->seg_cnt);
+		dev_dbg(&hci->master.dev, "trailing %d", ibi->seg_cnt);
 		data = pio_reg_read(IBI_PORT);
 		data = (__force u32) cpu_to_le32(data);
 		while (ibi->seg_cnt--) {
@@ -820,7 +830,7 @@ static bool hci_pio_prep_new_ibi(struct i3c_hci *hci, struct hci_pio_data *pio)
 	 */
 
 	ibi_status = pio_reg_read(IBI_PORT);
-	DBG("status = %#x", ibi_status);
+	dev_dbg(&hci->master.dev, "status = %#x", ibi_status);
 	ibi->addr = FIELD_GET(IBI_TARGET_ADDR, ibi_status);
 	if (ibi_status & IBI_ERROR) {
 		dev_err(&hci->master.dev, "IBI error from %#x\n", ibi->addr);
--

2.47.2

--
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c

Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
#11 lore raw

Re: [PATCH 5/5] i3c: mipi-i3c-hci: Convert remaining DBG() prints to dev_dbg()

Quoted 28 lines · Frank Li
Quoted 14 lines · Jarkko Nikula

Get rid of local DBG() macro and convert remaining debug prints to dev_dbg() which can be controlled without code recompile when kernel is built with dynamic debug support.

---
  drivers/i3c/master/mipi-i3c-hci/cmd_v1.c   |  9 ++-
  drivers/i3c/master/mipi-i3c-hci/cmd_v2.c   |  7 ++-
  drivers/i3c/master/mipi-i3c-hci/core.c     | 16 +++---
  drivers/i3c/master/mipi-i3c-hci/dma.c      | 15 +++--
  drivers/i3c/master/mipi-i3c-hci/ext_caps.c | 11 ++--
  drivers/i3c/master/mipi-i3c-hci/hci.h      |  3 -
  drivers/i3c/master/mipi-i3c-hci/pio.c      | 66 +++++++++++++---------
  7 files changed, 72 insertions(+), 55 deletions(-)

...

Quoted 12 lines
drivers/i3c/master/mipi-i3c-hci/hci.h +0 -2
-#define DBG(x, ...) pr_devel("%s: " x "\n", __func__, ##__VA_ARGS__)
-
  /* 32-bit word aware bit and mask macros */
  #define W0_MASK(h, l)  GENMASK((h) - 0,  (l) - 0)
  #define W1_MASK(h, l)  GENMASK((h) - 32, (l) - 32)
drivers/i3c/master/mipi-i3c-hci/pio.c +0 -0
index cde883137bc7..01e7d2833301 100644
@@ -213,7 +213,7 @@ static void hci_pio_cleanup(struct i3c_hci *hci)
  	pio_reg_write(INTR_SIGNAL_ENABLE, 0x0);
 
Quoted 7 lines

drivers/i3c/master/mipi-i3c-hci/pio.c static void hci_pio_cleanup(struct i3c_hci *hci) · line 217

Quoted 4 lines
drivers/i3c/master/mipi-i3c-hci/pio.c +1 -1
  	if (pio) {
-		DBG("status = %#x/%#x",
+		dev_dbg(&hci->master.dev, "status = %#x/%#x",
  		    pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));

fix pio_reg_read() align to (

Ah, this slipped my eyes. I can send a follow up patch giving kudos to you since this patch was now applied or leave it as it.

Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
#12 lore raw

Re: [PATCH 5/5] i3c: mipi-i3c-hci: Convert remaining DBG() prints to dev_dbg()

Quoted 36 lines · Jarkko Nikula
Quoted 28 lines · Frank Li
Quoted 14 lines · Jarkko Nikula

Get rid of local DBG() macro and convert remaining debug prints to dev_dbg() which can be controlled without code recompile when kernel is built with dynamic debug support.

---
  drivers/i3c/master/mipi-i3c-hci/cmd_v1.c   |  9 ++-
  drivers/i3c/master/mipi-i3c-hci/cmd_v2.c   |  7 ++-
  drivers/i3c/master/mipi-i3c-hci/core.c     | 16 +++---
  drivers/i3c/master/mipi-i3c-hci/dma.c      | 15 +++--
  drivers/i3c/master/mipi-i3c-hci/ext_caps.c | 11 ++--
  drivers/i3c/master/mipi-i3c-hci/hci.h      |  3 -
  drivers/i3c/master/mipi-i3c-hci/pio.c      | 66 +++++++++++++---------
  7 files changed, 72 insertions(+), 55 deletions(-)

...

Quoted 12 lines
drivers/i3c/master/mipi-i3c-hci/hci.h +0 -2
-#define DBG(x, ...) pr_devel("%s: " x "\n", __func__, ##__VA_ARGS__)
-
  /* 32-bit word aware bit and mask macros */
  #define W0_MASK(h, l)  GENMASK((h) - 0,  (l) - 0)
  #define W1_MASK(h, l)  GENMASK((h) - 32, (l) - 32)
drivers/i3c/master/mipi-i3c-hci/pio.c +0 -0
index cde883137bc7..01e7d2833301 100644
@@ -213,7 +213,7 @@ static void hci_pio_cleanup(struct i3c_hci *hci)
  	pio_reg_write(INTR_SIGNAL_ENABLE, 0x0);
 
Quoted 7 lines

drivers/i3c/master/mipi-i3c-hci/pio.c static void hci_pio_cleanup(struct i3c_hci *hci) · line 217

Quoted 4 lines
drivers/i3c/master/mipi-i3c-hci/pio.c +1 -1
  	if (pio) {
-		DBG("status = %#x/%#x",
+		dev_dbg(&hci->master.dev, "status = %#x/%#x",
  		    pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));

fix pio_reg_read() align to (

Quoted 2 lines

Ah, this slipped my eyes. I can send a follow up patch giving kudos to you since this patch was now applied or leave it as it.

I fixed it while applying.

Signature · 8 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
#13 lore raw

Re: [PATCH 5/5] i3c: mipi-i3c-hci: Convert remaining DBG() prints to dev_dbg()

Quoted 37 lines · Alexandre Belloni
Quoted 36 lines · Jarkko Nikula
Quoted 35 lines · Frank Li
Quoted 14 lines · Jarkko Nikula

Get rid of local DBG() macro and convert remaining debug prints to dev_dbg() which can be controlled without code recompile when kernel is built with dynamic debug support.

---
   drivers/i3c/master/mipi-i3c-hci/cmd_v1.c   |  9 ++-
   drivers/i3c/master/mipi-i3c-hci/cmd_v2.c   |  7 ++-
   drivers/i3c/master/mipi-i3c-hci/core.c     | 16 +++---
   drivers/i3c/master/mipi-i3c-hci/dma.c      | 15 +++--
   drivers/i3c/master/mipi-i3c-hci/ext_caps.c | 11 ++--
   drivers/i3c/master/mipi-i3c-hci/hci.h      |  3 -
   drivers/i3c/master/mipi-i3c-hci/pio.c      | 66 +++++++++++++---------
   7 files changed, 72 insertions(+), 55 deletions(-)

...

Quoted 10 lines
drivers/i3c/master/mipi-i3c-hci/hci.h +0 -2
-#define DBG(x, ...) pr_devel("%s: " x "\n", __func__, ##__VA_ARGS__)
-
   /* 32-bit word aware bit and mask macros */
   #define W0_MASK(h, l)  GENMASK((h) - 0,  (l) - 0)
   #define W1_MASK(h, l)  GENMASK((h) - 32, (l) - 32)
drivers/i3c/master/mipi-i3c-hci/pio.c +0 -0
index cde883137bc7..01e7d2833301 100644

drivers/i3c/master/mipi-i3c-hci/pio.c static void hci_pio_cleanup(struct i3c_hci *hci) · line 217

Quoted 6 lines
drivers/i3c/master/mipi-i3c-hci/pio.c +1 -1
@@ -213,7 +213,7 @@ static void hci_pio_cleanup(struct i3c_hci *hci)
   	pio_reg_write(INTR_SIGNAL_ENABLE, 0x0);
 
   	if (pio) {
-		DBG("status = %#x/%#x",
+		dev_dbg(&hci->master.dev, "status = %#x/%#x",
   		    pio_reg_read(INTR_STATUS), pio_reg_read(INTR_SIGNAL_ENABLE));

fix pio_reg_read() align to (

Quoted 5 lines
Quoted 2 lines

Ah, this slipped my eyes. I can send a follow up patch giving kudos to you since this patch was now applied or leave it as it.

I fixed it while applying.

Thanks!

Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
#14 lore raw
In reply to Jarkko Nikula
Quoted 13 lines · Jarkko Nikula

Hi

A recent error report and reporter's difficulties to enable interrupt status prints motivated me to (finally) convert all local DBG() prints to dev_dbg().

Jarkko Nikula (5):
i3c: mipi-i3c-hci: Change interrupt status prints to dev_dbg()
i3c: mipi-i3c-hci: Remove nonexistent ring interrupt
i3c: mipi-i3c-hci: Uniform ring number printouts
i3c: mipi-i3c-hci: Remove function enter DBG() printouts
i3c: mipi-i3c-hci: Convert remaining DBG() prints to dev_dbg()

Quoted 9 lines
  drivers/i3c/master/mipi-i3c-hci/cmd_v1.c   |  9 ++-
  drivers/i3c/master/mipi-i3c-hci/cmd_v2.c   |  7 ++-
  drivers/i3c/master/mipi-i3c-hci/core.c     | 34 +++-------
  drivers/i3c/master/mipi-i3c-hci/dma.c      | 27 ++++----
  drivers/i3c/master/mipi-i3c-hci/ext_caps.c | 11 ++--
  drivers/i3c/master/mipi-i3c-hci/hci.h      |  3 -
  drivers/i3c/master/mipi-i3c-hci/pio.c      | 73 +++++++++++++---------
  7 files changed, 81 insertions(+), 83 deletions(-)

Hi Frank, was this set ok in your point of view?

Signature · 3 lines
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
maintainer Applied
#15 lore raw
In reply to Jarkko Nikula
Quoted 4 lines · Jarkko Nikula

A recent error report and reporter's difficulties to enable interrupt status prints motivated me to (finally) convert all local DBG() prints to dev_dbg().

Quoted 8 lines

Jarkko Nikula (5):
i3c: mipi-i3c-hci: Change interrupt status prints to dev_dbg()
i3c: mipi-i3c-hci: Remove nonexistent ring interrupt
i3c: mipi-i3c-hci: Uniform ring number printouts
i3c: mipi-i3c-hci: Remove function enter DBG() printouts
i3c: mipi-i3c-hci: Convert remaining DBG() prints to dev_dbg()

[...]

Applied, thanks!

[1/5] i3c: mipi-i3c-hci: Change interrupt status prints to dev_dbg()

      https://git.kernel.org/i3c/c/a1e05bb05da8
[2/5] i3c: mipi-i3c-hci: Remove nonexistent ring interrupt
      https://git.kernel.org/i3c/c/1ff8dfc6e795
[3/5] i3c: mipi-i3c-hci: Uniform ring number printouts
      https://git.kernel.org/i3c/c/296edf445be0
[4/5] i3c: mipi-i3c-hci: Remove function enter DBG() printouts
      https://git.kernel.org/i3c/c/df92c53a8dff
[5/5] i3c: mipi-i3c-hci: Convert remaining DBG() prints to dev_dbg()
      https://git.kernel.org/i3c/c/4132335d15d5

Best regards,

Signature · 8 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c