Skip to contentSkip to conversation

bus: mhi: host: always print detected modem name

PATCH Superseded Koen Vandeputte 5 participants 6 messages Aug 19, 2022 – Aug 31, 2022 MHI bus

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus: mhi: host: always print detected modem name

This harmless print provides a very easy way of knowing if the modem is detected properly during probing.

Promote it to an informational print so no hassle is required enabling kernel debugging info to obtain it.

The rationale here is that:
On a lot of low-storage embedded devices, extensive kernel debugging info is not always present as this would increase it's size to much causing partition size issues.

---
 drivers/bus/mhi/host/pci_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mhi/host/pci_generic.c +1 -1
index 9e545f2a5a26..51e2b901bae0 100644
@@ -841,7 +841,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	struct mhi_controller *mhi_cntrl;
 	int err;
 
-	dev_dbg(&pdev->dev, "MHI PCI device found: %s\n", info->name);
+	dev_info(&pdev->dev, "MHI PCI device found: %s\n", info->name);
 
 	/* mhi_pdev.mhi_cntrl must be zero-initialized */
 	mhi_pdev = devm_kzalloc(&pdev->dev, sizeof(*mhi_pdev), GFP_KERNEL);
Signature · 1 line
2.34.1
#1 lore raw
Quoted 10 lines · Koen Vandeputte

This harmless print provides a very easy way of knowing if the modem is detected properly during probing.

Promote it to an informational print so no hassle is required enabling kernel debugging info to obtain it.

The rationale here is that:
On a lot of low-storage embedded devices, extensive kernel debugging info is not always present as this would increase it's size to much causing partition size issues.

With dynamic debug, you can turn on this one specific log and nothing else. Seems like it would have the same effect as this change.

Quoted 19 lines
---
  drivers/bus/mhi/host/pci_generic.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mhi/host/pci_generic.c +1 -1
index 9e545f2a5a26..51e2b901bae0 100644
@@ -841,7 +841,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
  	struct mhi_controller *mhi_cntrl;
  	int err;
 
-	dev_dbg(&pdev->dev, "MHI PCI device found: %s\n", info->name);
+	dev_info(&pdev->dev, "MHI PCI device found: %s\n", info->name);
 
  	/* mhi_pdev.mhi_cntrl must be zero-initialized */
  	mhi_pdev = devm_kzalloc(&pdev->dev, sizeof(*mhi_pdev), GFP_KERNEL);
#2 lore raw
Quoted 7 lines · Jeffrey Hugo
Quoted 6 lines · Koen Vandeputte

This harmless print provides a very easy way of knowing if the modem is detected properly during probing.

Promote it to an informational print so no hassle is required enabling kernel debugging info to obtain it.

Quoted 6 lines
Quoted 4 lines

The rationale here is that:
On a lot of low-storage embedded devices, extensive kernel debugging info is not always present as this would increase it's size to much causing partition size issues.

With dynamic debug, you can turn on this one specific log and nothing else.  Seems like it would have the same effect as this change.

Hi Jeffrey,

This is exactly my point.
A lot of targets using OpenWRT don't have dynamic debug featuring compiled-in as it enlarges the kernel too much :-) Also, it seems pretty logical to at least simply show which modem type has been detected on boot.

Also, I'm currently encountering a bug using MHI on kernel 5.15.x which was a pain to debug without this print:
- Using a FN980v1 (which is available in the PCI list in pci_generic.c)
- The modem is always detected as generic sdx55 iso the more specific fn980v1 (all ID's match perfectly, and sdx55 is defined behind it, but still ...)
- Enabling dynamic debug on MHI parts when build as a module didn't work at all

I had to manually add this proposed patch to detect this wrong behavior

Quoted 20 lines
Quoted 19 lines

---
  drivers/bus/mhi/host/pci_generic.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mhi/host/pci_generic.c +1 -0
index 9e545f2a5a26..51e2b901bae0 100644
@@ -841,7 +841,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, 
 const struct pci_device_id *id)
       struct mhi_controller *mhi_cntrl;
       int err;
   -    dev_dbg(&pdev->dev, "MHI PCI device found: %s\n", info->name);
+    dev_info(&pdev->dev, "MHI PCI device found: %s\n", info->name);
         /* mhi_pdev.mhi_cntrl must be zero-initialized */
       mhi_pdev = devm_kzalloc(&pdev->dev, sizeof(*mhi_pdev), GFP_KERNEL);
Reviewed-by on v1 1/1
#3 lore raw
In reply to Koen Vandeputte

+ Loic

Quoted 6 lines · Koen Vandeputte

This harmless print provides a very easy way of knowing if the modem is detected properly during probing.

Promote it to an informational print so no hassle is required enabling kernel debugging info to obtain it.

Quoted 6 lines

The rationale here is that:
On a lot of low-storage embedded devices, extensive kernel debugging info is not always present as this would increase it's size to much causing partition size issues.

The justification makes sense to me.

Thanks,
Mani

Quoted 21 lines
---
 drivers/bus/mhi/host/pci_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mhi/host/pci_generic.c +1 -1
index 9e545f2a5a26..51e2b901bae0 100644
@@ -841,7 +841,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	struct mhi_controller *mhi_cntrl;
 	int err;
 
-	dev_dbg(&pdev->dev, "MHI PCI device found: %s\n", info->name);
+	dev_info(&pdev->dev, "MHI PCI device found: %s\n", info->name);
 
 	/* mhi_pdev.mhi_cntrl must be zero-initialized */
 	mhi_pdev = devm_kzalloc(&pdev->dev, sizeof(*mhi_pdev), GFP_KERNEL);
Signature · 1 line
2.34.1
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Reviewed-by
#4 lore raw
Quoted 15 lines · Manivannan Sadhasivam

+ Loic

Quoted 11 lines · Koen Vandeputte

This harmless print provides a very easy way of knowing if the modem is detected properly during probing.

Promote it to an informational print so no hassle is required enabling kernel debugging info to obtain it.

The rationale here is that:
On a lot of low-storage embedded devices, extensive kernel debugging info is not always present as this would increase it's size to much causing partition size issues.

Quoted 5 lines
Quoted 1 line

The justification makes sense to me.

Fair enough.

Quoted 28 lines

Thanks,
Mani

Quoted 18 lines
---
 drivers/bus/mhi/host/pci_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mhi/host/pci_generic.c +1 -2
index 9e545f2a5a26..51e2b901bae0 100644
@@ -841,7 +841,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
      struct mhi_controller *mhi_cntrl;
      int err;
 
-     dev_dbg(&pdev->dev, "MHI PCI device found: %s\n", info->name);
+     dev_info(&pdev->dev, "MHI PCI device found: %s\n", info->name);
 
      /* mhi_pdev.mhi_cntrl must be zero-initialized */
      mhi_pdev = devm_kzalloc(&pdev->dev, sizeof(*mhi_pdev), GFP_KERNEL);
--
Quoted 3 lines

2.34.1

--
மணிவண்ணன் சதாசிவம்

#5 lore raw
In reply to Koen Vandeputte
Quoted 6 lines · Koen Vandeputte

This harmless print provides a very easy way of knowing if the modem is detected properly during probing.

Promote it to an informational print so no hassle is required enabling kernel debugging info to obtain it.

Quoted 6 lines

The rationale here is that:
On a lot of low-storage embedded devices, extensive kernel debugging info is not always present as this would increase it's size to much causing partition size issues.

While applying this patch, checkpatch.pl complains that the email addresses mismatch.

From:/Signed-off-by: email address mismatch: 'From: Koen Vandeputte <[email protected]>' != 'Signed-off-by: Koen Vandeputte <[email protected]>'

Can you please fix it and resend?

Thanks,
Mani

Quoted 21 lines
---
 drivers/bus/mhi/host/pci_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/mhi/host/pci_generic.c +1 -1
index 9e545f2a5a26..51e2b901bae0 100644
@@ -841,7 +841,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	struct mhi_controller *mhi_cntrl;
 	int err;
 
-	dev_dbg(&pdev->dev, "MHI PCI device found: %s\n", info->name);
+	dev_info(&pdev->dev, "MHI PCI device found: %s\n", info->name);
 
 	/* mhi_pdev.mhi_cntrl must be zero-initialized */
 	mhi_pdev = devm_kzalloc(&pdev->dev, sizeof(*mhi_pdev), GFP_KERNEL);
Signature · 1 line
2.34.1
Signature · 1 line
மணிவண்ணன் சதாசிவம்