Skip to contentSkip to conversation

usb: musb: musb_cppi41: Update an error message

PATCH Applied Alexandre Bailon 3 participants 4 messages May 5, 2017 – May 11, 2017 1 message not in the archive

Subsystems (2)

v2 of 3 Applied Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb: musb: musb_cppi41: Update an error message

If dma_request_slave_channel() failed to return a channel, then the driver will print an error and request to defer probe, regardless of the cause of the failure.
Only defer if the DMA is not ready yet and print an error to explain that we are deferring probe.

---
 drivers/usb/musb/musb_cppi41.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/usb/musb/musb_cppi41.c +6 -4
index e7c8b1b..4718d0d 100644
@@ -673,10 +673,12 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller)
 		musb_dma->status = MUSB_DMA_STATUS_FREE;
 		musb_dma->max_len = SZ_4M;
 
-		dc = dma_request_slave_channel(dev->parent, str);
-		if (!dc) {
-			dev_err(dev, "Failed to request %s.\n", str);
-			ret = -EPROBE_DEFER;
+		dc = dma_request_chan(dev->parent, str);
+		if (IS_ERR(dc)) {
+			ret = PTR_ERR(dc);
+			dev_err(dev, "Failed to request %s%s.\n", str,
+				ret == -EPROBE_DEFER
+				? ", deferring probe" : "");
 			goto err;
 		}
 		cppi41_channel->dc = dc;
Signature · 6 lines
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170505125233.27015-1-abailon-rdvid1DuHRBWk0Htik3J/[email protected]

Applied
#2 lore raw
Quoted 7 lines · Alexandre Bailon

If dma_request_slave_channel() failed to return a channel, then the driver will print an error and request to defer probe, regardless of the cause of the failure.
Only defer if the DMA is not ready yet and print an error to explain that we are deferring probe.

Applied. Thanks.
-Bin.

Quoted 32 lines
---
 drivers/usb/musb/musb_cppi41.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/usb/musb/musb_cppi41.c +6 -4
index e7c8b1b..4718d0d 100644
@@ -673,10 +673,12 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller)
 		musb_dma->status = MUSB_DMA_STATUS_FREE;
 		musb_dma->max_len = SZ_4M;
 
-		dc = dma_request_slave_channel(dev->parent, str);
-		if (!dc) {
-			dev_err(dev, "Failed to request %s.\n", str);
-			ret = -EPROBE_DEFER;
+		dc = dma_request_chan(dev->parent, str);
+		if (IS_ERR(dc)) {
+			ret = PTR_ERR(dc);
+			dev_err(dev, "Failed to request %s%s.\n", str,
+				ret == -EPROBE_DEFER
+				? ", deferring probe" : "");
 			goto err;
 		}
 		cppi41_channel->dc = dc;
Signature · 6 lines
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 23 lines · Bin Liu
Quoted 7 lines · Alexandre Bailon

If dma_request_slave_channel() failed to return a channel, then the driver will print an error and request to defer probe, regardless of the cause of the failure.
Only defer if the DMA is not ready yet and print an error to explain that we are deferring probe.

Applied. Thanks.

Quoted 12 lines
---
 drivers/usb/musb/musb_cppi41.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/usb/musb/musb_cppi41.c +0 -0
index e7c8b1b..4718d0d 100644
@@ -673,10 +673,12 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller)
 		musb_dma->status = MUSB_DMA_STATUS_FREE;
 		musb_dma->max_len = SZ_4M;
 
Quoted 10 lines

drivers/usb/musb/musb_cppi41.c static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller) · line 681

Quoted 10 lines
drivers/usb/musb/musb_cppi41.c +6 -4
-		dc = dma_request_slave_channel(dev->parent, str);
-		if (!dc) {
-			dev_err(dev, "Failed to request %s.\n", str);
-			ret = -EPROBE_DEFER;
+		dc = dma_request_chan(dev->parent, str);
+		if (IS_ERR(dc)) {
+			ret = PTR_ERR(dc);
+			dev_err(dev, "Failed to request %s%s.\n", str,
+				ret == -EPROBE_DEFER
+				? ", deferring probe" : "");

Probe deferral is not really an error, and we typically suppress any error messages otherwise printed when a subsystem requests it to avoid noise during boot. (There is a debug statement in driver core that anyone interested can enable instead).

Quoted 2 lines

drivers/usb/musb/musb_cppi41.c static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller) · line 683

Quoted 2 lines
drivers/usb/musb/musb_cppi41.c +0 -0
 			goto err;
 		}

So this should really be

	if (IS_ERR(DC)) {
		ret = PTR_ERR(dc);
		if (ret != -EPROBE_DEFER)
			dev_err(dev, ...);
		goto err;
	}

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 24 lines · Johan Hovold
Quoted 23 lines · Bin Liu
Quoted 7 lines · Alexandre Bailon

If dma_request_slave_channel() failed to return a channel, then the driver will print an error and request to defer probe, regardless of the cause of the failure.
Only defer if the DMA is not ready yet and print an error to explain that we are deferring probe.

Applied. Thanks.

Quoted 12 lines
---
 drivers/usb/musb/musb_cppi41.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/usb/musb/musb_cppi41.c +0 -0
index e7c8b1b..4718d0d 100644
@@ -673,10 +673,12 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller)
 		musb_dma->status = MUSB_DMA_STATUS_FREE;
 		musb_dma->max_len = SZ_4M;
 
Quoted 14 lines
Quoted 10 lines

drivers/usb/musb/musb_cppi41.c static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller) · line 681

Quoted 10 lines
drivers/usb/musb/musb_cppi41.c +6 -4
-		dc = dma_request_slave_channel(dev->parent, str);
-		if (!dc) {
-			dev_err(dev, "Failed to request %s.\n", str);
-			ret = -EPROBE_DEFER;
+		dc = dma_request_chan(dev->parent, str);
+		if (IS_ERR(dc)) {
+			ret = PTR_ERR(dc);
+			dev_err(dev, "Failed to request %s%s.\n", str,
+				ret == -EPROBE_DEFER
+				? ", deferring probe" : "");

Probe deferral is not really an error, and we typically suppress any error messages otherwise printed when a subsystem requests it to avoid noise during boot. (There is a debug statement in driver core that

Valid point, the deferral log shouldn't use the error level. So dropped this patch from my tree.

Quoted 5 lines

anyone interested can enable instead).

Quoted 2 lines

drivers/usb/musb/musb_cppi41.c static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller) · line 683

Quoted 2 lines
drivers/usb/musb/musb_cppi41.c +0 -0
 			goto err;
 		}
Quoted 8 lines

So this should really be

	if (IS_ERR(DC)) {
		ret = PTR_ERR(dc);
		if (ret != -EPROBE_DEFER)
			dev_err(dev, ...);
		goto err;
	}

Regards,
-Bin.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html