Skip to contentSkip to conversation

common: resource: print conflicts as warning

PATCH Applied Alexander Aring 2 participants 2 messages Jun 23, 2014 – Jun 24, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common: resource: print conflicts as warning

Crazy things happen if there are resource conflicts and a device probe runs dev_request_mem_region. The dev_request_mem_region returns a start pointer which is zero. The probe function doesn't check on this and probing the device on zero base address.

To debug this in debug log level there are many other outputs. This patch replace the debug print to a warning printout. A conflict should normally never happen. If there is a conflict it's much easier to see it with this patch.

---
 common/resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/resource.c +1 -1
index fe4680e..1ea2a75 100644
@@ -71,7 +71,7 @@ struct resource *__request_region(struct resource *parent,
 			goto ok;
 		if (start > r->end)
 			continue;
-		debug("%s: 0x%08llx:0x%08llx conflicts with 0x%08llx:0x%08llx\n",
+		pr_warn("%s: 0x%08llx:0x%08llx conflicts with 0x%08llx:0x%08llx\n",
 				__func__,
 				(unsigned long long)start,
 				(unsigned long long)end,
Signature · 7 lines
2.0.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 11 lines · Alexander Aring

Crazy things happen if there are resource conflicts and a device probe runs dev_request_mem_region. The dev_request_mem_region returns a start pointer which is zero. The probe function doesn't check on this and probing the device on zero base address.

To debug this in debug log level there are many other outputs. This patch replace the debug print to a warning printout. A conflict should normally never happen. If there is a conflict it's much easier to see it with this patch.

Applied, thanks

Sascha

Quoted 26 lines
---
 common/resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/resource.c +1 -1
index fe4680e..1ea2a75 100644
@@ -71,7 +71,7 @@ struct resource *__request_region(struct resource *parent,
 			goto ok;
 		if (start > r->end)
 			continue;
-		debug("%s: 0x%08llx:0x%08llx conflicts with 0x%08llx:0x%08llx\n",
+		pr_warn("%s: 0x%08llx:0x%08llx conflicts with 0x%08llx:0x%08llx\n",
 				__func__,
 				(unsigned long long)start,
 				(unsigned long long)end,
Signature · 7 lines
2.0.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox