ANDROID: Revert: Merge 5.4.60 into android11-5.4

Something is going flaky with the ABI checker, so back this merge out at
the moment so that we can fix things up first before merging this back
in.

Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I41ada004b1596b4961f95d9de48ca7b677d05226
This commit is contained in:
Greg Kroah-Hartman
2020-08-21 17:12:37 +02:00
parent 98f3e290c5
commit f553ed04bc
151 changed files with 626 additions and 1084 deletions

View File

@@ -21,7 +21,7 @@ controller state. The mux controller state is described in
Example: Example:
mux: mux-controller { mux: mux-controller {
compatible = "gpio-mux"; compatible = "mux-gpio";
#mux-control-cells = <0>; #mux-control-cells = <0>;
mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>, mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,

View File

@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
VERSION = 5 VERSION = 5
PATCHLEVEL = 4 PATCHLEVEL = 4
SUBLEVEL = 60 SUBLEVEL = 59
EXTRAVERSION = EXTRAVERSION =
NAME = Kleptomaniac Octopus NAME = Kleptomaniac Octopus

View File

@@ -19,12 +19,6 @@
model = "Globalscale Marvell ESPRESSOBin Board"; model = "Globalscale Marvell ESPRESSOBin Board";
compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710"; compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";
aliases {
ethernet0 = &eth0;
serial0 = &uart0;
serial1 = &uart1;
};
chosen { chosen {
stdout-path = "serial0:115200n8"; stdout-path = "serial0:115200n8";
}; };

View File

@@ -155,7 +155,7 @@ armv8pmu_events_sysfs_show(struct device *dev,
pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr); pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr);
return sprintf(page, "event=0x%04llx\n", pmu_attr->id); return sprintf(page, "event=0x%03llx\n", pmu_attr->id);
} }
#define ARMV8_EVENT_ATTR(name, config) \ #define ARMV8_EVENT_ATTR(name, config) \
@@ -303,13 +303,10 @@ armv8pmu_event_attr_is_visible(struct kobject *kobj,
test_bit(pmu_attr->id, cpu_pmu->pmceid_bitmap)) test_bit(pmu_attr->id, cpu_pmu->pmceid_bitmap))
return attr->mode; return attr->mode;
if (pmu_attr->id >= ARMV8_PMUV3_EXT_COMMON_EVENT_BASE) { pmu_attr->id -= ARMV8_PMUV3_EXT_COMMON_EVENT_BASE;
u64 id = pmu_attr->id - ARMV8_PMUV3_EXT_COMMON_EVENT_BASE; if (pmu_attr->id < ARMV8_PMUV3_MAX_COMMON_EVENTS &&
test_bit(pmu_attr->id, cpu_pmu->pmceid_ext_bitmap))
if (id < ARMV8_PMUV3_MAX_COMMON_EVENTS &&
test_bit(id, cpu_pmu->pmceid_ext_bitmap))
return attr->mode; return attr->mode;
}
return 0; return 0;
} }

View File

@@ -69,7 +69,7 @@
"Speaker", "OUTL", "Speaker", "OUTL",
"Speaker", "OUTR", "Speaker", "OUTR",
"INL", "LOUT", "INL", "LOUT",
"INR", "ROUT"; "INL", "ROUT";
simple-audio-card,aux-devs = <&amp>; simple-audio-card,aux-devs = <&amp>;

View File

@@ -20,7 +20,7 @@ static int __init topology_init(void)
for_each_present_cpu(i) { for_each_present_cpu(i) {
struct cpu *c = &per_cpu(cpu_devices, i); struct cpu *c = &per_cpu(cpu_devices, i);
c->hotpluggable = !!i; c->hotpluggable = 1;
ret = register_cpu(c, i); ret = register_cpu(c, i);
if (ret) if (ret)
printk(KERN_WARNING "topology_init: register_cpu %d " printk(KERN_WARNING "topology_init: register_cpu %d "

View File

@@ -13,7 +13,6 @@
#include <linux/export.h> #include <linux/export.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/sched/debug.h> #include <linux/sched/debug.h>
#include <linux/sched/task_stack.h>
#include <linux/stacktrace.h> #include <linux/stacktrace.h>
#include <asm/processor.h> #include <asm/processor.h>
@@ -69,25 +68,12 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
{ {
unsigned long *sp = NULL; unsigned long *sp = NULL;
if (!try_get_task_stack(tsk))
return;
if (tsk == current) if (tsk == current)
sp = (unsigned long *) &sp; sp = (unsigned long *) &sp;
else { else
unsigned long ksp; sp = (unsigned long *) KSTK_ESP(tsk);
/* Locate stack from kernel context */
ksp = task_thread_info(tsk)->ksp;
ksp += STACK_FRAME_OVERHEAD; /* redzone */
ksp += sizeof(struct pt_regs);
sp = (unsigned long *) ksp;
}
unwind_stack(trace, sp, save_stack_address_nosched); unwind_stack(trace, sp, save_stack_address_nosched);
put_task_stack(tsk);
} }
EXPORT_SYMBOL_GPL(save_stack_trace_tsk); EXPORT_SYMBOL_GPL(save_stack_trace_tsk);

View File

@@ -10,6 +10,8 @@
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#include <asm/paca.h>
#define __my_cpu_offset local_paca->data_offset #define __my_cpu_offset local_paca->data_offset
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
@@ -17,6 +19,4 @@
#include <asm-generic/percpu.h> #include <asm-generic/percpu.h>
#include <asm/paca.h>
#endif /* _ASM_POWERPC_PERCPU_H_ */ #endif /* _ASM_POWERPC_PERCPU_H_ */

View File

@@ -241,9 +241,6 @@ static bool bad_kernel_fault(struct pt_regs *regs, unsigned long error_code,
return false; return false;
} }
// This comes from 64-bit struct rt_sigframe + __SIGNAL_FRAMESIZE
#define SIGFRAME_MAX_SIZE (4096 + 128)
static bool bad_stack_expansion(struct pt_regs *regs, unsigned long address, static bool bad_stack_expansion(struct pt_regs *regs, unsigned long address,
struct vm_area_struct *vma, unsigned int flags, struct vm_area_struct *vma, unsigned int flags,
bool *must_retry) bool *must_retry)
@@ -251,7 +248,7 @@ static bool bad_stack_expansion(struct pt_regs *regs, unsigned long address,
/* /*
* N.B. The POWER/Open ABI allows programs to access up to * N.B. The POWER/Open ABI allows programs to access up to
* 288 bytes below the stack pointer. * 288 bytes below the stack pointer.
* The kernel signal delivery code writes a bit over 4KB * The kernel signal delivery code writes up to about 1.5kB
* below the stack pointer (r1) before decrementing it. * below the stack pointer (r1) before decrementing it.
* The exec code can write slightly over 640kB to the stack * The exec code can write slightly over 640kB to the stack
* before setting the user r1. Thus we allow the stack to * before setting the user r1. Thus we allow the stack to
@@ -276,7 +273,7 @@ static bool bad_stack_expansion(struct pt_regs *regs, unsigned long address,
* between the last mapped region and the stack will * between the last mapped region and the stack will
* expand the stack rather than segfaulting. * expand the stack rather than segfaulting.
*/ */
if (address + SIGFRAME_MAX_SIZE >= uregs->gpr[1]) if (address + 2048 >= uregs->gpr[1])
return false; return false;
if ((flags & FAULT_FLAG_WRITE) && (flags & FAULT_FLAG_USER) && if ((flags & FAULT_FLAG_WRITE) && (flags & FAULT_FLAG_USER) &&

View File

@@ -259,7 +259,7 @@ static int pseries_find(unsigned long ea, int psize, bool primary, u64 *v, u64 *
for (i = 0; i < HPTES_PER_GROUP; i += 4, hpte_group += 4) { for (i = 0; i < HPTES_PER_GROUP; i += 4, hpte_group += 4) {
lpar_rc = plpar_pte_read_4(0, hpte_group, (void *)ptes); lpar_rc = plpar_pte_read_4(0, hpte_group, (void *)ptes);
if (lpar_rc) if (lpar_rc != H_SUCCESS)
continue; continue;
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
if (HPTE_V_COMPARE(ptes[j].v, want_v) && if (HPTE_V_COMPARE(ptes[j].v, want_v) &&

View File

@@ -27,7 +27,7 @@ static bool rtas_hp_event;
unsigned long pseries_memory_block_size(void) unsigned long pseries_memory_block_size(void)
{ {
struct device_node *np; struct device_node *np;
u64 memblock_size = MIN_MEMORY_BLOCK_SIZE; unsigned int memblock_size = MIN_MEMORY_BLOCK_SIZE;
struct resource r; struct resource r;
np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");

View File

@@ -82,9 +82,6 @@ device_initcall(landisk_devices_setup);
static void __init landisk_setup(char **cmdline_p) static void __init landisk_setup(char **cmdline_p)
{ {
/* I/O port identity mapping */
__set_io_port_base(0);
/* LED ON */ /* LED ON */
__raw_writeb(__raw_readb(PA_LED) | 0x03, PA_LED); __raw_writeb(__raw_readb(PA_LED) | 0x03, PA_LED);

View File

@@ -642,7 +642,7 @@ static const struct attribute_group *rapl_attr_update[] = {
&rapl_events_pkg_group, &rapl_events_pkg_group,
&rapl_events_ram_group, &rapl_events_ram_group,
&rapl_events_gpu_group, &rapl_events_gpu_group,
&rapl_events_psys_group, &rapl_events_gpu_group,
NULL, NULL,
}; };

View File

@@ -554,10 +554,6 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq,
irqd->chip_data = apicd; irqd->chip_data = apicd;
irqd->hwirq = virq + i; irqd->hwirq = virq + i;
irqd_set_single_target(irqd); irqd_set_single_target(irqd);
/* Don't invoke affinity setter on deactivated interrupts */
irqd_set_affinity_on_activate(irqd);
/* /*
* Legacy vectors are already assigned when the IOAPIC * Legacy vectors are already assigned when the IOAPIC
* takes them over. They stay on the same vector. This is * takes them over. They stay on the same vector. This is

View File

@@ -133,15 +133,10 @@ static const struct freq_desc freq_desc_ann = {
.mask = 0x0f, .mask = 0x0f,
}; };
/* /* 24 MHz crystal? : 24 * 13 / 4 = 78 MHz */
* 24 MHz crystal? : 24 * 13 / 4 = 78 MHz
* Frequency step for Lightning Mountain SoC is fixed to 78 MHz,
* so all the frequency entries are 78000.
*/
static const struct freq_desc freq_desc_lgm = { static const struct freq_desc freq_desc_lgm = {
.use_msr_plat = true, .use_msr_plat = true,
.freqs = { 78000, 78000, 78000, 78000, 78000, 78000, 78000, 78000, .freqs = { 78000, 78000, 78000, 78000, 78000, 78000, 78000, 78000 },
78000, 78000, 78000, 78000, 78000, 78000, 78000, 78000 },
.mask = 0x0f, .mask = 0x0f,
}; };

View File

@@ -55,10 +55,6 @@ struct thread_info {
mm_segment_t addr_limit; /* thread address space */ mm_segment_t addr_limit; /* thread address space */
unsigned long cpenable; unsigned long cpenable;
#if XCHAL_HAVE_EXCLUSIVE
/* result of the most recent exclusive store */
unsigned long atomctl8;
#endif
/* Allocate storage for extra user states and coprocessor states. */ /* Allocate storage for extra user states and coprocessor states. */
#if XTENSA_HAVE_COPROCESSORS #if XTENSA_HAVE_COPROCESSORS

View File

@@ -93,9 +93,6 @@ int main(void)
DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra)); DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra));
DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp)); DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp));
DEFINE(THREAD_CPENABLE, offsetof (struct thread_info, cpenable)); DEFINE(THREAD_CPENABLE, offsetof (struct thread_info, cpenable));
#if XCHAL_HAVE_EXCLUSIVE
DEFINE(THREAD_ATOMCTL8, offsetof (struct thread_info, atomctl8));
#endif
#if XTENSA_HAVE_COPROCESSORS #if XTENSA_HAVE_COPROCESSORS
DEFINE(THREAD_XTREGS_CP0, offsetof(struct thread_info, xtregs_cp.cp0)); DEFINE(THREAD_XTREGS_CP0, offsetof(struct thread_info, xtregs_cp.cp0));
DEFINE(THREAD_XTREGS_CP1, offsetof(struct thread_info, xtregs_cp.cp1)); DEFINE(THREAD_XTREGS_CP1, offsetof(struct thread_info, xtregs_cp.cp1));

View File

@@ -374,11 +374,6 @@ common_exception:
s32i a2, a1, PT_LCOUNT s32i a2, a1, PT_LCOUNT
#endif #endif
#if XCHAL_HAVE_EXCLUSIVE
/* Clear exclusive access monitor set by interrupted code */
clrex
#endif
/* It is now save to restore the EXC_TABLE_FIXUP variable. */ /* It is now save to restore the EXC_TABLE_FIXUP variable. */
rsr a2, exccause rsr a2, exccause
@@ -2029,12 +2024,6 @@ ENTRY(_switch_to)
s32i a3, a4, THREAD_CPENABLE s32i a3, a4, THREAD_CPENABLE
#endif #endif
#if XCHAL_HAVE_EXCLUSIVE
l32i a3, a5, THREAD_ATOMCTL8
getex a3
s32i a3, a4, THREAD_ATOMCTL8
#endif
/* Flush register file. */ /* Flush register file. */
spill_registers_kernel spill_registers_kernel

View File

@@ -401,7 +401,7 @@ static struct pmu xtensa_pmu = {
.read = xtensa_pmu_read, .read = xtensa_pmu_read,
}; };
static int xtensa_pmu_setup(unsigned int cpu) static int xtensa_pmu_setup(int cpu)
{ {
unsigned i; unsigned i;

View File

@@ -635,7 +635,6 @@ void af_alg_pull_tsgl(struct sock *sk, size_t used, struct scatterlist *dst,
if (!ctx->used) if (!ctx->used)
ctx->merge = 0; ctx->merge = 0;
ctx->init = ctx->more;
} }
EXPORT_SYMBOL_GPL(af_alg_pull_tsgl); EXPORT_SYMBOL_GPL(af_alg_pull_tsgl);
@@ -735,10 +734,9 @@ EXPORT_SYMBOL_GPL(af_alg_wmem_wakeup);
* *
* @sk socket of connection to user space * @sk socket of connection to user space
* @flags If MSG_DONTWAIT is set, then only report if function would sleep * @flags If MSG_DONTWAIT is set, then only report if function would sleep
* @min Set to minimum request size if partial requests are allowed.
* @return 0 when writable memory is available, < 0 upon error * @return 0 when writable memory is available, < 0 upon error
*/ */
int af_alg_wait_for_data(struct sock *sk, unsigned flags, unsigned min) int af_alg_wait_for_data(struct sock *sk, unsigned flags)
{ {
DEFINE_WAIT_FUNC(wait, woken_wake_function); DEFINE_WAIT_FUNC(wait, woken_wake_function);
struct alg_sock *ask = alg_sk(sk); struct alg_sock *ask = alg_sk(sk);
@@ -756,9 +754,7 @@ int af_alg_wait_for_data(struct sock *sk, unsigned flags, unsigned min)
if (signal_pending(current)) if (signal_pending(current))
break; break;
timeout = MAX_SCHEDULE_TIMEOUT; timeout = MAX_SCHEDULE_TIMEOUT;
if (sk_wait_event(sk, &timeout, if (sk_wait_event(sk, &timeout, (ctx->used || !ctx->more),
ctx->init && (!ctx->more ||
(min && ctx->used >= min)),
&wait)) { &wait)) {
err = 0; err = 0;
break; break;
@@ -847,11 +843,10 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
} }
lock_sock(sk); lock_sock(sk);
if (ctx->init && (init || !ctx->more)) { if (!ctx->more && ctx->used) {
err = -EINVAL; err = -EINVAL;
goto unlock; goto unlock;
} }
ctx->init = true;
if (init) { if (init) {
ctx->enc = enc; ctx->enc = enc;

View File

@@ -106,8 +106,8 @@ static int _aead_recvmsg(struct socket *sock, struct msghdr *msg,
size_t usedpages = 0; /* [in] RX bufs to be used from user */ size_t usedpages = 0; /* [in] RX bufs to be used from user */
size_t processed = 0; /* [in] TX bufs to be consumed */ size_t processed = 0; /* [in] TX bufs to be consumed */
if (!ctx->init || ctx->more) { if (!ctx->used) {
err = af_alg_wait_for_data(sk, flags, 0); err = af_alg_wait_for_data(sk, flags);
if (err) if (err)
return err; return err;
} }
@@ -558,6 +558,12 @@ static int aead_accept_parent_nokey(void *private, struct sock *sk)
INIT_LIST_HEAD(&ctx->tsgl_list); INIT_LIST_HEAD(&ctx->tsgl_list);
ctx->len = len; ctx->len = len;
ctx->used = 0;
atomic_set(&ctx->rcvused, 0);
ctx->more = 0;
ctx->merge = 0;
ctx->enc = 0;
ctx->aead_assoclen = 0;
crypto_init_wait(&ctx->wait); crypto_init_wait(&ctx->wait);
ask->private = ctx; ask->private = ctx;

View File

@@ -61,8 +61,8 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg,
int err = 0; int err = 0;
size_t len = 0; size_t len = 0;
if (!ctx->init || (ctx->more && ctx->used < bs)) { if (!ctx->used) {
err = af_alg_wait_for_data(sk, flags, bs); err = af_alg_wait_for_data(sk, flags);
if (err) if (err)
return err; return err;
} }
@@ -333,7 +333,6 @@ static int skcipher_accept_parent_nokey(void *private, struct sock *sk)
ctx = sock_kmalloc(sk, len, GFP_KERNEL); ctx = sock_kmalloc(sk, len, GFP_KERNEL);
if (!ctx) if (!ctx)
return -ENOMEM; return -ENOMEM;
memset(ctx, 0, len);
ctx->iv = sock_kmalloc(sk, crypto_skcipher_ivsize(tfm), ctx->iv = sock_kmalloc(sk, crypto_skcipher_ivsize(tfm),
GFP_KERNEL); GFP_KERNEL);
@@ -341,10 +340,16 @@ static int skcipher_accept_parent_nokey(void *private, struct sock *sk)
sock_kfree_s(sk, ctx, len); sock_kfree_s(sk, ctx, len);
return -ENOMEM; return -ENOMEM;
} }
memset(ctx->iv, 0, crypto_skcipher_ivsize(tfm)); memset(ctx->iv, 0, crypto_skcipher_ivsize(tfm));
INIT_LIST_HEAD(&ctx->tsgl_list); INIT_LIST_HEAD(&ctx->tsgl_list);
ctx->len = len; ctx->len = len;
ctx->used = 0;
atomic_set(&ctx->rcvused, 0);
ctx->more = 0;
ctx->merge = 0;
ctx->enc = 0;
crypto_init_wait(&ctx->wait); crypto_init_wait(&ctx->wait);
ask->private = ctx; ask->private = ctx;

View File

@@ -893,9 +893,7 @@ static int __device_attach(struct device *dev, bool allow_async)
int ret = 0; int ret = 0;
device_lock(dev); device_lock(dev);
if (dev->p->dead) { if (dev->driver) {
goto out_unlock;
} else if (dev->driver) {
if (device_is_bound(dev)) { if (device_is_bound(dev)) {
ret = 1; ret = 1;
goto out_unlock; goto out_unlock;

View File

@@ -183,7 +183,7 @@ static OWL_GATE(timer_clk, "timer_clk", "hosc", CMU_DEVCLKEN1, 27, 0, 0);
static OWL_GATE(hdmi_clk, "hdmi_clk", "hosc", CMU_DEVCLKEN1, 3, 0, 0); static OWL_GATE(hdmi_clk, "hdmi_clk", "hosc", CMU_DEVCLKEN1, 3, 0, 0);
/* divider clocks */ /* divider clocks */
static OWL_DIVIDER(h_clk, "h_clk", "ahbprediv_clk", CMU_BUSCLK1, 12, 2, NULL, 0, 0); static OWL_DIVIDER(h_clk, "h_clk", "ahbprevdiv_clk", CMU_BUSCLK1, 12, 2, NULL, 0, 0);
static OWL_DIVIDER(rmii_ref_clk, "rmii_ref_clk", "ethernet_pll_clk", CMU_ETHERNETPLL, 1, 1, rmii_ref_div_table, 0, 0); static OWL_DIVIDER(rmii_ref_clk, "rmii_ref_clk", "ethernet_pll_clk", CMU_ETHERNETPLL, 1, 1, rmii_ref_div_table, 0, 0);
/* factor clocks */ /* factor clocks */

View File

@@ -314,7 +314,6 @@ struct bcm2835_cprman {
struct device *dev; struct device *dev;
void __iomem *regs; void __iomem *regs;
spinlock_t regs_lock; /* spinlock for all clocks */ spinlock_t regs_lock; /* spinlock for all clocks */
unsigned int soc;
/* /*
* Real names of cprman clock parents looked up through * Real names of cprman clock parents looked up through
@@ -526,20 +525,6 @@ static int bcm2835_pll_is_on(struct clk_hw *hw)
A2W_PLL_CTRL_PRST_DISABLE; A2W_PLL_CTRL_PRST_DISABLE;
} }
static u32 bcm2835_pll_get_prediv_mask(struct bcm2835_cprman *cprman,
const struct bcm2835_pll_data *data)
{
/*
* On BCM2711 there isn't a pre-divisor available in the PLL feedback
* loop. Bits 13:14 of ANA1 (PLLA,PLLB,PLLC,PLLD) have been re-purposed
* for to for VCO RANGE bits.
*/
if (cprman->soc & SOC_BCM2711)
return 0;
return data->ana->fb_prediv_mask;
}
static void bcm2835_pll_choose_ndiv_and_fdiv(unsigned long rate, static void bcm2835_pll_choose_ndiv_and_fdiv(unsigned long rate,
unsigned long parent_rate, unsigned long parent_rate,
u32 *ndiv, u32 *fdiv) u32 *ndiv, u32 *fdiv)
@@ -597,7 +582,7 @@ static unsigned long bcm2835_pll_get_rate(struct clk_hw *hw,
ndiv = (a2wctrl & A2W_PLL_CTRL_NDIV_MASK) >> A2W_PLL_CTRL_NDIV_SHIFT; ndiv = (a2wctrl & A2W_PLL_CTRL_NDIV_MASK) >> A2W_PLL_CTRL_NDIV_SHIFT;
pdiv = (a2wctrl & A2W_PLL_CTRL_PDIV_MASK) >> A2W_PLL_CTRL_PDIV_SHIFT; pdiv = (a2wctrl & A2W_PLL_CTRL_PDIV_MASK) >> A2W_PLL_CTRL_PDIV_SHIFT;
using_prediv = cprman_read(cprman, data->ana_reg_base + 4) & using_prediv = cprman_read(cprman, data->ana_reg_base + 4) &
bcm2835_pll_get_prediv_mask(cprman, data); data->ana->fb_prediv_mask;
if (using_prediv) { if (using_prediv) {
ndiv *= 2; ndiv *= 2;
@@ -680,7 +665,6 @@ static int bcm2835_pll_set_rate(struct clk_hw *hw,
struct bcm2835_pll *pll = container_of(hw, struct bcm2835_pll, hw); struct bcm2835_pll *pll = container_of(hw, struct bcm2835_pll, hw);
struct bcm2835_cprman *cprman = pll->cprman; struct bcm2835_cprman *cprman = pll->cprman;
const struct bcm2835_pll_data *data = pll->data; const struct bcm2835_pll_data *data = pll->data;
u32 prediv_mask = bcm2835_pll_get_prediv_mask(cprman, data);
bool was_using_prediv, use_fb_prediv, do_ana_setup_first; bool was_using_prediv, use_fb_prediv, do_ana_setup_first;
u32 ndiv, fdiv, a2w_ctl; u32 ndiv, fdiv, a2w_ctl;
u32 ana[4]; u32 ana[4];
@@ -698,7 +682,7 @@ static int bcm2835_pll_set_rate(struct clk_hw *hw,
for (i = 3; i >= 0; i--) for (i = 3; i >= 0; i--)
ana[i] = cprman_read(cprman, data->ana_reg_base + i * 4); ana[i] = cprman_read(cprman, data->ana_reg_base + i * 4);
was_using_prediv = ana[1] & prediv_mask; was_using_prediv = ana[1] & data->ana->fb_prediv_mask;
ana[0] &= ~data->ana->mask0; ana[0] &= ~data->ana->mask0;
ana[0] |= data->ana->set0; ana[0] |= data->ana->set0;
@@ -708,10 +692,10 @@ static int bcm2835_pll_set_rate(struct clk_hw *hw,
ana[3] |= data->ana->set3; ana[3] |= data->ana->set3;
if (was_using_prediv && !use_fb_prediv) { if (was_using_prediv && !use_fb_prediv) {
ana[1] &= ~prediv_mask; ana[1] &= ~data->ana->fb_prediv_mask;
do_ana_setup_first = true; do_ana_setup_first = true;
} else if (!was_using_prediv && use_fb_prediv) { } else if (!was_using_prediv && use_fb_prediv) {
ana[1] |= prediv_mask; ana[1] |= data->ana->fb_prediv_mask;
do_ana_setup_first = false; do_ana_setup_first = false;
} else { } else {
do_ana_setup_first = true; do_ana_setup_first = true;
@@ -2250,7 +2234,6 @@ static int bcm2835_clk_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, cprman); platform_set_drvdata(pdev, cprman);
cprman->onecell.num = asize; cprman->onecell.num = asize;
cprman->soc = pdata->soc;
hws = cprman->onecell.hws; hws = cprman->onecell.hws;
for (i = 0; i < asize; i++) { for (i = 0; i < asize; i++) {

View File

@@ -55,6 +55,7 @@
#define PLL_STATUS(p) ((p)->offset + (p)->regs[PLL_OFF_STATUS]) #define PLL_STATUS(p) ((p)->offset + (p)->regs[PLL_OFF_STATUS])
#define PLL_OPMODE(p) ((p)->offset + (p)->regs[PLL_OFF_OPMODE]) #define PLL_OPMODE(p) ((p)->offset + (p)->regs[PLL_OFF_OPMODE])
#define PLL_FRAC(p) ((p)->offset + (p)->regs[PLL_OFF_FRAC]) #define PLL_FRAC(p) ((p)->offset + (p)->regs[PLL_OFF_FRAC])
#define PLL_CAL_VAL(p) ((p)->offset + (p)->regs[PLL_OFF_CAL_VAL])
const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = { const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = {
[CLK_ALPHA_PLL_TYPE_DEFAULT] = { [CLK_ALPHA_PLL_TYPE_DEFAULT] = {
@@ -113,6 +114,7 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = {
[PLL_OFF_STATUS] = 0x30, [PLL_OFF_STATUS] = 0x30,
[PLL_OFF_OPMODE] = 0x38, [PLL_OFF_OPMODE] = 0x38,
[PLL_OFF_ALPHA_VAL] = 0x40, [PLL_OFF_ALPHA_VAL] = 0x40,
[PLL_OFF_CAL_VAL] = 0x44,
}, },
}; };
EXPORT_SYMBOL_GPL(clk_alpha_pll_regs); EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);

View File

@@ -1715,9 +1715,6 @@ static struct clk_branch gcc_mss_cfg_ahb_clk = {
static struct clk_branch gcc_mss_mnoc_bimc_axi_clk = { static struct clk_branch gcc_mss_mnoc_bimc_axi_clk = {
.halt_reg = 0x8a004, .halt_reg = 0x8a004,
.halt_check = BRANCH_HALT,
.hwcg_reg = 0x8a004,
.hwcg_bit = 1,
.clkr = { .clkr = {
.enable_reg = 0x8a004, .enable_reg = 0x8a004,
.enable_mask = BIT(0), .enable_mask = BIT(0),

View File

@@ -1616,7 +1616,6 @@ static struct clk_branch gcc_gpu_cfg_ahb_clk = {
}; };
static struct clk_branch gcc_gpu_gpll0_clk_src = { static struct clk_branch gcc_gpu_gpll0_clk_src = {
.halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52004, .enable_reg = 0x52004,
.enable_mask = BIT(15), .enable_mask = BIT(15),
@@ -1632,14 +1631,13 @@ static struct clk_branch gcc_gpu_gpll0_clk_src = {
}; };
static struct clk_branch gcc_gpu_gpll0_div_clk_src = { static struct clk_branch gcc_gpu_gpll0_div_clk_src = {
.halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52004, .enable_reg = 0x52004,
.enable_mask = BIT(16), .enable_mask = BIT(16),
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "gcc_gpu_gpll0_div_clk_src", .name = "gcc_gpu_gpll0_div_clk_src",
.parent_hws = (const struct clk_hw *[]){ .parent_hws = (const struct clk_hw *[]){
&gpll0_out_even.clkr.hw }, &gcc_gpu_gpll0_clk_src.clkr.hw },
.num_parents = 1, .num_parents = 1,
.flags = CLK_SET_RATE_PARENT, .flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops, .ops = &clk_branch2_ops,
@@ -1730,7 +1728,6 @@ static struct clk_branch gcc_npu_cfg_ahb_clk = {
}; };
static struct clk_branch gcc_npu_gpll0_clk_src = { static struct clk_branch gcc_npu_gpll0_clk_src = {
.halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52004, .enable_reg = 0x52004,
.enable_mask = BIT(18), .enable_mask = BIT(18),
@@ -1746,14 +1743,13 @@ static struct clk_branch gcc_npu_gpll0_clk_src = {
}; };
static struct clk_branch gcc_npu_gpll0_div_clk_src = { static struct clk_branch gcc_npu_gpll0_div_clk_src = {
.halt_check = BRANCH_HALT_SKIP,
.clkr = { .clkr = {
.enable_reg = 0x52004, .enable_reg = 0x52004,
.enable_mask = BIT(19), .enable_mask = BIT(19),
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "gcc_npu_gpll0_div_clk_src", .name = "gcc_npu_gpll0_div_clk_src",
.parent_hws = (const struct clk_hw *[]){ .parent_hws = (const struct clk_hw *[]){
&gpll0_out_even.clkr.hw }, &gcc_npu_gpll0_clk_src.clkr.hw },
.num_parents = 1, .num_parents = 1,
.flags = CLK_SET_RATE_PARENT, .flags = CLK_SET_RATE_PARENT,
.ops = &clk_branch2_ops, .ops = &clk_branch2_ops,

View File

@@ -135,7 +135,7 @@ static void __init atlas6_clk_init(struct device_node *np)
for (i = pll1; i < maxclk; i++) { for (i = pll1; i < maxclk; i++) {
atlas6_clks[i] = clk_register(NULL, atlas6_clk_hw_array[i]); atlas6_clks[i] = clk_register(NULL, atlas6_clk_hw_array[i]);
BUG_ON(IS_ERR(atlas6_clks[i])); BUG_ON(!atlas6_clks[i]);
} }
clk_register_clkdev(atlas6_clks[cpu], NULL, "cpu"); clk_register_clkdev(atlas6_clks[cpu], NULL, "cpu");
clk_register_clkdev(atlas6_clks[io], NULL, "io"); clk_register_clkdev(atlas6_clks[io], NULL, "io");

View File

@@ -818,6 +818,12 @@ static int ctr_skcipher_setkey(struct crypto_skcipher *skcipher,
return skcipher_setkey(skcipher, key, keylen, ctx1_iv_off); return skcipher_setkey(skcipher, key, keylen, ctx1_iv_off);
} }
static int arc4_skcipher_setkey(struct crypto_skcipher *skcipher,
const u8 *key, unsigned int keylen)
{
return skcipher_setkey(skcipher, key, keylen, 0);
}
static int des_skcipher_setkey(struct crypto_skcipher *skcipher, static int des_skcipher_setkey(struct crypto_skcipher *skcipher,
const u8 *key, unsigned int keylen) const u8 *key, unsigned int keylen)
{ {
@@ -2052,6 +2058,21 @@ static struct caam_skcipher_alg driver_algs[] = {
}, },
.caam.class1_alg_type = OP_ALG_ALGSEL_3DES | OP_ALG_AAI_ECB, .caam.class1_alg_type = OP_ALG_ALGSEL_3DES | OP_ALG_AAI_ECB,
}, },
{
.skcipher = {
.base = {
.cra_name = "ecb(arc4)",
.cra_driver_name = "ecb-arc4-caam",
.cra_blocksize = ARC4_BLOCK_SIZE,
},
.setkey = arc4_skcipher_setkey,
.encrypt = skcipher_encrypt,
.decrypt = skcipher_decrypt,
.min_keysize = ARC4_MIN_KEY_SIZE,
.max_keysize = ARC4_MAX_KEY_SIZE,
},
.caam.class1_alg_type = OP_ALG_ALGSEL_ARC4 | OP_ALG_AAI_ECB,
},
}; };
static struct caam_aead_alg driver_aeads[] = { static struct caam_aead_alg driver_aeads[] = {
@@ -3512,6 +3533,7 @@ int caam_algapi_init(struct device *ctrldev)
struct caam_drv_private *priv = dev_get_drvdata(ctrldev); struct caam_drv_private *priv = dev_get_drvdata(ctrldev);
int i = 0, err = 0; int i = 0, err = 0;
u32 aes_vid, aes_inst, des_inst, md_vid, md_inst, ccha_inst, ptha_inst; u32 aes_vid, aes_inst, des_inst, md_vid, md_inst, ccha_inst, ptha_inst;
u32 arc4_inst;
unsigned int md_limit = SHA512_DIGEST_SIZE; unsigned int md_limit = SHA512_DIGEST_SIZE;
bool registered = false, gcm_support; bool registered = false, gcm_support;
@@ -3531,6 +3553,8 @@ int caam_algapi_init(struct device *ctrldev)
CHA_ID_LS_DES_SHIFT; CHA_ID_LS_DES_SHIFT;
aes_inst = cha_inst & CHA_ID_LS_AES_MASK; aes_inst = cha_inst & CHA_ID_LS_AES_MASK;
md_inst = (cha_inst & CHA_ID_LS_MD_MASK) >> CHA_ID_LS_MD_SHIFT; md_inst = (cha_inst & CHA_ID_LS_MD_MASK) >> CHA_ID_LS_MD_SHIFT;
arc4_inst = (cha_inst & CHA_ID_LS_ARC4_MASK) >>
CHA_ID_LS_ARC4_SHIFT;
ccha_inst = 0; ccha_inst = 0;
ptha_inst = 0; ptha_inst = 0;
@@ -3551,6 +3575,7 @@ int caam_algapi_init(struct device *ctrldev)
md_inst = mdha & CHA_VER_NUM_MASK; md_inst = mdha & CHA_VER_NUM_MASK;
ccha_inst = rd_reg32(&priv->ctrl->vreg.ccha) & CHA_VER_NUM_MASK; ccha_inst = rd_reg32(&priv->ctrl->vreg.ccha) & CHA_VER_NUM_MASK;
ptha_inst = rd_reg32(&priv->ctrl->vreg.ptha) & CHA_VER_NUM_MASK; ptha_inst = rd_reg32(&priv->ctrl->vreg.ptha) & CHA_VER_NUM_MASK;
arc4_inst = rd_reg32(&priv->ctrl->vreg.afha) & CHA_VER_NUM_MASK;
gcm_support = aesa & CHA_VER_MISC_AES_GCM; gcm_support = aesa & CHA_VER_MISC_AES_GCM;
} }
@@ -3573,6 +3598,10 @@ int caam_algapi_init(struct device *ctrldev)
if (!aes_inst && (alg_sel == OP_ALG_ALGSEL_AES)) if (!aes_inst && (alg_sel == OP_ALG_ALGSEL_AES))
continue; continue;
/* Skip ARC4 algorithms if not supported by device */
if (!arc4_inst && alg_sel == OP_ALG_ALGSEL_ARC4)
continue;
/* /*
* Check support for AES modes not available * Check support for AES modes not available
* on LP devices. * on LP devices.

View File

@@ -43,6 +43,7 @@
#include <crypto/akcipher.h> #include <crypto/akcipher.h>
#include <crypto/scatterwalk.h> #include <crypto/scatterwalk.h>
#include <crypto/skcipher.h> #include <crypto/skcipher.h>
#include <crypto/arc4.h>
#include <crypto/internal/skcipher.h> #include <crypto/internal/skcipher.h>
#include <crypto/internal/hash.h> #include <crypto/internal/hash.h>
#include <crypto/internal/rsa.h> #include <crypto/internal/rsa.h>

View File

@@ -85,77 +85,12 @@ static int rv1_determine_dppclk_threshold(struct clk_mgr_internal *clk_mgr, stru
return disp_clk_threshold; return disp_clk_threshold;
} }
static void ramp_up_dispclk_with_dpp( static void ramp_up_dispclk_with_dpp(struct clk_mgr_internal *clk_mgr, struct dc *dc, struct dc_clocks *new_clocks)
struct clk_mgr_internal *clk_mgr,
struct dc *dc,
struct dc_clocks *new_clocks,
bool safe_to_lower)
{ {
int i; int i;
int dispclk_to_dpp_threshold = rv1_determine_dppclk_threshold(clk_mgr, new_clocks); int dispclk_to_dpp_threshold = rv1_determine_dppclk_threshold(clk_mgr, new_clocks);
bool request_dpp_div = new_clocks->dispclk_khz > new_clocks->dppclk_khz; bool request_dpp_div = new_clocks->dispclk_khz > new_clocks->dppclk_khz;
/* this function is to change dispclk, dppclk and dprefclk according to
* bandwidth requirement. Its call stack is rv1_update_clocks -->
* update_clocks --> dcn10_prepare_bandwidth / dcn10_optimize_bandwidth
* --> prepare_bandwidth / optimize_bandwidth. before change dcn hw,
* prepare_bandwidth will be called first to allow enough clock,
* watermark for change, after end of dcn hw change, optimize_bandwidth
* is executed to lower clock to save power for new dcn hw settings.
*
* below is sequence of commit_planes_for_stream:
*
* step 1: prepare_bandwidth - raise clock to have enough bandwidth
* step 2: lock_doublebuffer_enable
* step 3: pipe_control_lock(true) - make dchubp register change will
* not take effect right way
* step 4: apply_ctx_for_surface - program dchubp
* step 5: pipe_control_lock(false) - dchubp register change take effect
* step 6: optimize_bandwidth --> dc_post_update_surfaces_to_stream
* for full_date, optimize clock to save power
*
* at end of step 1, dcn clocks (dprefclk, dispclk, dppclk) may be
* changed for new dchubp configuration. but real dcn hub dchubps are
* still running with old configuration until end of step 5. this need
* clocks settings at step 1 should not less than that before step 1.
* this is checked by two conditions: 1. if (should_set_clock(safe_to_lower
* , new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz) ||
* new_clocks->dispclk_khz == clk_mgr_base->clks.dispclk_khz)
* 2. request_dpp_div = new_clocks->dispclk_khz > new_clocks->dppclk_khz
*
* the second condition is based on new dchubp configuration. dppclk
* for new dchubp may be different from dppclk before step 1.
* for example, before step 1, dchubps are as below:
* pipe 0: recout=(0,40,1920,980) viewport=(0,0,1920,979)
* pipe 1: recout=(0,0,1920,1080) viewport=(0,0,1920,1080)
* for dppclk for pipe0 need dppclk = dispclk
*
* new dchubp pipe split configuration:
* pipe 0: recout=(0,0,960,1080) viewport=(0,0,960,1080)
* pipe 1: recout=(960,0,960,1080) viewport=(960,0,960,1080)
* dppclk only needs dppclk = dispclk /2.
*
* dispclk, dppclk are not lock by otg master lock. they take effect
* after step 1. during this transition, dispclk are the same, but
* dppclk is changed to half of previous clock for old dchubp
* configuration between step 1 and step 6. This may cause p-state
* warning intermittently.
*
* for new_clocks->dispclk_khz == clk_mgr_base->clks.dispclk_khz, we
* need make sure dppclk are not changed to less between step 1 and 6.
* for new_clocks->dispclk_khz > clk_mgr_base->clks.dispclk_khz,
* new display clock is raised, but we do not know ratio of
* new_clocks->dispclk_khz and clk_mgr_base->clks.dispclk_khz,
* new_clocks->dispclk_khz /2 does not guarantee equal or higher than
* old dppclk. we could ignore power saving different between
* dppclk = displck and dppclk = dispclk / 2 between step 1 and step 6.
* as long as safe_to_lower = false, set dpclk = dispclk to simplify
* condition check.
* todo: review this change for other asic.
**/
if (!safe_to_lower)
request_dpp_div = false;
/* set disp clk to dpp clk threshold */ /* set disp clk to dpp clk threshold */
clk_mgr->funcs->set_dispclk(clk_mgr, dispclk_to_dpp_threshold); clk_mgr->funcs->set_dispclk(clk_mgr, dispclk_to_dpp_threshold);
@@ -271,7 +206,7 @@ static void rv1_update_clocks(struct clk_mgr *clk_mgr_base,
/* program dispclk on = as a w/a for sleep resume clock ramping issues */ /* program dispclk on = as a w/a for sleep resume clock ramping issues */
if (should_set_clock(safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz) if (should_set_clock(safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)
|| new_clocks->dispclk_khz == clk_mgr_base->clks.dispclk_khz) { || new_clocks->dispclk_khz == clk_mgr_base->clks.dispclk_khz) {
ramp_up_dispclk_with_dpp(clk_mgr, dc, new_clocks, safe_to_lower); ramp_up_dispclk_with_dpp(clk_mgr, dc, new_clocks);
clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz; clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;
send_request_to_lower = true; send_request_to_lower = true;
} }

View File

@@ -2725,10 +2725,7 @@ static int ci_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)
static bool ci_is_dpm_running(struct pp_hwmgr *hwmgr) static bool ci_is_dpm_running(struct pp_hwmgr *hwmgr)
{ {
return (1 == PHM_READ_INDIRECT_FIELD(hwmgr->device, return ci_is_smc_ram_running(hwmgr);
CGS_IND_REG__SMC, FEATURE_STATUS,
VOLTAGE_CONTROLLER_ON))
? true : false;
} }
static int ci_smu_init(struct pp_hwmgr *hwmgr) static int ci_smu_init(struct pp_hwmgr *hwmgr)

View File

@@ -3369,13 +3369,13 @@ bool drm_dp_mst_allocate_vcpi(struct drm_dp_mst_topology_mgr *mgr,
{ {
int ret; int ret;
if (slots < 0)
return false;
port = drm_dp_mst_topology_get_port_validated(mgr, port); port = drm_dp_mst_topology_get_port_validated(mgr, port);
if (!port) if (!port)
return false; return false;
if (slots < 0)
return false;
if (port->vcpi.vcpi > 0) { if (port->vcpi.vcpi > 0) {
DRM_DEBUG_KMS("payload: vcpi %d already allocated for pbn %d - requested pbn %d\n", DRM_DEBUG_KMS("payload: vcpi %d already allocated for pbn %d - requested pbn %d\n",
port->vcpi.vcpi, port->vcpi.pbn, pbn); port->vcpi.vcpi, port->vcpi.pbn, pbn);
@@ -3389,7 +3389,6 @@ bool drm_dp_mst_allocate_vcpi(struct drm_dp_mst_topology_mgr *mgr,
if (ret) { if (ret) {
DRM_DEBUG_KMS("failed to init vcpi slots=%d max=63 ret=%d\n", DRM_DEBUG_KMS("failed to init vcpi slots=%d max=63 ret=%d\n",
DIV_ROUND_UP(pbn, mgr->pbn_div), ret); DIV_ROUND_UP(pbn, mgr->pbn_div), ret);
drm_dp_mst_topology_put_port(port);
goto out; goto out;
} }
DRM_DEBUG_KMS("initing vcpi for pbn=%d slots=%d\n", DRM_DEBUG_KMS("initing vcpi for pbn=%d slots=%d\n",

View File

@@ -121,12 +121,6 @@ static const struct dmi_system_id orientation_data[] = {
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T101HA"), DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T101HA"),
}, },
.driver_data = (void *)&lcd800x1280_rightside_up, .driver_data = (void *)&lcd800x1280_rightside_up,
}, { /* Asus T103HAF */
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T103HAF"),
},
.driver_data = (void *)&lcd800x1280_rightside_up,
}, { /* GPD MicroPC (generic strings, also match on bios date) */ }, { /* GPD MicroPC (generic strings, also match on bios date) */
.matches = { .matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"), DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"),

View File

@@ -302,19 +302,18 @@ static void imx_ldb_encoder_disable(struct drm_encoder *encoder)
{ {
struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder); struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
struct imx_ldb *ldb = imx_ldb_ch->ldb; struct imx_ldb *ldb = imx_ldb_ch->ldb;
int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
int mux, ret; int mux, ret;
drm_panel_disable(imx_ldb_ch->panel); drm_panel_disable(imx_ldb_ch->panel);
if (imx_ldb_ch == &ldb->channel[0] || dual) if (imx_ldb_ch == &ldb->channel[0])
ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK; ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK;
if (imx_ldb_ch == &ldb->channel[1] || dual) else if (imx_ldb_ch == &ldb->channel[1])
ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK; ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK;
regmap_write(ldb->regmap, IOMUXC_GPR2, ldb->ldb_ctrl); regmap_write(ldb->regmap, IOMUXC_GPR2, ldb->ldb_ctrl);
if (dual) { if (ldb->ldb_ctrl & LDB_SPLIT_MODE_EN) {
clk_disable_unprepare(ldb->clk[0]); clk_disable_unprepare(ldb->clk[0]);
clk_disable_unprepare(ldb->clk[1]); clk_disable_unprepare(ldb->clk[1]);
} }

View File

@@ -46,7 +46,7 @@ static void panfrost_gem_free_object(struct drm_gem_object *obj)
sg_free_table(&bo->sgts[i]); sg_free_table(&bo->sgts[i]);
} }
} }
kvfree(bo->sgts); kfree(bo->sgts);
} }
drm_gem_shmem_free_object(obj); drm_gem_shmem_free_object(obj);

View File

@@ -486,7 +486,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as,
pages = kvmalloc_array(bo->base.base.size >> PAGE_SHIFT, pages = kvmalloc_array(bo->base.base.size >> PAGE_SHIFT,
sizeof(struct page *), GFP_KERNEL | __GFP_ZERO); sizeof(struct page *), GFP_KERNEL | __GFP_ZERO);
if (!pages) { if (!pages) {
kvfree(bo->sgts); kfree(bo->sgts);
bo->sgts = NULL; bo->sgts = NULL;
mutex_unlock(&bo->base.pages_lock); mutex_unlock(&bo->base.pages_lock);
ret = -ENOMEM; ret = -ENOMEM;

View File

@@ -2666,7 +2666,7 @@ int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv,
++i; ++i;
} }
if (&con->head == &dev_priv->dev->mode_config.connector_list) { if (i != unit) {
DRM_ERROR("Could not find initial display unit.\n"); DRM_ERROR("Could not find initial display unit.\n");
ret = -EINVAL; ret = -EINVAL;
goto out_unlock; goto out_unlock;
@@ -2690,13 +2690,13 @@ int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv,
break; break;
} }
if (&mode->head == &con->modes) { if (mode->type & DRM_MODE_TYPE_PREFERRED)
*p_mode = mode;
else {
WARN_ONCE(true, "Could not find initial preferred mode.\n"); WARN_ONCE(true, "Could not find initial preferred mode.\n");
*p_mode = list_first_entry(&con->modes, *p_mode = list_first_entry(&con->modes,
struct drm_display_mode, struct drm_display_mode,
head); head);
} else {
*p_mode = mode;
} }
out_unlock: out_unlock:

View File

@@ -81,7 +81,7 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
struct vmw_legacy_display_unit *entry; struct vmw_legacy_display_unit *entry;
struct drm_framebuffer *fb = NULL; struct drm_framebuffer *fb = NULL;
struct drm_crtc *crtc = NULL; struct drm_crtc *crtc = NULL;
int i; int i = 0;
/* If there is no display topology the host just assumes /* If there is no display topology the host just assumes
* that the guest will set the same layout as the host. * that the guest will set the same layout as the host.
@@ -92,11 +92,12 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
crtc = &entry->base.crtc; crtc = &entry->base.crtc;
w = max(w, crtc->x + crtc->mode.hdisplay); w = max(w, crtc->x + crtc->mode.hdisplay);
h = max(h, crtc->y + crtc->mode.vdisplay); h = max(h, crtc->y + crtc->mode.vdisplay);
i++;
} }
if (crtc == NULL) if (crtc == NULL)
return 0; return 0;
fb = crtc->primary->state->fb; fb = entry->base.crtc.primary->state->fb;
return vmw_kms_write_svga(dev_priv, w, h, fb->pitches[0], return vmw_kms_write_svga(dev_priv, w, h, fb->pitches[0],
fb->format->cpp[0] * 8, fb->format->cpp[0] * 8,

View File

@@ -137,17 +137,6 @@ struct ipu_image_convert_ctx;
struct ipu_image_convert_chan; struct ipu_image_convert_chan;
struct ipu_image_convert_priv; struct ipu_image_convert_priv;
enum eof_irq_mask {
EOF_IRQ_IN = BIT(0),
EOF_IRQ_ROT_IN = BIT(1),
EOF_IRQ_OUT = BIT(2),
EOF_IRQ_ROT_OUT = BIT(3),
};
#define EOF_IRQ_COMPLETE (EOF_IRQ_IN | EOF_IRQ_OUT)
#define EOF_IRQ_ROT_COMPLETE (EOF_IRQ_IN | EOF_IRQ_OUT | \
EOF_IRQ_ROT_IN | EOF_IRQ_ROT_OUT)
struct ipu_image_convert_ctx { struct ipu_image_convert_ctx {
struct ipu_image_convert_chan *chan; struct ipu_image_convert_chan *chan;
@@ -184,9 +173,6 @@ struct ipu_image_convert_ctx {
/* where to place converted tile in dest image */ /* where to place converted tile in dest image */
unsigned int out_tile_map[MAX_TILES]; unsigned int out_tile_map[MAX_TILES];
/* mask of completed EOF irqs at every tile conversion */
enum eof_irq_mask eof_mask;
struct list_head list; struct list_head list;
}; };
@@ -203,8 +189,6 @@ struct ipu_image_convert_chan {
struct ipuv3_channel *rotation_out_chan; struct ipuv3_channel *rotation_out_chan;
/* the IPU end-of-frame irqs */ /* the IPU end-of-frame irqs */
int in_eof_irq;
int rot_in_eof_irq;
int out_eof_irq; int out_eof_irq;
int rot_out_eof_irq; int rot_out_eof_irq;
@@ -1396,9 +1380,6 @@ static int convert_start(struct ipu_image_convert_run *run, unsigned int tile)
dev_dbg(priv->ipu->dev, "%s: task %u: starting ctx %p run %p tile %u -> %u\n", dev_dbg(priv->ipu->dev, "%s: task %u: starting ctx %p run %p tile %u -> %u\n",
__func__, chan->ic_task, ctx, run, tile, dst_tile); __func__, chan->ic_task, ctx, run, tile, dst_tile);
/* clear EOF irq mask */
ctx->eof_mask = 0;
if (ipu_rot_mode_is_irt(ctx->rot_mode)) { if (ipu_rot_mode_is_irt(ctx->rot_mode)) {
/* swap width/height for resizer */ /* swap width/height for resizer */
dest_width = d_image->tile[dst_tile].height; dest_width = d_image->tile[dst_tile].height;
@@ -1634,7 +1615,7 @@ static bool ic_settings_changed(struct ipu_image_convert_ctx *ctx)
} }
/* hold irqlock when calling */ /* hold irqlock when calling */
static irqreturn_t do_tile_complete(struct ipu_image_convert_run *run) static irqreturn_t do_irq(struct ipu_image_convert_run *run)
{ {
struct ipu_image_convert_ctx *ctx = run->ctx; struct ipu_image_convert_ctx *ctx = run->ctx;
struct ipu_image_convert_chan *chan = ctx->chan; struct ipu_image_convert_chan *chan = ctx->chan;
@@ -1719,7 +1700,6 @@ static irqreturn_t do_tile_complete(struct ipu_image_convert_run *run)
ctx->cur_buf_num ^= 1; ctx->cur_buf_num ^= 1;
} }
ctx->eof_mask = 0; /* clear EOF irq mask for next tile */
ctx->next_tile++; ctx->next_tile++;
return IRQ_HANDLED; return IRQ_HANDLED;
done: done:
@@ -1729,15 +1709,13 @@ done:
return IRQ_WAKE_THREAD; return IRQ_WAKE_THREAD;
} }
static irqreturn_t eof_irq(int irq, void *data) static irqreturn_t norotate_irq(int irq, void *data)
{ {
struct ipu_image_convert_chan *chan = data; struct ipu_image_convert_chan *chan = data;
struct ipu_image_convert_priv *priv = chan->priv;
struct ipu_image_convert_ctx *ctx; struct ipu_image_convert_ctx *ctx;
struct ipu_image_convert_run *run; struct ipu_image_convert_run *run;
irqreturn_t ret = IRQ_HANDLED;
bool tile_complete = false;
unsigned long flags; unsigned long flags;
irqreturn_t ret;
spin_lock_irqsave(&chan->irqlock, flags); spin_lock_irqsave(&chan->irqlock, flags);
@@ -1750,33 +1728,46 @@ static irqreturn_t eof_irq(int irq, void *data)
ctx = run->ctx; ctx = run->ctx;
if (irq == chan->in_eof_irq) { if (ipu_rot_mode_is_irt(ctx->rot_mode)) {
ctx->eof_mask |= EOF_IRQ_IN; /* this is a rotation operation, just ignore */
} else if (irq == chan->out_eof_irq) { spin_unlock_irqrestore(&chan->irqlock, flags);
ctx->eof_mask |= EOF_IRQ_OUT; return IRQ_HANDLED;
} else if (irq == chan->rot_in_eof_irq ||
irq == chan->rot_out_eof_irq) {
if (!ipu_rot_mode_is_irt(ctx->rot_mode)) {
/* this was NOT a rotation op, shouldn't happen */
dev_err(priv->ipu->dev,
"Unexpected rotation interrupt\n");
goto out;
} }
ctx->eof_mask |= (irq == chan->rot_in_eof_irq) ?
EOF_IRQ_ROT_IN : EOF_IRQ_ROT_OUT; ret = do_irq(run);
} else { out:
dev_err(priv->ipu->dev, "Received unknown irq %d\n", irq); spin_unlock_irqrestore(&chan->irqlock, flags);
return ret;
}
static irqreturn_t rotate_irq(int irq, void *data)
{
struct ipu_image_convert_chan *chan = data;
struct ipu_image_convert_priv *priv = chan->priv;
struct ipu_image_convert_ctx *ctx;
struct ipu_image_convert_run *run;
unsigned long flags;
irqreturn_t ret;
spin_lock_irqsave(&chan->irqlock, flags);
/* get current run and its context */
run = chan->current_run;
if (!run) {
ret = IRQ_NONE; ret = IRQ_NONE;
goto out; goto out;
} }
if (ipu_rot_mode_is_irt(ctx->rot_mode)) ctx = run->ctx;
tile_complete = (ctx->eof_mask == EOF_IRQ_ROT_COMPLETE);
else
tile_complete = (ctx->eof_mask == EOF_IRQ_COMPLETE);
if (tile_complete) if (!ipu_rot_mode_is_irt(ctx->rot_mode)) {
ret = do_tile_complete(run); /* this was NOT a rotation operation, shouldn't happen */
dev_err(priv->ipu->dev, "Unexpected rotation interrupt\n");
spin_unlock_irqrestore(&chan->irqlock, flags);
return IRQ_HANDLED;
}
ret = do_irq(run);
out: out:
spin_unlock_irqrestore(&chan->irqlock, flags); spin_unlock_irqrestore(&chan->irqlock, flags);
return ret; return ret;
@@ -1810,10 +1801,6 @@ static void force_abort(struct ipu_image_convert_ctx *ctx)
static void release_ipu_resources(struct ipu_image_convert_chan *chan) static void release_ipu_resources(struct ipu_image_convert_chan *chan)
{ {
if (chan->in_eof_irq >= 0)
free_irq(chan->in_eof_irq, chan);
if (chan->rot_in_eof_irq >= 0)
free_irq(chan->rot_in_eof_irq, chan);
if (chan->out_eof_irq >= 0) if (chan->out_eof_irq >= 0)
free_irq(chan->out_eof_irq, chan); free_irq(chan->out_eof_irq, chan);
if (chan->rot_out_eof_irq >= 0) if (chan->rot_out_eof_irq >= 0)
@@ -1832,27 +1819,7 @@ static void release_ipu_resources(struct ipu_image_convert_chan *chan)
chan->in_chan = chan->out_chan = chan->rotation_in_chan = chan->in_chan = chan->out_chan = chan->rotation_in_chan =
chan->rotation_out_chan = NULL; chan->rotation_out_chan = NULL;
chan->in_eof_irq = -1; chan->out_eof_irq = chan->rot_out_eof_irq = -1;
chan->rot_in_eof_irq = -1;
chan->out_eof_irq = -1;
chan->rot_out_eof_irq = -1;
}
static int get_eof_irq(struct ipu_image_convert_chan *chan,
struct ipuv3_channel *channel)
{
struct ipu_image_convert_priv *priv = chan->priv;
int ret, irq;
irq = ipu_idmac_channel_irq(priv->ipu, channel, IPU_IRQ_EOF);
ret = request_threaded_irq(irq, eof_irq, do_bh, 0, "ipu-ic", chan);
if (ret < 0) {
dev_err(priv->ipu->dev, "could not acquire irq %d\n", irq);
return ret;
}
return irq;
} }
static int get_ipu_resources(struct ipu_image_convert_chan *chan) static int get_ipu_resources(struct ipu_image_convert_chan *chan)
@@ -1888,33 +1855,31 @@ static int get_ipu_resources(struct ipu_image_convert_chan *chan)
} }
/* acquire the EOF interrupts */ /* acquire the EOF interrupts */
ret = get_eof_irq(chan, chan->in_chan); chan->out_eof_irq = ipu_idmac_channel_irq(priv->ipu,
if (ret < 0) { chan->out_chan,
chan->in_eof_irq = -1; IPU_IRQ_EOF);
goto err;
}
chan->in_eof_irq = ret;
ret = get_eof_irq(chan, chan->rotation_in_chan); ret = request_threaded_irq(chan->out_eof_irq, norotate_irq, do_bh,
if (ret < 0) { 0, "ipu-ic", chan);
chan->rot_in_eof_irq = -1;
goto err;
}
chan->rot_in_eof_irq = ret;
ret = get_eof_irq(chan, chan->out_chan);
if (ret < 0) { if (ret < 0) {
dev_err(priv->ipu->dev, "could not acquire irq %d\n",
chan->out_eof_irq);
chan->out_eof_irq = -1; chan->out_eof_irq = -1;
goto err; goto err;
} }
chan->out_eof_irq = ret;
ret = get_eof_irq(chan, chan->rotation_out_chan); chan->rot_out_eof_irq = ipu_idmac_channel_irq(priv->ipu,
chan->rotation_out_chan,
IPU_IRQ_EOF);
ret = request_threaded_irq(chan->rot_out_eof_irq, rotate_irq, do_bh,
0, "ipu-ic", chan);
if (ret < 0) { if (ret < 0) {
dev_err(priv->ipu->dev, "could not acquire irq %d\n",
chan->rot_out_eof_irq);
chan->rot_out_eof_irq = -1; chan->rot_out_eof_irq = -1;
goto err; goto err;
} }
chan->rot_out_eof_irq = ret;
return 0; return 0;
err: err:
@@ -2493,8 +2458,6 @@ int ipu_image_convert_init(struct ipu_soc *ipu, struct device *dev)
chan->ic_task = i; chan->ic_task = i;
chan->priv = priv; chan->priv = priv;
chan->dma_ch = &image_convert_dma_chan[i]; chan->dma_ch = &image_convert_dma_chan[i];
chan->in_eof_irq = -1;
chan->rot_in_eof_irq = -1;
chan->out_eof_irq = -1; chan->out_eof_irq = -1;
chan->rot_out_eof_irq = -1; chan->rot_out_eof_irq = -1;

View File

@@ -1037,7 +1037,7 @@ static int bcm_iproc_i2c_unreg_slave(struct i2c_client *slave)
if (!iproc_i2c->slave) if (!iproc_i2c->slave)
return -EINVAL; return -EINVAL;
disable_irq(iproc_i2c->irq); iproc_i2c->slave = NULL;
/* disable all slave interrupts */ /* disable all slave interrupts */
tmp = iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET); tmp = iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET);
@@ -1050,17 +1050,6 @@ static int bcm_iproc_i2c_unreg_slave(struct i2c_client *slave)
tmp &= ~BIT(S_CFG_EN_NIC_SMB_ADDR3_SHIFT); tmp &= ~BIT(S_CFG_EN_NIC_SMB_ADDR3_SHIFT);
iproc_i2c_wr_reg(iproc_i2c, S_CFG_SMBUS_ADDR_OFFSET, tmp); iproc_i2c_wr_reg(iproc_i2c, S_CFG_SMBUS_ADDR_OFFSET, tmp);
/* flush TX/RX FIFOs */
tmp = (BIT(S_FIFO_RX_FLUSH_SHIFT) | BIT(S_FIFO_TX_FLUSH_SHIFT));
iproc_i2c_wr_reg(iproc_i2c, S_FIFO_CTRL_OFFSET, tmp);
/* clear all pending slave interrupts */
iproc_i2c_wr_reg(iproc_i2c, IS_OFFSET, ISR_MASK_SLAVE);
iproc_i2c->slave = NULL;
enable_irq(iproc_i2c->irq);
return 0; return 0;
} }

View File

@@ -580,14 +580,13 @@ static bool rcar_i2c_slave_irq(struct rcar_i2c_priv *priv)
rcar_i2c_write(priv, ICSIER, SDR | SSR | SAR); rcar_i2c_write(priv, ICSIER, SDR | SSR | SAR);
} }
/* Clear SSR, too, because of old STOPs to other clients than us */ rcar_i2c_write(priv, ICSSR, ~SAR & 0xff);
rcar_i2c_write(priv, ICSSR, ~(SAR | SSR) & 0xff);
} }
/* master sent stop */ /* master sent stop */
if (ssr_filtered & SSR) { if (ssr_filtered & SSR) {
i2c_slave_event(priv->slave, I2C_SLAVE_STOP, &value); i2c_slave_event(priv->slave, I2C_SLAVE_STOP, &value);
rcar_i2c_write(priv, ICSIER, SAR); rcar_i2c_write(priv, ICSIER, SAR | SSR);
rcar_i2c_write(priv, ICSSR, ~SSR & 0xff); rcar_i2c_write(priv, ICSSR, ~SSR & 0xff);
} }
@@ -851,7 +850,7 @@ static int rcar_reg_slave(struct i2c_client *slave)
priv->slave = slave; priv->slave = slave;
rcar_i2c_write(priv, ICSAR, slave->addr); rcar_i2c_write(priv, ICSAR, slave->addr);
rcar_i2c_write(priv, ICSSR, 0); rcar_i2c_write(priv, ICSSR, 0);
rcar_i2c_write(priv, ICSIER, SAR); rcar_i2c_write(priv, ICSIER, SAR | SSR);
rcar_i2c_write(priv, ICSCR, SIE | SDBS); rcar_i2c_write(priv, ICSCR, SIE | SDBS);
return 0; return 0;
@@ -863,14 +862,12 @@ static int rcar_unreg_slave(struct i2c_client *slave)
WARN_ON(!priv->slave); WARN_ON(!priv->slave);
/* ensure no irq is running before clearing ptr */ /* disable irqs and ensure none is running before clearing ptr */
disable_irq(priv->irq);
rcar_i2c_write(priv, ICSIER, 0); rcar_i2c_write(priv, ICSIER, 0);
rcar_i2c_write(priv, ICSSR, 0); rcar_i2c_write(priv, ICSCR, 0);
enable_irq(priv->irq);
rcar_i2c_write(priv, ICSCR, SDBS);
rcar_i2c_write(priv, ICSAR, 0); /* Gen2: must be 0 if not using slave */ rcar_i2c_write(priv, ICSAR, 0); /* Gen2: must be 0 if not using slave */
synchronize_irq(priv->irq);
priv->slave = NULL; priv->slave = NULL;
pm_runtime_put(rcar_i2c_priv_to_dev(priv)); pm_runtime_put(rcar_i2c_priv_to_dev(priv));

View File

@@ -416,7 +416,7 @@ static int ad5592r_read_raw(struct iio_dev *iio_dev,
s64 tmp = *val * (3767897513LL / 25LL); s64 tmp = *val * (3767897513LL / 25LL);
*val = div_s64_rem(tmp, 1000000000LL, val2); *val = div_s64_rem(tmp, 1000000000LL, val2);
return IIO_VAL_INT_PLUS_MICRO; ret = IIO_VAL_INT_PLUS_MICRO;
} else { } else {
int mult; int mult;
@@ -447,7 +447,7 @@ static int ad5592r_read_raw(struct iio_dev *iio_dev,
ret = IIO_VAL_INT; ret = IIO_VAL_INT;
break; break;
default: default:
return -EINVAL; ret = -EINVAL;
} }
unlock: unlock:

View File

@@ -284,7 +284,7 @@ int rdma_counter_bind_qp_auto(struct ib_qp *qp, u8 port)
struct rdma_counter *counter; struct rdma_counter *counter;
int ret; int ret;
if (!qp->res.valid || rdma_is_kernel_res(&qp->res)) if (!qp->res.valid)
return 0; return 0;
if (!rdma_is_port_valid(dev, port)) if (!rdma_is_port_valid(dev, port))
@@ -487,7 +487,7 @@ int rdma_counter_bind_qpn(struct ib_device *dev, u8 port,
goto err; goto err;
} }
if (rdma_is_kernel_res(&counter->res) != rdma_is_kernel_res(&qp->res)) { if (counter->res.task != qp->res.task) {
ret = -EINVAL; ret = -EINVAL;
goto err_task; goto err_task;
} }

View File

@@ -757,7 +757,6 @@ static int ib_uverbs_reg_mr(struct uverbs_attr_bundle *attrs)
mr->uobject = uobj; mr->uobject = uobj;
atomic_inc(&pd->usecnt); atomic_inc(&pd->usecnt);
mr->res.type = RDMA_RESTRACK_MR; mr->res.type = RDMA_RESTRACK_MR;
mr->iova = cmd.hca_va;
rdma_restrack_uadd(&mr->res); rdma_restrack_uadd(&mr->res);
uobj->object = mr; uobj->object = mr;
@@ -848,9 +847,6 @@ static int ib_uverbs_rereg_mr(struct uverbs_attr_bundle *attrs)
atomic_dec(&old_pd->usecnt); atomic_dec(&old_pd->usecnt);
} }
if (cmd.flags & IB_MR_REREG_TRANS)
mr->iova = cmd.hca_va;
memset(&resp, 0, sizeof(resp)); memset(&resp, 0, sizeof(resp));
resp.lkey = mr->lkey; resp.lkey = mr->lkey;
resp.rkey = mr->rkey; resp.rkey = mr->rkey;

View File

@@ -399,6 +399,7 @@ static int finish_mem_reg(struct c4iw_mr *mhp, u32 stag)
mmid = stag >> 8; mmid = stag >> 8;
mhp->ibmr.rkey = mhp->ibmr.lkey = stag; mhp->ibmr.rkey = mhp->ibmr.lkey = stag;
mhp->ibmr.length = mhp->attr.len; mhp->ibmr.length = mhp->attr.len;
mhp->ibmr.iova = mhp->attr.va_fbo;
mhp->ibmr.page_size = 1U << (mhp->attr.page_size + 12); mhp->ibmr.page_size = 1U << (mhp->attr.page_size + 12);
pr_debug("mmid 0x%x mhp %p\n", mmid, mhp); pr_debug("mmid 0x%x mhp %p\n", mmid, mhp);
return xa_insert_irq(&mhp->rhp->mrs, mmid, mhp, GFP_KERNEL); return xa_insert_irq(&mhp->rhp->mrs, mmid, mhp, GFP_KERNEL);

View File

@@ -439,6 +439,7 @@ struct ib_mr *mlx4_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
mr->ibmr.rkey = mr->ibmr.lkey = mr->mmr.key; mr->ibmr.rkey = mr->ibmr.lkey = mr->mmr.key;
mr->ibmr.length = length; mr->ibmr.length = length;
mr->ibmr.iova = virt_addr;
mr->ibmr.page_size = 1U << shift; mr->ibmr.page_size = 1U << shift;
return &mr->ibmr; return &mr->ibmr;

View File

@@ -515,7 +515,7 @@ void ipoib_ib_dev_cleanup(struct net_device *dev);
int ipoib_ib_dev_open_default(struct net_device *dev); int ipoib_ib_dev_open_default(struct net_device *dev);
int ipoib_ib_dev_open(struct net_device *dev); int ipoib_ib_dev_open(struct net_device *dev);
void ipoib_ib_dev_stop(struct net_device *dev); int ipoib_ib_dev_stop(struct net_device *dev);
void ipoib_ib_dev_up(struct net_device *dev); void ipoib_ib_dev_up(struct net_device *dev);
void ipoib_ib_dev_down(struct net_device *dev); void ipoib_ib_dev_down(struct net_device *dev);
int ipoib_ib_dev_stop_default(struct net_device *dev); int ipoib_ib_dev_stop_default(struct net_device *dev);

View File

@@ -670,12 +670,13 @@ int ipoib_send(struct net_device *dev, struct sk_buff *skb,
return rc; return rc;
} }
static void ipoib_reap_dead_ahs(struct ipoib_dev_priv *priv) static void __ipoib_reap_ah(struct net_device *dev)
{ {
struct ipoib_dev_priv *priv = ipoib_priv(dev);
struct ipoib_ah *ah, *tah; struct ipoib_ah *ah, *tah;
unsigned long flags; unsigned long flags;
netif_tx_lock_bh(priv->dev); netif_tx_lock_bh(dev);
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
list_for_each_entry_safe(ah, tah, &priv->dead_ahs, list) list_for_each_entry_safe(ah, tah, &priv->dead_ahs, list)
@@ -686,37 +687,37 @@ static void ipoib_reap_dead_ahs(struct ipoib_dev_priv *priv)
} }
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
netif_tx_unlock_bh(priv->dev); netif_tx_unlock_bh(dev);
} }
void ipoib_reap_ah(struct work_struct *work) void ipoib_reap_ah(struct work_struct *work)
{ {
struct ipoib_dev_priv *priv = struct ipoib_dev_priv *priv =
container_of(work, struct ipoib_dev_priv, ah_reap_task.work); container_of(work, struct ipoib_dev_priv, ah_reap_task.work);
struct net_device *dev = priv->dev;
ipoib_reap_dead_ahs(priv); __ipoib_reap_ah(dev);
if (!test_bit(IPOIB_STOP_REAPER, &priv->flags)) if (!test_bit(IPOIB_STOP_REAPER, &priv->flags))
queue_delayed_work(priv->wq, &priv->ah_reap_task, queue_delayed_work(priv->wq, &priv->ah_reap_task,
round_jiffies_relative(HZ)); round_jiffies_relative(HZ));
} }
static void ipoib_start_ah_reaper(struct ipoib_dev_priv *priv) static void ipoib_flush_ah(struct net_device *dev)
{ {
clear_bit(IPOIB_STOP_REAPER, &priv->flags); struct ipoib_dev_priv *priv = ipoib_priv(dev);
queue_delayed_work(priv->wq, &priv->ah_reap_task,
round_jiffies_relative(HZ)); cancel_delayed_work(&priv->ah_reap_task);
flush_workqueue(priv->wq);
ipoib_reap_ah(&priv->ah_reap_task.work);
} }
static void ipoib_stop_ah_reaper(struct ipoib_dev_priv *priv) static void ipoib_stop_ah(struct net_device *dev)
{ {
struct ipoib_dev_priv *priv = ipoib_priv(dev);
set_bit(IPOIB_STOP_REAPER, &priv->flags); set_bit(IPOIB_STOP_REAPER, &priv->flags);
cancel_delayed_work(&priv->ah_reap_task); ipoib_flush_ah(dev);
/*
* After ipoib_stop_ah_reaper() we always go through
* ipoib_reap_dead_ahs() which ensures the work is really stopped and
* does a final flush out of the dead_ah's list
*/
} }
static int recvs_pending(struct net_device *dev) static int recvs_pending(struct net_device *dev)
@@ -845,6 +846,18 @@ timeout:
return 0; return 0;
} }
int ipoib_ib_dev_stop(struct net_device *dev)
{
struct ipoib_dev_priv *priv = ipoib_priv(dev);
priv->rn_ops->ndo_stop(dev);
clear_bit(IPOIB_FLAG_INITIALIZED, &priv->flags);
ipoib_flush_ah(dev);
return 0;
}
int ipoib_ib_dev_open_default(struct net_device *dev) int ipoib_ib_dev_open_default(struct net_device *dev)
{ {
struct ipoib_dev_priv *priv = ipoib_priv(dev); struct ipoib_dev_priv *priv = ipoib_priv(dev);
@@ -888,7 +901,10 @@ int ipoib_ib_dev_open(struct net_device *dev)
return -1; return -1;
} }
ipoib_start_ah_reaper(priv); clear_bit(IPOIB_STOP_REAPER, &priv->flags);
queue_delayed_work(priv->wq, &priv->ah_reap_task,
round_jiffies_relative(HZ));
if (priv->rn_ops->ndo_open(dev)) { if (priv->rn_ops->ndo_open(dev)) {
pr_warn("%s: Failed to open dev\n", dev->name); pr_warn("%s: Failed to open dev\n", dev->name);
goto dev_stop; goto dev_stop;
@@ -899,20 +915,13 @@ int ipoib_ib_dev_open(struct net_device *dev)
return 0; return 0;
dev_stop: dev_stop:
ipoib_stop_ah_reaper(priv); set_bit(IPOIB_STOP_REAPER, &priv->flags);
cancel_delayed_work(&priv->ah_reap_task);
set_bit(IPOIB_FLAG_INITIALIZED, &priv->flags);
ipoib_ib_dev_stop(dev);
return -1; return -1;
} }
void ipoib_ib_dev_stop(struct net_device *dev)
{
struct ipoib_dev_priv *priv = ipoib_priv(dev);
priv->rn_ops->ndo_stop(dev);
clear_bit(IPOIB_FLAG_INITIALIZED, &priv->flags);
ipoib_stop_ah_reaper(priv);
}
void ipoib_pkey_dev_check_presence(struct net_device *dev) void ipoib_pkey_dev_check_presence(struct net_device *dev)
{ {
struct ipoib_dev_priv *priv = ipoib_priv(dev); struct ipoib_dev_priv *priv = ipoib_priv(dev);
@@ -1223,7 +1232,7 @@ static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv,
ipoib_mcast_dev_flush(dev); ipoib_mcast_dev_flush(dev);
if (oper_up) if (oper_up)
set_bit(IPOIB_FLAG_OPER_UP, &priv->flags); set_bit(IPOIB_FLAG_OPER_UP, &priv->flags);
ipoib_reap_dead_ahs(priv); ipoib_flush_ah(dev);
} }
if (level >= IPOIB_FLUSH_NORMAL) if (level >= IPOIB_FLUSH_NORMAL)
@@ -1298,7 +1307,7 @@ void ipoib_ib_dev_cleanup(struct net_device *dev)
* the neighbor garbage collection is stopped and reaped. * the neighbor garbage collection is stopped and reaped.
* That should all be done now, so make a final ah flush. * That should all be done now, so make a final ah flush.
*/ */
ipoib_reap_dead_ahs(priv); ipoib_stop_ah(dev);
clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags); clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);

View File

@@ -1979,8 +1979,6 @@ static void ipoib_ndo_uninit(struct net_device *dev)
/* no more works over the priv->wq */ /* no more works over the priv->wq */
if (priv->wq) { if (priv->wq) {
/* See ipoib_mcast_carrier_on_task() */
WARN_ON(test_bit(IPOIB_FLAG_OPER_UP, &priv->flags));
flush_workqueue(priv->wq); flush_workqueue(priv->wq);
destroy_workqueue(priv->wq); destroy_workqueue(priv->wq);
priv->wq = NULL; priv->wq = NULL;

View File

@@ -441,7 +441,7 @@ static ssize_t fsp_attr_set_setreg(struct psmouse *psmouse, void *data,
fsp_reg_write_enable(psmouse, false); fsp_reg_write_enable(psmouse, false);
return retval; return count;
} }
PSMOUSE_DEFINE_WO_ATTR(setreg, S_IWUSR, NULL, fsp_attr_set_setreg); PSMOUSE_DEFINE_WO_ATTR(setreg, S_IWUSR, NULL, fsp_attr_set_setreg);

View File

@@ -98,11 +98,8 @@ static ssize_t debug_read_regs(struct file *file, char __user *userbuf,
mutex_lock(&iommu_debug_lock); mutex_lock(&iommu_debug_lock);
bytes = omap_iommu_dump_ctx(obj, p, count); bytes = omap_iommu_dump_ctx(obj, p, count);
if (bytes < 0)
goto err;
bytes = simple_read_from_buffer(userbuf, count, ppos, buf, bytes); bytes = simple_read_from_buffer(userbuf, count, ppos, buf, bytes);
err:
mutex_unlock(&iommu_debug_lock); mutex_unlock(&iommu_debug_lock);
kfree(buf); kfree(buf);

View File

@@ -2581,7 +2581,6 @@ static int its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
msi_alloc_info_t *info = args; msi_alloc_info_t *info = args;
struct its_device *its_dev = info->scratchpad[0].ptr; struct its_device *its_dev = info->scratchpad[0].ptr;
struct its_node *its = its_dev->its; struct its_node *its = its_dev->its;
struct irq_data *irqd;
irq_hw_number_t hwirq; irq_hw_number_t hwirq;
int err; int err;
int i; int i;
@@ -2601,9 +2600,7 @@ static int its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
irq_domain_set_hwirq_and_chip(domain, virq + i, irq_domain_set_hwirq_and_chip(domain, virq + i,
hwirq + i, &its_irq_chip, its_dev); hwirq + i, &its_irq_chip, its_dev);
irqd = irq_get_irq_data(virq + i); irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(virq + i)));
irqd_set_single_target(irqd);
irqd_set_affinity_on_activate(irqd);
pr_debug("ID:%d pID:%d vID:%d\n", pr_debug("ID:%d pID:%d vID:%d\n",
(int)(hwirq + i - its_dev->event_map.lpi_base), (int)(hwirq + i - its_dev->event_map.lpi_base),
(int)(hwirq + i), virq + i); (int)(hwirq + i), virq + i);

View File

@@ -264,7 +264,7 @@ struct bcache_device {
#define BCACHE_DEV_UNLINK_DONE 2 #define BCACHE_DEV_UNLINK_DONE 2
#define BCACHE_DEV_WB_RUNNING 3 #define BCACHE_DEV_WB_RUNNING 3
#define BCACHE_DEV_RATE_DW_RUNNING 4 #define BCACHE_DEV_RATE_DW_RUNNING 4
int nr_stripes; unsigned int nr_stripes;
unsigned int stripe_size; unsigned int stripe_size;
atomic_t *stripe_sectors_dirty; atomic_t *stripe_sectors_dirty;
unsigned long *full_dirty_stripes; unsigned long *full_dirty_stripes;

View File

@@ -321,7 +321,7 @@ int bch_btree_keys_alloc(struct btree_keys *b,
b->page_order = page_order; b->page_order = page_order;
t->data = (void *) __get_free_pages(__GFP_COMP|gfp, b->page_order); t->data = (void *) __get_free_pages(gfp, b->page_order);
if (!t->data) if (!t->data)
goto err; goto err;

View File

@@ -840,7 +840,7 @@ int bch_btree_cache_alloc(struct cache_set *c)
mutex_init(&c->verify_lock); mutex_init(&c->verify_lock);
c->verify_ondisk = (void *) c->verify_ondisk = (void *)
__get_free_pages(GFP_KERNEL|__GFP_COMP, ilog2(bucket_pages(c))); __get_free_pages(GFP_KERNEL, ilog2(bucket_pages(c)));
c->verify_data = mca_bucket_alloc(c, &ZERO_KEY, GFP_KERNEL); c->verify_data = mca_bucket_alloc(c, &ZERO_KEY, GFP_KERNEL);

View File

@@ -1002,8 +1002,8 @@ int bch_journal_alloc(struct cache_set *c)
j->w[1].c = c; j->w[1].c = c;
if (!(init_fifo(&j->pin, JOURNAL_PIN, GFP_KERNEL)) || if (!(init_fifo(&j->pin, JOURNAL_PIN, GFP_KERNEL)) ||
!(j->w[0].data = (void *) __get_free_pages(GFP_KERNEL|__GFP_COMP, JSET_BITS)) || !(j->w[0].data = (void *) __get_free_pages(GFP_KERNEL, JSET_BITS)) ||
!(j->w[1].data = (void *) __get_free_pages(GFP_KERNEL|__GFP_COMP, JSET_BITS))) !(j->w[1].data = (void *) __get_free_pages(GFP_KERNEL, JSET_BITS)))
return -ENOMEM; return -ENOMEM;
return 0; return 0;

View File

@@ -1754,7 +1754,7 @@ void bch_cache_set_unregister(struct cache_set *c)
} }
#define alloc_bucket_pages(gfp, c) \ #define alloc_bucket_pages(gfp, c) \
((void *) __get_free_pages(__GFP_ZERO|__GFP_COMP|gfp, ilog2(bucket_pages(c)))) ((void *) __get_free_pages(__GFP_ZERO|gfp, ilog2(bucket_pages(c))))
struct cache_set *bch_cache_set_alloc(struct cache_sb *sb) struct cache_set *bch_cache_set_alloc(struct cache_sb *sb)
{ {

View File

@@ -519,19 +519,15 @@ void bcache_dev_sectors_dirty_add(struct cache_set *c, unsigned int inode,
uint64_t offset, int nr_sectors) uint64_t offset, int nr_sectors)
{ {
struct bcache_device *d = c->devices[inode]; struct bcache_device *d = c->devices[inode];
unsigned int stripe_offset, sectors_dirty; unsigned int stripe_offset, stripe, sectors_dirty;
int stripe;
if (!d) if (!d)
return; return;
stripe = offset_to_stripe(d, offset);
if (stripe < 0)
return;
if (UUID_FLASH_ONLY(&c->uuids[inode])) if (UUID_FLASH_ONLY(&c->uuids[inode]))
atomic_long_add(nr_sectors, &c->flash_dev_dirty_sectors); atomic_long_add(nr_sectors, &c->flash_dev_dirty_sectors);
stripe = offset_to_stripe(d, offset);
stripe_offset = offset & (d->stripe_size - 1); stripe_offset = offset & (d->stripe_size - 1);
while (nr_sectors) { while (nr_sectors) {
@@ -571,12 +567,12 @@ static bool dirty_pred(struct keybuf *buf, struct bkey *k)
static void refill_full_stripes(struct cached_dev *dc) static void refill_full_stripes(struct cached_dev *dc)
{ {
struct keybuf *buf = &dc->writeback_keys; struct keybuf *buf = &dc->writeback_keys;
unsigned int start_stripe, next_stripe; unsigned int start_stripe, stripe, next_stripe;
int stripe;
bool wrapped = false; bool wrapped = false;
stripe = offset_to_stripe(&dc->disk, KEY_OFFSET(&buf->last_scanned)); stripe = offset_to_stripe(&dc->disk, KEY_OFFSET(&buf->last_scanned));
if (stripe < 0)
if (stripe >= dc->disk.nr_stripes)
stripe = 0; stripe = 0;
start_stripe = stripe; start_stripe = stripe;

View File

@@ -33,22 +33,10 @@ static inline uint64_t bcache_dev_sectors_dirty(struct bcache_device *d)
return ret; return ret;
} }
static inline int offset_to_stripe(struct bcache_device *d, static inline unsigned int offset_to_stripe(struct bcache_device *d,
uint64_t offset) uint64_t offset)
{ {
do_div(offset, d->stripe_size); do_div(offset, d->stripe_size);
/* d->nr_stripes is in range [1, INT_MAX] */
if (unlikely(offset >= d->nr_stripes)) {
pr_err("Invalid stripe %llu (>= nr_stripes %d).\n",
offset, d->nr_stripes);
return -EINVAL;
}
/*
* Here offset is definitly smaller than INT_MAX,
* return it as int will never overflow.
*/
return offset; return offset;
} }
@@ -56,10 +44,7 @@ static inline bool bcache_dev_stripe_dirty(struct cached_dev *dc,
uint64_t offset, uint64_t offset,
unsigned int nr_sectors) unsigned int nr_sectors)
{ {
int stripe = offset_to_stripe(&dc->disk, offset); unsigned int stripe = offset_to_stripe(&dc->disk, offset);
if (stripe < 0)
return false;
while (1) { while (1) {
if (atomic_read(dc->disk.stripe_sectors_dirty + stripe)) if (atomic_read(dc->disk.stripe_sectors_dirty + stripe))

View File

@@ -70,6 +70,9 @@ void dm_start_queue(struct request_queue *q)
void dm_stop_queue(struct request_queue *q) void dm_stop_queue(struct request_queue *q)
{ {
if (blk_mq_queue_stopped(q))
return;
blk_mq_quiesce_queue(q); blk_mq_quiesce_queue(q);
} }

View File

@@ -1139,7 +1139,6 @@ static int resize_bitmaps(struct mddev *mddev, sector_t newsize, sector_t oldsiz
bitmap = get_bitmap_from_slot(mddev, i); bitmap = get_bitmap_from_slot(mddev, i);
if (IS_ERR(bitmap)) { if (IS_ERR(bitmap)) {
pr_err("can't get bitmap from slot %d\n", i); pr_err("can't get bitmap from slot %d\n", i);
bitmap = NULL;
goto out; goto out;
} }
counts = &bitmap->counts; counts = &bitmap->counts;

View File

@@ -3604,7 +3604,6 @@ static int need_this_block(struct stripe_head *sh, struct stripe_head_state *s,
* is missing/faulty, then we need to read everything we can. * is missing/faulty, then we need to read everything we can.
*/ */
if (sh->raid_conf->level != 6 && if (sh->raid_conf->level != 6 &&
sh->raid_conf->rmw_level != PARITY_DISABLE_RMW &&
sh->sector < sh->raid_conf->mddev->recovery_cp) sh->sector < sh->raid_conf->mddev->recovery_cp)
/* reconstruct-write isn't being forced */ /* reconstruct-write isn't being forced */
return 0; return 0;
@@ -4840,7 +4839,7 @@ static void handle_stripe(struct stripe_head *sh)
* or to load a block that is being partially written. * or to load a block that is being partially written.
*/ */
if (s.to_read || s.non_overwrite if (s.to_read || s.non_overwrite
|| (s.to_write && s.failed) || (conf->level == 6 && s.to_write && s.failed)
|| (s.syncing && (s.uptodate + s.compute < disks)) || (s.syncing && (s.uptodate + s.compute < disks))
|| s.replacing || s.replacing
|| s.expanding) || s.expanding)

View File

@@ -200,25 +200,22 @@ static void rga_cmd_set_trans_info(struct rga_ctx *ctx)
dst_info.data.format = ctx->out.fmt->hw_format; dst_info.data.format = ctx->out.fmt->hw_format;
dst_info.data.swap = ctx->out.fmt->color_swap; dst_info.data.swap = ctx->out.fmt->color_swap;
/* if (ctx->in.fmt->hw_format >= RGA_COLOR_FMT_YUV422SP) {
* CSC mode must only be set when the colorspace families differ between if (ctx->out.fmt->hw_format < RGA_COLOR_FMT_YUV422SP) {
* input and output. It must remain unset (zeroed) if both are the same.
*/
if (RGA_COLOR_FMT_IS_YUV(ctx->in.fmt->hw_format) &&
RGA_COLOR_FMT_IS_RGB(ctx->out.fmt->hw_format)) {
switch (ctx->in.colorspace) { switch (ctx->in.colorspace) {
case V4L2_COLORSPACE_REC709: case V4L2_COLORSPACE_REC709:
src_info.data.csc_mode = RGA_SRC_CSC_MODE_BT709_R0; src_info.data.csc_mode =
RGA_SRC_CSC_MODE_BT709_R0;
break; break;
default: default:
src_info.data.csc_mode = RGA_SRC_CSC_MODE_BT601_R0; src_info.data.csc_mode =
RGA_SRC_CSC_MODE_BT601_R0;
break; break;
} }
} }
}
if (RGA_COLOR_FMT_IS_RGB(ctx->in.fmt->hw_format) && if (ctx->out.fmt->hw_format >= RGA_COLOR_FMT_YUV422SP) {
RGA_COLOR_FMT_IS_YUV(ctx->out.fmt->hw_format)) {
switch (ctx->out.colorspace) { switch (ctx->out.colorspace) {
case V4L2_COLORSPACE_REC709: case V4L2_COLORSPACE_REC709:
dst_info.data.csc_mode = RGA_SRC_CSC_MODE_BT709_R0; dst_info.data.csc_mode = RGA_SRC_CSC_MODE_BT709_R0;

View File

@@ -95,11 +95,6 @@
#define RGA_COLOR_FMT_CP_8BPP 15 #define RGA_COLOR_FMT_CP_8BPP 15
#define RGA_COLOR_FMT_MASK 15 #define RGA_COLOR_FMT_MASK 15
#define RGA_COLOR_FMT_IS_YUV(fmt) \
(((fmt) >= RGA_COLOR_FMT_YUV422SP) && ((fmt) < RGA_COLOR_FMT_CP_1BPP))
#define RGA_COLOR_FMT_IS_RGB(fmt) \
((fmt) < RGA_COLOR_FMT_YUV422SP)
#define RGA_COLOR_NONE_SWAP 0 #define RGA_COLOR_NONE_SWAP 0
#define RGA_COLOR_RB_SWAP 1 #define RGA_COLOR_RB_SWAP 1
#define RGA_COLOR_ALPHA_SWAP 2 #define RGA_COLOR_ALPHA_SWAP 2

View File

@@ -431,8 +431,6 @@ vsp1_dl_cmd_pool_create(struct vsp1_device *vsp1, enum vsp1_extcmd_type type,
if (!pool) if (!pool)
return NULL; return NULL;
pool->vsp1 = vsp1;
spin_lock_init(&pool->lock); spin_lock_init(&pool->lock);
INIT_LIST_HEAD(&pool->free); INIT_LIST_HEAD(&pool->free);

View File

@@ -1430,15 +1430,6 @@ err_irq:
arizona_irq_exit(arizona); arizona_irq_exit(arizona);
err_pm: err_pm:
pm_runtime_disable(arizona->dev); pm_runtime_disable(arizona->dev);
switch (arizona->pdata.clk32k_src) {
case ARIZONA_32KZ_MCLK1:
case ARIZONA_32KZ_MCLK2:
arizona_clk32k_disable(arizona);
break;
default:
break;
}
err_reset: err_reset:
arizona_enable_reset(arizona); arizona_enable_reset(arizona);
regulator_disable(arizona->dcvdd); regulator_disable(arizona->dcvdd);
@@ -1461,15 +1452,6 @@ int arizona_dev_exit(struct arizona *arizona)
regulator_disable(arizona->dcvdd); regulator_disable(arizona->dcvdd);
regulator_put(arizona->dcvdd); regulator_put(arizona->dcvdd);
switch (arizona->pdata.clk32k_src) {
case ARIZONA_32KZ_MCLK1:
case ARIZONA_32KZ_MCLK2:
arizona_clk32k_disable(arizona);
break;
default:
break;
}
mfd_remove_devices(arizona->dev); mfd_remove_devices(arizona->dev);
arizona_free_irq(arizona, ARIZONA_IRQ_UNDERCLOCKED, arizona); arizona_free_irq(arizona, ARIZONA_IRQ_UNDERCLOCKED, arizona);
arizona_free_irq(arizona, ARIZONA_IRQ_OVERCLOCKED, arizona); arizona_free_irq(arizona, ARIZONA_IRQ_OVERCLOCKED, arizona);

View File

@@ -287,11 +287,7 @@ static void dln2_rx(struct urb *urb)
len = urb->actual_length - sizeof(struct dln2_header); len = urb->actual_length - sizeof(struct dln2_header);
if (handle == DLN2_HANDLE_EVENT) { if (handle == DLN2_HANDLE_EVENT) {
unsigned long flags;
spin_lock_irqsave(&dln2->event_cb_lock, flags);
dln2_run_event_callbacks(dln2, id, echo, data, len); dln2_run_event_callbacks(dln2, id, echo, data, len);
spin_unlock_irqrestore(&dln2->event_cb_lock, flags);
} else { } else {
/* URB will be re-submitted in _dln2_transfer (free_rx_slot) */ /* URB will be re-submitted in _dln2_transfer (free_rx_slot) */
if (dln2_transfer_complete(dln2, urb, handle, echo)) if (dln2_transfer_complete(dln2, urb, handle, echo))

View File

@@ -229,12 +229,15 @@ static void renesas_sdhi_internal_dmac_issue_tasklet_fn(unsigned long arg)
DTRAN_CTRL_DM_START); DTRAN_CTRL_DM_START);
} }
static bool renesas_sdhi_internal_dmac_complete(struct tmio_mmc_host *host) static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg)
{ {
struct tmio_mmc_host *host = (struct tmio_mmc_host *)arg;
enum dma_data_direction dir; enum dma_data_direction dir;
spin_lock_irq(&host->lock);
if (!host->data) if (!host->data)
return false; goto out;
if (host->data->flags & MMC_DATA_READ) if (host->data->flags & MMC_DATA_READ)
dir = DMA_FROM_DEVICE; dir = DMA_FROM_DEVICE;
@@ -247,17 +250,6 @@ static bool renesas_sdhi_internal_dmac_complete(struct tmio_mmc_host *host)
if (dir == DMA_FROM_DEVICE) if (dir == DMA_FROM_DEVICE)
clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags); clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags);
return true;
}
static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg)
{
struct tmio_mmc_host *host = (struct tmio_mmc_host *)arg;
spin_lock_irq(&host->lock);
if (!renesas_sdhi_internal_dmac_complete(host))
goto out;
tmio_mmc_do_data_irq(host); tmio_mmc_do_data_irq(host);
out: out:
spin_unlock_irq(&host->lock); spin_unlock_irq(&host->lock);

View File

@@ -62,6 +62,7 @@ static int fun_chip_ready(struct nand_chip *chip)
static void fun_wait_rnb(struct fsl_upm_nand *fun) static void fun_wait_rnb(struct fsl_upm_nand *fun)
{ {
if (fun->rnb_gpio[fun->mchip_number] >= 0) { if (fun->rnb_gpio[fun->mchip_number] >= 0) {
struct mtd_info *mtd = nand_to_mtd(&fun->chip);
int cnt = 1000000; int cnt = 1000000;
while (--cnt && !fun_chip_ready(&fun->chip)) while (--cnt && !fun_chip_ready(&fun->chip))

View File

@@ -43,7 +43,7 @@ struct qmem {
void *base; void *base;
dma_addr_t iova; dma_addr_t iova;
int alloc_sz; int alloc_sz;
u16 entry_sz; u8 entry_sz;
u8 align; u8 align;
u32 qsize; u32 qsize;
}; };

View File

@@ -485,24 +485,13 @@ static int emac_clks_phase1_init(struct platform_device *pdev,
ret = clk_prepare_enable(adpt->clk[EMAC_CLK_CFG_AHB]); ret = clk_prepare_enable(adpt->clk[EMAC_CLK_CFG_AHB]);
if (ret) if (ret)
goto disable_clk_axi; return ret;
ret = clk_set_rate(adpt->clk[EMAC_CLK_HIGH_SPEED], 19200000); ret = clk_set_rate(adpt->clk[EMAC_CLK_HIGH_SPEED], 19200000);
if (ret) if (ret)
goto disable_clk_cfg_ahb;
ret = clk_prepare_enable(adpt->clk[EMAC_CLK_HIGH_SPEED]);
if (ret)
goto disable_clk_cfg_ahb;
return 0;
disable_clk_cfg_ahb:
clk_disable_unprepare(adpt->clk[EMAC_CLK_CFG_AHB]);
disable_clk_axi:
clk_disable_unprepare(adpt->clk[EMAC_CLK_AXI]);
return ret; return ret;
return clk_prepare_enable(adpt->clk[EMAC_CLK_HIGH_SPEED]);
} }
/* Enable clocks; needs emac_clks_phase1_init to be called before */ /* Enable clocks; needs emac_clks_phase1_init to be called before */

View File

@@ -350,7 +350,6 @@ static int ipq806x_gmac_probe(struct platform_device *pdev)
plat_dat->has_gmac = true; plat_dat->has_gmac = true;
plat_dat->bsp_priv = gmac; plat_dat->bsp_priv = gmac;
plat_dat->fix_mac_speed = ipq806x_gmac_fix_mac_speed; plat_dat->fix_mac_speed = ipq806x_gmac_fix_mac_speed;
plat_dat->multicast_filter_bins = 0;
err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
if (err) if (err)

View File

@@ -166,9 +166,6 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
value = GMAC_FRAME_FILTER_PR | GMAC_FRAME_FILTER_PCF; value = GMAC_FRAME_FILTER_PR | GMAC_FRAME_FILTER_PCF;
} else if (dev->flags & IFF_ALLMULTI) { } else if (dev->flags & IFF_ALLMULTI) {
value = GMAC_FRAME_FILTER_PM; /* pass all multi */ value = GMAC_FRAME_FILTER_PM; /* pass all multi */
} else if (!netdev_mc_empty(dev) && (mcbitslog2 == 0)) {
/* Fall back to all multicast if we've no filter */
value = GMAC_FRAME_FILTER_PM;
} else if (!netdev_mc_empty(dev)) { } else if (!netdev_mc_empty(dev)) {
struct netdev_hw_addr *ha; struct netdev_hw_addr *ha;

View File

@@ -450,19 +450,14 @@ void __nvdimm_security_overwrite_query(struct nvdimm *nvdimm)
else else
dev_dbg(&nvdimm->dev, "overwrite completed\n"); dev_dbg(&nvdimm->dev, "overwrite completed\n");
/* if (nvdimm->sec.overwrite_state)
* Mark the overwrite work done and update dimm security flags, sysfs_notify_dirent(nvdimm->sec.overwrite_state);
* then send a sysfs event notification to wake up userspace
* poll threads to picked up the changed state.
*/
nvdimm->sec.overwrite_tmo = 0; nvdimm->sec.overwrite_tmo = 0;
clear_bit(NDD_SECURITY_OVERWRITE, &nvdimm->flags); clear_bit(NDD_SECURITY_OVERWRITE, &nvdimm->flags);
clear_bit(NDD_WORK_PENDING, &nvdimm->flags); clear_bit(NDD_WORK_PENDING, &nvdimm->flags);
nvdimm->sec.flags = nvdimm_security_flags(nvdimm, NVDIMM_USER);
nvdimm->sec.ext_flags = nvdimm_security_flags(nvdimm, NVDIMM_MASTER);
if (nvdimm->sec.overwrite_state)
sysfs_notify_dirent(nvdimm->sec.overwrite_state);
put_device(&nvdimm->dev); put_device(&nvdimm->dev);
nvdimm->sec.flags = nvdimm_security_flags(nvdimm, NVDIMM_USER);
nvdimm->sec.flags = nvdimm_security_flags(nvdimm, NVDIMM_MASTER);
} }
void nvdimm_security_overwrite_query(struct work_struct *work) void nvdimm_security_overwrite_query(struct work_struct *work)

View File

@@ -322,8 +322,12 @@ void pci_bus_add_device(struct pci_dev *dev)
dev->match_driver = true; dev->match_driver = true;
retval = device_attach(&dev->dev); retval = device_attach(&dev->dev);
if (retval < 0 && retval != -EPROBE_DEFER) if (retval < 0 && retval != -EPROBE_DEFER) {
pci_warn(dev, "device attach failed (%d)\n", retval); pci_warn(dev, "device attach failed (%d)\n", retval);
pci_proc_detach_device(dev);
pci_remove_sysfs_dev_files(dev);
return;
}
pci_dev_assign_added(dev, true); pci_dev_assign_added(dev, true);
} }

View File

@@ -45,13 +45,7 @@
#define PCIE_CAP_CPL_TIMEOUT_DISABLE 0x10 #define PCIE_CAP_CPL_TIMEOUT_DISABLE 0x10
#define PCIE20_PARF_PHY_CTRL 0x40 #define PCIE20_PARF_PHY_CTRL 0x40
#define PHY_CTRL_PHY_TX0_TERM_OFFSET_MASK GENMASK(20, 16)
#define PHY_CTRL_PHY_TX0_TERM_OFFSET(x) ((x) << 16)
#define PCIE20_PARF_PHY_REFCLK 0x4C #define PCIE20_PARF_PHY_REFCLK 0x4C
#define PHY_REFCLK_SSP_EN BIT(16)
#define PHY_REFCLK_USE_PAD BIT(12)
#define PCIE20_PARF_DBI_BASE_ADDR 0x168 #define PCIE20_PARF_DBI_BASE_ADDR 0x168
#define PCIE20_PARF_SLV_ADDR_SPACE_SIZE 0x16C #define PCIE20_PARF_SLV_ADDR_SPACE_SIZE 0x16C
#define PCIE20_PARF_MHI_CLOCK_RESET_CTRL 0x174 #define PCIE20_PARF_MHI_CLOCK_RESET_CTRL 0x174
@@ -83,18 +77,6 @@
#define DBI_RO_WR_EN 1 #define DBI_RO_WR_EN 1
#define PERST_DELAY_US 1000 #define PERST_DELAY_US 1000
/* PARF registers */
#define PCIE20_PARF_PCS_DEEMPH 0x34
#define PCS_DEEMPH_TX_DEEMPH_GEN1(x) ((x) << 16)
#define PCS_DEEMPH_TX_DEEMPH_GEN2_3_5DB(x) ((x) << 8)
#define PCS_DEEMPH_TX_DEEMPH_GEN2_6DB(x) ((x) << 0)
#define PCIE20_PARF_PCS_SWING 0x38
#define PCS_SWING_TX_SWING_FULL(x) ((x) << 8)
#define PCS_SWING_TX_SWING_LOW(x) ((x) << 0)
#define PCIE20_PARF_CONFIG_BITS 0x50
#define PHY_RX0_EQ(x) ((x) << 24)
#define PCIE20_v3_PARF_SLV_ADDR_SPACE_SIZE 0x358 #define PCIE20_v3_PARF_SLV_ADDR_SPACE_SIZE 0x358
#define SLV_ADDR_SPACE_SZ 0x10000000 #define SLV_ADDR_SPACE_SZ 0x10000000
@@ -304,7 +286,6 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)
struct qcom_pcie_resources_2_1_0 *res = &pcie->res.v2_1_0; struct qcom_pcie_resources_2_1_0 *res = &pcie->res.v2_1_0;
struct dw_pcie *pci = pcie->pci; struct dw_pcie *pci = pcie->pci;
struct device *dev = pci->dev; struct device *dev = pci->dev;
struct device_node *node = dev->of_node;
u32 val; u32 val;
int ret; int ret;
@@ -349,29 +330,9 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)
val &= ~BIT(0); val &= ~BIT(0);
writel(val, pcie->parf + PCIE20_PARF_PHY_CTRL); writel(val, pcie->parf + PCIE20_PARF_PHY_CTRL);
if (of_device_is_compatible(node, "qcom,pcie-ipq8064")) {
writel(PCS_DEEMPH_TX_DEEMPH_GEN1(24) |
PCS_DEEMPH_TX_DEEMPH_GEN2_3_5DB(24) |
PCS_DEEMPH_TX_DEEMPH_GEN2_6DB(34),
pcie->parf + PCIE20_PARF_PCS_DEEMPH);
writel(PCS_SWING_TX_SWING_FULL(120) |
PCS_SWING_TX_SWING_LOW(120),
pcie->parf + PCIE20_PARF_PCS_SWING);
writel(PHY_RX0_EQ(4), pcie->parf + PCIE20_PARF_CONFIG_BITS);
}
if (of_device_is_compatible(node, "qcom,pcie-ipq8064")) {
/* set TX termination offset */
val = readl(pcie->parf + PCIE20_PARF_PHY_CTRL);
val &= ~PHY_CTRL_PHY_TX0_TERM_OFFSET_MASK;
val |= PHY_CTRL_PHY_TX0_TERM_OFFSET(7);
writel(val, pcie->parf + PCIE20_PARF_PHY_CTRL);
}
/* enable external reference clock */ /* enable external reference clock */
val = readl(pcie->parf + PCIE20_PARF_PHY_REFCLK); val = readl(pcie->parf + PCIE20_PARF_PHY_REFCLK);
val &= ~PHY_REFCLK_USE_PAD; val |= BIT(16);
val |= PHY_REFCLK_SSP_EN;
writel(val, pcie->parf + PCIE20_PARF_PHY_REFCLK); writel(val, pcie->parf + PCIE20_PARF_PHY_REFCLK);
ret = reset_control_deassert(res->phy_reset); ret = reset_control_deassert(res->phy_reset);

View File

@@ -122,21 +122,13 @@ static struct acpiphp_context *acpiphp_grab_context(struct acpi_device *adev)
struct acpiphp_context *context; struct acpiphp_context *context;
acpi_lock_hp_context(); acpi_lock_hp_context();
context = acpiphp_get_context(adev); context = acpiphp_get_context(adev);
if (!context) if (!context || context->func.parent->is_going_away) {
goto unlock; acpi_unlock_hp_context();
return NULL;
if (context->func.parent->is_going_away) {
acpiphp_put_context(context);
context = NULL;
goto unlock;
} }
get_bridge(context->func.parent); get_bridge(context->func.parent);
acpiphp_put_context(context); acpiphp_put_context(context);
unlock:
acpi_unlock_hp_context(); acpi_unlock_hp_context();
return context; return context;
} }

View File

@@ -5208,8 +5208,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, 0x0422, quirk_no_ext_tags);
*/ */
static void quirk_amd_harvest_no_ats(struct pci_dev *pdev) static void quirk_amd_harvest_no_ats(struct pci_dev *pdev)
{ {
if ((pdev->device == 0x7312 && pdev->revision != 0x00) || if (pdev->device == 0x7340 && pdev->revision != 0xc5)
(pdev->device == 0x7340 && pdev->revision != 0xc5))
return; return;
pci_info(pdev, "disabling ATS\n"); pci_info(pdev, "disabling ATS\n");
@@ -5220,8 +5219,6 @@ static void quirk_amd_harvest_no_ats(struct pci_dev *pdev)
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x98e4, quirk_amd_harvest_no_ats); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x98e4, quirk_amd_harvest_no_ats);
/* AMD Iceland dGPU */ /* AMD Iceland dGPU */
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x6900, quirk_amd_harvest_no_ats); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x6900, quirk_amd_harvest_no_ats);
/* AMD Navi10 dGPU */
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7312, quirk_amd_harvest_no_ats);
/* AMD Navi14 dGPU */ /* AMD Navi14 dGPU */
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7340, quirk_amd_harvest_no_ats); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7340, quirk_amd_harvest_no_ats);
#endif /* CONFIG_PCI_ATS */ #endif /* CONFIG_PCI_ATS */

View File

@@ -1500,9 +1500,9 @@ static void ingenic_gpio_irq_ack(struct irq_data *irqd)
*/ */
high = ingenic_gpio_get_value(jzgc, irq); high = ingenic_gpio_get_value(jzgc, irq);
if (high) if (high)
irq_set_type(jzgc, irq, IRQ_TYPE_LEVEL_LOW); irq_set_type(jzgc, irq, IRQ_TYPE_EDGE_FALLING);
else else
irq_set_type(jzgc, irq, IRQ_TYPE_LEVEL_HIGH); irq_set_type(jzgc, irq, IRQ_TYPE_EDGE_RISING);
} }
if (jzgc->jzpc->version >= ID_JZ4760) if (jzgc->jzpc->version >= ID_JZ4760)
@@ -1538,7 +1538,7 @@ static int ingenic_gpio_irq_set_type(struct irq_data *irqd, unsigned int type)
*/ */
bool high = ingenic_gpio_get_value(jzgc, irqd->hwirq); bool high = ingenic_gpio_get_value(jzgc, irqd->hwirq);
type = high ? IRQ_TYPE_LEVEL_LOW : IRQ_TYPE_LEVEL_HIGH; type = high ? IRQ_TYPE_EDGE_FALLING : IRQ_TYPE_EDGE_RISING;
} }
irq_set_type(jzgc, irqd->hwirq, type); irq_set_type(jzgc, irqd->hwirq, type);
@@ -1644,8 +1644,7 @@ static int ingenic_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
unsigned int pin = gc->base + offset; unsigned int pin = gc->base + offset;
if (jzpc->version >= ID_JZ4760) if (jzpc->version >= ID_JZ4760)
return ingenic_get_pin_config(jzpc, pin, JZ4760_GPIO_INT) || return ingenic_get_pin_config(jzpc, pin, JZ4760_GPIO_PAT1);
ingenic_get_pin_config(jzpc, pin, JZ4760_GPIO_PAT1);
if (ingenic_get_pin_config(jzpc, pin, JZ4740_GPIO_SELECT)) if (ingenic_get_pin_config(jzpc, pin, JZ4740_GPIO_SELECT))
return true; return true;

View File

@@ -645,10 +645,8 @@ static int cros_ec_ishtp_probe(struct ishtp_cl_device *cl_device)
/* Register croc_ec_dev mfd */ /* Register croc_ec_dev mfd */
rv = cros_ec_dev_init(client_data); rv = cros_ec_dev_init(client_data);
if (rv) { if (rv)
down_write(&init_lock);
goto end_cros_ec_dev_init_error; goto end_cros_ec_dev_init_error;
}
return 0; return 0;

View File

@@ -85,6 +85,8 @@ static void iproc_pwmc_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
u64 tmp, multi, rate; u64 tmp, multi, rate;
u32 value, prescale; u32 value, prescale;
rate = clk_get_rate(ip->clk);
value = readl(ip->base + IPROC_PWM_CTRL_OFFSET); value = readl(ip->base + IPROC_PWM_CTRL_OFFSET);
if (value & BIT(IPROC_PWM_CTRL_EN_SHIFT(pwm->hwpwm))) if (value & BIT(IPROC_PWM_CTRL_EN_SHIFT(pwm->hwpwm)))
@@ -97,13 +99,6 @@ static void iproc_pwmc_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
else else
state->polarity = PWM_POLARITY_INVERSED; state->polarity = PWM_POLARITY_INVERSED;
rate = clk_get_rate(ip->clk);
if (rate == 0) {
state->period = 0;
state->duty_cycle = 0;
return;
}
value = readl(ip->base + IPROC_PWM_PRESCALE_OFFSET); value = readl(ip->base + IPROC_PWM_PRESCALE_OFFSET);
prescale = value >> IPROC_PWM_PRESCALE_SHIFT(pwm->hwpwm); prescale = value >> IPROC_PWM_PRESCALE_SHIFT(pwm->hwpwm);
prescale &= IPROC_PWM_PRESCALE_MAX; prescale &= IPROC_PWM_PRESCALE_MAX;

View File

@@ -151,8 +151,6 @@ int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5)
{ {
int ret; int ret;
q6v5->running = false;
qcom_smem_state_update_bits(q6v5->state, qcom_smem_state_update_bits(q6v5->state,
BIT(q6v5->stop_bit), BIT(q6v5->stop_bit)); BIT(q6v5->stop_bit), BIT(q6v5->stop_bit));

View File

@@ -381,12 +381,6 @@ static int q6v5_load(struct rproc *rproc, const struct firmware *fw)
{ {
struct q6v5 *qproc = rproc->priv; struct q6v5 *qproc = rproc->priv;
/* MBA is restricted to a maximum size of 1M */
if (fw->size > qproc->mba_size || fw->size > SZ_1M) {
dev_err(qproc->dev, "MBA firmware load failed\n");
return -EINVAL;
}
memcpy(qproc->mba_region, fw->data, fw->size); memcpy(qproc->mba_region, fw->data, fw->size);
return 0; return 0;
@@ -1034,14 +1028,15 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
} else if (phdr->p_filesz) { } else if (phdr->p_filesz) {
/* Replace "xxx.xxx" with "xxx.bxx" */ /* Replace "xxx.xxx" with "xxx.bxx" */
sprintf(fw_name + fw_name_len - 3, "b%02d", i); sprintf(fw_name + fw_name_len - 3, "b%02d", i);
ret = request_firmware_into_buf(&seg_fw, fw_name, qproc->dev, ret = request_firmware(&seg_fw, fw_name, qproc->dev);
ptr, phdr->p_filesz);
if (ret) { if (ret) {
dev_err(qproc->dev, "failed to load %s\n", fw_name); dev_err(qproc->dev, "failed to load %s\n", fw_name);
iounmap(ptr); iounmap(ptr);
goto release_firmware; goto release_firmware;
} }
memcpy(ptr, seg_fw->data, seg_fw->size);
release_firmware(seg_fw); release_firmware(seg_fw);
} }

View File

@@ -1923,7 +1923,7 @@ lpfc_nvmet_destroy_targetport(struct lpfc_hba *phba)
} }
tgtp->tport_unreg_cmp = &tport_unreg_cmp; tgtp->tport_unreg_cmp = &tport_unreg_cmp;
nvmet_fc_unregister_targetport(phba->targetport); nvmet_fc_unregister_targetport(phba->targetport);
if (!wait_for_completion_timeout(&tport_unreg_cmp, if (!wait_for_completion_timeout(tgtp->tport_unreg_cmp,
msecs_to_jiffies(LPFC_NVMET_WAIT_TMO))) msecs_to_jiffies(LPFC_NVMET_WAIT_TMO)))
lpfc_printf_log(phba, KERN_ERR, LOG_NVME, lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
"6179 Unreg targetport x%px timeout " "6179 Unreg targetport x%px timeout "

View File

@@ -2480,11 +2480,12 @@ static int ftdi_prepare_write_buffer(struct usb_serial_port *port,
#define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE) #define FTDI_RS_ERR_MASK (FTDI_RS_BI | FTDI_RS_PE | FTDI_RS_FE | FTDI_RS_OE)
static int ftdi_process_packet(struct usb_serial_port *port, static int ftdi_process_packet(struct usb_serial_port *port,
struct ftdi_private *priv, unsigned char *buf, int len) struct ftdi_private *priv, char *packet, int len)
{ {
unsigned char status;
int i; int i;
char status;
char flag; char flag;
char *ch;
if (len < 2) { if (len < 2) {
dev_dbg(&port->dev, "malformed packet\n"); dev_dbg(&port->dev, "malformed packet\n");
@@ -2494,7 +2495,7 @@ static int ftdi_process_packet(struct usb_serial_port *port,
/* Compare new line status to the old one, signal if different/ /* Compare new line status to the old one, signal if different/
N.B. packet may be processed more than once, but differences N.B. packet may be processed more than once, but differences
are only processed once. */ are only processed once. */
status = buf[0] & FTDI_STATUS_B0_MASK; status = packet[0] & FTDI_STATUS_B0_MASK;
if (status != priv->prev_status) { if (status != priv->prev_status) {
char diff_status = status ^ priv->prev_status; char diff_status = status ^ priv->prev_status;
@@ -2520,12 +2521,13 @@ static int ftdi_process_packet(struct usb_serial_port *port,
} }
/* save if the transmitter is empty or not */ /* save if the transmitter is empty or not */
if (buf[1] & FTDI_RS_TEMT) if (packet[1] & FTDI_RS_TEMT)
priv->transmit_empty = 1; priv->transmit_empty = 1;
else else
priv->transmit_empty = 0; priv->transmit_empty = 0;
if (len == 2) len -= 2;
if (!len)
return 0; /* status only */ return 0; /* status only */
/* /*
@@ -2533,41 +2535,40 @@ static int ftdi_process_packet(struct usb_serial_port *port,
* data payload to avoid over-reporting. * data payload to avoid over-reporting.
*/ */
flag = TTY_NORMAL; flag = TTY_NORMAL;
if (buf[1] & FTDI_RS_ERR_MASK) { if (packet[1] & FTDI_RS_ERR_MASK) {
/* Break takes precedence over parity, which takes precedence /* Break takes precedence over parity, which takes precedence
* over framing errors */ * over framing errors */
if (buf[1] & FTDI_RS_BI) { if (packet[1] & FTDI_RS_BI) {
flag = TTY_BREAK; flag = TTY_BREAK;
port->icount.brk++; port->icount.brk++;
usb_serial_handle_break(port); usb_serial_handle_break(port);
} else if (buf[1] & FTDI_RS_PE) { } else if (packet[1] & FTDI_RS_PE) {
flag = TTY_PARITY; flag = TTY_PARITY;
port->icount.parity++; port->icount.parity++;
} else if (buf[1] & FTDI_RS_FE) { } else if (packet[1] & FTDI_RS_FE) {
flag = TTY_FRAME; flag = TTY_FRAME;
port->icount.frame++; port->icount.frame++;
} }
/* Overrun is special, not associated with a char */ /* Overrun is special, not associated with a char */
if (buf[1] & FTDI_RS_OE) { if (packet[1] & FTDI_RS_OE) {
port->icount.overrun++; port->icount.overrun++;
tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
} }
} }
port->icount.rx += len - 2; port->icount.rx += len;
ch = packet + 2;
if (port->port.console && port->sysrq) { if (port->port.console && port->sysrq) {
for (i = 2; i < len; i++) { for (i = 0; i < len; i++, ch++) {
if (usb_serial_handle_sysrq_char(port, buf[i])) if (!usb_serial_handle_sysrq_char(port, *ch))
continue; tty_insert_flip_char(&port->port, *ch, flag);
tty_insert_flip_char(&port->port, buf[i], flag);
} }
} else { } else {
tty_insert_flip_string_fixed_flag(&port->port, buf + 2, flag, tty_insert_flip_string_fixed_flag(&port->port, ch, flag, len);
len - 2);
} }
return len - 2; return len;
} }
static void ftdi_process_read_urb(struct urb *urb) static void ftdi_process_read_urb(struct urb *urb)

View File

@@ -689,9 +689,9 @@ static int __init watchdog_init(int sioaddr)
* into the module have been registered yet. * into the module have been registered yet.
*/ */
watchdog.sioaddr = sioaddr; watchdog.sioaddr = sioaddr;
watchdog.ident.options = WDIOF_MAGICCLOSE watchdog.ident.options = WDIOC_SETTIMEOUT
| WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE
| WDIOF_CARDRESET; | WDIOF_KEEPALIVEPING;
snprintf(watchdog.ident.identity, snprintf(watchdog.ident.identity,
sizeof(watchdog.ident.identity), "%s watchdog", sizeof(watchdog.ident.identity), "%s watchdog",
@@ -705,13 +705,6 @@ static int __init watchdog_init(int sioaddr)
wdt_conf = superio_inb(sioaddr, F71808FG_REG_WDT_CONF); wdt_conf = superio_inb(sioaddr, F71808FG_REG_WDT_CONF);
watchdog.caused_reboot = wdt_conf & BIT(F71808FG_FLAG_WDTMOUT_STS); watchdog.caused_reboot = wdt_conf & BIT(F71808FG_FLAG_WDTMOUT_STS);
/*
* We don't want WDTMOUT_STS to stick around till regular reboot.
* Write 1 to the bit to clear it to zero.
*/
superio_outb(sioaddr, F71808FG_REG_WDT_CONF,
wdt_conf | BIT(F71808FG_FLAG_WDTMOUT_STS));
superio_exit(sioaddr); superio_exit(sioaddr);
err = watchdog_set_timeout(timeout); err = watchdog_set_timeout(timeout);

View File

@@ -974,15 +974,6 @@ static int watchdog_cdev_register(struct watchdog_device *wdd)
if (IS_ERR_OR_NULL(watchdog_kworker)) if (IS_ERR_OR_NULL(watchdog_kworker))
return -ENODEV; return -ENODEV;
device_initialize(&wd_data->dev);
wd_data->dev.devt = MKDEV(MAJOR(watchdog_devt), wdd->id);
wd_data->dev.class = &watchdog_class;
wd_data->dev.parent = wdd->parent;
wd_data->dev.groups = wdd->groups;
wd_data->dev.release = watchdog_core_data_release;
dev_set_drvdata(&wd_data->dev, wdd);
dev_set_name(&wd_data->dev, "watchdog%d", wdd->id);
kthread_init_work(&wd_data->work, watchdog_ping_work); kthread_init_work(&wd_data->work, watchdog_ping_work);
hrtimer_init(&wd_data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); hrtimer_init(&wd_data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
wd_data->timer.function = watchdog_timer_expired; wd_data->timer.function = watchdog_timer_expired;
@@ -1003,6 +994,15 @@ static int watchdog_cdev_register(struct watchdog_device *wdd)
} }
} }
device_initialize(&wd_data->dev);
wd_data->dev.devt = MKDEV(MAJOR(watchdog_devt), wdd->id);
wd_data->dev.class = &watchdog_class;
wd_data->dev.parent = wdd->parent;
wd_data->dev.groups = wdd->groups;
wd_data->dev.release = watchdog_core_data_release;
dev_set_drvdata(&wd_data->dev, wdd);
dev_set_name(&wd_data->dev, "watchdog%d", wdd->id);
/* Fill in the data structures */ /* Fill in the data structures */
cdev_init(&wd_data->cdev, &watchdog_fops); cdev_init(&wd_data->cdev, &watchdog_fops);

View File

@@ -990,10 +990,8 @@ struct btrfs_root {
wait_queue_head_t log_writer_wait; wait_queue_head_t log_writer_wait;
wait_queue_head_t log_commit_wait[2]; wait_queue_head_t log_commit_wait[2];
struct list_head log_ctxs[2]; struct list_head log_ctxs[2];
/* Used only for log trees of subvolumes, not for the log root tree */
atomic_t log_writers; atomic_t log_writers;
atomic_t log_commit[2]; atomic_t log_commit[2];
/* Used only for log trees of subvolumes, not for the log root tree */
atomic_t log_batch; atomic_t log_batch;
int log_transid; int log_transid;
/* No matter the commit succeeds or not*/ /* No matter the commit succeeds or not*/
@@ -3166,7 +3164,7 @@ do { \
/* Report first abort since mount */ \ /* Report first abort since mount */ \
if (!test_and_set_bit(BTRFS_FS_STATE_TRANS_ABORTED, \ if (!test_and_set_bit(BTRFS_FS_STATE_TRANS_ABORTED, \
&((trans)->fs_info->fs_state))) { \ &((trans)->fs_info->fs_state))) { \
if ((errno) != -EIO && (errno) != -EROFS) { \ if ((errno) != -EIO) { \
WARN(1, KERN_DEBUG \ WARN(1, KERN_DEBUG \
"BTRFS: Transaction aborted (error %d)\n", \ "BTRFS: Transaction aborted (error %d)\n", \
(errno)); \ (errno)); \

View File

@@ -1475,16 +1475,9 @@ int btrfs_init_fs_root(struct btrfs_root *root)
spin_lock_init(&root->ino_cache_lock); spin_lock_init(&root->ino_cache_lock);
init_waitqueue_head(&root->ino_cache_wait); init_waitqueue_head(&root->ino_cache_wait);
/*
* Don't assign anonymous block device to roots that are not exposed to
* userspace, the id pool is limited to 1M
*/
if (is_fstree(root->root_key.objectid) &&
btrfs_root_refs(&root->root_item) > 0) {
ret = get_anon_bdev(&root->anon_dev); ret = get_anon_bdev(&root->anon_dev);
if (ret) if (ret)
goto fail; goto fail;
}
mutex_lock(&root->objectid_mutex); mutex_lock(&root->objectid_mutex);
ret = btrfs_find_highest_objectid(root, ret = btrfs_find_highest_objectid(root,

View File

@@ -5221,13 +5221,6 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
goto out; goto out;
} }
/*
* Use join to avoid potential EINTR from transaction start. See
* wait_reserve_ticket and the whole reservation callchain.
*/
if (for_reloc)
trans = btrfs_join_transaction(tree_root);
else
trans = btrfs_start_transaction(tree_root, 0); trans = btrfs_start_transaction(tree_root, 0);
if (IS_ERR(trans)) { if (IS_ERR(trans)) {
err = PTR_ERR(trans); err = PTR_ERR(trans);

View File

@@ -4467,25 +4467,15 @@ int try_release_extent_mapping(struct page *page, gfp_t mask)
free_extent_map(em); free_extent_map(em);
break; break;
} }
if (test_range_bit(tree, em->start, if (!test_range_bit(tree, em->start,
extent_map_end(em) - 1, extent_map_end(em) - 1,
EXTENT_LOCKED, 0, NULL)) EXTENT_LOCKED, 0, NULL)) {
goto next;
/*
* If it's not in the list of modified extents, used
* by a fast fsync, we can remove it. If it's being
* logged we can safely remove it since fsync took an
* extra reference on the em.
*/
if (list_empty(&em->list) ||
test_bit(EXTENT_FLAG_LOGGING, &em->flags)) {
set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, set_bit(BTRFS_INODE_NEEDS_FULL_SYNC,
&btrfs_inode->runtime_flags); &btrfs_inode->runtime_flags);
remove_extent_mapping(map, em); remove_extent_mapping(map, em);
/* once for the rb tree */ /* once for the rb tree */
free_extent_map(em); free_extent_map(em);
} }
next:
start = extent_map_end(em); start = extent_map_end(em);
write_unlock(&map->lock); write_unlock(&map->lock);

View File

@@ -2166,7 +2166,7 @@ out:
static bool try_merge_free_space(struct btrfs_free_space_ctl *ctl, static bool try_merge_free_space(struct btrfs_free_space_ctl *ctl,
struct btrfs_free_space *info, bool update_stat) struct btrfs_free_space *info, bool update_stat)
{ {
struct btrfs_free_space *left_info = NULL; struct btrfs_free_space *left_info;
struct btrfs_free_space *right_info; struct btrfs_free_space *right_info;
bool merged = false; bool merged = false;
u64 offset = info->offset; u64 offset = info->offset;
@@ -2181,7 +2181,7 @@ static bool try_merge_free_space(struct btrfs_free_space_ctl *ctl,
if (right_info && rb_prev(&right_info->offset_index)) if (right_info && rb_prev(&right_info->offset_index))
left_info = rb_entry(rb_prev(&right_info->offset_index), left_info = rb_entry(rb_prev(&right_info->offset_index),
struct btrfs_free_space, offset_index); struct btrfs_free_space, offset_index);
else if (!right_info) else
left_info = tree_search_offset(ctl, offset - 1, 0, 0); left_info = tree_search_offset(ctl, offset - 1, 0, 0);
if (right_info && !right_info->bitmap) { if (right_info && !right_info->bitmap) {

View File

@@ -641,18 +641,12 @@ cont:
page_error_op | page_error_op |
PAGE_END_WRITEBACK); PAGE_END_WRITEBACK);
/*
* Ensure we only free the compressed pages if we have
* them allocated, as we can still reach here with
* inode_need_compress() == false.
*/
if (pages) {
for (i = 0; i < nr_pages; i++) { for (i = 0; i < nr_pages; i++) {
WARN_ON(pages[i]->mapping); WARN_ON(pages[i]->mapping);
put_page(pages[i]); put_page(pages[i]);
} }
kfree(pages); kfree(pages);
}
return 0; return 0;
} }
} }
@@ -4687,8 +4681,6 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry)
} }
} }
free_anon_bdev(dest->anon_dev);
dest->anon_dev = 0;
out_end_trans: out_end_trans:
trans->block_rsv = NULL; trans->block_rsv = NULL;
trans->bytes_reserved = 0; trans->bytes_reserved = 0;
@@ -7194,7 +7186,7 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
extent_type == BTRFS_FILE_EXTENT_PREALLOC) { extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
/* Only regular file could have regular/prealloc extent */ /* Only regular file could have regular/prealloc extent */
if (!S_ISREG(inode->vfs_inode.i_mode)) { if (!S_ISREG(inode->vfs_inode.i_mode)) {
err = -EUCLEAN; ret = -EUCLEAN;
btrfs_crit(fs_info, btrfs_crit(fs_info,
"regular/prealloc extent found for non-regular inode %llu", "regular/prealloc extent found for non-regular inode %llu",
btrfs_ino(inode)); btrfs_ino(inode));

View File

@@ -167,11 +167,8 @@ static int btrfs_ioctl_getflags(struct file *file, void __user *arg)
return 0; return 0;
} }
/* /* Check if @flags are a supported and valid set of FS_*_FL flags */
* Check if @flags are a supported and valid set of FS_*_FL flags and that static int check_fsflags(unsigned int flags)
* the old and new flags are not conflicting
*/
static int check_fsflags(unsigned int old_flags, unsigned int flags)
{ {
if (flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | \ if (flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | \
FS_NOATIME_FL | FS_NODUMP_FL | \ FS_NOATIME_FL | FS_NODUMP_FL | \
@@ -180,19 +177,9 @@ static int check_fsflags(unsigned int old_flags, unsigned int flags)
FS_NOCOW_FL)) FS_NOCOW_FL))
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* COMPR and NOCOMP on new/old are valid */
if ((flags & FS_NOCOMP_FL) && (flags & FS_COMPR_FL)) if ((flags & FS_NOCOMP_FL) && (flags & FS_COMPR_FL))
return -EINVAL; return -EINVAL;
if ((flags & FS_COMPR_FL) && (flags & FS_NOCOW_FL))
return -EINVAL;
/* NOCOW and compression options are mutually exclusive */
if ((old_flags & FS_NOCOW_FL) && (flags & (FS_COMPR_FL | FS_NOCOMP_FL)))
return -EINVAL;
if ((flags & FS_NOCOW_FL) && (old_flags & (FS_COMPR_FL | FS_NOCOMP_FL)))
return -EINVAL;
return 0; return 0;
} }
@@ -206,7 +193,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
unsigned int fsflags, old_fsflags; unsigned int fsflags, old_fsflags;
int ret; int ret;
const char *comp = NULL; const char *comp = NULL;
u32 binode_flags; u32 binode_flags = binode->flags;
if (!inode_owner_or_capable(inode)) if (!inode_owner_or_capable(inode))
return -EPERM; return -EPERM;
@@ -217,23 +204,22 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
if (copy_from_user(&fsflags, arg, sizeof(fsflags))) if (copy_from_user(&fsflags, arg, sizeof(fsflags)))
return -EFAULT; return -EFAULT;
ret = check_fsflags(fsflags);
if (ret)
return ret;
ret = mnt_want_write_file(file); ret = mnt_want_write_file(file);
if (ret) if (ret)
return ret; return ret;
inode_lock(inode); inode_lock(inode);
fsflags = btrfs_mask_fsflags_for_type(inode, fsflags); fsflags = btrfs_mask_fsflags_for_type(inode, fsflags);
old_fsflags = btrfs_inode_flags_to_fsflags(binode->flags); old_fsflags = btrfs_inode_flags_to_fsflags(binode->flags);
ret = vfs_ioc_setflags_prepare(inode, old_fsflags, fsflags); ret = vfs_ioc_setflags_prepare(inode, old_fsflags, fsflags);
if (ret) if (ret)
goto out_unlock; goto out_unlock;
ret = check_fsflags(old_fsflags, fsflags);
if (ret)
goto out_unlock;
binode_flags = binode->flags;
if (fsflags & FS_SYNC_FL) if (fsflags & FS_SYNC_FL)
binode_flags |= BTRFS_INODE_SYNC; binode_flags |= BTRFS_INODE_SYNC;
else else

View File

@@ -286,8 +286,6 @@ static struct block_entry *add_block_entry(struct btrfs_fs_info *fs_info,
exist_re = insert_root_entry(&exist->roots, re); exist_re = insert_root_entry(&exist->roots, re);
if (exist_re) if (exist_re)
kfree(re); kfree(re);
} else {
kfree(re);
} }
kfree(be); kfree(be);
return exist; return exist;

View File

@@ -2312,20 +2312,12 @@ static noinline_for_stack int merge_reloc_root(struct reloc_control *rc,
btrfs_unlock_up_safe(path, 0); btrfs_unlock_up_safe(path, 0);
} }
/* min_reserved = fs_info->nodesize * (BTRFS_MAX_LEVEL - 1) * 2;
* In merge_reloc_root(), we modify the upper level pointer to swap the
* tree blocks between reloc tree and subvolume tree. Thus for tree
* block COW, we COW at most from level 1 to root level for each tree.
*
* Thus the needed metadata size is at most root_level * nodesize,
* and * 2 since we have two trees to COW.
*/
min_reserved = fs_info->nodesize * btrfs_root_level(root_item) * 2;
memset(&next_key, 0, sizeof(next_key)); memset(&next_key, 0, sizeof(next_key));
while (1) { while (1) {
ret = btrfs_block_rsv_refill(root, rc->block_rsv, min_reserved, ret = btrfs_block_rsv_refill(root, rc->block_rsv, min_reserved,
BTRFS_RESERVE_FLUSH_LIMIT); BTRFS_RESERVE_FLUSH_ALL);
if (ret) { if (ret) {
err = ret; err = ret;
goto out; goto out;

View File

@@ -435,7 +435,6 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
char *compress_type; char *compress_type;
bool compress_force = false; bool compress_force = false;
enum btrfs_compression_type saved_compress_type; enum btrfs_compression_type saved_compress_type;
int saved_compress_level;
bool saved_compress_force; bool saved_compress_force;
int no_compress = 0; int no_compress = 0;
@@ -518,7 +517,6 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
info->compress_type : BTRFS_COMPRESS_NONE; info->compress_type : BTRFS_COMPRESS_NONE;
saved_compress_force = saved_compress_force =
btrfs_test_opt(info, FORCE_COMPRESS); btrfs_test_opt(info, FORCE_COMPRESS);
saved_compress_level = info->compress_level;
if (token == Opt_compress || if (token == Opt_compress ||
token == Opt_compress_force || token == Opt_compress_force ||
strncmp(args[0].from, "zlib", 4) == 0) { strncmp(args[0].from, "zlib", 4) == 0) {
@@ -563,8 +561,6 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
no_compress = 0; no_compress = 0;
} else if (strncmp(args[0].from, "no", 2) == 0) { } else if (strncmp(args[0].from, "no", 2) == 0) {
compress_type = "no"; compress_type = "no";
info->compress_level = 0;
info->compress_type = 0;
btrfs_clear_opt(info->mount_opt, COMPRESS); btrfs_clear_opt(info->mount_opt, COMPRESS);
btrfs_clear_opt(info->mount_opt, FORCE_COMPRESS); btrfs_clear_opt(info->mount_opt, FORCE_COMPRESS);
compress_force = false; compress_force = false;
@@ -585,11 +581,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
*/ */
btrfs_clear_opt(info->mount_opt, FORCE_COMPRESS); btrfs_clear_opt(info->mount_opt, FORCE_COMPRESS);
} }
if (no_compress == 1) { if ((btrfs_test_opt(info, COMPRESS) &&
btrfs_info(info, "use no compression"); (info->compress_type != saved_compress_type ||
} else if ((info->compress_type != saved_compress_type) || compress_force != saved_compress_force)) ||
(compress_force != saved_compress_force) || (!btrfs_test_opt(info, COMPRESS) &&
(info->compress_level != saved_compress_level)) { no_compress == 1)) {
btrfs_info(info, "%s %s compression, level %d", btrfs_info(info, "%s %s compression, level %d",
(compress_force) ? "force" : "use", (compress_force) ? "force" : "use",
compress_type, info->compress_level); compress_type, info->compress_level);
@@ -1852,12 +1848,6 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
set_bit(BTRFS_FS_OPEN, &fs_info->flags); set_bit(BTRFS_FS_OPEN, &fs_info->flags);
} }
out: out:
/*
* We need to set SB_I_VERSION here otherwise it'll get cleared by VFS,
* since the absence of the flag means it can be toggled off by remount.
*/
*flags |= SB_I_VERSION;
wake_up_process(fs_info->transaction_kthread); wake_up_process(fs_info->transaction_kthread);
btrfs_remount_cleanup(fs_info, old_opts); btrfs_remount_cleanup(fs_info, old_opts);
return 0; return 0;
@@ -2264,7 +2254,9 @@ static int btrfs_unfreeze(struct super_block *sb)
static int btrfs_show_devname(struct seq_file *m, struct dentry *root) static int btrfs_show_devname(struct seq_file *m, struct dentry *root)
{ {
struct btrfs_fs_info *fs_info = btrfs_sb(root->d_sb); struct btrfs_fs_info *fs_info = btrfs_sb(root->d_sb);
struct btrfs_fs_devices *cur_devices;
struct btrfs_device *dev, *first_dev = NULL; struct btrfs_device *dev, *first_dev = NULL;
struct list_head *head;
/* /*
* Lightweight locking of the devices. We should not need * Lightweight locking of the devices. We should not need
@@ -2274,7 +2266,10 @@ static int btrfs_show_devname(struct seq_file *m, struct dentry *root)
* least until the rcu_read_unlock. * least until the rcu_read_unlock.
*/ */
rcu_read_lock(); rcu_read_lock();
list_for_each_entry_rcu(dev, &fs_info->fs_devices->devices, dev_list) { cur_devices = fs_info->fs_devices;
while (cur_devices) {
head = &cur_devices->devices;
list_for_each_entry_rcu(dev, head, dev_list) {
if (test_bit(BTRFS_DEV_STATE_MISSING, &dev->dev_state)) if (test_bit(BTRFS_DEV_STATE_MISSING, &dev->dev_state))
continue; continue;
if (!dev->name) if (!dev->name)
@@ -2282,6 +2277,8 @@ static int btrfs_show_devname(struct seq_file *m, struct dentry *root)
if (!first_dev || dev->devid < first_dev->devid) if (!first_dev || dev->devid < first_dev->devid)
first_dev = dev; first_dev = dev;
} }
cur_devices = cur_devices->seed;
}
if (first_dev) if (first_dev)
seq_escape(m, rcu_str_deref(first_dev->name), " \t\n\\"); seq_escape(m, rcu_str_deref(first_dev->name), " \t\n\\");

View File

@@ -975,9 +975,7 @@ int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices,
{ {
int error = 0; int error = 0;
struct btrfs_device *dev; struct btrfs_device *dev;
unsigned int nofs_flag;
nofs_flag = memalloc_nofs_save();
list_for_each_entry(dev, &fs_devices->devices, dev_list) { list_for_each_entry(dev, &fs_devices->devices, dev_list) {
struct hd_struct *disk; struct hd_struct *disk;
struct kobject *disk_kobj; struct kobject *disk_kobj;
@@ -996,7 +994,6 @@ int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices,
if (error) if (error)
break; break;
} }
memalloc_nofs_restore(nofs_flag);
return error; return error;
} }

Some files were not shown because too many files have changed in this diff Show More