mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
Merge tag 'v4.4.13' into linux-linaro-lsk-v4.4
This is the 4.4.13 stable release
This commit is contained in:
commit
c66b2190a1
|
|
@ -94,6 +94,7 @@ clocks and IDs.
|
|||
csi_sel 79
|
||||
iim_gate 80
|
||||
gpu2d_gate 81
|
||||
ckli_gate 82
|
||||
|
||||
Examples:
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ Currently, these files are in /proc/sys/fs:
|
|||
- nr_open
|
||||
- overflowuid
|
||||
- overflowgid
|
||||
- pipe-user-pages-hard
|
||||
- pipe-user-pages-soft
|
||||
- protected_hardlinks
|
||||
- protected_symlinks
|
||||
- suid_dumpable
|
||||
|
|
@ -159,6 +161,27 @@ The default is 65534.
|
|||
|
||||
==============================================================
|
||||
|
||||
pipe-user-pages-hard:
|
||||
|
||||
Maximum total number of pages a non-privileged user may allocate for pipes.
|
||||
Once this limit is reached, no new pipes may be allocated until usage goes
|
||||
below the limit again. When set to 0, no limit is applied, which is the default
|
||||
setting.
|
||||
|
||||
==============================================================
|
||||
|
||||
pipe-user-pages-soft:
|
||||
|
||||
Maximum total number of pages a non-privileged user may allocate for pipes
|
||||
before the pipe size gets limited to a single page. Once this limit is reached,
|
||||
new pipes will be limited to a single page in size for this user in order to
|
||||
limit total memory usage, and trying to increase them using fcntl() will be
|
||||
denied until usage goes below the limit again. The default value allows to
|
||||
allocate up to 1024 pipes at their default size. When set to 0, no limit is
|
||||
applied.
|
||||
|
||||
==============================================================
|
||||
|
||||
protected_hardlinks:
|
||||
|
||||
A long-standing class of security issues is the hardlink-based
|
||||
|
|
|
|||
4
Makefile
4
Makefile
|
|
@ -1,6 +1,6 @@
|
|||
VERSION = 4
|
||||
PATCHLEVEL = 4
|
||||
SUBLEVEL = 12
|
||||
SUBLEVEL = 13
|
||||
EXTRAVERSION =
|
||||
NAME = Blurry Fish Butt
|
||||
|
||||
|
|
@ -364,7 +364,7 @@ AFLAGS_MODULE =
|
|||
LDFLAGS_MODULE =
|
||||
CFLAGS_KERNEL =
|
||||
AFLAGS_KERNEL =
|
||||
CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
|
||||
CFLAGS_GCOV = -fprofile-arcs -ftest-coverage -fno-tree-loop-im
|
||||
|
||||
|
||||
# Use USERINCLUDE when you must reference the UAPI directories only.
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ button@1 {
|
|||
button@2 {
|
||||
label = "Factory Reset Button";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
|
||||
gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -260,7 +260,7 @@ power {
|
|||
};
|
||||
|
||||
sata {
|
||||
gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio1 22 GPIO_ACTIVE_LOW>;
|
||||
default-state = "off";
|
||||
};
|
||||
};
|
||||
|
|
@ -313,7 +313,7 @@ port@5 {
|
|||
|
||||
&pinctrl {
|
||||
keys_pin: keys-pin {
|
||||
marvell,pins = "mpp24", "mpp47";
|
||||
marvell,pins = "mpp24", "mpp29";
|
||||
marvell,function = "gpio";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -304,13 +304,13 @@ gpio_keys {
|
|||
button@1 {
|
||||
label = "WPS";
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
button@2 {
|
||||
label = "Factory Reset Button";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -298,6 +298,8 @@ max8997_pmic@66 {
|
|||
compatible = "maxim,max8997-pmic";
|
||||
|
||||
reg = <0x66>;
|
||||
interrupt-parent = <&gpx0>;
|
||||
interrupts = <7 0>;
|
||||
|
||||
max8997,pmic-buck1-uses-gpio-dvs;
|
||||
max8997,pmic-buck2-uses-gpio-dvs;
|
||||
|
|
|
|||
|
|
@ -837,8 +837,8 @@
|
|||
#define PIN_PD23__ISC_FIELD PINMUX_PIN(PIN_PD23, 6, 4)
|
||||
#define PIN_PD24 120
|
||||
#define PIN_PD24__GPIO PINMUX_PIN(PIN_PD24, 0, 0)
|
||||
#define PIN_PD24__UTXD2 PINMUX_PIN(PIN_PD23, 1, 2)
|
||||
#define PIN_PD24__FLEXCOM4_IO3 PINMUX_PIN(PIN_PD23, 3, 3)
|
||||
#define PIN_PD24__UTXD2 PINMUX_PIN(PIN_PD24, 1, 2)
|
||||
#define PIN_PD24__FLEXCOM4_IO3 PINMUX_PIN(PIN_PD24, 3, 3)
|
||||
#define PIN_PD25 121
|
||||
#define PIN_PD25__GPIO PINMUX_PIN(PIN_PD25, 0, 0)
|
||||
#define PIN_PD25__SPI1_SPCK PINMUX_PIN(PIN_PD25, 1, 3)
|
||||
|
|
|
|||
|
|
@ -31,13 +31,15 @@ static inline void prom_putchar_wait(void __iomem *reg, u32 mask, u32 val)
|
|||
} while (1);
|
||||
}
|
||||
|
||||
#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
|
||||
|
||||
static void prom_putchar_ar71xx(unsigned char ch)
|
||||
{
|
||||
void __iomem *base = (void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE));
|
||||
|
||||
prom_putchar_wait(base + UART_LSR * 4, UART_LSR_THRE, UART_LSR_THRE);
|
||||
prom_putchar_wait(base + UART_LSR * 4, BOTH_EMPTY, BOTH_EMPTY);
|
||||
__raw_writel(ch, base + UART_TX * 4);
|
||||
prom_putchar_wait(base + UART_LSR * 4, UART_LSR_THRE, UART_LSR_THRE);
|
||||
prom_putchar_wait(base + UART_LSR * 4, BOTH_EMPTY, BOTH_EMPTY);
|
||||
}
|
||||
|
||||
static void prom_putchar_ar933x(unsigned char ch)
|
||||
|
|
|
|||
|
|
@ -298,21 +298,21 @@
|
|||
.set pop
|
||||
.endm
|
||||
|
||||
.macro copy_u_w ws, n
|
||||
.macro copy_s_w ws, n
|
||||
.set push
|
||||
.set mips32r2
|
||||
.set fp=64
|
||||
.set msa
|
||||
copy_u.w $1, $w\ws[\n]
|
||||
copy_s.w $1, $w\ws[\n]
|
||||
.set pop
|
||||
.endm
|
||||
|
||||
.macro copy_u_d ws, n
|
||||
.macro copy_s_d ws, n
|
||||
.set push
|
||||
.set mips64r2
|
||||
.set fp=64
|
||||
.set msa
|
||||
copy_u.d $1, $w\ws[\n]
|
||||
copy_s.d $1, $w\ws[\n]
|
||||
.set pop
|
||||
.endm
|
||||
|
||||
|
|
@ -346,8 +346,8 @@
|
|||
#define STH_MSA_INSN 0x5800081f
|
||||
#define STW_MSA_INSN 0x5800082f
|
||||
#define STD_MSA_INSN 0x5800083f
|
||||
#define COPY_UW_MSA_INSN 0x58f00056
|
||||
#define COPY_UD_MSA_INSN 0x58f80056
|
||||
#define COPY_SW_MSA_INSN 0x58b00056
|
||||
#define COPY_SD_MSA_INSN 0x58b80056
|
||||
#define INSERT_W_MSA_INSN 0x59300816
|
||||
#define INSERT_D_MSA_INSN 0x59380816
|
||||
#else
|
||||
|
|
@ -361,8 +361,8 @@
|
|||
#define STH_MSA_INSN 0x78000825
|
||||
#define STW_MSA_INSN 0x78000826
|
||||
#define STD_MSA_INSN 0x78000827
|
||||
#define COPY_UW_MSA_INSN 0x78f00059
|
||||
#define COPY_UD_MSA_INSN 0x78f80059
|
||||
#define COPY_SW_MSA_INSN 0x78b00059
|
||||
#define COPY_SD_MSA_INSN 0x78b80059
|
||||
#define INSERT_W_MSA_INSN 0x79300819
|
||||
#define INSERT_D_MSA_INSN 0x79380819
|
||||
#endif
|
||||
|
|
@ -393,7 +393,7 @@
|
|||
.set push
|
||||
.set noat
|
||||
SET_HARDFLOAT
|
||||
addu $1, \base, \off
|
||||
PTR_ADDU $1, \base, \off
|
||||
.word LDB_MSA_INSN | (\wd << 6)
|
||||
.set pop
|
||||
.endm
|
||||
|
|
@ -402,7 +402,7 @@
|
|||
.set push
|
||||
.set noat
|
||||
SET_HARDFLOAT
|
||||
addu $1, \base, \off
|
||||
PTR_ADDU $1, \base, \off
|
||||
.word LDH_MSA_INSN | (\wd << 6)
|
||||
.set pop
|
||||
.endm
|
||||
|
|
@ -411,7 +411,7 @@
|
|||
.set push
|
||||
.set noat
|
||||
SET_HARDFLOAT
|
||||
addu $1, \base, \off
|
||||
PTR_ADDU $1, \base, \off
|
||||
.word LDW_MSA_INSN | (\wd << 6)
|
||||
.set pop
|
||||
.endm
|
||||
|
|
@ -420,7 +420,7 @@
|
|||
.set push
|
||||
.set noat
|
||||
SET_HARDFLOAT
|
||||
addu $1, \base, \off
|
||||
PTR_ADDU $1, \base, \off
|
||||
.word LDD_MSA_INSN | (\wd << 6)
|
||||
.set pop
|
||||
.endm
|
||||
|
|
@ -429,7 +429,7 @@
|
|||
.set push
|
||||
.set noat
|
||||
SET_HARDFLOAT
|
||||
addu $1, \base, \off
|
||||
PTR_ADDU $1, \base, \off
|
||||
.word STB_MSA_INSN | (\wd << 6)
|
||||
.set pop
|
||||
.endm
|
||||
|
|
@ -438,7 +438,7 @@
|
|||
.set push
|
||||
.set noat
|
||||
SET_HARDFLOAT
|
||||
addu $1, \base, \off
|
||||
PTR_ADDU $1, \base, \off
|
||||
.word STH_MSA_INSN | (\wd << 6)
|
||||
.set pop
|
||||
.endm
|
||||
|
|
@ -447,7 +447,7 @@
|
|||
.set push
|
||||
.set noat
|
||||
SET_HARDFLOAT
|
||||
addu $1, \base, \off
|
||||
PTR_ADDU $1, \base, \off
|
||||
.word STW_MSA_INSN | (\wd << 6)
|
||||
.set pop
|
||||
.endm
|
||||
|
|
@ -456,26 +456,26 @@
|
|||
.set push
|
||||
.set noat
|
||||
SET_HARDFLOAT
|
||||
addu $1, \base, \off
|
||||
PTR_ADDU $1, \base, \off
|
||||
.word STD_MSA_INSN | (\wd << 6)
|
||||
.set pop
|
||||
.endm
|
||||
|
||||
.macro copy_u_w ws, n
|
||||
.macro copy_s_w ws, n
|
||||
.set push
|
||||
.set noat
|
||||
SET_HARDFLOAT
|
||||
.insn
|
||||
.word COPY_UW_MSA_INSN | (\n << 16) | (\ws << 11)
|
||||
.word COPY_SW_MSA_INSN | (\n << 16) | (\ws << 11)
|
||||
.set pop
|
||||
.endm
|
||||
|
||||
.macro copy_u_d ws, n
|
||||
.macro copy_s_d ws, n
|
||||
.set push
|
||||
.set noat
|
||||
SET_HARDFLOAT
|
||||
.insn
|
||||
.word COPY_UD_MSA_INSN | (\n << 16) | (\ws << 11)
|
||||
.word COPY_SD_MSA_INSN | (\n << 16) | (\ws << 11)
|
||||
.set pop
|
||||
.endm
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ extern void (*flush_cache_range)(struct vm_area_struct *vma,
|
|||
unsigned long start, unsigned long end);
|
||||
extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn);
|
||||
extern void __flush_dcache_page(struct page *page);
|
||||
extern void __flush_icache_page(struct vm_area_struct *vma, struct page *page);
|
||||
|
||||
#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
|
||||
static inline void flush_dcache_page(struct page *page)
|
||||
|
|
@ -77,11 +76,6 @@ static inline void flush_anon_page(struct vm_area_struct *vma,
|
|||
static inline void flush_icache_page(struct vm_area_struct *vma,
|
||||
struct page *page)
|
||||
{
|
||||
if (!cpu_has_ic_fills_f_dc && (vma->vm_flags & VM_EXEC) &&
|
||||
Page_dcache_dirty(page)) {
|
||||
__flush_icache_page(vma, page);
|
||||
ClearPageDcacheDirty(page);
|
||||
}
|
||||
}
|
||||
|
||||
extern void (*flush_icache_range)(unsigned long start, unsigned long end);
|
||||
|
|
|
|||
|
|
@ -147,6 +147,19 @@ static inline void restore_msa(struct task_struct *t)
|
|||
_restore_msa(t);
|
||||
}
|
||||
|
||||
static inline void init_msa_upper(void)
|
||||
{
|
||||
/*
|
||||
* Check cpu_has_msa only if it's a constant. This will allow the
|
||||
* compiler to optimise out code for CPUs without MSA without adding
|
||||
* an extra redundant check for CPUs with MSA.
|
||||
*/
|
||||
if (__builtin_constant_p(cpu_has_msa) && !cpu_has_msa)
|
||||
return;
|
||||
|
||||
_init_msa_upper();
|
||||
}
|
||||
|
||||
#ifdef TOOLCHAIN_SUPPORTS_MSA
|
||||
|
||||
#define __BUILD_MSA_CTL_REG(name, cs) \
|
||||
|
|
|
|||
|
|
@ -127,10 +127,14 @@ do { \
|
|||
} \
|
||||
} while(0)
|
||||
|
||||
static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
|
||||
pte_t *ptep, pte_t pteval);
|
||||
|
||||
#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
|
||||
|
||||
#define pte_none(pte) (!(((pte).pte_high) & ~_PAGE_GLOBAL))
|
||||
#define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT)
|
||||
#define pte_no_exec(pte) ((pte).pte_low & _PAGE_NO_EXEC)
|
||||
|
||||
static inline void set_pte(pte_t *ptep, pte_t pte)
|
||||
{
|
||||
|
|
@ -148,7 +152,6 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
|
|||
buddy->pte_high |= _PAGE_GLOBAL;
|
||||
}
|
||||
}
|
||||
#define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
|
||||
|
||||
static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
|
||||
{
|
||||
|
|
@ -166,6 +169,7 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt
|
|||
|
||||
#define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL))
|
||||
#define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
|
||||
#define pte_no_exec(pte) (pte_val(pte) & _PAGE_NO_EXEC)
|
||||
|
||||
/*
|
||||
* Certain architectures need to do special things when pte's
|
||||
|
|
@ -218,7 +222,6 @@ static inline void set_pte(pte_t *ptep, pte_t pteval)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
#define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
|
||||
|
||||
static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
|
||||
{
|
||||
|
|
@ -234,6 +237,22 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt
|
|||
}
|
||||
#endif
|
||||
|
||||
static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
|
||||
pte_t *ptep, pte_t pteval)
|
||||
{
|
||||
extern void __update_cache(unsigned long address, pte_t pte);
|
||||
|
||||
if (!pte_present(pteval))
|
||||
goto cache_sync_done;
|
||||
|
||||
if (pte_present(*ptep) && (pte_pfn(*ptep) == pte_pfn(pteval)))
|
||||
goto cache_sync_done;
|
||||
|
||||
__update_cache(addr, pteval);
|
||||
cache_sync_done:
|
||||
set_pte(ptep, pteval);
|
||||
}
|
||||
|
||||
/*
|
||||
* (pmds are folded into puds so this doesn't get actually called,
|
||||
* but the define is needed for a generic inline function.)
|
||||
|
|
@ -430,15 +449,12 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
|
|||
|
||||
extern void __update_tlb(struct vm_area_struct *vma, unsigned long address,
|
||||
pte_t pte);
|
||||
extern void __update_cache(struct vm_area_struct *vma, unsigned long address,
|
||||
pte_t pte);
|
||||
|
||||
static inline void update_mmu_cache(struct vm_area_struct *vma,
|
||||
unsigned long address, pte_t *ptep)
|
||||
{
|
||||
pte_t pte = *ptep;
|
||||
__update_tlb(vma, address, pte);
|
||||
__update_cache(vma, address, pte);
|
||||
}
|
||||
|
||||
static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ do { \
|
|||
__clear_software_ll_bit(); \
|
||||
if (cpu_has_userlocal) \
|
||||
write_c0_userlocal(task_thread_info(next)->tp_value); \
|
||||
__restore_watch(); \
|
||||
__restore_watch(next); \
|
||||
(last) = resume(prev, next, task_thread_info(next)); \
|
||||
} while (0)
|
||||
|
||||
|
|
|
|||
|
|
@ -12,21 +12,21 @@
|
|||
|
||||
#include <asm/mipsregs.h>
|
||||
|
||||
void mips_install_watch_registers(void);
|
||||
void mips_install_watch_registers(struct task_struct *t);
|
||||
void mips_read_watch_registers(void);
|
||||
void mips_clear_watch_registers(void);
|
||||
void mips_probe_watch_registers(struct cpuinfo_mips *c);
|
||||
|
||||
#ifdef CONFIG_HARDWARE_WATCHPOINTS
|
||||
#define __restore_watch() do { \
|
||||
#define __restore_watch(task) do { \
|
||||
if (unlikely(test_bit(TIF_LOAD_WATCH, \
|
||||
¤t_thread_info()->flags))) { \
|
||||
mips_install_watch_registers(); \
|
||||
&task_thread_info(task)->flags))) { \
|
||||
mips_install_watch_registers(task); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
#define __restore_watch() do {} while (0)
|
||||
#define __restore_watch(task) do {} while (0)
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_WATCH_H */
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#define __ARCH_SIGSYS
|
||||
|
||||
#include <uapi/asm-generic/siginfo.h>
|
||||
#include <asm-generic/siginfo.h>
|
||||
|
||||
/* We can't use generic siginfo_t, because our si_code and si_errno are swapped */
|
||||
typedef struct siginfo {
|
||||
|
|
@ -42,13 +42,13 @@ typedef struct siginfo {
|
|||
|
||||
/* kill() */
|
||||
struct {
|
||||
pid_t _pid; /* sender's pid */
|
||||
__kernel_pid_t _pid; /* sender's pid */
|
||||
__ARCH_SI_UID_T _uid; /* sender's uid */
|
||||
} _kill;
|
||||
|
||||
/* POSIX.1b timers */
|
||||
struct {
|
||||
timer_t _tid; /* timer id */
|
||||
__kernel_timer_t _tid; /* timer id */
|
||||
int _overrun; /* overrun count */
|
||||
char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
|
||||
sigval_t _sigval; /* same as below */
|
||||
|
|
@ -57,26 +57,26 @@ typedef struct siginfo {
|
|||
|
||||
/* POSIX.1b signals */
|
||||
struct {
|
||||
pid_t _pid; /* sender's pid */
|
||||
__kernel_pid_t _pid; /* sender's pid */
|
||||
__ARCH_SI_UID_T _uid; /* sender's uid */
|
||||
sigval_t _sigval;
|
||||
} _rt;
|
||||
|
||||
/* SIGCHLD */
|
||||
struct {
|
||||
pid_t _pid; /* which child */
|
||||
__kernel_pid_t _pid; /* which child */
|
||||
__ARCH_SI_UID_T _uid; /* sender's uid */
|
||||
int _status; /* exit code */
|
||||
clock_t _utime;
|
||||
clock_t _stime;
|
||||
__kernel_clock_t _utime;
|
||||
__kernel_clock_t _stime;
|
||||
} _sigchld;
|
||||
|
||||
/* IRIX SIGCHLD */
|
||||
struct {
|
||||
pid_t _pid; /* which child */
|
||||
clock_t _utime;
|
||||
__kernel_pid_t _pid; /* which child */
|
||||
__kernel_clock_t _utime;
|
||||
int _status; /* exit code */
|
||||
clock_t _stime;
|
||||
__kernel_clock_t _stime;
|
||||
} _irix_sigchld;
|
||||
|
||||
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
|
||||
|
|
@ -118,6 +118,4 @@ typedef struct siginfo {
|
|||
#define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
|
||||
#define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
|
||||
|
||||
#include <asm-generic/siginfo.h>
|
||||
|
||||
#endif /* _UAPI_ASM_SIGINFO_H */
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include <asm/inst.h>
|
||||
#include <asm/mips-r2-to-r6-emul.h>
|
||||
#include <asm/local.h>
|
||||
#include <asm/mipsregs.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
|
|
@ -1251,10 +1252,10 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
|
|||
" j 10b\n"
|
||||
" .previous\n"
|
||||
" .section __ex_table,\"a\"\n"
|
||||
" .word 1b,8b\n"
|
||||
" .word 2b,8b\n"
|
||||
" .word 3b,8b\n"
|
||||
" .word 4b,8b\n"
|
||||
STR(PTR) " 1b,8b\n"
|
||||
STR(PTR) " 2b,8b\n"
|
||||
STR(PTR) " 3b,8b\n"
|
||||
STR(PTR) " 4b,8b\n"
|
||||
" .previous\n"
|
||||
" .set pop\n"
|
||||
: "+&r"(rt), "=&r"(rs),
|
||||
|
|
@ -1326,10 +1327,10 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
|
|||
" j 10b\n"
|
||||
" .previous\n"
|
||||
" .section __ex_table,\"a\"\n"
|
||||
" .word 1b,8b\n"
|
||||
" .word 2b,8b\n"
|
||||
" .word 3b,8b\n"
|
||||
" .word 4b,8b\n"
|
||||
STR(PTR) " 1b,8b\n"
|
||||
STR(PTR) " 2b,8b\n"
|
||||
STR(PTR) " 3b,8b\n"
|
||||
STR(PTR) " 4b,8b\n"
|
||||
" .previous\n"
|
||||
" .set pop\n"
|
||||
: "+&r"(rt), "=&r"(rs),
|
||||
|
|
@ -1397,10 +1398,10 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
|
|||
" j 9b\n"
|
||||
" .previous\n"
|
||||
" .section __ex_table,\"a\"\n"
|
||||
" .word 1b,8b\n"
|
||||
" .word 2b,8b\n"
|
||||
" .word 3b,8b\n"
|
||||
" .word 4b,8b\n"
|
||||
STR(PTR) " 1b,8b\n"
|
||||
STR(PTR) " 2b,8b\n"
|
||||
STR(PTR) " 3b,8b\n"
|
||||
STR(PTR) " 4b,8b\n"
|
||||
" .previous\n"
|
||||
" .set pop\n"
|
||||
: "+&r"(rt), "=&r"(rs),
|
||||
|
|
@ -1467,10 +1468,10 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
|
|||
" j 9b\n"
|
||||
" .previous\n"
|
||||
" .section __ex_table,\"a\"\n"
|
||||
" .word 1b,8b\n"
|
||||
" .word 2b,8b\n"
|
||||
" .word 3b,8b\n"
|
||||
" .word 4b,8b\n"
|
||||
STR(PTR) " 1b,8b\n"
|
||||
STR(PTR) " 2b,8b\n"
|
||||
STR(PTR) " 3b,8b\n"
|
||||
STR(PTR) " 4b,8b\n"
|
||||
" .previous\n"
|
||||
" .set pop\n"
|
||||
: "+&r"(rt), "=&r"(rs),
|
||||
|
|
@ -1582,14 +1583,14 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
|
|||
" j 9b\n"
|
||||
" .previous\n"
|
||||
" .section __ex_table,\"a\"\n"
|
||||
" .word 1b,8b\n"
|
||||
" .word 2b,8b\n"
|
||||
" .word 3b,8b\n"
|
||||
" .word 4b,8b\n"
|
||||
" .word 5b,8b\n"
|
||||
" .word 6b,8b\n"
|
||||
" .word 7b,8b\n"
|
||||
" .word 0b,8b\n"
|
||||
STR(PTR) " 1b,8b\n"
|
||||
STR(PTR) " 2b,8b\n"
|
||||
STR(PTR) " 3b,8b\n"
|
||||
STR(PTR) " 4b,8b\n"
|
||||
STR(PTR) " 5b,8b\n"
|
||||
STR(PTR) " 6b,8b\n"
|
||||
STR(PTR) " 7b,8b\n"
|
||||
STR(PTR) " 0b,8b\n"
|
||||
" .previous\n"
|
||||
" .set pop\n"
|
||||
: "+&r"(rt), "=&r"(rs),
|
||||
|
|
@ -1701,14 +1702,14 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
|
|||
" j 9b\n"
|
||||
" .previous\n"
|
||||
" .section __ex_table,\"a\"\n"
|
||||
" .word 1b,8b\n"
|
||||
" .word 2b,8b\n"
|
||||
" .word 3b,8b\n"
|
||||
" .word 4b,8b\n"
|
||||
" .word 5b,8b\n"
|
||||
" .word 6b,8b\n"
|
||||
" .word 7b,8b\n"
|
||||
" .word 0b,8b\n"
|
||||
STR(PTR) " 1b,8b\n"
|
||||
STR(PTR) " 2b,8b\n"
|
||||
STR(PTR) " 3b,8b\n"
|
||||
STR(PTR) " 4b,8b\n"
|
||||
STR(PTR) " 5b,8b\n"
|
||||
STR(PTR) " 6b,8b\n"
|
||||
STR(PTR) " 7b,8b\n"
|
||||
STR(PTR) " 0b,8b\n"
|
||||
" .previous\n"
|
||||
" .set pop\n"
|
||||
: "+&r"(rt), "=&r"(rs),
|
||||
|
|
@ -1820,14 +1821,14 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
|
|||
" j 9b\n"
|
||||
" .previous\n"
|
||||
" .section __ex_table,\"a\"\n"
|
||||
" .word 1b,8b\n"
|
||||
" .word 2b,8b\n"
|
||||
" .word 3b,8b\n"
|
||||
" .word 4b,8b\n"
|
||||
" .word 5b,8b\n"
|
||||
" .word 6b,8b\n"
|
||||
" .word 7b,8b\n"
|
||||
" .word 0b,8b\n"
|
||||
STR(PTR) " 1b,8b\n"
|
||||
STR(PTR) " 2b,8b\n"
|
||||
STR(PTR) " 3b,8b\n"
|
||||
STR(PTR) " 4b,8b\n"
|
||||
STR(PTR) " 5b,8b\n"
|
||||
STR(PTR) " 6b,8b\n"
|
||||
STR(PTR) " 7b,8b\n"
|
||||
STR(PTR) " 0b,8b\n"
|
||||
" .previous\n"
|
||||
" .set pop\n"
|
||||
: "+&r"(rt), "=&r"(rs),
|
||||
|
|
@ -1938,14 +1939,14 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
|
|||
" j 9b\n"
|
||||
" .previous\n"
|
||||
" .section __ex_table,\"a\"\n"
|
||||
" .word 1b,8b\n"
|
||||
" .word 2b,8b\n"
|
||||
" .word 3b,8b\n"
|
||||
" .word 4b,8b\n"
|
||||
" .word 5b,8b\n"
|
||||
" .word 6b,8b\n"
|
||||
" .word 7b,8b\n"
|
||||
" .word 0b,8b\n"
|
||||
STR(PTR) " 1b,8b\n"
|
||||
STR(PTR) " 2b,8b\n"
|
||||
STR(PTR) " 3b,8b\n"
|
||||
STR(PTR) " 4b,8b\n"
|
||||
STR(PTR) " 5b,8b\n"
|
||||
STR(PTR) " 6b,8b\n"
|
||||
STR(PTR) " 7b,8b\n"
|
||||
STR(PTR) " 0b,8b\n"
|
||||
" .previous\n"
|
||||
" .set pop\n"
|
||||
: "+&r"(rt), "=&r"(rs),
|
||||
|
|
@ -2000,7 +2001,7 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
|
|||
"j 2b\n"
|
||||
".previous\n"
|
||||
".section __ex_table,\"a\"\n"
|
||||
".word 1b, 3b\n"
|
||||
STR(PTR) " 1b,3b\n"
|
||||
".previous\n"
|
||||
: "=&r"(res), "+&r"(err)
|
||||
: "r"(vaddr), "i"(SIGSEGV)
|
||||
|
|
@ -2058,7 +2059,7 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
|
|||
"j 2b\n"
|
||||
".previous\n"
|
||||
".section __ex_table,\"a\"\n"
|
||||
".word 1b, 3b\n"
|
||||
STR(PTR) " 1b,3b\n"
|
||||
".previous\n"
|
||||
: "+&r"(res), "+&r"(err)
|
||||
: "r"(vaddr), "i"(SIGSEGV));
|
||||
|
|
@ -2119,7 +2120,7 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
|
|||
"j 2b\n"
|
||||
".previous\n"
|
||||
".section __ex_table,\"a\"\n"
|
||||
".word 1b, 3b\n"
|
||||
STR(PTR) " 1b,3b\n"
|
||||
".previous\n"
|
||||
: "=&r"(res), "+&r"(err)
|
||||
: "r"(vaddr), "i"(SIGSEGV)
|
||||
|
|
@ -2182,7 +2183,7 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
|
|||
"j 2b\n"
|
||||
".previous\n"
|
||||
".section __ex_table,\"a\"\n"
|
||||
".word 1b, 3b\n"
|
||||
STR(PTR) " 1b,3b\n"
|
||||
".previous\n"
|
||||
: "+&r"(res), "+&r"(err)
|
||||
: "r"(vaddr), "i"(SIGSEGV));
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ static void mips_cpu_restore(void)
|
|||
write_c0_userlocal(current_thread_info()->tp_value);
|
||||
|
||||
/* Restore watch registers */
|
||||
__restore_watch();
|
||||
__restore_watch(current);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ unsigned long notrace unwind_stack_by_address(unsigned long stack_page,
|
|||
*sp + sizeof(*regs) <= stack_page + THREAD_SIZE - 32) {
|
||||
regs = (struct pt_regs *)*sp;
|
||||
pc = regs->cp0_epc;
|
||||
if (__kernel_text_address(pc)) {
|
||||
if (!user_mode(regs) && __kernel_text_address(pc)) {
|
||||
*sp = regs->regs[29];
|
||||
*ra = regs->regs[31];
|
||||
return pc;
|
||||
|
|
@ -603,6 +603,9 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)
|
|||
if (!(value & PR_FP_MODE_FR) && cpu_has_fpu && cpu_has_mips_r6)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/* Proceed with the mode switch */
|
||||
preempt_disable();
|
||||
|
||||
/* Save FP & vector context, then disable FPU & MSA */
|
||||
if (task->signal == current->signal)
|
||||
lose_fpu(1);
|
||||
|
|
@ -661,6 +664,7 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)
|
|||
|
||||
/* Allow threads to use FP again */
|
||||
atomic_set(&task->mm->context.fp_mode_switching, 0);
|
||||
preempt_enable();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,8 +57,7 @@ static void init_fp_ctx(struct task_struct *target)
|
|||
/* Begin with data registers set to all 1s... */
|
||||
memset(&target->thread.fpu.fpr, ~0, sizeof(target->thread.fpu.fpr));
|
||||
|
||||
/* ...and FCSR zeroed */
|
||||
target->thread.fpu.fcr31 = 0;
|
||||
/* FCSR has been preset by `mips_set_personality_nan'. */
|
||||
|
||||
/*
|
||||
* Record that the target has "used" math, such that the context
|
||||
|
|
@ -79,6 +78,22 @@ void ptrace_disable(struct task_struct *child)
|
|||
clear_tsk_thread_flag(child, TIF_LOAD_WATCH);
|
||||
}
|
||||
|
||||
/*
|
||||
* Poke at FCSR according to its mask. Don't set the cause bits as
|
||||
* this is currently not handled correctly in FP context restoration
|
||||
* and will cause an oops if a corresponding enable bit is set.
|
||||
*/
|
||||
static void ptrace_setfcr31(struct task_struct *child, u32 value)
|
||||
{
|
||||
u32 fcr31;
|
||||
u32 mask;
|
||||
|
||||
value &= ~FPU_CSR_ALL_X;
|
||||
fcr31 = child->thread.fpu.fcr31;
|
||||
mask = boot_cpu_data.fpu_msk31;
|
||||
child->thread.fpu.fcr31 = (value & ~mask) | (fcr31 & mask);
|
||||
}
|
||||
|
||||
/*
|
||||
* Read a general register set. We always use the 64-bit format, even
|
||||
* for 32-bit kernels and for 32-bit processes on a 64-bit kernel.
|
||||
|
|
@ -159,9 +174,7 @@ int ptrace_setfpregs(struct task_struct *child, __u32 __user *data)
|
|||
{
|
||||
union fpureg *fregs;
|
||||
u64 fpr_val;
|
||||
u32 fcr31;
|
||||
u32 value;
|
||||
u32 mask;
|
||||
int i;
|
||||
|
||||
if (!access_ok(VERIFY_READ, data, 33 * 8))
|
||||
|
|
@ -176,9 +189,7 @@ int ptrace_setfpregs(struct task_struct *child, __u32 __user *data)
|
|||
}
|
||||
|
||||
__get_user(value, data + 64);
|
||||
fcr31 = child->thread.fpu.fcr31;
|
||||
mask = boot_cpu_data.fpu_msk31;
|
||||
child->thread.fpu.fcr31 = (value & ~mask) | (fcr31 & mask);
|
||||
ptrace_setfcr31(child, value);
|
||||
|
||||
/* FIR may not be written. */
|
||||
|
||||
|
|
@ -808,7 +819,7 @@ long arch_ptrace(struct task_struct *child, long request,
|
|||
break;
|
||||
#endif
|
||||
case FPC_CSR:
|
||||
child->thread.fpu.fcr31 = data & ~FPU_CSR_ALL_X;
|
||||
ptrace_setfcr31(child, data);
|
||||
break;
|
||||
case DSP_BASE ... DSP_BASE + 5: {
|
||||
dspreg_t *dregs;
|
||||
|
|
|
|||
|
|
@ -244,17 +244,17 @@ LEAF(\name)
|
|||
.set push
|
||||
.set noat
|
||||
#ifdef CONFIG_64BIT
|
||||
copy_u_d \wr, 1
|
||||
copy_s_d \wr, 1
|
||||
EX sd $1, \off(\base)
|
||||
#elif defined(CONFIG_CPU_LITTLE_ENDIAN)
|
||||
copy_u_w \wr, 2
|
||||
copy_s_w \wr, 2
|
||||
EX sw $1, \off(\base)
|
||||
copy_u_w \wr, 3
|
||||
copy_s_w \wr, 3
|
||||
EX sw $1, (\off+4)(\base)
|
||||
#else /* CONFIG_CPU_BIG_ENDIAN */
|
||||
copy_u_w \wr, 2
|
||||
copy_s_w \wr, 2
|
||||
EX sw $1, (\off+4)(\base)
|
||||
copy_u_w \wr, 3
|
||||
copy_s_w \wr, 3
|
||||
EX sw $1, \off(\base)
|
||||
#endif
|
||||
.set pop
|
||||
|
|
|
|||
|
|
@ -706,6 +706,9 @@ static void __init arch_mem_init(char **cmdline_p)
|
|||
for_each_memblock(reserved, reg)
|
||||
if (reg->size != 0)
|
||||
reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT);
|
||||
|
||||
reserve_bootmem_region(__pa_symbol(&__nosave_begin),
|
||||
__pa_symbol(&__nosave_end)); /* Reserve for hibernation */
|
||||
}
|
||||
|
||||
static void __init resource_init(void)
|
||||
|
|
|
|||
|
|
@ -195,6 +195,9 @@ static int restore_msa_extcontext(void __user *buf, unsigned int size)
|
|||
unsigned int csr;
|
||||
int i, err;
|
||||
|
||||
if (!config_enabled(CONFIG_CPU_HAS_MSA))
|
||||
return SIGSYS;
|
||||
|
||||
if (size != sizeof(*msa))
|
||||
return -EINVAL;
|
||||
|
||||
|
|
@ -398,8 +401,8 @@ int protected_restore_fp_context(void __user *sc)
|
|||
}
|
||||
|
||||
fp_done:
|
||||
if (used & USED_EXTCONTEXT)
|
||||
err |= restore_extcontext(sc_to_extcontext(sc));
|
||||
if (!err && (used & USED_EXTCONTEXT))
|
||||
err = restore_extcontext(sc_to_extcontext(sc));
|
||||
|
||||
return err ?: sig;
|
||||
}
|
||||
|
|
@ -767,15 +770,7 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
|
|||
sigset_t *oldset = sigmask_to_save();
|
||||
int ret;
|
||||
struct mips_abi *abi = current->thread.abi;
|
||||
#ifdef CONFIG_CPU_MICROMIPS
|
||||
void *vdso;
|
||||
unsigned long tmp = (unsigned long)current->mm->context.vdso;
|
||||
|
||||
set_isa16_mode(tmp);
|
||||
vdso = (void *)tmp;
|
||||
#else
|
||||
void *vdso = current->mm->context.vdso;
|
||||
#endif
|
||||
|
||||
if (regs->regs[0]) {
|
||||
switch(regs->regs[2]) {
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ static void show_backtrace(struct task_struct *task, const struct pt_regs *regs)
|
|||
if (!task)
|
||||
task = current;
|
||||
|
||||
if (raw_show_trace || !__kernel_text_address(pc)) {
|
||||
if (raw_show_trace || user_mode(regs) || !__kernel_text_address(pc)) {
|
||||
show_raw_backtrace(sp);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1241,7 +1241,7 @@ static int enable_restore_fp_context(int msa)
|
|||
err = init_fpu();
|
||||
if (msa && !err) {
|
||||
enable_msa();
|
||||
_init_msa_upper();
|
||||
init_msa_upper();
|
||||
set_thread_flag(TIF_USEDMSA);
|
||||
set_thread_flag(TIF_MSA_CTX_LIVE);
|
||||
}
|
||||
|
|
@ -1304,7 +1304,7 @@ static int enable_restore_fp_context(int msa)
|
|||
*/
|
||||
prior_msa = test_and_set_thread_flag(TIF_MSA_CTX_LIVE);
|
||||
if (!prior_msa && was_fpu_owner) {
|
||||
_init_msa_upper();
|
||||
init_msa_upper();
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -1321,7 +1321,7 @@ static int enable_restore_fp_context(int msa)
|
|||
* of each vector register such that it cannot see data left
|
||||
* behind by another task.
|
||||
*/
|
||||
_init_msa_upper();
|
||||
init_msa_upper();
|
||||
} else {
|
||||
/* We need to restore the vector context. */
|
||||
restore_msa(current);
|
||||
|
|
|
|||
|
|
@ -15,10 +15,9 @@
|
|||
* Install the watch registers for the current thread. A maximum of
|
||||
* four registers are installed although the machine may have more.
|
||||
*/
|
||||
void mips_install_watch_registers(void)
|
||||
void mips_install_watch_registers(struct task_struct *t)
|
||||
{
|
||||
struct mips3264_watch_reg_state *watches =
|
||||
¤t->thread.watch.mips3264;
|
||||
struct mips3264_watch_reg_state *watches = &t->thread.watch.mips3264;
|
||||
switch (current_cpu_data.watch_reg_use_cnt) {
|
||||
default:
|
||||
BUG();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "libgcc.h"
|
||||
|
||||
long long __ashldi3(long long u, word_type b)
|
||||
long long notrace __ashldi3(long long u, word_type b)
|
||||
{
|
||||
DWunion uu, w;
|
||||
word_type bm;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "libgcc.h"
|
||||
|
||||
long long __ashrdi3(long long u, word_type b)
|
||||
long long notrace __ashrdi3(long long u, word_type b)
|
||||
{
|
||||
DWunion uu, w;
|
||||
word_type bm;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <linux/module.h>
|
||||
|
||||
unsigned long long __bswapdi2(unsigned long long u)
|
||||
unsigned long long notrace __bswapdi2(unsigned long long u)
|
||||
{
|
||||
return (((u) & 0xff00000000000000ull) >> 56) |
|
||||
(((u) & 0x00ff000000000000ull) >> 40) |
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <linux/module.h>
|
||||
|
||||
unsigned int __bswapsi2(unsigned int u)
|
||||
unsigned int notrace __bswapsi2(unsigned int u)
|
||||
{
|
||||
return (((u) & 0xff000000) >> 24) |
|
||||
(((u) & 0x00ff0000) >> 8) |
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "libgcc.h"
|
||||
|
||||
word_type __cmpdi2(long long a, long long b)
|
||||
word_type notrace __cmpdi2(long long a, long long b)
|
||||
{
|
||||
const DWunion au = {
|
||||
.ll = a
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "libgcc.h"
|
||||
|
||||
long long __lshrdi3(long long u, word_type b)
|
||||
long long notrace __lshrdi3(long long u, word_type b)
|
||||
{
|
||||
DWunion uu, w;
|
||||
word_type bm;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "libgcc.h"
|
||||
|
||||
word_type __ucmpdi2(unsigned long long a, unsigned long long b)
|
||||
word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b)
|
||||
{
|
||||
const DWunion au = {.ll = a};
|
||||
const DWunion bu = {.ll = b};
|
||||
|
|
|
|||
|
|
@ -213,10 +213,10 @@ static void __init node_mem_init(unsigned int node)
|
|||
BOOTMEM_DEFAULT);
|
||||
|
||||
if (node == 0 && node_end_pfn(0) >= (0xffffffff >> PAGE_SHIFT)) {
|
||||
/* Reserve 0xff800000~0xffffffff for RS780E integrated GPU */
|
||||
/* Reserve 0xfe000000~0xffffffff for RS780E integrated GPU */
|
||||
reserve_bootmem_node(NODE_DATA(node),
|
||||
(node_addrspace_offset | 0xff800000),
|
||||
8 << 20, BOOTMEM_DEFAULT);
|
||||
(node_addrspace_offset | 0xfe000000),
|
||||
32 << 20, BOOTMEM_DEFAULT);
|
||||
}
|
||||
|
||||
sparse_memory_present_with_active_regions(node);
|
||||
|
|
|
|||
|
|
@ -445,9 +445,11 @@ static int isBranchInstr(struct pt_regs *regs, struct mm_decoded_insn dec_insn,
|
|||
case spec_op:
|
||||
switch (insn.r_format.func) {
|
||||
case jalr_op:
|
||||
regs->regs[insn.r_format.rd] =
|
||||
regs->cp0_epc + dec_insn.pc_inc +
|
||||
dec_insn.next_pc_inc;
|
||||
if (insn.r_format.rd != 0) {
|
||||
regs->regs[insn.r_format.rd] =
|
||||
regs->cp0_epc + dec_insn.pc_inc +
|
||||
dec_insn.next_pc_inc;
|
||||
}
|
||||
/* Fall through */
|
||||
case jr_op:
|
||||
/* For R6, JR already emulated in jalr_op */
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include <linux/mm.h>
|
||||
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/highmem.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/cpu.h>
|
||||
#include <asm/cpu-features.h>
|
||||
|
|
@ -83,8 +84,6 @@ void __flush_dcache_page(struct page *page)
|
|||
struct address_space *mapping = page_mapping(page);
|
||||
unsigned long addr;
|
||||
|
||||
if (PageHighMem(page))
|
||||
return;
|
||||
if (mapping && !mapping_mapped(mapping)) {
|
||||
SetPageDcacheDirty(page);
|
||||
return;
|
||||
|
|
@ -95,8 +94,15 @@ void __flush_dcache_page(struct page *page)
|
|||
* case is for exec env/arg pages and those are %99 certainly going to
|
||||
* get faulted into the tlb (and thus flushed) anyways.
|
||||
*/
|
||||
addr = (unsigned long) page_address(page);
|
||||
if (PageHighMem(page))
|
||||
addr = (unsigned long)kmap_atomic(page);
|
||||
else
|
||||
addr = (unsigned long)page_address(page);
|
||||
|
||||
flush_data_cache_page(addr);
|
||||
|
||||
if (PageHighMem(page))
|
||||
__kunmap_atomic((void *)addr);
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(__flush_dcache_page);
|
||||
|
|
@ -119,33 +125,28 @@ void __flush_anon_page(struct page *page, unsigned long vmaddr)
|
|||
|
||||
EXPORT_SYMBOL(__flush_anon_page);
|
||||
|
||||
void __flush_icache_page(struct vm_area_struct *vma, struct page *page)
|
||||
{
|
||||
unsigned long addr;
|
||||
|
||||
if (PageHighMem(page))
|
||||
return;
|
||||
|
||||
addr = (unsigned long) page_address(page);
|
||||
flush_data_cache_page(addr);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__flush_icache_page);
|
||||
|
||||
void __update_cache(struct vm_area_struct *vma, unsigned long address,
|
||||
pte_t pte)
|
||||
void __update_cache(unsigned long address, pte_t pte)
|
||||
{
|
||||
struct page *page;
|
||||
unsigned long pfn, addr;
|
||||
int exec = (vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc;
|
||||
int exec = !pte_no_exec(pte) && !cpu_has_ic_fills_f_dc;
|
||||
|
||||
pfn = pte_pfn(pte);
|
||||
if (unlikely(!pfn_valid(pfn)))
|
||||
return;
|
||||
page = pfn_to_page(pfn);
|
||||
if (page_mapping(page) && Page_dcache_dirty(page)) {
|
||||
addr = (unsigned long) page_address(page);
|
||||
if (Page_dcache_dirty(page)) {
|
||||
if (PageHighMem(page))
|
||||
addr = (unsigned long)kmap_atomic(page);
|
||||
else
|
||||
addr = (unsigned long)page_address(page);
|
||||
|
||||
if (exec || pages_do_alias(addr, address & PAGE_MASK))
|
||||
flush_data_cache_page(addr);
|
||||
|
||||
if (PageHighMem(page))
|
||||
__kunmap_atomic((void *)addr);
|
||||
|
||||
ClearPageDcacheDirty(page);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,12 @@ obj-vdso-y := elf.o gettimeofday.o sigreturn.o
|
|||
ccflags-vdso := \
|
||||
$(filter -I%,$(KBUILD_CFLAGS)) \
|
||||
$(filter -E%,$(KBUILD_CFLAGS)) \
|
||||
$(filter -mmicromips,$(KBUILD_CFLAGS)) \
|
||||
$(filter -march=%,$(KBUILD_CFLAGS))
|
||||
cflags-vdso := $(ccflags-vdso) \
|
||||
$(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
|
||||
-O2 -g -fPIC -fno-common -fno-builtin -G 0 -DDISABLE_BRANCH_PROFILING \
|
||||
-O2 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
|
||||
-DDISABLE_BRANCH_PROFILING \
|
||||
$(call cc-option, -fno-stack-protector)
|
||||
aflags-vdso := $(ccflags-vdso) \
|
||||
$(filter -I%,$(KBUILD_CFLAGS)) \
|
||||
|
|
|
|||
|
|
@ -1072,7 +1072,7 @@ void eeh_add_device_early(struct pci_dn *pdn)
|
|||
struct pci_controller *phb;
|
||||
struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
|
||||
|
||||
if (!edev || !eeh_enabled())
|
||||
if (!edev)
|
||||
return;
|
||||
|
||||
if (!eeh_has_flag(EEH_PROBE_MODE_DEVTREE))
|
||||
|
|
|
|||
|
|
@ -166,6 +166,16 @@ static void *eeh_dev_save_state(void *data, void *userdata)
|
|||
if (!edev)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* We cannot access the config space on some adapters.
|
||||
* Otherwise, it will cause fenced PHB. We don't save
|
||||
* the content in their config space and will restore
|
||||
* from the initial config space saved when the EEH
|
||||
* device is created.
|
||||
*/
|
||||
if (edev->pe && (edev->pe->state & EEH_PE_CFG_RESTRICTED))
|
||||
return NULL;
|
||||
|
||||
pdev = eeh_dev_to_pci_dev(edev);
|
||||
if (!pdev)
|
||||
return NULL;
|
||||
|
|
@ -305,6 +315,19 @@ static void *eeh_dev_restore_state(void *data, void *userdata)
|
|||
if (!edev)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* The content in the config space isn't saved because
|
||||
* the blocked config space on some adapters. We have
|
||||
* to restore the initial saved config space when the
|
||||
* EEH device is created.
|
||||
*/
|
||||
if (edev->pe && (edev->pe->state & EEH_PE_CFG_RESTRICTED)) {
|
||||
if (list_is_last(&edev->list, &edev->pe->edevs))
|
||||
eeh_pe_restore_bars(edev->pe);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pdev = eeh_dev_to_pci_dev(edev);
|
||||
if (!pdev)
|
||||
return NULL;
|
||||
|
|
@ -504,9 +527,6 @@ int eeh_pe_reset_and_recover(struct eeh_pe *pe)
|
|||
/* Save states */
|
||||
eeh_pe_dev_traverse(pe, eeh_dev_save_state, NULL);
|
||||
|
||||
/* Report error */
|
||||
eeh_pe_dev_traverse(pe, eeh_report_error, &result);
|
||||
|
||||
/* Issue reset */
|
||||
ret = eeh_reset_pe(pe);
|
||||
if (ret) {
|
||||
|
|
|
|||
|
|
@ -962,11 +962,6 @@ hv_facility_unavailable_relon_trampoline:
|
|||
#endif
|
||||
STD_RELON_EXCEPTION_PSERIES(0x5700, 0x1700, altivec_assist)
|
||||
|
||||
/* Other future vectors */
|
||||
.align 7
|
||||
.globl __end_interrupts
|
||||
__end_interrupts:
|
||||
|
||||
.align 7
|
||||
system_call_entry:
|
||||
b system_call_common
|
||||
|
|
@ -1253,6 +1248,17 @@ __end_handlers:
|
|||
STD_RELON_EXCEPTION_PSERIES_OOL(0xf60, facility_unavailable)
|
||||
STD_RELON_EXCEPTION_HV_OOL(0xf80, hv_facility_unavailable)
|
||||
|
||||
/*
|
||||
* The __end_interrupts marker must be past the out-of-line (OOL)
|
||||
* handlers, so that they are copied to real address 0x100 when running
|
||||
* a relocatable kernel. This ensures they can be reached from the short
|
||||
* trampoline handlers (like 0x4f00, 0x4f20, etc.) which branch
|
||||
* directly, without using LOAD_HANDLER().
|
||||
*/
|
||||
.align 7
|
||||
.globl __end_interrupts
|
||||
__end_interrupts:
|
||||
|
||||
#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)
|
||||
/*
|
||||
* Data area reserved for FWNMI option.
|
||||
|
|
|
|||
|
|
@ -393,6 +393,9 @@ static unsigned long __init xen_set_identity_and_remap_chunk(
|
|||
unsigned long i = 0;
|
||||
unsigned long n = end_pfn - start_pfn;
|
||||
|
||||
if (remap_pfn == 0)
|
||||
remap_pfn = nr_pages;
|
||||
|
||||
while (i < n) {
|
||||
unsigned long cur_pfn = start_pfn + i;
|
||||
unsigned long left = n - i;
|
||||
|
|
@ -438,17 +441,29 @@ static unsigned long __init xen_set_identity_and_remap_chunk(
|
|||
return remap_pfn;
|
||||
}
|
||||
|
||||
static void __init xen_set_identity_and_remap(unsigned long nr_pages)
|
||||
static unsigned long __init xen_count_remap_pages(
|
||||
unsigned long start_pfn, unsigned long end_pfn, unsigned long nr_pages,
|
||||
unsigned long remap_pages)
|
||||
{
|
||||
if (start_pfn >= nr_pages)
|
||||
return remap_pages;
|
||||
|
||||
return remap_pages + min(end_pfn, nr_pages) - start_pfn;
|
||||
}
|
||||
|
||||
static unsigned long __init xen_foreach_remap_area(unsigned long nr_pages,
|
||||
unsigned long (*func)(unsigned long start_pfn, unsigned long end_pfn,
|
||||
unsigned long nr_pages, unsigned long last_val))
|
||||
{
|
||||
phys_addr_t start = 0;
|
||||
unsigned long last_pfn = nr_pages;
|
||||
unsigned long ret_val = 0;
|
||||
const struct e820entry *entry = xen_e820_map;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Combine non-RAM regions and gaps until a RAM region (or the
|
||||
* end of the map) is reached, then set the 1:1 map and
|
||||
* remap the memory in those non-RAM regions.
|
||||
* end of the map) is reached, then call the provided function
|
||||
* to perform its duty on the non-RAM region.
|
||||
*
|
||||
* The combined non-RAM regions are rounded to a whole number
|
||||
* of pages so any partial pages are accessible via the 1:1
|
||||
|
|
@ -466,14 +481,13 @@ static void __init xen_set_identity_and_remap(unsigned long nr_pages)
|
|||
end_pfn = PFN_UP(entry->addr);
|
||||
|
||||
if (start_pfn < end_pfn)
|
||||
last_pfn = xen_set_identity_and_remap_chunk(
|
||||
start_pfn, end_pfn, nr_pages,
|
||||
last_pfn);
|
||||
ret_val = func(start_pfn, end_pfn, nr_pages,
|
||||
ret_val);
|
||||
start = end;
|
||||
}
|
||||
}
|
||||
|
||||
pr_info("Released %ld page(s)\n", xen_released_pages);
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -596,35 +610,6 @@ static void __init xen_ignore_unusable(void)
|
|||
}
|
||||
}
|
||||
|
||||
static unsigned long __init xen_count_remap_pages(unsigned long max_pfn)
|
||||
{
|
||||
unsigned long extra = 0;
|
||||
unsigned long start_pfn, end_pfn;
|
||||
const struct e820entry *entry = xen_e820_map;
|
||||
int i;
|
||||
|
||||
end_pfn = 0;
|
||||
for (i = 0; i < xen_e820_map_entries; i++, entry++) {
|
||||
start_pfn = PFN_DOWN(entry->addr);
|
||||
/* Adjacent regions on non-page boundaries handling! */
|
||||
end_pfn = min(end_pfn, start_pfn);
|
||||
|
||||
if (start_pfn >= max_pfn)
|
||||
return extra + max_pfn - end_pfn;
|
||||
|
||||
/* Add any holes in map to result. */
|
||||
extra += start_pfn - end_pfn;
|
||||
|
||||
end_pfn = PFN_UP(entry->addr + entry->size);
|
||||
end_pfn = min(end_pfn, max_pfn);
|
||||
|
||||
if (entry->type != E820_RAM)
|
||||
extra += end_pfn - start_pfn;
|
||||
}
|
||||
|
||||
return extra;
|
||||
}
|
||||
|
||||
bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size)
|
||||
{
|
||||
struct e820entry *entry;
|
||||
|
|
@ -804,7 +789,7 @@ char * __init xen_memory_setup(void)
|
|||
max_pages = xen_get_max_pages();
|
||||
|
||||
/* How many extra pages do we need due to remapping? */
|
||||
max_pages += xen_count_remap_pages(max_pfn);
|
||||
max_pages += xen_foreach_remap_area(max_pfn, xen_count_remap_pages);
|
||||
|
||||
if (max_pages > max_pfn)
|
||||
extra_pages += max_pages - max_pfn;
|
||||
|
|
@ -922,7 +907,9 @@ char * __init xen_memory_setup(void)
|
|||
* Set identity map on non-RAM pages and prepare remapping the
|
||||
* underlying RAM.
|
||||
*/
|
||||
xen_set_identity_and_remap(max_pfn);
|
||||
xen_foreach_remap_area(max_pfn, xen_set_identity_and_remap_chunk);
|
||||
|
||||
pr_info("Released %ld page(s)\n", xen_released_pages);
|
||||
|
||||
return "Xen";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1262,14 +1262,15 @@ int dpm_suspend_late(pm_message_t state)
|
|||
error = device_suspend_late(dev);
|
||||
|
||||
mutex_lock(&dpm_list_mtx);
|
||||
if (!list_empty(&dev->power.entry))
|
||||
list_move(&dev->power.entry, &dpm_late_early_list);
|
||||
|
||||
if (error) {
|
||||
pm_dev_err(dev, state, " late", error);
|
||||
dpm_save_failed_dev(dev_name(dev));
|
||||
put_device(dev);
|
||||
break;
|
||||
}
|
||||
if (!list_empty(&dev->power.entry))
|
||||
list_move(&dev->power.entry, &dpm_late_early_list);
|
||||
put_device(dev);
|
||||
|
||||
if (async_error)
|
||||
|
|
|
|||
|
|
@ -1468,11 +1468,16 @@ int pm_runtime_force_resume(struct device *dev)
|
|||
goto out;
|
||||
}
|
||||
|
||||
ret = callback(dev);
|
||||
ret = pm_runtime_set_active(dev);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
pm_runtime_set_active(dev);
|
||||
ret = callback(dev);
|
||||
if (ret) {
|
||||
pm_runtime_set_suspended(dev);
|
||||
goto out;
|
||||
}
|
||||
|
||||
pm_runtime_mark_last_busy(dev);
|
||||
out:
|
||||
pm_runtime_enable(dev);
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ static int exynos_read(struct hwrng *rng, void *buf,
|
|||
struct exynos_rng, rng);
|
||||
u32 *data = buf;
|
||||
int retry = 100;
|
||||
int ret = 4;
|
||||
|
||||
pm_runtime_get_sync(exynos_rng->dev);
|
||||
|
||||
|
|
@ -97,17 +98,20 @@ static int exynos_read(struct hwrng *rng, void *buf,
|
|||
while (!(exynos_rng_readl(exynos_rng,
|
||||
EXYNOS_PRNG_STATUS_OFFSET) & PRNG_DONE) && --retry)
|
||||
cpu_relax();
|
||||
if (!retry)
|
||||
return -ETIMEDOUT;
|
||||
if (!retry) {
|
||||
ret = -ETIMEDOUT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
exynos_rng_writel(exynos_rng, PRNG_DONE, EXYNOS_PRNG_STATUS_OFFSET);
|
||||
|
||||
*data = exynos_rng_readl(exynos_rng, EXYNOS_PRNG_OUT1_OFFSET);
|
||||
|
||||
out:
|
||||
pm_runtime_mark_last_busy(exynos_rng->dev);
|
||||
pm_runtime_put_sync_autosuspend(exynos_rng->dev);
|
||||
|
||||
return 4;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int exynos_rng_probe(struct platform_device *pdev)
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ void __init of_sama5d4_clk_h32mx_setup(struct device_node *np,
|
|||
h32mxclk->pmc = pmc;
|
||||
|
||||
clk = clk_register(NULL, &h32mxclk->hw);
|
||||
if (!clk) {
|
||||
if (IS_ERR(clk)) {
|
||||
kfree(h32mxclk);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -890,8 +890,14 @@ static void bcm2835_pll_off(struct clk_hw *hw)
|
|||
struct bcm2835_cprman *cprman = pll->cprman;
|
||||
const struct bcm2835_pll_data *data = pll->data;
|
||||
|
||||
cprman_write(cprman, data->cm_ctrl_reg, CM_PLL_ANARST);
|
||||
cprman_write(cprman, data->a2w_ctrl_reg, A2W_PLL_CTRL_PWRDN);
|
||||
spin_lock(&cprman->regs_lock);
|
||||
cprman_write(cprman, data->cm_ctrl_reg,
|
||||
cprman_read(cprman, data->cm_ctrl_reg) |
|
||||
CM_PLL_ANARST);
|
||||
cprman_write(cprman, data->a2w_ctrl_reg,
|
||||
cprman_read(cprman, data->a2w_ctrl_reg) |
|
||||
A2W_PLL_CTRL_PWRDN);
|
||||
spin_unlock(&cprman->regs_lock);
|
||||
}
|
||||
|
||||
static int bcm2835_pll_on(struct clk_hw *hw)
|
||||
|
|
@ -901,6 +907,10 @@ static int bcm2835_pll_on(struct clk_hw *hw)
|
|||
const struct bcm2835_pll_data *data = pll->data;
|
||||
ktime_t timeout;
|
||||
|
||||
cprman_write(cprman, data->a2w_ctrl_reg,
|
||||
cprman_read(cprman, data->a2w_ctrl_reg) &
|
||||
~A2W_PLL_CTRL_PWRDN);
|
||||
|
||||
/* Take the PLL out of reset. */
|
||||
cprman_write(cprman, data->cm_ctrl_reg,
|
||||
cprman_read(cprman, data->cm_ctrl_reg) & ~CM_PLL_ANARST);
|
||||
|
|
@ -1171,8 +1181,9 @@ static u32 bcm2835_clock_choose_div(struct clk_hw *hw,
|
|||
div &= ~unused_frac_mask;
|
||||
}
|
||||
|
||||
/* Clamp to the limits. */
|
||||
div = max(div, unused_frac_mask + 1);
|
||||
/* clamp to min divider of 1 */
|
||||
div = max_t(u32, div, 1 << CM_DIV_FRAC_BITS);
|
||||
/* clamp to the highest possible fractional divider */
|
||||
div = min_t(u32, div, GENMASK(data->int_bits + CM_DIV_FRAC_BITS - 1,
|
||||
CM_DIV_FRAC_BITS - data->frac_bits));
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ static const char *std_sel[] = {"ppll", "arm"};
|
|||
static const char *ipg_per_sel[] = {"ahb_per_div", "arm_per_div"};
|
||||
|
||||
enum mx35_clks {
|
||||
ckih, ckil, mpll, ppll, mpll_075, arm, hsp, hsp_div, hsp_sel, ahb, ipg,
|
||||
ckih, mpll, ppll, mpll_075, arm, hsp, hsp_div, hsp_sel, ahb, ipg,
|
||||
arm_per_div, ahb_per_div, ipg_per, uart_sel, uart_div, esdhc_sel,
|
||||
esdhc1_div, esdhc2_div, esdhc3_div, spdif_sel, spdif_div_pre,
|
||||
spdif_div_post, ssi_sel, ssi1_div_pre, ssi1_div_post, ssi2_div_pre,
|
||||
|
|
@ -79,7 +79,7 @@ enum mx35_clks {
|
|||
rtc_gate, rtic_gate, scc_gate, sdma_gate, spba_gate, spdif_gate,
|
||||
ssi1_gate, ssi2_gate, uart1_gate, uart2_gate, uart3_gate, usbotg_gate,
|
||||
wdog_gate, max_gate, admux_gate, csi_gate, csi_div, csi_sel, iim_gate,
|
||||
gpu2d_gate, clk_max
|
||||
gpu2d_gate, ckil, clk_max
|
||||
};
|
||||
|
||||
static struct clk *clk[clk_max];
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv,
|
|||
tick_broadcast_exit();
|
||||
}
|
||||
|
||||
if (!cpuidle_state_is_coupled(drv, entered_state))
|
||||
if (!cpuidle_state_is_coupled(drv, index))
|
||||
local_irq_enable();
|
||||
|
||||
diff = ktime_to_us(ktime_sub(time_end, time_start));
|
||||
|
|
@ -433,6 +433,8 @@ static void __cpuidle_unregister_device(struct cpuidle_device *dev)
|
|||
list_del(&dev->device_list);
|
||||
per_cpu(cpuidle_devices, dev->cpu) = NULL;
|
||||
module_put(drv->owner);
|
||||
|
||||
dev->registered = 0;
|
||||
}
|
||||
|
||||
static void __cpuidle_device_init(struct cpuidle_device *dev)
|
||||
|
|
|
|||
|
|
@ -194,12 +194,12 @@ int amdgpu_connector_get_monitor_bpc(struct drm_connector *connector)
|
|||
bpc = 8;
|
||||
DRM_DEBUG("%s: HDMI deep color 10 bpc exceeds max tmds clock. Using %d bpc.\n",
|
||||
connector->name, bpc);
|
||||
} else if (bpc > 8) {
|
||||
/* max_tmds_clock missing, but hdmi spec mandates it for deep color. */
|
||||
DRM_DEBUG("%s: Required max tmds clock for HDMI deep color missing. Using 8 bpc.\n",
|
||||
connector->name);
|
||||
bpc = 8;
|
||||
}
|
||||
} else if (bpc > 8) {
|
||||
/* max_tmds_clock missing, but hdmi spec mandates it for deep color. */
|
||||
DRM_DEBUG("%s: Required max tmds clock for HDMI deep color missing. Using 8 bpc.\n",
|
||||
connector->name);
|
||||
bpc = 8;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ u32 amdgpu_dpm_get_vrefresh(struct amdgpu_device *adev)
|
|||
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
|
||||
amdgpu_crtc = to_amdgpu_crtc(crtc);
|
||||
if (crtc->enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) {
|
||||
vrefresh = amdgpu_crtc->hw_mode.vrefresh;
|
||||
vrefresh = drm_mode_vrefresh(&amdgpu_crtc->hw_mode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state)
|
|||
for (i = 0; i < state->num_connector; i++) {
|
||||
struct drm_connector *connector = state->connectors[i];
|
||||
|
||||
if (!connector)
|
||||
if (!connector || !connector->funcs)
|
||||
continue;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1899,7 +1899,6 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
|
|||
int n, int width, int height)
|
||||
{
|
||||
int c, o;
|
||||
struct drm_device *dev = fb_helper->dev;
|
||||
struct drm_connector *connector;
|
||||
const struct drm_connector_helper_funcs *connector_funcs;
|
||||
struct drm_encoder *encoder;
|
||||
|
|
@ -1918,7 +1917,7 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
|
|||
if (modes[n] == NULL)
|
||||
return best_score;
|
||||
|
||||
crtcs = kzalloc(dev->mode_config.num_connector *
|
||||
crtcs = kzalloc(fb_helper->connector_count *
|
||||
sizeof(struct drm_fb_helper_crtc *), GFP_KERNEL);
|
||||
if (!crtcs)
|
||||
return best_score;
|
||||
|
|
@ -1964,7 +1963,7 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
|
|||
if (score > best_score) {
|
||||
best_score = score;
|
||||
memcpy(best_crtcs, crtcs,
|
||||
dev->mode_config.num_connector *
|
||||
fb_helper->connector_count *
|
||||
sizeof(struct drm_fb_helper_crtc *));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ static const char *const dsi_errors[] = {
|
|||
"RX Prot Violation",
|
||||
"HS Generic Write FIFO Full",
|
||||
"LP Generic Write FIFO Full",
|
||||
"Generic Read Data Avail"
|
||||
"Generic Read Data Avail",
|
||||
"Special Packet Sent",
|
||||
"Tearing Effect",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -362,12 +362,12 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
|
|||
uint64_t conn_configured = 0, mask;
|
||||
int pass = 0;
|
||||
|
||||
save_enabled = kcalloc(dev->mode_config.num_connector, sizeof(bool),
|
||||
save_enabled = kcalloc(fb_helper->connector_count, sizeof(bool),
|
||||
GFP_KERNEL);
|
||||
if (!save_enabled)
|
||||
return false;
|
||||
|
||||
memcpy(save_enabled, enabled, dev->mode_config.num_connector);
|
||||
memcpy(save_enabled, enabled, fb_helper->connector_count);
|
||||
mask = (1 << fb_helper->connector_count) - 1;
|
||||
retry:
|
||||
for (i = 0; i < fb_helper->connector_count; i++) {
|
||||
|
|
@ -501,7 +501,7 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
|
|||
if (fallback) {
|
||||
bail:
|
||||
DRM_DEBUG_KMS("Not using firmware configuration\n");
|
||||
memcpy(enabled, save_enabled, dev->mode_config.num_connector);
|
||||
memcpy(enabled, save_enabled, fb_helper->connector_count);
|
||||
kfree(save_enabled);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3880,6 +3880,8 @@ static void ilk_pipe_wm_get_hw_state(struct drm_crtc *crtc)
|
|||
if (IS_HASWELL(dev) || IS_BROADWELL(dev))
|
||||
hw->wm_linetime[pipe] = I915_READ(PIPE_WM_LINETIME(pipe));
|
||||
|
||||
memset(active, 0, sizeof(*active));
|
||||
|
||||
active->pipe_enabled = intel_crtc->active;
|
||||
|
||||
if (active->pipe_enabled) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include <drm/drm_fb_cma_helper.h>
|
||||
#include <drm/drm_plane_helper.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <video/imx-ipu-v3.h>
|
||||
|
||||
#include "imx-drm.h"
|
||||
|
||||
|
|
@ -504,6 +505,13 @@ static int compare_of(struct device *dev, void *data)
|
|||
{
|
||||
struct device_node *np = data;
|
||||
|
||||
/* Special case for DI, dev->of_node may not be set yet */
|
||||
if (strcmp(dev->driver->name, "imx-ipuv3-crtc") == 0) {
|
||||
struct ipu_client_platformdata *pdata = dev->platform_data;
|
||||
|
||||
return pdata->of_node == np;
|
||||
}
|
||||
|
||||
/* Special case for LDB, one device for two channels */
|
||||
if (of_node_cmp(np->name, "lvds-channel") == 0) {
|
||||
np = of_get_parent(np);
|
||||
|
|
|
|||
|
|
@ -369,7 +369,7 @@ static int ipu_crtc_init(struct ipu_crtc *ipu_crtc,
|
|||
|
||||
ret = imx_drm_add_crtc(drm, &ipu_crtc->base, &ipu_crtc->imx_crtc,
|
||||
&ipu_crtc->plane[0]->base, &ipu_crtc_helper_funcs,
|
||||
ipu_crtc->dev->of_node);
|
||||
pdata->of_node);
|
||||
if (ret) {
|
||||
dev_err(ipu_crtc->dev, "adding crtc failed with %d.\n", ret);
|
||||
goto err_put_resources;
|
||||
|
|
|
|||
|
|
@ -3273,19 +3273,19 @@ static const struct vmw_cmd_entry vmw_cmd_entries[SVGA_3D_CMD_MAX] = {
|
|||
&vmw_cmd_dx_cid_check, true, false, true),
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_DEFINE_QUERY, &vmw_cmd_dx_define_query,
|
||||
true, false, true),
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_DESTROY_QUERY, &vmw_cmd_ok,
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_DESTROY_QUERY, &vmw_cmd_dx_cid_check,
|
||||
true, false, true),
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_BIND_QUERY, &vmw_cmd_dx_bind_query,
|
||||
true, false, true),
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_SET_QUERY_OFFSET,
|
||||
&vmw_cmd_ok, true, false, true),
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_BEGIN_QUERY, &vmw_cmd_ok,
|
||||
&vmw_cmd_dx_cid_check, true, false, true),
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_BEGIN_QUERY, &vmw_cmd_dx_cid_check,
|
||||
true, false, true),
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_END_QUERY, &vmw_cmd_ok,
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_END_QUERY, &vmw_cmd_dx_cid_check,
|
||||
true, false, true),
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_READBACK_QUERY, &vmw_cmd_invalid,
|
||||
true, false, true),
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_SET_PREDICATION, &vmw_cmd_invalid,
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_SET_PREDICATION, &vmw_cmd_dx_cid_check,
|
||||
true, false, true),
|
||||
VMW_CMD_DEF(SVGA_3D_CMD_DX_SET_VIEWPORTS, &vmw_cmd_dx_cid_check,
|
||||
true, false, true),
|
||||
|
|
|
|||
|
|
@ -573,9 +573,9 @@ static int vmw_fb_set_par(struct fb_info *info)
|
|||
mode = old_mode;
|
||||
old_mode = NULL;
|
||||
} else if (!vmw_kms_validate_mode_vram(vmw_priv,
|
||||
mode->hdisplay *
|
||||
(var->bits_per_pixel + 7) / 8,
|
||||
mode->vdisplay)) {
|
||||
mode->hdisplay *
|
||||
DIV_ROUND_UP(var->bits_per_pixel, 8),
|
||||
mode->vdisplay)) {
|
||||
drm_mode_destroy(vmw_priv->dev, mode);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -997,7 +997,7 @@ struct ipu_platform_reg {
|
|||
};
|
||||
|
||||
/* These must be in the order of the corresponding device tree port nodes */
|
||||
static const struct ipu_platform_reg client_reg[] = {
|
||||
static struct ipu_platform_reg client_reg[] = {
|
||||
{
|
||||
.pdata = {
|
||||
.csi = 0,
|
||||
|
|
@ -1048,7 +1048,7 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)
|
|||
mutex_unlock(&ipu_client_id_mutex);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(client_reg); i++) {
|
||||
const struct ipu_platform_reg *reg = &client_reg[i];
|
||||
struct ipu_platform_reg *reg = &client_reg[i];
|
||||
struct platform_device *pdev;
|
||||
struct device_node *of_node;
|
||||
|
||||
|
|
@ -1070,6 +1070,7 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)
|
|||
|
||||
pdev->dev.parent = dev;
|
||||
|
||||
reg->pdata.of_node = of_node;
|
||||
ret = platform_device_add_data(pdev, ®->pdata,
|
||||
sizeof(reg->pdata));
|
||||
if (!ret)
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ static int ads7828_probe(struct i2c_client *client,
|
|||
unsigned int vref_mv = ADS7828_INT_VREF_MV;
|
||||
bool diff_input = false;
|
||||
bool ext_vref = false;
|
||||
unsigned int regval;
|
||||
|
||||
data = devm_kzalloc(dev, sizeof(struct ads7828_data), GFP_KERNEL);
|
||||
if (!data)
|
||||
|
|
@ -154,6 +155,15 @@ static int ads7828_probe(struct i2c_client *client,
|
|||
if (!diff_input)
|
||||
data->cmd_byte |= ADS7828_CMD_SD_SE;
|
||||
|
||||
/*
|
||||
* Datasheet specifies internal reference voltage is disabled by
|
||||
* default. The internal reference voltage needs to be enabled and
|
||||
* voltage needs to settle before getting valid ADC data. So perform a
|
||||
* dummy read to enable the internal reference voltage.
|
||||
*/
|
||||
if (!ext_vref)
|
||||
regmap_read(data->regmap, data->cmd_byte, ®val);
|
||||
|
||||
hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
|
||||
data,
|
||||
ads7828_groups);
|
||||
|
|
|
|||
|
|
@ -893,9 +893,15 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
|
||||
#define UI_SET_PHYS_COMPAT _IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t)
|
||||
|
||||
static long uinput_compat_ioctl(struct file *file,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
if (cmd == UI_SET_PHYS_COMPAT)
|
||||
cmd = UI_SET_PHYS;
|
||||
|
||||
return uinput_ioctl_handler(file, cmd, arg, compat_ptr(arg));
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -280,7 +280,8 @@ static int put_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __user
|
|||
static int put_v4l2_create32(struct v4l2_create_buffers *kp, struct v4l2_create_buffers32 __user *up)
|
||||
{
|
||||
if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_create_buffers32)) ||
|
||||
copy_to_user(up, kp, offsetof(struct v4l2_create_buffers32, format)))
|
||||
copy_to_user(up, kp, offsetof(struct v4l2_create_buffers32, format)) ||
|
||||
copy_to_user(up->reserved, kp->reserved, sizeof(kp->reserved)))
|
||||
return -EFAULT;
|
||||
return __put_v4l2_format32(&kp->format, &up->format);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#define LPSS_DEV_SIZE 0x200
|
||||
#define LPSS_PRIV_OFFSET 0x200
|
||||
#define LPSS_PRIV_SIZE 0x100
|
||||
#define LPSS_PRIV_REG_COUNT (LPSS_PRIV_SIZE / 4)
|
||||
#define LPSS_IDMA64_OFFSET 0x800
|
||||
#define LPSS_IDMA64_SIZE 0x800
|
||||
|
||||
|
|
@ -75,6 +76,7 @@ struct intel_lpss {
|
|||
const struct mfd_cell *cell;
|
||||
struct device *dev;
|
||||
void __iomem *priv;
|
||||
u32 priv_ctx[LPSS_PRIV_REG_COUNT];
|
||||
int devid;
|
||||
u32 caps;
|
||||
u32 active_ltr;
|
||||
|
|
@ -485,6 +487,16 @@ EXPORT_SYMBOL_GPL(intel_lpss_prepare);
|
|||
|
||||
int intel_lpss_suspend(struct device *dev)
|
||||
{
|
||||
struct intel_lpss *lpss = dev_get_drvdata(dev);
|
||||
unsigned int i;
|
||||
|
||||
/* Save device context */
|
||||
for (i = 0; i < LPSS_PRIV_REG_COUNT; i++)
|
||||
lpss->priv_ctx[i] = readl(lpss->priv + i * 4);
|
||||
|
||||
/* Put the device into reset state */
|
||||
writel(0, lpss->priv + LPSS_PRIV_RESETS);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(intel_lpss_suspend);
|
||||
|
|
@ -492,8 +504,13 @@ EXPORT_SYMBOL_GPL(intel_lpss_suspend);
|
|||
int intel_lpss_resume(struct device *dev)
|
||||
{
|
||||
struct intel_lpss *lpss = dev_get_drvdata(dev);
|
||||
unsigned int i;
|
||||
|
||||
intel_lpss_init_dev(lpss);
|
||||
intel_lpss_deassert_reset(lpss);
|
||||
|
||||
/* Restore device context */
|
||||
for (i = 0; i < LPSS_PRIV_REG_COUNT; i++)
|
||||
writel(lpss->priv_ctx[i], lpss->priv + i * 4);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ static struct gpiod_lookup_table panel_gpio_table = {
|
|||
.table = {
|
||||
/* Panel EN/DISABLE */
|
||||
GPIO_LOOKUP("gpio_crystalcove", 94, "panel", GPIO_ACTIVE_HIGH),
|
||||
{ },
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1681,6 +1681,10 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode)
|
|||
goto err_hif_stop;
|
||||
}
|
||||
|
||||
ar->free_vdev_map = (1LL << ar->max_num_vdevs) - 1;
|
||||
|
||||
INIT_LIST_HEAD(&ar->arvifs);
|
||||
|
||||
/* we don't care about HTT in UTF mode */
|
||||
if (mode == ATH10K_FIRMWARE_MODE_NORMAL) {
|
||||
status = ath10k_htt_setup(&ar->htt);
|
||||
|
|
@ -1694,10 +1698,6 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode)
|
|||
if (status)
|
||||
goto err_hif_stop;
|
||||
|
||||
ar->free_vdev_map = (1LL << ar->max_num_vdevs) - 1;
|
||||
|
||||
INIT_LIST_HEAD(&ar->arvifs);
|
||||
|
||||
return 0;
|
||||
|
||||
err_hif_stop:
|
||||
|
|
|
|||
|
|
@ -1986,7 +1986,12 @@ static ssize_t ath10k_write_pktlog_filter(struct file *file,
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (filter && (filter != ar->debug.pktlog_filter)) {
|
||||
if (filter == ar->debug.pktlog_filter) {
|
||||
ret = count;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (filter) {
|
||||
ret = ath10k_wmi_pdev_pktlog_enable(ar, filter);
|
||||
if (ret) {
|
||||
ath10k_warn(ar, "failed to enable pktlog filter %x: %d\n",
|
||||
|
|
|
|||
|
|
@ -4456,7 +4456,10 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
|
|||
goto err_vdev_delete;
|
||||
}
|
||||
|
||||
if (ar->cfg_tx_chainmask) {
|
||||
/* Configuring number of spatial stream for monitor interface is causing
|
||||
* target assert in qca9888 and qca6174.
|
||||
*/
|
||||
if (ar->cfg_tx_chainmask && (vif->type != NL80211_IFTYPE_MONITOR)) {
|
||||
u16 nss = get_nss_from_chainmask(ar->cfg_tx_chainmask);
|
||||
|
||||
vdev_param = ar->wmi.vdev_param->nss;
|
||||
|
|
@ -6416,7 +6419,13 @@ ath10k_mac_update_rx_channel(struct ath10k *ar,
|
|||
def = &vifs[0].new_ctx->def;
|
||||
|
||||
ar->rx_channel = def->chan;
|
||||
} else if (ctx && ath10k_mac_num_chanctxs(ar) == 0) {
|
||||
} else if ((ctx && ath10k_mac_num_chanctxs(ar) == 0) ||
|
||||
(ctx && (ar->state == ATH10K_STATE_RESTARTED))) {
|
||||
/* During driver restart due to firmware assert, since mac80211
|
||||
* already has valid channel context for given radio, channel
|
||||
* context iteration return num_chanctx > 0. So fix rx_channel
|
||||
* when restart is in progress.
|
||||
*/
|
||||
ar->rx_channel = ctx->def.chan;
|
||||
} else {
|
||||
ar->rx_channel = NULL;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ static const struct pci_device_id ath5k_led_devices[] = {
|
|||
/* HP Compaq CQ60-206US (ddreggors@jumptv.com) */
|
||||
{ ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137a), ATH_LED(3, 1) },
|
||||
/* HP Compaq C700 (nitrousnrg@gmail.com) */
|
||||
{ ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 1) },
|
||||
{ ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 0) },
|
||||
/* LiteOn AR5BXB63 (magooz@salug.it) */
|
||||
{ ATH_SDEVICE(PCI_VENDOR_ID_ATHEROS, 0x3067), ATH_LED(3, 0) },
|
||||
/* IBM-specific AR5212 (all others) */
|
||||
|
|
|
|||
|
|
@ -49,6 +49,10 @@ int ath9k_led_blink;
|
|||
module_param_named(blink, ath9k_led_blink, int, 0444);
|
||||
MODULE_PARM_DESC(blink, "Enable LED blink on activity");
|
||||
|
||||
static int ath9k_led_active_high = -1;
|
||||
module_param_named(led_active_high, ath9k_led_active_high, int, 0444);
|
||||
MODULE_PARM_DESC(led_active_high, "Invert LED polarity");
|
||||
|
||||
static int ath9k_btcoex_enable;
|
||||
module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444);
|
||||
MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence");
|
||||
|
|
@ -600,6 +604,9 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (ath9k_led_active_high != -1)
|
||||
ah->config.led_active_high = ath9k_led_active_high == 1;
|
||||
|
||||
/*
|
||||
* Enable WLAN/BT RX Antenna diversity only when:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -28,6 +28,16 @@ static const struct pci_device_id ath_pci_id_table[] = {
|
|||
{ PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */
|
||||
{ PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */
|
||||
{ PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */
|
||||
|
||||
#ifdef CONFIG_ATH9K_PCOEM
|
||||
/* Mini PCI AR9220 MB92 cards: Compex WLM200NX, Wistron DNMA-92 */
|
||||
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
|
||||
0x0029,
|
||||
PCI_VENDOR_ID_ATHEROS,
|
||||
0x2096),
|
||||
.driver_data = ATH9K_PCI_LED_ACT_HI },
|
||||
#endif
|
||||
|
||||
{ PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */
|
||||
|
||||
#ifdef CONFIG_ATH9K_PCOEM
|
||||
|
|
|
|||
|
|
@ -1660,9 +1660,9 @@ void rtl_watchdog_wq_callback(void *data)
|
|||
if (((rtlpriv->link_info.num_rx_inperiod +
|
||||
rtlpriv->link_info.num_tx_inperiod) > 8) ||
|
||||
(rtlpriv->link_info.num_rx_inperiod > 2))
|
||||
rtl_lps_enter(hw);
|
||||
else
|
||||
rtl_lps_leave(hw);
|
||||
else
|
||||
rtl_lps_enter(hw);
|
||||
}
|
||||
|
||||
rtlpriv->link_info.num_rx_inperiod = 0;
|
||||
|
|
|
|||
|
|
@ -1203,7 +1203,6 @@ static void btc8723b2ant_set_ant_path(struct btc_coexist *btcoexist,
|
|||
|
||||
/* Force GNT_BT to low */
|
||||
btcoexist->btc_write_1byte_bitmask(btcoexist, 0x765, 0x18, 0x0);
|
||||
btcoexist->btc_write_2byte(btcoexist, 0x948, 0x0);
|
||||
|
||||
if (board_info->btdm_ant_pos == BTC_ANTENNA_AT_MAIN_PORT) {
|
||||
/* tell firmware "no antenna inverse" */
|
||||
|
|
@ -1211,19 +1210,25 @@ static void btc8723b2ant_set_ant_path(struct btc_coexist *btcoexist,
|
|||
h2c_parameter[1] = 1; /* ext switch type */
|
||||
btcoexist->btc_fill_h2c(btcoexist, 0x65, 2,
|
||||
h2c_parameter);
|
||||
btcoexist->btc_write_2byte(btcoexist, 0x948, 0x0);
|
||||
} else {
|
||||
/* tell firmware "antenna inverse" */
|
||||
h2c_parameter[0] = 1;
|
||||
h2c_parameter[1] = 1; /* ext switch type */
|
||||
btcoexist->btc_fill_h2c(btcoexist, 0x65, 2,
|
||||
h2c_parameter);
|
||||
btcoexist->btc_write_2byte(btcoexist, 0x948, 0x280);
|
||||
}
|
||||
}
|
||||
|
||||
/* ext switch setting */
|
||||
if (use_ext_switch) {
|
||||
/* fixed internal switch S1->WiFi, S0->BT */
|
||||
btcoexist->btc_write_2byte(btcoexist, 0x948, 0x0);
|
||||
if (board_info->btdm_ant_pos == BTC_ANTENNA_AT_MAIN_PORT)
|
||||
btcoexist->btc_write_2byte(btcoexist, 0x948, 0x0);
|
||||
else
|
||||
btcoexist->btc_write_2byte(btcoexist, 0x948, 0x280);
|
||||
|
||||
switch (antpos_type) {
|
||||
case BTC_ANT_WIFI_AT_MAIN:
|
||||
/* ext switch main at wifi */
|
||||
|
|
|
|||
|
|
@ -965,13 +965,38 @@ void exhalbtc_set_chip_type(u8 chip_type)
|
|||
}
|
||||
}
|
||||
|
||||
void exhalbtc_set_ant_num(u8 type, u8 ant_num)
|
||||
void exhalbtc_set_ant_num(struct rtl_priv *rtlpriv, u8 type, u8 ant_num)
|
||||
{
|
||||
if (BT_COEX_ANT_TYPE_PG == type) {
|
||||
gl_bt_coexist.board_info.pg_ant_num = ant_num;
|
||||
gl_bt_coexist.board_info.btdm_ant_num = ant_num;
|
||||
/* The antenna position:
|
||||
* Main (default) or Aux for pgAntNum=2 && btdmAntNum =1.
|
||||
* The antenna position should be determined by
|
||||
* auto-detect mechanism.
|
||||
* The following is assumed to main,
|
||||
* and those must be modified
|
||||
* if y auto-detect mechanism is ready
|
||||
*/
|
||||
if ((gl_bt_coexist.board_info.pg_ant_num == 2) &&
|
||||
(gl_bt_coexist.board_info.btdm_ant_num == 1))
|
||||
gl_bt_coexist.board_info.btdm_ant_pos =
|
||||
BTC_ANTENNA_AT_MAIN_PORT;
|
||||
else
|
||||
gl_bt_coexist.board_info.btdm_ant_pos =
|
||||
BTC_ANTENNA_AT_MAIN_PORT;
|
||||
} else if (BT_COEX_ANT_TYPE_ANTDIV == type) {
|
||||
gl_bt_coexist.board_info.btdm_ant_num = ant_num;
|
||||
gl_bt_coexist.board_info.btdm_ant_pos =
|
||||
BTC_ANTENNA_AT_MAIN_PORT;
|
||||
} else if (type == BT_COEX_ANT_TYPE_DETECTED) {
|
||||
gl_bt_coexist.board_info.btdm_ant_num = ant_num;
|
||||
if (rtlpriv->cfg->mod_params->ant_sel == 1)
|
||||
gl_bt_coexist.board_info.btdm_ant_pos =
|
||||
BTC_ANTENNA_AT_AUX_PORT;
|
||||
else
|
||||
gl_bt_coexist.board_info.btdm_ant_pos =
|
||||
BTC_ANTENNA_AT_MAIN_PORT;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -535,7 +535,7 @@ void exhalbtc_set_bt_patch_version(u16 bt_hci_version, u16 bt_patch_version);
|
|||
void exhalbtc_update_min_bt_rssi(char bt_rssi);
|
||||
void exhalbtc_set_bt_exist(bool bt_exist);
|
||||
void exhalbtc_set_chip_type(u8 chip_type);
|
||||
void exhalbtc_set_ant_num(u8 type, u8 ant_num);
|
||||
void exhalbtc_set_ant_num(struct rtl_priv *rtlpriv, u8 type, u8 ant_num);
|
||||
void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist);
|
||||
void exhalbtc_signal_compensation(struct btc_coexist *btcoexist,
|
||||
u8 *rssi_wifi, u8 *rssi_bt);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,10 @@ void rtl_btc_init_hal_vars(struct rtl_priv *rtlpriv)
|
|||
__func__, bt_type);
|
||||
exhalbtc_set_chip_type(bt_type);
|
||||
|
||||
exhalbtc_set_ant_num(BT_COEX_ANT_TYPE_PG, ant_num);
|
||||
if (rtlpriv->cfg->mod_params->ant_sel == 1)
|
||||
exhalbtc_set_ant_num(rtlpriv, BT_COEX_ANT_TYPE_DETECTED, 1);
|
||||
else
|
||||
exhalbtc_set_ant_num(rtlpriv, BT_COEX_ANT_TYPE_PG, ant_num);
|
||||
}
|
||||
|
||||
void rtl_btc_init_hw_config(struct rtl_priv *rtlpriv)
|
||||
|
|
|
|||
|
|
@ -1573,7 +1573,7 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
|
|||
true,
|
||||
HW_DESC_TXBUFF_ADDR),
|
||||
skb->len, PCI_DMA_TODEVICE);
|
||||
kfree_skb(skb);
|
||||
dev_kfree_skb_irq(skb);
|
||||
ring->idx = (ring->idx + 1) % ring->entries;
|
||||
}
|
||||
ring->idx = 0;
|
||||
|
|
|
|||
|
|
@ -2684,6 +2684,7 @@ void rtl8723be_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw,
|
|||
bool auto_load_fail, u8 *hwinfo)
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_mod_params *mod_params = rtlpriv->cfg->mod_params;
|
||||
u8 value;
|
||||
u32 tmpu_32;
|
||||
|
||||
|
|
@ -2702,6 +2703,10 @@ void rtl8723be_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw,
|
|||
rtlpriv->btcoexist.btc_info.ant_num = ANT_X2;
|
||||
}
|
||||
|
||||
/* override ant_num / ant_path */
|
||||
if (mod_params->ant_sel)
|
||||
rtlpriv->btcoexist.btc_info.ant_num =
|
||||
(mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1);
|
||||
}
|
||||
|
||||
void rtl8723be_bt_reg_init(struct ieee80211_hw *hw)
|
||||
|
|
|
|||
|
|
@ -273,6 +273,7 @@ static struct rtl_mod_params rtl8723be_mod_params = {
|
|||
.msi_support = false,
|
||||
.disable_watchdog = false,
|
||||
.debug = DBG_EMERG,
|
||||
.ant_sel = 0,
|
||||
};
|
||||
|
||||
static struct rtl_hal_cfg rtl8723be_hal_cfg = {
|
||||
|
|
@ -394,6 +395,7 @@ module_param_named(fwlps, rtl8723be_mod_params.fwctrl_lps, bool, 0444);
|
|||
module_param_named(msi, rtl8723be_mod_params.msi_support, bool, 0444);
|
||||
module_param_named(disable_watchdog, rtl8723be_mod_params.disable_watchdog,
|
||||
bool, 0444);
|
||||
module_param_named(ant_sel, rtl8723be_mod_params.ant_sel, int, 0444);
|
||||
MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
|
||||
MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
|
||||
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
|
||||
|
|
@ -402,6 +404,7 @@ MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 0)\n");
|
|||
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
|
||||
MODULE_PARM_DESC(disable_watchdog,
|
||||
"Set to 1 to disable the watchdog (default 0)\n");
|
||||
MODULE_PARM_DESC(ant_sel, "Set to 1 or 2 to force antenna number (default 0)\n");
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
|
||||
|
||||
|
|
|
|||
|
|
@ -2252,6 +2252,9 @@ struct rtl_mod_params {
|
|||
|
||||
/* default 0: 1 means do not disable interrupts */
|
||||
bool int_clear;
|
||||
|
||||
/* select antenna */
|
||||
int ant_sel;
|
||||
};
|
||||
|
||||
struct rtl_hal_usbint_cfg {
|
||||
|
|
|
|||
|
|
@ -179,9 +179,6 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
|
|||
u16 orig_cmd;
|
||||
struct pci_bus_region region, inverted_region;
|
||||
|
||||
if (dev->non_compliant_bars)
|
||||
return 0;
|
||||
|
||||
mask = type ? PCI_ROM_ADDRESS_MASK : ~0;
|
||||
|
||||
/* No printks while decoding is disabled! */
|
||||
|
|
@ -322,6 +319,9 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
|
|||
{
|
||||
unsigned int pos, reg;
|
||||
|
||||
if (dev->non_compliant_bars)
|
||||
return;
|
||||
|
||||
for (pos = 0; pos < howmany; pos++) {
|
||||
struct resource *res = &dev->resource[pos];
|
||||
reg = PCI_BASE_ADDRESS_0 + (pos << 2);
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ struct exynos5440_pmx_func {
|
|||
* @nr_groups: number of pin groups available.
|
||||
* @pmx_functions: list of pin functions parsed from device tree.
|
||||
* @nr_functions: number of pin functions available.
|
||||
* @range: gpio range to register with pinctrl
|
||||
*/
|
||||
struct exynos5440_pinctrl_priv_data {
|
||||
void __iomem *reg_base;
|
||||
|
|
@ -117,6 +118,7 @@ struct exynos5440_pinctrl_priv_data {
|
|||
unsigned int nr_groups;
|
||||
const struct exynos5440_pmx_func *pmx_functions;
|
||||
unsigned int nr_functions;
|
||||
struct pinctrl_gpio_range range;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -742,7 +744,6 @@ static int exynos5440_pinctrl_register(struct platform_device *pdev,
|
|||
struct pinctrl_desc *ctrldesc;
|
||||
struct pinctrl_dev *pctl_dev;
|
||||
struct pinctrl_pin_desc *pindesc, *pdesc;
|
||||
struct pinctrl_gpio_range grange;
|
||||
char *pin_names;
|
||||
int pin, ret;
|
||||
|
||||
|
|
@ -794,12 +795,12 @@ static int exynos5440_pinctrl_register(struct platform_device *pdev,
|
|||
return PTR_ERR(pctl_dev);
|
||||
}
|
||||
|
||||
grange.name = "exynos5440-pctrl-gpio-range";
|
||||
grange.id = 0;
|
||||
grange.base = 0;
|
||||
grange.npins = EXYNOS5440_MAX_PINS;
|
||||
grange.gc = priv->gc;
|
||||
pinctrl_add_gpio_range(pctl_dev, &grange);
|
||||
priv->range.name = "exynos5440-pctrl-gpio-range";
|
||||
priv->range.id = 0;
|
||||
priv->range.base = 0;
|
||||
priv->range.npins = EXYNOS5440_MAX_PINS;
|
||||
priv->range.gc = priv->gc;
|
||||
pinctrl_add_gpio_range(pctl_dev, &priv->range);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ enum {
|
|||
#define AAC_INT_MODE_MSI (1<<1)
|
||||
#define AAC_INT_MODE_AIF (1<<2)
|
||||
#define AAC_INT_MODE_SYNC (1<<3)
|
||||
#define AAC_INT_MODE_MSIX (1<<16)
|
||||
|
||||
#define AAC_INT_ENABLE_TYPE1_INTX 0xfffffffb
|
||||
#define AAC_INT_ENABLE_TYPE1_MSIX 0xfffffffa
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#include <linux/spinlock.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/mm.h>
|
||||
#include <scsi/scsi_host.h>
|
||||
|
|
@ -47,6 +48,20 @@ struct aac_common aac_config = {
|
|||
.irq_mod = 1
|
||||
};
|
||||
|
||||
static inline int aac_is_msix_mode(struct aac_dev *dev)
|
||||
{
|
||||
u32 status;
|
||||
|
||||
status = src_readl(dev, MUnit.OMR);
|
||||
return (status & AAC_INT_MODE_MSIX);
|
||||
}
|
||||
|
||||
static inline void aac_change_to_intx(struct aac_dev *dev)
|
||||
{
|
||||
aac_src_access_devreg(dev, AAC_DISABLE_MSIX);
|
||||
aac_src_access_devreg(dev, AAC_ENABLE_INTX);
|
||||
}
|
||||
|
||||
static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long commsize, unsigned long commalign)
|
||||
{
|
||||
unsigned char *base;
|
||||
|
|
@ -425,6 +440,15 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
|
|||
dev->comm_interface = AAC_COMM_PRODUCER;
|
||||
dev->raw_io_interface = dev->raw_io_64 = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Enable INTX mode, if not done already Enabled
|
||||
*/
|
||||
if (aac_is_msix_mode(dev)) {
|
||||
aac_change_to_intx(dev);
|
||||
dev_info(&dev->pdev->dev, "Changed firmware to INTX mode");
|
||||
}
|
||||
|
||||
if ((!aac_adapter_sync_cmd(dev, GET_ADAPTER_PROPERTIES,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
status+0, status+1, status+2, status+3, NULL)) &&
|
||||
|
|
|
|||
|
|
@ -611,10 +611,10 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
|
|||
}
|
||||
return -EFAULT;
|
||||
}
|
||||
/* We used to udelay() here but that absorbed
|
||||
* a CPU when a timeout occured. Not very
|
||||
* useful. */
|
||||
cpu_relax();
|
||||
/*
|
||||
* Allow other processes / CPUS to use core
|
||||
*/
|
||||
schedule();
|
||||
}
|
||||
} else if (down_interruptible(&fibptr->event_wait)) {
|
||||
/* Do nothing ... satisfy
|
||||
|
|
@ -1970,6 +1970,10 @@ int aac_command_thread(void *data)
|
|||
if (difference <= 0)
|
||||
difference = 1;
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
|
||||
if (kthread_should_stop())
|
||||
break;
|
||||
|
||||
schedule_timeout(difference);
|
||||
|
||||
if (kthread_should_stop())
|
||||
|
|
|
|||
|
|
@ -1478,6 +1478,9 @@ static const struct of_device_id ucc_uart_match[] = {
|
|||
.type = "serial",
|
||||
.compatible = "ucc_uart",
|
||||
},
|
||||
{
|
||||
.compatible = "fsl,t1040-ucc-uart",
|
||||
},
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, ucc_uart_match);
|
||||
|
|
|
|||
|
|
@ -487,7 +487,8 @@ static void eoi_pirq(struct irq_data *data)
|
|||
if (!VALID_EVTCHN(evtchn))
|
||||
return;
|
||||
|
||||
if (unlikely(irqd_is_setaffinity_pending(data))) {
|
||||
if (unlikely(irqd_is_setaffinity_pending(data)) &&
|
||||
likely(!irqd_irq_disabled(data))) {
|
||||
int masked = test_and_set_mask(evtchn);
|
||||
|
||||
clear_evtchn(evtchn);
|
||||
|
|
@ -1370,7 +1371,8 @@ static void ack_dynirq(struct irq_data *data)
|
|||
if (!VALID_EVTCHN(evtchn))
|
||||
return;
|
||||
|
||||
if (unlikely(irqd_is_setaffinity_pending(data))) {
|
||||
if (unlikely(irqd_is_setaffinity_pending(data)) &&
|
||||
likely(!irqd_irq_disabled(data))) {
|
||||
int masked = test_and_set_mask(evtchn);
|
||||
|
||||
clear_evtchn(evtchn);
|
||||
|
|
|
|||
|
|
@ -528,7 +528,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
|
|||
char *prefix = NULL;
|
||||
|
||||
new_opts = kstrdup(data, GFP_KERNEL);
|
||||
if (!new_opts)
|
||||
if (data && !new_opts)
|
||||
return -ENOMEM;
|
||||
|
||||
pr_debug("%s(flags=0x%x,opts=\"%s\")\n", __func__, *flags, data);
|
||||
|
|
@ -546,7 +546,8 @@ affs_remount(struct super_block *sb, int *flags, char *data)
|
|||
}
|
||||
|
||||
flush_delayed_work(&sbi->sb_work);
|
||||
replace_mount_options(sb, new_opts);
|
||||
if (new_opts)
|
||||
replace_mount_options(sb, new_opts);
|
||||
|
||||
sbi->s_flags = mount_flags;
|
||||
sbi->s_mode = mode;
|
||||
|
|
|
|||
|
|
@ -1143,25 +1143,20 @@ struct inode *ext4_orphan_get(struct super_block *sb, unsigned long ino)
|
|||
unsigned long max_ino = le32_to_cpu(EXT4_SB(sb)->s_es->s_inodes_count);
|
||||
ext4_group_t block_group;
|
||||
int bit;
|
||||
struct buffer_head *bitmap_bh;
|
||||
struct buffer_head *bitmap_bh = NULL;
|
||||
struct inode *inode = NULL;
|
||||
long err = -EIO;
|
||||
int err = -EFSCORRUPTED;
|
||||
|
||||
/* Error cases - e2fsck has already cleaned up for us */
|
||||
if (ino > max_ino) {
|
||||
ext4_warning(sb, "bad orphan ino %lu! e2fsck was run?", ino);
|
||||
err = -EFSCORRUPTED;
|
||||
goto error;
|
||||
}
|
||||
if (ino < EXT4_FIRST_INO(sb) || ino > max_ino)
|
||||
goto bad_orphan;
|
||||
|
||||
block_group = (ino - 1) / EXT4_INODES_PER_GROUP(sb);
|
||||
bit = (ino - 1) % EXT4_INODES_PER_GROUP(sb);
|
||||
bitmap_bh = ext4_read_inode_bitmap(sb, block_group);
|
||||
if (IS_ERR(bitmap_bh)) {
|
||||
err = PTR_ERR(bitmap_bh);
|
||||
ext4_warning(sb, "inode bitmap error %ld for orphan %lu",
|
||||
ino, err);
|
||||
goto error;
|
||||
ext4_error(sb, "inode bitmap error %ld for orphan %lu",
|
||||
ino, PTR_ERR(bitmap_bh));
|
||||
return (struct inode *) bitmap_bh;
|
||||
}
|
||||
|
||||
/* Having the inode bit set should be a 100% indicator that this
|
||||
|
|
@ -1172,15 +1167,21 @@ struct inode *ext4_orphan_get(struct super_block *sb, unsigned long ino)
|
|||
goto bad_orphan;
|
||||
|
||||
inode = ext4_iget(sb, ino);
|
||||
if (IS_ERR(inode))
|
||||
goto iget_failed;
|
||||
if (IS_ERR(inode)) {
|
||||
err = PTR_ERR(inode);
|
||||
ext4_error(sb, "couldn't read orphan inode %lu (err %d)",
|
||||
ino, err);
|
||||
return inode;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the orphans has i_nlinks > 0 then it should be able to be
|
||||
* truncated, otherwise it won't be removed from the orphan list
|
||||
* during processing and an infinite loop will result.
|
||||
* If the orphans has i_nlinks > 0 then it should be able to
|
||||
* be truncated, otherwise it won't be removed from the orphan
|
||||
* list during processing and an infinite loop will result.
|
||||
* Similarly, it must not be a bad inode.
|
||||
*/
|
||||
if (inode->i_nlink && !ext4_can_truncate(inode))
|
||||
if ((inode->i_nlink && !ext4_can_truncate(inode)) ||
|
||||
is_bad_inode(inode))
|
||||
goto bad_orphan;
|
||||
|
||||
if (NEXT_ORPHAN(inode) > max_ino)
|
||||
|
|
@ -1188,29 +1189,25 @@ struct inode *ext4_orphan_get(struct super_block *sb, unsigned long ino)
|
|||
brelse(bitmap_bh);
|
||||
return inode;
|
||||
|
||||
iget_failed:
|
||||
err = PTR_ERR(inode);
|
||||
inode = NULL;
|
||||
bad_orphan:
|
||||
ext4_warning(sb, "bad orphan inode %lu! e2fsck was run?", ino);
|
||||
printk(KERN_WARNING "ext4_test_bit(bit=%d, block=%llu) = %d\n",
|
||||
bit, (unsigned long long)bitmap_bh->b_blocknr,
|
||||
ext4_test_bit(bit, bitmap_bh->b_data));
|
||||
printk(KERN_WARNING "inode=%p\n", inode);
|
||||
ext4_error(sb, "bad orphan inode %lu", ino);
|
||||
if (bitmap_bh)
|
||||
printk(KERN_ERR "ext4_test_bit(bit=%d, block=%llu) = %d\n",
|
||||
bit, (unsigned long long)bitmap_bh->b_blocknr,
|
||||
ext4_test_bit(bit, bitmap_bh->b_data));
|
||||
if (inode) {
|
||||
printk(KERN_WARNING "is_bad_inode(inode)=%d\n",
|
||||
printk(KERN_ERR "is_bad_inode(inode)=%d\n",
|
||||
is_bad_inode(inode));
|
||||
printk(KERN_WARNING "NEXT_ORPHAN(inode)=%u\n",
|
||||
printk(KERN_ERR "NEXT_ORPHAN(inode)=%u\n",
|
||||
NEXT_ORPHAN(inode));
|
||||
printk(KERN_WARNING "max_ino=%lu\n", max_ino);
|
||||
printk(KERN_WARNING "i_nlink=%u\n", inode->i_nlink);
|
||||
printk(KERN_ERR "max_ino=%lu\n", max_ino);
|
||||
printk(KERN_ERR "i_nlink=%u\n", inode->i_nlink);
|
||||
/* Avoid freeing blocks if we got a bad deleted inode */
|
||||
if (inode->i_nlink == 0)
|
||||
inode->i_blocks = 0;
|
||||
iput(inode);
|
||||
}
|
||||
brelse(bitmap_bh);
|
||||
error:
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1259,6 +1259,7 @@ static void ext4_mb_unload_buddy(struct ext4_buddy *e4b)
|
|||
static int mb_find_order_for_block(struct ext4_buddy *e4b, int block)
|
||||
{
|
||||
int order = 1;
|
||||
int bb_incr = 1 << (e4b->bd_blkbits - 1);
|
||||
void *bb;
|
||||
|
||||
BUG_ON(e4b->bd_bitmap == e4b->bd_buddy);
|
||||
|
|
@ -1271,7 +1272,8 @@ static int mb_find_order_for_block(struct ext4_buddy *e4b, int block)
|
|||
/* this block is part of buddy of order 'order' */
|
||||
return order;
|
||||
}
|
||||
bb += 1 << (e4b->bd_blkbits - order);
|
||||
bb += bb_incr;
|
||||
bb_incr >>= 1;
|
||||
order++;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -2576,7 +2578,7 @@ int ext4_mb_init(struct super_block *sb)
|
|||
{
|
||||
struct ext4_sb_info *sbi = EXT4_SB(sb);
|
||||
unsigned i, j;
|
||||
unsigned offset;
|
||||
unsigned offset, offset_incr;
|
||||
unsigned max;
|
||||
int ret;
|
||||
|
||||
|
|
@ -2605,11 +2607,13 @@ int ext4_mb_init(struct super_block *sb)
|
|||
|
||||
i = 1;
|
||||
offset = 0;
|
||||
offset_incr = 1 << (sb->s_blocksize_bits - 1);
|
||||
max = sb->s_blocksize << 2;
|
||||
do {
|
||||
sbi->s_mb_offsets[i] = offset;
|
||||
sbi->s_mb_maxs[i] = max;
|
||||
offset += 1 << (sb->s_blocksize_bits - i);
|
||||
offset += offset_incr;
|
||||
offset_incr = offset_incr >> 1;
|
||||
max = max >> 1;
|
||||
i++;
|
||||
} while (i <= sb->s_blocksize_bits + 1);
|
||||
|
|
|
|||
|
|
@ -2809,7 +2809,7 @@ int ext4_orphan_add(handle_t *handle, struct inode *inode)
|
|||
* list entries can cause panics at unmount time.
|
||||
*/
|
||||
mutex_lock(&sbi->s_orphan_lock);
|
||||
list_del(&EXT4_I(inode)->i_orphan);
|
||||
list_del_init(&EXT4_I(inode)->i_orphan);
|
||||
mutex_unlock(&sbi->s_orphan_lock);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
47
fs/pipe.c
47
fs/pipe.c
|
|
@ -38,6 +38,12 @@ unsigned int pipe_max_size = 1048576;
|
|||
*/
|
||||
unsigned int pipe_min_size = PAGE_SIZE;
|
||||
|
||||
/* Maximum allocatable pages per user. Hard limit is unset by default, soft
|
||||
* matches default values.
|
||||
*/
|
||||
unsigned long pipe_user_pages_hard;
|
||||
unsigned long pipe_user_pages_soft = PIPE_DEF_BUFFERS * INR_OPEN_CUR;
|
||||
|
||||
/*
|
||||
* We use a start+len construction, which provides full use of the
|
||||
* allocated memory.
|
||||
|
|
@ -583,20 +589,49 @@ pipe_fasync(int fd, struct file *filp, int on)
|
|||
return retval;
|
||||
}
|
||||
|
||||
static void account_pipe_buffers(struct pipe_inode_info *pipe,
|
||||
unsigned long old, unsigned long new)
|
||||
{
|
||||
atomic_long_add(new - old, &pipe->user->pipe_bufs);
|
||||
}
|
||||
|
||||
static bool too_many_pipe_buffers_soft(struct user_struct *user)
|
||||
{
|
||||
return pipe_user_pages_soft &&
|
||||
atomic_long_read(&user->pipe_bufs) >= pipe_user_pages_soft;
|
||||
}
|
||||
|
||||
static bool too_many_pipe_buffers_hard(struct user_struct *user)
|
||||
{
|
||||
return pipe_user_pages_hard &&
|
||||
atomic_long_read(&user->pipe_bufs) >= pipe_user_pages_hard;
|
||||
}
|
||||
|
||||
struct pipe_inode_info *alloc_pipe_info(void)
|
||||
{
|
||||
struct pipe_inode_info *pipe;
|
||||
|
||||
pipe = kzalloc(sizeof(struct pipe_inode_info), GFP_KERNEL);
|
||||
if (pipe) {
|
||||
pipe->bufs = kzalloc(sizeof(struct pipe_buffer) * PIPE_DEF_BUFFERS, GFP_KERNEL);
|
||||
unsigned long pipe_bufs = PIPE_DEF_BUFFERS;
|
||||
struct user_struct *user = get_current_user();
|
||||
|
||||
if (!too_many_pipe_buffers_hard(user)) {
|
||||
if (too_many_pipe_buffers_soft(user))
|
||||
pipe_bufs = 1;
|
||||
pipe->bufs = kzalloc(sizeof(struct pipe_buffer) * pipe_bufs, GFP_KERNEL);
|
||||
}
|
||||
|
||||
if (pipe->bufs) {
|
||||
init_waitqueue_head(&pipe->wait);
|
||||
pipe->r_counter = pipe->w_counter = 1;
|
||||
pipe->buffers = PIPE_DEF_BUFFERS;
|
||||
pipe->buffers = pipe_bufs;
|
||||
pipe->user = user;
|
||||
account_pipe_buffers(pipe, 0, pipe_bufs);
|
||||
mutex_init(&pipe->mutex);
|
||||
return pipe;
|
||||
}
|
||||
free_uid(user);
|
||||
kfree(pipe);
|
||||
}
|
||||
|
||||
|
|
@ -607,6 +642,8 @@ void free_pipe_info(struct pipe_inode_info *pipe)
|
|||
{
|
||||
int i;
|
||||
|
||||
account_pipe_buffers(pipe, pipe->buffers, 0);
|
||||
free_uid(pipe->user);
|
||||
for (i = 0; i < pipe->buffers; i++) {
|
||||
struct pipe_buffer *buf = pipe->bufs + i;
|
||||
if (buf->ops)
|
||||
|
|
@ -998,6 +1035,7 @@ static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long nr_pages)
|
|||
memcpy(bufs + head, pipe->bufs, tail * sizeof(struct pipe_buffer));
|
||||
}
|
||||
|
||||
account_pipe_buffers(pipe, pipe->buffers, nr_pages);
|
||||
pipe->curbuf = 0;
|
||||
kfree(pipe->bufs);
|
||||
pipe->bufs = bufs;
|
||||
|
|
@ -1069,6 +1107,11 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
|
|||
if (!capable(CAP_SYS_RESOURCE) && size > pipe_max_size) {
|
||||
ret = -EPERM;
|
||||
goto out;
|
||||
} else if ((too_many_pipe_buffers_hard(pipe->user) ||
|
||||
too_many_pipe_buffers_soft(pipe->user)) &&
|
||||
!capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN)) {
|
||||
ret = -EPERM;
|
||||
goto out;
|
||||
}
|
||||
ret = pipe_set_size(pipe, nr_pages);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -535,6 +535,7 @@ xfs_agfl_write_verify(
|
|||
}
|
||||
|
||||
const struct xfs_buf_ops xfs_agfl_buf_ops = {
|
||||
.name = "xfs_agfl",
|
||||
.verify_read = xfs_agfl_read_verify,
|
||||
.verify_write = xfs_agfl_write_verify,
|
||||
};
|
||||
|
|
@ -2339,6 +2340,7 @@ xfs_agf_write_verify(
|
|||
}
|
||||
|
||||
const struct xfs_buf_ops xfs_agf_buf_ops = {
|
||||
.name = "xfs_agf",
|
||||
.verify_read = xfs_agf_read_verify,
|
||||
.verify_write = xfs_agf_write_verify,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -379,6 +379,7 @@ xfs_allocbt_write_verify(
|
|||
}
|
||||
|
||||
const struct xfs_buf_ops xfs_allocbt_buf_ops = {
|
||||
.name = "xfs_allocbt",
|
||||
.verify_read = xfs_allocbt_read_verify,
|
||||
.verify_write = xfs_allocbt_write_verify,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -328,6 +328,7 @@ xfs_attr3_leaf_read_verify(
|
|||
}
|
||||
|
||||
const struct xfs_buf_ops xfs_attr3_leaf_buf_ops = {
|
||||
.name = "xfs_attr3_leaf",
|
||||
.verify_read = xfs_attr3_leaf_read_verify,
|
||||
.verify_write = xfs_attr3_leaf_write_verify,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -201,6 +201,7 @@ xfs_attr3_rmt_write_verify(
|
|||
}
|
||||
|
||||
const struct xfs_buf_ops xfs_attr3_rmt_buf_ops = {
|
||||
.name = "xfs_attr3_rmt",
|
||||
.verify_read = xfs_attr3_rmt_read_verify,
|
||||
.verify_write = xfs_attr3_rmt_write_verify,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -720,6 +720,7 @@ xfs_bmbt_write_verify(
|
|||
}
|
||||
|
||||
const struct xfs_buf_ops xfs_bmbt_buf_ops = {
|
||||
.name = "xfs_bmbt",
|
||||
.verify_read = xfs_bmbt_read_verify,
|
||||
.verify_write = xfs_bmbt_write_verify,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -245,6 +245,7 @@ xfs_da3_node_read_verify(
|
|||
}
|
||||
|
||||
const struct xfs_buf_ops xfs_da3_node_buf_ops = {
|
||||
.name = "xfs_da3_node",
|
||||
.verify_read = xfs_da3_node_read_verify,
|
||||
.verify_write = xfs_da3_node_write_verify,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ xfs_dir3_block_write_verify(
|
|||
}
|
||||
|
||||
const struct xfs_buf_ops xfs_dir3_block_buf_ops = {
|
||||
.name = "xfs_dir3_block",
|
||||
.verify_read = xfs_dir3_block_read_verify,
|
||||
.verify_write = xfs_dir3_block_write_verify,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -305,11 +305,13 @@ xfs_dir3_data_write_verify(
|
|||
}
|
||||
|
||||
const struct xfs_buf_ops xfs_dir3_data_buf_ops = {
|
||||
.name = "xfs_dir3_data",
|
||||
.verify_read = xfs_dir3_data_read_verify,
|
||||
.verify_write = xfs_dir3_data_write_verify,
|
||||
};
|
||||
|
||||
static const struct xfs_buf_ops xfs_dir3_data_reada_buf_ops = {
|
||||
.name = "xfs_dir3_data_reada",
|
||||
.verify_read = xfs_dir3_data_reada_verify,
|
||||
.verify_write = xfs_dir3_data_write_verify,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -245,11 +245,13 @@ xfs_dir3_leafn_write_verify(
|
|||
}
|
||||
|
||||
const struct xfs_buf_ops xfs_dir3_leaf1_buf_ops = {
|
||||
.name = "xfs_dir3_leaf1",
|
||||
.verify_read = xfs_dir3_leaf1_read_verify,
|
||||
.verify_write = xfs_dir3_leaf1_write_verify,
|
||||
};
|
||||
|
||||
const struct xfs_buf_ops xfs_dir3_leafn_buf_ops = {
|
||||
.name = "xfs_dir3_leafn",
|
||||
.verify_read = xfs_dir3_leafn_read_verify,
|
||||
.verify_write = xfs_dir3_leafn_write_verify,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -150,6 +150,7 @@ xfs_dir3_free_write_verify(
|
|||
}
|
||||
|
||||
const struct xfs_buf_ops xfs_dir3_free_buf_ops = {
|
||||
.name = "xfs_dir3_free",
|
||||
.verify_read = xfs_dir3_free_read_verify,
|
||||
.verify_write = xfs_dir3_free_write_verify,
|
||||
};
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user