Skip to content

Commit 112eeaa

Browse files
dliviubjorn-helgaas
authored andcommitted
asm-generic/io.h: Fix ioport_map() for !CONFIG_GENERIC_IOMAP
The !CONFIG_GENERIC_IOMAP version of ioport_map() is wrong. It returns a mapped, i.e., virtual, address that can start from zero and completely ignores the PCI_IOBASE and IO_SPACE_LIMIT that most architectures that use !CONFIG_GENERIC_MAP define. Tested-by: Tanmay Inamdar <tinamdar@apm.com> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
1 parent 52addcf commit 112eeaa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • include/asm-generic

‎include/asm-generic/io.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ static inline void iounmap(void __iomem *addr)
331331
#ifndef CONFIG_GENERIC_IOMAP
332332
static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
333333
{
334-
return (void __iomem *) port;
334+
return PCI_IOBASE + (port & IO_SPACE_LIMIT);
335335
}
336336

337337
static inline void ioport_unmap(void __iomem *p)

0 commit comments

Comments
 (0)