Merge 5.10.225 into android12-5.10-lts
Changes in 5.10.225 fuse: Initialize beyond-EOF page contents before setting uptodate ALSA: usb-audio: Support Yamaha P-125 quirk entry xhci: Fix Panther point NULL pointer deref at full-speed re-enumeration thunderbolt: Mark XDomain as unplugged when router is removed s390/dasd: fix error recovery leading to data corruption on ESE devices arm64: ACPI: NUMA: initialize all values of acpi_early_node_map to NUMA_NO_NODE dm resume: don't return EINVAL when signalled dm persistent data: fix memory allocation failure vfs: Don't evict inode under the inode lru traversing context bitmap: introduce generic optimized bitmap_size() fix bitmap corruption on close_range() with CLOSE_RANGE_UNSHARE selinux: fix potential counting error in avc_add_xperms_decision() btrfs: tree-checker: add dev extent item checks drm/amdgpu: Actually check flags for all context ops. memcg_write_event_control(): fix a user-triggerable oops drm/amdgpu/jpeg2: properly set atomics vmid field s390/cio: rename bitmap_size() -> idset_bitmap_size() btrfs: rename bitmap_set_bits() -> btrfs_bitmap_set_bits() s390/uv: Panic for set and remove shared access UVC errors net/mlx5e: Correctly report errors for ethtool rx flows atm: idt77252: prevent use after free in dequeue_rx() net: axienet: Fix register defines comment description net: dsa: vsc73xx: pass value in phy_write operation net: dsa: vsc73xx: use read_poll_timeout instead delay loop net: dsa: vsc73xx: check busy flag in MDIO operations mptcp: correct MPTCP_SUBFLOW_ATTR_SSN_OFFSET reserved size netfilter: flowtable: initialise extack before use net: hns3: fix wrong use of semaphore up net: hns3: fix a deadlock problem when config TC during resetting ALSA: hda/realtek: Fix noise from speakers on Lenovo IdeaPad 3 15IAU7 ssb: Fix division by zero issue in ssb_calc_clock_rate wifi: mac80211: fix BA session teardown race wifi: cw1200: Avoid processing an invalid TIM IE i2c: riic: avoid potential division by zero RDMA/rtrs: Fix the problem of variable not initialized fully s390/smp,mcck: fix early IPI handling media: radio-isa: use dev_name to fill in bus_info staging: iio: resolver: ad2s1210: fix use before initialization drm/amd/display: Validate hw_points_num before using it staging: ks7010: disable bh on tx_dev_lock binfmt_misc: cleanup on filesystem umount media: qcom: venus: fix incorrect return value scsi: spi: Fix sshdr use gfs2: setattr_chown: Add missing initialization wifi: iwlwifi: abort scan when rfkill on but device enabled IB/hfi1: Fix potential deadlock on &irq_src_lock and &dd->uctxt_lock powerpc/xics: Check return value of kasprintf in icp_native_map_one_cpu nvmet-trace: avoid dereferencing pointer too early ext4: do not trim the group with corrupted block bitmap quota: Remove BUG_ON from dqget() media: pci: cx23885: check cx23885_vdev_init() return fs: binfmt_elf_efpic: don't use missing interpreter's properties scsi: lpfc: Initialize status local variable in lpfc_sli4_repost_sgl_list() net/sun3_82586: Avoid reading past buffer in debug output drm/lima: set gp bus_stop bit before hard reset virtiofs: forbid newlines in tags netlink: hold nlk->cb_mutex longer in __netlink_dump_start() md: clean up invalid BUG_ON in md_ioctl x86: Increase brk randomness entropy for 64-bit systems memory: stm32-fmc2-ebi: check regmap_read return value parisc: Use irq_enter_rcu() to fix warning at kernel/context_tracking.c:367 powerpc/boot: Handle allocation failure in simple_realloc() powerpc/boot: Only free if realloc() succeeds btrfs: change BUG_ON to assertion when checking for delayed_node root btrfs: handle invalid root reference found in may_destroy_subvol() btrfs: send: handle unexpected data in header buffer in begin_cmd() btrfs: delete pointless BUG_ON check on quota root in btrfs_qgroup_account_extent() f2fs: fix to do sanity check in update_sit_entry usb: gadget: fsl: Increase size of name buffer for endpoints Bluetooth: bnep: Fix out-of-bound access net: hns3: add checking for vf id of mailbox nvmet-tcp: do not continue for invalid icreq NFS: avoid infinite loop in pnfs_update_layout. openrisc: Call setup_memory() earlier in the init sequence s390/iucv: fix receive buffer virtual vs physical address confusion usb: dwc3: core: Skip setting event buffers for host only controllers irqchip/gic-v3-its: Remove BUG_ON in its_vpe_irq_domain_alloc ext4: set the type of max_zeroout to unsigned int to avoid overflow nvmet-rdma: fix possible bad dereference when freeing rsps hrtimer: Prevent queuing of hrtimer without a function callback gtp: pull network headers in gtp_dev_xmit() block: use "unsigned long" for blk_validate_block_size(). media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) dm suspend: return -ERESTARTSYS instead of -EINTR Bluetooth: hci_core: Fix LE quote calculation Bluetooth: SMP: Fix assumption of Central always being Initiator tc-testing: don't access non-existent variable on exception kcm: Serialise kcm_sendmsg() for the same socket. netfilter: nft_counter: Synchronize nft_counter_reset() against reader. ip6_tunnel: Fix broken GRO bonding: fix bond_ipsec_offload_ok return type bonding: fix null pointer deref in bond_ipsec_offload_ok bonding: fix xfrm real_dev null pointer dereference bonding: fix xfrm state handling when clearing active slave ice: fix ICE_LAST_OFFSET formula net: dsa: mv88e6xxx: read FID when handling ATU violations net: dsa: mv88e6xxx: replace ATU violation prints with trace points net: dsa: mv88e6xxx: Fix out-of-bound access netem: fix return value if duplicate enqueue fails ipv6: prevent UAF in ip6_send_skb() net: xilinx: axienet: Always disable promiscuous mode net: xilinx: axienet: Fix dangling multicast addresses drm/msm/dpu: don't play tricks with debug macros drm/msm/dp: reset the link phy params before link training mmc: mmc_test: Fix NULL dereference on allocation failure Bluetooth: MGMT: Add error handling to pair_device() binfmt_misc: pass binfmt_misc flags to the interpreter MIPS: Loongson64: Set timer mode in cpu-probe HID: wacom: Defer calculation of resolution until resolution_code is known HID: microsoft: Add rumble support to latest xbox controllers cxgb4: add forgotten u64 ivlan cast before shift KVM: arm64: Make ICC_*SGI*_EL1 undef in the absence of a vGICv3 mmc: dw_mmc: allow biu and ciu clocks to defer Revert "drm/amd/display: Validate hw_points_num before using it" ALSA: timer: Relax start tick time check for slave timer elements nfsd: Don't call freezable_schedule_timeout() after each successful page allocation in svc_alloc_arg(). Bluetooth: hci_ldisc: check HCI_UART_PROTO_READY flag in HCIUARTGETPROTO Input: MT - limit max slots tools: move alignment-related macros to new <linux/align.h> drm/amdgpu: Using uninitialized value *size when calling amdgpu_vce_cs_reloc KVM: arm64: Don't use cbz/adr with external symbols pinctrl: rockchip: correct RK3328 iomux width flag for GPIO2-B pins pinctrl: single: fix potential NULL dereference in pcs_get_function() wifi: mwifiex: duplicate static structs used in driver instances mptcp: sched: check both backup in retrans ipc: replace costly bailout check in sysvipc_find_ipc() drm/amdkfd: don't allow mapping the MMIO HDP page with large pages media: uvcvideo: Fix integer overflow calculating timestamp Revert "Input: ioc3kbd - convert to platform remove callback returning void" ata: libata-core: Fix null pointer dereference on error cgroup/cpuset: Prevent UAF in proc_cpuset_show() net:rds: Fix possible deadlock in rds_message_put ovl: do not fail because of O_NOATIME soundwire: stream: fix programming slave ports for non-continous port maps dmaengine: dw: Add peripheral bus width verification dmaengine: dw: Add memory bus width verification ethtool: check device is present when getting link settings gtp: fix a potential NULL pointer dereference net: busy-poll: use ktime_get_ns() instead of local_clock() nfc: pn533: Add poll mod list filling check soc: qcom: cmd-db: Map shared memory as WC, not WB cdc-acm: Add DISABLE_ECHO quirk for GE HealthCare UI Controller USB: serial: option: add MeiG Smart SRM825L usb: dwc3: omap: add missing depopulate in probe error path usb: dwc3: core: Prevent USB core invalid event buffer address access usb: dwc3: st: fix probed platform device ref count on probe error path usb: dwc3: st: add missing depopulate in probe error path usb: core: sysfs: Unmerge @usb3_hardware_lpm_attr_group in remove_power_attributes() scsi: aacraid: Fix double-free on probe failure apparmor: fix policy_unpack_test on big endian systems Linux 5.10.225 Change-Id: I5028ef07db680262d45fba4096094fe8b19dd052 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
4951c68022
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 10
|
||||
SUBLEVEL = 224
|
||||
SUBLEVEL = 225
|
||||
EXTRAVERSION =
|
||||
NAME = Dare mighty things
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
#include <asm/numa.h>
|
||||
|
||||
static int acpi_early_node_map[NR_CPUS] __initdata = { NUMA_NO_NODE };
|
||||
static int acpi_early_node_map[NR_CPUS] __initdata = { [0 ... NR_CPUS - 1] = NUMA_NO_NODE };
|
||||
|
||||
int __init acpi_numa_get_nid(unsigned int cpu)
|
||||
{
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <trace/events/kvm.h>
|
||||
|
||||
#include "sys_regs.h"
|
||||
#include "vgic/vgic.h"
|
||||
|
||||
#include "trace.h"
|
||||
|
||||
@ -207,6 +208,11 @@ static bool access_gic_sgi(struct kvm_vcpu *vcpu,
|
||||
{
|
||||
bool g1;
|
||||
|
||||
if (!kvm_has_gicv3(vcpu->kvm)) {
|
||||
kvm_inject_undefined(vcpu);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!p->is_write)
|
||||
return read_from_write_only(vcpu, p, r);
|
||||
|
||||
|
@ -318,4 +318,11 @@ int vgic_v4_init(struct kvm *kvm);
|
||||
void vgic_v4_teardown(struct kvm *kvm);
|
||||
void vgic_v4_configure_vsgis(struct kvm *kvm);
|
||||
|
||||
static inline bool kvm_has_gicv3(struct kvm *kvm)
|
||||
{
|
||||
return (static_branch_unlikely(&kvm_vgic_global_state.gicv3_cpuif) &&
|
||||
irqchip_in_kernel(kvm) &&
|
||||
kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1769,12 +1769,16 @@ static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
c->ases |= (MIPS_ASE_LOONGSON_MMI | MIPS_ASE_LOONGSON_CAM |
|
||||
MIPS_ASE_LOONGSON_EXT | MIPS_ASE_LOONGSON_EXT2);
|
||||
c->ases &= ~MIPS_ASE_VZ; /* VZ of Loongson-3A2000/3000 is incomplete */
|
||||
change_c0_config6(LOONGSON_CONF6_EXTIMER | LOONGSON_CONF6_INTIMER,
|
||||
LOONGSON_CONF6_INTIMER);
|
||||
break;
|
||||
case PRID_IMP_LOONGSON_64G:
|
||||
__cpu_name[cpu] = "ICT Loongson-3";
|
||||
set_elf_platform(cpu, "loongson3a");
|
||||
set_isa(c, MIPS_CPU_ISA_M64R2);
|
||||
decode_cpucfg(c);
|
||||
change_c0_config6(LOONGSON_CONF6_EXTIMER | LOONGSON_CONF6_INTIMER,
|
||||
LOONGSON_CONF6_INTIMER);
|
||||
break;
|
||||
default:
|
||||
panic("Unknown Loongson Processor ID!");
|
||||
|
@ -284,6 +284,9 @@ void calibrate_delay(void)
|
||||
|
||||
void __init setup_arch(char **cmdline_p)
|
||||
{
|
||||
/* setup memblock allocator */
|
||||
setup_memory();
|
||||
|
||||
unflatten_and_copy_device_tree();
|
||||
|
||||
setup_cpuinfo();
|
||||
@ -310,9 +313,6 @@ void __init setup_arch(char **cmdline_p)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* setup memblock allocator */
|
||||
setup_memory();
|
||||
|
||||
/* paging_init() sets up the MMU and marks all pages as reserved */
|
||||
paging_init();
|
||||
|
||||
|
@ -520,7 +520,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
|
||||
|
||||
old_regs = set_irq_regs(regs);
|
||||
local_irq_disable();
|
||||
irq_enter();
|
||||
irq_enter_rcu();
|
||||
|
||||
eirr_val = mfctl(23) & cpu_eiem & per_cpu(local_ack_eiem, cpu);
|
||||
if (!eirr_val)
|
||||
@ -555,7 +555,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
|
||||
#endif /* CONFIG_IRQSTACKS */
|
||||
|
||||
out:
|
||||
irq_exit();
|
||||
irq_exit_rcu();
|
||||
set_irq_regs(old_regs);
|
||||
return;
|
||||
|
||||
|
@ -114,8 +114,11 @@ static void *simple_realloc(void *ptr, unsigned long size)
|
||||
return ptr;
|
||||
|
||||
new = simple_malloc(size);
|
||||
if (new) {
|
||||
memcpy(new, ptr, p->size);
|
||||
simple_free(ptr);
|
||||
}
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
|
@ -235,6 +235,8 @@ static int __init icp_native_map_one_cpu(int hw_id, unsigned long addr,
|
||||
rname = kasprintf(GFP_KERNEL, "CPU %d [0x%x] Interrupt Presentation",
|
||||
cpu, hw_id);
|
||||
|
||||
if (!rname)
|
||||
return -ENOMEM;
|
||||
if (!request_mem_region(addr, size, rname)) {
|
||||
pr_warn("icp_native: Could not reserve ICP MMIO for CPU %d, interrupt server #0x%x\n",
|
||||
cpu, hw_id);
|
||||
|
@ -312,7 +312,10 @@ static inline int share(unsigned long addr, u16 cmd)
|
||||
|
||||
if (!uv_call(0, (u64)&uvcb))
|
||||
return 0;
|
||||
return -EINVAL;
|
||||
pr_err("%s UVC failed (rc: 0x%x, rrc: 0x%x), possible hypervisor bug.\n",
|
||||
uvcb.header.cmd == UVC_CMD_SET_SHARED_ACCESS ? "Share" : "Unshare",
|
||||
uvcb.header.rc, uvcb.header.rrc);
|
||||
panic("System security cannot be guaranteed unless the system panics now.\n");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -252,15 +252,9 @@ static inline void save_vector_registers(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void setup_control_registers(void)
|
||||
static inline void setup_low_address_protection(void)
|
||||
{
|
||||
unsigned long reg;
|
||||
|
||||
__ctl_store(reg, 0, 0);
|
||||
reg |= CR0_LOW_ADDRESS_PROTECTION;
|
||||
reg |= CR0_EMERGENCY_SIGNAL_SUBMASK;
|
||||
reg |= CR0_EXTERNAL_CALL_SUBMASK;
|
||||
__ctl_load(reg, 0, 0);
|
||||
__ctl_set_bit(0, 28);
|
||||
}
|
||||
|
||||
static inline void setup_access_registers(void)
|
||||
@ -313,7 +307,7 @@ void __init startup_init(void)
|
||||
save_vector_registers();
|
||||
setup_topology();
|
||||
sclp_early_detect();
|
||||
setup_control_registers();
|
||||
setup_low_address_protection();
|
||||
setup_access_registers();
|
||||
lockdep_on();
|
||||
}
|
||||
|
@ -982,12 +982,12 @@ void __init smp_fill_possible_mask(void)
|
||||
|
||||
void __init smp_prepare_cpus(unsigned int max_cpus)
|
||||
{
|
||||
/* request the 0x1201 emergency signal external interrupt */
|
||||
if (register_external_irq(EXT_IRQ_EMERGENCY_SIG, do_ext_call_interrupt))
|
||||
panic("Couldn't request external interrupt 0x1201");
|
||||
/* request the 0x1202 external call external interrupt */
|
||||
ctl_set_bit(0, 14);
|
||||
if (register_external_irq(EXT_IRQ_EXTERNAL_CALL, do_ext_call_interrupt))
|
||||
panic("Couldn't request external interrupt 0x1202");
|
||||
ctl_set_bit(0, 13);
|
||||
}
|
||||
|
||||
void __init smp_prepare_boot_cpu(void)
|
||||
|
@ -926,7 +926,10 @@ unsigned long arch_align_stack(unsigned long sp)
|
||||
|
||||
unsigned long arch_randomize_brk(struct mm_struct *mm)
|
||||
{
|
||||
return randomize_page(mm->brk, 0x02000000);
|
||||
if (mmap_is_ia32())
|
||||
return randomize_page(mm->brk, SZ_32M);
|
||||
|
||||
return randomize_page(mm->brk, SZ_1G);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -5366,6 +5366,9 @@ static void ata_host_release(struct kref *kref)
|
||||
for (i = 0; i < host->n_ports; i++) {
|
||||
struct ata_port *ap = host->ports[i];
|
||||
|
||||
if (!ap)
|
||||
continue;
|
||||
|
||||
kfree(ap->pmp_link);
|
||||
kfree(ap->slave_link);
|
||||
kfree(ap);
|
||||
|
@ -1118,8 +1118,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
|
||||
rpp->len += skb->len;
|
||||
|
||||
if (stat & SAR_RSQE_EPDU) {
|
||||
unsigned int len, truesize;
|
||||
unsigned char *l1l2;
|
||||
unsigned int len;
|
||||
|
||||
l1l2 = (unsigned char *) ((unsigned long) skb->data + skb->len - 6);
|
||||
|
||||
@ -1189,14 +1189,15 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
|
||||
ATM_SKB(skb)->vcc = vcc;
|
||||
__net_timestamp(skb);
|
||||
|
||||
truesize = skb->truesize;
|
||||
vcc->push(vcc, skb);
|
||||
atomic_inc(&vcc->stats->rx);
|
||||
|
||||
if (skb->truesize > SAR_FB_SIZE_3)
|
||||
if (truesize > SAR_FB_SIZE_3)
|
||||
add_rx_skb(card, 3, SAR_FB_SIZE_3, 1);
|
||||
else if (skb->truesize > SAR_FB_SIZE_2)
|
||||
else if (truesize > SAR_FB_SIZE_2)
|
||||
add_rx_skb(card, 2, SAR_FB_SIZE_2, 1);
|
||||
else if (skb->truesize > SAR_FB_SIZE_1)
|
||||
else if (truesize > SAR_FB_SIZE_1)
|
||||
add_rx_skb(card, 1, SAR_FB_SIZE_1, 1);
|
||||
else
|
||||
add_rx_skb(card, 0, SAR_FB_SIZE_0, 1);
|
||||
|
@ -768,7 +768,8 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file *file,
|
||||
break;
|
||||
|
||||
case HCIUARTGETPROTO:
|
||||
if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
|
||||
if (test_bit(HCI_UART_PROTO_SET, &hu->flags) &&
|
||||
test_bit(HCI_UART_PROTO_READY, &hu->flags))
|
||||
err = hu->proto->id;
|
||||
else
|
||||
err = -EUNATCH;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/log2.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
@ -624,12 +625,10 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
|
||||
struct dw_desc *prev;
|
||||
struct dw_desc *first;
|
||||
u32 ctllo, ctlhi;
|
||||
u8 m_master = dwc->dws.m_master;
|
||||
u8 lms = DWC_LLP_LMS(m_master);
|
||||
u8 lms = DWC_LLP_LMS(dwc->dws.m_master);
|
||||
dma_addr_t reg;
|
||||
unsigned int reg_width;
|
||||
unsigned int mem_width;
|
||||
unsigned int data_width = dw->pdata->data_width[m_master];
|
||||
unsigned int i;
|
||||
struct scatterlist *sg;
|
||||
size_t total_len = 0;
|
||||
@ -663,7 +662,7 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
|
||||
mem = sg_dma_address(sg);
|
||||
len = sg_dma_len(sg);
|
||||
|
||||
mem_width = __ffs(data_width | mem | len);
|
||||
mem_width = __ffs(sconfig->src_addr_width | mem | len);
|
||||
|
||||
slave_sg_todev_fill_desc:
|
||||
desc = dwc_desc_get(dwc);
|
||||
@ -723,7 +722,7 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
|
||||
lli_write(desc, sar, reg);
|
||||
lli_write(desc, dar, mem);
|
||||
lli_write(desc, ctlhi, ctlhi);
|
||||
mem_width = __ffs(data_width | mem);
|
||||
mem_width = __ffs(sconfig->dst_addr_width | mem);
|
||||
lli_write(desc, ctllo, ctllo | DWC_CTLL_DST_WIDTH(mem_width));
|
||||
desc->len = dlen;
|
||||
|
||||
@ -783,17 +782,93 @@ bool dw_dma_filter(struct dma_chan *chan, void *param)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dw_dma_filter);
|
||||
|
||||
static int dwc_verify_p_buswidth(struct dma_chan *chan)
|
||||
{
|
||||
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
|
||||
struct dw_dma *dw = to_dw_dma(chan->device);
|
||||
u32 reg_width, max_width;
|
||||
|
||||
if (dwc->dma_sconfig.direction == DMA_MEM_TO_DEV)
|
||||
reg_width = dwc->dma_sconfig.dst_addr_width;
|
||||
else if (dwc->dma_sconfig.direction == DMA_DEV_TO_MEM)
|
||||
reg_width = dwc->dma_sconfig.src_addr_width;
|
||||
else /* DMA_MEM_TO_MEM */
|
||||
return 0;
|
||||
|
||||
max_width = dw->pdata->data_width[dwc->dws.p_master];
|
||||
|
||||
/* Fall-back to 1-byte transfer width if undefined */
|
||||
if (reg_width == DMA_SLAVE_BUSWIDTH_UNDEFINED)
|
||||
reg_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
|
||||
else if (!is_power_of_2(reg_width) || reg_width > max_width)
|
||||
return -EINVAL;
|
||||
else /* bus width is valid */
|
||||
return 0;
|
||||
|
||||
/* Update undefined addr width value */
|
||||
if (dwc->dma_sconfig.direction == DMA_MEM_TO_DEV)
|
||||
dwc->dma_sconfig.dst_addr_width = reg_width;
|
||||
else /* DMA_DEV_TO_MEM */
|
||||
dwc->dma_sconfig.src_addr_width = reg_width;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dwc_verify_m_buswidth(struct dma_chan *chan)
|
||||
{
|
||||
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
|
||||
struct dw_dma *dw = to_dw_dma(chan->device);
|
||||
u32 reg_width, reg_burst, mem_width;
|
||||
|
||||
mem_width = dw->pdata->data_width[dwc->dws.m_master];
|
||||
|
||||
/*
|
||||
* It's possible to have a data portion locked in the DMA FIFO in case
|
||||
* of the channel suspension. Subsequent channel disabling will cause
|
||||
* that data silent loss. In order to prevent that maintain the src and
|
||||
* dst transfer widths coherency by means of the relation:
|
||||
* (CTLx.SRC_TR_WIDTH * CTLx.SRC_MSIZE >= CTLx.DST_TR_WIDTH)
|
||||
* Look for the details in the commit message that brings this change.
|
||||
*
|
||||
* Note the DMA configs utilized in the calculations below must have
|
||||
* been verified to have correct values by this method call.
|
||||
*/
|
||||
if (dwc->dma_sconfig.direction == DMA_MEM_TO_DEV) {
|
||||
reg_width = dwc->dma_sconfig.dst_addr_width;
|
||||
if (mem_width < reg_width)
|
||||
return -EINVAL;
|
||||
|
||||
dwc->dma_sconfig.src_addr_width = mem_width;
|
||||
} else if (dwc->dma_sconfig.direction == DMA_DEV_TO_MEM) {
|
||||
reg_width = dwc->dma_sconfig.src_addr_width;
|
||||
reg_burst = rounddown_pow_of_two(dwc->dma_sconfig.src_maxburst);
|
||||
|
||||
dwc->dma_sconfig.dst_addr_width = min(mem_width, reg_width * reg_burst);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dwc_config(struct dma_chan *chan, struct dma_slave_config *sconfig)
|
||||
{
|
||||
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
|
||||
struct dw_dma *dw = to_dw_dma(chan->device);
|
||||
int ret;
|
||||
|
||||
memcpy(&dwc->dma_sconfig, sconfig, sizeof(*sconfig));
|
||||
|
||||
dwc->dma_sconfig.src_maxburst =
|
||||
clamp(dwc->dma_sconfig.src_maxburst, 0U, dwc->max_burst);
|
||||
clamp(dwc->dma_sconfig.src_maxburst, 1U, dwc->max_burst);
|
||||
dwc->dma_sconfig.dst_maxburst =
|
||||
clamp(dwc->dma_sconfig.dst_maxburst, 0U, dwc->max_burst);
|
||||
clamp(dwc->dma_sconfig.dst_maxburst, 1U, dwc->max_burst);
|
||||
|
||||
ret = dwc_verify_p_buswidth(chan);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = dwc_verify_m_buswidth(chan);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
dw->encode_maxburst(dwc, &dwc->dma_sconfig.src_maxburst);
|
||||
dw->encode_maxburst(dwc, &dwc->dma_sconfig.dst_maxburst);
|
||||
|
@ -386,16 +386,24 @@ int amdgpu_ctx_ioctl(struct drm_device *dev, void *data,
|
||||
|
||||
switch (args->in.op) {
|
||||
case AMDGPU_CTX_OP_ALLOC_CTX:
|
||||
if (args->in.flags)
|
||||
return -EINVAL;
|
||||
r = amdgpu_ctx_alloc(adev, fpriv, filp, priority, &id);
|
||||
args->out.alloc.ctx_id = id;
|
||||
break;
|
||||
case AMDGPU_CTX_OP_FREE_CTX:
|
||||
if (args->in.flags)
|
||||
return -EINVAL;
|
||||
r = amdgpu_ctx_free(fpriv, id);
|
||||
break;
|
||||
case AMDGPU_CTX_OP_QUERY_STATE:
|
||||
if (args->in.flags)
|
||||
return -EINVAL;
|
||||
r = amdgpu_ctx_query(adev, fpriv, id, &args->out);
|
||||
break;
|
||||
case AMDGPU_CTX_OP_QUERY_STATE2:
|
||||
if (args->in.flags)
|
||||
return -EINVAL;
|
||||
r = amdgpu_ctx_query2(adev, fpriv, id, &args->out);
|
||||
break;
|
||||
default:
|
||||
|
@ -725,7 +725,8 @@ int amdgpu_vce_ring_parse_cs(struct amdgpu_cs_parser *p, uint32_t ib_idx)
|
||||
uint32_t created = 0;
|
||||
uint32_t allocated = 0;
|
||||
uint32_t tmp, handle = 0;
|
||||
uint32_t *size = &tmp;
|
||||
uint32_t dummy = 0xffffffff;
|
||||
uint32_t *size = &dummy;
|
||||
unsigned idx;
|
||||
int i, r = 0;
|
||||
|
||||
|
@ -553,11 +553,11 @@ void jpeg_v2_0_dec_ring_emit_ib(struct amdgpu_ring *ring,
|
||||
|
||||
amdgpu_ring_write(ring, PACKETJ(mmUVD_LMI_JRBC_IB_VMID_INTERNAL_OFFSET,
|
||||
0, 0, PACKETJ_TYPE0));
|
||||
amdgpu_ring_write(ring, (vmid | (vmid << 4)));
|
||||
amdgpu_ring_write(ring, (vmid | (vmid << 4) | (vmid << 8)));
|
||||
|
||||
amdgpu_ring_write(ring, PACKETJ(mmUVD_LMI_JPEG_VMID_INTERNAL_OFFSET,
|
||||
0, 0, PACKETJ_TYPE0));
|
||||
amdgpu_ring_write(ring, (vmid | (vmid << 4)));
|
||||
amdgpu_ring_write(ring, (vmid | (vmid << 4) | (vmid << 8)));
|
||||
|
||||
amdgpu_ring_write(ring, PACKETJ(mmUVD_LMI_JRBC_IB_64BIT_BAR_LOW_INTERNAL_OFFSET,
|
||||
0, 0, PACKETJ_TYPE0));
|
||||
|
@ -1311,7 +1311,7 @@ static int kfd_ioctl_alloc_memory_of_gpu(struct file *filep,
|
||||
goto err_unlock;
|
||||
}
|
||||
offset = amdgpu_amdkfd_get_mmio_remap_phys_addr(dev->kgd);
|
||||
if (!offset) {
|
||||
if (!offset || (PAGE_SIZE > 4096)) {
|
||||
err = -ENOMEM;
|
||||
goto err_unlock;
|
||||
}
|
||||
@ -1969,6 +1969,9 @@ static int kfd_mmio_mmap(struct kfd_dev *dev, struct kfd_process *process,
|
||||
if (vma->vm_end - vma->vm_start != PAGE_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
if (PAGE_SIZE > 4096)
|
||||
return -EINVAL;
|
||||
|
||||
address = amdgpu_amdkfd_get_mmio_remap_phys_addr(dev->kgd);
|
||||
|
||||
vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_NORESERVE |
|
||||
|
@ -166,6 +166,11 @@ static void lima_gp_task_run(struct lima_sched_pipe *pipe,
|
||||
gp_write(LIMA_GP_CMD, cmd);
|
||||
}
|
||||
|
||||
static int lima_gp_bus_stop_poll(struct lima_ip *ip)
|
||||
{
|
||||
return !!(gp_read(LIMA_GP_STATUS) & LIMA_GP_STATUS_BUS_STOPPED);
|
||||
}
|
||||
|
||||
static int lima_gp_hard_reset_poll(struct lima_ip *ip)
|
||||
{
|
||||
gp_write(LIMA_GP_PERF_CNT_0_LIMIT, 0xC01A0000);
|
||||
@ -179,6 +184,13 @@ static int lima_gp_hard_reset(struct lima_ip *ip)
|
||||
|
||||
gp_write(LIMA_GP_PERF_CNT_0_LIMIT, 0xC0FFE000);
|
||||
gp_write(LIMA_GP_INT_MASK, 0);
|
||||
|
||||
gp_write(LIMA_GP_CMD, LIMA_GP_CMD_STOP_BUS);
|
||||
ret = lima_poll_timeout(ip, lima_gp_bus_stop_poll, 10, 100);
|
||||
if (ret) {
|
||||
dev_err(dev->dev, "%s bus stop timeout\n", lima_ip_name(ip));
|
||||
return ret;
|
||||
}
|
||||
gp_write(LIMA_GP_CMD, LIMA_GP_CMD_RESET);
|
||||
ret = lima_poll_timeout(ip, lima_gp_hard_reset_poll, 10, 100);
|
||||
if (ret) {
|
||||
|
@ -32,24 +32,14 @@
|
||||
* @fmt: Pointer to format string
|
||||
*/
|
||||
#define DPU_DEBUG(fmt, ...) \
|
||||
do { \
|
||||
if (drm_debug_enabled(DRM_UT_KMS)) \
|
||||
DRM_DEBUG(fmt, ##__VA_ARGS__); \
|
||||
else \
|
||||
pr_debug(fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* DPU_DEBUG_DRIVER - macro for hardware driver logging
|
||||
* @fmt: Pointer to format string
|
||||
*/
|
||||
#define DPU_DEBUG_DRIVER(fmt, ...) \
|
||||
do { \
|
||||
if (drm_debug_enabled(DRM_UT_DRIVER)) \
|
||||
DRM_ERROR(fmt, ##__VA_ARGS__); \
|
||||
else \
|
||||
pr_debug(fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__)
|
||||
|
||||
#define DPU_ERROR(fmt, ...) pr_err("[dpu error]" fmt, ##__VA_ARGS__)
|
||||
#define DPU_ERROR_RATELIMITED(fmt, ...) pr_err_ratelimited("[dpu error]" fmt, ##__VA_ARGS__)
|
||||
|
@ -1246,6 +1246,8 @@ static int dp_ctrl_link_train(struct dp_ctrl_private *ctrl,
|
||||
link_info.rate = ctrl->link->link_params.rate;
|
||||
link_info.capabilities = DP_LINK_CAP_ENHANCED_FRAMING;
|
||||
|
||||
dp_link_reset_phy_params_vx_px(ctrl->link);
|
||||
|
||||
dp_aux_link_configure(ctrl->aux, &link_info);
|
||||
drm_dp_dpcd_write(ctrl->aux, DP_MAIN_LINK_CHANNEL_CODING_SET,
|
||||
&encoding, 1);
|
||||
|
@ -875,7 +875,15 @@
|
||||
#define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9
|
||||
#define USB_DEVICE_ID_MS_POWER_COVER 0x07da
|
||||
#define USB_DEVICE_ID_MS_SURFACE3_COVER 0x07de
|
||||
#define USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER 0x02fd
|
||||
/*
|
||||
* For a description of the Xbox controller models, refer to:
|
||||
* https://en.wikipedia.org/wiki/Xbox_Wireless_Controller#Summary
|
||||
*/
|
||||
#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708 0x02fd
|
||||
#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708_BLE 0x0b20
|
||||
#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1914 0x0b13
|
||||
#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797 0x0b05
|
||||
#define USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797_BLE 0x0b22
|
||||
#define USB_DEVICE_ID_MS_PIXART_MOUSE 0x00cb
|
||||
#define USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS 0x02e0
|
||||
#define USB_DEVICE_ID_MS_MOUSE_0783 0x0783
|
||||
|
@ -446,7 +446,16 @@ static const struct hid_device_id ms_devices[] = {
|
||||
.driver_data = MS_PRESENTER },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x091B),
|
||||
.driver_data = MS_SURFACE_DIAL },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER),
|
||||
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708),
|
||||
.driver_data = MS_QUIRK_FF },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1708_BLE),
|
||||
.driver_data = MS_QUIRK_FF },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1914),
|
||||
.driver_data = MS_QUIRK_FF },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797),
|
||||
.driver_data = MS_QUIRK_FF },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_CONTROLLER_MODEL_1797_BLE),
|
||||
.driver_data = MS_QUIRK_FF },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS),
|
||||
.driver_data = MS_QUIRK_FF },
|
||||
|
@ -1920,12 +1920,14 @@ static void wacom_map_usage(struct input_dev *input, struct hid_usage *usage,
|
||||
int fmax = field->logical_maximum;
|
||||
unsigned int equivalent_usage = wacom_equivalent_usage(usage->hid);
|
||||
int resolution_code = code;
|
||||
int resolution = hidinput_calc_abs_res(field, resolution_code);
|
||||
int resolution;
|
||||
|
||||
if (equivalent_usage == HID_DG_TWIST) {
|
||||
resolution_code = ABS_RZ;
|
||||
}
|
||||
|
||||
resolution = hidinput_calc_abs_res(field, resolution_code);
|
||||
|
||||
if (equivalent_usage == HID_GD_X) {
|
||||
fmin += features->offset_left;
|
||||
fmax -= features->offset_right;
|
||||
|
@ -312,7 +312,7 @@ static int riic_init_hw(struct riic_dev *riic, struct i2c_timings *t)
|
||||
* frequency with only 62 clock ticks max (31 high, 31 low).
|
||||
* Aim for a duty of 60% LOW, 40% HIGH.
|
||||
*/
|
||||
total_ticks = DIV_ROUND_UP(rate, t->bus_freq_hz);
|
||||
total_ticks = DIV_ROUND_UP(rate, t->bus_freq_hz ?: 1);
|
||||
|
||||
for (cks = 0; cks < 7; cks++) {
|
||||
/*
|
||||
|
@ -13224,15 +13224,16 @@ static void read_mod_write(struct hfi1_devdata *dd, u16 src, u64 bits,
|
||||
{
|
||||
u64 reg;
|
||||
u16 idx = src / BITS_PER_REGISTER;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock(&dd->irq_src_lock);
|
||||
spin_lock_irqsave(&dd->irq_src_lock, flags);
|
||||
reg = read_csr(dd, CCE_INT_MASK + (8 * idx));
|
||||
if (set)
|
||||
reg |= bits;
|
||||
else
|
||||
reg &= ~bits;
|
||||
write_csr(dd, CCE_INT_MASK + (8 * idx), reg);
|
||||
spin_unlock(&dd->irq_src_lock);
|
||||
spin_unlock_irqrestore(&dd->irq_src_lock, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -235,7 +235,7 @@ static int create_cq(struct rtrs_con *con, int cq_vector, u16 cq_size,
|
||||
static int create_qp(struct rtrs_con *con, struct ib_pd *pd,
|
||||
u32 max_send_wr, u32 max_recv_wr, u32 max_sge)
|
||||
{
|
||||
struct ib_qp_init_attr init_attr = {NULL};
|
||||
struct ib_qp_init_attr init_attr = {};
|
||||
struct rdma_cm_id *cm_id = con->cm_id;
|
||||
int ret;
|
||||
|
||||
|
@ -45,6 +45,9 @@ int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots,
|
||||
return 0;
|
||||
if (mt)
|
||||
return mt->num_slots != num_slots ? -EINVAL : 0;
|
||||
/* Arbitrary limit for avoiding too large memory allocation. */
|
||||
if (num_slots > 1024)
|
||||
return -EINVAL;
|
||||
|
||||
mt = kzalloc(struct_size(mt, slots, num_slots), GFP_KERNEL);
|
||||
if (!mt)
|
||||
|
@ -190,7 +190,7 @@ static int ioc3kbd_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ioc3kbd_remove(struct platform_device *pdev)
|
||||
static int ioc3kbd_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct ioc3kbd_data *d = platform_get_drvdata(pdev);
|
||||
|
||||
@ -198,6 +198,8 @@ static void ioc3kbd_remove(struct platform_device *pdev)
|
||||
|
||||
serio_unregister_port(d->kbd);
|
||||
serio_unregister_port(d->aux);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct platform_device_id ioc3kbd_id_table[] = {
|
||||
@ -208,7 +210,7 @@ MODULE_DEVICE_TABLE(platform, ioc3kbd_id_table);
|
||||
|
||||
static struct platform_driver ioc3kbd_driver = {
|
||||
.probe = ioc3kbd_probe,
|
||||
.remove_new = ioc3kbd_remove,
|
||||
.remove = ioc3kbd_remove,
|
||||
.id_table = ioc3kbd_id_table,
|
||||
.driver = {
|
||||
.name = "ioc3-kbd",
|
||||
|
@ -4483,8 +4483,6 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
|
||||
struct page *vprop_page;
|
||||
int base, nr_ids, i, err = 0;
|
||||
|
||||
BUG_ON(!vm);
|
||||
|
||||
bitmap = its_lpi_alloc(roundup_pow_of_two(nr_irqs), &base, &nr_ids);
|
||||
if (!bitmap)
|
||||
return -ENOMEM;
|
||||
|
@ -471,11 +471,6 @@ static void __destroy_persistent_data_structures(struct dm_clone_metadata *cmd)
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static size_t bitmap_size(unsigned long nr_bits)
|
||||
{
|
||||
return BITS_TO_LONGS(nr_bits) * sizeof(long);
|
||||
}
|
||||
|
||||
static int __dirty_map_init(struct dirty_map *dmap, unsigned long nr_words,
|
||||
unsigned long nr_regions)
|
||||
{
|
||||
|
@ -1064,8 +1064,26 @@ static int do_resume(struct dm_ioctl *param)
|
||||
suspend_flags &= ~DM_SUSPEND_LOCKFS_FLAG;
|
||||
if (param->flags & DM_NOFLUSH_FLAG)
|
||||
suspend_flags |= DM_SUSPEND_NOFLUSH_FLAG;
|
||||
if (!dm_suspended_md(md))
|
||||
dm_suspend(md, suspend_flags);
|
||||
if (!dm_suspended_md(md)) {
|
||||
r = dm_suspend(md, suspend_flags);
|
||||
if (r) {
|
||||
down_write(&_hash_lock);
|
||||
hc = dm_get_mdptr(md);
|
||||
if (hc && !hc->new_map) {
|
||||
hc->new_map = new_map;
|
||||
new_map = NULL;
|
||||
} else {
|
||||
r = -ENXIO;
|
||||
}
|
||||
up_write(&_hash_lock);
|
||||
if (new_map) {
|
||||
dm_sync_table(md);
|
||||
dm_table_destroy(new_map);
|
||||
}
|
||||
dm_put(md);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
old_map = dm_swap_table(md, new_map);
|
||||
if (IS_ERR(old_map)) {
|
||||
|
@ -2359,7 +2359,7 @@ static int dm_wait_for_bios_completion(struct mapped_device *md, long task_state
|
||||
break;
|
||||
|
||||
if (signal_pending_state(task_state, current)) {
|
||||
r = -EINTR;
|
||||
r = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2384,7 +2384,7 @@ static int dm_wait_for_completion(struct mapped_device *md, long task_state)
|
||||
break;
|
||||
|
||||
if (signal_pending_state(task_state, current)) {
|
||||
r = -EINTR;
|
||||
r = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -7596,11 +7596,6 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
|
||||
|
||||
mddev = bdev->bd_disk->private_data;
|
||||
|
||||
if (!mddev) {
|
||||
BUG();
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Some actions do not requires the mutex */
|
||||
switch (cmd) {
|
||||
case GET_ARRAY_INFO:
|
||||
|
@ -275,7 +275,7 @@ static void sm_metadata_destroy(struct dm_space_map *sm)
|
||||
{
|
||||
struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm);
|
||||
|
||||
kfree(smm);
|
||||
kvfree(smm);
|
||||
}
|
||||
|
||||
static int sm_metadata_get_nr_blocks(struct dm_space_map *sm, dm_block_t *count)
|
||||
@ -759,7 +759,7 @@ struct dm_space_map *dm_sm_metadata_init(void)
|
||||
{
|
||||
struct sm_metadata *smm;
|
||||
|
||||
smm = kmalloc(sizeof(*smm), GFP_KERNEL);
|
||||
smm = kvmalloc(sizeof(*smm), GFP_KERNEL);
|
||||
if (!smm)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
@ -1353,6 +1353,10 @@ int cx23885_video_register(struct cx23885_dev *dev)
|
||||
/* register Video device */
|
||||
dev->video_dev = cx23885_vdev_init(dev, dev->pci,
|
||||
&cx23885_video_template, "video");
|
||||
if (!dev->video_dev) {
|
||||
err = -ENOMEM;
|
||||
goto fail_unreg;
|
||||
}
|
||||
dev->video_dev->queue = &dev->vb2_vidq;
|
||||
dev->video_dev->device_caps = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING |
|
||||
V4L2_CAP_AUDIO | V4L2_CAP_VIDEO_CAPTURE;
|
||||
@ -1381,6 +1385,10 @@ int cx23885_video_register(struct cx23885_dev *dev)
|
||||
/* register VBI device */
|
||||
dev->vbi_dev = cx23885_vdev_init(dev, dev->pci,
|
||||
&cx23885_vbi_template, "vbi");
|
||||
if (!dev->vbi_dev) {
|
||||
err = -ENOMEM;
|
||||
goto fail_unreg;
|
||||
}
|
||||
dev->vbi_dev->queue = &dev->vb2_vbiq;
|
||||
dev->vbi_dev->device_caps = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING |
|
||||
V4L2_CAP_AUDIO | V4L2_CAP_VBI_CAPTURE;
|
||||
|
@ -57,16 +57,16 @@
|
||||
#define SOLO_MP4E_EXT_ADDR(__solo) \
|
||||
(SOLO_EREF_EXT_ADDR(__solo) + SOLO_EREF_EXT_AREA(__solo))
|
||||
#define SOLO_MP4E_EXT_SIZE(__solo) \
|
||||
max((__solo->nr_chans * 0x00080000), \
|
||||
min(((__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo)) - \
|
||||
__SOLO_JPEG_MIN_SIZE(__solo)), 0x00ff0000))
|
||||
clamp(__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo) - \
|
||||
__SOLO_JPEG_MIN_SIZE(__solo), \
|
||||
__solo->nr_chans * 0x00080000, 0x00ff0000)
|
||||
|
||||
#define __SOLO_JPEG_MIN_SIZE(__solo) (__solo->nr_chans * 0x00080000)
|
||||
#define SOLO_JPEG_EXT_ADDR(__solo) \
|
||||
(SOLO_MP4E_EXT_ADDR(__solo) + SOLO_MP4E_EXT_SIZE(__solo))
|
||||
#define SOLO_JPEG_EXT_SIZE(__solo) \
|
||||
max(__SOLO_JPEG_MIN_SIZE(__solo), \
|
||||
min((__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo)), 0x00ff0000))
|
||||
clamp(__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo), \
|
||||
__SOLO_JPEG_MIN_SIZE(__solo), 0x00ff0000)
|
||||
|
||||
#define SOLO_SDRAM_END(__solo) \
|
||||
(SOLO_JPEG_EXT_ADDR(__solo) + SOLO_JPEG_EXT_SIZE(__solo))
|
||||
|
@ -765,7 +765,7 @@ static int vcodec_domains_get(struct venus_core *core)
|
||||
pd = dev_pm_domain_attach_by_name(dev,
|
||||
res->vcodec_pmdomains[i]);
|
||||
if (IS_ERR_OR_NULL(pd))
|
||||
return PTR_ERR(pd) ? : -ENODATA;
|
||||
return pd ? PTR_ERR(pd) : -ENODATA;
|
||||
core->pmdomains[i] = pd;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ static int radio_isa_querycap(struct file *file, void *priv,
|
||||
|
||||
strscpy(v->driver, isa->drv->driver.driver.name, sizeof(v->driver));
|
||||
strscpy(v->card, isa->drv->card, sizeof(v->card));
|
||||
snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", isa->v4l2_dev.name);
|
||||
snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev_name(isa->v4l2_dev.dev));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -723,11 +723,11 @@ void uvc_video_clock_update(struct uvc_streaming *stream,
|
||||
unsigned long flags;
|
||||
u64 timestamp;
|
||||
u32 delta_stc;
|
||||
u32 y1, y2;
|
||||
u32 y1;
|
||||
u32 x1, x2;
|
||||
u32 mean;
|
||||
u32 sof;
|
||||
u64 y;
|
||||
u64 y, y2;
|
||||
|
||||
if (!uvc_hw_timestamps_param)
|
||||
return;
|
||||
@ -767,7 +767,7 @@ void uvc_video_clock_update(struct uvc_streaming *stream,
|
||||
sof = y;
|
||||
|
||||
uvc_trace(UVC_TRACE_CLOCK, "%s: PTS %u y %llu.%06llu SOF %u.%06llu "
|
||||
"(x1 %u x2 %u y1 %u y2 %u SOF offset %u)\n",
|
||||
"(x1 %u x2 %u y1 %u y2 %llu SOF offset %u)\n",
|
||||
stream->dev->name, buf->pts,
|
||||
y >> 16, div_u64((y & 0xffff) * 1000000, 65536),
|
||||
sof >> 16, div_u64(((u64)sof & 0xffff) * 1000000LLU, 65536),
|
||||
@ -782,7 +782,7 @@ void uvc_video_clock_update(struct uvc_streaming *stream,
|
||||
goto done;
|
||||
|
||||
y1 = NSEC_PER_SEC;
|
||||
y2 = (u32)ktime_to_ns(ktime_sub(last->host_time, first->host_time)) + y1;
|
||||
y2 = ktime_to_ns(ktime_sub(last->host_time, first->host_time)) + y1;
|
||||
|
||||
/* Interpolated and host SOF timestamps can wrap around at slightly
|
||||
* different times. Handle this by adding or removing 2048 to or from
|
||||
@ -802,7 +802,7 @@ void uvc_video_clock_update(struct uvc_streaming *stream,
|
||||
timestamp = ktime_to_ns(first->host_time) + y - y1;
|
||||
|
||||
uvc_trace(UVC_TRACE_CLOCK, "%s: SOF %u.%06llu y %llu ts %llu "
|
||||
"buf ts %llu (x1 %u/%u/%u x2 %u/%u/%u y1 %u y2 %u)\n",
|
||||
"buf ts %llu (x1 %u/%u/%u x2 %u/%u/%u y1 %u y2 %llu)\n",
|
||||
stream->dev->name,
|
||||
sof >> 16, div_u64(((u64)sof & 0xffff) * 1000000LLU, 65536),
|
||||
y, timestamp, vbuf->vb2_buf.timestamp,
|
||||
|
@ -179,8 +179,11 @@ static int stm32_fmc2_ebi_check_mux(struct stm32_fmc2_ebi *ebi,
|
||||
int cs)
|
||||
{
|
||||
u32 bcr;
|
||||
int ret;
|
||||
|
||||
regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (bcr & FMC2_BCR_MTYP)
|
||||
return 0;
|
||||
@ -193,8 +196,11 @@ static int stm32_fmc2_ebi_check_waitcfg(struct stm32_fmc2_ebi *ebi,
|
||||
int cs)
|
||||
{
|
||||
u32 bcr, val = FIELD_PREP(FMC2_BCR_MTYP, FMC2_BCR_MTYP_NOR);
|
||||
int ret;
|
||||
|
||||
regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if ((bcr & FMC2_BCR_MTYP) == val && bcr & FMC2_BCR_BURSTEN)
|
||||
return 0;
|
||||
@ -207,8 +213,11 @@ static int stm32_fmc2_ebi_check_sync_trans(struct stm32_fmc2_ebi *ebi,
|
||||
int cs)
|
||||
{
|
||||
u32 bcr;
|
||||
int ret;
|
||||
|
||||
regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (bcr & FMC2_BCR_BURSTEN)
|
||||
return 0;
|
||||
@ -221,8 +230,11 @@ static int stm32_fmc2_ebi_check_async_trans(struct stm32_fmc2_ebi *ebi,
|
||||
int cs)
|
||||
{
|
||||
u32 bcr;
|
||||
int ret;
|
||||
|
||||
regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!(bcr & FMC2_BCR_BURSTEN) || !(bcr & FMC2_BCR_CBURSTRW))
|
||||
return 0;
|
||||
@ -235,8 +247,11 @@ static int stm32_fmc2_ebi_check_cpsize(struct stm32_fmc2_ebi *ebi,
|
||||
int cs)
|
||||
{
|
||||
u32 bcr, val = FIELD_PREP(FMC2_BCR_MTYP, FMC2_BCR_MTYP_PSRAM);
|
||||
int ret;
|
||||
|
||||
regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if ((bcr & FMC2_BCR_MTYP) == val && bcr & FMC2_BCR_BURSTEN)
|
||||
return 0;
|
||||
@ -249,12 +264,18 @@ static int stm32_fmc2_ebi_check_address_hold(struct stm32_fmc2_ebi *ebi,
|
||||
int cs)
|
||||
{
|
||||
u32 bcr, bxtr, val = FIELD_PREP(FMC2_BXTR_ACCMOD, FMC2_BXTR_EXTMOD_D);
|
||||
int ret;
|
||||
|
||||
ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
if (prop->reg_type == FMC2_REG_BWTR)
|
||||
regmap_read(ebi->regmap, FMC2_BWTR(cs), &bxtr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BWTR(cs), &bxtr);
|
||||
else
|
||||
regmap_read(ebi->regmap, FMC2_BTR(cs), &bxtr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &bxtr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if ((!(bcr & FMC2_BCR_BURSTEN) || !(bcr & FMC2_BCR_CBURSTRW)) &&
|
||||
((bxtr & FMC2_BXTR_ACCMOD) == val || bcr & FMC2_BCR_MUXEN))
|
||||
@ -268,12 +289,19 @@ static int stm32_fmc2_ebi_check_clk_period(struct stm32_fmc2_ebi *ebi,
|
||||
int cs)
|
||||
{
|
||||
u32 bcr, bcr1;
|
||||
int ret;
|
||||
|
||||
regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
if (cs)
|
||||
regmap_read(ebi->regmap, FMC2_BCR1, &bcr1);
|
||||
else
|
||||
ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (cs) {
|
||||
ret = regmap_read(ebi->regmap, FMC2_BCR1, &bcr1);
|
||||
if (ret)
|
||||
return ret;
|
||||
} else {
|
||||
bcr1 = bcr;
|
||||
}
|
||||
|
||||
if (bcr & FMC2_BCR_BURSTEN && (!cs || !(bcr1 & FMC2_BCR1_CCLKEN)))
|
||||
return 0;
|
||||
@ -305,12 +333,18 @@ static u32 stm32_fmc2_ebi_ns_to_clk_period(struct stm32_fmc2_ebi *ebi,
|
||||
{
|
||||
u32 nb_clk_cycles = stm32_fmc2_ebi_ns_to_clock_cycles(ebi, cs, setup);
|
||||
u32 bcr, btr, clk_period;
|
||||
int ret;
|
||||
|
||||
ret = regmap_read(ebi->regmap, FMC2_BCR1, &bcr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
regmap_read(ebi->regmap, FMC2_BCR1, &bcr);
|
||||
if (bcr & FMC2_BCR1_CCLKEN || !cs)
|
||||
regmap_read(ebi->regmap, FMC2_BTR1, &btr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BTR1, &btr);
|
||||
else
|
||||
regmap_read(ebi->regmap, FMC2_BTR(cs), &btr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &btr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
clk_period = FIELD_GET(FMC2_BTR_CLKDIV, btr) + 1;
|
||||
|
||||
@ -569,11 +603,16 @@ static int stm32_fmc2_ebi_set_address_setup(struct stm32_fmc2_ebi *ebi,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (prop->reg_type == FMC2_REG_BWTR)
|
||||
regmap_read(ebi->regmap, FMC2_BWTR(cs), &bxtr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BWTR(cs), &bxtr);
|
||||
else
|
||||
regmap_read(ebi->regmap, FMC2_BTR(cs), &bxtr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &bxtr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if ((bxtr & FMC2_BXTR_ACCMOD) == val || bcr & FMC2_BCR_MUXEN)
|
||||
val = clamp_val(setup, 1, FMC2_BXTR_ADDSET_MAX);
|
||||
@ -691,11 +730,14 @@ static int stm32_fmc2_ebi_set_max_low_pulse(struct stm32_fmc2_ebi *ebi,
|
||||
int cs, u32 setup)
|
||||
{
|
||||
u32 old_val, new_val, pcscntr;
|
||||
int ret;
|
||||
|
||||
if (setup < 1)
|
||||
return 0;
|
||||
|
||||
regmap_read(ebi->regmap, FMC2_PCSCNTR, &pcscntr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_PCSCNTR, &pcscntr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Enable counter for the bank */
|
||||
regmap_update_bits(ebi->regmap, FMC2_PCSCNTR,
|
||||
@ -942,17 +984,20 @@ static void stm32_fmc2_ebi_disable_bank(struct stm32_fmc2_ebi *ebi, int cs)
|
||||
regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_MBKEN, 0);
|
||||
}
|
||||
|
||||
static void stm32_fmc2_ebi_save_setup(struct stm32_fmc2_ebi *ebi)
|
||||
static int stm32_fmc2_ebi_save_setup(struct stm32_fmc2_ebi *ebi)
|
||||
{
|
||||
unsigned int cs;
|
||||
int ret;
|
||||
|
||||
for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) {
|
||||
regmap_read(ebi->regmap, FMC2_BCR(cs), &ebi->bcr[cs]);
|
||||
regmap_read(ebi->regmap, FMC2_BTR(cs), &ebi->btr[cs]);
|
||||
regmap_read(ebi->regmap, FMC2_BWTR(cs), &ebi->bwtr[cs]);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &ebi->bcr[cs]);
|
||||
ret |= regmap_read(ebi->regmap, FMC2_BTR(cs), &ebi->btr[cs]);
|
||||
ret |= regmap_read(ebi->regmap, FMC2_BWTR(cs), &ebi->bwtr[cs]);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
regmap_read(ebi->regmap, FMC2_PCSCNTR, &ebi->pcscntr);
|
||||
return regmap_read(ebi->regmap, FMC2_PCSCNTR, &ebi->pcscntr);
|
||||
}
|
||||
|
||||
static void stm32_fmc2_ebi_set_setup(struct stm32_fmc2_ebi *ebi)
|
||||
@ -981,22 +1026,29 @@ static void stm32_fmc2_ebi_disable_banks(struct stm32_fmc2_ebi *ebi)
|
||||
}
|
||||
|
||||
/* NWAIT signal can not be connected to EBI controller and NAND controller */
|
||||
static bool stm32_fmc2_ebi_nwait_used_by_ctrls(struct stm32_fmc2_ebi *ebi)
|
||||
static int stm32_fmc2_ebi_nwait_used_by_ctrls(struct stm32_fmc2_ebi *ebi)
|
||||
{
|
||||
struct device *dev = ebi->dev;
|
||||
unsigned int cs;
|
||||
u32 bcr;
|
||||
int ret;
|
||||
|
||||
for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) {
|
||||
if (!(ebi->bank_assigned & BIT(cs)))
|
||||
continue;
|
||||
|
||||
regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if ((bcr & FMC2_BCR_WAITEN || bcr & FMC2_BCR_ASYNCWAIT) &&
|
||||
ebi->bank_assigned & BIT(FMC2_NAND))
|
||||
return true;
|
||||
ebi->bank_assigned & BIT(FMC2_NAND)) {
|
||||
dev_err(dev, "NWAIT signal connected to EBI and NAND controllers\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void stm32_fmc2_ebi_enable(struct stm32_fmc2_ebi *ebi)
|
||||
@ -1083,10 +1135,9 @@ static int stm32_fmc2_ebi_parse_dt(struct stm32_fmc2_ebi *ebi)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (stm32_fmc2_ebi_nwait_used_by_ctrls(ebi)) {
|
||||
dev_err(dev, "NWAIT signal connected to EBI and NAND controllers\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
ret = stm32_fmc2_ebi_nwait_used_by_ctrls(ebi);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
stm32_fmc2_ebi_enable(ebi);
|
||||
|
||||
@ -1131,7 +1182,10 @@ static int stm32_fmc2_ebi_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
goto err_release;
|
||||
|
||||
stm32_fmc2_ebi_save_setup(ebi);
|
||||
ret = stm32_fmc2_ebi_save_setup(ebi);
|
||||
if (ret)
|
||||
goto err_release;
|
||||
|
||||
platform_set_drvdata(pdev, ebi);
|
||||
|
||||
return 0;
|
||||
|
@ -3125,13 +3125,13 @@ static ssize_t mtf_test_write(struct file *file, const char __user *buf,
|
||||
test->buffer = kzalloc(BUFFER_SIZE, GFP_KERNEL);
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
test->highmem = alloc_pages(GFP_KERNEL | __GFP_HIGHMEM, BUFFER_ORDER);
|
||||
if (!test->highmem) {
|
||||
count = -ENOMEM;
|
||||
goto free_test_buffer;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
if (test->buffer && test->highmem) {
|
||||
#else
|
||||
if (test->buffer) {
|
||||
#endif
|
||||
mutex_lock(&mmc_test_lock);
|
||||
mmc_test_run(test, testcase);
|
||||
mutex_unlock(&mmc_test_lock);
|
||||
@ -3139,6 +3139,7 @@ static ssize_t mtf_test_write(struct file *file, const char __user *buf,
|
||||
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
__free_pages(test->highmem, BUFFER_ORDER);
|
||||
free_test_buffer:
|
||||
#endif
|
||||
kfree(test->buffer);
|
||||
kfree(test);
|
||||
|
@ -3171,6 +3171,10 @@ int dw_mci_probe(struct dw_mci *host)
|
||||
host->biu_clk = devm_clk_get(host->dev, "biu");
|
||||
if (IS_ERR(host->biu_clk)) {
|
||||
dev_dbg(host->dev, "biu clock not available\n");
|
||||
ret = PTR_ERR(host->biu_clk);
|
||||
if (ret == -EPROBE_DEFER)
|
||||
return ret;
|
||||
|
||||
} else {
|
||||
ret = clk_prepare_enable(host->biu_clk);
|
||||
if (ret) {
|
||||
@ -3182,6 +3186,10 @@ int dw_mci_probe(struct dw_mci *host)
|
||||
host->ciu_clk = devm_clk_get(host->dev, "ciu");
|
||||
if (IS_ERR(host->ciu_clk)) {
|
||||
dev_dbg(host->dev, "ciu clock not available\n");
|
||||
ret = PTR_ERR(host->ciu_clk);
|
||||
if (ret == -EPROBE_DEFER)
|
||||
goto err_clk_biu;
|
||||
|
||||
host->bus_hz = host->pdata->bus_hz;
|
||||
} else {
|
||||
ret = clk_prepare_enable(host->ciu_clk);
|
||||
|
@ -540,7 +540,6 @@ static void bond_ipsec_del_sa_all(struct bonding *bond)
|
||||
} else {
|
||||
slave->dev->xfrmdev_ops->xdo_dev_state_delete(ipsec->xs);
|
||||
}
|
||||
ipsec->xs->xso.real_dev = NULL;
|
||||
}
|
||||
spin_unlock_bh(&bond->ipsec_lock);
|
||||
rcu_read_unlock();
|
||||
@ -557,34 +556,30 @@ static bool bond_ipsec_offload_ok(struct sk_buff *skb, struct xfrm_state *xs)
|
||||
struct net_device *real_dev;
|
||||
struct slave *curr_active;
|
||||
struct bonding *bond;
|
||||
int err;
|
||||
bool ok = false;
|
||||
|
||||
bond = netdev_priv(bond_dev);
|
||||
rcu_read_lock();
|
||||
curr_active = rcu_dereference(bond->curr_active_slave);
|
||||
if (!curr_active)
|
||||
goto out;
|
||||
real_dev = curr_active->dev;
|
||||
|
||||
if (BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) {
|
||||
err = false;
|
||||
if (BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!xs->xso.real_dev) {
|
||||
err = false;
|
||||
if (!xs->xso.real_dev)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!real_dev->xfrmdev_ops ||
|
||||
!real_dev->xfrmdev_ops->xdo_dev_offload_ok ||
|
||||
netif_is_bond_master(real_dev)) {
|
||||
err = false;
|
||||
netif_is_bond_master(real_dev))
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = real_dev->xfrmdev_ops->xdo_dev_offload_ok(skb, xs);
|
||||
ok = real_dev->xfrmdev_ops->xdo_dev_offload_ok(skb, xs);
|
||||
out:
|
||||
rcu_read_unlock();
|
||||
return err;
|
||||
return ok;
|
||||
}
|
||||
|
||||
static const struct xfrmdev_ops bond_xfrmdev_ops = {
|
||||
|
@ -822,7 +822,7 @@ static int bond_option_active_slave_set(struct bonding *bond,
|
||||
/* check to see if we are clearing active */
|
||||
if (!slave_dev) {
|
||||
netdev_dbg(bond->dev, "Clearing current active slave\n");
|
||||
RCU_INIT_POINTER(bond->curr_active_slave, NULL);
|
||||
bond_change_active_slave(bond, NULL);
|
||||
bond_select_active_slave(bond);
|
||||
} else {
|
||||
struct slave *old_active = rtnl_dereference(bond->curr_active_slave);
|
||||
|
@ -15,3 +15,7 @@ mv88e6xxx-objs += port_hidden.o
|
||||
mv88e6xxx-$(CONFIG_NET_DSA_MV88E6XXX_PTP) += ptp.o
|
||||
mv88e6xxx-objs += serdes.o
|
||||
mv88e6xxx-objs += smi.o
|
||||
mv88e6xxx-objs += trace.o
|
||||
|
||||
# for tracing framework to find trace.h
|
||||
CFLAGS_trace.o := -I$(src)
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
#include "chip.h"
|
||||
#include "global1.h"
|
||||
#include "trace.h"
|
||||
|
||||
/* Offset 0x01: ATU FID Register */
|
||||
|
||||
@ -114,6 +115,19 @@ static int mv88e6xxx_g1_atu_op_wait(struct mv88e6xxx_chip *chip)
|
||||
return mv88e6xxx_g1_wait_bit(chip, MV88E6XXX_G1_ATU_OP, bit, 0);
|
||||
}
|
||||
|
||||
static int mv88e6xxx_g1_read_atu_violation(struct mv88e6xxx_chip *chip)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = mv88e6xxx_g1_write(chip, MV88E6XXX_G1_ATU_OP,
|
||||
MV88E6XXX_G1_ATU_OP_BUSY |
|
||||
MV88E6XXX_G1_ATU_OP_GET_CLR_VIOLATION);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return mv88e6xxx_g1_atu_op_wait(chip);
|
||||
}
|
||||
|
||||
static int mv88e6xxx_g1_atu_op(struct mv88e6xxx_chip *chip, u16 fid, u16 op)
|
||||
{
|
||||
u16 val;
|
||||
@ -159,6 +173,41 @@ int mv88e6xxx_g1_atu_get_next(struct mv88e6xxx_chip *chip, u16 fid)
|
||||
return mv88e6xxx_g1_atu_op(chip, fid, MV88E6XXX_G1_ATU_OP_GET_NEXT_DB);
|
||||
}
|
||||
|
||||
static int mv88e6xxx_g1_atu_fid_read(struct mv88e6xxx_chip *chip, u16 *fid)
|
||||
{
|
||||
u16 val = 0, upper = 0, op = 0;
|
||||
int err = -EOPNOTSUPP;
|
||||
|
||||
if (mv88e6xxx_num_databases(chip) > 256) {
|
||||
err = mv88e6xxx_g1_read(chip, MV88E6352_G1_ATU_FID, &val);
|
||||
val &= 0xfff;
|
||||
if (err)
|
||||
return err;
|
||||
} else {
|
||||
err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_ATU_OP, &op);
|
||||
if (err)
|
||||
return err;
|
||||
if (mv88e6xxx_num_databases(chip) > 64) {
|
||||
/* ATU DBNum[7:4] are located in ATU Control 15:12 */
|
||||
err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_ATU_CTL,
|
||||
&upper);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
upper = (upper >> 8) & 0x00f0;
|
||||
} else if (mv88e6xxx_num_databases(chip) > 16) {
|
||||
/* ATU DBNum[5:4] are located in ATU Operation 9:8 */
|
||||
upper = (op >> 4) & 0x30;
|
||||
}
|
||||
|
||||
/* ATU DBNum[3:0] are located in ATU Operation 3:0 */
|
||||
val = (op & 0xf) | upper;
|
||||
}
|
||||
*fid = val;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Offset 0x0C: ATU Data Register */
|
||||
|
||||
static int mv88e6xxx_g1_atu_data_read(struct mv88e6xxx_chip *chip,
|
||||
@ -353,14 +402,12 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id)
|
||||
{
|
||||
struct mv88e6xxx_chip *chip = dev_id;
|
||||
struct mv88e6xxx_atu_entry entry;
|
||||
int spid;
|
||||
int err;
|
||||
u16 val;
|
||||
int err, spid;
|
||||
u16 val, fid;
|
||||
|
||||
mv88e6xxx_reg_lock(chip);
|
||||
|
||||
err = mv88e6xxx_g1_atu_op(chip, 0,
|
||||
MV88E6XXX_G1_ATU_OP_GET_CLR_VIOLATION);
|
||||
err = mv88e6xxx_g1_read_atu_violation(chip);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
@ -368,6 +415,10 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id)
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = mv88e6xxx_g1_atu_fid_read(chip, &fid);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = mv88e6xxx_g1_atu_data_read(chip, &entry);
|
||||
if (err)
|
||||
goto out;
|
||||
@ -385,23 +436,24 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id)
|
||||
}
|
||||
|
||||
if (val & MV88E6XXX_G1_ATU_OP_MEMBER_VIOLATION) {
|
||||
dev_err_ratelimited(chip->dev,
|
||||
"ATU member violation for %pM portvec %x spid %d\n",
|
||||
entry.mac, entry.portvec, spid);
|
||||
trace_mv88e6xxx_atu_member_violation(chip->dev, spid,
|
||||
entry.portvec, entry.mac,
|
||||
fid);
|
||||
chip->ports[spid].atu_member_violation++;
|
||||
}
|
||||
|
||||
if (val & MV88E6XXX_G1_ATU_OP_MISS_VIOLATION) {
|
||||
dev_err_ratelimited(chip->dev,
|
||||
"ATU miss violation for %pM portvec %x spid %d\n",
|
||||
entry.mac, entry.portvec, spid);
|
||||
trace_mv88e6xxx_atu_miss_violation(chip->dev, spid,
|
||||
entry.portvec, entry.mac,
|
||||
fid);
|
||||
chip->ports[spid].atu_miss_violation++;
|
||||
}
|
||||
|
||||
if (val & MV88E6XXX_G1_ATU_OP_FULL_VIOLATION) {
|
||||
dev_err_ratelimited(chip->dev,
|
||||
"ATU full violation for %pM portvec %x spid %d\n",
|
||||
entry.mac, entry.portvec, spid);
|
||||
trace_mv88e6xxx_atu_full_violation(chip->dev, spid,
|
||||
entry.portvec, entry.mac,
|
||||
fid);
|
||||
if (spid < ARRAY_SIZE(chip->ports))
|
||||
chip->ports[spid].atu_full_violation++;
|
||||
}
|
||||
mv88e6xxx_reg_unlock(chip);
|
||||
|
6
drivers/net/dsa/mv88e6xxx/trace.c
Normal file
6
drivers/net/dsa/mv88e6xxx/trace.c
Normal file
@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/* Copyright 2022 NXP
|
||||
*/
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include "trace.h"
|
66
drivers/net/dsa/mv88e6xxx/trace.h
Normal file
66
drivers/net/dsa/mv88e6xxx/trace.h
Normal file
@ -0,0 +1,66 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/* Copyright 2022 NXP
|
||||
*/
|
||||
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM mv88e6xxx
|
||||
|
||||
#if !defined(_MV88E6XXX_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _MV88E6XXX_TRACE_H
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
DECLARE_EVENT_CLASS(mv88e6xxx_atu_violation,
|
||||
|
||||
TP_PROTO(const struct device *dev, int spid, u16 portvec,
|
||||
const unsigned char *addr, u16 fid),
|
||||
|
||||
TP_ARGS(dev, spid, portvec, addr, fid),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__string(name, dev_name(dev))
|
||||
__field(int, spid)
|
||||
__field(u16, portvec)
|
||||
__array(unsigned char, addr, ETH_ALEN)
|
||||
__field(u16, fid)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(name, dev_name(dev));
|
||||
__entry->spid = spid;
|
||||
__entry->portvec = portvec;
|
||||
memcpy(__entry->addr, addr, ETH_ALEN);
|
||||
__entry->fid = fid;
|
||||
),
|
||||
|
||||
TP_printk("dev %s spid %d portvec 0x%x addr %pM fid %u",
|
||||
__get_str(name), __entry->spid, __entry->portvec,
|
||||
__entry->addr, __entry->fid)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(mv88e6xxx_atu_violation, mv88e6xxx_atu_member_violation,
|
||||
TP_PROTO(const struct device *dev, int spid, u16 portvec,
|
||||
const unsigned char *addr, u16 fid),
|
||||
TP_ARGS(dev, spid, portvec, addr, fid));
|
||||
|
||||
DEFINE_EVENT(mv88e6xxx_atu_violation, mv88e6xxx_atu_miss_violation,
|
||||
TP_PROTO(const struct device *dev, int spid, u16 portvec,
|
||||
const unsigned char *addr, u16 fid),
|
||||
TP_ARGS(dev, spid, portvec, addr, fid));
|
||||
|
||||
DEFINE_EVENT(mv88e6xxx_atu_violation, mv88e6xxx_atu_full_violation,
|
||||
TP_PROTO(const struct device *dev, int spid, u16 portvec,
|
||||
const unsigned char *addr, u16 fid),
|
||||
TP_ARGS(dev, spid, portvec, addr, fid));
|
||||
|
||||
#endif /* _MV88E6XXX_TRACE_H */
|
||||
|
||||
/* We don't want to use include/trace/events */
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
#define TRACE_INCLUDE_PATH .
|
||||
#undef TRACE_INCLUDE_FILE
|
||||
#define TRACE_INCLUDE_FILE trace
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
@ -17,6 +17,7 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/of_mdio.h>
|
||||
@ -38,6 +39,10 @@
|
||||
#define VSC73XX_BLOCK_ARBITER 0x5 /* Only subblock 0 */
|
||||
#define VSC73XX_BLOCK_SYSTEM 0x7 /* Only subblock 0 */
|
||||
|
||||
/* MII Block subblock */
|
||||
#define VSC73XX_BLOCK_MII_INTERNAL 0x0 /* Internal MDIO subblock */
|
||||
#define VSC73XX_BLOCK_MII_EXTERNAL 0x1 /* External MDIO subblock */
|
||||
|
||||
#define CPU_PORT 6 /* CPU port */
|
||||
|
||||
/* MAC Block registers */
|
||||
@ -196,6 +201,8 @@
|
||||
#define VSC73XX_MII_CMD 0x1
|
||||
#define VSC73XX_MII_DATA 0x2
|
||||
|
||||
#define VSC73XX_MII_STAT_BUSY BIT(3)
|
||||
|
||||
/* Arbiter block 5 registers */
|
||||
#define VSC73XX_ARBEMPTY 0x0c
|
||||
#define VSC73XX_ARBDISC 0x0e
|
||||
@ -269,6 +276,10 @@
|
||||
#define IS_7398(a) ((a)->chipid == VSC73XX_CHIPID_ID_7398)
|
||||
#define IS_739X(a) (IS_7395(a) || IS_7398(a))
|
||||
|
||||
#define VSC73XX_POLL_SLEEP_US 1000
|
||||
#define VSC73XX_MDIO_POLL_SLEEP_US 5
|
||||
#define VSC73XX_POLL_TIMEOUT_US 10000
|
||||
|
||||
struct vsc73xx_counter {
|
||||
u8 counter;
|
||||
const char *name;
|
||||
@ -484,6 +495,22 @@ static int vsc73xx_detect(struct vsc73xx *vsc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vsc73xx_mdio_busy_check(struct vsc73xx *vsc)
|
||||
{
|
||||
int ret, err;
|
||||
u32 val;
|
||||
|
||||
ret = read_poll_timeout(vsc73xx_read, err,
|
||||
err < 0 || !(val & VSC73XX_MII_STAT_BUSY),
|
||||
VSC73XX_MDIO_POLL_SLEEP_US,
|
||||
VSC73XX_POLL_TIMEOUT_US, false, vsc,
|
||||
VSC73XX_BLOCK_MII, VSC73XX_BLOCK_MII_INTERNAL,
|
||||
VSC73XX_MII_STAT, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
return err;
|
||||
}
|
||||
|
||||
static int vsc73xx_phy_read(struct dsa_switch *ds, int phy, int regnum)
|
||||
{
|
||||
struct vsc73xx *vsc = ds->priv;
|
||||
@ -491,12 +518,20 @@ static int vsc73xx_phy_read(struct dsa_switch *ds, int phy, int regnum)
|
||||
u32 val;
|
||||
int ret;
|
||||
|
||||
ret = vsc73xx_mdio_busy_check(vsc);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Setting bit 26 means "read" */
|
||||
cmd = BIT(26) | (phy << 21) | (regnum << 16);
|
||||
ret = vsc73xx_write(vsc, VSC73XX_BLOCK_MII, 0, 1, cmd);
|
||||
if (ret)
|
||||
return ret;
|
||||
msleep(2);
|
||||
|
||||
ret = vsc73xx_mdio_busy_check(vsc);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = vsc73xx_read(vsc, VSC73XX_BLOCK_MII, 0, 2, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
@ -520,6 +555,10 @@ static int vsc73xx_phy_write(struct dsa_switch *ds, int phy, int regnum,
|
||||
u32 cmd;
|
||||
int ret;
|
||||
|
||||
ret = vsc73xx_mdio_busy_check(vsc);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* It was found through tedious experiments that this router
|
||||
* chip really hates to have it's PHYs reset. They
|
||||
* never recover if that happens: autonegotiation stops
|
||||
@ -531,7 +570,7 @@ static int vsc73xx_phy_write(struct dsa_switch *ds, int phy, int regnum,
|
||||
return 0;
|
||||
}
|
||||
|
||||
cmd = (phy << 21) | (regnum << 16);
|
||||
cmd = (phy << 21) | (regnum << 16) | val;
|
||||
ret = vsc73xx_write(vsc, VSC73XX_BLOCK_MII, 0, 1, cmd);
|
||||
if (ret)
|
||||
return ret;
|
||||
@ -780,7 +819,7 @@ static void vsc73xx_adjust_link(struct dsa_switch *ds, int port,
|
||||
* after a PHY or the CPU port comes up or down.
|
||||
*/
|
||||
if (!phydev->link) {
|
||||
int maxloop = 10;
|
||||
int ret, err;
|
||||
|
||||
dev_dbg(vsc->dev, "port %d: went down\n",
|
||||
port);
|
||||
@ -795,19 +834,17 @@ static void vsc73xx_adjust_link(struct dsa_switch *ds, int port,
|
||||
VSC73XX_ARBDISC, BIT(port), BIT(port));
|
||||
|
||||
/* Wait until queue is empty */
|
||||
vsc73xx_read(vsc, VSC73XX_BLOCK_ARBITER, 0,
|
||||
ret = read_poll_timeout(vsc73xx_read, err,
|
||||
err < 0 || (val & BIT(port)),
|
||||
VSC73XX_POLL_SLEEP_US,
|
||||
VSC73XX_POLL_TIMEOUT_US, false,
|
||||
vsc, VSC73XX_BLOCK_ARBITER, 0,
|
||||
VSC73XX_ARBEMPTY, &val);
|
||||
while (!(val & BIT(port))) {
|
||||
msleep(1);
|
||||
vsc73xx_read(vsc, VSC73XX_BLOCK_ARBITER, 0,
|
||||
VSC73XX_ARBEMPTY, &val);
|
||||
if (--maxloop == 0) {
|
||||
if (ret)
|
||||
dev_err(vsc->dev,
|
||||
"timeout waiting for block arbiter\n");
|
||||
/* Continue anyway */
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (err < 0)
|
||||
dev_err(vsc->dev, "error reading arbiter\n");
|
||||
|
||||
/* Put this port into reset */
|
||||
vsc73xx_write(vsc, VSC73XX_BLOCK_MAC, port, VSC73XX_MAC_CFG,
|
||||
|
@ -1244,7 +1244,8 @@ static u64 hash_filter_ntuple(struct ch_filter_specification *fs,
|
||||
* in the Compressed Filter Tuple.
|
||||
*/
|
||||
if (tp->vlan_shift >= 0 && fs->mask.ivlan)
|
||||
ntuple |= (FT_VLAN_VLD_F | fs->val.ivlan) << tp->vlan_shift;
|
||||
ntuple |= (u64)(FT_VLAN_VLD_F |
|
||||
fs->val.ivlan) << tp->vlan_shift;
|
||||
|
||||
if (tp->port_shift >= 0 && fs->mask.iport)
|
||||
ntuple |= (u64)fs->val.iport << tp->port_shift;
|
||||
|
@ -4536,6 +4536,9 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)
|
||||
struct hns3_nic_priv *priv = netdev_priv(netdev);
|
||||
int ret;
|
||||
|
||||
if (!test_bit(HNS3_NIC_STATE_DOWN, &priv->state))
|
||||
hns3_nic_net_stop(netdev);
|
||||
|
||||
if (!test_and_clear_bit(HNS3_NIC_STATE_INITED, &priv->state)) {
|
||||
netdev_warn(netdev, "already uninitialized\n");
|
||||
return 0;
|
||||
|
@ -10051,7 +10051,7 @@ static void hclge_flr_done(struct hnae3_ae_dev *ae_dev)
|
||||
dev_err(&hdev->pdev->dev, "fail to rebuild, ret=%d\n", ret);
|
||||
|
||||
hdev->reset_type = HNAE3_NONE_RESET;
|
||||
clear_bit(HCLGE_STATE_RST_HANDLING, &hdev->state);
|
||||
if (test_and_clear_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
|
||||
up(&hdev->reset_sem);
|
||||
}
|
||||
|
||||
|
@ -715,10 +715,11 @@ void hclge_mbx_handler(struct hclge_dev *hdev)
|
||||
req = (struct hclge_mbx_vf_to_pf_cmd *)desc->data;
|
||||
|
||||
flag = le16_to_cpu(crq->desc[crq->next_to_use].flag);
|
||||
if (unlikely(!hnae3_get_bit(flag, HCLGE_CMDQ_RX_OUTVLD_B))) {
|
||||
if (unlikely(!hnae3_get_bit(flag, HCLGE_CMDQ_RX_OUTVLD_B) ||
|
||||
req->mbx_src_vfid > hdev->num_req_vfs)) {
|
||||
dev_warn(&hdev->pdev->dev,
|
||||
"dropped invalid mailbox message, code = %u\n",
|
||||
req->msg.code);
|
||||
"dropped invalid mailbox message, code = %u, vfid = %u\n",
|
||||
req->msg.code, req->mbx_src_vfid);
|
||||
|
||||
/* dropping/not processing this invalid message */
|
||||
crq->desc[crq->next_to_use].flag = 0;
|
||||
|
@ -2093,7 +2093,7 @@ static void hclgevf_flr_done(struct hnae3_ae_dev *ae_dev)
|
||||
ret);
|
||||
|
||||
hdev->reset_type = HNAE3_NONE_RESET;
|
||||
clear_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state);
|
||||
if (test_and_clear_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state))
|
||||
up(&hdev->reset_sem);
|
||||
}
|
||||
|
||||
|
@ -990,7 +990,7 @@ static void sun3_82586_timeout(struct net_device *dev, unsigned int txqueue)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printk("%s: xmitter timed out, try to restart! stat: %02x\n",dev->name,p->scb->cus);
|
||||
printk("%s: command-stats: %04x %04x\n",dev->name,swab16(p->xmit_cmds[0]->cmd_status),swab16(p->xmit_cmds[1]->cmd_status));
|
||||
printk("%s: command-stats: %04x\n", dev->name, swab16(p->xmit_cmds[0]->cmd_status));
|
||||
printk("%s: check, whether you set the right interrupt number!\n",dev->name);
|
||||
#endif
|
||||
sun3_82586_close(dev);
|
||||
|
@ -786,7 +786,7 @@ ice_can_reuse_rx_page(struct ice_rx_buf *rx_buf, int rx_buf_pgcnt)
|
||||
return false;
|
||||
#else
|
||||
#define ICE_LAST_OFFSET \
|
||||
(SKB_WITH_OVERHEAD(PAGE_SIZE) - ICE_RXBUF_2048)
|
||||
(SKB_WITH_OVERHEAD(PAGE_SIZE) - ICE_RXBUF_3072)
|
||||
if (rx_buf->page_offset > ICE_LAST_OFFSET)
|
||||
return false;
|
||||
#endif /* PAGE_SIZE < 8192) */
|
||||
|
@ -679,7 +679,7 @@ mlx5e_ethtool_flow_replace(struct mlx5e_priv *priv,
|
||||
if (num_tuples <= 0) {
|
||||
netdev_warn(priv->netdev, "%s: flow is not valid %d\n",
|
||||
__func__, num_tuples);
|
||||
return num_tuples;
|
||||
return num_tuples < 0 ? num_tuples : -EINVAL;
|
||||
}
|
||||
|
||||
eth_ft = get_flow_table(priv, fs, num_tuples);
|
||||
|
@ -159,16 +159,17 @@
|
||||
#define XAE_RCW1_OFFSET 0x00000404 /* Rx Configuration Word 1 */
|
||||
#define XAE_TC_OFFSET 0x00000408 /* Tx Configuration */
|
||||
#define XAE_FCC_OFFSET 0x0000040C /* Flow Control Configuration */
|
||||
#define XAE_EMMC_OFFSET 0x00000410 /* EMAC mode configuration */
|
||||
#define XAE_PHYC_OFFSET 0x00000414 /* RGMII/SGMII configuration */
|
||||
#define XAE_EMMC_OFFSET 0x00000410 /* MAC speed configuration */
|
||||
#define XAE_PHYC_OFFSET 0x00000414 /* RX Max Frame Configuration */
|
||||
#define XAE_ID_OFFSET 0x000004F8 /* Identification register */
|
||||
#define XAE_MDIO_MC_OFFSET 0x00000500 /* MII Management Config */
|
||||
#define XAE_MDIO_MCR_OFFSET 0x00000504 /* MII Management Control */
|
||||
#define XAE_MDIO_MWD_OFFSET 0x00000508 /* MII Management Write Data */
|
||||
#define XAE_MDIO_MRD_OFFSET 0x0000050C /* MII Management Read Data */
|
||||
#define XAE_MDIO_MC_OFFSET 0x00000500 /* MDIO Setup */
|
||||
#define XAE_MDIO_MCR_OFFSET 0x00000504 /* MDIO Control */
|
||||
#define XAE_MDIO_MWD_OFFSET 0x00000508 /* MDIO Write Data */
|
||||
#define XAE_MDIO_MRD_OFFSET 0x0000050C /* MDIO Read Data */
|
||||
#define XAE_UAW0_OFFSET 0x00000700 /* Unicast address word 0 */
|
||||
#define XAE_UAW1_OFFSET 0x00000704 /* Unicast address word 1 */
|
||||
#define XAE_FMI_OFFSET 0x00000708 /* Filter Mask Index */
|
||||
#define XAE_FMI_OFFSET 0x00000708 /* Frame Filter Control */
|
||||
#define XAE_FFE_OFFSET 0x0000070C /* Frame Filter Enable */
|
||||
#define XAE_AF0_OFFSET 0x00000710 /* Address Filter 0 */
|
||||
#define XAE_AF1_OFFSET 0x00000714 /* Address Filter 1 */
|
||||
|
||||
@ -307,7 +308,7 @@
|
||||
*/
|
||||
#define XAE_UAW1_UNICASTADDR_MASK 0x0000FFFF
|
||||
|
||||
/* Bit masks for Axi Ethernet FMI register */
|
||||
/* Bit masks for Axi Ethernet FMC register */
|
||||
#define XAE_FMI_PM_MASK 0x80000000 /* Promis. mode enable */
|
||||
#define XAE_FMI_IND_MASK 0x00000003 /* Index Mask */
|
||||
|
||||
|
@ -409,7 +409,7 @@ static int netdev_set_mac_address(struct net_device *ndev, void *p)
|
||||
*/
|
||||
static void axienet_set_multicast_list(struct net_device *ndev)
|
||||
{
|
||||
int i;
|
||||
int i = 0;
|
||||
u32 reg, af0reg, af1reg;
|
||||
struct axienet_local *lp = netdev_priv(ndev);
|
||||
|
||||
@ -427,7 +427,10 @@ static void axienet_set_multicast_list(struct net_device *ndev)
|
||||
} else if (!netdev_mc_empty(ndev)) {
|
||||
struct netdev_hw_addr *ha;
|
||||
|
||||
i = 0;
|
||||
reg = axienet_ior(lp, XAE_FMI_OFFSET);
|
||||
reg &= ~XAE_FMI_PM_MASK;
|
||||
axienet_iow(lp, XAE_FMI_OFFSET, reg);
|
||||
|
||||
netdev_for_each_mc_addr(ha, ndev) {
|
||||
if (i >= XAE_MULTICAST_CAM_TABLE_NUM)
|
||||
break;
|
||||
@ -446,6 +449,7 @@ static void axienet_set_multicast_list(struct net_device *ndev)
|
||||
axienet_iow(lp, XAE_FMI_OFFSET, reg);
|
||||
axienet_iow(lp, XAE_AF0_OFFSET, af0reg);
|
||||
axienet_iow(lp, XAE_AF1_OFFSET, af1reg);
|
||||
axienet_iow(lp, XAE_FFE_OFFSET, 1);
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
@ -453,17 +457,14 @@ static void axienet_set_multicast_list(struct net_device *ndev)
|
||||
reg &= ~XAE_FMI_PM_MASK;
|
||||
|
||||
axienet_iow(lp, XAE_FMI_OFFSET, reg);
|
||||
|
||||
for (i = 0; i < XAE_MULTICAST_CAM_TABLE_NUM; i++) {
|
||||
reg = axienet_ior(lp, XAE_FMI_OFFSET) & 0xFFFFFF00;
|
||||
reg |= i;
|
||||
|
||||
axienet_iow(lp, XAE_FMI_OFFSET, reg);
|
||||
axienet_iow(lp, XAE_AF0_OFFSET, 0);
|
||||
axienet_iow(lp, XAE_AF1_OFFSET, 0);
|
||||
dev_info(&ndev->dev, "Promiscuous mode disabled.\n");
|
||||
}
|
||||
|
||||
dev_info(&ndev->dev, "Promiscuous mode disabled.\n");
|
||||
for (; i < XAE_MULTICAST_CAM_TABLE_NUM; i++) {
|
||||
reg = axienet_ior(lp, XAE_FMI_OFFSET) & 0xFFFFFF00;
|
||||
reg |= i;
|
||||
axienet_iow(lp, XAE_FMI_OFFSET, reg);
|
||||
axienet_iow(lp, XAE_FFE_OFFSET, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -567,6 +567,9 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
if (skb_cow_head(skb, dev->needed_headroom))
|
||||
goto tx_err;
|
||||
|
||||
if (!pskb_inet_may_pull(skb))
|
||||
goto tx_err;
|
||||
|
||||
skb_reset_inner_headers(skb);
|
||||
|
||||
/* PDP context lookups in gtp_build_skb_*() need rcu read-side lock. */
|
||||
@ -798,7 +801,7 @@ static struct sock *gtp_encap_enable_socket(int fd, int type,
|
||||
sock = sockfd_lookup(fd, &err);
|
||||
if (!sock) {
|
||||
pr_debug("gtp socket fd=%d not found\n", fd);
|
||||
return NULL;
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
sk = sock->sk;
|
||||
|
@ -2675,7 +2675,7 @@ int iwl_mvm_scan_stop(struct iwl_mvm *mvm, int type, bool notify)
|
||||
if (!(mvm->scan_status & type))
|
||||
return 0;
|
||||
|
||||
if (iwl_mvm_is_radio_killed(mvm)) {
|
||||
if (!test_bit(STATUS_DEVICE_ENABLED, &mvm->trans->status)) {
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
@ -4314,11 +4314,27 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
|
||||
if (ISSUPP_ADHOC_ENABLED(adapter->fw_cap_info))
|
||||
wiphy->interface_modes |= BIT(NL80211_IFTYPE_ADHOC);
|
||||
|
||||
wiphy->bands[NL80211_BAND_2GHZ] = &mwifiex_band_2ghz;
|
||||
if (adapter->config_bands & BAND_A)
|
||||
wiphy->bands[NL80211_BAND_5GHZ] = &mwifiex_band_5ghz;
|
||||
else
|
||||
wiphy->bands[NL80211_BAND_2GHZ] = devm_kmemdup(adapter->dev,
|
||||
&mwifiex_band_2ghz,
|
||||
sizeof(mwifiex_band_2ghz),
|
||||
GFP_KERNEL);
|
||||
if (!wiphy->bands[NL80211_BAND_2GHZ]) {
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (adapter->config_bands & BAND_A) {
|
||||
wiphy->bands[NL80211_BAND_5GHZ] = devm_kmemdup(adapter->dev,
|
||||
&mwifiex_band_5ghz,
|
||||
sizeof(mwifiex_band_5ghz),
|
||||
GFP_KERNEL);
|
||||
if (!wiphy->bands[NL80211_BAND_5GHZ]) {
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
} else {
|
||||
wiphy->bands[NL80211_BAND_5GHZ] = NULL;
|
||||
}
|
||||
|
||||
if (adapter->drcs_enabled && ISSUPP_DRCS_ENABLED(adapter->fw_cap_info))
|
||||
wiphy->iface_combinations = &mwifiex_iface_comb_ap_sta_drcs;
|
||||
@ -4411,8 +4427,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
|
||||
if (ret < 0) {
|
||||
mwifiex_dbg(adapter, ERROR,
|
||||
"%s: wiphy_register failed: %d\n", __func__, ret);
|
||||
wiphy_free(wiphy);
|
||||
return ret;
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!adapter->regd) {
|
||||
@ -4454,4 +4469,9 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
|
||||
|
||||
adapter->wiphy = wiphy;
|
||||
return ret;
|
||||
|
||||
err:
|
||||
wiphy_free(wiphy);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1170,7 +1170,7 @@ void cw1200_rx_cb(struct cw1200_common *priv,
|
||||
size_t ies_len = skb->len - (ies - (u8 *)(skb->data));
|
||||
|
||||
tim_ie = cfg80211_find_ie(WLAN_EID_TIM, ies, ies_len);
|
||||
if (tim_ie) {
|
||||
if (tim_ie && tim_ie[1] >= sizeof(struct ieee80211_tim_ie)) {
|
||||
struct ieee80211_tim_ie *tim =
|
||||
(struct ieee80211_tim_ie *)&tim_ie[2];
|
||||
|
||||
|
@ -1751,6 +1751,11 @@ static int pn533_start_poll(struct nfc_dev *nfc_dev,
|
||||
}
|
||||
|
||||
pn533_poll_create_mod_list(dev, im_protocols, tm_protocols);
|
||||
if (!dev->poll_mod_count) {
|
||||
nfc_err(dev->dev,
|
||||
"Poll mod list is empty\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Do not always start polling from the same modulation */
|
||||
get_random_bytes(&rand_mod, sizeof(rand_mod));
|
||||
|
@ -472,12 +472,8 @@ nvmet_rdma_alloc_rsps(struct nvmet_rdma_queue *queue)
|
||||
return 0;
|
||||
|
||||
out_free:
|
||||
while (--i >= 0) {
|
||||
struct nvmet_rdma_rsp *rsp = &queue->rsps[i];
|
||||
|
||||
list_del(&rsp->free_list);
|
||||
nvmet_rdma_free_rsp(ndev, rsp);
|
||||
}
|
||||
while (--i >= 0)
|
||||
nvmet_rdma_free_rsp(ndev, &queue->rsps[i]);
|
||||
kfree(queue->rsps);
|
||||
out:
|
||||
return ret;
|
||||
@ -488,12 +484,8 @@ static void nvmet_rdma_free_rsps(struct nvmet_rdma_queue *queue)
|
||||
struct nvmet_rdma_device *ndev = queue->dev;
|
||||
int i, nr_rsps = queue->recv_queue_size * 2;
|
||||
|
||||
for (i = 0; i < nr_rsps; i++) {
|
||||
struct nvmet_rdma_rsp *rsp = &queue->rsps[i];
|
||||
|
||||
list_del(&rsp->free_list);
|
||||
nvmet_rdma_free_rsp(ndev, rsp);
|
||||
}
|
||||
for (i = 0; i < nr_rsps; i++)
|
||||
nvmet_rdma_free_rsp(ndev, &queue->rsps[i]);
|
||||
kfree(queue->rsps);
|
||||
}
|
||||
|
||||
|
@ -846,6 +846,7 @@ static int nvmet_tcp_handle_icreq(struct nvmet_tcp_queue *queue)
|
||||
pr_err("bad nvme-tcp pdu length (%d)\n",
|
||||
le32_to_cpu(icreq->hdr.plen));
|
||||
nvmet_tcp_fatal_error(queue);
|
||||
return -EPROTO;
|
||||
}
|
||||
|
||||
if (icreq->pfv != NVME_TCP_PFV_1_0) {
|
||||
|
@ -195,7 +195,7 @@ const char *nvmet_trace_disk_name(struct trace_seq *p, char *name)
|
||||
return ret;
|
||||
}
|
||||
|
||||
const char *nvmet_trace_ctrl_name(struct trace_seq *p, struct nvmet_ctrl *ctrl)
|
||||
const char *nvmet_trace_ctrl_id(struct trace_seq *p, u16 ctrl_id)
|
||||
{
|
||||
const char *ret = trace_seq_buffer_ptr(p);
|
||||
|
||||
@ -208,8 +208,8 @@ const char *nvmet_trace_ctrl_name(struct trace_seq *p, struct nvmet_ctrl *ctrl)
|
||||
* If we can know the extra data of the connect command in this stage,
|
||||
* we can update this print statement later.
|
||||
*/
|
||||
if (ctrl)
|
||||
trace_seq_printf(p, "%d", ctrl->cntlid);
|
||||
if (ctrl_id)
|
||||
trace_seq_printf(p, "%d", ctrl_id);
|
||||
else
|
||||
trace_seq_printf(p, "_");
|
||||
trace_seq_putc(p, 0);
|
||||
|
@ -32,18 +32,24 @@ const char *nvmet_trace_parse_fabrics_cmd(struct trace_seq *p, u8 fctype,
|
||||
nvmet_trace_parse_nvm_cmd(p, opcode, cdw10) : \
|
||||
nvmet_trace_parse_admin_cmd(p, opcode, cdw10)))
|
||||
|
||||
const char *nvmet_trace_ctrl_name(struct trace_seq *p, struct nvmet_ctrl *ctrl);
|
||||
#define __print_ctrl_name(ctrl) \
|
||||
nvmet_trace_ctrl_name(p, ctrl)
|
||||
const char *nvmet_trace_ctrl_id(struct trace_seq *p, u16 ctrl_id);
|
||||
#define __print_ctrl_id(ctrl_id) \
|
||||
nvmet_trace_ctrl_id(p, ctrl_id)
|
||||
|
||||
const char *nvmet_trace_disk_name(struct trace_seq *p, char *name);
|
||||
#define __print_disk_name(name) \
|
||||
nvmet_trace_disk_name(p, name)
|
||||
|
||||
#ifndef TRACE_HEADER_MULTI_READ
|
||||
static inline struct nvmet_ctrl *nvmet_req_to_ctrl(struct nvmet_req *req)
|
||||
static inline u16 nvmet_req_to_ctrl_id(struct nvmet_req *req)
|
||||
{
|
||||
return req->sq->ctrl;
|
||||
/*
|
||||
* The queue and controller pointers are not valid until an association
|
||||
* has been established.
|
||||
*/
|
||||
if (!req->sq || !req->sq->ctrl)
|
||||
return 0;
|
||||
return req->sq->ctrl->cntlid;
|
||||
}
|
||||
|
||||
static inline void __assign_req_name(char *name, struct nvmet_req *req)
|
||||
@ -60,7 +66,7 @@ TRACE_EVENT(nvmet_req_init,
|
||||
TP_ARGS(req, cmd),
|
||||
TP_STRUCT__entry(
|
||||
__field(struct nvme_command *, cmd)
|
||||
__field(struct nvmet_ctrl *, ctrl)
|
||||
__field(u16, ctrl_id)
|
||||
__array(char, disk, DISK_NAME_LEN)
|
||||
__field(int, qid)
|
||||
__field(u16, cid)
|
||||
@ -73,7 +79,7 @@ TRACE_EVENT(nvmet_req_init,
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->cmd = cmd;
|
||||
__entry->ctrl = nvmet_req_to_ctrl(req);
|
||||
__entry->ctrl_id = nvmet_req_to_ctrl_id(req);
|
||||
__assign_req_name(__entry->disk, req);
|
||||
__entry->qid = req->sq->qid;
|
||||
__entry->cid = cmd->common.command_id;
|
||||
@ -87,7 +93,7 @@ TRACE_EVENT(nvmet_req_init,
|
||||
),
|
||||
TP_printk("nvmet%s: %sqid=%d, cmdid=%u, nsid=%u, flags=%#x, "
|
||||
"meta=%#llx, cmd=(%s, %s)",
|
||||
__print_ctrl_name(__entry->ctrl),
|
||||
__print_ctrl_id(__entry->ctrl_id),
|
||||
__print_disk_name(__entry->disk),
|
||||
__entry->qid, __entry->cid, __entry->nsid,
|
||||
__entry->flags, __entry->metadata,
|
||||
@ -101,7 +107,7 @@ TRACE_EVENT(nvmet_req_complete,
|
||||
TP_PROTO(struct nvmet_req *req),
|
||||
TP_ARGS(req),
|
||||
TP_STRUCT__entry(
|
||||
__field(struct nvmet_ctrl *, ctrl)
|
||||
__field(u16, ctrl_id)
|
||||
__array(char, disk, DISK_NAME_LEN)
|
||||
__field(int, qid)
|
||||
__field(int, cid)
|
||||
@ -109,7 +115,7 @@ TRACE_EVENT(nvmet_req_complete,
|
||||
__field(u16, status)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->ctrl = nvmet_req_to_ctrl(req);
|
||||
__entry->ctrl_id = nvmet_req_to_ctrl_id(req);
|
||||
__entry->qid = req->cq->qid;
|
||||
__entry->cid = req->cqe->command_id;
|
||||
__entry->result = le64_to_cpu(req->cqe->result.u64);
|
||||
@ -117,7 +123,7 @@ TRACE_EVENT(nvmet_req_complete,
|
||||
__assign_req_name(__entry->disk, req);
|
||||
),
|
||||
TP_printk("nvmet%s: %sqid=%d, cmdid=%u, res=%#llx, status=%#x",
|
||||
__print_ctrl_name(__entry->ctrl),
|
||||
__print_ctrl_id(__entry->ctrl_id),
|
||||
__print_disk_name(__entry->disk),
|
||||
__entry->qid, __entry->cid, __entry->result, __entry->status)
|
||||
|
||||
|
@ -3695,7 +3695,7 @@ static struct rockchip_pin_bank rk3328_pin_banks[] = {
|
||||
PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", 0, 0, 0, 0),
|
||||
PIN_BANK_IOMUX_FLAGS(1, 32, "gpio1", 0, 0, 0, 0),
|
||||
PIN_BANK_IOMUX_FLAGS(2, 32, "gpio2", 0,
|
||||
0,
|
||||
IOMUX_WIDTH_2BIT,
|
||||
IOMUX_WIDTH_3BIT,
|
||||
0),
|
||||
PIN_BANK_IOMUX_FLAGS(3, 32, "gpio3",
|
||||
|
@ -350,6 +350,8 @@ static int pcs_get_function(struct pinctrl_dev *pctldev, unsigned pin,
|
||||
return -ENOTSUPP;
|
||||
fselector = setting->func;
|
||||
function = pinmux_generic_get_function(pctldev, fselector);
|
||||
if (!function)
|
||||
return -EINVAL;
|
||||
*func = function->data;
|
||||
if (!(*func)) {
|
||||
dev_err(pcs->dev, "%s could not find function%i\n",
|
||||
|
@ -1665,9 +1665,15 @@ static int dasd_ese_needs_format(struct dasd_block *block, struct irb *irb)
|
||||
if (!sense)
|
||||
return 0;
|
||||
|
||||
return !!(sense[1] & SNS1_NO_REC_FOUND) ||
|
||||
!!(sense[1] & SNS1_FILE_PROTECTED) ||
|
||||
scsw_cstat(&irb->scsw) == SCHN_STAT_INCORR_LEN;
|
||||
if (sense[1] & SNS1_NO_REC_FOUND)
|
||||
return 1;
|
||||
|
||||
if ((sense[1] & SNS1_INV_TRACK_FORMAT) &&
|
||||
scsw_is_tm(&irb->scsw) &&
|
||||
!(sense[2] & SNS2_ENV_DATA_PRESENT))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dasd_ese_oos_cond(u8 *sense)
|
||||
@ -1688,7 +1694,7 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
|
||||
struct dasd_device *device;
|
||||
unsigned long now;
|
||||
int nrf_suppressed = 0;
|
||||
int fp_suppressed = 0;
|
||||
int it_suppressed = 0;
|
||||
struct request *req;
|
||||
u8 *sense = NULL;
|
||||
int expires;
|
||||
@ -1743,8 +1749,9 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
|
||||
*/
|
||||
sense = dasd_get_sense(irb);
|
||||
if (sense) {
|
||||
fp_suppressed = (sense[1] & SNS1_FILE_PROTECTED) &&
|
||||
test_bit(DASD_CQR_SUPPRESS_FP, &cqr->flags);
|
||||
it_suppressed = (sense[1] & SNS1_INV_TRACK_FORMAT) &&
|
||||
!(sense[2] & SNS2_ENV_DATA_PRESENT) &&
|
||||
test_bit(DASD_CQR_SUPPRESS_IT, &cqr->flags);
|
||||
nrf_suppressed = (sense[1] & SNS1_NO_REC_FOUND) &&
|
||||
test_bit(DASD_CQR_SUPPRESS_NRF, &cqr->flags);
|
||||
|
||||
@ -1759,7 +1766,7 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!(fp_suppressed || nrf_suppressed))
|
||||
if (!(it_suppressed || nrf_suppressed))
|
||||
device->discipline->dump_sense_dbf(device, irb, "int");
|
||||
|
||||
if (device->features & DASD_FEATURE_ERPLOG)
|
||||
@ -2513,14 +2520,17 @@ static int _dasd_sleep_on_queue(struct list_head *ccw_queue, int interruptible)
|
||||
rc = 0;
|
||||
list_for_each_entry_safe(cqr, n, ccw_queue, blocklist) {
|
||||
/*
|
||||
* In some cases the 'File Protected' or 'Incorrect Length'
|
||||
* error might be expected and error recovery would be
|
||||
* unnecessary in these cases. Check if the according suppress
|
||||
* bit is set.
|
||||
* In some cases certain errors might be expected and
|
||||
* error recovery would be unnecessary in these cases.
|
||||
* Check if the according suppress bit is set.
|
||||
*/
|
||||
sense = dasd_get_sense(&cqr->irb);
|
||||
if (sense && sense[1] & SNS1_FILE_PROTECTED &&
|
||||
test_bit(DASD_CQR_SUPPRESS_FP, &cqr->flags))
|
||||
if (sense && (sense[1] & SNS1_INV_TRACK_FORMAT) &&
|
||||
!(sense[2] & SNS2_ENV_DATA_PRESENT) &&
|
||||
test_bit(DASD_CQR_SUPPRESS_IT, &cqr->flags))
|
||||
continue;
|
||||
if (sense && (sense[1] & SNS1_NO_REC_FOUND) &&
|
||||
test_bit(DASD_CQR_SUPPRESS_NRF, &cqr->flags))
|
||||
continue;
|
||||
if (scsw_cstat(&cqr->irb.scsw) == 0x40 &&
|
||||
test_bit(DASD_CQR_SUPPRESS_IL, &cqr->flags))
|
||||
|
@ -1401,12 +1401,6 @@ dasd_3990_erp_file_prot(struct dasd_ccw_req * erp)
|
||||
|
||||
struct dasd_device *device = erp->startdev;
|
||||
|
||||
/*
|
||||
* In some cases the 'File Protected' error might be expected and
|
||||
* log messages shouldn't be written then.
|
||||
* Check if the according suppress bit is set.
|
||||
*/
|
||||
if (!test_bit(DASD_CQR_SUPPRESS_FP, &erp->flags))
|
||||
dev_err(&device->cdev->dev,
|
||||
"Accessing the DASD failed because of a hardware error\n");
|
||||
|
||||
|
@ -2201,6 +2201,7 @@ dasd_eckd_analysis_ccw(struct dasd_device *device)
|
||||
cqr->status = DASD_CQR_FILLED;
|
||||
/* Set flags to suppress output for expected errors */
|
||||
set_bit(DASD_CQR_SUPPRESS_NRF, &cqr->flags);
|
||||
set_bit(DASD_CQR_SUPPRESS_IT, &cqr->flags);
|
||||
|
||||
return cqr;
|
||||
}
|
||||
@ -2482,7 +2483,6 @@ dasd_eckd_build_check_tcw(struct dasd_device *base, struct format_data_t *fdata,
|
||||
cqr->buildclk = get_tod_clock();
|
||||
cqr->status = DASD_CQR_FILLED;
|
||||
/* Set flags to suppress output for expected errors */
|
||||
set_bit(DASD_CQR_SUPPRESS_FP, &cqr->flags);
|
||||
set_bit(DASD_CQR_SUPPRESS_IL, &cqr->flags);
|
||||
|
||||
return cqr;
|
||||
@ -4031,8 +4031,6 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_cmd_single(
|
||||
|
||||
/* Set flags to suppress output for expected errors */
|
||||
if (dasd_eckd_is_ese(basedev)) {
|
||||
set_bit(DASD_CQR_SUPPRESS_FP, &cqr->flags);
|
||||
set_bit(DASD_CQR_SUPPRESS_IL, &cqr->flags);
|
||||
set_bit(DASD_CQR_SUPPRESS_NRF, &cqr->flags);
|
||||
}
|
||||
|
||||
@ -4534,9 +4532,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track(
|
||||
|
||||
/* Set flags to suppress output for expected errors */
|
||||
if (dasd_eckd_is_ese(basedev)) {
|
||||
set_bit(DASD_CQR_SUPPRESS_FP, &cqr->flags);
|
||||
set_bit(DASD_CQR_SUPPRESS_IL, &cqr->flags);
|
||||
set_bit(DASD_CQR_SUPPRESS_NRF, &cqr->flags);
|
||||
set_bit(DASD_CQR_SUPPRESS_IT, &cqr->flags);
|
||||
}
|
||||
|
||||
return cqr;
|
||||
@ -5706,26 +5703,16 @@ static void dasd_eckd_dump_sense(struct dasd_device *device,
|
||||
{
|
||||
u8 *sense = dasd_get_sense(irb);
|
||||
|
||||
if (scsw_is_tm(&irb->scsw)) {
|
||||
/*
|
||||
* In some cases the 'File Protected' or 'Incorrect Length'
|
||||
* error might be expected and log messages shouldn't be written
|
||||
* then. Check if the according suppress bit is set.
|
||||
* In some cases certain errors might be expected and
|
||||
* log messages shouldn't be written then.
|
||||
* Check if the according suppress bit is set.
|
||||
*/
|
||||
if (sense && (sense[1] & SNS1_FILE_PROTECTED) &&
|
||||
test_bit(DASD_CQR_SUPPRESS_FP, &req->flags))
|
||||
return;
|
||||
if (scsw_cstat(&irb->scsw) == 0x40 &&
|
||||
test_bit(DASD_CQR_SUPPRESS_IL, &req->flags))
|
||||
if (sense && (sense[1] & SNS1_INV_TRACK_FORMAT) &&
|
||||
!(sense[2] & SNS2_ENV_DATA_PRESENT) &&
|
||||
test_bit(DASD_CQR_SUPPRESS_IT, &req->flags))
|
||||
return;
|
||||
|
||||
dasd_eckd_dump_sense_tcw(device, req, irb);
|
||||
} else {
|
||||
/*
|
||||
* In some cases the 'Command Reject' or 'No Record Found'
|
||||
* error might be expected and log messages shouldn't be
|
||||
* written then. Check if the according suppress bit is set.
|
||||
*/
|
||||
if (sense && sense[0] & SNS0_CMD_REJECT &&
|
||||
test_bit(DASD_CQR_SUPPRESS_CR, &req->flags))
|
||||
return;
|
||||
@ -5734,9 +5721,15 @@ static void dasd_eckd_dump_sense(struct dasd_device *device,
|
||||
test_bit(DASD_CQR_SUPPRESS_NRF, &req->flags))
|
||||
return;
|
||||
|
||||
if (scsw_cstat(&irb->scsw) == 0x40 &&
|
||||
test_bit(DASD_CQR_SUPPRESS_IL, &req->flags))
|
||||
return;
|
||||
|
||||
if (scsw_is_tm(&irb->scsw))
|
||||
dasd_eckd_dump_sense_tcw(device, req, irb);
|
||||
else
|
||||
dasd_eckd_dump_sense_ccw(device, req, irb);
|
||||
}
|
||||
}
|
||||
|
||||
static int dasd_eckd_pm_freeze(struct dasd_device *device)
|
||||
{
|
||||
|
@ -226,7 +226,7 @@ struct dasd_ccw_req {
|
||||
* The following flags are used to suppress output of certain errors.
|
||||
*/
|
||||
#define DASD_CQR_SUPPRESS_NRF 4 /* Suppress 'No Record Found' error */
|
||||
#define DASD_CQR_SUPPRESS_FP 5 /* Suppress 'File Protected' error*/
|
||||
#define DASD_CQR_SUPPRESS_IT 5 /* Suppress 'Invalid Track' error*/
|
||||
#define DASD_CQR_SUPPRESS_IL 6 /* Suppress 'Incorrect Length' error */
|
||||
#define DASD_CQR_SUPPRESS_CR 7 /* Suppress 'Command Reject' error */
|
||||
|
||||
|
@ -16,20 +16,21 @@ struct idset {
|
||||
unsigned long bitmap[];
|
||||
};
|
||||
|
||||
static inline unsigned long bitmap_size(int num_ssid, int num_id)
|
||||
static inline unsigned long idset_bitmap_size(int num_ssid, int num_id)
|
||||
{
|
||||
return BITS_TO_LONGS(num_ssid * num_id) * sizeof(unsigned long);
|
||||
return bitmap_size(size_mul(num_ssid, num_id));
|
||||
}
|
||||
|
||||
static struct idset *idset_new(int num_ssid, int num_id)
|
||||
{
|
||||
struct idset *set;
|
||||
|
||||
set = vmalloc(sizeof(struct idset) + bitmap_size(num_ssid, num_id));
|
||||
set = vmalloc(sizeof(struct idset) +
|
||||
idset_bitmap_size(num_ssid, num_id));
|
||||
if (set) {
|
||||
set->num_ssid = num_ssid;
|
||||
set->num_id = num_id;
|
||||
memset(set->bitmap, 0, bitmap_size(num_ssid, num_id));
|
||||
memset(set->bitmap, 0, idset_bitmap_size(num_ssid, num_id));
|
||||
}
|
||||
return set;
|
||||
}
|
||||
@ -41,7 +42,8 @@ void idset_free(struct idset *set)
|
||||
|
||||
void idset_fill(struct idset *set)
|
||||
{
|
||||
memset(set->bitmap, 0xff, bitmap_size(set->num_ssid, set->num_id));
|
||||
memset(set->bitmap, 0xff,
|
||||
idset_bitmap_size(set->num_ssid, set->num_id));
|
||||
}
|
||||
|
||||
static inline void idset_add(struct idset *set, int ssid, int id)
|
||||
|
@ -642,6 +642,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
|
||||
|
||||
if (aac_comm_init(dev)<0){
|
||||
kfree(dev->queues);
|
||||
dev->queues = NULL;
|
||||
return NULL;
|
||||
}
|
||||
/*
|
||||
@ -649,6 +650,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
|
||||
*/
|
||||
if (aac_fib_setup(dev) < 0) {
|
||||
kfree(dev->queues);
|
||||
dev->queues = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -7048,7 +7048,7 @@ lpfc_sli4_repost_sgl_list(struct lpfc_hba *phba,
|
||||
struct lpfc_sglq *sglq_entry = NULL;
|
||||
struct lpfc_sglq *sglq_entry_next = NULL;
|
||||
struct lpfc_sglq *sglq_entry_first = NULL;
|
||||
int status, total_cnt;
|
||||
int status = 0, total_cnt;
|
||||
int post_cnt = 0, num_posted = 0, block_cnt = 0;
|
||||
int last_xritag = NO_XRI;
|
||||
LIST_HEAD(prep_sgl_list);
|
||||
|
@ -680,7 +680,7 @@ spi_dv_device_echo_buffer(struct scsi_device *sdev, u8 *buffer,
|
||||
if (result || !scsi_device_online(sdev)) {
|
||||
|
||||
scsi_device_set_state(sdev, SDEV_QUIESCE);
|
||||
if (scsi_sense_valid(&sshdr)
|
||||
if (result > 0 && scsi_sense_valid(&sshdr)
|
||||
&& sshdr.sense_key == ILLEGAL_REQUEST
|
||||
/* INVALID FIELD IN CDB */
|
||||
&& sshdr.asc == 0x24 && sshdr.ascq == 0x00)
|
||||
|
@ -320,7 +320,7 @@ static int cmd_db_dev_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
cmd_db_header = memremap(rmem->base, rmem->size, MEMREMAP_WB);
|
||||
cmd_db_header = memremap(rmem->base, rmem->size, MEMREMAP_WC);
|
||||
if (!cmd_db_header) {
|
||||
ret = -ENOMEM;
|
||||
cmd_db_header = NULL;
|
||||
|
@ -1425,18 +1425,18 @@ struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave,
|
||||
unsigned int port_num)
|
||||
{
|
||||
struct sdw_dpn_prop *dpn_prop;
|
||||
u8 num_ports;
|
||||
unsigned long mask;
|
||||
int i;
|
||||
|
||||
if (direction == SDW_DATA_DIR_TX) {
|
||||
num_ports = hweight32(slave->prop.source_ports);
|
||||
mask = slave->prop.source_ports;
|
||||
dpn_prop = slave->prop.src_dpn_prop;
|
||||
} else {
|
||||
num_ports = hweight32(slave->prop.sink_ports);
|
||||
mask = slave->prop.sink_ports;
|
||||
dpn_prop = slave->prop.sink_dpn_prop;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_ports; i++) {
|
||||
for_each_set_bit(i, &mask, 32) {
|
||||
if (dpn_prop[i].num == port_num)
|
||||
return &dpn_prop[i];
|
||||
}
|
||||
|
@ -835,7 +835,7 @@ static u32 clkfactor_f6_resolve(u32 v)
|
||||
case SSB_CHIPCO_CLK_F6_7:
|
||||
return 7;
|
||||
}
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Calculate the speed the backplane would run at a given set of clockcontrol values */
|
||||
|
@ -658,9 +658,6 @@ static int ad2s1210_probe(struct spi_device *spi)
|
||||
if (!indio_dev)
|
||||
return -ENOMEM;
|
||||
st = iio_priv(indio_dev);
|
||||
ret = ad2s1210_setup_gpios(st);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
spi_set_drvdata(spi, indio_dev);
|
||||
|
||||
@ -671,6 +668,10 @@ static int ad2s1210_probe(struct spi_device *spi)
|
||||
st->resolution = 12;
|
||||
st->fexcit = AD2S1210_DEF_EXCIT;
|
||||
|
||||
ret = ad2s1210_setup_gpios(st);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
indio_dev->info = &ad2s1210_info;
|
||||
indio_dev->modes = INDIO_DIRECT_MODE;
|
||||
indio_dev->channels = ad2s1210_channels;
|
||||
|
@ -395,9 +395,9 @@ int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, unsigned long size,
|
||||
priv->hostt.buff[priv->hostt.qtail] = le16_to_cpu(hdr->event);
|
||||
priv->hostt.qtail = (priv->hostt.qtail + 1) % SME_EVENT_BUFF_SIZE;
|
||||
|
||||
spin_lock(&priv->tx_dev.tx_dev_lock);
|
||||
spin_lock_bh(&priv->tx_dev.tx_dev_lock);
|
||||
result = enqueue_txdev(priv, p, size, complete_handler, skb);
|
||||
spin_unlock(&priv->tx_dev.tx_dev_lock);
|
||||
spin_unlock_bh(&priv->tx_dev.tx_dev_lock);
|
||||
|
||||
if (txq_has_space(priv))
|
||||
queue_delayed_work(priv->wq, &priv->rw_dwork, 0);
|
||||
|
@ -2584,6 +2584,7 @@ void tb_switch_remove(struct tb_switch *sw)
|
||||
tb_switch_remove(port->remote->sw);
|
||||
port->remote = NULL;
|
||||
} else if (port->xdomain) {
|
||||
port->xdomain->is_unplugged = true;
|
||||
tb_xdomain_remove(port->xdomain);
|
||||
port->xdomain = NULL;
|
||||
}
|
||||
|
@ -1757,6 +1757,9 @@ static const struct usb_device_id acm_ids[] = {
|
||||
{ USB_DEVICE(0x11ca, 0x0201), /* VeriFone Mx870 Gadget Serial */
|
||||
.driver_info = SINGLE_RX_URB,
|
||||
},
|
||||
{ USB_DEVICE(0x1901, 0x0006), /* GE Healthcare Patient Monitor UI Controller */
|
||||
.driver_info = DISABLE_ECHO, /* DISABLE ECHO in termios flag */
|
||||
},
|
||||
{ USB_DEVICE(0x1965, 0x0018), /* Uniden UBC125XLT */
|
||||
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
|
||||
},
|
||||
|
@ -690,6 +690,7 @@ static int add_power_attributes(struct device *dev)
|
||||
|
||||
static void remove_power_attributes(struct device *dev)
|
||||
{
|
||||
sysfs_unmerge_group(&dev->kobj, &usb3_hardware_lpm_attr_group);
|
||||
sysfs_unmerge_group(&dev->kobj, &usb2_hardware_lpm_attr_group);
|
||||
sysfs_unmerge_group(&dev->kobj, &power_attr_group);
|
||||
}
|
||||
|
@ -431,6 +431,13 @@ static void dwc3_free_event_buffers(struct dwc3 *dwc)
|
||||
static int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length)
|
||||
{
|
||||
struct dwc3_event_buffer *evt;
|
||||
unsigned int hw_mode;
|
||||
|
||||
hw_mode = DWC3_GHWPARAMS0_MODE(dwc->hwparams.hwparams0);
|
||||
if (hw_mode == DWC3_GHWPARAMS0_MODE_HOST) {
|
||||
dwc->ev_buf = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
evt = dwc3_alloc_one_event_buffer(dwc, length);
|
||||
if (IS_ERR(evt)) {
|
||||
@ -452,6 +459,9 @@ int dwc3_event_buffers_setup(struct dwc3 *dwc)
|
||||
{
|
||||
struct dwc3_event_buffer *evt;
|
||||
|
||||
if (!dwc->ev_buf)
|
||||
return 0;
|
||||
|
||||
evt = dwc->ev_buf;
|
||||
evt->lpos = 0;
|
||||
dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(0),
|
||||
@ -468,6 +478,17 @@ int dwc3_event_buffers_setup(struct dwc3 *dwc)
|
||||
void dwc3_event_buffers_cleanup(struct dwc3 *dwc)
|
||||
{
|
||||
struct dwc3_event_buffer *evt;
|
||||
u32 reg;
|
||||
|
||||
if (!dwc->ev_buf)
|
||||
return;
|
||||
/*
|
||||
* Exynos platforms may not be able to access event buffer if the
|
||||
* controller failed to halt on dwc3_core_exit().
|
||||
*/
|
||||
reg = dwc3_readl(dwc->regs, DWC3_DSTS);
|
||||
if (!(reg & DWC3_DSTS_DEVCTRLHLT))
|
||||
return;
|
||||
|
||||
evt = dwc->ev_buf;
|
||||
|
||||
|
@ -522,11 +522,13 @@ static int dwc3_omap_probe(struct platform_device *pdev)
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to request IRQ #%d --> %d\n",
|
||||
omap->irq, ret);
|
||||
goto err1;
|
||||
goto err2;
|
||||
}
|
||||
dwc3_omap_enable_irqs(omap);
|
||||
return 0;
|
||||
|
||||
err2:
|
||||
of_platform_depopulate(dev);
|
||||
err1:
|
||||
pm_runtime_put_sync(dev);
|
||||
pm_runtime_disable(dev);
|
||||
|
@ -219,10 +219,8 @@ static int st_dwc3_probe(struct platform_device *pdev)
|
||||
dwc3_data->regmap = regmap;
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "syscfg-reg");
|
||||
if (!res) {
|
||||
ret = -ENXIO;
|
||||
goto undo_platform_dev_alloc;
|
||||
}
|
||||
if (!res)
|
||||
return -ENXIO;
|
||||
|
||||
dwc3_data->syscfg_reg_off = res->start;
|
||||
|
||||
@ -233,8 +231,7 @@ static int st_dwc3_probe(struct platform_device *pdev)
|
||||
devm_reset_control_get_exclusive(dev, "powerdown");
|
||||
if (IS_ERR(dwc3_data->rstc_pwrdn)) {
|
||||
dev_err(&pdev->dev, "could not get power controller\n");
|
||||
ret = PTR_ERR(dwc3_data->rstc_pwrdn);
|
||||
goto undo_platform_dev_alloc;
|
||||
return PTR_ERR(dwc3_data->rstc_pwrdn);
|
||||
}
|
||||
|
||||
/* Manage PowerDown */
|
||||
@ -269,7 +266,7 @@ static int st_dwc3_probe(struct platform_device *pdev)
|
||||
if (!child_pdev) {
|
||||
dev_err(dev, "failed to find dwc3 core device\n");
|
||||
ret = -ENODEV;
|
||||
goto err_node_put;
|
||||
goto depopulate;
|
||||
}
|
||||
|
||||
dwc3_data->dr_mode = usb_get_dr_mode(&child_pdev->dev);
|
||||
@ -285,6 +282,7 @@ static int st_dwc3_probe(struct platform_device *pdev)
|
||||
ret = st_dwc3_drd_init(dwc3_data);
|
||||
if (ret) {
|
||||
dev_err(dev, "drd initialisation failed\n");
|
||||
of_platform_depopulate(dev);
|
||||
goto undo_softreset;
|
||||
}
|
||||
|
||||
@ -294,14 +292,14 @@ static int st_dwc3_probe(struct platform_device *pdev)
|
||||
platform_set_drvdata(pdev, dwc3_data);
|
||||
return 0;
|
||||
|
||||
depopulate:
|
||||
of_platform_depopulate(dev);
|
||||
err_node_put:
|
||||
of_node_put(child);
|
||||
undo_softreset:
|
||||
reset_control_assert(dwc3_data->rstc_rst);
|
||||
undo_powerdown:
|
||||
reset_control_assert(dwc3_data->rstc_pwrdn);
|
||||
undo_platform_dev_alloc:
|
||||
platform_device_put(pdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2501,7 +2501,7 @@ static int fsl_udc_probe(struct platform_device *pdev)
|
||||
/* setup the udc->eps[] for non-control endpoints and link
|
||||
* to gadget.ep_list */
|
||||
for (i = 1; i < (int)(udc_controller->max_ep / 2); i++) {
|
||||
char name[14];
|
||||
char name[16];
|
||||
|
||||
sprintf(name, "ep%dout", i);
|
||||
struct_ep_setup(udc_controller, i * 2, name, 1);
|
||||
|
@ -2819,7 +2819,7 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci,
|
||||
xhci->num_active_eps);
|
||||
return -ENOMEM;
|
||||
}
|
||||
if ((xhci->quirks & XHCI_SW_BW_CHECKING) &&
|
||||
if ((xhci->quirks & XHCI_SW_BW_CHECKING) && !ctx_change &&
|
||||
xhci_reserve_bandwidth(xhci, virt_dev, command->in_ctx)) {
|
||||
if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK))
|
||||
xhci_free_host_resources(xhci, ctrl_ctx);
|
||||
@ -4205,8 +4205,10 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
|
||||
mutex_unlock(&xhci->mutex);
|
||||
ret = xhci_disable_slot(xhci, udev->slot_id);
|
||||
xhci_free_virt_device(xhci, udev->slot_id);
|
||||
if (!ret)
|
||||
xhci_alloc_dev(hcd, udev);
|
||||
if (!ret) {
|
||||
if (xhci_alloc_dev(hcd, udev) == 1)
|
||||
xhci_setup_addressable_virt_dev(xhci, udev);
|
||||
}
|
||||
kfree(command->completion);
|
||||
kfree(command);
|
||||
return -EPROTO;
|
||||
|
@ -619,6 +619,8 @@ static void option_instat_callback(struct urb *urb);
|
||||
|
||||
/* MeiG Smart Technology products */
|
||||
#define MEIGSMART_VENDOR_ID 0x2dee
|
||||
/* MeiG Smart SRM825L based on Qualcomm 315 */
|
||||
#define MEIGSMART_PRODUCT_SRM825L 0x4d22
|
||||
/* MeiG Smart SLM320 based on UNISOC UIS8910 */
|
||||
#define MEIGSMART_PRODUCT_SLM320 0x4d41
|
||||
|
||||
@ -2366,6 +2368,9 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, TOZED_PRODUCT_LT70C, 0xff, 0, 0) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SLM320, 0xff, 0, 0) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x30) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SRM825L, 0xff, 0xff, 0x60) },
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(usb, option_ids);
|
||||
|
@ -186,6 +186,7 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec,
|
||||
unsigned char k_rand_bytes[16];
|
||||
int items;
|
||||
elf_addr_t *elf_info;
|
||||
elf_addr_t flags = 0;
|
||||
int ei_index;
|
||||
const struct cred *cred = current_cred();
|
||||
struct vm_area_struct *vma;
|
||||
@ -260,7 +261,9 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec,
|
||||
NEW_AUX_ENT(AT_PHENT, sizeof(struct elf_phdr));
|
||||
NEW_AUX_ENT(AT_PHNUM, exec->e_phnum);
|
||||
NEW_AUX_ENT(AT_BASE, interp_load_addr);
|
||||
NEW_AUX_ENT(AT_FLAGS, 0);
|
||||
if (bprm->interp_flags & BINPRM_FLAGS_PRESERVE_ARGV0)
|
||||
flags |= AT_FLAGS_PRESERVE_ARGV0;
|
||||
NEW_AUX_ENT(AT_FLAGS, flags);
|
||||
NEW_AUX_ENT(AT_ENTRY, e_entry);
|
||||
NEW_AUX_ENT(AT_UID, from_kuid_munged(cred->user_ns, cred->uid));
|
||||
NEW_AUX_ENT(AT_EUID, from_kuid_munged(cred->user_ns, cred->euid));
|
||||
|
@ -320,7 +320,7 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
|
||||
else
|
||||
executable_stack = EXSTACK_DEFAULT;
|
||||
|
||||
if (stack_size == 0) {
|
||||
if (stack_size == 0 && interp_params.flags & ELF_FDPIC_FLAG_PRESENT) {
|
||||
stack_size = interp_params.stack_size;
|
||||
if (interp_params.flags & ELF_FDPIC_FLAG_EXEC_STACK)
|
||||
executable_stack = EXSTACK_ENABLE_X;
|
||||
@ -506,6 +506,7 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
|
||||
char __user *u_platform, *u_base_platform, *p;
|
||||
int loop;
|
||||
int nr; /* reset for each csp adjustment */
|
||||
unsigned long flags = 0;
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
/* In some cases (e.g. Hyper-Threading), we want to avoid L1 evictions
|
||||
@ -648,7 +649,9 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
|
||||
NEW_AUX_ENT(AT_PHENT, sizeof(struct elf_phdr));
|
||||
NEW_AUX_ENT(AT_PHNUM, exec_params->hdr.e_phnum);
|
||||
NEW_AUX_ENT(AT_BASE, interp_params->elfhdr_addr);
|
||||
NEW_AUX_ENT(AT_FLAGS, 0);
|
||||
if (bprm->interp_flags & BINPRM_FLAGS_PRESERVE_ARGV0)
|
||||
flags |= AT_FLAGS_PRESERVE_ARGV0;
|
||||
NEW_AUX_ENT(AT_FLAGS, flags);
|
||||
NEW_AUX_ENT(AT_ENTRY, exec_params->entry_addr);
|
||||
NEW_AUX_ENT(AT_UID, (elf_addr_t) from_kuid_munged(cred->user_ns, cred->uid));
|
||||
NEW_AUX_ENT(AT_EUID, (elf_addr_t) from_kuid_munged(cred->user_ns, cred->euid));
|
||||
|
220
fs/binfmt_misc.c
220
fs/binfmt_misc.c
@ -60,12 +60,11 @@ typedef struct {
|
||||
char *name;
|
||||
struct dentry *dentry;
|
||||
struct file *interp_file;
|
||||
refcount_t users; /* sync removal with load_misc_binary() */
|
||||
} Node;
|
||||
|
||||
static DEFINE_RWLOCK(entries_lock);
|
||||
static struct file_system_type bm_fs_type;
|
||||
static struct vfsmount *bm_mnt;
|
||||
static int entry_count;
|
||||
|
||||
/*
|
||||
* Max length of the register string. Determined by:
|
||||
@ -82,19 +81,23 @@ static int entry_count;
|
||||
*/
|
||||
#define MAX_REGISTER_LENGTH 1920
|
||||
|
||||
/*
|
||||
* Check if we support the binfmt
|
||||
* if we do, return the node, else NULL
|
||||
* locking is done in load_misc_binary
|
||||
/**
|
||||
* search_binfmt_handler - search for a binary handler for @bprm
|
||||
* @misc: handle to binfmt_misc instance
|
||||
* @bprm: binary for which we are looking for a handler
|
||||
*
|
||||
* Search for a binary type handler for @bprm in the list of registered binary
|
||||
* type handlers.
|
||||
*
|
||||
* Return: binary type list entry on success, NULL on failure
|
||||
*/
|
||||
static Node *check_file(struct linux_binprm *bprm)
|
||||
static Node *search_binfmt_handler(struct linux_binprm *bprm)
|
||||
{
|
||||
char *p = strrchr(bprm->interp, '.');
|
||||
struct list_head *l;
|
||||
Node *e;
|
||||
|
||||
/* Walk all the registered handlers. */
|
||||
list_for_each(l, &entries) {
|
||||
Node *e = list_entry(l, Node, list);
|
||||
list_for_each_entry(e, &entries, list) {
|
||||
char *s;
|
||||
int j;
|
||||
|
||||
@ -123,9 +126,49 @@ static Node *check_file(struct linux_binprm *bprm)
|
||||
if (j == e->size)
|
||||
return e;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_binfmt_handler - try to find a binary type handler
|
||||
* @misc: handle to binfmt_misc instance
|
||||
* @bprm: binary for which we are looking for a handler
|
||||
*
|
||||
* Try to find a binfmt handler for the binary type. If one is found take a
|
||||
* reference to protect against removal via bm_{entry,status}_write().
|
||||
*
|
||||
* Return: binary type list entry on success, NULL on failure
|
||||
*/
|
||||
static Node *get_binfmt_handler(struct linux_binprm *bprm)
|
||||
{
|
||||
Node *e;
|
||||
|
||||
read_lock(&entries_lock);
|
||||
e = search_binfmt_handler(bprm);
|
||||
if (e)
|
||||
refcount_inc(&e->users);
|
||||
read_unlock(&entries_lock);
|
||||
return e;
|
||||
}
|
||||
|
||||
/**
|
||||
* put_binfmt_handler - put binary handler node
|
||||
* @e: node to put
|
||||
*
|
||||
* Free node syncing with load_misc_binary() and defer final free to
|
||||
* load_misc_binary() in case it is using the binary type handler we were
|
||||
* requested to remove.
|
||||
*/
|
||||
static void put_binfmt_handler(Node *e)
|
||||
{
|
||||
if (refcount_dec_and_test(&e->users)) {
|
||||
if (e->flags & MISC_FMT_OPEN_FILE)
|
||||
filp_close(e->interp_file, NULL);
|
||||
kfree(e);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* the loader itself
|
||||
*/
|
||||
@ -139,12 +182,7 @@ static int load_misc_binary(struct linux_binprm *bprm)
|
||||
if (!enabled)
|
||||
return retval;
|
||||
|
||||
/* to keep locking time low, we copy the interpreter string */
|
||||
read_lock(&entries_lock);
|
||||
fmt = check_file(bprm);
|
||||
if (fmt)
|
||||
dget(fmt->dentry);
|
||||
read_unlock(&entries_lock);
|
||||
fmt = get_binfmt_handler(bprm);
|
||||
if (!fmt)
|
||||
return retval;
|
||||
|
||||
@ -153,7 +191,9 @@ static int load_misc_binary(struct linux_binprm *bprm)
|
||||
if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE)
|
||||
goto ret;
|
||||
|
||||
if (!(fmt->flags & MISC_FMT_PRESERVE_ARGV0)) {
|
||||
if (fmt->flags & MISC_FMT_PRESERVE_ARGV0) {
|
||||
bprm->interp_flags |= BINPRM_FLAGS_PRESERVE_ARGV0;
|
||||
} else {
|
||||
retval = remove_arg_zero(bprm);
|
||||
if (retval)
|
||||
goto ret;
|
||||
@ -196,7 +236,16 @@ static int load_misc_binary(struct linux_binprm *bprm)
|
||||
|
||||
retval = 0;
|
||||
ret:
|
||||
dput(fmt->dentry);
|
||||
|
||||
/*
|
||||
* If we actually put the node here all concurrent calls to
|
||||
* load_misc_binary() will have finished. We also know
|
||||
* that for the refcount to be zero ->evict_inode() must have removed
|
||||
* the node to be deleted from the list. All that is left for us is to
|
||||
* close and free.
|
||||
*/
|
||||
put_binfmt_handler(fmt);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -551,30 +600,90 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode)
|
||||
return inode;
|
||||
}
|
||||
|
||||
/**
|
||||
* bm_evict_inode - cleanup data associated with @inode
|
||||
* @inode: inode to which the data is attached
|
||||
*
|
||||
* Cleanup the binary type handler data associated with @inode if a binary type
|
||||
* entry is removed or the filesystem is unmounted and the super block is
|
||||
* shutdown.
|
||||
*
|
||||
* If the ->evict call was not caused by a super block shutdown but by a write
|
||||
* to remove the entry or all entries via bm_{entry,status}_write() the entry
|
||||
* will have already been removed from the list. We keep the list_empty() check
|
||||
* to make that explicit.
|
||||
*/
|
||||
static void bm_evict_inode(struct inode *inode)
|
||||
{
|
||||
Node *e = inode->i_private;
|
||||
|
||||
if (e && e->flags & MISC_FMT_OPEN_FILE)
|
||||
filp_close(e->interp_file, NULL);
|
||||
|
||||
clear_inode(inode);
|
||||
kfree(e);
|
||||
|
||||
if (e) {
|
||||
write_lock(&entries_lock);
|
||||
if (!list_empty(&e->list))
|
||||
list_del_init(&e->list);
|
||||
write_unlock(&entries_lock);
|
||||
put_binfmt_handler(e);
|
||||
}
|
||||
}
|
||||
|
||||
static void kill_node(Node *e)
|
||||
/**
|
||||
* unlink_binfmt_dentry - remove the dentry for the binary type handler
|
||||
* @dentry: dentry associated with the binary type handler
|
||||
*
|
||||
* Do the actual filesystem work to remove a dentry for a registered binary
|
||||
* type handler. Since binfmt_misc only allows simple files to be created
|
||||
* directly under the root dentry of the filesystem we ensure that we are
|
||||
* indeed passed a dentry directly beneath the root dentry, that the inode
|
||||
* associated with the root dentry is locked, and that it is a regular file we
|
||||
* are asked to remove.
|
||||
*/
|
||||
static void unlink_binfmt_dentry(struct dentry *dentry)
|
||||
{
|
||||
struct dentry *dentry;
|
||||
struct dentry *parent = dentry->d_parent;
|
||||
struct inode *inode, *parent_inode;
|
||||
|
||||
/* All entries are immediate descendants of the root dentry. */
|
||||
if (WARN_ON_ONCE(dentry->d_sb->s_root != parent))
|
||||
return;
|
||||
|
||||
/* We only expect to be called on regular files. */
|
||||
inode = d_inode(dentry);
|
||||
if (WARN_ON_ONCE(!S_ISREG(inode->i_mode)))
|
||||
return;
|
||||
|
||||
/* The parent inode must be locked. */
|
||||
parent_inode = d_inode(parent);
|
||||
if (WARN_ON_ONCE(!inode_is_locked(parent_inode)))
|
||||
return;
|
||||
|
||||
if (simple_positive(dentry)) {
|
||||
dget(dentry);
|
||||
simple_unlink(parent_inode, dentry);
|
||||
d_delete(dentry);
|
||||
dput(dentry);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* remove_binfmt_handler - remove a binary type handler
|
||||
* @misc: handle to binfmt_misc instance
|
||||
* @e: binary type handler to remove
|
||||
*
|
||||
* Remove a binary type handler from the list of binary type handlers and
|
||||
* remove its associated dentry. This is called from
|
||||
* binfmt_{entry,status}_write(). In the future, we might want to think about
|
||||
* adding a proper ->unlink() method to binfmt_misc instead of forcing caller's
|
||||
* to use writes to files in order to delete binary type handlers. But it has
|
||||
* worked for so long that it's not a pressing issue.
|
||||
*/
|
||||
static void remove_binfmt_handler(Node *e)
|
||||
{
|
||||
write_lock(&entries_lock);
|
||||
list_del_init(&e->list);
|
||||
write_unlock(&entries_lock);
|
||||
|
||||
dentry = e->dentry;
|
||||
drop_nlink(d_inode(dentry));
|
||||
d_drop(dentry);
|
||||
dput(dentry);
|
||||
simple_release_fs(&bm_mnt, &entry_count);
|
||||
unlink_binfmt_dentry(e->dentry);
|
||||
}
|
||||
|
||||
/* /<entry> */
|
||||
@ -601,8 +710,8 @@ bm_entry_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
||||
static ssize_t bm_entry_write(struct file *file, const char __user *buffer,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct dentry *root;
|
||||
Node *e = file_inode(file)->i_private;
|
||||
struct inode *inode = file_inode(file);
|
||||
Node *e = inode->i_private;
|
||||
int res = parse_command(buffer, count);
|
||||
|
||||
switch (res) {
|
||||
@ -616,13 +725,22 @@ static ssize_t bm_entry_write(struct file *file, const char __user *buffer,
|
||||
break;
|
||||
case 3:
|
||||
/* Delete this handler. */
|
||||
root = file_inode(file)->i_sb->s_root;
|
||||
inode_lock(d_inode(root));
|
||||
inode = d_inode(inode->i_sb->s_root);
|
||||
inode_lock(inode);
|
||||
|
||||
/*
|
||||
* In order to add new element or remove elements from the list
|
||||
* via bm_{entry,register,status}_write() inode_lock() on the
|
||||
* root inode must be held.
|
||||
* The lock is exclusive ensuring that the list can't be
|
||||
* modified. Only load_misc_binary() can access but does so
|
||||
* read-only. So we only need to take the write lock when we
|
||||
* actually remove the entry from the list.
|
||||
*/
|
||||
if (!list_empty(&e->list))
|
||||
kill_node(e);
|
||||
remove_binfmt_handler(e);
|
||||
|
||||
inode_unlock(d_inode(root));
|
||||
inode_unlock(inode);
|
||||
break;
|
||||
default:
|
||||
return res;
|
||||
@ -681,13 +799,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer,
|
||||
if (!inode)
|
||||
goto out2;
|
||||
|
||||
err = simple_pin_fs(&bm_fs_type, &bm_mnt, &entry_count);
|
||||
if (err) {
|
||||
iput(inode);
|
||||
inode = NULL;
|
||||
goto out2;
|
||||
}
|
||||
|
||||
refcount_set(&e->users, 1);
|
||||
e->dentry = dget(dentry);
|
||||
inode->i_private = e;
|
||||
inode->i_fop = &bm_entry_operations;
|
||||
@ -731,7 +843,8 @@ static ssize_t bm_status_write(struct file *file, const char __user *buffer,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
int res = parse_command(buffer, count);
|
||||
struct dentry *root;
|
||||
Node *e, *next;
|
||||
struct inode *inode;
|
||||
|
||||
switch (res) {
|
||||
case 1:
|
||||
@ -744,13 +857,22 @@ static ssize_t bm_status_write(struct file *file, const char __user *buffer,
|
||||
break;
|
||||
case 3:
|
||||
/* Delete all handlers. */
|
||||
root = file_inode(file)->i_sb->s_root;
|
||||
inode_lock(d_inode(root));
|
||||
inode = d_inode(file_inode(file)->i_sb->s_root);
|
||||
inode_lock(inode);
|
||||
|
||||
while (!list_empty(&entries))
|
||||
kill_node(list_first_entry(&entries, Node, list));
|
||||
/*
|
||||
* In order to add new element or remove elements from the list
|
||||
* via bm_{entry,register,status}_write() inode_lock() on the
|
||||
* root inode must be held.
|
||||
* The lock is exclusive ensuring that the list can't be
|
||||
* modified. Only load_misc_binary() can access but does so
|
||||
* read-only. So we only need to take the write lock when we
|
||||
* actually remove the entry from the list.
|
||||
*/
|
||||
list_for_each_entry_safe(e, next, &entries, list)
|
||||
remove_binfmt_handler(e);
|
||||
|
||||
inode_unlock(d_inode(root));
|
||||
inode_unlock(inode);
|
||||
break;
|
||||
default:
|
||||
return res;
|
||||
|
@ -986,7 +986,7 @@ static void btrfs_release_delayed_inode(struct btrfs_delayed_node *delayed_node)
|
||||
|
||||
if (delayed_node &&
|
||||
test_bit(BTRFS_DELAYED_NODE_INODE_DIRTY, &delayed_node->flags)) {
|
||||
BUG_ON(!delayed_node->root);
|
||||
ASSERT(delayed_node->root);
|
||||
clear_bit(BTRFS_DELAYED_NODE_INODE_DIRTY, &delayed_node->flags);
|
||||
delayed_node->count--;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user