Skip to contentSkip to conversation

ata: core: fix irq description on AHCI single irq systems

PATCH Applied Heiner Kallweit 3 participants 3 messages Dec 6, 2015 – Dec 7, 2015 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ata: core: fix irq description on AHCI single irq systems

On my machine with single irq AHCI just the PCI id is printed as description in /proc/interrupts.
I found a related discussion from beginning of this year:
http://www.gossamer-threads.com/lists/linux/kernel/2117335

Seems like commit commit 4f37b504768c952b64bc9469a2d579c7597590f2 tried to fix displaying a proper interrupt description for one scenario but broke it for another one.

The mentioned discussion ended in the current situation being considered as broken but w/o a patch to fix it.

The following patch is based on a proposal in this mail thread. Now the interrupt is properly described as:
PCI-MSI 512000-edge ahci[0000:00:1f.2]

By combining both values also the scenario that commit 4f37b504768c952b64bc9469a2d579c7597590f2 refers to should still be fine. There it should look like this now:
ahci[20100000.ide]

Using managed memory allocation ensures that the irq description lives at least as long as the interrupt.

---
 drivers/ata/libata-core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/ata/libata-core.c +8 -1
index b79cb10..1004155 100644
@@ -6223,6 +6223,7 @@ int ata_host_activate(struct ata_host *host, int irq,
 		      struct scsi_host_template *sht)
 {
 	int i, rc;
+	char *irq_desc;
 
 	rc = ata_host_start(host);
 	if (rc)
@@ -6234,8 +6235,14 @@ int ata_host_activate(struct ata_host *host, int irq,
 		return ata_host_register(host, sht);
 	}
 
+	irq_desc = devm_kasprintf(host->dev, GFP_KERNEL, "%s[%s]",
+				  dev_driver_string(host->dev),
+				  dev_name(host->dev));
+	if (!irq_desc)
+		return -ENOMEM;
+
 	rc = devm_request_irq(host->dev, irq, irq_handler, irq_flags,
-			      dev_name(host->dev), host);
+			      irq_desc, host);
 	if (rc)
 		return rc;
 
Signature · 1 line
2.6.3
#1 lore raw

Hello.

Quoted 6 lines · Heiner Kallweit

On my machine with single irq AHCI just the PCI id is printed as description in /proc/interrupts.
I found a related discussion from beginning of this year:
http://www.gossamer-threads.com/lists/linux/kernel/2117335

Seems like commit commit 4f37b504768c952b64bc9469a2d579c7597590f2

                    ^^^^^^ one is enough :-)

And scripts/checkpatch.pl now rnofrces certain format for the commit citing.

Quoted 6 lines

tried to fix displaying a proper interrupt description for one scenario but broke it for another one.

The mentioned discussion ended in the current situation being considered as broken but w/o a patch to fix it.

Quoted 8 lines

The following patch is based on a proposal in this mail thread. Now the interrupt is properly described as:
PCI-MSI 512000-edge ahci[0000:00:1f.2]

By combining both values also the scenario that commit 4f37b504768c952b64bc9469a2d579c7597590f2 refers to should still be fine. There it should look like this now:
ahci[20100000.ide]

s/ide/sata/?

Quoted 4 lines

Using managed memory allocation ensures that the irq description lives at least as long as the interrupt.

[...]

MBR, Sergei

Applied
#2 lore raw
In reply to Heiner Kallweit
Quoted 21 lines · Heiner Kallweit

On my machine with single irq AHCI just the PCI id is printed as description in /proc/interrupts.
I found a related discussion from beginning of this year:
http://www.gossamer-threads.com/lists/linux/kernel/2117335

Seems like commit commit 4f37b504768c952b64bc9469a2d579c7597590f2 tried to fix displaying a proper interrupt description for one scenario but broke it for another one.

The mentioned discussion ended in the current situation being considered as broken but w/o a patch to fix it.

The following patch is based on a proposal in this mail thread. Now the interrupt is properly described as:
PCI-MSI 512000-edge ahci[0000:00:1f.2]

By combining both values also the scenario that commit 4f37b504768c952b64bc9469a2d579c7597590f2 refers to should still be fine. There it should look like this now:
ahci[20100000.ide]

Quoted 4 lines

Using managed memory allocation ensures that the irq description lives at least as long as the interrupt.

Applied to libata/for-4.5 w/ commit refs fixed.

Thanks.

Signature · 1 line
tejun