Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 22 Jan 2019 05:16:08 -0000 Received: from aserp2130.oracle.com ([141.146.126.79]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gloPu-0004q6-TW for speck@linutronix.de; Tue, 22 Jan 2019 06:16:07 +0100 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0M5EIx9061792 for ; Tue, 22 Jan 2019 05:16:00 GMT Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2q3sde9k3j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 22 Jan 2019 05:16:00 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x0M5FsK1009952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 22 Jan 2019 05:15:54 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x0M5FsFf014411 for ; Tue, 22 Jan 2019 05:15:54 GMT Date: Tue, 22 Jan 2019 00:15:54 -0500 From: Konrad Rzeszutek Wilk Subject: [MODERATED] Re: [PATCH v5 25/27] MDSv5 4 Message-ID: <20190122051554.GQ12859@char.us.oracle.com> References: <0dd2885fd306d16007f0a4d33209206731230af4.1547858934.git.ak@linux.intel.com> MIME-Version: 1.0 In-Reply-To: <0dd2885fd306d16007f0a4d33209206731230af4.1547858934.git.ak@linux.intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Fri, Jan 18, 2019 at 04:50:40PM -0800, speck for Andi Kleen wrote: > From: Andi Kleen > Subject: mds: Mark AHCI interrupt as not needing cpu clear > > AHCI interrupt handlers never touch user data with the CPU. Can you expand a bit? Asking this as folks will follow this as an example of auditing an interrupt handler - and this commit does not have much data on how you came to this conclusion. It would be helpful for other developers to know what you looked for - especially say if a bus ran you over! Thank you. > > Just to get the number of clears down on my test system. > > Signed-off-by: Andi Kleen > --- > drivers/ata/ahci.c | 2 +- > drivers/ata/ahci.h | 2 ++ > drivers/ata/libahci.c | 40 ++++++++++++++++++++++++---------------- > 3 files changed, 27 insertions(+), 17 deletions(-) > > diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c > index 021ce46e2e57..1455ad89d2f9 100644 > --- a/drivers/ata/ahci.c > +++ b/drivers/ata/ahci.c > @@ -1865,7 +1865,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) > > pci_set_master(pdev); > > - rc = ahci_host_activate(host, &ahci_sht); > + rc = ahci_host_activate_irqflags(host, &ahci_sht, IRQF_NO_USER); > if (rc) > return rc; > > diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h > index 8810475f307a..093ea1856307 100644 > --- a/drivers/ata/ahci.h > +++ b/drivers/ata/ahci.h > @@ -432,6 +432,8 @@ void ahci_set_em_messages(struct ahci_host_priv *hpriv, > int ahci_reset_em(struct ata_host *host); > void ahci_print_info(struct ata_host *host, const char *scc_s); > int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht); > +int ahci_host_activate_irqflags(struct ata_host *host, struct scsi_host_template *sht, > + int irqflags); > void ahci_error_handler(struct ata_port *ap); > u32 ahci_handle_port_intr(struct ata_host *host, u32 irq_masked); > > diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c > index b5f57c69c487..b32664c7d8a1 100644 > --- a/drivers/ata/libahci.c > +++ b/drivers/ata/libahci.c > @@ -2548,7 +2548,8 @@ void ahci_set_em_messages(struct ahci_host_priv *hpriv, > EXPORT_SYMBOL_GPL(ahci_set_em_messages); > > static int ahci_host_activate_multi_irqs(struct ata_host *host, > - struct scsi_host_template *sht) > + struct scsi_host_template *sht, > + int irqflags) > { > struct ahci_host_priv *hpriv = host->private_data; > int i, rc; > @@ -2571,7 +2572,7 @@ static int ahci_host_activate_multi_irqs(struct ata_host *host, > } > > rc = devm_request_irq(host->dev, irq, ahci_multi_irqs_intr_hard, > - 0, pp->irq_desc, host->ports[i]); > + irqflags, pp->irq_desc, host->ports[i]); > > if (rc) > return rc; > @@ -2581,18 +2582,8 @@ static int ahci_host_activate_multi_irqs(struct ata_host *host, > return ata_host_register(host, sht); > } > > -/** > - * ahci_host_activate - start AHCI host, request IRQs and register it > - * @host: target ATA host > - * @sht: scsi_host_template to use when registering the host > - * > - * LOCKING: > - * Inherited from calling layer (may sleep). > - * > - * RETURNS: > - * 0 on success, -errno otherwise. > - */ > -int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht) > +int ahci_host_activate_irqflags(struct ata_host *host, struct scsi_host_template *sht, > + int irqflags) > { > struct ahci_host_priv *hpriv = host->private_data; > int irq = hpriv->irq; > @@ -2608,15 +2599,32 @@ int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht) > return -EIO; > } > > - rc = ahci_host_activate_multi_irqs(host, sht); > + rc = ahci_host_activate_multi_irqs(host, sht, irqflags); > } else { > rc = ata_host_activate(host, irq, hpriv->irq_handler, > - IRQF_SHARED, sht); > + irqflags|IRQF_SHARED, sht); > } > > > return rc; > } > +EXPORT_SYMBOL_GPL(ahci_host_activate_irqflags); > + > +/** > + * ahci_host_activate - start AHCI host, request IRQs and register it > + * @host: target ATA host > + * @sht: scsi_host_template to use when registering the host > + * > + * LOCKING: > + * Inherited from calling layer (may sleep). > + * > + * RETURNS: > + * 0 on success, -errno otherwise. > + */ > +int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht) > +{ > + return ahci_host_activate_irqflags(host, sht, 0); > +} > EXPORT_SYMBOL_GPL(ahci_host_activate); > > MODULE_AUTHOR("Jeff Garzik"); > -- > 2.17.2