Skip to content

Commit f6c5971

Browse files
committed
Merge tag 'libata-5.14-2021-07-30' of git://git.kernel.dk/linux-block
Pull libata fixlets from Jens Axboe: - A fix for PIO highmem (Christoph) - Kill HAVE_IDE as it's now unused (Lukas) * tag 'libata-5.14-2021-07-30' of git://git.kernel.dk/linux-block: arch: Kconfig: clean up obsolete use of HAVE_IDE libata: fix ata_pio_sector for CONFIG_HIGHMEM
2 parents 051df24 + 094121e commit f6c5971

File tree

14 files changed

+27
-26
lines changed

14 files changed

+27
-26
lines changed

arch/alpha/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ config ALPHA
1414
select PCI_SYSCALL if PCI
1515
select HAVE_AOUT
1616
select HAVE_ASM_MODVERSIONS
17-
select HAVE_IDE
1817
select HAVE_PCSPKR_PLATFORM
1918
select HAVE_PERF_EVENTS
2019
select NEED_DMA_MAP_STATE

arch/arm/Kconfig

-6
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ config ARM
9595
select HAVE_FUNCTION_TRACER if !XIP_KERNEL
9696
select HAVE_GCC_PLUGINS
9797
select HAVE_HW_BREAKPOINT if PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)
98-
select HAVE_IDE if PCI || ISA || PCMCIA
9998
select HAVE_IRQ_TIME_ACCOUNTING
10099
select HAVE_KERNEL_GZIP
101100
select HAVE_KERNEL_LZ4
@@ -361,7 +360,6 @@ config ARCH_FOOTBRIDGE
361360
bool "FootBridge"
362361
select CPU_SA110
363362
select FOOTBRIDGE
364-
select HAVE_IDE
365363
select NEED_MACH_IO_H if !MMU
366364
select NEED_MACH_MEMORY_H
367365
help
@@ -430,7 +428,6 @@ config ARCH_PXA
430428
select GENERIC_IRQ_MULTI_HANDLER
431429
select GPIO_PXA
432430
select GPIOLIB
433-
select HAVE_IDE
434431
select IRQ_DOMAIN
435432
select PLAT_PXA
436433
select SPARSE_IRQ
@@ -446,7 +443,6 @@ config ARCH_RPC
446443
select ARM_HAS_SG_CHAIN
447444
select CPU_SA110
448445
select FIQ
449-
select HAVE_IDE
450446
select HAVE_PATA_PLATFORM
451447
select ISA_DMA_API
452448
select LEGACY_TIMER_TICK
@@ -469,7 +465,6 @@ config ARCH_SA1100
469465
select CPU_SA1100
470466
select GENERIC_IRQ_MULTI_HANDLER
471467
select GPIOLIB
472-
select HAVE_IDE
473468
select IRQ_DOMAIN
474469
select ISA
475470
select NEED_MACH_MEMORY_H
@@ -505,7 +500,6 @@ config ARCH_OMAP1
505500
select GENERIC_IRQ_CHIP
506501
select GENERIC_IRQ_MULTI_HANDLER
507502
select GPIOLIB
508-
select HAVE_IDE
509503
select HAVE_LEGACY_CLK
510504
select IRQ_DOMAIN
511505
select NEED_MACH_IO_H if PCCARD

arch/arm/mach-davinci/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ menuconfig ARCH_DAVINCI
99
select PM_GENERIC_DOMAINS_OF if PM && OF
1010
select REGMAP_MMIO
1111
select RESET_CONTROLLER
12-
select HAVE_IDE
1312
select PINCTRL_SINGLE
1413

1514
if ARCH_DAVINCI

arch/h8300/Kconfig.cpu

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ config H8300_H8MAX
4444
bool "H8MAX"
4545
select H83069
4646
select RAMKERNEL
47-
select HAVE_IDE
4847
help
4948
H8MAX Evaluation Board Support
5049
More Information. (Japanese Only)

arch/ia64/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ config IA64
2525
select HAVE_ASM_MODVERSIONS
2626
select HAVE_UNSTABLE_SCHED_CLOCK
2727
select HAVE_EXIT_THREAD
28-
select HAVE_IDE
2928
select HAVE_KPROBES
3029
select HAVE_KRETPROBES
3130
select HAVE_FTRACE_MCOUNT_RECORD

arch/m68k/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ config M68K
2323
select HAVE_DEBUG_BUGVERBOSE
2424
select HAVE_EFFICIENT_UNALIGNED_ACCESS if !CPU_HAS_NO_UNALIGNED
2525
select HAVE_FUTEX_CMPXCHG if MMU && FUTEX
26-
select HAVE_IDE
2726
select HAVE_MOD_ARCH_SPECIFIC
2827
select HAVE_UID16
2928
select MMU_GATHER_NO_RANGE if MMU

arch/mips/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ config MIPS
7171
select HAVE_FUNCTION_TRACER
7272
select HAVE_GCC_PLUGINS
7373
select HAVE_GENERIC_VDSO
74-
select HAVE_IDE
7574
select HAVE_IOREMAP_PROT
7675
select HAVE_IRQ_EXIT_ON_IRQ_STACK
7776
select HAVE_IRQ_TIME_ACCOUNTING

arch/parisc/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ config PARISC
33
def_bool y
44
select ARCH_32BIT_OFF_T if !64BIT
55
select ARCH_MIGHT_HAVE_PC_PARPORT
6-
select HAVE_IDE
76
select HAVE_FUNCTION_TRACER
87
select HAVE_FUNCTION_GRAPH_TRACER
98
select HAVE_SYSCALL_TRACEPOINTS

arch/powerpc/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ config PPC
220220
select HAVE_HARDLOCKUP_DETECTOR_ARCH if PPC_BOOK3S_64 && SMP
221221
select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI && !HAVE_HARDLOCKUP_DETECTOR_ARCH
222222
select HAVE_HW_BREAKPOINT if PERF_EVENTS && (PPC_BOOK3S || PPC_8xx)
223-
select HAVE_IDE
224223
select HAVE_IOREMAP_PROT
225224
select HAVE_IRQ_EXIT_ON_IRQ_STACK
226225
select HAVE_IRQ_TIME_ACCOUNTING

arch/sh/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ config SUPERH
3939
select HAVE_FUTEX_CMPXCHG if FUTEX
4040
select HAVE_FTRACE_MCOUNT_RECORD
4141
select HAVE_HW_BREAKPOINT
42-
select HAVE_IDE if HAS_IOPORT_MAP
4342
select HAVE_IOREMAP_PROT if MMU && !X2TLB
4443
select HAVE_KERNEL_BZIP2
4544
select HAVE_KERNEL_GZIP

arch/sparc/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ config SPARC
1919
select OF
2020
select OF_PROMTREE
2121
select HAVE_ASM_MODVERSIONS
22-
select HAVE_IDE
2322
select HAVE_ARCH_KGDB if !SMP || SPARC64
2423
select HAVE_ARCH_TRACEHOOK
2524
select HAVE_ARCH_SECCOMP if SPARC64

arch/x86/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ config X86
202202
select HAVE_FUNCTION_TRACER
203203
select HAVE_GCC_PLUGINS
204204
select HAVE_HW_BREAKPOINT
205-
select HAVE_IDE
206205
select HAVE_IOREMAP_PROT
207206
select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64
208207
select HAVE_IRQ_TIME_ACCOUNTING

arch/xtensa/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ config XTENSA_PLATFORM_ISS
327327

328328
config XTENSA_PLATFORM_XT2000
329329
bool "XT2000"
330-
select HAVE_IDE
331330
help
332331
XT2000 is the name of Tensilica's feature-rich emulation platform.
333332
This hardware is capable of running a full Linux distribution.

drivers/ata/libata-sff.c

+27-8
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,20 @@ unsigned int ata_sff_data_xfer32(struct ata_queued_cmd *qc, unsigned char *buf,
637637
}
638638
EXPORT_SYMBOL_GPL(ata_sff_data_xfer32);
639639

640+
static void ata_pio_xfer(struct ata_queued_cmd *qc, struct page *page,
641+
unsigned int offset, size_t xfer_size)
642+
{
643+
bool do_write = (qc->tf.flags & ATA_TFLAG_WRITE);
644+
unsigned char *buf;
645+
646+
buf = kmap_atomic(page);
647+
qc->ap->ops->sff_data_xfer(qc, buf + offset, xfer_size, do_write);
648+
kunmap_atomic(buf);
649+
650+
if (!do_write && !PageSlab(page))
651+
flush_dcache_page(page);
652+
}
653+
640654
/**
641655
* ata_pio_sector - Transfer a sector of data.
642656
* @qc: Command on going
@@ -648,11 +662,9 @@ EXPORT_SYMBOL_GPL(ata_sff_data_xfer32);
648662
*/
649663
static void ata_pio_sector(struct ata_queued_cmd *qc)
650664
{
651-
int do_write = (qc->tf.flags & ATA_TFLAG_WRITE);
652665
struct ata_port *ap = qc->ap;
653666
struct page *page;
654667
unsigned int offset;
655-
unsigned char *buf;
656668

657669
if (!qc->cursg) {
658670
qc->curbytes = qc->nbytes;
@@ -670,13 +682,20 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)
670682

671683
DPRINTK("data %s\n", qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read");
672684

673-
/* do the actual data transfer */
674-
buf = kmap_atomic(page);
675-
ap->ops->sff_data_xfer(qc, buf + offset, qc->sect_size, do_write);
676-
kunmap_atomic(buf);
685+
/*
686+
* Split the transfer when it splits a page boundary. Note that the
687+
* split still has to be dword aligned like all ATA data transfers.
688+
*/
689+
WARN_ON_ONCE(offset % 4);
690+
if (offset + qc->sect_size > PAGE_SIZE) {
691+
unsigned int split_len = PAGE_SIZE - offset;
677692

678-
if (!do_write && !PageSlab(page))
679-
flush_dcache_page(page);
693+
ata_pio_xfer(qc, page, offset, split_len);
694+
ata_pio_xfer(qc, nth_page(page, 1), 0,
695+
qc->sect_size - split_len);
696+
} else {
697+
ata_pio_xfer(qc, page, offset, qc->sect_size);
698+
}
680699

681700
qc->curbytes += qc->sect_size;
682701
qc->cursg_ofs += qc->sect_size;

0 commit comments

Comments
 (0)