Skip to contentSkip to conversation

ide-generic: added messages in case of PCI IDE devices

PATCH In review Luiz Carlos Ramos 3 participants 6 messages Feb 21, 2017 – Feb 28, 2017 libata

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 ide-generic: added messages in case of PCI IDE devices

Two messages are now displayed (at "warn" level) to make sure the user is aware that PCI IDE devices were detected at common addresses (0x1f0 and 0x170) and that they will not be managed by ide-generic, but rather delegated to its specific driver.

---
 drivers/ide/ide-generic.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/ide/ide-generic.c +10 -0
index ee11edcdba3170c077381d603918498d79ffa3bb..2204819ef73612deed4ebfe58c69cdadb40fa53b 100644
@@ -125,9 +125,19 @@ static int __init ide_generic_init(void)
 
 		if (primary == 0)
 			probe_mask |= 0x1;
+		else {
+			printk(KERN_WARN DRV_NAME ": PCI IDE device detected at 0x%4.4x."
+			     " ide-generic will not grab this device, delegating it to"
+			     " the driver of its specific chipset\n", 0x1f0);
+		}
 
 		if (secondary == 0)
 			probe_mask |= 0x2;
+		else {
+			printk(KERN_WARN DRV_NAME ": PCI IDE device detected at 0x%4.4x."
+			     " ide-generic will not grab this device, delegating it to"
+			     " the driver of its specific chipset\n", 0x170);
+		}
 	} else
 		printk(KERN_INFO DRV_NAME ": enforcing probing of I/O ports "
 			"upon user request\n");
Signature · 1 line
2.8.2
#1 lore raw

Hello.

Quoted 15 lines · Luiz Carlos Ramos

Two messages are now displayed (at "warn" level) to make sure the user is aware that PCI IDE devices were detected at common addresses (0x1f0 and 0x170) and that they will not be managed by ide-generic, but rather delegated to its specific driver.

---
 drivers/ide/ide-generic.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/ide/ide-generic.c +0 -0
index ee11edcdba3170c077381d603918498d79ffa3bb..2204819ef73612deed4ebfe58c69cdadb40fa53b 100644

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 128

Quoted 4 lines
drivers/ide/ide-generic.c +1 -0
@@ -125,9 +125,19 @@ static int __init ide_generic_init(void)
 
 		if (primary == 0)
 			probe_mask |= 0x1;
+		else {

CodingStyle: need {} in both *if* branches if at least one branch has them.

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 131

Quoted 3 lines
drivers/ide/ide-generic.c +3 -0
+			printk(KERN_WARN DRV_NAME ": PCI IDE device detected at 0x%4.4x."
+			     " ide-generic will not grab this device, delegating it to"
+			     " the driver of its specific chipset\n", 0x1f0);

The messages shouldn't be split -- checkpatch.pl knows about that.

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 140

Quoted 9 lines
drivers/ide/ide-generic.c +6 -0
+		}
 
 		if (secondary == 0)
 			probe_mask |= 0x2;
+		else {
+			printk(KERN_WARN DRV_NAME ": PCI IDE device detected at 0x%4.4x."
+			     " ide-generic will not grab this device, delegating it to"
+			     " the driver of its specific chipset\n", 0x170);
+		}

Same here.

[..]

MBR, Sergei

#2 lore raw
In reply to Luiz Carlos Ramos
Quoted 15 lines · Luiz Carlos Ramos

Two messages are now displayed (at "warn" level) to make sure the user is aware that PCI IDE devices were detected at common addresses (0x1f0 and 0x170) and that they will not be managed by ide-generic, but rather delegated to its specific driver.

---
 drivers/ide/ide-generic.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/ide/ide-generic.c +0 -0
index ee11edcdba3170c077381d603918498d79ffa3bb..2204819ef73612deed4ebfe58c69cdadb40fa53b 100644

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 129

Quoted 5 lines
drivers/ide/ide-generic.c +2 -0
@@ -125,9 +125,19 @@ static int __init ide_generic_init(void)
 
 		if (primary == 0)
 			probe_mask |= 0x1;
+		else {
+			printk(KERN_WARN DRV_NAME ": PCI IDE device detected at 0x%4.4x."

Also, please use pr_warn().

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 137

Quoted 8 lines
drivers/ide/ide-generic.c +5 -0
+			     " ide-generic will not grab this device, delegating it to"
+			     " the driver of its specific chipset\n", 0x1f0);
+		}
 
 		if (secondary == 0)
 			probe_mask |= 0x2;
+		else {
+			printk(KERN_WARN DRV_NAME ": PCI IDE device detected at 0x%4.4x."

Likewise.

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 143

Quoted 6 lines
drivers/ide/ide-generic.c +3 -0
+			     " ide-generic will not grab this device, delegating it to"
+			     " the driver of its specific chipset\n", 0x170);
+		}
 	} else
 		printk(KERN_INFO DRV_NAME ": enforcing probing of I/O ports "
 			"upon user request\n");

MBR, Sergei

#3 lore raw

Hello, Sergei!

I have a question or two about checkpatch.pl results below.

Quoted 18 lines · Sergei Shtylyov
Quoted 16 lines · Luiz Carlos Ramos

Two messages are now displayed (at "warn" level) to make sure the user is aware that PCI IDE devices were detected at common addresses (0x1f0 and 0x170) and that they will not be managed by ide-generic, but rather delegated to its specific driver.

---
drivers/ide/ide-generic.c | 10 ++++++++++

1 file changed, 10 insertions(+)
drivers/ide/ide-generic.c +0 -0
index ee11edcdba3170c077381d603918498d79ffa3bb..2204819ef73612deed4ebfe58c69cdadb40fa53b 100644
@@ -125,9 +125,19 @@ static int __init ide_generic_init(void)
 
Quoted 7 lines

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 129

Quoted 4 lines
drivers/ide/ide-generic.c +2 -0
 		if (primary == 0)
 			probe_mask |= 0x1;
+		else {
+			printk(KERN_WARN DRV_NAME ": PCI IDE device detected at 0x%4.4x."

Also, please use pr_warn().

This code is quite old, and it is in deep maintenance phase.

Every other message in ide-generic.c is implemented as printk(...), but to be fair, there are not so many of them.

Given that fact, would it be better to change these two ones to be inserted to pr_warn() as suggested (and then having a mix of printk() and pr_warn() in the code), or to "allow" two more printk() in the code and having checkpatck.pl complaining?

I really don't know what is better or worse. Both can be implemented, and there are a mix of advantages and disadvantages in each side.

I'd like to hear from you and colleagues about how to proceed.

Quoted 11 lines

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 137

Quoted 8 lines
drivers/ide/ide-generic.c +5 -0
+			     " ide-generic will not grab this device, delegating it to"
+			     " the driver of its specific chipset\n", 0x1f0);
+		}
 
 		if (secondary == 0)
 			probe_mask |= 0x2;
+		else {
+			printk(KERN_WARN DRV_NAME ": PCI IDE device detected at 0x%4.4x."

Likewise.

Quoted 9 lines

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 143

Quoted 6 lines
drivers/ide/ide-generic.c +3 -0
+			     " ide-generic will not grab this device, delegating it to"
+			     " the driver of its specific chipset\n", 0x170);
+		}
 	} else
 		printk(KERN_INFO DRV_NAME ": enforcing probing of I/O ports "
 			"upon user request\n");

MBR, Sergei

Best regards,

Luiz Carlos Ramos

#4 lore raw
Quoted 41 lines · Luiz Carlos Ramos

Hello, Sergei!

I have a question or two about checkpatch.pl results below.

Quoted 18 lines · Sergei Shtylyov
Quoted 16 lines · Luiz Carlos Ramos

Two messages are now displayed (at "warn" level) to make sure the user is aware that PCI IDE devices were detected at common addresses (0x1f0 and 0x170) and that they will not be managed by ide-generic, but rather delegated to its specific driver.

---
drivers/ide/ide-generic.c | 10 ++++++++++

1 file changed, 10 insertions(+)
drivers/ide/ide-generic.c +0 -0
index ee11edcdba3170c077381d603918498d79ffa3bb..2204819ef73612deed4ebfe58c69cdadb40fa53b 100644
@@ -125,9 +125,19 @@ static int __init ide_generic_init(void)
 
Quoted 7 lines

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 129

Quoted 4 lines
drivers/ide/ide-generic.c +2 -0
 		if (primary == 0)
 			probe_mask |= 0x1;
+		else {
+			printk(KERN_WARN DRV_NAME ": PCI IDE device detected at 0x%4.4x."

Also, please use pr_warn().

This code is quite old, and it is in deep maintenance phase.

Every other message in ide-generic.c is implemented as printk(...), but to be fair, there are not so many of them.

Given that fact, would it be better to change these two ones to be inserted to pr_warn() as suggested (and then having a mix of printk() and pr_warn() in the code), or to "allow" two more printk() in the code and having checkpatck.pl complaining?

Quoted 4 lines

I really don't know what is better or worse. Both can be implemented, and there are a mix of advantages and disadvantages in each side.

I'd like to hear from you and colleagues about how to proceed.

Well, I vote for allowing two more printk() and leaving the old code as it is.

Quoted 21 lines
Quoted 11 lines

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 137

Quoted 8 lines
drivers/ide/ide-generic.c +5 -0
+			     " ide-generic will not grab this device, delegating it to"
+			     " the driver of its specific chipset\n", 0x1f0);
+		}
 
 		if (secondary == 0)
 			probe_mask |= 0x2;
+		else {
+			printk(KERN_WARN DRV_NAME ": PCI IDE device detected at 0x%4.4x."

Likewise.

Quoted 9 lines

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 143

Quoted 6 lines
drivers/ide/ide-generic.c +3 -0
+			     " ide-generic will not grab this device, delegating it to"
+			     " the driver of its specific chipset\n", 0x170);
+		}
 	} else
 		printk(KERN_INFO DRV_NAME ": enforcing probing of I/O ports "
 			"upon user request\n");

MBR, Sergei

Quoted 3 lines

Best regards,

Luiz Carlos Ramos

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

#5 lore raw
In reply to Luiz Carlos Ramos
Quoted 36 lines · Luiz Carlos Ramos
Quoted 18 lines · Luiz Carlos Ramos
Quoted 17 lines

Two messages are now displayed (at "warn" level) to make sure the user is aware that PCI IDE devices were detected at common addresses (0x1f0 and 0x170) and that they will not be managed by ide-generic, but rather delegated to its specific driver.

---
drivers/ide/ide-generic.c | 10 ++++++++++

1 file changed, 10 insertions(+)
drivers/ide/ide-generic.c +0 -0
index ee11edcdba3170c077381d603918498d79ffa3bb..2204819ef73612deed4ebfe58c69cdadb40fa53b 100644
@@ -125,9 +125,19 @@ static int __init ide_generic_init(void)
 
Quoted 7 lines

drivers/ide/ide-generic.c static int __init ide_generic_init(void) · line 129

Quoted 4 lines
drivers/ide/ide-generic.c +2 -0
 		if (primary == 0)
 			probe_mask |= 0x1;
+		else {
+			printk(KERN_WARN DRV_NAME ": PCI IDE device detected at 0x%4.4x."

Also, please use pr_warn().

This code is quite old, and it is in deep maintenance phase.

Every other message in ide-generic.c is implemented as printk(...), but to be fair, there are not so many of them.

Given that fact, would it be better to change these two ones to be inserted to pr_warn() as suggested (and then having a mix of printk() and pr_warn() in the code), or to "allow" two more printk() in the code and having checkpatck.pl complaining?

Quoted 4 lines

I really don't know what is better or worse. Both can be implemented, and there are a mix of advantages and disadvantages in each side.

I'd like to hear from you and colleagues about how to proceed.

I'd prefer a checkpatch-clean patch. Though I don't think DaveM would take
further cleanups (printk -> pr_<foo>).

MBR, Sergei