History

swiotlb: Add CONFIG_HAS_IOMEM check around swiotlb_mem_remap()

HAS_IOMEM option may not be selected on some platforms (e.g, s390) and this will cause compilation failure due to missing memremap() implementation. Fix it by stubbing out swiotlb_mem_remap when CONFIG_HAS_IOMEM is not set.

Wei Liu committed 4 years ago

Commit 2deb55d1 parent e1878401 file · +7 −0Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/dma/swiotlb.c+7−0
@@ -163,6 +163,7 @@ static inline unsigned long nr_slots(u64 val) · 162 unmodified lines
163 * when swiotlb_unencrypted_base is set. (e.g. for Hyper-V AMD SEV-SNP163 * when swiotlb_unencrypted_base is set. (e.g. for Hyper-V AMD SEV-SNP
164 * Isolation VMs).164 * Isolation VMs).
165 */165 */
166#ifdef CONFIG_HAS_IOMEM
166static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes)167static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes)
167{168{
168 void *vaddr = NULL;169 void *vaddr = NULL;
@@ -178,6 +179,12 @@ static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes) · 9 unmodified lines
178 179
179 return vaddr;180 return vaddr;
180}181}
182#else
183static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes)
184{
185 return NULL;
186}
187#endif
181 188
182/*189/*
183 * Early SWIOTLB allocation may be too early to allow an architecture to190 * Early SWIOTLB allocation may be too early to allow an architecture to

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t