PCI IO and IO_COND

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have a question regarding the IO_COND macro in lib/iomap.c...

If you have a system which uses GENERIC_IOMAP and you use default values for
PIO_OFFSET, PIO_MASK and PIO_RESERVED - it doesn't seem possible to use the
ioreadX functions to access the first address of the IO port, i.e.
addr=PIO_OFFSET (assuming that you would want to).

/*
 * Ugly macros are a way of life.
 */
#define IO_COND(addr, is_pio, is_mmio) do {			\
	unsigned long port = (unsigned long __force)addr;	\
	if (port >= PIO_RESERVED) {				\
		is_mmio;					\
	} else if (port > PIO_OFFSET) {				\
		port &= PIO_MASK;				\
		is_pio;						\
	} else							\
		bad_io_access(port, #is_pio );			\
} while (0)

Should the first else be '} else if (port >= PIO_OFFSET)' or am I missing
something here?

I can see that on ARM where IO is used for PCI, the pcibios_min_io variable
probably prevents accesses to addr=PIO_OFFSET as it introduces an additional
offset.

Thanks,

Andrew Murray
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux