Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
linux
Commits
d5963d87
Commit
d5963d87
authored
5 years ago
by
Ingo Molnar
Browse files
Options
Download
Plain Diff
Merge tag 'v5.1-rc7' into x86/mm, to pick up fixes
Signed-off-by:
Ingo Molnar
<
mingo@kernel.org
>
parents
3db6d5a5
37624b58
Changes
60
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
149 additions
and
76 deletions
+149
-76
Documentation/sysctl/vm.txt
Documentation/sysctl/vm.txt
+8
-8
Makefile
Makefile
+1
-1
arch/arm/Kconfig
arch/arm/Kconfig
+1
-1
arch/arm/Kconfig.debug
arch/arm/Kconfig.debug
+3
-3
arch/arm/boot/compressed/head.S
arch/arm/boot/compressed/head.S
+15
-1
arch/arm/kernel/head-nommu.S
arch/arm/kernel/head-nommu.S
+1
-1
arch/arm64/kernel/ftrace.c
arch/arm64/kernel/ftrace.c
+7
-2
arch/arm64/mm/init.c
arch/arm64/mm/init.c
+1
-1
arch/powerpc/configs/skiroot_defconfig
arch/powerpc/configs/skiroot_defconfig
+1
-0
arch/powerpc/mm/mmu_context_iommu.c
arch/powerpc/mm/mmu_context_iommu.c
+58
-39
arch/powerpc/platforms/Kconfig.cputype
arch/powerpc/platforms/Kconfig.cputype
+1
-1
arch/x86/boot/compressed/misc.c
arch/x86/boot/compressed/misc.c
+1
-1
arch/x86/events/intel/cstate.c
arch/x86/events/intel/cstate.c
+5
-5
arch/x86/mm/init.c
arch/x86/mm/init.c
+6
-0
drivers/block/zram/zram_drv.c
drivers/block/zram/zram_drv.c
+3
-2
drivers/dma/bcm2835-dma.c
drivers/dma/bcm2835-dma.c
+1
-1
drivers/dma/mediatek/mtk-cqdma.c
drivers/dma/mediatek/mtk-cqdma.c
+1
-1
drivers/dma/sh/rcar-dmac.c
drivers/dma/sh/rcar-dmac.c
+26
-4
drivers/gpio/gpio-eic-sprd.c
drivers/gpio/gpio-eic-sprd.c
+1
-0
drivers/gpio/gpiolib.c
drivers/gpio/gpiolib.c
+8
-4
No files found.
Documentation/sysctl/vm.txt
View file @
d5963d87
...
...
@@ -866,14 +866,14 @@ The intent is that compaction has less work to do in the future and to
increase the success rate of future high-order allocations such as SLUB
allocations, THP and hugetlbfs pages.
To make it sensible with respect to the watermark_scale_factor
parameter,
the unit is in fractions of 10,000. The default value of
15,000 means
that up to 150% of the high watermark will be reclaimed in the event of
a pageblock being mixed due to fragmentation. T
he
l
eve
l
of
reclaim is
determined by the number of fragmentation events that occurred in the
recent past. If this value is smaller than a pageblock then a pageblock
s
worth of pages will be reclaimed (e.g. 2MB on 64-bit x86). A boost factor
of 0 will disable the feature.
To make it sensible with respect to the watermark_scale_factor
parameter,
the unit is in fractions of 10,000. The default value of
15,000 on !DISCONTIGMEM configurations means that up to 150% of the high
watermark will be reclaimed in t
he eve
nt
of
a pageblock being mixed due
to fragmentation. The level of reclaim is determined by the number of
fragmentation events that occurred in the recent past. If this value i
s
smaller than a pageblock then a pageblocks worth of pages will be reclaimed
(e.g. 2MB on 64-bit x86). A boost factor
of 0 will disable the feature.
=============================================================
...
...
This diff is collapsed.
Click to expand it.
Makefile
View file @
d5963d87
...
...
@@ -2,7 +2,7 @@
VERSION
=
5
PATCHLEVEL
=
1
SUBLEVEL
=
0
EXTRAVERSION
=
-rc
6
EXTRAVERSION
=
-rc
7
NAME
=
Shy Crocodile
# *DOCUMENTATION*
...
...
This diff is collapsed.
Click to expand it.
arch/arm/Kconfig
View file @
d5963d87
...
...
@@ -73,7 +73,7 @@ config ARM
select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
select HAVE_EXIT_THREAD
select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL
select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL
&& !CC_IS_CLANG
select HAVE_FUNCTION_TRACER if !XIP_KERNEL
select HAVE_GCC_PLUGINS
select HAVE_HW_BREAKPOINT if PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)
...
...
This diff is collapsed.
Click to expand it.
arch/arm/Kconfig.debug
View file @
d5963d87
...
...
@@ -47,8 +47,8 @@ config DEBUG_WX
choice
prompt "Choose kernel unwinder"
default UNWINDER_ARM if AEABI
&& !FUNCTION_GRAPH_TRACER
default UNWINDER_FRAME_POINTER if !AEABI
|| FUNCTION_GRAPH_TRACER
default UNWINDER_ARM if AEABI
default UNWINDER_FRAME_POINTER if !AEABI
help
This determines which method will be used for unwinding kernel stack
traces for panics, oopses, bugs, warnings, perf, /proc/<pid>/stack,
...
...
@@ -65,7 +65,7 @@ config UNWINDER_FRAME_POINTER
config UNWINDER_ARM
bool "ARM EABI stack unwinder"
depends on AEABI
depends on AEABI
&& !FUNCTION_GRAPH_TRACER
select ARM_UNWIND
help
This option enables stack unwinding support in the kernel
...
...
This diff is collapsed.
Click to expand it.
arch/arm/boot/compressed/head.S
View file @
d5963d87
...
...
@@ -1438,7 +1438,21 @@ ENTRY(efi_stub_entry)
@
Preserve
return
value
of
efi_entry
()
in
r4
mov
r4
,
r0
bl
cache_clean_flush
@
our
cache
maintenance
code
relies
on
CP15
barrier
instructions
@
but
since
we
arrived
here
with
the
MMU
and
caches
configured
@
by
UEFI
,
we
must
check
that
the
CP15BEN
bit
is
set
in
SCTLR
.
@
Note
that
this
bit
is
RAO
/
WI
on
v6
and
earlier
,
so
the
ISB
in
@
the
enable
path
will
be
executed
on
v7
+
only
.
mrc
p15
,
0
,
r1
,
c1
,
c0
,
0
@
read
SCTLR
tst
r1
,
#(
1
<<
5
)
@
CP15BEN
bit
set
?
bne
0
f
orr
r1
,
r1
,
#(
1
<<
5
)
@
CP15
barrier
instructions
mcr
p15
,
0
,
r1
,
c1
,
c0
,
0
@
write
SCTLR
ARM
(
.
inst
0xf57ff06f
@
v7
+
isb
)
THUMB
(
isb
)
0
:
bl
cache_clean_flush
bl
cache_off
@
Set
parameters
for
booting
zImage
according
to
boot
protocol
...
...
This diff is collapsed.
Click to expand it.
arch/arm/kernel/head-nommu.S
View file @
d5963d87
...
...
@@ -133,9 +133,9 @@ __secondary_data:
*/
.
text
__after_proc_init
:
#ifdef CONFIG_ARM_MPU
M_CLASS
(
movw
r12
,
#
:
lower16
:
BASEADDR_V7M_SCB
)
M_CLASS
(
movt
r12
,
#
:
upper16
:
BASEADDR_V7M_SCB
)
#ifdef CONFIG_ARM_MPU
M_CLASS
(
ldr
r3
,
[
r12
,
0x50
])
AR_CLASS
(
mrc
p15
,
0
,
r3
,
c0
,
c1
,
4
)
@
Read
ID_MMFR0
and
r3
,
r3
,
#(
MMFR0_PMSA
)
@
PMSA
field
...
...
This diff is collapsed.
Click to expand it.
arch/arm64/kernel/ftrace.c
View file @
d5963d87
...
...
@@ -103,10 +103,15 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
* to be revisited if support for multiple ftrace entry points
* is added in the future, but for now, the pr_err() below
* deals with a theoretical issue only.
*
* Note that PLTs are place relative, and plt_entries_equal()
* checks whether they point to the same target. Here, we need
* to check if the actual opcodes are in fact identical,
* regardless of the offset in memory so use memcmp() instead.
*/
trampoline
=
get_plt_entry
(
addr
,
mod
->
arch
.
ftrace_trampoline
);
if
(
!
plt_entries_equal
(
mod
->
arch
.
ftrace_trampoline
,
&
trampoline
))
{
if
(
memcmp
(
mod
->
arch
.
ftrace_trampoline
,
&
trampoline
,
sizeof
(
trampoline
))
)
{
if
(
plt_entry_is_initialized
(
mod
->
arch
.
ftrace_trampoline
))
{
pr_err
(
"ftrace: far branches to multiple entry points unsupported inside a single module
\n
"
);
return
-
EINVAL
;
...
...
This diff is collapsed.
Click to expand it.
arch/arm64/mm/init.c
View file @
d5963d87
...
...
@@ -363,7 +363,7 @@ void __init arm64_memblock_init(void)
* Otherwise, this is a no-op
*/
u64
base
=
phys_initrd_start
&
PAGE_MASK
;
u64
size
=
PAGE_ALIGN
(
phys_initrd_s
ize
)
;
u64
size
=
PAGE_ALIGN
(
phys_initrd_s
tart
+
phys_initrd_size
)
-
base
;
/*
* We can only add back the initrd memory if we don't end up
...
...
This diff is collapsed.
Click to expand it.
arch/powerpc/configs/skiroot_defconfig
View file @
d5963d87
...
...
@@ -266,6 +266,7 @@ CONFIG_UDF_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_PROC_KCORE=y
CONFIG_HUGETLBFS=y
# CONFIG_MISC_FILESYSTEMS is not set
# CONFIG_NETWORK_FILESYSTEMS is not set
CONFIG_NLS=y
...
...
This diff is collapsed.
Click to expand it.
arch/powerpc/mm/mmu_context_iommu.c
View file @
d5963d87
...
...
@@ -95,28 +95,15 @@ static long mm_iommu_do_alloc(struct mm_struct *mm, unsigned long ua,
unsigned
long
entries
,
unsigned
long
dev_hpa
,
struct
mm_iommu_table_group_mem_t
**
pmem
)
{
struct
mm_iommu_table_group_mem_t
*
mem
;
long
i
,
ret
,
locked_entries
=
0
;
struct
mm_iommu_table_group_mem_t
*
mem
,
*
mem2
;
long
i
,
ret
,
locked_entries
=
0
,
pinned
=
0
;
unsigned
int
pageshift
;
mutex_lock
(
&
mem_list_mutex
);
list_for_each_entry_rcu
(
mem
,
&
mm
->
context
.
iommu_group_mem_list
,
next
)
{
/* Overlap? */
if
((
mem
->
ua
<
(
ua
+
(
entries
<<
PAGE_SHIFT
)))
&&
(
ua
<
(
mem
->
ua
+
(
mem
->
entries
<<
PAGE_SHIFT
))))
{
ret
=
-
EINVAL
;
goto
unlock_exit
;
}
}
unsigned
long
entry
,
chunk
;
if
(
dev_hpa
==
MM_IOMMU_TABLE_INVALID_HPA
)
{
ret
=
mm_iommu_adjust_locked_vm
(
mm
,
entries
,
true
);
if
(
ret
)
goto
unlock_exi
t
;
return
re
t
;
locked_entries
=
entries
;
}
...
...
@@ -148,17 +135,27 @@ static long mm_iommu_do_alloc(struct mm_struct *mm, unsigned long ua,
}
down_read
(
&
mm
->
mmap_sem
);
ret
=
get_user_pages_longterm
(
ua
,
entries
,
FOLL_WRITE
,
mem
->
hpages
,
NULL
);
chunk
=
(
1UL
<<
(
PAGE_SHIFT
+
MAX_ORDER
-
1
))
/
sizeof
(
struct
vm_area_struct
*
);
chunk
=
min
(
chunk
,
entries
);
for
(
entry
=
0
;
entry
<
entries
;
entry
+=
chunk
)
{
unsigned
long
n
=
min
(
entries
-
entry
,
chunk
);
ret
=
get_user_pages_longterm
(
ua
+
(
entry
<<
PAGE_SHIFT
),
n
,
FOLL_WRITE
,
mem
->
hpages
+
entry
,
NULL
);
if
(
ret
==
n
)
{
pinned
+=
n
;
continue
;
}
if
(
ret
>
0
)
pinned
+=
ret
;
break
;
}
up_read
(
&
mm
->
mmap_sem
);
if
(
ret
!=
entries
)
{
/* free the reference taken */
for
(
i
=
0
;
i
<
ret
;
i
++
)
put_page
(
mem
->
hpages
[
i
]);
vfree
(
mem
->
hpas
);
kfree
(
mem
);
ret
=
-
EFAULT
;
goto
unlock_exit
;
if
(
pinned
!=
entries
)
{
if
(
!
ret
)
ret
=
-
EFAULT
;
goto
free_exit
;
}
pageshift
=
PAGE_SHIFT
;
...
...
@@ -183,21 +180,43 @@ static long mm_iommu_do_alloc(struct mm_struct *mm, unsigned long ua,
}
good_exit:
ret
=
0
;
atomic64_set
(
&
mem
->
mapped
,
1
);
mem
->
used
=
1
;
mem
->
ua
=
ua
;
mem
->
entries
=
entries
;
*
pmem
=
mem
;
list_add_rcu
(
&
mem
->
next
,
&
mm
->
context
.
iommu_group_
mem_list
);
mutex_lock
(
&
mem_list
_mutex
);
unlock_exit:
if
(
locked_entries
&&
ret
)
mm_iommu_adjust_locked_vm
(
mm
,
locked_entries
,
false
);
list_for_each_entry_rcu
(
mem2
,
&
mm
->
context
.
iommu_group_mem_list
,
next
)
{
/* Overlap? */
if
((
mem2
->
ua
<
(
ua
+
(
entries
<<
PAGE_SHIFT
)))
&&
(
ua
<
(
mem2
->
ua
+
(
mem2
->
entries
<<
PAGE_SHIFT
))))
{
ret
=
-
EINVAL
;
mutex_unlock
(
&
mem_list_mutex
);
goto
free_exit
;
}
}
list_add_rcu
(
&
mem
->
next
,
&
mm
->
context
.
iommu_group_mem_list
);
mutex_unlock
(
&
mem_list_mutex
);
*
pmem
=
mem
;
return
0
;
free_exit:
/* free the reference taken */
for
(
i
=
0
;
i
<
pinned
;
i
++
)
put_page
(
mem
->
hpages
[
i
]);
vfree
(
mem
->
hpas
);
kfree
(
mem
);
unlock_exit:
mm_iommu_adjust_locked_vm
(
mm
,
locked_entries
,
false
);
return
ret
;
}
...
...
@@ -266,7 +285,7 @@ static void mm_iommu_release(struct mm_iommu_table_group_mem_t *mem)
long
mm_iommu_put
(
struct
mm_struct
*
mm
,
struct
mm_iommu_table_group_mem_t
*
mem
)
{
long
ret
=
0
;
unsigned
long
entries
,
dev_hpa
;
unsigned
long
unlock_entries
=
0
;
mutex_lock
(
&
mem_list_mutex
);
...
...
@@ -287,17 +306,17 @@ long mm_iommu_put(struct mm_struct *mm, struct mm_iommu_table_group_mem_t *mem)
goto
unlock_exit
;
}
if
(
mem
->
dev_hpa
==
MM_IOMMU_TABLE_INVALID_HPA
)
unlock_entries
=
mem
->
entries
;
/* @mapped became 0 so now mappings are disabled, release the region */
entries
=
mem
->
entries
;
dev_hpa
=
mem
->
dev_hpa
;
mm_iommu_release
(
mem
);
if
(
dev_hpa
==
MM_IOMMU_TABLE_INVALID_HPA
)
mm_iommu_adjust_locked_vm
(
mm
,
entries
,
false
);
unlock_exit:
mutex_unlock
(
&
mem_list_mutex
);
mm_iommu_adjust_locked_vm
(
mm
,
unlock_entries
,
false
);
return
ret
;
}
EXPORT_SYMBOL_GPL
(
mm_iommu_put
);
...
...
This diff is collapsed.
Click to expand it.
arch/powerpc/platforms/Kconfig.cputype
View file @
d5963d87
...
...
@@ -324,7 +324,7 @@ config ARCH_ENABLE_SPLIT_PMD_PTLOCK
config PPC_RADIX_MMU
bool "Radix MMU Support"
depends on PPC_BOOK3S_64
depends on PPC_BOOK3S_64
&& HUGETLB_PAGE
select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA
default y
help
...
...
This diff is collapsed.
Click to expand it.
arch/x86/boot/compressed/misc.c
View file @
d5963d87
...
...
@@ -352,7 +352,7 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
boot_params
->
hdr
.
loadflags
&=
~
KASLR_FLAG
;
/* Save RSDP address for later use. */
boot_params
->
acpi_rsdp_addr
=
get_rsdp_addr
();
/*
boot_params->acpi_rsdp_addr = get_rsdp_addr();
*/
sanitize_boot_params
(
boot_params
);
...
...
This diff is collapsed.
Click to expand it.
arch/x86/events/intel/cstate.c
View file @
d5963d87
...
...
@@ -76,15 +76,15 @@
* Scope: Package (physical package)
* MSR_PKG_C8_RESIDENCY: Package C8 Residency Counter.
* perf code: 0x04
* Available model: HSW ULT,CNL
* Available model: HSW ULT,
KBL,
CNL
* Scope: Package (physical package)
* MSR_PKG_C9_RESIDENCY: Package C9 Residency Counter.
* perf code: 0x05
* Available model: HSW ULT,CNL
* Available model: HSW ULT,
KBL,
CNL
* Scope: Package (physical package)
* MSR_PKG_C10_RESIDENCY: Package C10 Residency Counter.
* perf code: 0x06
* Available model: HSW ULT,GLM,CNL
* Available model: HSW ULT,
KBL,
GLM,CNL
* Scope: Package (physical package)
*
*/
...
...
@@ -566,8 +566,8 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = {
X86_CSTATES_MODEL
(
INTEL_FAM6_SKYLAKE_DESKTOP
,
snb_cstates
),
X86_CSTATES_MODEL
(
INTEL_FAM6_SKYLAKE_X
,
snb_cstates
),
X86_CSTATES_MODEL
(
INTEL_FAM6_KABYLAKE_MOBILE
,
snb
_cstates
),
X86_CSTATES_MODEL
(
INTEL_FAM6_KABYLAKE_DESKTOP
,
snb
_cstates
),
X86_CSTATES_MODEL
(
INTEL_FAM6_KABYLAKE_MOBILE
,
hswult
_cstates
),
X86_CSTATES_MODEL
(
INTEL_FAM6_KABYLAKE_DESKTOP
,
hswult
_cstates
),
X86_CSTATES_MODEL
(
INTEL_FAM6_CANNONLAKE_MOBILE
,
cnl_cstates
),
...
...
This diff is collapsed.
Click to expand it.
arch/x86/mm/init.c
View file @
d5963d87
...
...
@@ -5,6 +5,7 @@
#include <linux/memblock.h>
#include <linux/swapfile.h>
#include <linux/swapops.h>
#include <linux/kmemleak.h>
#include <asm/set_memory.h>
#include <asm/e820/api.h>
...
...
@@ -766,6 +767,11 @@ void free_init_pages(const char *what, unsigned long begin, unsigned long end)
if
(
debug_pagealloc_enabled
())
{
pr_info
(
"debug: unmapping init [mem %#010lx-%#010lx]
\n
"
,
begin
,
end
-
1
);
/*
* Inform kmemleak about the hole in the memory since the
* corresponding pages will be unmapped.
*/
kmemleak_free_part
((
void
*
)
begin
,
end
-
begin
);
set_memory_np
(
begin
,
(
end
-
begin
)
>>
PAGE_SHIFT
);
}
else
{
/*
...
...
This diff is collapsed.
Click to expand it.
drivers/block/zram/zram_drv.c
View file @
d5963d87
...
...
@@ -774,18 +774,18 @@ struct zram_work {
struct
zram
*
zram
;
unsigned
long
entry
;
struct
bio
*
bio
;
struct
bio_vec
bvec
;
};
#if PAGE_SIZE != 4096
static
void
zram_sync_read
(
struct
work_struct
*
work
)
{
struct
bio_vec
bvec
;
struct
zram_work
*
zw
=
container_of
(
work
,
struct
zram_work
,
work
);
struct
zram
*
zram
=
zw
->
zram
;
unsigned
long
entry
=
zw
->
entry
;
struct
bio
*
bio
=
zw
->
bio
;
read_from_bdev_async
(
zram
,
&
bvec
,
entry
,
bio
);
read_from_bdev_async
(
zram
,
&
zw
->
bvec
,
entry
,
bio
);
}
/*
...
...
@@ -798,6 +798,7 @@ static int read_from_bdev_sync(struct zram *zram, struct bio_vec *bvec,
{
struct
zram_work
work
;
work
.
bvec
=
*
bvec
;
work
.
zram
=
zram
;
work
.
entry
=
entry
;
work
.
bio
=
bio
;
...
...
This diff is collapsed.
Click to expand it.
drivers/dma/bcm2835-dma.c
View file @
d5963d87
...
...
@@ -671,7 +671,7 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg(
d
=
bcm2835_dma_create_cb_chain
(
chan
,
direction
,
false
,
info
,
extra
,
frames
,
src
,
dst
,
0
,
0
,
GFP_
KERNEL
);
GFP_
NOWAIT
);
if
(
!
d
)
return
NULL
;
...
...
This diff is collapsed.
Click to expand it.
drivers/dma/mediatek/mtk-cqdma.c
View file @
d5963d87
...
...
@@ -253,7 +253,7 @@ static void mtk_cqdma_start(struct mtk_cqdma_pchan *pc,
#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
mtk_dma_set
(
pc
,
MTK_CQDMA_DST2
,
cvd
->
dest
>>
MTK_CQDMA_ADDR2_SHFIT
);
#else
mtk_dma_set
(
pc
,
MTK_CQDMA_
SRC
2
,
0
);
mtk_dma_set
(
pc
,
MTK_CQDMA_
DST
2
,
0
);
#endif
/* setup the length */
...
...
This diff is collapsed.
Click to expand it.
drivers/dma/sh/rcar-dmac.c
View file @
d5963d87
...
...
@@ -1282,6 +1282,9 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan,
enum
dma_status
status
;
unsigned
int
residue
=
0
;
unsigned
int
dptr
=
0
;
unsigned
int
chcrb
;
unsigned
int
tcrb
;
unsigned
int
i
;
if
(
!
desc
)
return
0
;
...
...
@@ -1329,6 +1332,24 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan,
return
0
;
}
/*
* We need to read two registers.
* Make sure the control register does not skip to next chunk
* while reading the counter.
* Trying it 3 times should be enough: Initial read, retry, retry
* for the paranoid.
*/
for
(
i
=
0
;
i
<
3
;
i
++
)
{
chcrb
=
rcar_dmac_chan_read
(
chan
,
RCAR_DMACHCRB
)
&
RCAR_DMACHCRB_DPTR_MASK
;
tcrb
=
rcar_dmac_chan_read
(
chan
,
RCAR_DMATCRB
);
/* Still the same? */
if
(
chcrb
==
(
rcar_dmac_chan_read
(
chan
,
RCAR_DMACHCRB
)
&
RCAR_DMACHCRB_DPTR_MASK
))
break
;
}
WARN_ONCE
(
i
>=
3
,
"residue might be not continuous!"
);
/*
* In descriptor mode the descriptor running pointer is not maintained
* by the interrupt handler, find the running descriptor from the
...
...
@@ -1336,8 +1357,7 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan,
* mode just use the running descriptor pointer.
*/
if
(
desc
->
hwdescs
.
use
)
{
dptr
=
(
rcar_dmac_chan_read
(
chan
,
RCAR_DMACHCRB
)
&
RCAR_DMACHCRB_DPTR_MASK
)
>>
RCAR_DMACHCRB_DPTR_SHIFT
;
dptr
=
chcrb
>>
RCAR_DMACHCRB_DPTR_SHIFT
;
if
(
dptr
==
0
)
dptr
=
desc
->
nchunks
;
dptr
--
;
...
...
@@ -1355,7 +1375,7 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan,
}
/* Add the residue for the current chunk. */
residue
+=
rcar_dmac_chan_read
(
chan
,
RCAR_DMATCRB
)
<<
desc
->
xfer_shift
;
residue
+=
tcrb
<<
desc
->
xfer_shift
;
return
residue
;
}
...
...
@@ -1368,6 +1388,7 @@ static enum dma_status rcar_dmac_tx_status(struct dma_chan *chan,
enum
dma_status
status
;
unsigned
long
flags
;
unsigned
int
residue
;
bool
cyclic
;
status
=
dma_cookie_status
(
chan
,
cookie
,
txstate
);
if
(
status
==
DMA_COMPLETE
||
!
txstate
)
...
...
@@ -1375,10 +1396,11 @@ static enum dma_status rcar_dmac_tx_status(struct dma_chan *chan,
spin_lock_irqsave
(
&
rchan
->
lock
,
flags
);
residue
=
rcar_dmac_chan_get_residue
(
rchan
,
cookie
);
cyclic
=
rchan
->
desc
.
running
?
rchan
->
desc
.
running
->
cyclic
:
false
;
spin_unlock_irqrestore
(
&
rchan
->
lock
,
flags
);
/* if there's no residue, the cookie is complete */
if
(
!
residue
)
if
(
!
residue
&&
!
cyclic
)
return
DMA_COMPLETE
;
dma_set_residue
(
txstate
,
residue
);
...
...
This diff is collapsed.
Click to expand it.
drivers/gpio/gpio-eic-sprd.c
View file @
d5963d87
...
...
@@ -414,6 +414,7 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
irq_set_handler_locked
(
data
,
handle_edge_irq
);
break
;
case
IRQ_TYPE_EDGE_BOTH
:
sprd_eic_update
(
chip
,
offset
,
SPRD_EIC_SYNC_INTMODE
,
0
);
sprd_eic_update
(
chip
,
offset
,
SPRD_EIC_SYNC_INTBOTH
,
1
);
irq_set_handler_locked
(
data
,
handle_edge_irq
);
break
;
...
...
This diff is collapsed.
Click to expand it.
drivers/gpio/gpiolib.c
View file @
d5963d87
...
...
@@ -1379,7 +1379,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data,
status
=
gpiochip_add_irqchip
(
chip
,
lock_key
,
request_key
);
if
(
status
)
goto
err_re
move_chip
;
goto
err_
f
re
e_gpiochip_mask
;
status
=
of_gpiochip_add
(
chip
);
if
(
status
)
...
...
@@ -1387,7 +1387,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data,
status
=
gpiochip_init_valid_mask
(
chip
);
if
(
status
)
goto
err_remove_chip
;
goto
err_remove_
of_
chip
;
for
(
i
=
0
;
i
<
chip
->
ngpio
;
i
++
)
{
struct
gpio_desc
*
desc
=
&
gdev
->
descs
[
i
];
...
...
@@ -1415,14 +1415,18 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data,
if
(
gpiolib_initialized
)
{
status
=
gpiochip_setup_dev
(
gdev
);
if
(
status
)
goto
err_remove_chip
;
goto
err_remove_
acpi_
chip
;
}
return
0
;
err_remove_chip:
err_remove_
acpi_
chip:
acpi_gpiochip_remove
(
chip
);
err_remove_of_chip:
gpiochip_free_hogs
(
chip
);
of_gpiochip_remove
(
chip
);
err_remove_chip:
gpiochip_irqchip_remove
(
chip
);
err_free_gpiochip_mask:
gpiochip_free_valid_mask
(
chip
);
err_remove_irqchip_mask:
gpiochip_irqchip_free_valid_mask
(
chip
);
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment