Skip to content

Commit a67e23d

Browse files
jgross1kawasaki
authored andcommitted
block/floppy: Don't use REALLY_SLOW_IO for delays
Instead of defining REALLY_SLOW_IO before including io.h, add the required additional calls of native_io_delay() to the related functions in arch/x86/include/asm/floppy.h. This will remove the last place where REALLY_SLOW_IO is being defined. Signed-off-by: Juergen Gross <[email protected]>
1 parent 8a473ad commit a67e23d

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

arch/x86/include/asm/floppy.h

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
#define CSW fd_routine[can_use_virtual_dma & 1]
3030

3131

32-
#define fd_inb(base, reg) inb_p((base) + (reg))
33-
#define fd_outb(value, base, reg) outb_p(value, (base) + (reg))
34-
3532
#define fd_request_dma() CSW._request_dma(FLOPPY_DMA, "floppy")
3633
#define fd_free_dma() CSW._free_dma(FLOPPY_DMA)
3734
#define fd_enable_irq() enable_irq(FLOPPY_IRQ)
@@ -49,6 +46,26 @@ static char *virtual_dma_addr;
4946
static int virtual_dma_mode;
5047
static int doing_pdma;
5148

49+
static inline u8 fd_inb(u16 base, u16 reg)
50+
{
51+
u8 ret = inb_p(base + reg);
52+
53+
native_io_delay();
54+
native_io_delay();
55+
native_io_delay();
56+
57+
return ret;
58+
}
59+
60+
static inline void fd_outb(u8 value, u16 base, u16 reg)
61+
{
62+
outb_p(value, base + reg);
63+
64+
native_io_delay();
65+
native_io_delay();
66+
native_io_delay();
67+
}
68+
5269
static irqreturn_t floppy_hardint(int irq, void *dev_id)
5370
{
5471
unsigned char st;
@@ -79,9 +96,9 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id)
7996
if (st != (STATUS_DMA | STATUS_READY))
8097
break;
8198
if (virtual_dma_mode)
82-
outb_p(*lptr, virtual_dma_port + FD_DATA);
99+
fd_outb(*lptr, virtual_dma_port, FD_DATA);
83100
else
84-
*lptr = inb_p(virtual_dma_port + FD_DATA);
101+
*lptr = fd_inb(virtual_dma_port, FD_DATA);
85102
}
86103
virtual_dma_count = lcount;
87104
virtual_dma_addr = lptr;

drivers/block/floppy.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@
145145
* Better audit of register_blkdev.
146146
*/
147147

148-
#define REALLY_SLOW_IO
149-
150148
#define DEBUGT 2
151149

152150
#define DPRINT(format, args...) \

0 commit comments

Comments
 (0)