Skip to content

Commit b29900e

Browse files
Alexander Gordeevhtejun
authored andcommitted
AHCI: Make distinct names for ports in /proc/interrupts
Currently all interrupts assigned to AHCI ports show up in '/proc/interrupts' as 'ahci'. This fix adds port numbers as suffixes and hence makes the descriptions distinct. Reported-by: Jan Beulich <JBeulich@suse.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 966fbe1 commit b29900e

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎drivers/ata/ahci.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,9 +1142,11 @@ int ahci_host_activate(struct ata_host *host, int irq, unsigned int n_msis)
11421142
return rc;
11431143

11441144
for (i = 0; i < host->n_ports; i++) {
1145+
struct ahci_port_priv *pp = host->ports[i]->private_data;
1146+
11451147
rc = devm_request_threaded_irq(host->dev,
11461148
irq + i, ahci_hw_interrupt, ahci_thread_fn, IRQF_SHARED,
1147-
dev_driver_string(host->dev), host->ports[i]);
1149+
pp->irq_desc, host->ports[i]);
11481150
if (rc)
11491151
goto out_free_irqs;
11501152
}

‎drivers/ata/ahci.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ struct ahci_port_priv {
306306
int fbs_last_dev; /* save FBS.DEV of last FIS */
307307
/* enclosure management info per PM slot */
308308
struct ahci_em_priv em_priv[EM_MAX_SLOTS];
309+
char *irq_desc; /* desc in /proc/interrupts */
309310
};
310311

311312
struct ahci_host_priv {

‎drivers/ata/libahci.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,6 +2234,16 @@ static int ahci_port_start(struct ata_port *ap)
22342234
if (!pp)
22352235
return -ENOMEM;
22362236

2237+
if (ap->host->n_ports > 1) {
2238+
pp->irq_desc = devm_kzalloc(dev, 8, GFP_KERNEL);
2239+
if (!pp->irq_desc) {
2240+
devm_kfree(dev, pp);
2241+
return -ENOMEM;
2242+
}
2243+
snprintf(pp->irq_desc, 8,
2244+
"%s%d", dev_driver_string(dev), ap->port_no);
2245+
}
2246+
22372247
/* check FBS capability */
22382248
if ((hpriv->cap & HOST_CAP_FBS) && sata_pmp_supported(ap)) {
22392249
void __iomem *port_mmio = ahci_port_base(ap);

0 commit comments

Comments
 (0)