Merge tag 'ASB-2024-07-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina
https://source.android.com/docs/security/bulletin/2024-07-01 CVE-2024-26923 * tag 'ASB-2024-07-05_11-5.4' of https://android.googlesource.com/kernel/common: (193 commits) ANDROID: fix kernelci build breaks due to hid/uhid cyclic dependency UPSTREAM: af_unix: Fix garbage collector racing against connect() ANDROID: 16K: Only check basename of linker context UPSTREAM: af_unix: Do not use atomic ops for unix_sk(sk)->inflight. Linux 5.4.276 pinctrl: mediatek: paris: Fix PIN_CONFIG_INPUT_SCHMITT_ENABLE readback pinctrl: mediatek: remove set but not used variable 'e' pinctrl: mediatek: Fix some off by one bugs pinctrl: mediatek: Fix fallback behavior for bias_set_combo regulator: core: fix debugfs creation regression net: fix out-of-bounds access in ops_init drm/vmwgfx: Fix invalid reads in fence signaled events dyndbg: fix old BUG_ON in >control parser tipc: fix UAF in error path usb: gadget: f_fs: Fix a race condition when processing setup packets. usb: gadget: composite: fix OS descriptors w_value logic firewire: nosy: ensure user_length is taken into account when fetching packet contents net: qede: use return from qede_parse_flow_attr() for flower net: qede: sanitize 'rc' in qede_add_tc_flower_fltr() ipv6: fib6_rules: avoid possible NULL dereference in fib6_rule_action() ... Conflicts: net/unix/garbage.c Change-Id: I9d928b110c82362cd82e7e9cc3bb19c664cdd53d
This commit is contained in:
commit
58d1d8f5ba
164 changed files with 1501 additions and 669 deletions
2
Makefile
2
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
SUBLEVEL = 274
|
||||
SUBLEVEL = 276
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
|
|
|
|||
|
|
@ -205,7 +205,6 @@
|
|||
};
|
||||
|
||||
gmac: ethernet@8000 {
|
||||
#interrupt-cells = <1>;
|
||||
compatible = "snps,dwmac";
|
||||
reg = <0x8000 0x2000>;
|
||||
interrupts = <10>;
|
||||
|
|
|
|||
|
|
@ -105,15 +105,89 @@
|
|||
proc-supply = <&cpus_fixed_vproc1>;
|
||||
};
|
||||
|
||||
ð {
|
||||
phy-mode ="rgmii-rxid";
|
||||
phy-handle = <ðernet_phy0>;
|
||||
mediatek,tx-delay-ps = <1530>;
|
||||
snps,reset-gpio = <&pio 87 GPIO_ACTIVE_LOW>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
pinctrl-0 = <ð_default>;
|
||||
pinctrl-1 = <ð_sleep>;
|
||||
status = "okay";
|
||||
|
||||
mdio {
|
||||
compatible = "snps,dwmac-mdio";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
ethernet_phy0: ethernet-phy@5 {
|
||||
compatible = "ethernet-phy-id0243.0d90";
|
||||
reg = <0x5>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pio {
|
||||
usb0_id_pins_float: usb0_iddig {
|
||||
eth_default: eth-default-pins {
|
||||
tx_pins {
|
||||
pinmux = <MT2712_PIN_71_GBE_TXD3__FUNC_GBE_TXD3>,
|
||||
<MT2712_PIN_72_GBE_TXD2__FUNC_GBE_TXD2>,
|
||||
<MT2712_PIN_73_GBE_TXD1__FUNC_GBE_TXD1>,
|
||||
<MT2712_PIN_74_GBE_TXD0__FUNC_GBE_TXD0>,
|
||||
<MT2712_PIN_75_GBE_TXC__FUNC_GBE_TXC>,
|
||||
<MT2712_PIN_76_GBE_TXEN__FUNC_GBE_TXEN>;
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
};
|
||||
rx_pins {
|
||||
pinmux = <MT2712_PIN_78_GBE_RXD3__FUNC_GBE_RXD3>,
|
||||
<MT2712_PIN_79_GBE_RXD2__FUNC_GBE_RXD2>,
|
||||
<MT2712_PIN_80_GBE_RXD1__FUNC_GBE_RXD1>,
|
||||
<MT2712_PIN_81_GBE_RXD0__FUNC_GBE_RXD0>,
|
||||
<MT2712_PIN_82_GBE_RXDV__FUNC_GBE_RXDV>,
|
||||
<MT2712_PIN_84_GBE_RXC__FUNC_GBE_RXC>;
|
||||
input-enable;
|
||||
};
|
||||
mdio_pins {
|
||||
pinmux = <MT2712_PIN_85_GBE_MDC__FUNC_GBE_MDC>,
|
||||
<MT2712_PIN_86_GBE_MDIO__FUNC_GBE_MDIO>;
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
input-enable;
|
||||
};
|
||||
};
|
||||
|
||||
eth_sleep: eth-sleep-pins {
|
||||
tx_pins {
|
||||
pinmux = <MT2712_PIN_71_GBE_TXD3__FUNC_GPIO71>,
|
||||
<MT2712_PIN_72_GBE_TXD2__FUNC_GPIO72>,
|
||||
<MT2712_PIN_73_GBE_TXD1__FUNC_GPIO73>,
|
||||
<MT2712_PIN_74_GBE_TXD0__FUNC_GPIO74>,
|
||||
<MT2712_PIN_75_GBE_TXC__FUNC_GPIO75>,
|
||||
<MT2712_PIN_76_GBE_TXEN__FUNC_GPIO76>;
|
||||
};
|
||||
rx_pins {
|
||||
pinmux = <MT2712_PIN_78_GBE_RXD3__FUNC_GPIO78>,
|
||||
<MT2712_PIN_79_GBE_RXD2__FUNC_GPIO79>,
|
||||
<MT2712_PIN_80_GBE_RXD1__FUNC_GPIO80>,
|
||||
<MT2712_PIN_81_GBE_RXD0__FUNC_GPIO81>,
|
||||
<MT2712_PIN_82_GBE_RXDV__FUNC_GPIO82>,
|
||||
<MT2712_PIN_84_GBE_RXC__FUNC_GPIO84>;
|
||||
input-disable;
|
||||
};
|
||||
mdio_pins {
|
||||
pinmux = <MT2712_PIN_85_GBE_MDC__FUNC_GPIO85>,
|
||||
<MT2712_PIN_86_GBE_MDIO__FUNC_GPIO86>;
|
||||
input-disable;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
|
||||
usb0_id_pins_float: usb0-iddig-pins {
|
||||
pins_iddig {
|
||||
pinmux = <MT2712_PIN_12_IDDIG_P0__FUNC_IDDIG_A>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
usb1_id_pins_float: usb1_iddig {
|
||||
usb1_id_pins_float: usb1-iddig-pins {
|
||||
pins_iddig {
|
||||
pinmux = <MT2712_PIN_14_IDDIG_P1__FUNC_IDDIG_B>;
|
||||
bias-pull-up;
|
||||
|
|
|
|||
|
|
@ -249,10 +249,11 @@
|
|||
#clock-cells = <1>;
|
||||
};
|
||||
|
||||
infracfg: syscon@10001000 {
|
||||
infracfg: clock-controller@10001000 {
|
||||
compatible = "mediatek,mt2712-infracfg", "syscon";
|
||||
reg = <0 0x10001000 0 0x1000>;
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
|
||||
pericfg: syscon@10003000 {
|
||||
|
|
@ -632,6 +633,71 @@
|
|||
status = "disabled";
|
||||
};
|
||||
|
||||
stmmac_axi_setup: stmmac-axi-config {
|
||||
snps,wr_osr_lmt = <0x7>;
|
||||
snps,rd_osr_lmt = <0x7>;
|
||||
snps,blen = <0 0 0 0 16 8 4>;
|
||||
};
|
||||
|
||||
mtl_rx_setup: rx-queues-config {
|
||||
snps,rx-queues-to-use = <1>;
|
||||
snps,rx-sched-sp;
|
||||
queue0 {
|
||||
snps,dcb-algorithm;
|
||||
snps,map-to-dma-channel = <0x0>;
|
||||
snps,priority = <0x0>;
|
||||
};
|
||||
};
|
||||
|
||||
mtl_tx_setup: tx-queues-config {
|
||||
snps,tx-queues-to-use = <3>;
|
||||
snps,tx-sched-wrr;
|
||||
queue0 {
|
||||
snps,weight = <0x10>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x0>;
|
||||
};
|
||||
queue1 {
|
||||
snps,weight = <0x11>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x1>;
|
||||
};
|
||||
queue2 {
|
||||
snps,weight = <0x12>;
|
||||
snps,dcb-algorithm;
|
||||
snps,priority = <0x2>;
|
||||
};
|
||||
};
|
||||
|
||||
eth: ethernet@1101c000 {
|
||||
compatible = "mediatek,mt2712-gmac";
|
||||
reg = <0 0x1101c000 0 0x1300>;
|
||||
interrupts = <GIC_SPI 237 IRQ_TYPE_LEVEL_LOW>;
|
||||
interrupt-names = "macirq";
|
||||
mac-address = [00 55 7b b5 7d f7];
|
||||
clock-names = "axi",
|
||||
"apb",
|
||||
"mac_main",
|
||||
"ptp_ref";
|
||||
clocks = <&pericfg CLK_PERI_GMAC>,
|
||||
<&pericfg CLK_PERI_GMAC_PCLK>,
|
||||
<&topckgen CLK_TOP_ETHER_125M_SEL>,
|
||||
<&topckgen CLK_TOP_ETHER_50M_SEL>;
|
||||
assigned-clocks = <&topckgen CLK_TOP_ETHER_125M_SEL>,
|
||||
<&topckgen CLK_TOP_ETHER_50M_SEL>;
|
||||
assigned-clock-parents = <&topckgen CLK_TOP_ETHERPLL_125M>,
|
||||
<&topckgen CLK_TOP_APLL1_D3>;
|
||||
power-domains = <&scpsys MT2712_POWER_DOMAIN_AUDIO>;
|
||||
mediatek,pericfg = <&pericfg>;
|
||||
snps,axi-config = <&stmmac_axi_setup>;
|
||||
snps,mtl-rx-config = <&mtl_rx_setup>;
|
||||
snps,mtl-tx-config = <&mtl_tx_setup>;
|
||||
snps,txpbl = <1>;
|
||||
snps,rxpbl = <1>;
|
||||
clk_csr = <0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
mmc0: mmc@11230000 {
|
||||
compatible = "mediatek,mt2712-mmc";
|
||||
reg = <0 0x11230000 0 0x1000>;
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@
|
|||
clock-names = "hif_sel";
|
||||
};
|
||||
|
||||
cir: cir@10009000 {
|
||||
cir: ir-receiver@10009000 {
|
||||
compatible = "mediatek,mt7622-cir";
|
||||
reg = <0 0x10009000 0 0x1000>;
|
||||
interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_LOW>;
|
||||
|
|
@ -507,7 +507,6 @@
|
|||
<&pericfg CLK_PERI_AUXADC_PD>;
|
||||
clock-names = "therm", "auxadc";
|
||||
resets = <&pericfg MT7622_PERI_THERM_SW_RST>;
|
||||
reset-names = "therm";
|
||||
mediatek,auxadc = <&auxadc>;
|
||||
mediatek,apmixedsys = <&apmixedsys>;
|
||||
nvmem-cells = <&thermal_calibration>;
|
||||
|
|
@ -901,9 +900,7 @@
|
|||
};
|
||||
|
||||
eth: ethernet@1b100000 {
|
||||
compatible = "mediatek,mt7622-eth",
|
||||
"mediatek,mt2701-eth",
|
||||
"syscon";
|
||||
compatible = "mediatek,mt7622-eth";
|
||||
reg = <0 0x1b100000 0 0x20000>;
|
||||
interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_LOW>,
|
||||
<GIC_SPI 224 IRQ_TYPE_LEVEL_LOW>,
|
||||
|
|
|
|||
|
|
@ -425,16 +425,22 @@
|
|||
gpio1830-supply = <&vcc_1v8>;
|
||||
};
|
||||
|
||||
&pmu_io_domains {
|
||||
status = "okay";
|
||||
pmu1830-supply = <&vcc_1v8>;
|
||||
};
|
||||
|
||||
&pwm2 {
|
||||
status = "okay";
|
||||
&pcie_clkreqn_cpm {
|
||||
rockchip,pins =
|
||||
<2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&q7_thermal_pin>;
|
||||
|
||||
gpios {
|
||||
q7_thermal_pin: q7-thermal-pin {
|
||||
rockchip,pins =
|
||||
<0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
};
|
||||
};
|
||||
|
||||
i2c8 {
|
||||
i2c8_xfer_a: i2c8-xfer {
|
||||
rockchip,pins =
|
||||
|
|
@ -465,6 +471,15 @@
|
|||
};
|
||||
};
|
||||
|
||||
&pmu_io_domains {
|
||||
status = "okay";
|
||||
pmu1830-supply = <&vcc_1v8>;
|
||||
};
|
||||
|
||||
&pwm2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdhci {
|
||||
/*
|
||||
* Signal integrity isn't great at 200MHz but 100MHz has proven stable
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ static inline long regs_return_value(struct pt_regs *regs)
|
|||
#define instruction_pointer(regs) ((regs)->cp0_epc)
|
||||
#define profile_pc(regs) instruction_pointer(regs)
|
||||
|
||||
extern asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall);
|
||||
extern asmlinkage long syscall_trace_enter(struct pt_regs *regs);
|
||||
extern asmlinkage void syscall_trace_leave(struct pt_regs *regs);
|
||||
|
||||
extern void die(const char *, struct pt_regs *) __noreturn;
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ void output_thread_info_defines(void)
|
|||
OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
|
||||
OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
|
||||
OFFSET(TI_REGS, thread_info, regs);
|
||||
OFFSET(TI_SYSCALL, thread_info, syscall);
|
||||
DEFINE(_THREAD_SIZE, THREAD_SIZE);
|
||||
DEFINE(_THREAD_MASK, THREAD_MASK);
|
||||
DEFINE(_IRQ_STACK_SIZE, IRQ_STACK_SIZE);
|
||||
|
|
|
|||
|
|
@ -1399,16 +1399,13 @@ long arch_ptrace(struct task_struct *child, long request,
|
|||
* Notification of system call entry/exit
|
||||
* - triggered by current->work.syscall_trace
|
||||
*/
|
||||
asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
|
||||
asmlinkage long syscall_trace_enter(struct pt_regs *regs)
|
||||
{
|
||||
user_exit();
|
||||
|
||||
current_thread_info()->syscall = syscall;
|
||||
|
||||
if (test_thread_flag(TIF_SYSCALL_TRACE)) {
|
||||
if (tracehook_report_syscall_entry(regs))
|
||||
return -1;
|
||||
syscall = current_thread_info()->syscall;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SECCOMP
|
||||
|
|
@ -1417,7 +1414,7 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
|
|||
struct seccomp_data sd;
|
||||
unsigned long args[6];
|
||||
|
||||
sd.nr = syscall;
|
||||
sd.nr = current_thread_info()->syscall;
|
||||
sd.arch = syscall_get_arch(current);
|
||||
syscall_get_arguments(current, regs, args);
|
||||
for (i = 0; i < 6; i++)
|
||||
|
|
@ -1427,23 +1424,23 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
|
|||
ret = __secure_computing(&sd);
|
||||
if (ret == -1)
|
||||
return ret;
|
||||
syscall = current_thread_info()->syscall;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
|
||||
trace_sys_enter(regs, regs->regs[2]);
|
||||
|
||||
audit_syscall_entry(syscall, regs->regs[4], regs->regs[5],
|
||||
audit_syscall_entry(current_thread_info()->syscall,
|
||||
regs->regs[4], regs->regs[5],
|
||||
regs->regs[6], regs->regs[7]);
|
||||
|
||||
/*
|
||||
* Negative syscall numbers are mistaken for rejected syscalls, but
|
||||
* won't have had the return value set appropriately, so we do so now.
|
||||
*/
|
||||
if (syscall < 0)
|
||||
if (current_thread_info()->syscall < 0)
|
||||
syscall_set_return_value(current, regs, -ENOSYS, 0);
|
||||
return syscall;
|
||||
return current_thread_info()->syscall;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -80,6 +80,18 @@ loads_done:
|
|||
PTR load_a7, bad_stack_a7
|
||||
.previous
|
||||
|
||||
/*
|
||||
* syscall number is in v0 unless we called syscall(__NR_###)
|
||||
* where the real syscall number is in a0
|
||||
*/
|
||||
subu t2, v0, __NR_O32_Linux
|
||||
bnez t2, 1f /* __NR_syscall at offset 0 */
|
||||
LONG_S a0, TI_SYSCALL($28) # Save a0 as syscall number
|
||||
b 2f
|
||||
1:
|
||||
LONG_S v0, TI_SYSCALL($28) # Save v0 as syscall number
|
||||
2:
|
||||
|
||||
lw t0, TI_FLAGS($28) # syscall tracing enabled?
|
||||
li t1, _TIF_WORK_SYSCALL_ENTRY
|
||||
and t0, t1
|
||||
|
|
@ -117,16 +129,7 @@ syscall_trace_entry:
|
|||
SAVE_STATIC
|
||||
move a0, sp
|
||||
|
||||
/*
|
||||
* syscall number is in v0 unless we called syscall(__NR_###)
|
||||
* where the real syscall number is in a0
|
||||
*/
|
||||
move a1, v0
|
||||
subu t2, v0, __NR_O32_Linux
|
||||
bnez t2, 1f /* __NR_syscall at offset 0 */
|
||||
lw a1, PT_R4(sp)
|
||||
|
||||
1: jal syscall_trace_enter
|
||||
jal syscall_trace_enter
|
||||
|
||||
bltz v0, 1f # seccomp failed? Skip syscall
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ NESTED(handle_sysn32, PT_SIZE, sp)
|
|||
|
||||
sd a3, PT_R26(sp) # save a3 for syscall restarting
|
||||
|
||||
LONG_S v0, TI_SYSCALL($28) # Store syscall number
|
||||
|
||||
li t1, _TIF_WORK_SYSCALL_ENTRY
|
||||
LONG_L t0, TI_FLAGS($28) # syscall tracing enabled?
|
||||
and t0, t1, t0
|
||||
|
|
@ -72,7 +74,6 @@ syscall_common:
|
|||
n32_syscall_trace_entry:
|
||||
SAVE_STATIC
|
||||
move a0, sp
|
||||
move a1, v0
|
||||
jal syscall_trace_enter
|
||||
|
||||
bltz v0, 1f # seccomp failed? Skip syscall
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ NESTED(handle_sys64, PT_SIZE, sp)
|
|||
|
||||
sd a3, PT_R26(sp) # save a3 for syscall restarting
|
||||
|
||||
LONG_S v0, TI_SYSCALL($28) # Store syscall number
|
||||
|
||||
li t1, _TIF_WORK_SYSCALL_ENTRY
|
||||
LONG_L t0, TI_FLAGS($28) # syscall tracing enabled?
|
||||
and t0, t1, t0
|
||||
|
|
@ -83,7 +85,6 @@ n64_syscall_exit:
|
|||
syscall_trace_entry:
|
||||
SAVE_STATIC
|
||||
move a0, sp
|
||||
move a1, v0
|
||||
jal syscall_trace_enter
|
||||
|
||||
bltz v0, 1f # seccomp failed? Skip syscall
|
||||
|
|
|
|||
|
|
@ -79,6 +79,22 @@ loads_done:
|
|||
PTR load_a7, bad_stack_a7
|
||||
.previous
|
||||
|
||||
/*
|
||||
* absolute syscall number is in v0 unless we called syscall(__NR_###)
|
||||
* where the real syscall number is in a0
|
||||
* note: NR_syscall is the first O32 syscall but the macro is
|
||||
* only defined when compiling with -mabi=32 (CONFIG_32BIT)
|
||||
* therefore __NR_O32_Linux is used (4000)
|
||||
*/
|
||||
|
||||
subu t2, v0, __NR_O32_Linux
|
||||
bnez t2, 1f /* __NR_syscall at offset 0 */
|
||||
LONG_S a0, TI_SYSCALL($28) # Save a0 as syscall number
|
||||
b 2f
|
||||
1:
|
||||
LONG_S v0, TI_SYSCALL($28) # Save v0 as syscall number
|
||||
2:
|
||||
|
||||
li t1, _TIF_WORK_SYSCALL_ENTRY
|
||||
LONG_L t0, TI_FLAGS($28) # syscall tracing enabled?
|
||||
and t0, t1, t0
|
||||
|
|
@ -113,22 +129,7 @@ trace_a_syscall:
|
|||
sd a7, PT_R11(sp) # For indirect syscalls
|
||||
|
||||
move a0, sp
|
||||
/*
|
||||
* absolute syscall number is in v0 unless we called syscall(__NR_###)
|
||||
* where the real syscall number is in a0
|
||||
* note: NR_syscall is the first O32 syscall but the macro is
|
||||
* only defined when compiling with -mabi=32 (CONFIG_32BIT)
|
||||
* therefore __NR_O32_Linux is used (4000)
|
||||
*/
|
||||
.set push
|
||||
.set reorder
|
||||
subu t1, v0, __NR_O32_Linux
|
||||
move a1, v0
|
||||
bnez t1, 1f /* __NR_syscall at offset 0 */
|
||||
ld a1, PT_R4(sp) /* Arg1 for __NR_syscall case */
|
||||
.set pop
|
||||
|
||||
1: jal syscall_trace_enter
|
||||
jal syscall_trace_enter
|
||||
|
||||
bltz v0, 1f # seccomp failed? Skip syscall
|
||||
|
||||
|
|
|
|||
|
|
@ -2610,7 +2610,7 @@ static int __s390_enable_skey_hugetlb(pte_t *pte, unsigned long addr,
|
|||
return 0;
|
||||
|
||||
start = pmd_val(*pmd) & HPAGE_MASK;
|
||||
end = start + HPAGE_SIZE - 1;
|
||||
end = start + HPAGE_SIZE;
|
||||
__storage_key_init_range(start, end);
|
||||
set_bit(PG_arch_1, &page->flags);
|
||||
cond_resched();
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ static void clear_huge_pte_skeys(struct mm_struct *mm, unsigned long rste)
|
|||
}
|
||||
|
||||
if (!test_and_set_bit(PG_arch_1, &page->flags))
|
||||
__storage_key_init_range(paddr, paddr + size - 1);
|
||||
__storage_key_init_range(paddr, paddr + size);
|
||||
}
|
||||
|
||||
void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <asm/mpspec.h>
|
||||
#include <asm/msr.h>
|
||||
#include <asm/hardirq.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#define ARCH_APICTIMER_STOPS_ON_C3 1
|
||||
|
||||
|
|
@ -111,7 +112,7 @@ static inline void native_apic_mem_write(u32 reg, u32 v)
|
|||
|
||||
static inline u32 native_apic_mem_read(u32 reg)
|
||||
{
|
||||
return *((volatile u32 *)(APIC_BASE + reg));
|
||||
return readl((void __iomem *)(APIC_BASE + reg));
|
||||
}
|
||||
|
||||
extern void native_apic_wait_icr_idle(void);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,10 @@ static const struct cpuid_dep cpuid_deps[] = {
|
|||
{ X86_FEATURE_F16C, X86_FEATURE_XMM2, },
|
||||
{ X86_FEATURE_AES, X86_FEATURE_XMM2 },
|
||||
{ X86_FEATURE_SHA_NI, X86_FEATURE_XMM2 },
|
||||
{ X86_FEATURE_GFNI, X86_FEATURE_XMM2 },
|
||||
{ X86_FEATURE_FMA, X86_FEATURE_AVX },
|
||||
{ X86_FEATURE_VAES, X86_FEATURE_AVX },
|
||||
{ X86_FEATURE_VPCLMULQDQ, X86_FEATURE_AVX },
|
||||
{ X86_FEATURE_AVX2, X86_FEATURE_AVX, },
|
||||
{ X86_FEATURE_AVX512F, X86_FEATURE_AVX, },
|
||||
{ X86_FEATURE_AVX512IFMA, X86_FEATURE_AVX512F },
|
||||
|
|
@ -56,9 +59,6 @@ static const struct cpuid_dep cpuid_deps[] = {
|
|||
{ X86_FEATURE_AVX512VL, X86_FEATURE_AVX512F },
|
||||
{ X86_FEATURE_AVX512VBMI, X86_FEATURE_AVX512F },
|
||||
{ X86_FEATURE_AVX512_VBMI2, X86_FEATURE_AVX512VL },
|
||||
{ X86_FEATURE_GFNI, X86_FEATURE_AVX512VL },
|
||||
{ X86_FEATURE_VAES, X86_FEATURE_AVX512VL },
|
||||
{ X86_FEATURE_VPCLMULQDQ, X86_FEATURE_AVX512VL },
|
||||
{ X86_FEATURE_AVX512_VNNI, X86_FEATURE_AVX512VL },
|
||||
{ X86_FEATURE_AVX512_BITALG, X86_FEATURE_AVX512VL },
|
||||
{ X86_FEATURE_AVX512_4VNNIW, X86_FEATURE_AVX512F },
|
||||
|
|
|
|||
|
|
@ -217,7 +217,6 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg)
|
|||
}
|
||||
|
||||
if (!strcmp(q->cra_driver_name, alg->cra_name) ||
|
||||
!strcmp(q->cra_driver_name, alg->cra_driver_name) ||
|
||||
!strcmp(q->cra_name, alg->cra_driver_name))
|
||||
goto err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,7 +201,10 @@ int gemini_sata_start_bridge(struct sata_gemini *sg, unsigned int bridge)
|
|||
pclk = sg->sata0_pclk;
|
||||
else
|
||||
pclk = sg->sata1_pclk;
|
||||
clk_enable(pclk);
|
||||
ret = clk_enable(pclk);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
msleep(10);
|
||||
|
||||
/* Do not keep clocking a bridge that is not online */
|
||||
|
|
|
|||
|
|
@ -360,6 +360,8 @@ static const struct usb_device_id blacklist_table[] = {
|
|||
/* Realtek 8852BE Bluetooth devices */
|
||||
{ USB_DEVICE(0x0cb8, 0xc559), .driver_info = BTUSB_REALTEK |
|
||||
BTUSB_WIDEBAND_SPEECH },
|
||||
{ USB_DEVICE(0x0bda, 0x4853), .driver_info = BTUSB_REALTEK |
|
||||
BTUSB_WIDEBAND_SPEECH },
|
||||
{ USB_DEVICE(0x0bda, 0x887b), .driver_info = BTUSB_REALTEK |
|
||||
BTUSB_WIDEBAND_SPEECH },
|
||||
{ USB_DEVICE(0x0bda, 0xb85b), .driver_info = BTUSB_REALTEK |
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ static HLIST_HEAD(clk_root_list);
|
|||
static HLIST_HEAD(clk_orphan_list);
|
||||
static LIST_HEAD(clk_notifier_list);
|
||||
|
||||
static struct hlist_head *all_lists[] = {
|
||||
static const struct hlist_head *all_lists[] = {
|
||||
&clk_root_list,
|
||||
&clk_orphan_list,
|
||||
NULL,
|
||||
|
|
@ -1325,6 +1325,8 @@ static int clk_disable_unused(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
pr_info("clk: Disabling unused clocks\n");
|
||||
|
||||
clk_prepare_lock();
|
||||
|
||||
hlist_for_each_entry(core, &clk_root_list, child_node)
|
||||
|
|
@ -3825,8 +3827,6 @@ static int __clk_core_init(struct clk_core *core)
|
|||
|
||||
clk_core_hold_state(core);
|
||||
clk_core_reparent_orphans_nolock();
|
||||
|
||||
kref_init(&core->ref);
|
||||
out:
|
||||
clk_pm_runtime_put(core);
|
||||
unlock:
|
||||
|
|
@ -4036,6 +4036,16 @@ static void clk_core_free_parent_map(struct clk_core *core)
|
|||
kfree(core->parents);
|
||||
}
|
||||
|
||||
/* Free memory allocated for a struct clk_core */
|
||||
static void __clk_release(struct kref *ref)
|
||||
{
|
||||
struct clk_core *core = container_of(ref, struct clk_core, ref);
|
||||
|
||||
clk_core_free_parent_map(core);
|
||||
kfree_const(core->name);
|
||||
kfree(core);
|
||||
}
|
||||
|
||||
static struct clk *
|
||||
__clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw)
|
||||
{
|
||||
|
|
@ -4056,6 +4066,8 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw)
|
|||
goto fail_out;
|
||||
}
|
||||
|
||||
kref_init(&core->ref);
|
||||
|
||||
core->name = kstrdup_const(init->name, GFP_KERNEL);
|
||||
if (!core->name) {
|
||||
ret = -ENOMEM;
|
||||
|
|
@ -4110,12 +4122,10 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw)
|
|||
hw->clk = NULL;
|
||||
|
||||
fail_create_clk:
|
||||
clk_core_free_parent_map(core);
|
||||
fail_parents:
|
||||
fail_ops:
|
||||
kfree_const(core->name);
|
||||
fail_name:
|
||||
kfree(core);
|
||||
kref_put(&core->ref, __clk_release);
|
||||
fail_out:
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
|
@ -4195,18 +4205,6 @@ int of_clk_hw_register(struct device_node *node, struct clk_hw *hw)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(of_clk_hw_register);
|
||||
|
||||
/* Free memory allocated for a clock. */
|
||||
static void __clk_release(struct kref *ref)
|
||||
{
|
||||
struct clk_core *core = container_of(ref, struct clk_core, ref);
|
||||
|
||||
lockdep_assert_held(&prepare_lock);
|
||||
|
||||
clk_core_free_parent_map(core);
|
||||
kfree_const(core->name);
|
||||
kfree(core);
|
||||
}
|
||||
|
||||
/*
|
||||
* Empty clk_ops for unregistered clocks. These are used temporarily
|
||||
* after clk_unregister() was called on a clock and until last clock
|
||||
|
|
@ -4259,7 +4257,7 @@ static void clk_core_evict_parent_cache_subtree(struct clk_core *root,
|
|||
/* Remove this clk from all parent caches */
|
||||
static void clk_core_evict_parent_cache(struct clk_core *core)
|
||||
{
|
||||
struct hlist_head **lists;
|
||||
const struct hlist_head **lists;
|
||||
struct clk_core *root;
|
||||
|
||||
lockdep_assert_held(&prepare_lock);
|
||||
|
|
@ -4288,7 +4286,8 @@ void clk_unregister(struct clk *clk)
|
|||
if (clk->core->ops == &clk_nodrv_ops) {
|
||||
pr_err("%s: unregistered clock: %s\n", __func__,
|
||||
clk->core->name);
|
||||
goto unlock;
|
||||
clk_prepare_unlock();
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* Assign empty clock ops for consumers that might still hold
|
||||
|
|
@ -4319,11 +4318,10 @@ void clk_unregister(struct clk *clk)
|
|||
if (clk->core->protect_count)
|
||||
pr_warn("%s: unregistering protected clock: %s\n",
|
||||
__func__, clk->core->name);
|
||||
clk_prepare_unlock();
|
||||
|
||||
kref_put(&clk->core->ref, __clk_release);
|
||||
free_clk(clk);
|
||||
unlock:
|
||||
clk_prepare_unlock();
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clk_unregister);
|
||||
|
||||
|
|
@ -4485,13 +4483,11 @@ void __clk_put(struct clk *clk)
|
|||
clk->max_rate < clk->core->req_rate)
|
||||
clk_core_set_rate_nolock(clk->core, clk->core->req_rate);
|
||||
|
||||
owner = clk->core->owner;
|
||||
kref_put(&clk->core->ref, __clk_release);
|
||||
|
||||
clk_prepare_unlock();
|
||||
|
||||
owner = clk->core->owner;
|
||||
kref_put(&clk->core->ref, __clk_release);
|
||||
module_put(owner);
|
||||
|
||||
free_clk(clk);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1172,12 +1172,19 @@ static const u32 usb2_clk_regs[] = {
|
|||
SUN50I_H6_USB3_CLK_REG,
|
||||
};
|
||||
|
||||
static struct ccu_mux_nb sun50i_h6_cpu_nb = {
|
||||
.common = &cpux_clk.common,
|
||||
.cm = &cpux_clk.mux,
|
||||
.delay_us = 1,
|
||||
.bypass_index = 0, /* index of 24 MHz oscillator */
|
||||
};
|
||||
|
||||
static int sun50i_h6_ccu_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *res;
|
||||
void __iomem *reg;
|
||||
int i, ret;
|
||||
u32 val;
|
||||
int i;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
reg = devm_ioremap_resource(&pdev->dev, res);
|
||||
|
|
@ -1231,7 +1238,15 @@ static int sun50i_h6_ccu_probe(struct platform_device *pdev)
|
|||
val |= BIT(24);
|
||||
writel(val, reg + SUN50I_H6_HDMI_CEC_CLK_REG);
|
||||
|
||||
return sunxi_ccu_probe(pdev->dev.of_node, reg, &sun50i_h6_ccu_desc);
|
||||
ret = sunxi_ccu_probe(pdev->dev.of_node, reg, &sun50i_h6_ccu_desc);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Reparent CPU during PLL CPUX rate changes */
|
||||
ccu_mux_notifier_register(pll_cpux_clk.common.hw.clk,
|
||||
&sun50i_h6_cpu_nb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id sun50i_h6_ccu_ids[] = {
|
||||
|
|
|
|||
|
|
@ -167,6 +167,10 @@ static irqreturn_t idma64_irq(int irq, void *dev)
|
|||
u32 status_err;
|
||||
unsigned short i;
|
||||
|
||||
/* Since IRQ may be shared, check if DMA controller is powered on */
|
||||
if (status == GENMASK(31, 0))
|
||||
return IRQ_NONE;
|
||||
|
||||
dev_vdbg(idma64->dma.dev, "%s: status=%#x\n", __func__, status);
|
||||
|
||||
/* Check if we have any interrupt from the DMA controller */
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ static void pchan_update(struct owl_dma_pchan *pchan, u32 reg,
|
|||
else
|
||||
regval &= ~val;
|
||||
|
||||
writel(val, pchan->base + reg);
|
||||
writel(regval, pchan->base + reg);
|
||||
}
|
||||
|
||||
static void pchan_writel(struct owl_dma_pchan *pchan, u32 reg, u32 data)
|
||||
|
|
@ -262,7 +262,7 @@ static void dma_update(struct owl_dma *od, u32 reg, u32 val, bool state)
|
|||
else
|
||||
regval &= ~val;
|
||||
|
||||
writel(val, od->base + reg);
|
||||
writel(regval, od->base + reg);
|
||||
}
|
||||
|
||||
static void dma_writel(struct owl_dma *od, u32 reg, u32 data)
|
||||
|
|
|
|||
|
|
@ -148,10 +148,12 @@ packet_buffer_get(struct client *client, char __user *data, size_t user_length)
|
|||
if (atomic_read(&buffer->size) == 0)
|
||||
return -ENODEV;
|
||||
|
||||
/* FIXME: Check length <= user_length. */
|
||||
length = buffer->head->length;
|
||||
|
||||
if (length > user_length)
|
||||
return 0;
|
||||
|
||||
end = buffer->data + buffer->capacity;
|
||||
length = buffer->head->length;
|
||||
|
||||
if (&buffer->head->data[length] < end) {
|
||||
if (copy_to_user(data, buffer->head->data, length))
|
||||
|
|
|
|||
|
|
@ -2053,6 +2053,8 @@ static void bus_reset_work(struct work_struct *work)
|
|||
|
||||
ohci->generation = generation;
|
||||
reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset);
|
||||
if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS)
|
||||
reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset);
|
||||
|
||||
if (ohci->quirks & QUIRK_RESET_PACKET)
|
||||
ohci->request_generation = generation;
|
||||
|
|
@ -2119,12 +2121,14 @@ static irqreturn_t irq_handler(int irq, void *data)
|
|||
return IRQ_NONE;
|
||||
|
||||
/*
|
||||
* busReset and postedWriteErr must not be cleared yet
|
||||
* busReset and postedWriteErr events must not be cleared yet
|
||||
* (OHCI 1.1 clauses 7.2.3.2 and 13.2.8.1)
|
||||
*/
|
||||
reg_write(ohci, OHCI1394_IntEventClear,
|
||||
event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr));
|
||||
log_irqs(ohci, event);
|
||||
if (event & OHCI1394_busReset)
|
||||
reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);
|
||||
|
||||
if (event & OHCI1394_selfIDComplete)
|
||||
queue_work(selfid_workqueue, &ohci->bus_reset_work);
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ static inline int to_reg(int gpio, enum ctrl_register reg_type)
|
|||
case 0x5e:
|
||||
return GPIOPANELCTL;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ static inline int to_reg(int gpio, enum ctrl_register reg_type)
|
|||
unsigned int reg;
|
||||
|
||||
if (gpio >= WCOVE_GPIO_NUM)
|
||||
return -EOPNOTSUPP;
|
||||
return -ENOTSUPP;
|
||||
|
||||
if (reg_type == CTRL_IN)
|
||||
reg = GPIO_IN_CTRL_BASE + gpio;
|
||||
|
|
|
|||
|
|
@ -1204,6 +1204,7 @@ allocate_init_user_pages_failed:
|
|||
err_bo_create:
|
||||
unreserve_mem_limit(adev, size, alloc_domain, !!sg);
|
||||
err_reserve_limit:
|
||||
amdgpu_sync_free(&(*mem)->sync);
|
||||
mutex_destroy(&(*mem)->lock);
|
||||
kfree(*mem);
|
||||
err:
|
||||
|
|
|
|||
|
|
@ -2095,6 +2095,37 @@ static void amdgpu_vm_bo_insert_map(struct amdgpu_device *adev,
|
|||
trace_amdgpu_vm_bo_map(bo_va, mapping);
|
||||
}
|
||||
|
||||
/* Validate operation parameters to prevent potential abuse */
|
||||
static int amdgpu_vm_verify_parameters(struct amdgpu_device *adev,
|
||||
struct amdgpu_bo *bo,
|
||||
uint64_t saddr,
|
||||
uint64_t offset,
|
||||
uint64_t size)
|
||||
{
|
||||
uint64_t tmp, lpfn;
|
||||
|
||||
if (saddr & AMDGPU_GPU_PAGE_MASK
|
||||
|| offset & AMDGPU_GPU_PAGE_MASK
|
||||
|| size & AMDGPU_GPU_PAGE_MASK)
|
||||
return -EINVAL;
|
||||
|
||||
if (check_add_overflow(saddr, size, &tmp)
|
||||
|| check_add_overflow(offset, size, &tmp)
|
||||
|| size == 0 /* which also leads to end < begin */)
|
||||
return -EINVAL;
|
||||
|
||||
/* make sure object fit at this offset */
|
||||
if (bo && offset + size > amdgpu_bo_size(bo))
|
||||
return -EINVAL;
|
||||
|
||||
/* Ensure last pfn not exceed max_pfn */
|
||||
lpfn = (saddr + size - 1) >> AMDGPU_GPU_PAGE_SHIFT;
|
||||
if (lpfn >= adev->vm_manager.max_pfn)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_vm_bo_map - map bo inside a vm
|
||||
*
|
||||
|
|
@ -2121,20 +2152,14 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev,
|
|||
struct amdgpu_bo *bo = bo_va->base.bo;
|
||||
struct amdgpu_vm *vm = bo_va->base.vm;
|
||||
uint64_t eaddr;
|
||||
int r;
|
||||
|
||||
/* validate the parameters */
|
||||
if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK ||
|
||||
size == 0 || size & ~PAGE_MASK)
|
||||
return -EINVAL;
|
||||
|
||||
/* make sure object fit at this offset */
|
||||
eaddr = saddr + size - 1;
|
||||
if (saddr >= eaddr ||
|
||||
(bo && offset + size > amdgpu_bo_size(bo)))
|
||||
return -EINVAL;
|
||||
r = amdgpu_vm_verify_parameters(adev, bo, saddr, offset, size);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
saddr /= AMDGPU_GPU_PAGE_SIZE;
|
||||
eaddr /= AMDGPU_GPU_PAGE_SIZE;
|
||||
eaddr = saddr + (size - 1) / AMDGPU_GPU_PAGE_SIZE;
|
||||
|
||||
tmp = amdgpu_vm_it_iter_first(&vm->va, saddr, eaddr);
|
||||
if (tmp) {
|
||||
|
|
@ -2187,16 +2212,9 @@ int amdgpu_vm_bo_replace_map(struct amdgpu_device *adev,
|
|||
uint64_t eaddr;
|
||||
int r;
|
||||
|
||||
/* validate the parameters */
|
||||
if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK ||
|
||||
size == 0 || size & ~PAGE_MASK)
|
||||
return -EINVAL;
|
||||
|
||||
/* make sure object fit at this offset */
|
||||
eaddr = saddr + size - 1;
|
||||
if (saddr >= eaddr ||
|
||||
(bo && offset + size > amdgpu_bo_size(bo)))
|
||||
return -EINVAL;
|
||||
r = amdgpu_vm_verify_parameters(adev, bo, saddr, offset, size);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
/* Allocate all the needed memory */
|
||||
mapping = kmalloc(sizeof(*mapping), GFP_KERNEL);
|
||||
|
|
@ -2210,7 +2228,7 @@ int amdgpu_vm_bo_replace_map(struct amdgpu_device *adev,
|
|||
}
|
||||
|
||||
saddr /= AMDGPU_GPU_PAGE_SIZE;
|
||||
eaddr /= AMDGPU_GPU_PAGE_SIZE;
|
||||
eaddr = saddr + (size - 1) / AMDGPU_GPU_PAGE_SIZE;
|
||||
|
||||
mapping->start = saddr;
|
||||
mapping->last = eaddr;
|
||||
|
|
@ -2297,10 +2315,14 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,
|
|||
struct amdgpu_bo_va_mapping *before, *after, *tmp, *next;
|
||||
LIST_HEAD(removed);
|
||||
uint64_t eaddr;
|
||||
int r;
|
||||
|
||||
r = amdgpu_vm_verify_parameters(adev, NULL, saddr, 0, size);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
eaddr = saddr + size - 1;
|
||||
saddr /= AMDGPU_GPU_PAGE_SIZE;
|
||||
eaddr /= AMDGPU_GPU_PAGE_SIZE;
|
||||
eaddr = saddr + (size - 1) / AMDGPU_GPU_PAGE_SIZE;
|
||||
|
||||
/* Allocate all the needed memory */
|
||||
before = kzalloc(sizeof(*before), GFP_KERNEL);
|
||||
|
|
|
|||
|
|
@ -700,6 +700,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width,
|
|||
unsigned int total_modes_count = 0;
|
||||
struct drm_client_offset *offsets;
|
||||
unsigned int connector_count = 0;
|
||||
/* points to modes protected by mode_config.mutex */
|
||||
struct drm_display_mode **modes;
|
||||
struct drm_crtc **crtcs;
|
||||
int i, ret = 0;
|
||||
|
|
@ -768,7 +769,6 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width,
|
|||
drm_client_pick_crtcs(client, connectors, connector_count,
|
||||
crtcs, modes, 0, width, height);
|
||||
}
|
||||
mutex_unlock(&dev->mode_config.mutex);
|
||||
|
||||
drm_client_modeset_release(client);
|
||||
|
||||
|
|
@ -798,6 +798,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width,
|
|||
modeset->y = offset->y;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&dev->mode_config.mutex);
|
||||
|
||||
mutex_unlock(&client->modeset_mutex);
|
||||
out:
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
|
||||
#include "nouveau_drv.h"
|
||||
#include "nouveau_bios.h"
|
||||
#include "nouveau_reg.h"
|
||||
#include "dispnv04/hw.h"
|
||||
#include "nouveau_encoder.h"
|
||||
|
|
@ -1672,7 +1673,7 @@ apply_dcb_encoder_quirks(struct drm_device *dev, int idx, u32 *conn, u32 *conf)
|
|||
*/
|
||||
if (nv_match_device(dev, 0x0201, 0x1462, 0x8851)) {
|
||||
if (*conn == 0xf2005014 && *conf == 0xffffffff) {
|
||||
fabricate_dcb_output(dcb, DCB_OUTPUT_TMDS, 1, 1, 1);
|
||||
fabricate_dcb_output(dcb, DCB_OUTPUT_TMDS, 1, 1, DCB_OUTPUT_B);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1758,26 +1759,26 @@ fabricate_dcb_encoder_table(struct drm_device *dev, struct nvbios *bios)
|
|||
#ifdef __powerpc__
|
||||
/* Apple iMac G4 NV17 */
|
||||
if (of_machine_is_compatible("PowerMac4,5")) {
|
||||
fabricate_dcb_output(dcb, DCB_OUTPUT_TMDS, 0, all_heads, 1);
|
||||
fabricate_dcb_output(dcb, DCB_OUTPUT_ANALOG, 1, all_heads, 2);
|
||||
fabricate_dcb_output(dcb, DCB_OUTPUT_TMDS, 0, all_heads, DCB_OUTPUT_B);
|
||||
fabricate_dcb_output(dcb, DCB_OUTPUT_ANALOG, 1, all_heads, DCB_OUTPUT_C);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Make up some sane defaults */
|
||||
fabricate_dcb_output(dcb, DCB_OUTPUT_ANALOG,
|
||||
bios->legacy.i2c_indices.crt, 1, 1);
|
||||
bios->legacy.i2c_indices.crt, 1, DCB_OUTPUT_B);
|
||||
|
||||
if (nv04_tv_identify(dev, bios->legacy.i2c_indices.tv) >= 0)
|
||||
fabricate_dcb_output(dcb, DCB_OUTPUT_TV,
|
||||
bios->legacy.i2c_indices.tv,
|
||||
all_heads, 0);
|
||||
all_heads, DCB_OUTPUT_A);
|
||||
|
||||
else if (bios->tmds.output0_script_ptr ||
|
||||
bios->tmds.output1_script_ptr)
|
||||
fabricate_dcb_output(dcb, DCB_OUTPUT_TMDS,
|
||||
bios->legacy.i2c_indices.panel,
|
||||
all_heads, 1);
|
||||
all_heads, DCB_OUTPUT_B);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -66,11 +66,16 @@ of_init(struct nvkm_bios *bios, const char *name)
|
|||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
static void of_fini(void *p)
|
||||
{
|
||||
kfree(p);
|
||||
}
|
||||
|
||||
const struct nvbios_source
|
||||
nvbios_of = {
|
||||
.name = "OpenFirmware",
|
||||
.init = of_init,
|
||||
.fini = (void(*)(void *))kfree,
|
||||
.fini = of_fini,
|
||||
.read = of_read,
|
||||
.size = of_size,
|
||||
.rw = false,
|
||||
|
|
|
|||
|
|
@ -221,8 +221,11 @@ nv50_instobj_acquire(struct nvkm_memory *memory)
|
|||
void __iomem *map = NULL;
|
||||
|
||||
/* Already mapped? */
|
||||
if (refcount_inc_not_zero(&iobj->maps))
|
||||
if (refcount_inc_not_zero(&iobj->maps)) {
|
||||
/* read barrier match the wmb on refcount set */
|
||||
smp_rmb();
|
||||
return iobj->map;
|
||||
}
|
||||
|
||||
/* Take the lock, and re-check that another thread hasn't
|
||||
* already mapped the object in the meantime.
|
||||
|
|
@ -249,6 +252,8 @@ nv50_instobj_acquire(struct nvkm_memory *memory)
|
|||
iobj->base.memory.ptrs = &nv50_instobj_fast;
|
||||
else
|
||||
iobj->base.memory.ptrs = &nv50_instobj_slow;
|
||||
/* barrier to ensure the ptrs are written before refcount is set */
|
||||
smp_wmb();
|
||||
refcount_set(&iobj->maps, 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1066,7 +1066,7 @@ static int vmw_event_fence_action_create(struct drm_file *file_priv,
|
|||
}
|
||||
|
||||
event->event.base.type = DRM_VMW_EVENT_FENCE_SIGNALED;
|
||||
event->event.base.length = sizeof(*event);
|
||||
event->event.base.length = sizeof(event->event);
|
||||
event->event.user_data = user_data;
|
||||
|
||||
ret = drm_event_reserve_init(dev, file_priv, &event->base, &event->event.base);
|
||||
|
|
|
|||
|
|
@ -335,11 +335,6 @@ static int host1x_device_uevent(struct device *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int host1x_dma_configure(struct device *dev)
|
||||
{
|
||||
return of_dma_configure(dev, dev->of_node, true);
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops host1x_device_pm_ops = {
|
||||
.suspend = pm_generic_suspend,
|
||||
.resume = pm_generic_resume,
|
||||
|
|
@ -353,7 +348,6 @@ struct bus_type host1x_bus_type = {
|
|||
.name = "host1x",
|
||||
.match = host1x_device_match,
|
||||
.uevent = host1x_device_uevent,
|
||||
.dma_configure = host1x_dma_configure,
|
||||
.pm = &host1x_device_pm_ops,
|
||||
};
|
||||
|
||||
|
|
@ -442,8 +436,6 @@ static int host1x_device_add(struct host1x *host1x,
|
|||
device->dev.bus = &host1x_bus_type;
|
||||
device->dev.parent = host1x->dev;
|
||||
|
||||
of_dma_configure(&device->dev, host1x->dev->of_node, true);
|
||||
|
||||
device->dev.dma_parms = &device->dma_parms;
|
||||
dma_set_max_seg_size(&device->dev, SZ_4M);
|
||||
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign
|
|||
offset = report->size;
|
||||
report->size += parser->global.report_size * parser->global.report_count;
|
||||
|
||||
if (IS_ENABLED(CONFIG_UHID) && parser->device->ll_driver == &uhid_hid_driver)
|
||||
if (IS_BUILTIN(CONFIG_UHID) && parser->device->ll_driver == &uhid_hid_driver)
|
||||
max_buffer_size = UHID_DATA_MAX;
|
||||
|
||||
/* Total size check: Allow for possible report index byte */
|
||||
|
|
@ -1767,7 +1767,7 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
|
|||
|
||||
rsize = hid_compute_report_size(report);
|
||||
|
||||
if (IS_ENABLED(CONFIG_UHID) && hid->ll_driver == &uhid_hid_driver)
|
||||
if (IS_BUILTIN(CONFIG_UHID) && hid->ll_driver == &uhid_hid_driver)
|
||||
max_buffer_size = UHID_DATA_MAX;
|
||||
|
||||
if (report_enum->numbered && rsize >= max_buffer_size)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@
|
|||
/* flags */
|
||||
#define I2C_HID_STARTED 0
|
||||
#define I2C_HID_RESET_PENDING 1
|
||||
#define I2C_HID_READ_PENDING 2
|
||||
|
||||
#define I2C_HID_PWR_ON 0x00
|
||||
#define I2C_HID_PWR_SLEEP 0x01
|
||||
|
|
@ -258,7 +257,6 @@ static int __i2c_hid_command(struct i2c_client *client,
|
|||
msg[1].len = data_len;
|
||||
msg[1].buf = buf_recv;
|
||||
msg_num = 2;
|
||||
set_bit(I2C_HID_READ_PENDING, &ihid->flags);
|
||||
}
|
||||
|
||||
if (wait)
|
||||
|
|
@ -266,9 +264,6 @@ static int __i2c_hid_command(struct i2c_client *client,
|
|||
|
||||
ret = i2c_transfer(client->adapter, msg, msg_num);
|
||||
|
||||
if (data_len > 0)
|
||||
clear_bit(I2C_HID_READ_PENDING, &ihid->flags);
|
||||
|
||||
if (ret != msg_num)
|
||||
return ret < 0 ? ret : -EIO;
|
||||
|
||||
|
|
@ -540,9 +535,6 @@ static irqreturn_t i2c_hid_irq(int irq, void *dev_id)
|
|||
{
|
||||
struct i2c_hid *ihid = dev_id;
|
||||
|
||||
if (test_bit(I2C_HID_READ_PENDING, &ihid->flags))
|
||||
return IRQ_HANDLED;
|
||||
|
||||
i2c_hid_get_input(ihid);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
|
|
|
|||
|
|
@ -1965,13 +1965,18 @@ static int i2c_check_for_quirks(struct i2c_adapter *adap, struct i2c_msg *msgs,
|
|||
* Returns negative errno, else the number of messages executed.
|
||||
*
|
||||
* Adapter lock must be held when calling this function. No debug logging
|
||||
* takes place. adap->algo->master_xfer existence isn't checked.
|
||||
* takes place.
|
||||
*/
|
||||
int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
|
||||
{
|
||||
unsigned long orig_jiffies;
|
||||
int ret, try;
|
||||
|
||||
if (!adap->algo->master_xfer) {
|
||||
dev_dbg(&adap->dev, "I2C level transfers not supported\n");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
if (WARN_ON(!msgs || num < 1))
|
||||
return -EINVAL;
|
||||
|
||||
|
|
@ -2038,11 +2043,6 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
|
|||
{
|
||||
int ret;
|
||||
|
||||
if (!adap->algo->master_xfer) {
|
||||
dev_dbg(&adap->dev, "I2C level transfers not supported\n");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
/* REVISIT the fault reporting model here is weak:
|
||||
*
|
||||
* - When we get an error after receiving N bytes from a slave,
|
||||
|
|
|
|||
|
|
@ -219,7 +219,8 @@ static int process_pma_cmd(struct mlx5_ib_dev *dev, u8 port_num,
|
|||
mdev = dev->mdev;
|
||||
mdev_port_num = 1;
|
||||
}
|
||||
if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1) {
|
||||
if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1 &&
|
||||
!mlx5_core_mp_enabled(mdev)) {
|
||||
/* set local port to one for Function-Per-Port HCA. */
|
||||
mdev = dev->mdev;
|
||||
mdev_port_num = 1;
|
||||
|
|
|
|||
|
|
@ -72,6 +72,8 @@ void rxe_dealloc(struct ib_device *ib_dev)
|
|||
|
||||
if (rxe->tfm)
|
||||
crypto_free_shash(rxe->tfm);
|
||||
|
||||
mutex_destroy(&rxe->usdev_lock);
|
||||
}
|
||||
|
||||
/* initialize rxe device parameters */
|
||||
|
|
|
|||
|
|
@ -3121,13 +3121,8 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
|
|||
set_bit(i, bitmap);
|
||||
}
|
||||
|
||||
if (err) {
|
||||
if (i > 0)
|
||||
its_vpe_irq_domain_free(domain, virq, i);
|
||||
|
||||
its_lpi_free(bitmap, base, nr_ids);
|
||||
its_free_prop_table(vprop_page);
|
||||
}
|
||||
if (err)
|
||||
its_vpe_irq_domain_free(domain, virq, i);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
#include "dm.h"
|
||||
|
||||
#define DM_RESERVED_MAX_IOS 1024
|
||||
#define DM_MAX_TARGETS 1048576
|
||||
#define DM_MAX_TARGET_PARAMS 1024
|
||||
|
||||
struct dm_kobject_holder {
|
||||
struct kobject kobj;
|
||||
|
|
|
|||
|
|
@ -1760,7 +1760,8 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kern
|
|||
if (copy_from_user(param_kernel, user, minimum_data_size))
|
||||
return -EFAULT;
|
||||
|
||||
if (param_kernel->data_size < minimum_data_size)
|
||||
if (unlikely(param_kernel->data_size < minimum_data_size) ||
|
||||
unlikely(param_kernel->data_size > DM_MAX_TARGETS * DM_MAX_TARGET_PARAMS))
|
||||
return -EINVAL;
|
||||
|
||||
secure_data = param_kernel->flags & DM_SECURE_DATA_FLAG;
|
||||
|
|
|
|||
|
|
@ -186,7 +186,12 @@ static int alloc_targets(struct dm_table *t, unsigned int num)
|
|||
int dm_table_create(struct dm_table **result, fmode_t mode,
|
||||
unsigned num_targets, struct mapped_device *md)
|
||||
{
|
||||
struct dm_table *t = kzalloc(sizeof(*t), GFP_KERNEL);
|
||||
struct dm_table *t;
|
||||
|
||||
if (num_targets > DM_MAX_TARGETS)
|
||||
return -EOVERFLOW;
|
||||
|
||||
t = kzalloc(sizeof(*t), GFP_KERNEL);
|
||||
|
||||
if (!t)
|
||||
return -ENOMEM;
|
||||
|
|
@ -201,7 +206,7 @@ int dm_table_create(struct dm_table **result, fmode_t mode,
|
|||
|
||||
if (!num_targets) {
|
||||
kfree(t);
|
||||
return -ENOMEM;
|
||||
return -EOVERFLOW;
|
||||
}
|
||||
|
||||
if (alloc_targets(t, num_targets)) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ static unsigned long doc_locations[] __initdata = {
|
|||
0xe8000, 0xea000, 0xec000, 0xee000,
|
||||
#endif
|
||||
#endif
|
||||
0xffffffff };
|
||||
};
|
||||
|
||||
static struct mtd_info *doclist = NULL;
|
||||
|
||||
|
|
@ -1666,7 +1666,7 @@ static int __init init_nanddoc(void)
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
} else {
|
||||
for (i = 0; (doc_locations[i] != 0xffffffff); i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(doc_locations); i++) {
|
||||
doc_probe(doc_locations[i]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4200,6 +4200,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6097,
|
||||
.name = "Marvell 88E6085",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 10,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
|
|
@ -4222,6 +4223,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6095,
|
||||
.name = "Marvell 88E6095/88E6095F",
|
||||
.num_databases = 256,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 11,
|
||||
.num_internal_phys = 0,
|
||||
.max_vid = 4095,
|
||||
|
|
@ -4242,6 +4244,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6097,
|
||||
.name = "Marvell 88E6097/88E6097F",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 11,
|
||||
.num_internal_phys = 8,
|
||||
.max_vid = 4095,
|
||||
|
|
@ -4264,6 +4267,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6165,
|
||||
.name = "Marvell 88E6123",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 1024,
|
||||
.num_ports = 3,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
|
|
@ -4286,6 +4290,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6185,
|
||||
.name = "Marvell 88E6131",
|
||||
.num_databases = 256,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 8,
|
||||
.num_internal_phys = 0,
|
||||
.max_vid = 4095,
|
||||
|
|
@ -4305,7 +4310,8 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6141,
|
||||
.family = MV88E6XXX_FAMILY_6341,
|
||||
.name = "Marvell 88E6141",
|
||||
.num_databases = 4096,
|
||||
.num_databases = 256,
|
||||
.num_macs = 2048,
|
||||
.num_ports = 6,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 11,
|
||||
|
|
@ -4329,6 +4335,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6165,
|
||||
.name = "Marvell 88E6161",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 1024,
|
||||
.num_ports = 6,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
|
|
@ -4352,6 +4359,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6165,
|
||||
.name = "Marvell 88E6165",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 6,
|
||||
.num_internal_phys = 0,
|
||||
.max_vid = 4095,
|
||||
|
|
@ -4375,6 +4383,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6351,
|
||||
.name = "Marvell 88E6171",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
|
|
@ -4397,6 +4406,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6352,
|
||||
.name = "Marvell 88E6172",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 15,
|
||||
|
|
@ -4420,6 +4430,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6351,
|
||||
.name = "Marvell 88E6175",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
|
|
@ -4442,6 +4453,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6352,
|
||||
.name = "Marvell 88E6176",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 15,
|
||||
|
|
@ -4465,6 +4477,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6185,
|
||||
.name = "Marvell 88E6185",
|
||||
.num_databases = 256,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 10,
|
||||
.num_internal_phys = 0,
|
||||
.max_vid = 4095,
|
||||
|
|
@ -4485,6 +4498,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6390,
|
||||
.name = "Marvell 88E6190",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 16384,
|
||||
.num_ports = 11, /* 10 + Z80 */
|
||||
.num_internal_phys = 9,
|
||||
.num_gpio = 16,
|
||||
|
|
@ -4508,6 +4522,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6390,
|
||||
.name = "Marvell 88E6190X",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 16384,
|
||||
.num_ports = 11, /* 10 + Z80 */
|
||||
.num_internal_phys = 9,
|
||||
.num_gpio = 16,
|
||||
|
|
@ -4531,6 +4546,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6390,
|
||||
.name = "Marvell 88E6191",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 16384,
|
||||
.num_ports = 11, /* 10 + Z80 */
|
||||
.num_internal_phys = 9,
|
||||
.max_vid = 8191,
|
||||
|
|
@ -4581,6 +4597,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6352,
|
||||
.name = "Marvell 88E6240",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 15,
|
||||
|
|
@ -4651,6 +4668,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6320,
|
||||
.name = "Marvell 88E6320",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 15,
|
||||
|
|
@ -4675,6 +4693,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6320,
|
||||
.name = "Marvell 88E6321",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 15,
|
||||
|
|
@ -4697,7 +4716,8 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6341,
|
||||
.family = MV88E6XXX_FAMILY_6341,
|
||||
.name = "Marvell 88E6341",
|
||||
.num_databases = 4096,
|
||||
.num_databases = 256,
|
||||
.num_macs = 2048,
|
||||
.num_internal_phys = 5,
|
||||
.num_ports = 6,
|
||||
.num_gpio = 11,
|
||||
|
|
@ -4722,6 +4742,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6351,
|
||||
.name = "Marvell 88E6350",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
|
|
@ -4744,6 +4765,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6351,
|
||||
.name = "Marvell 88E6351",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
|
|
@ -4766,6 +4788,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6352,
|
||||
.name = "Marvell 88E6352",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 15,
|
||||
|
|
@ -4789,6 +4812,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6390,
|
||||
.name = "Marvell 88E6390",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 16384,
|
||||
.num_ports = 11, /* 10 + Z80 */
|
||||
.num_internal_phys = 9,
|
||||
.num_gpio = 16,
|
||||
|
|
@ -4812,6 +4836,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
|||
.family = MV88E6XXX_FAMILY_6390,
|
||||
.name = "Marvell 88E6390X",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 16384,
|
||||
.num_ports = 11, /* 10 + Z80 */
|
||||
.num_internal_phys = 9,
|
||||
.num_gpio = 16,
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ struct mv88e6xxx_info {
|
|||
u16 prod_num;
|
||||
const char *name;
|
||||
unsigned int num_databases;
|
||||
unsigned int num_macs;
|
||||
unsigned int num_ports;
|
||||
unsigned int num_internal_phys;
|
||||
unsigned int num_gpio;
|
||||
|
|
@ -609,6 +610,11 @@ static inline unsigned int mv88e6xxx_num_databases(struct mv88e6xxx_chip *chip)
|
|||
return chip->info->num_databases;
|
||||
}
|
||||
|
||||
static inline unsigned int mv88e6xxx_num_macs(struct mv88e6xxx_chip *chip)
|
||||
{
|
||||
return chip->info->num_macs;
|
||||
}
|
||||
|
||||
static inline unsigned int mv88e6xxx_num_ports(struct mv88e6xxx_chip *chip)
|
||||
{
|
||||
return chip->info->num_ports;
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev,
|
|||
ENA_COM_BOUNCE_BUFFER_CNTRL_CNT;
|
||||
io_sq->bounce_buf_ctrl.next_to_use = 0;
|
||||
|
||||
size = io_sq->bounce_buf_ctrl.buffer_size *
|
||||
size = (size_t)io_sq->bounce_buf_ctrl.buffer_size *
|
||||
io_sq->bounce_buf_ctrl.buffers_num;
|
||||
|
||||
dev_node = dev_to_node(ena_dev->dmadev);
|
||||
|
|
|
|||
|
|
@ -2033,12 +2033,14 @@ static int b44_set_pauseparam(struct net_device *dev,
|
|||
bp->flags |= B44_FLAG_TX_PAUSE;
|
||||
else
|
||||
bp->flags &= ~B44_FLAG_TX_PAUSE;
|
||||
if (bp->flags & B44_FLAG_PAUSE_AUTO) {
|
||||
b44_halt(bp);
|
||||
b44_init_rings(bp);
|
||||
b44_init_hw(bp, B44_FULL_RESET);
|
||||
} else {
|
||||
__b44_set_flow_ctrl(bp, bp->flags);
|
||||
if (netif_running(dev)) {
|
||||
if (bp->flags & B44_FLAG_PAUSE_AUTO) {
|
||||
b44_halt(bp);
|
||||
b44_init_rings(bp);
|
||||
b44_init_hw(bp, B44_FULL_RESET);
|
||||
} else {
|
||||
__b44_set_flow_ctrl(bp, bp->flags);
|
||||
}
|
||||
}
|
||||
spin_unlock_irq(&bp->lock);
|
||||
|
||||
|
|
|
|||
|
|
@ -2796,7 +2796,7 @@ static void bcmgenet_set_hw_addr(struct bcmgenet_priv *priv,
|
|||
}
|
||||
|
||||
/* Returns a reusable dma control register value */
|
||||
static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv)
|
||||
static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv, bool flush_rx)
|
||||
{
|
||||
unsigned int i;
|
||||
u32 reg;
|
||||
|
|
@ -2821,6 +2821,14 @@ static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv)
|
|||
udelay(10);
|
||||
bcmgenet_umac_writel(priv, 0, UMAC_TX_FLUSH);
|
||||
|
||||
if (flush_rx) {
|
||||
reg = bcmgenet_rbuf_ctrl_get(priv);
|
||||
bcmgenet_rbuf_ctrl_set(priv, reg | BIT(0));
|
||||
udelay(10);
|
||||
bcmgenet_rbuf_ctrl_set(priv, reg);
|
||||
udelay(10);
|
||||
}
|
||||
|
||||
return dma_ctrl;
|
||||
}
|
||||
|
||||
|
|
@ -2916,8 +2924,8 @@ static int bcmgenet_open(struct net_device *dev)
|
|||
|
||||
bcmgenet_set_hw_addr(priv, dev->dev_addr);
|
||||
|
||||
/* Disable RX/TX DMA and flush TX queues */
|
||||
dma_ctrl = bcmgenet_dma_disable(priv);
|
||||
/* Disable RX/TX DMA and flush TX and RX queues */
|
||||
dma_ctrl = bcmgenet_dma_disable(priv, true);
|
||||
|
||||
/* Reinitialize TDMA and RDMA and SW housekeeping */
|
||||
ret = bcmgenet_init_dma(priv);
|
||||
|
|
@ -3670,7 +3678,7 @@ static int bcmgenet_resume(struct device *d)
|
|||
bcmgenet_power_up(priv, GENET_POWER_WOL_MAGIC);
|
||||
|
||||
/* Disable RX/TX DMA and flush TX queues */
|
||||
dma_ctrl = bcmgenet_dma_disable(priv);
|
||||
dma_ctrl = bcmgenet_dma_disable(priv, false);
|
||||
|
||||
/* Reinitialize TDMA and RDMA and SW housekeeping */
|
||||
ret = bcmgenet_init_dma(priv);
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ bnad_debugfs_write_regrd(struct file *file, const char __user *buf,
|
|||
void *kern_buf;
|
||||
|
||||
/* Copy the user space buf */
|
||||
kern_buf = memdup_user(buf, nbytes);
|
||||
kern_buf = memdup_user_nul(buf, nbytes);
|
||||
if (IS_ERR(kern_buf))
|
||||
return PTR_ERR(kern_buf);
|
||||
|
||||
|
|
@ -372,7 +372,7 @@ bnad_debugfs_write_regwr(struct file *file, const char __user *buf,
|
|||
void *kern_buf;
|
||||
|
||||
/* Copy the user space buf */
|
||||
kern_buf = memdup_user(buf, nbytes);
|
||||
kern_buf = memdup_user_nul(buf, nbytes);
|
||||
if (IS_ERR(kern_buf))
|
||||
return PTR_ERR(kern_buf);
|
||||
|
||||
|
|
|
|||
|
|
@ -15971,7 +15971,7 @@ static int __init i40e_init_module(void)
|
|||
* since we need to be able to guarantee forward progress even under
|
||||
* memory pressure.
|
||||
*/
|
||||
i40e_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, i40e_driver_name);
|
||||
i40e_wq = alloc_workqueue("%s", 0, 0, i40e_driver_name);
|
||||
if (!i40e_wq) {
|
||||
pr_err("%s: Failed to create workqueue\n", i40e_driver_name);
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -2647,6 +2647,34 @@ static void iavf_del_all_cloud_filters(struct iavf_adapter *adapter)
|
|||
spin_unlock_bh(&adapter->cloud_filter_list_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* iavf_is_tc_config_same - Compare the mqprio TC config with the
|
||||
* TC config already configured on this adapter.
|
||||
* @adapter: board private structure
|
||||
* @mqprio_qopt: TC config received from kernel.
|
||||
*
|
||||
* This function compares the TC config received from the kernel
|
||||
* with the config already configured on the adapter.
|
||||
*
|
||||
* Return: True if configuration is same, false otherwise.
|
||||
**/
|
||||
static bool iavf_is_tc_config_same(struct iavf_adapter *adapter,
|
||||
struct tc_mqprio_qopt *mqprio_qopt)
|
||||
{
|
||||
struct virtchnl_channel_info *ch = &adapter->ch_config.ch_info[0];
|
||||
int i;
|
||||
|
||||
if (adapter->num_tc != mqprio_qopt->num_tc)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < adapter->num_tc; i++) {
|
||||
if (ch[i].count != mqprio_qopt->count[i] ||
|
||||
ch[i].offset != mqprio_qopt->offset[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* __iavf_setup_tc - configure multiple traffic classes
|
||||
* @netdev: network interface device structure
|
||||
|
|
@ -2703,7 +2731,7 @@ static int __iavf_setup_tc(struct net_device *netdev, void *type_data)
|
|||
if (ret)
|
||||
return ret;
|
||||
/* Return if same TC config is requested */
|
||||
if (adapter->num_tc == num_tc)
|
||||
if (iavf_is_tc_config_same(adapter, &mqprio_qopt->qopt))
|
||||
return 0;
|
||||
adapter->num_tc = num_tc;
|
||||
|
||||
|
|
|
|||
|
|
@ -114,15 +114,18 @@ static u8 alloc_token(struct mlx5_cmd *cmd)
|
|||
return token;
|
||||
}
|
||||
|
||||
static int cmd_alloc_index(struct mlx5_cmd *cmd)
|
||||
static int cmd_alloc_index(struct mlx5_cmd *cmd, struct mlx5_cmd_work_ent *ent)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
spin_lock_irqsave(&cmd->alloc_lock, flags);
|
||||
ret = find_first_bit(&cmd->bitmask, cmd->max_reg_cmds);
|
||||
if (ret < cmd->max_reg_cmds)
|
||||
if (ret < cmd->max_reg_cmds) {
|
||||
clear_bit(ret, &cmd->bitmask);
|
||||
ent->idx = ret;
|
||||
cmd->ent_arr[ent->idx] = ent;
|
||||
}
|
||||
spin_unlock_irqrestore(&cmd->alloc_lock, flags);
|
||||
|
||||
return ret < cmd->max_reg_cmds ? ret : -ENOMEM;
|
||||
|
|
@ -905,7 +908,7 @@ static void cmd_work_handler(struct work_struct *work)
|
|||
sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem;
|
||||
down(sem);
|
||||
if (!ent->page_queue) {
|
||||
alloc_ret = cmd_alloc_index(cmd);
|
||||
alloc_ret = cmd_alloc_index(cmd, ent);
|
||||
if (alloc_ret < 0) {
|
||||
mlx5_core_err(dev, "failed to allocate command entry\n");
|
||||
if (ent->callback) {
|
||||
|
|
@ -920,15 +923,14 @@ static void cmd_work_handler(struct work_struct *work)
|
|||
up(sem);
|
||||
return;
|
||||
}
|
||||
ent->idx = alloc_ret;
|
||||
} else {
|
||||
ent->idx = cmd->max_reg_cmds;
|
||||
spin_lock_irqsave(&cmd->alloc_lock, flags);
|
||||
clear_bit(ent->idx, &cmd->bitmask);
|
||||
cmd->ent_arr[ent->idx] = ent;
|
||||
spin_unlock_irqrestore(&cmd->alloc_lock, flags);
|
||||
}
|
||||
|
||||
cmd->ent_arr[ent->idx] = ent;
|
||||
lay = get_inst(cmd, ent->idx);
|
||||
ent->lay = lay;
|
||||
memset(lay, 0, sizeof(*lay));
|
||||
|
|
|
|||
|
|
@ -1549,8 +1549,9 @@ static struct mlx5_flow_handle *add_rule_fg(struct mlx5_flow_group *fg,
|
|||
}
|
||||
trace_mlx5_fs_set_fte(fte, false);
|
||||
|
||||
/* Link newly added rules into the tree. */
|
||||
for (i = 0; i < handle->num_rules; i++) {
|
||||
if (refcount_read(&handle->rule[i]->node.refcount) == 1) {
|
||||
if (!handle->rule[i]->node.parent) {
|
||||
tree_add_node(&handle->rule[i]->node, &fte->node);
|
||||
trace_mlx5_fs_add_rule(handle->rule[i]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ free_skb:
|
|||
|
||||
static const struct mlxsw_listener mlxsw_emad_rx_listener =
|
||||
MLXSW_RXL(mlxsw_emad_rx_listener_func, ETHEMAD, TRAP_TO_CPU, false,
|
||||
EMAD, DISCARD);
|
||||
EMAD, FORWARD);
|
||||
|
||||
static int mlxsw_emad_init(struct mlxsw_core *mlxsw_core)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -756,7 +756,9 @@ static void mlxsw_sp_acl_tcam_vregion_rehash_work(struct work_struct *work)
|
|||
rehash.dw.work);
|
||||
int credits = MLXSW_SP_ACL_TCAM_VREGION_REHASH_CREDITS;
|
||||
|
||||
mutex_lock(&vregion->lock);
|
||||
mlxsw_sp_acl_tcam_vregion_rehash(vregion->mlxsw_sp, vregion, &credits);
|
||||
mutex_unlock(&vregion->lock);
|
||||
if (credits < 0)
|
||||
/* Rehash gone out of credits so it was interrupted.
|
||||
* Schedule the work as soon as possible to continue.
|
||||
|
|
@ -766,6 +768,17 @@ static void mlxsw_sp_acl_tcam_vregion_rehash_work(struct work_struct *work)
|
|||
mlxsw_sp_acl_tcam_vregion_rehash_work_schedule(vregion);
|
||||
}
|
||||
|
||||
static void
|
||||
mlxsw_sp_acl_tcam_rehash_ctx_vchunk_reset(struct mlxsw_sp_acl_tcam_rehash_ctx *ctx)
|
||||
{
|
||||
/* The entry markers are relative to the current chunk and therefore
|
||||
* needs to be reset together with the chunk marker.
|
||||
*/
|
||||
ctx->current_vchunk = NULL;
|
||||
ctx->start_ventry = NULL;
|
||||
ctx->stop_ventry = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
mlxsw_sp_acl_tcam_rehash_ctx_vchunk_changed(struct mlxsw_sp_acl_tcam_vchunk *vchunk)
|
||||
{
|
||||
|
|
@ -788,7 +801,7 @@ mlxsw_sp_acl_tcam_rehash_ctx_vregion_changed(struct mlxsw_sp_acl_tcam_vregion *v
|
|||
* the current chunk pointer to make sure all chunks
|
||||
* are properly migrated.
|
||||
*/
|
||||
vregion->rehash.ctx.current_vchunk = NULL;
|
||||
mlxsw_sp_acl_tcam_rehash_ctx_vchunk_reset(&vregion->rehash.ctx);
|
||||
}
|
||||
|
||||
static struct mlxsw_sp_acl_tcam_vregion *
|
||||
|
|
@ -861,10 +874,14 @@ mlxsw_sp_acl_tcam_vregion_destroy(struct mlxsw_sp *mlxsw_sp,
|
|||
struct mlxsw_sp_acl_tcam *tcam = vregion->tcam;
|
||||
|
||||
if (vgroup->vregion_rehash_enabled && ops->region_rehash_hints_get) {
|
||||
struct mlxsw_sp_acl_tcam_rehash_ctx *ctx = &vregion->rehash.ctx;
|
||||
|
||||
mutex_lock(&tcam->lock);
|
||||
list_del(&vregion->tlist);
|
||||
mutex_unlock(&tcam->lock);
|
||||
cancel_delayed_work_sync(&vregion->rehash.dw);
|
||||
if (cancel_delayed_work_sync(&vregion->rehash.dw) &&
|
||||
ctx->hints_priv)
|
||||
ops->region_rehash_hints_put(ctx->hints_priv);
|
||||
}
|
||||
mlxsw_sp_acl_tcam_vgroup_vregion_detach(mlxsw_sp, vregion);
|
||||
if (vregion->region2)
|
||||
|
|
@ -1228,8 +1245,14 @@ mlxsw_sp_acl_tcam_ventry_activity_get(struct mlxsw_sp *mlxsw_sp,
|
|||
struct mlxsw_sp_acl_tcam_ventry *ventry,
|
||||
bool *activity)
|
||||
{
|
||||
return mlxsw_sp_acl_tcam_entry_activity_get(mlxsw_sp,
|
||||
ventry->entry, activity);
|
||||
struct mlxsw_sp_acl_tcam_vregion *vregion = ventry->vchunk->vregion;
|
||||
int err;
|
||||
|
||||
mutex_lock(&vregion->lock);
|
||||
err = mlxsw_sp_acl_tcam_entry_activity_get(mlxsw_sp, ventry->entry,
|
||||
activity);
|
||||
mutex_unlock(&vregion->lock);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1263,6 +1286,8 @@ mlxsw_sp_acl_tcam_vchunk_migrate_start(struct mlxsw_sp *mlxsw_sp,
|
|||
{
|
||||
struct mlxsw_sp_acl_tcam_chunk *new_chunk;
|
||||
|
||||
WARN_ON(vchunk->chunk2);
|
||||
|
||||
new_chunk = mlxsw_sp_acl_tcam_chunk_create(mlxsw_sp, vchunk, region);
|
||||
if (IS_ERR(new_chunk))
|
||||
return PTR_ERR(new_chunk);
|
||||
|
|
@ -1281,7 +1306,7 @@ mlxsw_sp_acl_tcam_vchunk_migrate_end(struct mlxsw_sp *mlxsw_sp,
|
|||
{
|
||||
mlxsw_sp_acl_tcam_chunk_destroy(mlxsw_sp, vchunk->chunk2);
|
||||
vchunk->chunk2 = NULL;
|
||||
ctx->current_vchunk = NULL;
|
||||
mlxsw_sp_acl_tcam_rehash_ctx_vchunk_reset(ctx);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1304,6 +1329,9 @@ mlxsw_sp_acl_tcam_vchunk_migrate_one(struct mlxsw_sp *mlxsw_sp,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (list_empty(&vchunk->ventry_list))
|
||||
goto out;
|
||||
|
||||
/* If the migration got interrupted, we have the ventry to start from
|
||||
* stored in context.
|
||||
*/
|
||||
|
|
@ -1313,6 +1341,8 @@ mlxsw_sp_acl_tcam_vchunk_migrate_one(struct mlxsw_sp *mlxsw_sp,
|
|||
ventry = list_first_entry(&vchunk->ventry_list,
|
||||
typeof(*ventry), list);
|
||||
|
||||
WARN_ON(ventry->vchunk != vchunk);
|
||||
|
||||
list_for_each_entry_from(ventry, &vchunk->ventry_list, list) {
|
||||
/* During rollback, once we reach the ventry that failed
|
||||
* to migrate, we are done.
|
||||
|
|
@ -1353,6 +1383,7 @@ mlxsw_sp_acl_tcam_vchunk_migrate_one(struct mlxsw_sp *mlxsw_sp,
|
|||
}
|
||||
}
|
||||
|
||||
out:
|
||||
mlxsw_sp_acl_tcam_vchunk_migrate_end(mlxsw_sp, vchunk, ctx);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1366,6 +1397,9 @@ mlxsw_sp_acl_tcam_vchunk_migrate_all(struct mlxsw_sp *mlxsw_sp,
|
|||
struct mlxsw_sp_acl_tcam_vchunk *vchunk;
|
||||
int err;
|
||||
|
||||
if (list_empty(&vregion->vchunk_list))
|
||||
return 0;
|
||||
|
||||
/* If the migration got interrupted, we have the vchunk
|
||||
* we are working on stored in context.
|
||||
*/
|
||||
|
|
@ -1394,16 +1428,17 @@ mlxsw_sp_acl_tcam_vregion_migrate(struct mlxsw_sp *mlxsw_sp,
|
|||
int err, err2;
|
||||
|
||||
trace_mlxsw_sp_acl_tcam_vregion_migrate(mlxsw_sp, vregion);
|
||||
mutex_lock(&vregion->lock);
|
||||
err = mlxsw_sp_acl_tcam_vchunk_migrate_all(mlxsw_sp, vregion,
|
||||
ctx, credits);
|
||||
if (err) {
|
||||
if (ctx->this_is_rollback)
|
||||
return err;
|
||||
/* In case migration was not successful, we need to swap
|
||||
* so the original region pointer is assigned again
|
||||
* to vregion->region.
|
||||
*/
|
||||
swap(vregion->region, vregion->region2);
|
||||
ctx->current_vchunk = NULL;
|
||||
mlxsw_sp_acl_tcam_rehash_ctx_vchunk_reset(ctx);
|
||||
ctx->this_is_rollback = true;
|
||||
err2 = mlxsw_sp_acl_tcam_vchunk_migrate_all(mlxsw_sp, vregion,
|
||||
ctx, credits);
|
||||
|
|
@ -1414,7 +1449,6 @@ mlxsw_sp_acl_tcam_vregion_migrate(struct mlxsw_sp *mlxsw_sp,
|
|||
/* Let the rollback to be continued later on. */
|
||||
}
|
||||
}
|
||||
mutex_unlock(&vregion->lock);
|
||||
trace_mlxsw_sp_acl_tcam_vregion_migrate_end(mlxsw_sp, vregion);
|
||||
return err;
|
||||
}
|
||||
|
|
@ -1463,6 +1497,7 @@ mlxsw_sp_acl_tcam_vregion_rehash_start(struct mlxsw_sp *mlxsw_sp,
|
|||
|
||||
ctx->hints_priv = hints_priv;
|
||||
ctx->this_is_rollback = false;
|
||||
mlxsw_sp_acl_tcam_rehash_ctx_vchunk_reset(ctx);
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
@ -1515,7 +1550,8 @@ mlxsw_sp_acl_tcam_vregion_rehash(struct mlxsw_sp *mlxsw_sp,
|
|||
err = mlxsw_sp_acl_tcam_vregion_migrate(mlxsw_sp, vregion,
|
||||
ctx, credits);
|
||||
if (err) {
|
||||
dev_err(mlxsw_sp->bus_info->dev, "Failed to migrate vregion\n");
|
||||
dev_err_ratelimited(mlxsw_sp->bus_info->dev, "Failed to migrate vregion\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (*credits >= 0)
|
||||
|
|
|
|||
|
|
@ -1949,8 +1949,8 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
|
|||
struct flow_cls_offload *f)
|
||||
{
|
||||
struct qede_arfs_fltr_node *n;
|
||||
int min_hlen, rc = -EINVAL;
|
||||
struct qede_arfs_tuple t;
|
||||
int min_hlen, rc;
|
||||
|
||||
__qede_lock(edev);
|
||||
|
||||
|
|
@ -1960,7 +1960,8 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
|
|||
}
|
||||
|
||||
/* parse flower attribute and prepare filter */
|
||||
if (qede_parse_flow_attr(edev, proto, f->rule, &t))
|
||||
rc = qede_parse_flow_attr(edev, proto, f->rule, &t);
|
||||
if (rc)
|
||||
goto unlock;
|
||||
|
||||
/* Validate profile mode and number of filters */
|
||||
|
|
@ -1969,12 +1970,15 @@ int qede_add_tc_flower_fltr(struct qede_dev *edev, __be16 proto,
|
|||
DP_NOTICE(edev,
|
||||
"Filter configuration invalidated, filter mode=0x%x, configured mode=0x%x, filter count=0x%x\n",
|
||||
t.mode, edev->arfs->mode, edev->arfs->filter_count);
|
||||
rc = -EINVAL;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
/* parse tc actions and get the vf_id */
|
||||
if (qede_parse_actions(edev, &f->rule->action))
|
||||
if (qede_parse_actions(edev, &f->rule->action)) {
|
||||
rc = -EINVAL;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (qede_flow_find_fltr(edev, &t)) {
|
||||
rc = -EEXIST;
|
||||
|
|
@ -2079,10 +2083,9 @@ static int qede_flow_spec_to_rule(struct qede_dev *edev,
|
|||
if (IS_ERR(flow))
|
||||
return PTR_ERR(flow);
|
||||
|
||||
if (qede_parse_flow_attr(edev, proto, flow->rule, t)) {
|
||||
err = -EINVAL;
|
||||
err = qede_parse_flow_attr(edev, proto, flow->rule, t);
|
||||
if (err)
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
/* Make sure location is valid and filter isn't already set */
|
||||
err = qede_flow_spec_validate(edev, &flow->rule->action, t,
|
||||
|
|
|
|||
|
|
@ -890,7 +890,7 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
|
|||
__be16 sport;
|
||||
int err;
|
||||
|
||||
if (!pskb_inet_may_pull(skb))
|
||||
if (!skb_vlan_inet_prepare(skb))
|
||||
return -EINVAL;
|
||||
|
||||
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
|
||||
|
|
@ -956,7 +956,7 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
|
|||
__be16 sport;
|
||||
int err;
|
||||
|
||||
if (!pskb_inet_may_pull(skb))
|
||||
if (!skb_vlan_inet_prepare(skb))
|
||||
return -EINVAL;
|
||||
|
||||
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
|
||||
|
|
|
|||
|
|
@ -706,11 +706,12 @@ out_hashtable:
|
|||
static void gtp_dellink(struct net_device *dev, struct list_head *head)
|
||||
{
|
||||
struct gtp_dev *gtp = netdev_priv(dev);
|
||||
struct hlist_node *next;
|
||||
struct pdp_ctx *pctx;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < gtp->hash_size; i++)
|
||||
hlist_for_each_entry_rcu(pctx, >p->tid_hash[i], hlist_tid)
|
||||
hlist_for_each_entry_safe(pctx, next, >p->tid_hash[i], hlist_tid)
|
||||
pdp_context_delete(pctx);
|
||||
|
||||
list_del_rcu(>p->list);
|
||||
|
|
|
|||
|
|
@ -2208,14 +2208,16 @@ static ssize_t tun_put_user(struct tun_struct *tun,
|
|||
tun_is_little_endian(tun), true,
|
||||
vlan_hlen)) {
|
||||
struct skb_shared_info *sinfo = skb_shinfo(skb);
|
||||
pr_err("unexpected GSO type: "
|
||||
"0x%x, gso_size %d, hdr_len %d\n",
|
||||
sinfo->gso_type, tun16_to_cpu(tun, gso.gso_size),
|
||||
tun16_to_cpu(tun, gso.hdr_len));
|
||||
print_hex_dump(KERN_ERR, "tun: ",
|
||||
DUMP_PREFIX_NONE,
|
||||
16, 1, skb->head,
|
||||
min((int)tun16_to_cpu(tun, gso.hdr_len), 64), true);
|
||||
|
||||
if (net_ratelimit()) {
|
||||
netdev_err(tun->dev, "unexpected GSO type: 0x%x, gso_size %d, hdr_len %d\n",
|
||||
sinfo->gso_type, tun16_to_cpu(tun, gso.gso_size),
|
||||
tun16_to_cpu(tun, gso.hdr_len));
|
||||
print_hex_dump(KERN_ERR, "tun: ",
|
||||
DUMP_PREFIX_NONE,
|
||||
16, 1, skb->head,
|
||||
min((int)tun16_to_cpu(tun, gso.hdr_len), 64), true);
|
||||
}
|
||||
WARN_ON_ONCE(1);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1452,21 +1452,16 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
|
|||
/* Skip IP alignment pseudo header */
|
||||
skb_pull(skb, 2);
|
||||
|
||||
skb->truesize = SKB_TRUESIZE(pkt_len_plus_padd);
|
||||
ax88179_rx_checksum(skb, pkt_hdr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ax_skb = skb_clone(skb, GFP_ATOMIC);
|
||||
ax_skb = netdev_alloc_skb_ip_align(dev->net, pkt_len);
|
||||
if (!ax_skb)
|
||||
return 0;
|
||||
skb_trim(ax_skb, pkt_len);
|
||||
skb_put(ax_skb, pkt_len);
|
||||
memcpy(ax_skb->data, skb->data + 2, pkt_len);
|
||||
|
||||
/* Skip IP alignment pseudo header */
|
||||
skb_pull(ax_skb, 2);
|
||||
|
||||
skb->truesize = pkt_len_plus_padd +
|
||||
SKB_DATA_ALIGN(sizeof(struct sk_buff));
|
||||
ax88179_rx_checksum(ax_skb, pkt_hdr);
|
||||
usbnet_skb_return(dev, ax_skb);
|
||||
|
||||
|
|
|
|||
|
|
@ -1380,6 +1380,7 @@ static const struct usb_device_id products[] = {
|
|||
{QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/
|
||||
{QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
|
||||
{QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
|
||||
{QMI_QUIRK_SET_DTR(0x33f8, 0x0104, 4)}, /* Rolling RW101 RMNET */
|
||||
|
||||
/* 4. Gobi 1000 devices */
|
||||
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
|
||||
|
|
|
|||
|
|
@ -1605,6 +1605,10 @@ static bool vxlan_set_mac(struct vxlan_dev *vxlan,
|
|||
if (ether_addr_equal(eth_hdr(skb)->h_source, vxlan->dev->dev_addr))
|
||||
return false;
|
||||
|
||||
/* Ignore packets from invalid src-address */
|
||||
if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
|
||||
return false;
|
||||
|
||||
/* Get address from the outer IP header */
|
||||
if (vxlan_get_sk_family(vs) == AF_INET) {
|
||||
saddr.sin.sin_addr.s_addr = ip_hdr(skb)->saddr;
|
||||
|
|
|
|||
|
|
@ -424,7 +424,8 @@ struct trf7970a {
|
|||
enum trf7970a_state state;
|
||||
struct device *dev;
|
||||
struct spi_device *spi;
|
||||
struct regulator *regulator;
|
||||
struct regulator *vin_regulator;
|
||||
struct regulator *vddio_regulator;
|
||||
struct nfc_digital_dev *ddev;
|
||||
u32 quirks;
|
||||
bool is_initiator;
|
||||
|
|
@ -1883,7 +1884,7 @@ static int trf7970a_power_up(struct trf7970a *trf)
|
|||
if (trf->state != TRF7970A_ST_PWR_OFF)
|
||||
return 0;
|
||||
|
||||
ret = regulator_enable(trf->regulator);
|
||||
ret = regulator_enable(trf->vin_regulator);
|
||||
if (ret) {
|
||||
dev_err(trf->dev, "%s - Can't enable VIN: %d\n", __func__, ret);
|
||||
return ret;
|
||||
|
|
@ -1926,7 +1927,7 @@ static int trf7970a_power_down(struct trf7970a *trf)
|
|||
if (trf->en2_gpiod && !(trf->quirks & TRF7970A_QUIRK_EN2_MUST_STAY_LOW))
|
||||
gpiod_set_value_cansleep(trf->en2_gpiod, 0);
|
||||
|
||||
ret = regulator_disable(trf->regulator);
|
||||
ret = regulator_disable(trf->vin_regulator);
|
||||
if (ret)
|
||||
dev_err(trf->dev, "%s - Can't disable VIN: %d\n", __func__,
|
||||
ret);
|
||||
|
|
@ -2065,37 +2066,37 @@ static int trf7970a_probe(struct spi_device *spi)
|
|||
mutex_init(&trf->lock);
|
||||
INIT_DELAYED_WORK(&trf->timeout_work, trf7970a_timeout_work_handler);
|
||||
|
||||
trf->regulator = devm_regulator_get(&spi->dev, "vin");
|
||||
if (IS_ERR(trf->regulator)) {
|
||||
ret = PTR_ERR(trf->regulator);
|
||||
trf->vin_regulator = devm_regulator_get(&spi->dev, "vin");
|
||||
if (IS_ERR(trf->vin_regulator)) {
|
||||
ret = PTR_ERR(trf->vin_regulator);
|
||||
dev_err(trf->dev, "Can't get VIN regulator: %d\n", ret);
|
||||
goto err_destroy_lock;
|
||||
}
|
||||
|
||||
ret = regulator_enable(trf->regulator);
|
||||
ret = regulator_enable(trf->vin_regulator);
|
||||
if (ret) {
|
||||
dev_err(trf->dev, "Can't enable VIN: %d\n", ret);
|
||||
goto err_destroy_lock;
|
||||
}
|
||||
|
||||
uvolts = regulator_get_voltage(trf->regulator);
|
||||
uvolts = regulator_get_voltage(trf->vin_regulator);
|
||||
if (uvolts > 4000000)
|
||||
trf->chip_status_ctrl = TRF7970A_CHIP_STATUS_VRS5_3;
|
||||
|
||||
trf->regulator = devm_regulator_get(&spi->dev, "vdd-io");
|
||||
if (IS_ERR(trf->regulator)) {
|
||||
ret = PTR_ERR(trf->regulator);
|
||||
trf->vddio_regulator = devm_regulator_get(&spi->dev, "vdd-io");
|
||||
if (IS_ERR(trf->vddio_regulator)) {
|
||||
ret = PTR_ERR(trf->vddio_regulator);
|
||||
dev_err(trf->dev, "Can't get VDD_IO regulator: %d\n", ret);
|
||||
goto err_destroy_lock;
|
||||
goto err_disable_vin_regulator;
|
||||
}
|
||||
|
||||
ret = regulator_enable(trf->regulator);
|
||||
ret = regulator_enable(trf->vddio_regulator);
|
||||
if (ret) {
|
||||
dev_err(trf->dev, "Can't enable VDD_IO: %d\n", ret);
|
||||
goto err_destroy_lock;
|
||||
goto err_disable_vin_regulator;
|
||||
}
|
||||
|
||||
if (regulator_get_voltage(trf->regulator) == 1800000) {
|
||||
if (regulator_get_voltage(trf->vddio_regulator) == 1800000) {
|
||||
trf->io_ctrl = TRF7970A_REG_IO_CTRL_IO_LOW;
|
||||
dev_dbg(trf->dev, "trf7970a config vdd_io to 1.8V\n");
|
||||
}
|
||||
|
|
@ -2108,7 +2109,7 @@ static int trf7970a_probe(struct spi_device *spi)
|
|||
if (!trf->ddev) {
|
||||
dev_err(trf->dev, "Can't allocate NFC digital device\n");
|
||||
ret = -ENOMEM;
|
||||
goto err_disable_regulator;
|
||||
goto err_disable_vddio_regulator;
|
||||
}
|
||||
|
||||
nfc_digital_set_parent_dev(trf->ddev, trf->dev);
|
||||
|
|
@ -2137,8 +2138,10 @@ err_shutdown:
|
|||
trf7970a_shutdown(trf);
|
||||
err_free_ddev:
|
||||
nfc_digital_free_device(trf->ddev);
|
||||
err_disable_regulator:
|
||||
regulator_disable(trf->regulator);
|
||||
err_disable_vddio_regulator:
|
||||
regulator_disable(trf->vddio_regulator);
|
||||
err_disable_vin_regulator:
|
||||
regulator_disable(trf->vin_regulator);
|
||||
err_destroy_lock:
|
||||
mutex_destroy(&trf->lock);
|
||||
return ret;
|
||||
|
|
@ -2157,7 +2160,8 @@ static int trf7970a_remove(struct spi_device *spi)
|
|||
nfc_digital_unregister_device(trf->ddev);
|
||||
nfc_digital_free_device(trf->ddev);
|
||||
|
||||
regulator_disable(trf->regulator);
|
||||
regulator_disable(trf->vddio_regulator);
|
||||
regulator_disable(trf->vin_regulator);
|
||||
|
||||
mutex_destroy(&trf->lock);
|
||||
|
||||
|
|
|
|||
|
|
@ -2054,13 +2054,7 @@ int pinctrl_enable(struct pinctrl_dev *pctldev)
|
|||
|
||||
error = pinctrl_claim_hogs(pctldev);
|
||||
if (error) {
|
||||
dev_err(pctldev->dev, "could not claim hogs: %i\n",
|
||||
error);
|
||||
pinctrl_free_pindescs(pctldev, pctldev->desc->pins,
|
||||
pctldev->desc->npins);
|
||||
mutex_destroy(&pctldev->mutex);
|
||||
kfree(pctldev);
|
||||
|
||||
dev_err(pctldev->dev, "could not claim hogs: %i\n", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -223,14 +223,16 @@ int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev)
|
|||
for (state = 0; ; state++) {
|
||||
/* Retrieve the pinctrl-* property */
|
||||
propname = kasprintf(GFP_KERNEL, "pinctrl-%d", state);
|
||||
if (!propname)
|
||||
return -ENOMEM;
|
||||
if (!propname) {
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
prop = of_find_property(np, propname, &size);
|
||||
kfree(propname);
|
||||
if (!prop) {
|
||||
if (state == 0) {
|
||||
of_node_put(np);
|
||||
return -ENODEV;
|
||||
ret = -ENODEV;
|
||||
goto err;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1070,15 +1070,12 @@ static const struct mtk_pin_soc mt6765_data = {
|
|||
.ngrps = ARRAY_SIZE(mtk_pins_mt6765),
|
||||
.eint_hw = &mt6765_eint_hw,
|
||||
.gpio_m = 0,
|
||||
.ies_present = true,
|
||||
.base_names = mt6765_pinctrl_register_base_names,
|
||||
.nbase_names = ARRAY_SIZE(mt6765_pinctrl_register_base_names),
|
||||
.bias_disable_set = mtk_pinconf_bias_disable_set,
|
||||
.bias_disable_get = mtk_pinconf_bias_disable_get,
|
||||
.bias_set = mtk_pinconf_bias_set,
|
||||
.bias_get = mtk_pinconf_bias_get,
|
||||
.drive_set = mtk_pinconf_drive_set_rev1,
|
||||
.drive_get = mtk_pinconf_drive_get_rev1,
|
||||
.bias_set_combo = mtk_pinconf_bias_set_combo,
|
||||
.bias_get_combo = mtk_pinconf_bias_get_combo,
|
||||
.drive_set = mtk_pinconf_drive_set_raw,
|
||||
.drive_get = mtk_pinconf_drive_get_raw,
|
||||
.adv_pull_get = mtk_pinconf_adv_pull_get,
|
||||
.adv_pull_set = mtk_pinconf_adv_pull_set,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -554,13 +554,10 @@ static const struct mtk_pin_soc mt8183_data = {
|
|||
.ngrps = ARRAY_SIZE(mtk_pins_mt8183),
|
||||
.eint_hw = &mt8183_eint_hw,
|
||||
.gpio_m = 0,
|
||||
.ies_present = true,
|
||||
.base_names = mt8183_pinctrl_register_base_names,
|
||||
.nbase_names = ARRAY_SIZE(mt8183_pinctrl_register_base_names),
|
||||
.bias_disable_set = mtk_pinconf_bias_disable_set_rev1,
|
||||
.bias_disable_get = mtk_pinconf_bias_disable_get_rev1,
|
||||
.bias_set = mtk_pinconf_bias_set_rev1,
|
||||
.bias_get = mtk_pinconf_bias_get_rev1,
|
||||
.bias_set_combo = mtk_pinconf_bias_set_combo,
|
||||
.bias_get_combo = mtk_pinconf_bias_get_combo,
|
||||
.drive_set = mtk_pinconf_drive_set_rev1,
|
||||
.drive_get = mtk_pinconf_drive_get_rev1,
|
||||
.adv_pull_get = mtk_pinconf_adv_pull_get,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <dt-bindings/pinctrl/mt65xx.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
|
|
@ -66,34 +67,44 @@ static int mtk_hw_pin_field_lookup(struct mtk_pinctrl *hw,
|
|||
const struct mtk_pin_desc *desc,
|
||||
int field, struct mtk_pin_field *pfd)
|
||||
{
|
||||
const struct mtk_pin_field_calc *c, *e;
|
||||
const struct mtk_pin_field_calc *c;
|
||||
const struct mtk_pin_reg_calc *rc;
|
||||
int start = 0, end, check;
|
||||
bool found = false;
|
||||
u32 bits;
|
||||
|
||||
if (hw->soc->reg_cal && hw->soc->reg_cal[field].range) {
|
||||
rc = &hw->soc->reg_cal[field];
|
||||
} else {
|
||||
dev_dbg(hw->dev,
|
||||
"Not support field %d for pin %d (%s)\n",
|
||||
field, desc->number, desc->name);
|
||||
"Not support field %d for this soc\n", field);
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
c = rc->range;
|
||||
e = c + rc->nranges;
|
||||
end = rc->nranges - 1;
|
||||
|
||||
while (c < e) {
|
||||
if (desc->number >= c->s_pin && desc->number <= c->e_pin)
|
||||
while (start <= end) {
|
||||
check = (start + end) >> 1;
|
||||
if (desc->number >= rc->range[check].s_pin
|
||||
&& desc->number <= rc->range[check].e_pin) {
|
||||
found = true;
|
||||
break;
|
||||
c++;
|
||||
} else if (start == end)
|
||||
break;
|
||||
else if (desc->number < rc->range[check].s_pin)
|
||||
end = check - 1;
|
||||
else
|
||||
start = check + 1;
|
||||
}
|
||||
|
||||
if (c >= e) {
|
||||
if (!found) {
|
||||
dev_dbg(hw->dev, "Not support field %d for pin = %d (%s)\n",
|
||||
field, desc->number, desc->name);
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
c = rc->range + check;
|
||||
|
||||
if (c->i_base > hw->nbase - 1) {
|
||||
dev_err(hw->dev,
|
||||
"Invalid base for field %d for pin = %d (%s)\n",
|
||||
|
|
@ -182,6 +193,9 @@ int mtk_hw_set_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc,
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
if (value < 0 || value > pf.mask)
|
||||
return -EINVAL;
|
||||
|
||||
if (!pf.next)
|
||||
mtk_rmw(hw, pf.index, pf.offset, pf.mask << pf.bitpos,
|
||||
(value & pf.mask) << pf.bitpos);
|
||||
|
|
@ -506,6 +520,226 @@ int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Combo for the following pull register type:
|
||||
* 1. PU + PD
|
||||
* 2. PULLSEL + PULLEN
|
||||
* 3. PUPD + R0 + R1
|
||||
*/
|
||||
static int mtk_pinconf_bias_set_pu_pd(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 pullup, u32 arg)
|
||||
{
|
||||
int err, pu, pd;
|
||||
|
||||
if (arg == MTK_DISABLE) {
|
||||
pu = 0;
|
||||
pd = 0;
|
||||
} else if ((arg == MTK_ENABLE) && pullup) {
|
||||
pu = 1;
|
||||
pd = 0;
|
||||
} else if ((arg == MTK_ENABLE) && !pullup) {
|
||||
pu = 0;
|
||||
pd = 1;
|
||||
} else {
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PU, pu);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PD, pd);
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mtk_pinconf_bias_set_pullsel_pullen(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 pullup, u32 arg)
|
||||
{
|
||||
int err, enable;
|
||||
|
||||
if (arg == MTK_DISABLE)
|
||||
enable = 0;
|
||||
else if (arg == MTK_ENABLE)
|
||||
enable = 1;
|
||||
else {
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLEN, enable);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLSEL, pullup);
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mtk_pinconf_bias_set_pupd_r1_r0(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 pullup, u32 arg)
|
||||
{
|
||||
int err, r0, r1;
|
||||
|
||||
if ((arg == MTK_DISABLE) || (arg == MTK_PUPD_SET_R1R0_00)) {
|
||||
pullup = 0;
|
||||
r0 = 0;
|
||||
r1 = 0;
|
||||
} else if (arg == MTK_PUPD_SET_R1R0_01) {
|
||||
r0 = 1;
|
||||
r1 = 0;
|
||||
} else if (arg == MTK_PUPD_SET_R1R0_10) {
|
||||
r0 = 0;
|
||||
r1 = 1;
|
||||
} else if (arg == MTK_PUPD_SET_R1R0_11) {
|
||||
r0 = 1;
|
||||
r1 = 1;
|
||||
} else {
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* MTK HW PUPD bit: 1 for pull-down, 0 for pull-up */
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PUPD, !pullup);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_R0, r0);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_R1, r1);
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mtk_pinconf_bias_get_pu_pd(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 *pullup, u32 *enable)
|
||||
{
|
||||
int err, pu, pd;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PU, &pu);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
if (pu == 0 && pd == 0) {
|
||||
*pullup = 0;
|
||||
*enable = MTK_DISABLE;
|
||||
} else if (pu == 1 && pd == 0) {
|
||||
*pullup = 1;
|
||||
*enable = MTK_ENABLE;
|
||||
} else if (pu == 0 && pd == 1) {
|
||||
*pullup = 0;
|
||||
*enable = MTK_ENABLE;
|
||||
} else
|
||||
err = -EINVAL;
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mtk_pinconf_bias_get_pullsel_pullen(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 *pullup, u32 *enable)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLSEL, pullup);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLEN, enable);
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mtk_pinconf_bias_get_pupd_r1_r0(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 *pullup, u32 *enable)
|
||||
{
|
||||
int err, r0, r1;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PUPD, pullup);
|
||||
if (err)
|
||||
goto out;
|
||||
/* MTK HW PUPD bit: 1 for pull-down, 0 for pull-up */
|
||||
*pullup = !(*pullup);
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_R0, &r0);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_R1, &r1);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
if ((r1 == 0) && (r0 == 0))
|
||||
*enable = MTK_PUPD_SET_R1R0_00;
|
||||
else if ((r1 == 0) && (r0 == 1))
|
||||
*enable = MTK_PUPD_SET_R1R0_01;
|
||||
else if ((r1 == 1) && (r0 == 0))
|
||||
*enable = MTK_PUPD_SET_R1R0_10;
|
||||
else if ((r1 == 1) && (r0 == 1))
|
||||
*enable = MTK_PUPD_SET_R1R0_11;
|
||||
else
|
||||
err = -EINVAL;
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
int mtk_pinconf_bias_set_combo(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 pullup, u32 arg)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, arg);
|
||||
if (!err)
|
||||
goto out;
|
||||
|
||||
err = mtk_pinconf_bias_set_pullsel_pullen(hw, desc, pullup, arg);
|
||||
if (!err)
|
||||
goto out;
|
||||
|
||||
err = mtk_pinconf_bias_set_pupd_r1_r0(hw, desc, pullup, arg);
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 *pullup, u32 *enable)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = mtk_pinconf_bias_get_pu_pd(hw, desc, pullup, enable);
|
||||
if (!err)
|
||||
goto out;
|
||||
|
||||
err = mtk_pinconf_bias_get_pullsel_pullen(hw, desc, pullup, enable);
|
||||
if (!err)
|
||||
goto out;
|
||||
|
||||
err = mtk_pinconf_bias_get_pupd_r1_r0(hw, desc, pullup, enable);
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Revision 0 */
|
||||
int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, u32 arg)
|
||||
|
|
@ -597,6 +831,18 @@ int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int mtk_pinconf_drive_set_raw(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, u32 arg)
|
||||
{
|
||||
return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, arg);
|
||||
}
|
||||
|
||||
int mtk_pinconf_drive_get_raw(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, int *val)
|
||||
{
|
||||
return mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, val);
|
||||
}
|
||||
|
||||
int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, bool pullup,
|
||||
u32 arg)
|
||||
|
|
@ -630,7 +876,9 @@ int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
|
|||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
return -ENOTSUPP;
|
||||
err = mtk_pinconf_bias_set_rev1(hw, desc, pullup);
|
||||
if (err)
|
||||
err = mtk_pinconf_bias_set(hw, desc, pullup);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -216,6 +216,11 @@ struct mtk_pin_soc {
|
|||
int (*bias_get)(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, bool pullup, int *res);
|
||||
|
||||
int (*bias_set_combo)(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, u32 pullup, u32 arg);
|
||||
int (*bias_get_combo)(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, u32 *pullup, u32 *arg);
|
||||
|
||||
int (*drive_set)(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, u32 arg);
|
||||
int (*drive_get)(struct mtk_pinctrl *hw,
|
||||
|
|
@ -277,6 +282,12 @@ int mtk_pinconf_bias_set_rev1(struct mtk_pinctrl *hw,
|
|||
int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, bool pullup,
|
||||
int *res);
|
||||
int mtk_pinconf_bias_set_combo(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 pullup, u32 enable);
|
||||
int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 *pullup, u32 *enable);
|
||||
|
||||
int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, u32 arg);
|
||||
|
|
@ -288,6 +299,11 @@ int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
|
|||
int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, int *val);
|
||||
|
||||
int mtk_pinconf_drive_set_raw(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, u32 arg);
|
||||
int mtk_pinconf_drive_get_raw(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, int *val);
|
||||
|
||||
int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc, bool pullup,
|
||||
u32 arg);
|
||||
|
|
|
|||
|
|
@ -78,123 +78,101 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
|
|||
{
|
||||
struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev);
|
||||
u32 param = pinconf_to_config_param(*config);
|
||||
int val, val2, err, reg, ret = 1;
|
||||
int pullup, reg, err = -ENOTSUPP, ret = 1;
|
||||
const struct mtk_pin_desc *desc;
|
||||
|
||||
if (pin >= hw->soc->npins)
|
||||
return -EINVAL;
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_BIAS_DISABLE:
|
||||
if (hw->soc->bias_disable_get) {
|
||||
err = hw->soc->bias_disable_get(hw, desc, &ret);
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_PULL_UP:
|
||||
if (hw->soc->bias_get) {
|
||||
err = hw->soc->bias_get(hw, desc, 1, &ret);
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_PULL_DOWN:
|
||||
if (hw->soc->bias_get) {
|
||||
err = hw->soc->bias_get(hw, desc, 0, &ret);
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
return -ENOTSUPP;
|
||||
if (!hw->soc->bias_get_combo)
|
||||
break;
|
||||
err = hw->soc->bias_get_combo(hw, desc, &pullup, &ret);
|
||||
if (err)
|
||||
break;
|
||||
if (ret == MTK_PUPD_SET_R1R0_00)
|
||||
ret = MTK_DISABLE;
|
||||
if (param == PIN_CONFIG_BIAS_DISABLE) {
|
||||
if (ret != MTK_DISABLE)
|
||||
err = -EINVAL;
|
||||
} else if (param == PIN_CONFIG_BIAS_PULL_UP) {
|
||||
if (!pullup || ret == MTK_DISABLE)
|
||||
err = -EINVAL;
|
||||
} else if (param == PIN_CONFIG_BIAS_PULL_DOWN) {
|
||||
if (pullup || ret == MTK_DISABLE)
|
||||
err = -EINVAL;
|
||||
}
|
||||
break;
|
||||
case PIN_CONFIG_SLEW_RATE:
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_SR, &val);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (!val)
|
||||
return -EINVAL;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_SR, &ret);
|
||||
break;
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &val);
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_IES, &ret);
|
||||
if (!ret)
|
||||
err = -EINVAL;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &ret);
|
||||
if (err)
|
||||
return err;
|
||||
break;
|
||||
|
||||
/* HW takes input mode as zero; output mode as non-zero */
|
||||
if ((val && param == PIN_CONFIG_INPUT_ENABLE) ||
|
||||
(!val && param == PIN_CONFIG_OUTPUT_ENABLE))
|
||||
return -EINVAL;
|
||||
if (!ret) {
|
||||
err = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DO, &ret);
|
||||
break;
|
||||
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &val);
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &ret);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_SMT, &val2);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (val || !val2)
|
||||
return -EINVAL;
|
||||
break;
|
||||
/* return error when in output mode
|
||||
* because schmitt trigger only work in input mode
|
||||
*/
|
||||
if (ret) {
|
||||
err = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_SMT, &ret);
|
||||
if (!ret)
|
||||
err = -EINVAL;
|
||||
break;
|
||||
case PIN_CONFIG_DRIVE_STRENGTH:
|
||||
if (hw->soc->drive_get) {
|
||||
err = hw->soc->drive_get(hw, desc, &ret);
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
err = -ENOTSUPP;
|
||||
}
|
||||
if (!hw->soc->drive_get)
|
||||
break;
|
||||
err = hw->soc->drive_get(hw, desc, &ret);
|
||||
break;
|
||||
case MTK_PIN_CONFIG_TDSEL:
|
||||
case MTK_PIN_CONFIG_RDSEL:
|
||||
reg = (param == MTK_PIN_CONFIG_TDSEL) ?
|
||||
PINCTRL_PIN_REG_TDSEL : PINCTRL_PIN_REG_RDSEL;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, reg, &val);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
ret = val;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, reg, &ret);
|
||||
break;
|
||||
case MTK_PIN_CONFIG_PU_ADV:
|
||||
case MTK_PIN_CONFIG_PD_ADV:
|
||||
if (hw->soc->adv_pull_get) {
|
||||
bool pullup;
|
||||
|
||||
pullup = param == MTK_PIN_CONFIG_PU_ADV;
|
||||
err = hw->soc->adv_pull_get(hw, desc, pullup, &ret);
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
if (!hw->soc->adv_pull_get)
|
||||
break;
|
||||
pullup = param == MTK_PIN_CONFIG_PU_ADV;
|
||||
err = hw->soc->adv_pull_get(hw, desc, pullup, &ret);
|
||||
break;
|
||||
case MTK_PIN_CONFIG_DRV_ADV:
|
||||
if (hw->soc->adv_drive_get) {
|
||||
err = hw->soc->adv_drive_get(hw, desc, &ret);
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
if (!hw->soc->adv_drive_get)
|
||||
break;
|
||||
err = hw->soc->adv_drive_get(hw, desc, &ret);
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
*config = pinconf_to_config_packed(param, ret);
|
||||
if (!err)
|
||||
*config = pinconf_to_config_packed(param, ret);
|
||||
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
||||
|
|
@ -202,140 +180,84 @@ static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
{
|
||||
struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct mtk_pin_desc *desc;
|
||||
int err = 0;
|
||||
int err = -ENOTSUPP;
|
||||
u32 reg;
|
||||
|
||||
if (pin >= hw->soc->npins)
|
||||
return -EINVAL;
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
|
||||
|
||||
switch ((u32)param) {
|
||||
case PIN_CONFIG_BIAS_DISABLE:
|
||||
if (hw->soc->bias_disable_set) {
|
||||
err = hw->soc->bias_disable_set(hw, desc);
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
if (!hw->soc->bias_set_combo)
|
||||
break;
|
||||
err = hw->soc->bias_set_combo(hw, desc, 0, MTK_DISABLE);
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_PULL_UP:
|
||||
if (hw->soc->bias_set) {
|
||||
err = hw->soc->bias_set(hw, desc, 1);
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
if (!hw->soc->bias_set_combo)
|
||||
break;
|
||||
err = hw->soc->bias_set_combo(hw, desc, 1, arg);
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_PULL_DOWN:
|
||||
if (hw->soc->bias_set) {
|
||||
err = hw->soc->bias_set(hw, desc, 0);
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT,
|
||||
MTK_DISABLE);
|
||||
if (err)
|
||||
goto err;
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
|
||||
MTK_OUTPUT);
|
||||
if (err)
|
||||
goto err;
|
||||
if (!hw->soc->bias_set_combo)
|
||||
break;
|
||||
err = hw->soc->bias_set_combo(hw, desc, 0, arg);
|
||||
break;
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
if (hw->soc->ies_present) {
|
||||
mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_IES,
|
||||
MTK_ENABLE);
|
||||
}
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
|
||||
MTK_INPUT);
|
||||
if (err)
|
||||
goto err;
|
||||
/* regard all non-zero value as enable */
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_IES, !!arg);
|
||||
break;
|
||||
case PIN_CONFIG_SLEW_RATE:
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SR,
|
||||
arg);
|
||||
if (err)
|
||||
goto err;
|
||||
|
||||
/* regard all non-zero value as enable */
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SR, !!arg);
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
|
||||
MTK_OUTPUT);
|
||||
if (err)
|
||||
goto err;
|
||||
break;
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DO,
|
||||
arg);
|
||||
if (err)
|
||||
goto err;
|
||||
break;
|
||||
case PIN_CONFIG_INPUT_SCHMITT:
|
||||
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
|
||||
/* arg = 1: Input mode & SMT enable ;
|
||||
* arg = 0: Output mode & SMT disable
|
||||
*/
|
||||
arg = arg ? 2 : 1;
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
|
||||
arg & 1);
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR, !arg);
|
||||
if (err)
|
||||
goto err;
|
||||
break;
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT,
|
||||
!!(arg & 2));
|
||||
if (err)
|
||||
goto err;
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, !!arg);
|
||||
break;
|
||||
case PIN_CONFIG_DRIVE_STRENGTH:
|
||||
if (hw->soc->drive_set) {
|
||||
err = hw->soc->drive_set(hw, desc, arg);
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
if (!hw->soc->drive_set)
|
||||
break;
|
||||
err = hw->soc->drive_set(hw, desc, arg);
|
||||
break;
|
||||
case MTK_PIN_CONFIG_TDSEL:
|
||||
case MTK_PIN_CONFIG_RDSEL:
|
||||
reg = (param == MTK_PIN_CONFIG_TDSEL) ?
|
||||
PINCTRL_PIN_REG_TDSEL : PINCTRL_PIN_REG_RDSEL;
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, reg, arg);
|
||||
if (err)
|
||||
goto err;
|
||||
break;
|
||||
case MTK_PIN_CONFIG_PU_ADV:
|
||||
case MTK_PIN_CONFIG_PD_ADV:
|
||||
if (hw->soc->adv_pull_set) {
|
||||
bool pullup;
|
||||
|
||||
pullup = param == MTK_PIN_CONFIG_PU_ADV;
|
||||
err = hw->soc->adv_pull_set(hw, desc, pullup,
|
||||
arg);
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
if (!hw->soc->adv_pull_set)
|
||||
break;
|
||||
err = hw->soc->adv_pull_set(hw, desc,
|
||||
(param == MTK_PIN_CONFIG_PU_ADV),
|
||||
arg);
|
||||
break;
|
||||
case MTK_PIN_CONFIG_DRV_ADV:
|
||||
if (hw->soc->adv_drive_set) {
|
||||
err = hw->soc->adv_drive_set(hw, desc, arg);
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
if (!hw->soc->adv_drive_set)
|
||||
break;
|
||||
err = hw->soc->adv_drive_set(hw, desc, arg);
|
||||
break;
|
||||
default:
|
||||
err = -ENOTSUPP;
|
||||
}
|
||||
|
||||
err:
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -690,6 +612,9 @@ static int mtk_gpio_get_direction(struct gpio_chip *chip, unsigned int gpio)
|
|||
const struct mtk_pin_desc *desc;
|
||||
int value, err;
|
||||
|
||||
if (gpio >= hw->soc->npins)
|
||||
return -EINVAL;
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio];
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &value);
|
||||
|
|
@ -705,6 +630,9 @@ static int mtk_gpio_get(struct gpio_chip *chip, unsigned int gpio)
|
|||
const struct mtk_pin_desc *desc;
|
||||
int value, err;
|
||||
|
||||
if (gpio >= hw->soc->npins)
|
||||
return -EINVAL;
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio];
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DI, &value);
|
||||
|
|
@ -719,6 +647,9 @@ static void mtk_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
|
|||
struct mtk_pinctrl *hw = gpiochip_get_data(chip);
|
||||
const struct mtk_pin_desc *desc;
|
||||
|
||||
if (gpio >= hw->soc->npins)
|
||||
return;
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio];
|
||||
|
||||
mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DO, !!value);
|
||||
|
|
@ -726,12 +657,22 @@ static void mtk_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
|
|||
|
||||
static int mtk_gpio_direction_input(struct gpio_chip *chip, unsigned int gpio)
|
||||
{
|
||||
struct mtk_pinctrl *hw = gpiochip_get_data(chip);
|
||||
|
||||
if (gpio >= hw->soc->npins)
|
||||
return -EINVAL;
|
||||
|
||||
return pinctrl_gpio_direction_input(chip->base + gpio);
|
||||
}
|
||||
|
||||
static int mtk_gpio_direction_output(struct gpio_chip *chip, unsigned int gpio,
|
||||
int value)
|
||||
{
|
||||
struct mtk_pinctrl *hw = gpiochip_get_data(chip);
|
||||
|
||||
if (gpio >= hw->soc->npins)
|
||||
return -EINVAL;
|
||||
|
||||
mtk_gpio_set(chip, gpio, value);
|
||||
|
||||
return pinctrl_gpio_direction_output(chip->base + gpio);
|
||||
|
|
|
|||
|
|
@ -193,6 +193,7 @@ static const int rt9455_voreg_values[] = {
|
|||
4450000, 4450000, 4450000, 4450000, 4450000, 4450000, 4450000, 4450000
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_PHY)
|
||||
/*
|
||||
* When the charger is in boost mode, REG02[7:2] represent boost output
|
||||
* voltage.
|
||||
|
|
@ -208,6 +209,7 @@ static const int rt9455_boost_voltage_values[] = {
|
|||
5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000,
|
||||
5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000,
|
||||
};
|
||||
#endif
|
||||
|
||||
/* REG07[3:0] (VMREG) in uV */
|
||||
static const int rt9455_vmreg_values[] = {
|
||||
|
|
|
|||
|
|
@ -1730,19 +1730,24 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
|
|||
}
|
||||
}
|
||||
|
||||
if (err != -EEXIST)
|
||||
if (err != -EEXIST) {
|
||||
regulator->debugfs = debugfs_create_dir(supply_name, rdev->debugfs);
|
||||
if (IS_ERR(regulator->debugfs))
|
||||
rdev_dbg(rdev, "Failed to create debugfs directory\n");
|
||||
if (IS_ERR(regulator->debugfs)) {
|
||||
rdev_dbg(rdev, "Failed to create debugfs directory\n");
|
||||
regulator->debugfs = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
debugfs_create_u32("uA_load", 0444, regulator->debugfs,
|
||||
®ulator->uA_load);
|
||||
debugfs_create_u32("min_uV", 0444, regulator->debugfs,
|
||||
®ulator->voltage[PM_SUSPEND_ON].min_uV);
|
||||
debugfs_create_u32("max_uV", 0444, regulator->debugfs,
|
||||
®ulator->voltage[PM_SUSPEND_ON].max_uV);
|
||||
debugfs_create_file("constraint_flags", 0444, regulator->debugfs,
|
||||
regulator, &constraint_flags_fops);
|
||||
if (regulator->debugfs) {
|
||||
debugfs_create_u32("uA_load", 0444, regulator->debugfs,
|
||||
®ulator->uA_load);
|
||||
debugfs_create_u32("min_uV", 0444, regulator->debugfs,
|
||||
®ulator->voltage[PM_SUSPEND_ON].min_uV);
|
||||
debugfs_create_u32("max_uV", 0444, regulator->debugfs,
|
||||
®ulator->voltage[PM_SUSPEND_ON].max_uV);
|
||||
debugfs_create_file("constraint_flags", 0444, regulator->debugfs,
|
||||
regulator, &constraint_flags_fops);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check now if the regulator is an always on regulator - if
|
||||
|
|
|
|||
|
|
@ -834,7 +834,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
|
|||
|
||||
BNX2FC_TGT_DBG(tgt, "Freeing up session resources\n");
|
||||
|
||||
spin_lock_bh(&tgt->cq_lock);
|
||||
ctx_base_ptr = tgt->ctx_base;
|
||||
tgt->ctx_base = NULL;
|
||||
|
||||
|
|
@ -890,7 +889,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
|
|||
tgt->sq, tgt->sq_dma);
|
||||
tgt->sq = NULL;
|
||||
}
|
||||
spin_unlock_bh(&tgt->cq_lock);
|
||||
|
||||
if (ctx_base_ptr)
|
||||
iounmap(ctx_base_ptr);
|
||||
|
|
|
|||
|
|
@ -1039,7 +1039,6 @@ struct lpfc_hba {
|
|||
unsigned long bit_flags;
|
||||
#define FABRIC_COMANDS_BLOCKED 0
|
||||
atomic_t num_rsrc_err;
|
||||
atomic_t num_cmd_success;
|
||||
unsigned long last_rsrc_error_time;
|
||||
unsigned long last_ramp_down_time;
|
||||
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
|
||||
|
|
|
|||
|
|
@ -246,11 +246,10 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
|
|||
struct Scsi_Host *shost;
|
||||
struct scsi_device *sdev;
|
||||
unsigned long new_queue_depth;
|
||||
unsigned long num_rsrc_err, num_cmd_success;
|
||||
unsigned long num_rsrc_err;
|
||||
int i;
|
||||
|
||||
num_rsrc_err = atomic_read(&phba->num_rsrc_err);
|
||||
num_cmd_success = atomic_read(&phba->num_cmd_success);
|
||||
|
||||
/*
|
||||
* The error and success command counters are global per
|
||||
|
|
@ -265,20 +264,16 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
|
|||
for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
|
||||
shost = lpfc_shost_from_vport(vports[i]);
|
||||
shost_for_each_device(sdev, shost) {
|
||||
new_queue_depth =
|
||||
sdev->queue_depth * num_rsrc_err /
|
||||
(num_rsrc_err + num_cmd_success);
|
||||
if (!new_queue_depth)
|
||||
new_queue_depth = sdev->queue_depth - 1;
|
||||
if (num_rsrc_err >= sdev->queue_depth)
|
||||
new_queue_depth = 1;
|
||||
else
|
||||
new_queue_depth = sdev->queue_depth -
|
||||
new_queue_depth;
|
||||
num_rsrc_err;
|
||||
scsi_change_queue_depth(sdev, new_queue_depth);
|
||||
}
|
||||
}
|
||||
lpfc_destroy_vport_work_array(phba, vports);
|
||||
atomic_set(&phba->num_rsrc_err, 0);
|
||||
atomic_set(&phba->num_cmd_success, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -642,32 +642,21 @@ static int vmk80xx_find_usb_endpoints(struct comedi_device *dev)
|
|||
struct vmk80xx_private *devpriv = dev->private;
|
||||
struct usb_interface *intf = comedi_to_usb_interface(dev);
|
||||
struct usb_host_interface *iface_desc = intf->cur_altsetting;
|
||||
struct usb_endpoint_descriptor *ep_desc;
|
||||
int i;
|
||||
struct usb_endpoint_descriptor *ep_rx_desc, *ep_tx_desc;
|
||||
int ret;
|
||||
|
||||
if (iface_desc->desc.bNumEndpoints != 2)
|
||||
if (devpriv->model == VMK8061_MODEL)
|
||||
ret = usb_find_common_endpoints(iface_desc, &ep_rx_desc,
|
||||
&ep_tx_desc, NULL, NULL);
|
||||
else
|
||||
ret = usb_find_common_endpoints(iface_desc, NULL, NULL,
|
||||
&ep_rx_desc, &ep_tx_desc);
|
||||
|
||||
if (ret)
|
||||
return -ENODEV;
|
||||
|
||||
for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
|
||||
ep_desc = &iface_desc->endpoint[i].desc;
|
||||
|
||||
if (usb_endpoint_is_int_in(ep_desc) ||
|
||||
usb_endpoint_is_bulk_in(ep_desc)) {
|
||||
if (!devpriv->ep_rx)
|
||||
devpriv->ep_rx = ep_desc;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (usb_endpoint_is_int_out(ep_desc) ||
|
||||
usb_endpoint_is_bulk_out(ep_desc)) {
|
||||
if (!devpriv->ep_tx)
|
||||
devpriv->ep_tx = ep_desc;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!devpriv->ep_rx || !devpriv->ep_tx)
|
||||
return -ENODEV;
|
||||
devpriv->ep_rx = ep_rx_desc;
|
||||
devpriv->ep_tx = ep_tx_desc;
|
||||
|
||||
if (!usb_endpoint_maxp(devpriv->ep_rx) || !usb_endpoint_maxp(devpriv->ep_tx))
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -577,7 +577,7 @@ static u_long get_word(struct vc_data *vc)
|
|||
}
|
||||
attr_ch = get_char(vc, (u_short *)tmp_pos, &spk_attr);
|
||||
buf[cnt++] = attr_ch;
|
||||
while (tmpx < vc->vc_cols - 1) {
|
||||
while (tmpx < vc->vc_cols - 1 && cnt < sizeof(buf) - 1) {
|
||||
tmp_pos += 2;
|
||||
tmpx++;
|
||||
ch = get_char(vc, (u_short *)tmp_pos, &temp);
|
||||
|
|
|
|||
|
|
@ -3458,6 +3458,8 @@ static int __init target_core_init_configfs(void)
|
|||
{
|
||||
struct configfs_subsystem *subsys = &target_core_fabrics;
|
||||
struct t10_alua_lu_gp *lu_gp;
|
||||
struct cred *kern_cred;
|
||||
const struct cred *old_cred;
|
||||
int ret;
|
||||
|
||||
pr_debug("TARGET_CORE[0]: Loading Generic Kernel Storage"
|
||||
|
|
@ -3534,11 +3536,21 @@ static int __init target_core_init_configfs(void)
|
|||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
/* We use the kernel credentials to access the target directory */
|
||||
kern_cred = prepare_kernel_cred(&init_task);
|
||||
if (!kern_cred) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
old_cred = override_creds(kern_cred);
|
||||
target_init_dbroot();
|
||||
revert_creds(old_cred);
|
||||
put_cred(kern_cred);
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
target_xcopy_release_pt();
|
||||
configfs_unregister_subsystem(subsys);
|
||||
core_dev_release_virtual_lun0();
|
||||
rd_module_exit();
|
||||
|
|
|
|||
|
|
@ -1126,11 +1126,13 @@ static void mxs_auart_set_ldisc(struct uart_port *port,
|
|||
|
||||
static irqreturn_t mxs_auart_irq_handle(int irq, void *context)
|
||||
{
|
||||
u32 istat;
|
||||
u32 istat, stat;
|
||||
struct mxs_auart_port *s = context;
|
||||
u32 mctrl_temp = s->mctrl_prev;
|
||||
u32 stat = mxs_read(s, REG_STAT);
|
||||
|
||||
uart_port_lock(&s->port);
|
||||
|
||||
stat = mxs_read(s, REG_STAT);
|
||||
istat = mxs_read(s, REG_INTR);
|
||||
|
||||
/* ack irq */
|
||||
|
|
@ -1166,6 +1168,8 @@ static irqreturn_t mxs_auart_irq_handle(int irq, void *context)
|
|||
istat &= ~AUART_INTR_TXIS;
|
||||
}
|
||||
|
||||
uart_port_unlock(&s->port);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -220,7 +220,6 @@ static bool pmz_receive_chars(struct uart_pmac_port *uap)
|
|||
{
|
||||
struct tty_port *port;
|
||||
unsigned char ch, r1, drop, flag;
|
||||
int loops = 0;
|
||||
|
||||
/* Sanity check, make sure the old bug is no longer happening */
|
||||
if (uap->port.state == NULL) {
|
||||
|
|
@ -301,24 +300,11 @@ static bool pmz_receive_chars(struct uart_pmac_port *uap)
|
|||
if (r1 & Rx_OVR)
|
||||
tty_insert_flip_char(port, 0, TTY_OVERRUN);
|
||||
next_char:
|
||||
/* We can get stuck in an infinite loop getting char 0 when the
|
||||
* line is in a wrong HW state, we break that here.
|
||||
* When that happens, I disable the receive side of the driver.
|
||||
* Note that what I've been experiencing is a real irq loop where
|
||||
* I'm getting flooded regardless of the actual port speed.
|
||||
* Something strange is going on with the HW
|
||||
*/
|
||||
if ((++loops) > 1000)
|
||||
goto flood;
|
||||
ch = read_zsreg(uap, R0);
|
||||
if (!(ch & Rx_CH_AV))
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
flood:
|
||||
pmz_interrupt_control(uap, 0);
|
||||
pmz_error("pmz: rx irq flood !\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -471,7 +471,6 @@ out_free_mem:
|
|||
static int service_outstanding_interrupt(struct wdm_device *desc)
|
||||
{
|
||||
int rv = 0;
|
||||
int used;
|
||||
|
||||
/* submit read urb only if the device is waiting for it */
|
||||
if (!desc->resp_count || !--desc->resp_count)
|
||||
|
|
@ -486,10 +485,7 @@ static int service_outstanding_interrupt(struct wdm_device *desc)
|
|||
goto out;
|
||||
}
|
||||
|
||||
used = test_and_set_bit(WDM_RESPONDING, &desc->flags);
|
||||
if (used)
|
||||
goto out;
|
||||
|
||||
set_bit(WDM_RESPONDING, &desc->flags);
|
||||
spin_unlock_irq(&desc->iuspin);
|
||||
rv = usb_submit_urb(desc->response, GFP_KERNEL);
|
||||
spin_lock_irq(&desc->iuspin);
|
||||
|
|
|
|||
|
|
@ -295,8 +295,10 @@ static void usb_port_shutdown(struct device *dev)
|
|||
{
|
||||
struct usb_port *port_dev = to_usb_port(dev);
|
||||
|
||||
if (port_dev->child)
|
||||
if (port_dev->child) {
|
||||
usb_disable_usb2_hardware_lpm(port_dev->child);
|
||||
usb_unlocked_disable_lpm(port_dev->child);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops usb_port_pm_ops = {
|
||||
|
|
|
|||
|
|
@ -897,13 +897,15 @@ static int dwc2_cmpl_host_isoc_dma_desc(struct dwc2_hsotg *hsotg,
|
|||
struct dwc2_dma_desc *dma_desc;
|
||||
struct dwc2_hcd_iso_packet_desc *frame_desc;
|
||||
u16 frame_desc_idx;
|
||||
struct urb *usb_urb = qtd->urb->priv;
|
||||
struct urb *usb_urb;
|
||||
u16 remain = 0;
|
||||
int rc = 0;
|
||||
|
||||
if (!qtd->urb)
|
||||
return -EINVAL;
|
||||
|
||||
usb_urb = qtd->urb->priv;
|
||||
|
||||
dma_sync_single_for_cpu(hsotg->dev, qh->desc_list_dma + (idx *
|
||||
sizeof(struct dwc2_dma_desc)),
|
||||
sizeof(struct dwc2_dma_desc),
|
||||
|
|
|
|||
|
|
@ -1979,7 +1979,7 @@ unknown:
|
|||
buf[5] = 0x01;
|
||||
switch (ctrl->bRequestType & USB_RECIP_MASK) {
|
||||
case USB_RECIP_DEVICE:
|
||||
if (w_index != 0x4 || (w_value >> 8))
|
||||
if (w_index != 0x4 || (w_value & 0xff))
|
||||
break;
|
||||
buf[6] = w_index;
|
||||
/* Number of ext compat interfaces */
|
||||
|
|
@ -2001,9 +2001,9 @@ unknown:
|
|||
}
|
||||
break;
|
||||
case USB_RECIP_INTERFACE:
|
||||
if (w_index != 0x5 || (w_value >> 8))
|
||||
if (w_index != 0x5 || (w_value & 0xff))
|
||||
break;
|
||||
interface = w_value & 0xFF;
|
||||
interface = w_value >> 8;
|
||||
if (interface >= MAX_CONFIG_INTERFACES ||
|
||||
!os_desc_cfg->interface[interface])
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -3747,7 +3747,7 @@ static int ffs_func_setup(struct usb_function *f,
|
|||
__ffs_event_add(ffs, FUNCTIONFS_SETUP);
|
||||
spin_unlock_irqrestore(&ffs->ev.waitq.lock, flags);
|
||||
|
||||
return creq->wLength == 0 ? USB_GADGET_DELAYED_STATUS : 0;
|
||||
return ffs->ev.setup.wLength == 0 ? USB_GADGET_DELAYED_STATUS : 0;
|
||||
}
|
||||
|
||||
static bool ffs_func_req_match(struct usb_function *f,
|
||||
|
|
|
|||
|
|
@ -255,6 +255,10 @@ static void option_instat_callback(struct urb *urb);
|
|||
#define QUECTEL_PRODUCT_EM061K_LMS 0x0124
|
||||
#define QUECTEL_PRODUCT_EC25 0x0125
|
||||
#define QUECTEL_PRODUCT_EM060K_128 0x0128
|
||||
#define QUECTEL_PRODUCT_EM060K_129 0x0129
|
||||
#define QUECTEL_PRODUCT_EM060K_12a 0x012a
|
||||
#define QUECTEL_PRODUCT_EM060K_12b 0x012b
|
||||
#define QUECTEL_PRODUCT_EM060K_12c 0x012c
|
||||
#define QUECTEL_PRODUCT_EG91 0x0191
|
||||
#define QUECTEL_PRODUCT_EG95 0x0195
|
||||
#define QUECTEL_PRODUCT_BG96 0x0296
|
||||
|
|
@ -1218,6 +1222,18 @@ static const struct usb_device_id option_ids[] = {
|
|||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_128, 0xff, 0xff, 0x30) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_128, 0xff, 0x00, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_128, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_129, 0xff, 0xff, 0x30) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_129, 0xff, 0x00, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_129, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_12a, 0xff, 0xff, 0x30) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_12a, 0xff, 0x00, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_12a, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_12b, 0xff, 0xff, 0x30) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_12b, 0xff, 0x00, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_12b, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_12c, 0xff, 0xff, 0x30) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_12c, 0xff, 0x00, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K_12c, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0xff, 0x30) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0x00, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM061K_LCN, 0xff, 0xff, 0x40) },
|
||||
|
|
@ -1360,6 +1376,12 @@ static const struct usb_device_id option_ids[] = {
|
|||
.driver_info = NCTRL(2) | RSVD(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1083, 0xff), /* Telit FE990 (ECM) */
|
||||
.driver_info = NCTRL(0) | RSVD(1) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a0, 0xff), /* Telit FN20C04 (rmnet) */
|
||||
.driver_info = RSVD(0) | NCTRL(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a4, 0xff), /* Telit FN20C04 (rmnet) */
|
||||
.driver_info = RSVD(0) | NCTRL(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a9, 0xff), /* Telit FN20C04 (rmnet) */
|
||||
.driver_info = RSVD(0) | NCTRL(2) | RSVD(3) | RSVD(4) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
|
||||
.driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
|
||||
|
|
@ -2052,6 +2074,10 @@ static const struct usb_device_id option_ids[] = {
|
|||
.driver_info = RSVD(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, 0x9803, 0xff),
|
||||
.driver_info = RSVD(4) },
|
||||
{ USB_DEVICE(LONGCHEER_VENDOR_ID, 0x9b05), /* Longsung U8300 */
|
||||
.driver_info = RSVD(4) | RSVD(5) },
|
||||
{ USB_DEVICE(LONGCHEER_VENDOR_ID, 0x9b3c), /* Longsung U9300 */
|
||||
.driver_info = RSVD(0) | RSVD(4) },
|
||||
{ USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) },
|
||||
{ USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) },
|
||||
{ USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },
|
||||
|
|
@ -2272,15 +2298,29 @@ static const struct usb_device_id option_ids[] = {
|
|||
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0111, 0xff) }, /* Fibocom FM160 (MBIM mode) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0115, 0xff), /* Fibocom FM135 (laptop MBIM) */
|
||||
.driver_info = RSVD(5) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a2, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a3, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */
|
||||
.driver_info = RSVD(4) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0a04, 0xff) }, /* Fibocom FM650-CN (ECM mode) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0a05, 0xff) }, /* Fibocom FM650-CN (NCM mode) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0a06, 0xff) }, /* Fibocom FM650-CN (RNDIS mode) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0a07, 0xff) }, /* Fibocom FM650-CN (MBIM mode) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */
|
||||
{ USB_DEVICE(0x33f8, 0x0104), /* Rolling RW101-GL (laptop RMNET) */
|
||||
.driver_info = RSVD(4) | RSVD(5) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x01a2, 0xff) }, /* Rolling RW101-GL (laptop MBIM) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x01a3, 0xff) }, /* Rolling RW101-GL (laptop MBIM) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x01a4, 0xff), /* Rolling RW101-GL (laptop MBIM) */
|
||||
.driver_info = RSVD(4) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x0115, 0xff), /* Rolling RW135-GL (laptop MBIM) */
|
||||
.driver_info = RSVD(5) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(OPPO_VENDOR_ID, OPPO_PRODUCT_R11, 0xff, 0xff, 0x30) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x30) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x40) },
|
||||
|
|
|
|||
|
|
@ -2525,9 +2525,19 @@ bool vhost_vq_avail_empty(struct vhost_dev *dev, struct vhost_virtqueue *vq)
|
|||
r = vhost_get_avail_idx(vq, &avail_idx);
|
||||
if (unlikely(r))
|
||||
return false;
|
||||
vq->avail_idx = vhost16_to_cpu(vq, avail_idx);
|
||||
|
||||
return vq->avail_idx == vq->last_avail_idx;
|
||||
vq->avail_idx = vhost16_to_cpu(vq, avail_idx);
|
||||
if (vq->avail_idx != vq->last_avail_idx) {
|
||||
/* Since we have updated avail_idx, the following
|
||||
* call to vhost_get_vq_desc() will read available
|
||||
* ring entries. Make sure that read happens after
|
||||
* the avail_idx read.
|
||||
*/
|
||||
smp_rmb();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vhost_vq_avail_empty);
|
||||
|
||||
|
|
|
|||
|
|
@ -676,6 +676,7 @@ const struct file_operations v9fs_file_operations = {
|
|||
.lock = v9fs_file_lock,
|
||||
.mmap = generic_file_readonly_mmap,
|
||||
.fsync = v9fs_file_fsync,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
||||
const struct file_operations v9fs_file_operations_dotl = {
|
||||
|
|
@ -711,4 +712,5 @@ const struct file_operations v9fs_mmap_file_operations_dotl = {
|
|||
.flock = v9fs_file_flock_dotl,
|
||||
.mmap = v9fs_mmap_file_mmap,
|
||||
.fsync = v9fs_file_fsync_dotl,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ static int p9mode2perm(struct v9fs_session_info *v9ses,
|
|||
int res;
|
||||
int mode = stat->mode;
|
||||
|
||||
res = mode & S_IALLUGO;
|
||||
res = mode & 0777; /* S_IRWXUGO */
|
||||
if (v9fs_proto_dotu(v9ses)) {
|
||||
if ((mode & P9_DMSETUID) == P9_DMSETUID)
|
||||
res |= S_ISUID;
|
||||
|
|
@ -177,6 +177,9 @@ int v9fs_uflags2omode(int uflags, int extended)
|
|||
break;
|
||||
}
|
||||
|
||||
if (uflags & O_TRUNC)
|
||||
ret |= P9_OTRUNC;
|
||||
|
||||
if (extended) {
|
||||
if (uflags & O_EXCL)
|
||||
ret |= P9_OEXCL;
|
||||
|
|
|
|||
|
|
@ -335,6 +335,7 @@ static const struct super_operations v9fs_super_ops = {
|
|||
.alloc_inode = v9fs_alloc_inode,
|
||||
.free_inode = v9fs_free_inode,
|
||||
.statfs = simple_statfs,
|
||||
.drop_inode = v9fs_drop_inode,
|
||||
.evict_inode = v9fs_evict_inode,
|
||||
.show_options = v9fs_show_options,
|
||||
.umount_begin = v9fs_umount_begin,
|
||||
|
|
|
|||
|
|
@ -2291,20 +2291,14 @@ struct btrfs_data_container *init_data_container(u32 total_bytes)
|
|||
size_t alloc_bytes;
|
||||
|
||||
alloc_bytes = max_t(size_t, total_bytes, sizeof(*data));
|
||||
data = kvmalloc(alloc_bytes, GFP_KERNEL);
|
||||
data = kvzalloc(alloc_bytes, GFP_KERNEL);
|
||||
if (!data)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
if (total_bytes >= sizeof(*data)) {
|
||||
if (total_bytes >= sizeof(*data))
|
||||
data->bytes_left = total_bytes - sizeof(*data);
|
||||
data->bytes_missing = 0;
|
||||
} else {
|
||||
else
|
||||
data->bytes_missing = sizeof(*data) - total_bytes;
|
||||
data->bytes_left = 0;
|
||||
}
|
||||
|
||||
data->elem_cnt = 0;
|
||||
data->elem_missed = 0;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1137,6 +1137,9 @@ __btrfs_commit_inode_delayed_items(struct btrfs_trans_handle *trans,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = btrfs_record_root_in_trans(trans, node->root);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = btrfs_update_delayed_inode(trans, node->root, path, node);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2051,7 +2051,7 @@ void btrfs_clear_delalloc_extent(struct inode *vfs_inode,
|
|||
*/
|
||||
if (*bits & EXTENT_CLEAR_META_RESV &&
|
||||
root != fs_info->tree_root)
|
||||
btrfs_delalloc_release_metadata(inode, len, false);
|
||||
btrfs_delalloc_release_metadata(inode, len, true);
|
||||
|
||||
/* For sanity tests. */
|
||||
if (btrfs_is_testing(fs_info))
|
||||
|
|
|
|||
|
|
@ -4061,6 +4061,8 @@ void btrfs_qgroup_convert_reserved_meta(struct btrfs_root *root, int num_bytes)
|
|||
BTRFS_QGROUP_RSV_META_PREALLOC);
|
||||
trace_qgroup_meta_convert(root, num_bytes);
|
||||
qgroup_convert_meta(fs_info, root->root_key.objectid, num_bytes);
|
||||
if (!sb_rdonly(fs_info->sb))
|
||||
add_root_meta_rsv(root, num_bytes, BTRFS_QGROUP_RSV_META_PERTRANS);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1226,6 +1226,7 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans)
|
|||
radix_tree_tag_clear(&fs_info->fs_roots_radix,
|
||||
(unsigned long)root->root_key.objectid,
|
||||
BTRFS_ROOT_TRANS_TAG);
|
||||
btrfs_qgroup_free_meta_all_pertrans(root);
|
||||
spin_unlock(&fs_info->fs_roots_radix_lock);
|
||||
|
||||
btrfs_free_log(trans, root);
|
||||
|
|
@ -1250,7 +1251,6 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans)
|
|||
if (ret2)
|
||||
return ret2;
|
||||
spin_lock(&fs_info->fs_roots_radix_lock);
|
||||
btrfs_qgroup_free_meta_all_pertrans(root);
|
||||
}
|
||||
}
|
||||
spin_unlock(&fs_info->fs_roots_radix_lock);
|
||||
|
|
|
|||
|
|
@ -1760,7 +1760,8 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length)
|
|||
struct buffer_head *dibh, *bh;
|
||||
struct gfs2_holder rd_gh;
|
||||
unsigned int bsize_shift = sdp->sd_sb.sb_bsize_shift;
|
||||
u64 lblock = (offset + (1 << bsize_shift) - 1) >> bsize_shift;
|
||||
unsigned int bsize = 1 << bsize_shift;
|
||||
u64 lblock = (offset + bsize - 1) >> bsize_shift;
|
||||
__u16 start_list[GFS2_MAX_META_HEIGHT];
|
||||
__u16 __end_list[GFS2_MAX_META_HEIGHT], *end_list = NULL;
|
||||
unsigned int start_aligned, end_aligned;
|
||||
|
|
@ -1771,7 +1772,7 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length)
|
|||
u64 prev_bnr = 0;
|
||||
__be64 *start, *end;
|
||||
|
||||
if (offset >= maxsize) {
|
||||
if (offset + bsize - 1 >= maxsize) {
|
||||
/*
|
||||
* The starting point lies beyond the allocated meta-data;
|
||||
* there are no blocks do deallocate.
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ const struct rpc_program nfs_program = {
|
|||
.number = NFS_PROGRAM,
|
||||
.nrvers = ARRAY_SIZE(nfs_version),
|
||||
.version = nfs_version,
|
||||
.stats = &nfs_rpcstat,
|
||||
.pipe_dir_name = NFS_PIPE_DIRNAME,
|
||||
};
|
||||
|
||||
|
|
@ -492,6 +491,7 @@ int nfs_create_rpc_client(struct nfs_client *clp,
|
|||
const struct nfs_client_initdata *cl_init,
|
||||
rpc_authflavor_t flavor)
|
||||
{
|
||||
struct nfs_net *nn = net_generic(clp->cl_net, nfs_net_id);
|
||||
struct rpc_clnt *clnt = NULL;
|
||||
struct rpc_create_args args = {
|
||||
.net = clp->cl_net,
|
||||
|
|
@ -503,6 +503,7 @@ int nfs_create_rpc_client(struct nfs_client *clp,
|
|||
.servername = clp->cl_hostname,
|
||||
.nodename = cl_init->nodename,
|
||||
.program = &nfs_program,
|
||||
.stats = &nn->rpcstats,
|
||||
.version = clp->rpc_ops->version,
|
||||
.authflavor = flavor,
|
||||
.cred = cl_init->cred,
|
||||
|
|
@ -1077,6 +1078,8 @@ void nfs_clients_init(struct net *net)
|
|||
#endif
|
||||
spin_lock_init(&nn->nfs_client_lock);
|
||||
nn->boot_time = ktime_get_real();
|
||||
memset(&nn->rpcstats, 0, sizeof(nn->rpcstats));
|
||||
nn->rpcstats.program = &nfs_program;
|
||||
|
||||
nfs_netns_sysfs_setup(nn, net);
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue