Skip to content

Commit c299010

Browse files
committed
Merge tag 'asm-generic-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic
Pull asm-generic cleanups from Arnd Bergmann: "A series from Baoquan He cleans up the asm-generic/io.h to remove the ioremap_uc() definition from everything except x86, which still needs it for pre-PAT systems. This series notably contains a patch from Jiaxun Yang that converts MIPS to use asm-generic/io.h like every other architecture does, enabling future cleanups. Some of my own patches fix -Wmissing-prototype warnings in architecture specific code across several architectures. This is now needed as the warning is enabled by default. There are still some remaining warnings in minor platforms, but the series should catch most of the widely used ones make them more consistent with one another. David McKay fixes a bug in __generic_cmpxchg_local() when this is used on 64-bit architectures. This could currently only affect parisc64 and sparc64. Additional cleanups address from Linus Walleij, Uwe Kleine-König, Thomas Huth, and Kefeng Wang help reduce unnecessary inconsistencies between architectures" * tag 'asm-generic-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: asm-generic: Fix 32 bit __generic_cmpxchg_local Hexagon: Make pfn accessors statics inlines ARC: mm: Make virt_to_pfn() a static inline mips: remove extraneous asm-generic/iomap.h include sparc: Use $(kecho) to announce kernel images being ready arm64: vdso32: Define BUILD_VDSO32_64 to correct prototypes csky: fix arch_jump_label_transform_static override arch: add do_page_fault prototypes arch: add missing prepare_ftrace_return() prototypes arch: vdso: consolidate gettime prototypes arch: include linux/cpu.h for trap_init() prototype arch: fix asm-offsets.c building with -Wmissing-prototypes arch: consolidate arch_irq_work_raise prototypes hexagon: Remove CONFIG_HEXAGON_ARCH_VERSION from uapi header asm/io: remove unnecessary xlate_dev_mem_ptr() and unxlate_dev_mem_ptr() mips: io: remove duplicated codes arch/*/io.h: remove ioremap_uc in some architectures mips: add <asm-generic/io.h> including
2 parents 4cd083d + d93cca2 commit c299010

63 files changed

Lines changed: 203 additions & 229 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/driver-api/device-io.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,12 @@ functions for details on the CPU side of things.
408408
ioremap_uc()
409409
------------
410410

411-
ioremap_uc() behaves like ioremap() except that on the x86 architecture without
412-
'PAT' mode, it marks memory as uncached even when the MTRR has designated
413-
it as cacheable, see Documentation/arch/x86/pat.rst.
411+
ioremap_uc() is only meaningful on old x86-32 systems with the PAT extension,
412+
and on ia64 with its slightly unconventional ioremap() behavior, everywhere
413+
elss ioremap_uc() defaults to return NULL.
414414

415-
Portable drivers should avoid the use of ioremap_uc().
415+
416+
Portable drivers should avoid the use of ioremap_uc(), use ioremap() instead.
416417

417418
ioremap_cache()
418419
---------------

arch/alpha/include/asm/io.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ static inline void __iomem *ioremap(unsigned long port, unsigned long size)
308308
}
309309

310310
#define ioremap_wc ioremap
311-
#define ioremap_uc ioremap
312311

313312
static inline void iounmap(volatile void __iomem *addr)
314313
{
@@ -651,12 +650,6 @@ extern void outsl (unsigned long port, const void *src, unsigned long count);
651650
#endif
652651
#define RTC_ALWAYS_BCD 0
653652

654-
/*
655-
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
656-
* access
657-
*/
658-
#define xlate_dev_mem_ptr(p) __va(p)
659-
660653
/*
661654
* These get provided from <asm-generic/iomap.h> since alpha does not
662655
* select GENERIC_IOMAP.

arch/alpha/include/asm/mmu_context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ ev4_switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm,
183183
}
184184

185185
extern void __load_new_mm_context(struct mm_struct *);
186+
asmlinkage void do_page_fault(unsigned long address, unsigned long mmcsr,
187+
long cause, struct pt_regs *regs);
186188

187189
#ifdef CONFIG_SMP
188190
#define check_mmu_context() \

arch/alpha/kernel/asm-offsets.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <linux/kbuild.h>
1313
#include <asm/io.h>
1414

15-
void foo(void)
15+
static void __used foo(void)
1616
{
1717
DEFINE(TI_TASK, offsetof(struct thread_info, task));
1818
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));

arch/alpha/kernel/traps.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* This file initializes the trap entry points
1010
*/
1111

12+
#include <linux/cpu.h>
1213
#include <linux/jiffies.h>
1314
#include <linux/mm.h>
1415
#include <linux/sched/signal.h>

arch/arc/include/asm/page.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,6 @@ typedef struct {
8484

8585
typedef struct page *pgtable_t;
8686

87-
/*
88-
* Use virt_to_pfn with caution:
89-
* If used in pte or paddr related macros, it could cause truncation
90-
* in PAE40 builds
91-
* As a rule of thumb, only use it in helpers starting with virt_
92-
* You have been warned !
93-
*/
94-
#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
95-
9687
/*
9788
* When HIGHMEM is enabled we have holes in the memory map so we need
9889
* pfn_valid() that takes into account the actual extents of the physical
@@ -122,6 +113,18 @@ extern int pfn_valid(unsigned long pfn);
122113
#define __pa(vaddr) ((unsigned long)(vaddr))
123114
#define __va(paddr) ((void *)((unsigned long)(paddr)))
124115

116+
/*
117+
* Use virt_to_pfn with caution:
118+
* If used in pte or paddr related macros, it could cause truncation
119+
* in PAE40 builds
120+
* As a rule of thumb, only use it in helpers starting with virt_
121+
* You have been warned !
122+
*/
123+
static inline unsigned long virt_to_pfn(const void *kaddr)
124+
{
125+
return __pa(kaddr) >> PAGE_SHIFT;
126+
}
127+
125128
#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
126129
#define virt_addr_valid(kaddr) pfn_valid(virt_to_pfn(kaddr))
127130

arch/arc/include/asm/pgtable-levels.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
#define pmd_clear(xp) do { pmd_val(*(xp)) = 0; } while (0)
160160
#define pmd_page_vaddr(pmd) (pmd_val(pmd) & PAGE_MASK)
161161
#define pmd_pfn(pmd) ((pmd_val(pmd) & PAGE_MASK) >> PAGE_SHIFT)
162-
#define pmd_page(pmd) virt_to_page(pmd_page_vaddr(pmd))
162+
#define pmd_page(pmd) virt_to_page((void *)pmd_page_vaddr(pmd))
163163
#define set_pmd(pmdp, pmd) (*(pmdp) = pmd)
164164
#define pmd_pgtable(pmd) ((pgtable_t) pmd_page(pmd))
165165

arch/arm/include/asm/io.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,6 @@ struct pci_dev;
407407
#define pci_iounmap pci_iounmap
408408
extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr);
409409

410-
/*
411-
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
412-
* access
413-
*/
414-
#define xlate_dev_mem_ptr(p) __va(p)
415-
416410
#include <asm-generic/io.h>
417411

418412
#ifdef CONFIG_MMU

arch/arm/include/asm/irq_work.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,4 @@ static inline bool arch_irq_work_has_interrupt(void)
99
return is_smp();
1010
}
1111

12-
extern void arch_irq_work_raise(void);
13-
1412
#endif /* _ASM_ARM_IRQ_WORK_H */

arch/arm/include/asm/vdso.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ static inline void arm_install_vdso(struct mm_struct *mm, unsigned long addr)
2424

2525
#endif /* CONFIG_VDSO */
2626

27-
int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts);
28-
int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts);
29-
int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
30-
int __vdso_clock_getres(clockid_t clock_id, struct old_timespec32 *res);
31-
3227
#endif /* __ASSEMBLY__ */
3328

3429
#endif /* __KERNEL__ */

0 commit comments

Comments
 (0)