libata: remove ata_sff_data_xfer_noirq()
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 11 Jul 2018 15:21:05 +0000 (17:21 +0200)
committerTejun Heo <tj@kernel.org>
Wed, 11 Jul 2018 17:45:28 +0000 (10:45 -0700)
ata_sff_data_xfer_noirq() is invoked via the ->sff_data_xfer hook. The
latter is invoked by ata_pio_sector(), atapi_send_cdb() and
__atapi_pio_bytes() which in turn is invoked by ata_sff_hsm_move().
The latter function requires that the "ap->lock" lock is held which
needs to be taken with disabled interrupts.

There is no need have to have ata_sff_data_xfer_noirq() which invokes
ata_sff_data_xfer32() with disabled interrupts because at this point the
interrupts are already disabled.
Remove the function and its references to it and replace all callers
with ata_sff_data_xfer32().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Tejun Heo <tj@kernel.org>
Documentation/driver-api/libata.rst
drivers/ata/libata-sff.c
drivers/ata/pata_cmd640.c
drivers/ata/pata_icside.c
drivers/ata/pata_imx.c
drivers/ata/pata_legacy.c
drivers/ata/pata_palmld.c
drivers/ata/pata_pcmcia.c
drivers/ata/pata_platform.c
drivers/ata/pata_via.c
include/linux/libata.h

index 4adc056f763565f415f3c5ec82fa5a0b9eec01fc..70e180e6b93dcc74d25fb6133bfaeb018166b870 100644 (file)
@@ -118,8 +118,7 @@ PIO data read/write
 All bmdma-style drivers must implement this hook. This is the low-level
 operation that actually copies the data bytes during a PIO data
 transfer. Typically the driver will choose one of
-:c:func:`ata_sff_data_xfer_noirq`, :c:func:`ata_sff_data_xfer`, or
-:c:func:`ata_sff_data_xfer32`.
+:c:func:`ata_sff_data_xfer`, or :c:func:`ata_sff_data_xfer32`.
 
 ATA command execute
 ~~~~~~~~~~~~~~~~~~~
index cc2f2e35f4c2e4ee49a67ef8df5da34cfb182a4e..c5ea0fc635e54eb800cb12d8812ea5e508c388cc 100644 (file)
@@ -657,36 +657,6 @@ unsigned int ata_sff_data_xfer32(struct ata_queued_cmd *qc, unsigned char *buf,
 }
 EXPORT_SYMBOL_GPL(ata_sff_data_xfer32);
 
-/**
- *     ata_sff_data_xfer_noirq - Transfer data by PIO
- *     @qc: queued command
- *     @buf: data buffer
- *     @buflen: buffer length
- *     @rw: read/write
- *
- *     Transfer data from/to the device data register by PIO. Do the
- *     transfer with interrupts disabled.
- *
- *     LOCKING:
- *     Inherited from caller.
- *
- *     RETURNS:
- *     Bytes consumed.
- */
-unsigned int ata_sff_data_xfer_noirq(struct ata_queued_cmd *qc, unsigned char *buf,
-                                    unsigned int buflen, int rw)
-{
-       unsigned long flags;
-       unsigned int consumed;
-
-       local_irq_save(flags);
-       consumed = ata_sff_data_xfer32(qc, buf, buflen, rw);
-       local_irq_restore(flags);
-
-       return consumed;
-}
-EXPORT_SYMBOL_GPL(ata_sff_data_xfer_noirq);
-
 /**
  *     ata_pio_sector - Transfer a sector of data.
  *     @qc: Command on going
index c47caa807fa933d370e91720ca99df253216c803..e3532eda7b058d41a16500c9b6d6dc7a0d6b1059 100644 (file)
@@ -178,7 +178,7 @@ static struct scsi_host_template cmd640_sht = {
 static struct ata_port_operations cmd640_port_ops = {
        .inherits       = &ata_sff_port_ops,
        /* In theory xfer_noirq is not needed once we kill the prefetcher */
-       .sff_data_xfer  = ata_sff_data_xfer_noirq,
+       .sff_data_xfer  = ata_sff_data_xfer32,
        .sff_irq_check  = cmd640_sff_irq_check,
        .qc_issue       = cmd640_qc_issue,
        .cable_detect   = ata_cable_40wire,
index 188f2f2eb21fe54ad5b62675864cb97ea31f9c32..c272f2cbb47c5872fae9d17a29ff7bfe0d79e48f 100644 (file)
@@ -324,7 +324,7 @@ static struct ata_port_operations pata_icside_port_ops = {
        .inherits               = &ata_bmdma_port_ops,
        /* no need to build any PRD tables for DMA */
        .qc_prep                = ata_noop_qc_prep,
-       .sff_data_xfer          = ata_sff_data_xfer_noirq,
+       .sff_data_xfer          = ata_sff_data_xfer32,
        .bmdma_setup            = pata_icside_bmdma_setup,
        .bmdma_start            = pata_icside_bmdma_start,
        .bmdma_stop             = pata_icside_bmdma_stop,
index d4caa23f5a88dd6c828afa84e9dca809b423874f..108101325efdf8b8e04927c73bfb96b39c371a38 100644 (file)
@@ -102,7 +102,7 @@ static struct scsi_host_template pata_imx_sht = {
 
 static struct ata_port_operations pata_imx_port_ops = {
        .inherits               = &ata_sff_port_ops,
-       .sff_data_xfer          = ata_sff_data_xfer_noirq,
+       .sff_data_xfer          = ata_sff_data_xfer32,
        .cable_detect           = ata_cable_unknown,
        .set_piomode            = pata_imx_set_piomode,
 };
index 53828b6c30441735b62a36103d42d67df58794b6..8ea4b8431fc822855f79ad2853b1ab4832ec6da4 100644 (file)
@@ -246,12 +246,12 @@ static const struct ata_port_operations legacy_base_port_ops = {
 
 static struct ata_port_operations simple_port_ops = {
        .inherits       = &legacy_base_port_ops,
-       .sff_data_xfer  = ata_sff_data_xfer_noirq,
+       .sff_data_xfer  = ata_sff_data_xfer32,
 };
 
 static struct ata_port_operations legacy_port_ops = {
        .inherits       = &legacy_base_port_ops,
-       .sff_data_xfer  = ata_sff_data_xfer_noirq,
+       .sff_data_xfer  = ata_sff_data_xfer32,
        .set_mode       = legacy_set_mode,
 };
 
@@ -341,7 +341,7 @@ static unsigned int pdc_data_xfer_vlb(struct ata_queued_cmd *qc,
                }
                local_irq_restore(flags);
        } else
-               buflen = ata_sff_data_xfer_noirq(qc, buf, buflen, rw);
+               buflen = ata_sff_data_xfer32(qc, buf, buflen, rw);
 
        return buflen;
 }
index 8c0d7d736b7afd81b1146536527efc3b46bab42e..d071ab6864a8a82cafd2befcfefbfaba93952dd8 100644 (file)
@@ -44,7 +44,7 @@ static struct scsi_host_template palmld_sht = {
 
 static struct ata_port_operations palmld_port_ops = {
        .inherits               = &ata_sff_port_ops,
-       .sff_data_xfer          = ata_sff_data_xfer_noirq,
+       .sff_data_xfer          = ata_sff_data_xfer32,
        .cable_detect           = ata_cable_40wire,
 };
 
index a541eacc5e95c3278598c4b849146280b1f6cc87..9b0e6c72e3f96c3cf55a7cc438c25f20b2f8ba6d 100644 (file)
@@ -151,7 +151,7 @@ static struct scsi_host_template pcmcia_sht = {
 
 static struct ata_port_operations pcmcia_port_ops = {
        .inherits       = &ata_sff_port_ops,
-       .sff_data_xfer  = ata_sff_data_xfer_noirq,
+       .sff_data_xfer  = ata_sff_data_xfer32,
        .cable_detect   = ata_cable_40wire,
        .set_mode       = pcmcia_set_mode,
 };
index c503ded87bb88a341cb0c2d1f9e22e0fb9ddd60f..d6f8f540644243fa8accf10b59e145982295b10b 100644 (file)
@@ -49,7 +49,7 @@ static struct scsi_host_template pata_platform_sht = {
 
 static struct ata_port_operations pata_platform_port_ops = {
        .inherits               = &ata_sff_port_ops,
-       .sff_data_xfer          = ata_sff_data_xfer_noirq,
+       .sff_data_xfer          = ata_sff_data_xfer32,
        .cable_detect           = ata_cable_unknown,
        .set_mode               = pata_platform_set_mode,
 };
index 1ca6bcab369f015dffc43718b985d58717eabce5..fd19f1ce83aa16dffd2e23cb6e8d9ae54c2129b7 100644 (file)
@@ -471,7 +471,7 @@ static struct ata_port_operations via_port_ops = {
 
 static struct ata_port_operations via_port_ops_noirq = {
        .inherits       = &via_port_ops,
-       .sff_data_xfer  = ata_sff_data_xfer_noirq,
+       .sff_data_xfer  = ata_sff_data_xfer32,
 };
 
 /**
index 8b8946dd63b9d4df3d08c5051604fce0fc147be1..aa8583655a18894cef5d77416fcb779b0d1c2489 100644 (file)
@@ -1832,8 +1832,6 @@ extern unsigned int ata_sff_data_xfer(struct ata_queued_cmd *qc,
                        unsigned char *buf, unsigned int buflen, int rw);
 extern unsigned int ata_sff_data_xfer32(struct ata_queued_cmd *qc,
                        unsigned char *buf, unsigned int buflen, int rw);
-extern unsigned int ata_sff_data_xfer_noirq(struct ata_queued_cmd *qc,
-                       unsigned char *buf, unsigned int buflen, int rw);
 extern void ata_sff_irq_on(struct ata_port *ap);
 extern void ata_sff_irq_clear(struct ata_port *ap);
 extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,