Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libata: remove ata_sff_data_xfer_noirq()

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>

authored by

Sebastian Andrzej Siewior and committed by
Tejun Heo
23ebda2f aece27a2

+11 -44
+1 -2
Documentation/driver-api/libata.rst
··· 118 118 All bmdma-style drivers must implement this hook. This is the low-level 119 119 operation that actually copies the data bytes during a PIO data 120 120 transfer. Typically the driver will choose one of 121 - :c:func:`ata_sff_data_xfer_noirq`, :c:func:`ata_sff_data_xfer`, or 122 - :c:func:`ata_sff_data_xfer32`. 121 + :c:func:`ata_sff_data_xfer`, or :c:func:`ata_sff_data_xfer32`. 123 122 124 123 ATA command execute 125 124 ~~~~~~~~~~~~~~~~~~~
-30
drivers/ata/libata-sff.c
··· 658 658 EXPORT_SYMBOL_GPL(ata_sff_data_xfer32); 659 659 660 660 /** 661 - * ata_sff_data_xfer_noirq - Transfer data by PIO 662 - * @qc: queued command 663 - * @buf: data buffer 664 - * @buflen: buffer length 665 - * @rw: read/write 666 - * 667 - * Transfer data from/to the device data register by PIO. Do the 668 - * transfer with interrupts disabled. 669 - * 670 - * LOCKING: 671 - * Inherited from caller. 672 - * 673 - * RETURNS: 674 - * Bytes consumed. 675 - */ 676 - unsigned int ata_sff_data_xfer_noirq(struct ata_queued_cmd *qc, unsigned char *buf, 677 - unsigned int buflen, int rw) 678 - { 679 - unsigned long flags; 680 - unsigned int consumed; 681 - 682 - local_irq_save(flags); 683 - consumed = ata_sff_data_xfer32(qc, buf, buflen, rw); 684 - local_irq_restore(flags); 685 - 686 - return consumed; 687 - } 688 - EXPORT_SYMBOL_GPL(ata_sff_data_xfer_noirq); 689 - 690 - /** 691 661 * ata_pio_sector - Transfer a sector of data. 692 662 * @qc: Command on going 693 663 *
+1 -1
drivers/ata/pata_cmd640.c
··· 178 178 static struct ata_port_operations cmd640_port_ops = { 179 179 .inherits = &ata_sff_port_ops, 180 180 /* In theory xfer_noirq is not needed once we kill the prefetcher */ 181 - .sff_data_xfer = ata_sff_data_xfer_noirq, 181 + .sff_data_xfer = ata_sff_data_xfer32, 182 182 .sff_irq_check = cmd640_sff_irq_check, 183 183 .qc_issue = cmd640_qc_issue, 184 184 .cable_detect = ata_cable_40wire,
+1 -1
drivers/ata/pata_icside.c
··· 324 324 .inherits = &ata_bmdma_port_ops, 325 325 /* no need to build any PRD tables for DMA */ 326 326 .qc_prep = ata_noop_qc_prep, 327 - .sff_data_xfer = ata_sff_data_xfer_noirq, 327 + .sff_data_xfer = ata_sff_data_xfer32, 328 328 .bmdma_setup = pata_icside_bmdma_setup, 329 329 .bmdma_start = pata_icside_bmdma_start, 330 330 .bmdma_stop = pata_icside_bmdma_stop,
+1 -1
drivers/ata/pata_imx.c
··· 102 102 103 103 static struct ata_port_operations pata_imx_port_ops = { 104 104 .inherits = &ata_sff_port_ops, 105 - .sff_data_xfer = ata_sff_data_xfer_noirq, 105 + .sff_data_xfer = ata_sff_data_xfer32, 106 106 .cable_detect = ata_cable_unknown, 107 107 .set_piomode = pata_imx_set_piomode, 108 108 };
+3 -3
drivers/ata/pata_legacy.c
··· 246 246 247 247 static struct ata_port_operations simple_port_ops = { 248 248 .inherits = &legacy_base_port_ops, 249 - .sff_data_xfer = ata_sff_data_xfer_noirq, 249 + .sff_data_xfer = ata_sff_data_xfer32, 250 250 }; 251 251 252 252 static struct ata_port_operations legacy_port_ops = { 253 253 .inherits = &legacy_base_port_ops, 254 - .sff_data_xfer = ata_sff_data_xfer_noirq, 254 + .sff_data_xfer = ata_sff_data_xfer32, 255 255 .set_mode = legacy_set_mode, 256 256 }; 257 257 ··· 341 341 } 342 342 local_irq_restore(flags); 343 343 } else 344 - buflen = ata_sff_data_xfer_noirq(qc, buf, buflen, rw); 344 + buflen = ata_sff_data_xfer32(qc, buf, buflen, rw); 345 345 346 346 return buflen; 347 347 }
+1 -1
drivers/ata/pata_palmld.c
··· 44 44 45 45 static struct ata_port_operations palmld_port_ops = { 46 46 .inherits = &ata_sff_port_ops, 47 - .sff_data_xfer = ata_sff_data_xfer_noirq, 47 + .sff_data_xfer = ata_sff_data_xfer32, 48 48 .cable_detect = ata_cable_40wire, 49 49 }; 50 50
+1 -1
drivers/ata/pata_pcmcia.c
··· 151 151 152 152 static struct ata_port_operations pcmcia_port_ops = { 153 153 .inherits = &ata_sff_port_ops, 154 - .sff_data_xfer = ata_sff_data_xfer_noirq, 154 + .sff_data_xfer = ata_sff_data_xfer32, 155 155 .cable_detect = ata_cable_40wire, 156 156 .set_mode = pcmcia_set_mode, 157 157 };
+1 -1
drivers/ata/pata_platform.c
··· 49 49 50 50 static struct ata_port_operations pata_platform_port_ops = { 51 51 .inherits = &ata_sff_port_ops, 52 - .sff_data_xfer = ata_sff_data_xfer_noirq, 52 + .sff_data_xfer = ata_sff_data_xfer32, 53 53 .cable_detect = ata_cable_unknown, 54 54 .set_mode = pata_platform_set_mode, 55 55 };
+1 -1
drivers/ata/pata_via.c
··· 471 471 472 472 static struct ata_port_operations via_port_ops_noirq = { 473 473 .inherits = &via_port_ops, 474 - .sff_data_xfer = ata_sff_data_xfer_noirq, 474 + .sff_data_xfer = ata_sff_data_xfer32, 475 475 }; 476 476 477 477 /**
-2
include/linux/libata.h
··· 1832 1832 unsigned char *buf, unsigned int buflen, int rw); 1833 1833 extern unsigned int ata_sff_data_xfer32(struct ata_queued_cmd *qc, 1834 1834 unsigned char *buf, unsigned int buflen, int rw); 1835 - extern unsigned int ata_sff_data_xfer_noirq(struct ata_queued_cmd *qc, 1836 - unsigned char *buf, unsigned int buflen, int rw); 1837 1835 extern void ata_sff_irq_on(struct ata_port *ap); 1838 1836 extern void ata_sff_irq_clear(struct ata_port *ap); 1839 1837 extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,