mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
This is the 4.14.71 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAluitQUACgkQONu9yGCS aT74Jg//RmFcIRNmv3123uhNjO0ZcyEa16Te8WJmOEaU10saMpqnu112rCqNAJgV LH2nTbowLfzeWrVomf2hmOxFkSs8+eh/AhgElQ4l1rdA05YGcjnEEKv0PMm4QDo1 dNg0N61EsERq2rqNKc/t8PcC/KGIm1qZPqSIzpF9/t7eM8jQIf/khGueihM9zST+ K7RSyw/2dfocYMOfsSdcJgRr5CBPTwpxNzrlCjV62nWkk3nCTftCzmb0Y9xnpSVN Ay9Z64WxHL1ZnsFH4U74JprB6gdwMJIPz7NF5eTh50x1vwjNkmdHN9tYTo/hKkjB 1RxVwm5CcMmf/c21nlvXEExJUrTwrAmBrI2kF0FYvgf5WvAUp41wCZoakRN7t7iz /Wnm4HxqHsz0+OFd0t4/thgFlLqxUsVqY0hUiQ/tGmy3kS9ARzrZTP6LqbDscWyk 1y88ybD8wcpz+lOVD4/MygA4cCDqL5u7deBpDJ4WgyIwf6i94VXpkoM7DTrjfNBa fasgyCsBAtgtPOpQ7iMNdr/BvnNnzcvk8n3flhYayQBtvUY35UWIV3V0agSVn7XU vtFFxkJujARCjExQMbwgPL5JxTJ1+GLLS2SKb6FMFes3lRdkabQ+b6/u27KQ3JGa t0Y16o3NS6KUTZdk6emIdlhfCJW5NcwucsRlOeWyCFbyTfmf9/I= =tHIX -----END PGP SIGNATURE----- Merge 4.14.71 into android-4.14-p Changes in 4.14.71 i2c: xiic: Make the start and the byte count write atomic i2c: i801: fix DNV's SMBCTRL register offset scsi: lpfc: Correct MDS diag and nvmet configuration nbd: don't allow invalid blocksize settings block: bfq: swap puts in bfqg_and_blkg_put android: binder: fix the race mmap and alloc_new_buf_locked MIPS: VDSO: Match data page cache colouring when D$ aliases SMB3: Backup intent flag missing for directory opens with backupuid mounts smb3: check for and properly advertise directory lease support Btrfs: fix data corruption when deduplicating between different files KVM: s390: vsie: copy wrapping keys to right place KVM: VMX: Do not allow reexecute_instruction() when skipping MMIO instr ALSA: hda - Fix cancel_work_sync() stall from jackpoll work cpu/hotplug: Adjust misplaced smb() in cpuhp_thread_fun() cpu/hotplug: Prevent state corruption on error rollback x86/microcode: Make sure boot_cpu_data.microcode is up-to-date x86/microcode: Update the new microcode revision unconditionally switchtec: Fix Spectre v1 vulnerability crypto: aes-generic - fix aes-generic regression on powerpc tpm: separate cmd_ready/go_idle from runtime_pm ARC: [plat-axs*]: Enable SWAP misc: mic: SCIF Fix scif_get_new_port() error handling ethtool: Remove trailing semicolon for static inline i2c: aspeed: Add an explicit type casting for *get_clk_reg_val Bluetooth: h5: Fix missing dependency on BT_HCIUART_SERDEV gpio: tegra: Move driver registration to subsys_init level powerpc/powernv: Fix concurrency issue with npu->mmio_atsd_usage selftests/bpf: fix a typo in map in map test media: davinci: vpif_display: Mix memory leak on probe error path media: dw2102: Fix memleak on sequence of probes net: phy: Fix the register offsets in Broadcom iProc mdio mux driver blk-mq: fix updating tags depth scsi: target: fix __transport_register_session locking md/raid5: fix data corruption of replacements after originals dropped timers: Clear timer_base::must_forward_clk with timer_base::lock held media: camss: csid: Configure data type and decode format properly gpu: ipu-v3: default to id 0 on missing OF alias misc: ti-st: Fix memory leak in the error path of probe() uio: potential double frees if __uio_register_device() fails firmware: vpd: Fix section enabled flag on vpd_section_destroy Drivers: hv: vmbus: Cleanup synic memory free path tty: rocket: Fix possible buffer overwrite on register_PCI f2fs: fix to active page in lru list for read path f2fs: do not set free of current section f2fs: fix defined but not used build warnings perf tools: Allow overriding MAX_NR_CPUS at compile time NFSv4.0 fix client reference leak in callback perf c2c report: Fix crash for empty browser perf evlist: Fix error out while applying initial delay and LBR macintosh/via-pmu: Add missing mmio accessors ath9k: report tx status on EOSP ath9k_hw: fix channel maximum power level test ath10k: prevent active scans on potential unusable channels wlcore: Set rx_status boottime_ns field on rx rpmsg: core: add support to power domains for devices MIPS: Fix ISA virt/bus conversion for non-zero PHYS_OFFSET ata: libahci: Allow reconfigure of DEVSLP register ata: libahci: Correct setting of DEVSLP register scsi: 3ware: fix return 0 on the error path of probe tools/testing/nvdimm: kaddr and pfn can be NULL to ->direct_access() ath10k: disable bundle mgmt tx completion event support Bluetooth: hidp: Fix handling of strncpy for hid->name information x86/mm: Remove in_nmi() warning from vmalloc_fault() pinctrl: imx: off by one in imx_pinconf_group_dbg_show() gpio: ml-ioh: Fix buffer underwrite on probe error path pinctrl/amd: only handle irq if it is pending and unmasked net: mvneta: fix mtu change on port without link f2fs: try grabbing node page lock aggressively in sync scenario pktcdvd: Fix possible Spectre-v1 for pkt_devs f2fs: fix to skip GC if type in SSA and SIT is inconsistent tpm_tis_spi: Pass the SPI IRQ down to the driver tpm/tpm_i2c_infineon: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) f2fs: fix to do sanity check with reserved blkaddr of inline inode MIPS: Octeon: add missing of_node_put() MIPS: generic: fix missing of_node_put() net: dcb: For wild-card lookups, use priority -1, not 0 dm cache: only allow a single io_mode cache feature to be requested Input: atmel_mxt_ts - only use first T9 instance media: s5p-mfc: Fix buffer look up in s5p_mfc_handle_frame_{new, copy_time} functions partitions/aix: append null character to print data from disk partitions/aix: fix usage of uninitialized lv_info and lvname structures media: helene: fix xtal frequency setting at power on f2fs: fix to wait on page writeback before updating page f2fs: Fix uninitialized return in f2fs_ioc_shutdown() iommu/ipmmu-vmsa: Fix allocation in atomic context mfd: ti_am335x_tscadc: Fix struct clk memory leak f2fs: fix to do sanity check with {sit,nat}_ver_bitmap_bytesize NFSv4.1: Fix a potential layoutget/layoutrecall deadlock MIPS: WARN_ON invalid DMA cache maintenance, not BUG_ON RDMA/cma: Do not ignore net namespace for unbound cm_id drm/i915: set DP Main Stream Attribute for color range on DDI platforms inet: frags: change inet_frags_init_net() return value inet: frags: add a pointer to struct netns_frags inet: frags: refactor ipfrag_init() inet: frags: Convert timers to use timer_setup() inet: frags: refactor ipv6_frag_init() inet: frags: refactor lowpan_net_frag_init() ipv6: export ip6 fragments sysctl to unprivileged users rhashtable: add schedule points inet: frags: use rhashtables for reassembly units inet: frags: remove some helpers inet: frags: get rif of inet_frag_evicting() inet: frags: remove inet_frag_maybe_warn_overflow() inet: frags: break the 2GB limit for frags storage inet: frags: do not clone skb in ip_expire() ipv6: frags: rewrite ip6_expire_frag_queue() rhashtable: reorganize struct rhashtable layout inet: frags: reorganize struct netns_frags inet: frags: get rid of ipfrag_skb_cb/FRAG_CB inet: frags: fix ip6frag_low_thresh boundary ip: discard IPv4 datagrams with overlapping segments. net: speed up skb_rbtree_purge() net: modify skb_rbtree_purge to return the truesize of all purged skbs. ipv6: defrag: drop non-last frags smaller than min mtu net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends net: add rb_to_skb() and other rb tree helpers net: sk_buff rbnode reorg ipv4: frags: precedence bug in ip_expire() ip: add helpers to process in-order fragments faster. ip: process in-order fragments efficiently ip: frags: fix crash in ip_do_fragment() mtd: ubi: wl: Fix error return code in ubi_wl_init() tun: fix use after free for ptr_ring tuntap: fix use after free during release autofs: fix autofs_sbi() does not check super block type mm: get rid of vmacache_flush_all() entirely Linux 4.14.71 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
58b620ff60
@ -133,14 +133,11 @@ min_adv_mss - INTEGER
|
||||
|
||||
IP Fragmentation:
|
||||
|
||||
ipfrag_high_thresh - INTEGER
|
||||
Maximum memory used to reassemble IP fragments. When
|
||||
ipfrag_high_thresh bytes of memory is allocated for this purpose,
|
||||
the fragment handler will toss packets until ipfrag_low_thresh
|
||||
is reached. This also serves as a maximum limit to namespaces
|
||||
different from the initial one.
|
||||
ipfrag_high_thresh - LONG INTEGER
|
||||
Maximum memory used to reassemble IP fragments.
|
||||
|
||||
ipfrag_low_thresh - INTEGER
|
||||
ipfrag_low_thresh - LONG INTEGER
|
||||
(Obsolete since linux-4.17)
|
||||
Maximum memory used to reassemble IP fragments before the kernel
|
||||
begins to remove incomplete fragment queues to free up resources.
|
||||
The kernel still accepts new fragments for defragmentation.
|
||||
|
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 70
|
||||
SUBLEVEL = 71
|
||||
EXTRAVERSION =
|
||||
NAME = Petit Gorille
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
CONFIG_DEFAULT_HOSTNAME="ARCLinux"
|
||||
# CONFIG_SWAP is not set
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
# CONFIG_CROSS_MEMORY_ATTACH is not set
|
||||
|
@ -1,5 +1,4 @@
|
||||
CONFIG_DEFAULT_HOSTNAME="ARCLinux"
|
||||
# CONFIG_SWAP is not set
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
# CONFIG_CROSS_MEMORY_ATTACH is not set
|
||||
|
@ -1,5 +1,4 @@
|
||||
CONFIG_DEFAULT_HOSTNAME="ARCLinux"
|
||||
# CONFIG_SWAP is not set
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
# CONFIG_CROSS_MEMORY_ATTACH is not set
|
||||
|
@ -322,6 +322,7 @@ static int __init octeon_ehci_device_init(void)
|
||||
return 0;
|
||||
|
||||
pd = of_find_device_by_node(ehci_node);
|
||||
of_node_put(ehci_node);
|
||||
if (!pd)
|
||||
return 0;
|
||||
|
||||
@ -384,6 +385,7 @@ static int __init octeon_ohci_device_init(void)
|
||||
return 0;
|
||||
|
||||
pd = of_find_device_by_node(ohci_node);
|
||||
of_node_put(ohci_node);
|
||||
if (!pd)
|
||||
return 0;
|
||||
|
||||
|
@ -204,6 +204,7 @@ void __init arch_init_irq(void)
|
||||
"mti,cpu-interrupt-controller");
|
||||
if (!cpu_has_veic && !intc_node)
|
||||
mips_cpu_irq_init();
|
||||
of_node_put(intc_node);
|
||||
|
||||
irqchip_init();
|
||||
}
|
||||
|
@ -141,14 +141,14 @@ static inline void * phys_to_virt(unsigned long address)
|
||||
/*
|
||||
* ISA I/O bus memory addresses are 1:1 with the physical address.
|
||||
*/
|
||||
static inline unsigned long isa_virt_to_bus(volatile void * address)
|
||||
static inline unsigned long isa_virt_to_bus(volatile void *address)
|
||||
{
|
||||
return (unsigned long)address - PAGE_OFFSET;
|
||||
return virt_to_phys(address);
|
||||
}
|
||||
|
||||
static inline void * isa_bus_to_virt(unsigned long address)
|
||||
static inline void *isa_bus_to_virt(unsigned long address)
|
||||
{
|
||||
return (void *)(address + PAGE_OFFSET);
|
||||
return phys_to_virt(address);
|
||||
}
|
||||
|
||||
#define isa_page_to_bus page_to_phys
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
@ -20,6 +21,7 @@
|
||||
|
||||
#include <asm/abi.h>
|
||||
#include <asm/mips-cps.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/vdso.h>
|
||||
|
||||
/* Kernel-provided data used by the VDSO. */
|
||||
@ -128,12 +130,30 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
|
||||
vvar_size = gic_size + PAGE_SIZE;
|
||||
size = vvar_size + image->size;
|
||||
|
||||
/*
|
||||
* Find a region that's large enough for us to perform the
|
||||
* colour-matching alignment below.
|
||||
*/
|
||||
if (cpu_has_dc_aliases)
|
||||
size += shm_align_mask + 1;
|
||||
|
||||
base = get_unmapped_area(NULL, 0, size, 0, 0);
|
||||
if (IS_ERR_VALUE(base)) {
|
||||
ret = base;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we suffer from dcache aliasing, ensure that the VDSO data page
|
||||
* mapping is coloured the same as the kernel's mapping of that memory.
|
||||
* This ensures that when the kernel updates the VDSO data userland
|
||||
* will observe it without requiring cache invalidations.
|
||||
*/
|
||||
if (cpu_has_dc_aliases) {
|
||||
base = __ALIGN_MASK(base, shm_align_mask);
|
||||
base += ((unsigned long)&vdso_data - gic_size) & shm_align_mask;
|
||||
}
|
||||
|
||||
data_addr = base + gic_size;
|
||||
vdso_addr = data_addr + PAGE_SIZE;
|
||||
|
||||
|
@ -835,7 +835,8 @@ static void r4k_flush_icache_user_range(unsigned long start, unsigned long end)
|
||||
static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
|
||||
{
|
||||
/* Catch bad driver code */
|
||||
BUG_ON(size == 0);
|
||||
if (WARN_ON(size == 0))
|
||||
return;
|
||||
|
||||
preempt_disable();
|
||||
if (cpu_has_inclusive_pcaches) {
|
||||
@ -871,7 +872,8 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
|
||||
static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
|
||||
{
|
||||
/* Catch bad driver code */
|
||||
BUG_ON(size == 0);
|
||||
if (WARN_ON(size == 0))
|
||||
return;
|
||||
|
||||
preempt_disable();
|
||||
if (cpu_has_inclusive_pcaches) {
|
||||
|
@ -427,8 +427,9 @@ static int get_mmio_atsd_reg(struct npu *npu)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < npu->mmio_atsd_count; i++) {
|
||||
if (!test_and_set_bit_lock(i, &npu->mmio_atsd_usage))
|
||||
return i;
|
||||
if (!test_bit(i, &npu->mmio_atsd_usage))
|
||||
if (!test_and_set_bit_lock(i, &npu->mmio_atsd_usage))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -ENOSPC;
|
||||
|
@ -170,7 +170,8 @@ static int shadow_crycb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
|
||||
return set_validity_icpt(scb_s, 0x0039U);
|
||||
|
||||
/* copy only the wrapping keys */
|
||||
if (read_guest_real(vcpu, crycb_addr + 72, &vsie_page->crycb, 56))
|
||||
if (read_guest_real(vcpu, crycb_addr + 72,
|
||||
vsie_page->crycb.dea_wrapping_key_mask, 56))
|
||||
return set_validity_icpt(scb_s, 0x0035U);
|
||||
|
||||
scb_s->ecb3 |= ecb3_flags;
|
||||
|
@ -504,6 +504,7 @@ static enum ucode_state apply_microcode_amd(int cpu)
|
||||
struct microcode_amd *mc_amd;
|
||||
struct ucode_cpu_info *uci;
|
||||
struct ucode_patch *p;
|
||||
enum ucode_state ret;
|
||||
u32 rev, dummy;
|
||||
|
||||
BUG_ON(raw_smp_processor_id() != cpu);
|
||||
@ -521,9 +522,8 @@ static enum ucode_state apply_microcode_amd(int cpu)
|
||||
|
||||
/* need to apply patch? */
|
||||
if (rev >= mc_amd->hdr.patch_id) {
|
||||
c->microcode = rev;
|
||||
uci->cpu_sig.rev = rev;
|
||||
return UCODE_OK;
|
||||
ret = UCODE_OK;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (__apply_microcode_amd(mc_amd)) {
|
||||
@ -531,13 +531,21 @@ static enum ucode_state apply_microcode_amd(int cpu)
|
||||
cpu, mc_amd->hdr.patch_id);
|
||||
return UCODE_ERROR;
|
||||
}
|
||||
pr_info("CPU%d: new patch_level=0x%08x\n", cpu,
|
||||
mc_amd->hdr.patch_id);
|
||||
|
||||
uci->cpu_sig.rev = mc_amd->hdr.patch_id;
|
||||
c->microcode = mc_amd->hdr.patch_id;
|
||||
rev = mc_amd->hdr.patch_id;
|
||||
ret = UCODE_UPDATED;
|
||||
|
||||
return UCODE_UPDATED;
|
||||
pr_info("CPU%d: new patch_level=0x%08x\n", cpu, rev);
|
||||
|
||||
out:
|
||||
uci->cpu_sig.rev = rev;
|
||||
c->microcode = rev;
|
||||
|
||||
/* Update boot_cpu_data's revision too, if we're on the BSP: */
|
||||
if (c->cpu_index == boot_cpu_data.cpu_index)
|
||||
boot_cpu_data.microcode = rev;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int install_equiv_cpu_table(const u8 *buf)
|
||||
|
@ -795,6 +795,7 @@ static enum ucode_state apply_microcode_intel(int cpu)
|
||||
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
|
||||
struct cpuinfo_x86 *c = &cpu_data(cpu);
|
||||
struct microcode_intel *mc;
|
||||
enum ucode_state ret;
|
||||
static int prev_rev;
|
||||
u32 rev;
|
||||
|
||||
@ -817,9 +818,8 @@ static enum ucode_state apply_microcode_intel(int cpu)
|
||||
*/
|
||||
rev = intel_get_microcode_revision();
|
||||
if (rev >= mc->hdr.rev) {
|
||||
uci->cpu_sig.rev = rev;
|
||||
c->microcode = rev;
|
||||
return UCODE_OK;
|
||||
ret = UCODE_OK;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -848,10 +848,17 @@ static enum ucode_state apply_microcode_intel(int cpu)
|
||||
prev_rev = rev;
|
||||
}
|
||||
|
||||
uci->cpu_sig.rev = rev;
|
||||
c->microcode = rev;
|
||||
ret = UCODE_UPDATED;
|
||||
|
||||
return UCODE_UPDATED;
|
||||
out:
|
||||
uci->cpu_sig.rev = rev;
|
||||
c->microcode = rev;
|
||||
|
||||
/* Update boot_cpu_data's revision too, if we're on the BSP: */
|
||||
if (c->cpu_index == boot_cpu_data.cpu_index)
|
||||
boot_cpu_data.microcode = rev;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static enum ucode_state generic_load_microcode(int cpu, void *data, size_t size,
|
||||
|
@ -6965,8 +6965,8 @@ static int handle_ept_misconfig(struct kvm_vcpu *vcpu)
|
||||
if (!static_cpu_has(X86_FEATURE_HYPERVISOR))
|
||||
return kvm_skip_emulated_instruction(vcpu);
|
||||
else
|
||||
return x86_emulate_instruction(vcpu, gpa, EMULTYPE_SKIP,
|
||||
NULL, 0) == EMULATE_DONE;
|
||||
return emulate_instruction(vcpu, EMULTYPE_SKIP) ==
|
||||
EMULATE_DONE;
|
||||
}
|
||||
|
||||
ret = kvm_mmu_page_fault(vcpu, gpa, PFERR_RSVD_MASK, NULL, 0);
|
||||
|
@ -317,8 +317,6 @@ static noinline int vmalloc_fault(unsigned long address)
|
||||
if (!(address >= VMALLOC_START && address < VMALLOC_END))
|
||||
return -1;
|
||||
|
||||
WARN_ON_ONCE(in_nmi());
|
||||
|
||||
/*
|
||||
* Synchronize this task's top level page-table
|
||||
* with the 'reference' page table.
|
||||
|
@ -224,9 +224,9 @@ static void bfqg_and_blkg_get(struct bfq_group *bfqg)
|
||||
|
||||
void bfqg_and_blkg_put(struct bfq_group *bfqg)
|
||||
{
|
||||
bfqg_put(bfqg);
|
||||
|
||||
blkg_put(bfqg_to_blkg(bfqg));
|
||||
|
||||
bfqg_put(bfqg);
|
||||
}
|
||||
|
||||
void bfqg_stats_update_io_add(struct bfq_group *bfqg, struct bfq_queue *bfqq,
|
||||
|
@ -416,8 +416,6 @@ int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,
|
||||
if (tdepth <= tags->nr_reserved_tags)
|
||||
return -EINVAL;
|
||||
|
||||
tdepth -= tags->nr_reserved_tags;
|
||||
|
||||
/*
|
||||
* If we are allowed to grow beyond the original size, allocate
|
||||
* a new set of tags before freeing the old one.
|
||||
@ -437,7 +435,8 @@ int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,
|
||||
if (tdepth > 16 * BLKDEV_MAX_RQ)
|
||||
return -EINVAL;
|
||||
|
||||
new = blk_mq_alloc_rq_map(set, hctx->queue_num, tdepth, 0);
|
||||
new = blk_mq_alloc_rq_map(set, hctx->queue_num, tdepth,
|
||||
tags->nr_reserved_tags);
|
||||
if (!new)
|
||||
return -ENOMEM;
|
||||
ret = blk_mq_alloc_rqs(set, new, hctx->queue_num, tdepth);
|
||||
@ -454,7 +453,8 @@ int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,
|
||||
* Don't need (or can't) update reserved tags here, they
|
||||
* remain static and should never need resizing.
|
||||
*/
|
||||
sbitmap_queue_resize(&tags->bitmap_tags, tdepth);
|
||||
sbitmap_queue_resize(&tags->bitmap_tags,
|
||||
tdepth - tags->nr_reserved_tags);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -178,7 +178,7 @@ int aix_partition(struct parsed_partitions *state)
|
||||
u32 vgda_sector = 0;
|
||||
u32 vgda_len = 0;
|
||||
int numlvs = 0;
|
||||
struct pvd *pvd;
|
||||
struct pvd *pvd = NULL;
|
||||
struct lv_info {
|
||||
unsigned short pps_per_lv;
|
||||
unsigned short pps_found;
|
||||
@ -232,10 +232,11 @@ int aix_partition(struct parsed_partitions *state)
|
||||
if (lvip[i].pps_per_lv)
|
||||
foundlvs += 1;
|
||||
}
|
||||
/* pvd loops depend on n[].name and lvip[].pps_per_lv */
|
||||
pvd = alloc_pvd(state, vgda_sector + 17);
|
||||
}
|
||||
put_dev_sector(sect);
|
||||
}
|
||||
pvd = alloc_pvd(state, vgda_sector + 17);
|
||||
if (pvd) {
|
||||
int numpps = be16_to_cpu(pvd->pp_count);
|
||||
int psn_part1 = be32_to_cpu(pvd->psn_part1);
|
||||
@ -282,10 +283,14 @@ int aix_partition(struct parsed_partitions *state)
|
||||
next_lp_ix += 1;
|
||||
}
|
||||
for (i = 0; i < state->limit; i += 1)
|
||||
if (lvip[i].pps_found && !lvip[i].lv_is_contiguous)
|
||||
if (lvip[i].pps_found && !lvip[i].lv_is_contiguous) {
|
||||
char tmp[sizeof(n[i].name) + 1]; // null char
|
||||
|
||||
snprintf(tmp, sizeof(tmp), "%s", n[i].name);
|
||||
pr_warn("partition %s (%u pp's found) is "
|
||||
"not contiguous\n",
|
||||
n[i].name, lvip[i].pps_found);
|
||||
tmp, lvip[i].pps_found);
|
||||
}
|
||||
kfree(pvd);
|
||||
}
|
||||
kfree(n);
|
||||
|
@ -98,7 +98,7 @@ obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o
|
||||
obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o
|
||||
CFLAGS_serpent_generic.o := $(call cc-option,-fsched-pressure) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
|
||||
obj-$(CONFIG_CRYPTO_AES) += aes_generic.o
|
||||
CFLAGS_aes_generic.o := $(call cc-ifversion, -ge, 0701, -Os) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356
|
||||
CFLAGS_aes_generic.o := $(call cc-option,-fno-code-hoisting) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356
|
||||
obj-$(CONFIG_CRYPTO_AES_TI) += aes_ti.o
|
||||
obj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o
|
||||
obj-$(CONFIG_CRYPTO_CAST_COMMON) += cast_common.o
|
||||
|
@ -327,6 +327,34 @@ err_no_vma:
|
||||
return vma ? -ENOMEM : -ESRCH;
|
||||
}
|
||||
|
||||
static inline void binder_alloc_set_vma(struct binder_alloc *alloc,
|
||||
struct vm_area_struct *vma)
|
||||
{
|
||||
if (vma)
|
||||
alloc->vma_vm_mm = vma->vm_mm;
|
||||
/*
|
||||
* If we see alloc->vma is not NULL, buffer data structures set up
|
||||
* completely. Look at smp_rmb side binder_alloc_get_vma.
|
||||
* We also want to guarantee new alloc->vma_vm_mm is always visible
|
||||
* if alloc->vma is set.
|
||||
*/
|
||||
smp_wmb();
|
||||
alloc->vma = vma;
|
||||
}
|
||||
|
||||
static inline struct vm_area_struct *binder_alloc_get_vma(
|
||||
struct binder_alloc *alloc)
|
||||
{
|
||||
struct vm_area_struct *vma = NULL;
|
||||
|
||||
if (alloc->vma) {
|
||||
/* Look at description in binder_alloc_set_vma */
|
||||
smp_rmb();
|
||||
vma = alloc->vma;
|
||||
}
|
||||
return vma;
|
||||
}
|
||||
|
||||
static struct binder_buffer *binder_alloc_new_buf_locked(
|
||||
struct binder_alloc *alloc,
|
||||
size_t data_size,
|
||||
@ -343,7 +371,7 @@ static struct binder_buffer *binder_alloc_new_buf_locked(
|
||||
size_t size, data_offsets_size;
|
||||
int ret;
|
||||
|
||||
if (alloc->vma == NULL) {
|
||||
if (!binder_alloc_get_vma(alloc)) {
|
||||
pr_err("%d: binder_alloc_buf, no vma\n",
|
||||
alloc->pid);
|
||||
return ERR_PTR(-ESRCH);
|
||||
@ -714,9 +742,7 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc,
|
||||
buffer->free = 1;
|
||||
binder_insert_free_buffer(alloc, buffer);
|
||||
alloc->free_async_space = alloc->buffer_size / 2;
|
||||
barrier();
|
||||
alloc->vma = vma;
|
||||
alloc->vma_vm_mm = vma->vm_mm;
|
||||
binder_alloc_set_vma(alloc, vma);
|
||||
mmgrab(alloc->vma_vm_mm);
|
||||
|
||||
return 0;
|
||||
@ -743,10 +769,10 @@ void binder_alloc_deferred_release(struct binder_alloc *alloc)
|
||||
int buffers, page_count;
|
||||
struct binder_buffer *buffer;
|
||||
|
||||
BUG_ON(alloc->vma);
|
||||
|
||||
buffers = 0;
|
||||
mutex_lock(&alloc->mutex);
|
||||
BUG_ON(alloc->vma);
|
||||
|
||||
while ((n = rb_first(&alloc->allocated_buffers))) {
|
||||
buffer = rb_entry(n, struct binder_buffer, rb_node);
|
||||
|
||||
@ -889,7 +915,7 @@ int binder_alloc_get_allocated_count(struct binder_alloc *alloc)
|
||||
*/
|
||||
void binder_alloc_vma_close(struct binder_alloc *alloc)
|
||||
{
|
||||
WRITE_ONCE(alloc->vma, NULL);
|
||||
binder_alloc_set_vma(alloc, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -924,7 +950,7 @@ enum lru_status binder_alloc_free_page(struct list_head *item,
|
||||
|
||||
index = page - alloc->pages;
|
||||
page_addr = (uintptr_t)alloc->buffer + index * PAGE_SIZE;
|
||||
vma = alloc->vma;
|
||||
vma = binder_alloc_get_vma(alloc);
|
||||
if (vma) {
|
||||
if (!mmget_not_zero(alloc->vma_vm_mm))
|
||||
goto err_mmget;
|
||||
|
@ -2096,7 +2096,7 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep)
|
||||
struct ahci_host_priv *hpriv = ap->host->private_data;
|
||||
void __iomem *port_mmio = ahci_port_base(ap);
|
||||
struct ata_device *dev = ap->link.device;
|
||||
u32 devslp, dm, dito, mdat, deto;
|
||||
u32 devslp, dm, dito, mdat, deto, dito_conf;
|
||||
int rc;
|
||||
unsigned int err_mask;
|
||||
|
||||
@ -2120,8 +2120,15 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep)
|
||||
return;
|
||||
}
|
||||
|
||||
/* device sleep was already enabled */
|
||||
if (devslp & PORT_DEVSLP_ADSE)
|
||||
dm = (devslp & PORT_DEVSLP_DM_MASK) >> PORT_DEVSLP_DM_OFFSET;
|
||||
dito = devslp_idle_timeout / (dm + 1);
|
||||
if (dito > 0x3ff)
|
||||
dito = 0x3ff;
|
||||
|
||||
dito_conf = (devslp >> PORT_DEVSLP_DITO_OFFSET) & 0x3FF;
|
||||
|
||||
/* device sleep was already enabled and same dito */
|
||||
if ((devslp & PORT_DEVSLP_ADSE) && (dito_conf == dito))
|
||||
return;
|
||||
|
||||
/* set DITO, MDAT, DETO and enable DevSlp, need to stop engine first */
|
||||
@ -2129,11 +2136,6 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep)
|
||||
if (rc)
|
||||
return;
|
||||
|
||||
dm = (devslp & PORT_DEVSLP_DM_MASK) >> PORT_DEVSLP_DM_OFFSET;
|
||||
dito = devslp_idle_timeout / (dm + 1);
|
||||
if (dito > 0x3ff)
|
||||
dito = 0x3ff;
|
||||
|
||||
/* Use the nominal value 10 ms if the read MDAT is zero,
|
||||
* the nominal value of DETO is 20 ms.
|
||||
*/
|
||||
@ -2151,6 +2153,8 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep)
|
||||
deto = 20;
|
||||
}
|
||||
|
||||
/* Make dito, mdat, deto bits to 0s */
|
||||
devslp &= ~GENMASK_ULL(24, 2);
|
||||
devslp |= ((dito << PORT_DEVSLP_DITO_OFFSET) |
|
||||
(mdat << PORT_DEVSLP_MDAT_OFFSET) |
|
||||
(deto << PORT_DEVSLP_DETO_OFFSET) |
|
||||
|
@ -1228,6 +1228,9 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
|
||||
case NBD_SET_SOCK:
|
||||
return nbd_add_socket(nbd, arg, false);
|
||||
case NBD_SET_BLKSIZE:
|
||||
if (!arg || !is_power_of_2(arg) || arg < 512 ||
|
||||
arg > PAGE_SIZE)
|
||||
return -EINVAL;
|
||||
nbd_size_set(nbd, arg,
|
||||
div_s64(config->bytesize, arg));
|
||||
return 0;
|
||||
|
@ -67,7 +67,7 @@
|
||||
#include <scsi/scsi.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/device.h>
|
||||
|
||||
#include <linux/nospec.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
#define DRIVER_NAME "pktcdvd"
|
||||
@ -2231,6 +2231,8 @@ static struct pktcdvd_device *pkt_find_dev_from_minor(unsigned int dev_minor)
|
||||
{
|
||||
if (dev_minor >= MAX_WRITERS)
|
||||
return NULL;
|
||||
|
||||
dev_minor = array_index_nospec(dev_minor, MAX_WRITERS);
|
||||
return pkt_devs[dev_minor];
|
||||
}
|
||||
|
||||
|
@ -146,6 +146,7 @@ config BT_HCIUART_LL
|
||||
config BT_HCIUART_3WIRE
|
||||
bool "Three-wire UART (H5) protocol support"
|
||||
depends on BT_HCIUART
|
||||
depends on BT_HCIUART_SERDEV
|
||||
help
|
||||
The HCI Three-wire UART Transport Layer makes it possible to
|
||||
user the Bluetooth HCI over a serial port interface. The HCI
|
||||
|
@ -369,10 +369,13 @@ err_len:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int tpm_request_locality(struct tpm_chip *chip)
|
||||
static int tpm_request_locality(struct tpm_chip *chip, unsigned int flags)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (flags & TPM_TRANSMIT_RAW)
|
||||
return 0;
|
||||
|
||||
if (!chip->ops->request_locality)
|
||||
return 0;
|
||||
|
||||
@ -385,10 +388,13 @@ static int tpm_request_locality(struct tpm_chip *chip)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void tpm_relinquish_locality(struct tpm_chip *chip)
|
||||
static void tpm_relinquish_locality(struct tpm_chip *chip, unsigned int flags)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (flags & TPM_TRANSMIT_RAW)
|
||||
return;
|
||||
|
||||
if (!chip->ops->relinquish_locality)
|
||||
return;
|
||||
|
||||
@ -399,6 +405,28 @@ static void tpm_relinquish_locality(struct tpm_chip *chip)
|
||||
chip->locality = -1;
|
||||
}
|
||||
|
||||
static int tpm_cmd_ready(struct tpm_chip *chip, unsigned int flags)
|
||||
{
|
||||
if (flags & TPM_TRANSMIT_RAW)
|
||||
return 0;
|
||||
|
||||
if (!chip->ops->cmd_ready)
|
||||
return 0;
|
||||
|
||||
return chip->ops->cmd_ready(chip);
|
||||
}
|
||||
|
||||
static int tpm_go_idle(struct tpm_chip *chip, unsigned int flags)
|
||||
{
|
||||
if (flags & TPM_TRANSMIT_RAW)
|
||||
return 0;
|
||||
|
||||
if (!chip->ops->go_idle)
|
||||
return 0;
|
||||
|
||||
return chip->ops->go_idle(chip);
|
||||
}
|
||||
|
||||
static ssize_t tpm_try_transmit(struct tpm_chip *chip,
|
||||
struct tpm_space *space,
|
||||
u8 *buf, size_t bufsiz,
|
||||
@ -449,14 +477,15 @@ static ssize_t tpm_try_transmit(struct tpm_chip *chip,
|
||||
/* Store the decision as chip->locality will be changed. */
|
||||
need_locality = chip->locality == -1;
|
||||
|
||||
if (!(flags & TPM_TRANSMIT_RAW) && need_locality) {
|
||||
rc = tpm_request_locality(chip);
|
||||
if (need_locality) {
|
||||
rc = tpm_request_locality(chip, flags);
|
||||
if (rc < 0)
|
||||
goto out_no_locality;
|
||||
}
|
||||
|
||||
if (chip->dev.parent)
|
||||
pm_runtime_get_sync(chip->dev.parent);
|
||||
rc = tpm_cmd_ready(chip, flags);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
rc = tpm2_prepare_space(chip, space, ordinal, buf);
|
||||
if (rc)
|
||||
@ -516,13 +545,16 @@ out_recv:
|
||||
}
|
||||
|
||||
rc = tpm2_commit_space(chip, space, ordinal, buf, &len);
|
||||
if (rc)
|
||||
dev_err(&chip->dev, "tpm2_commit_space: error %d\n", rc);
|
||||
|
||||
out:
|
||||
if (chip->dev.parent)
|
||||
pm_runtime_put_sync(chip->dev.parent);
|
||||
rc = tpm_go_idle(chip, flags);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
if (need_locality)
|
||||
tpm_relinquish_locality(chip);
|
||||
tpm_relinquish_locality(chip, flags);
|
||||
|
||||
out_no_locality:
|
||||
if (chip->ops->clk_enable != NULL)
|
||||
|
@ -511,9 +511,17 @@ extern const struct file_operations tpm_fops;
|
||||
extern const struct file_operations tpmrm_fops;
|
||||
extern struct idr dev_nums_idr;
|
||||
|
||||
/**
|
||||
* enum tpm_transmit_flags
|
||||
*
|
||||
* @TPM_TRANSMIT_UNLOCKED: used to lock sequence of tpm_transmit calls.
|
||||
* @TPM_TRANSMIT_RAW: prevent recursive calls into setup steps
|
||||
* (go idle, locality,..). Always use with UNLOCKED
|
||||
* as it will fail on double locking.
|
||||
*/
|
||||
enum tpm_transmit_flags {
|
||||
TPM_TRANSMIT_UNLOCKED = BIT(0),
|
||||
TPM_TRANSMIT_RAW = BIT(1),
|
||||
TPM_TRANSMIT_UNLOCKED = BIT(0),
|
||||
TPM_TRANSMIT_RAW = BIT(1),
|
||||
};
|
||||
|
||||
ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
|
||||
|
@ -39,7 +39,8 @@ static void tpm2_flush_sessions(struct tpm_chip *chip, struct tpm_space *space)
|
||||
for (i = 0; i < ARRAY_SIZE(space->session_tbl); i++) {
|
||||
if (space->session_tbl[i])
|
||||
tpm2_flush_context_cmd(chip, space->session_tbl[i],
|
||||
TPM_TRANSMIT_UNLOCKED);
|
||||
TPM_TRANSMIT_UNLOCKED |
|
||||
TPM_TRANSMIT_RAW);
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,7 +85,7 @@ static int tpm2_load_context(struct tpm_chip *chip, u8 *buf,
|
||||
tpm_buf_append(&tbuf, &buf[*offset], body_size);
|
||||
|
||||
rc = tpm_transmit_cmd(chip, NULL, tbuf.data, PAGE_SIZE, 4,
|
||||
TPM_TRANSMIT_UNLOCKED, NULL);
|
||||
TPM_TRANSMIT_UNLOCKED | TPM_TRANSMIT_RAW, NULL);
|
||||
if (rc < 0) {
|
||||
dev_warn(&chip->dev, "%s: failed with a system error %d\n",
|
||||
__func__, rc);
|
||||
@ -133,7 +134,7 @@ static int tpm2_save_context(struct tpm_chip *chip, u32 handle, u8 *buf,
|
||||
tpm_buf_append_u32(&tbuf, handle);
|
||||
|
||||
rc = tpm_transmit_cmd(chip, NULL, tbuf.data, PAGE_SIZE, 0,
|
||||
TPM_TRANSMIT_UNLOCKED, NULL);
|
||||
TPM_TRANSMIT_UNLOCKED | TPM_TRANSMIT_RAW, NULL);
|
||||
if (rc < 0) {
|
||||
dev_warn(&chip->dev, "%s: failed with a system error %d\n",
|
||||
__func__, rc);
|
||||
@ -170,7 +171,8 @@ static void tpm2_flush_space(struct tpm_chip *chip)
|
||||
for (i = 0; i < ARRAY_SIZE(space->context_tbl); i++)
|
||||
if (space->context_tbl[i] && ~space->context_tbl[i])
|
||||
tpm2_flush_context_cmd(chip, space->context_tbl[i],
|
||||
TPM_TRANSMIT_UNLOCKED);
|
||||
TPM_TRANSMIT_UNLOCKED |
|
||||
TPM_TRANSMIT_RAW);
|
||||
|
||||
tpm2_flush_sessions(chip, space);
|
||||
}
|
||||
@ -377,7 +379,8 @@ static int tpm2_map_response_header(struct tpm_chip *chip, u32 cc, u8 *rsp,
|
||||
|
||||
return 0;
|
||||
out_no_slots:
|
||||
tpm2_flush_context_cmd(chip, phandle, TPM_TRANSMIT_UNLOCKED);
|
||||
tpm2_flush_context_cmd(chip, phandle,
|
||||
TPM_TRANSMIT_UNLOCKED | TPM_TRANSMIT_RAW);
|
||||
dev_warn(&chip->dev, "%s: out of slots for 0x%08X\n", __func__,
|
||||
phandle);
|
||||
return -ENOMEM;
|
||||
@ -465,7 +468,8 @@ static int tpm2_save_space(struct tpm_chip *chip)
|
||||
return rc;
|
||||
|
||||
tpm2_flush_context_cmd(chip, space->context_tbl[i],
|
||||
TPM_TRANSMIT_UNLOCKED);
|
||||
TPM_TRANSMIT_UNLOCKED |
|
||||
TPM_TRANSMIT_RAW);
|
||||
space->context_tbl[i] = ~0;
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ static bool crb_wait_for_reg_32(u32 __iomem *reg, u32 mask, u32 value,
|
||||
}
|
||||
|
||||
/**
|
||||
* crb_go_idle - request tpm crb device to go the idle state
|
||||
* __crb_go_idle - request tpm crb device to go the idle state
|
||||
*
|
||||
* @dev: crb device
|
||||
* @priv: crb private data
|
||||
@ -151,7 +151,7 @@ static bool crb_wait_for_reg_32(u32 __iomem *reg, u32 mask, u32 value,
|
||||
*
|
||||
* Return: 0 always
|
||||
*/
|
||||
static int crb_go_idle(struct device *dev, struct crb_priv *priv)
|
||||
static int __crb_go_idle(struct device *dev, struct crb_priv *priv)
|
||||
{
|
||||
if ((priv->flags & CRB_FL_ACPI_START) ||
|
||||
(priv->flags & CRB_FL_CRB_SMC_START))
|
||||
@ -166,11 +166,20 @@ static int crb_go_idle(struct device *dev, struct crb_priv *priv)
|
||||
dev_warn(dev, "goIdle timed out\n");
|
||||
return -ETIME;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int crb_go_idle(struct tpm_chip *chip)
|
||||
{
|
||||
struct device *dev = &chip->dev;
|
||||
struct crb_priv *priv = dev_get_drvdata(dev);
|
||||
|
||||
return __crb_go_idle(dev, priv);
|
||||
}
|
||||
|
||||
/**
|
||||
* crb_cmd_ready - request tpm crb device to enter ready state
|
||||
* __crb_cmd_ready - request tpm crb device to enter ready state
|
||||
*
|
||||
* @dev: crb device
|
||||
* @priv: crb private data
|
||||
@ -183,7 +192,7 @@ static int crb_go_idle(struct device *dev, struct crb_priv *priv)
|
||||
*
|
||||
* Return: 0 on success -ETIME on timeout;
|
||||
*/
|
||||
static int crb_cmd_ready(struct device *dev, struct crb_priv *priv)
|
||||
static int __crb_cmd_ready(struct device *dev, struct crb_priv *priv)
|
||||
{
|
||||
if ((priv->flags & CRB_FL_ACPI_START) ||
|
||||
(priv->flags & CRB_FL_CRB_SMC_START))
|
||||
@ -201,6 +210,14 @@ static int crb_cmd_ready(struct device *dev, struct crb_priv *priv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int crb_cmd_ready(struct tpm_chip *chip)
|
||||
{
|
||||
struct device *dev = &chip->dev;
|
||||
struct crb_priv *priv = dev_get_drvdata(dev);
|
||||
|
||||
return __crb_cmd_ready(dev, priv);
|
||||
}
|
||||
|
||||
static int __crb_request_locality(struct device *dev,
|
||||
struct crb_priv *priv, int loc)
|
||||
{
|
||||
@ -393,6 +410,8 @@ static const struct tpm_class_ops tpm_crb = {
|
||||
.send = crb_send,
|
||||
.cancel = crb_cancel,
|
||||
.req_canceled = crb_req_canceled,
|
||||
.go_idle = crb_go_idle,
|
||||
.cmd_ready = crb_cmd_ready,
|
||||
.request_locality = crb_request_locality,
|
||||
.relinquish_locality = crb_relinquish_locality,
|
||||
.req_complete_mask = CRB_DRV_STS_COMPLETE,
|
||||
@ -508,7 +527,7 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv,
|
||||
* PTT HW bug w/a: wake up the device to access
|
||||
* possibly not retained registers.
|
||||
*/
|
||||
ret = crb_cmd_ready(dev, priv);
|
||||
ret = __crb_cmd_ready(dev, priv);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@ -553,7 +572,7 @@ out:
|
||||
if (!ret)
|
||||
priv->cmd_size = cmd_size;
|
||||
|
||||
crb_go_idle(dev, priv);
|
||||
__crb_go_idle(dev, priv);
|
||||
|
||||
__crb_relinquish_locality(dev, priv, 0);
|
||||
|
||||
@ -624,32 +643,7 @@ static int crb_acpi_add(struct acpi_device *device)
|
||||
chip->acpi_dev_handle = device->handle;
|
||||
chip->flags = TPM_CHIP_FLAG_TPM2;
|
||||
|
||||
rc = __crb_request_locality(dev, priv, 0);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = crb_cmd_ready(dev, priv);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
pm_runtime_get_noresume(dev);
|
||||
pm_runtime_set_active(dev);
|
||||
pm_runtime_enable(dev);
|
||||
|
||||
rc = tpm_chip_register(chip);
|
||||
if (rc) {
|
||||
crb_go_idle(dev, priv);
|
||||
pm_runtime_put_noidle(dev);
|
||||
pm_runtime_disable(dev);
|
||||
goto out;
|
||||
}
|
||||
|
||||
pm_runtime_put_sync(dev);
|
||||
|
||||
out:
|
||||
__crb_relinquish_locality(dev, priv, 0);
|
||||
|
||||
return rc;
|
||||
return tpm_chip_register(chip);
|
||||
}
|
||||
|
||||
static int crb_acpi_remove(struct acpi_device *device)
|
||||
@ -659,52 +653,11 @@ static int crb_acpi_remove(struct acpi_device *device)
|
||||
|
||||
tpm_chip_unregister(chip);
|
||||
|
||||
pm_runtime_disable(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused crb_pm_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct tpm_chip *chip = dev_get_drvdata(dev);
|
||||
struct crb_priv *priv = dev_get_drvdata(&chip->dev);
|
||||
|
||||
return crb_go_idle(dev, priv);
|
||||
}
|
||||
|
||||
static int __maybe_unused crb_pm_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct tpm_chip *chip = dev_get_drvdata(dev);
|
||||
struct crb_priv *priv = dev_get_drvdata(&chip->dev);
|
||||
|
||||
return crb_cmd_ready(dev, priv);
|
||||
}
|
||||
|
||||
static int __maybe_unused crb_pm_suspend(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = tpm_pm_suspend(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return crb_pm_runtime_suspend(dev);
|
||||
}
|
||||
|
||||
static int __maybe_unused crb_pm_resume(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = crb_pm_runtime_resume(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return tpm_pm_resume(dev);
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops crb_pm = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(crb_pm_suspend, crb_pm_resume)
|
||||
SET_RUNTIME_PM_OPS(crb_pm_runtime_suspend, crb_pm_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(tpm_pm_suspend, tpm_pm_resume)
|
||||
};
|
||||
|
||||
static const struct acpi_device_id crb_device_ids[] = {
|
||||
|
@ -117,7 +117,7 @@ static int iic_tpm_read(u8 addr, u8 *buffer, size_t len)
|
||||
/* Lock the adapter for the duration of the whole sequence. */
|
||||
if (!tpm_dev.client->adapter->algo->master_xfer)
|
||||
return -EOPNOTSUPP;
|
||||
i2c_lock_adapter(tpm_dev.client->adapter);
|
||||
i2c_lock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT);
|
||||
|
||||
if (tpm_dev.chip_type == SLB9645) {
|
||||
/* use a combined read for newer chips
|
||||
@ -192,7 +192,7 @@ static int iic_tpm_read(u8 addr, u8 *buffer, size_t len)
|
||||
}
|
||||
|
||||
out:
|
||||
i2c_unlock_adapter(tpm_dev.client->adapter);
|
||||
i2c_unlock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT);
|
||||
/* take care of 'guard time' */
|
||||
usleep_range(SLEEP_DURATION_LOW, SLEEP_DURATION_HI);
|
||||
|
||||
@ -224,7 +224,7 @@ static int iic_tpm_write_generic(u8 addr, u8 *buffer, size_t len,
|
||||
|
||||
if (!tpm_dev.client->adapter->algo->master_xfer)
|
||||
return -EOPNOTSUPP;
|
||||
i2c_lock_adapter(tpm_dev.client->adapter);
|
||||
i2c_lock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT);
|
||||
|
||||
/* prepend the 'register address' to the buffer */
|
||||
tpm_dev.buf[0] = addr;
|
||||
@ -243,7 +243,7 @@ static int iic_tpm_write_generic(u8 addr, u8 *buffer, size_t len,
|
||||
usleep_range(sleep_low, sleep_hi);
|
||||
}
|
||||
|
||||
i2c_unlock_adapter(tpm_dev.client->adapter);
|
||||
i2c_unlock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT);
|
||||
/* take care of 'guard time' */
|
||||
usleep_range(SLEEP_DURATION_LOW, SLEEP_DURATION_HI);
|
||||
|
||||
|
@ -188,6 +188,7 @@ static const struct tpm_tis_phy_ops tpm_spi_phy_ops = {
|
||||
static int tpm_tis_spi_probe(struct spi_device *dev)
|
||||
{
|
||||
struct tpm_tis_spi_phy *phy;
|
||||
int irq;
|
||||
|
||||
phy = devm_kzalloc(&dev->dev, sizeof(struct tpm_tis_spi_phy),
|
||||
GFP_KERNEL);
|
||||
@ -200,7 +201,13 @@ static int tpm_tis_spi_probe(struct spi_device *dev)
|
||||
if (!phy->iobuf)
|
||||
return -ENOMEM;
|
||||
|
||||
return tpm_tis_core_init(&dev->dev, &phy->priv, -1, &tpm_spi_phy_ops,
|
||||
/* If the SPI device has an IRQ then use that */
|
||||
if (dev->irq > 0)
|
||||
irq = dev->irq;
|
||||
else
|
||||
irq = -1;
|
||||
|
||||
return tpm_tis_core_init(&dev->dev, &phy->priv, irq, &tpm_spi_phy_ops,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
@ -246,6 +246,7 @@ static int vpd_section_destroy(struct vpd_section *sec)
|
||||
sysfs_remove_bin_file(vpd_kobj, &sec->bin_attr);
|
||||
kfree(sec->raw_name);
|
||||
memunmap(sec->baseaddr);
|
||||
sec->enabled = false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -279,8 +280,10 @@ static int vpd_sections_init(phys_addr_t physaddr)
|
||||
ret = vpd_section_init("rw", &rw_vpd,
|
||||
physaddr + sizeof(struct vpd_cbmem) +
|
||||
header.ro_size, header.rw_size);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
vpd_section_destroy(&ro_vpd);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -497,9 +497,10 @@ static int ioh_gpio_probe(struct pci_dev *pdev,
|
||||
return 0;
|
||||
|
||||
err_gpiochip_add:
|
||||
chip = chip_save;
|
||||
while (--i >= 0) {
|
||||
chip--;
|
||||
gpiochip_remove(&chip->gpio);
|
||||
chip++;
|
||||
}
|
||||
kfree(chip_save);
|
||||
|
||||
|
@ -728,4 +728,4 @@ static int __init tegra_gpio_init(void)
|
||||
{
|
||||
return platform_driver_register(&tegra_gpio_driver);
|
||||
}
|
||||
postcore_initcall(tegra_gpio_init);
|
||||
subsys_initcall(tegra_gpio_init);
|
||||
|
@ -8462,6 +8462,7 @@ enum skl_power_gate {
|
||||
#define TRANS_MSA_10_BPC (2<<5)
|
||||
#define TRANS_MSA_12_BPC (3<<5)
|
||||
#define TRANS_MSA_16_BPC (4<<5)
|
||||
#define TRANS_MSA_CEA_RANGE (1<<3)
|
||||
|
||||
/* LCPLL Control */
|
||||
#define LCPLL_CTL _MMIO(0x130040)
|
||||
|
@ -1396,6 +1396,10 @@ void intel_ddi_set_pipe_settings(const struct intel_crtc_state *crtc_state)
|
||||
WARN_ON(transcoder_is_dsi(cpu_transcoder));
|
||||
|
||||
temp = TRANS_MSA_SYNC_CLK;
|
||||
|
||||
if (crtc_state->limited_color_range)
|
||||
temp |= TRANS_MSA_CEA_RANGE;
|
||||
|
||||
switch (crtc_state->pipe_bpp) {
|
||||
case 18:
|
||||
temp |= TRANS_MSA_6_BPC;
|
||||
|
@ -1401,6 +1401,8 @@ static int ipu_probe(struct platform_device *pdev)
|
||||
return -ENODEV;
|
||||
|
||||
ipu->id = of_alias_get_id(np, "ipu");
|
||||
if (ipu->id < 0)
|
||||
ipu->id = 0;
|
||||
|
||||
if (of_device_is_compatible(np, "fsl,imx6qp-ipu") &&
|
||||
IS_ENABLED(CONFIG_DRM)) {
|
||||
|
@ -196,6 +196,10 @@ int hv_synic_alloc(void)
|
||||
|
||||
return 0;
|
||||
err:
|
||||
/*
|
||||
* Any memory allocations that succeeded will be freed when
|
||||
* the caller cleans up by calling hv_synic_free()
|
||||
*/
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@ -208,12 +212,10 @@ void hv_synic_free(void)
|
||||
struct hv_per_cpu_context *hv_cpu
|
||||
= per_cpu_ptr(hv_context.cpu_context, cpu);
|
||||
|
||||
if (hv_cpu->synic_event_page)
|
||||
free_page((unsigned long)hv_cpu->synic_event_page);
|
||||
if (hv_cpu->synic_message_page)
|
||||
free_page((unsigned long)hv_cpu->synic_message_page);
|
||||
if (hv_cpu->post_msg_page)
|
||||
free_page((unsigned long)hv_cpu->post_msg_page);
|
||||
kfree(hv_cpu->clk_evt);
|
||||
free_page((unsigned long)hv_cpu->synic_event_page);
|
||||
free_page((unsigned long)hv_cpu->synic_message_page);
|
||||
free_page((unsigned long)hv_cpu->post_msg_page);
|
||||
}
|
||||
|
||||
kfree(hv_context.hv_numa_map);
|
||||
|
@ -859,7 +859,7 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
|
||||
if (!match)
|
||||
bus->get_clk_reg_val = aspeed_i2c_24xx_get_clk_reg_val;
|
||||
else
|
||||
bus->get_clk_reg_val = match->data;
|
||||
bus->get_clk_reg_val = (u32 (*)(u32))match->data;
|
||||
|
||||
/* Initialize the I2C adapter */
|
||||
spin_lock_init(&bus->lock);
|
||||
|
@ -138,6 +138,7 @@
|
||||
|
||||
#define SBREG_BAR 0x10
|
||||
#define SBREG_SMBCTRL 0xc6000c
|
||||
#define SBREG_SMBCTRL_DNV 0xcf000c
|
||||
|
||||
/* Host status bits for SMBPCISTS */
|
||||
#define SMBPCISTS_INTS BIT(3)
|
||||
@ -1395,7 +1396,11 @@ static void i801_add_tco(struct i801_priv *priv)
|
||||
spin_unlock(&p2sb_spinlock);
|
||||
|
||||
res = &tco_res[ICH_RES_MEM_OFF];
|
||||
res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL;
|
||||
if (pci_dev->device == PCI_DEVICE_ID_INTEL_DNV_SMBUS)
|
||||
res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL_DNV;
|
||||
else
|
||||
res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL;
|
||||
|
||||
res->end = res->start + 3;
|
||||
res->flags = IORESOURCE_MEM;
|
||||
|
||||
|
@ -538,6 +538,7 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
|
||||
{
|
||||
u8 rx_watermark;
|
||||
struct i2c_msg *msg = i2c->rx_msg = i2c->tx_msg;
|
||||
unsigned long flags;
|
||||
|
||||
/* Clear and enable Rx full interrupt. */
|
||||
xiic_irq_clr_en(i2c, XIIC_INTR_RX_FULL_MASK | XIIC_INTR_TX_ERROR_MASK);
|
||||
@ -553,6 +554,7 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
|
||||
rx_watermark = IIC_RX_FIFO_DEPTH;
|
||||
xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, rx_watermark - 1);
|
||||
|
||||
local_irq_save(flags);
|
||||
if (!(msg->flags & I2C_M_NOSTART))
|
||||
/* write the address */
|
||||
xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET,
|
||||
@ -563,6 +565,8 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
|
||||
|
||||
xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET,
|
||||
msg->len | ((i2c->nmsgs == 1) ? XIIC_TX_DYN_STOP_MASK : 0));
|
||||
local_irq_restore(flags);
|
||||
|
||||
if (i2c->nmsgs == 1)
|
||||
/* very last, enable bus not busy as well */
|
||||
xiic_irq_clr_en(i2c, XIIC_INTR_BNB_MASK);
|
||||
|
@ -1459,9 +1459,16 @@ static bool cma_match_net_dev(const struct rdma_cm_id *id,
|
||||
(addr->src_addr.ss_family == AF_IB ||
|
||||
cma_protocol_roce_dev_port(id->device, port_num));
|
||||
|
||||
return !addr->dev_addr.bound_dev_if ||
|
||||
(net_eq(dev_net(net_dev), addr->dev_addr.net) &&
|
||||
addr->dev_addr.bound_dev_if == net_dev->ifindex);
|
||||
/*
|
||||
* Net namespaces must match, and if the listner is listening
|
||||
* on a specific netdevice than netdevice must match as well.
|
||||
*/
|
||||
if (net_eq(dev_net(net_dev), addr->dev_addr.net) &&
|
||||
(!!addr->dev_addr.bound_dev_if ==
|
||||
(addr->dev_addr.bound_dev_if == net_dev->ifindex)))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
static struct rdma_id_private *cma_find_listener(
|
||||
|
@ -1647,10 +1647,11 @@ static int mxt_parse_object_table(struct mxt_data *data,
|
||||
break;
|
||||
case MXT_TOUCH_MULTI_T9:
|
||||
data->multitouch = MXT_TOUCH_MULTI_T9;
|
||||
/* Only handle messages from first T9 instance */
|
||||
data->T9_reportid_min = min_id;
|
||||
data->T9_reportid_max = max_id;
|
||||
data->num_touchids = object->num_report_ids
|
||||
* mxt_obj_instances(object);
|
||||
data->T9_reportid_max = min_id +
|
||||
object->num_report_ids - 1;
|
||||
data->num_touchids = object->num_report_ids;
|
||||
break;
|
||||
case MXT_SPT_MESSAGECOUNT_T44:
|
||||
data->T44_address = object->start_address;
|
||||
|
@ -54,7 +54,7 @@ struct ipmmu_vmsa_domain {
|
||||
struct io_pgtable_ops *iop;
|
||||
|
||||
unsigned int context_id;
|
||||
spinlock_t lock; /* Protects mappings */
|
||||
struct mutex mutex; /* Protects mappings */
|
||||
};
|
||||
|
||||
struct ipmmu_vmsa_iommu_priv {
|
||||
@ -523,7 +523,7 @@ static struct iommu_domain *__ipmmu_domain_alloc(unsigned type)
|
||||
if (!domain)
|
||||
return NULL;
|
||||
|
||||
spin_lock_init(&domain->lock);
|
||||
mutex_init(&domain->mutex);
|
||||
|
||||
return &domain->io_domain;
|
||||
}
|
||||
@ -548,7 +548,6 @@ static int ipmmu_attach_device(struct iommu_domain *io_domain,
|
||||
struct iommu_fwspec *fwspec = dev->iommu_fwspec;
|
||||
struct ipmmu_vmsa_device *mmu = priv->mmu;
|
||||
struct ipmmu_vmsa_domain *domain = to_vmsa_domain(io_domain);
|
||||
unsigned long flags;
|
||||
unsigned int i;
|
||||
int ret = 0;
|
||||
|
||||
@ -557,7 +556,7 @@ static int ipmmu_attach_device(struct iommu_domain *io_domain,
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&domain->lock, flags);
|
||||
mutex_lock(&domain->mutex);
|
||||
|
||||
if (!domain->mmu) {
|
||||
/* The domain hasn't been used yet, initialize it. */
|
||||
@ -574,7 +573,7 @@ static int ipmmu_attach_device(struct iommu_domain *io_domain,
|
||||
} else
|
||||
dev_info(dev, "Reusing IPMMU context %u\n", domain->context_id);
|
||||
|
||||
spin_unlock_irqrestore(&domain->lock, flags);
|
||||
mutex_unlock(&domain->mutex);
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
@ -532,8 +532,9 @@ init_pmu(void)
|
||||
int timeout;
|
||||
struct adb_request req;
|
||||
|
||||
out_8(&via[B], via[B] | TREQ); /* negate TREQ */
|
||||
out_8(&via[DIRB], (via[DIRB] | TREQ) & ~TACK); /* TACK in, TREQ out */
|
||||
/* Negate TREQ. Set TACK to input and TREQ to output. */
|
||||
out_8(&via[B], in_8(&via[B]) | TREQ);
|
||||
out_8(&via[DIRB], (in_8(&via[DIRB]) | TREQ) & ~TACK);
|
||||
|
||||
pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
|
||||
timeout = 100000;
|
||||
@ -1455,8 +1456,8 @@ pmu_sr_intr(void)
|
||||
struct adb_request *req;
|
||||
int bite = 0;
|
||||
|
||||
if (via[B] & TREQ) {
|
||||
printk(KERN_ERR "PMU: spurious SR intr (%x)\n", via[B]);
|
||||
if (in_8(&via[B]) & TREQ) {
|
||||
printk(KERN_ERR "PMU: spurious SR intr (%x)\n", in_8(&via[B]));
|
||||
out_8(&via[IFR], SR_INT);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2330,7 +2330,7 @@ static int parse_features(struct cache_args *ca, struct dm_arg_set *as,
|
||||
{0, 2, "Invalid number of cache feature arguments"},
|
||||
};
|
||||
|
||||
int r;
|
||||
int r, mode_ctr = 0;
|
||||
unsigned argc;
|
||||
const char *arg;
|
||||
struct cache_features *cf = &ca->features;
|
||||
@ -2344,14 +2344,20 @@ static int parse_features(struct cache_args *ca, struct dm_arg_set *as,
|
||||
while (argc--) {
|
||||
arg = dm_shift_arg(as);
|
||||
|
||||
if (!strcasecmp(arg, "writeback"))
|
||||
if (!strcasecmp(arg, "writeback")) {
|
||||
cf->io_mode = CM_IO_WRITEBACK;
|
||||
mode_ctr++;
|
||||
}
|
||||
|
||||
else if (!strcasecmp(arg, "writethrough"))
|
||||
else if (!strcasecmp(arg, "writethrough")) {
|
||||
cf->io_mode = CM_IO_WRITETHROUGH;
|
||||
mode_ctr++;
|
||||
}
|
||||
|
||||
else if (!strcasecmp(arg, "passthrough"))
|
||||
else if (!strcasecmp(arg, "passthrough")) {
|
||||
cf->io_mode = CM_IO_PASSTHROUGH;
|
||||
mode_ctr++;
|
||||
}
|
||||
|
||||
else if (!strcasecmp(arg, "metadata2"))
|
||||
cf->metadata_version = 2;
|
||||
@ -2362,6 +2368,11 @@ static int parse_features(struct cache_args *ca, struct dm_arg_set *as,
|
||||
}
|
||||
}
|
||||
|
||||
if (mode_ctr > 1) {
|
||||
*error = "Duplicate cache io_mode features requested";
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -4516,6 +4516,12 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s)
|
||||
s->failed++;
|
||||
if (rdev && !test_bit(Faulty, &rdev->flags))
|
||||
do_recovery = 1;
|
||||
else if (!rdev) {
|
||||
rdev = rcu_dereference(
|
||||
conf->disks[i].replacement);
|
||||
if (rdev && !test_bit(Faulty, &rdev->flags))
|
||||
do_recovery = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (test_bit(R5_InJournal, &dev->flags))
|
||||
|
@ -897,7 +897,10 @@ static int helene_x_pon(struct helene_priv *priv)
|
||||
helene_write_regs(priv, 0x99, cdata, sizeof(cdata));
|
||||
|
||||
/* 0x81 - 0x94 */
|
||||
data[0] = 0x18; /* xtal 24 MHz */
|
||||
if (priv->xtal == SONY_HELENE_XTAL_16000)
|
||||
data[0] = 0x10; /* xtal 16 MHz */
|
||||
else
|
||||
data[0] = 0x18; /* xtal 24 MHz */
|
||||
data[1] = (uint8_t)(0x80 | (0x04 & 0x1F)); /* 4 x 25 = 100uA */
|
||||
data[2] = (uint8_t)(0x80 | (0x26 & 0x7F)); /* 38 x 0.25 = 9.5pF */
|
||||
data[3] = 0x80; /* REFOUT signal output 500mVpp */
|
||||
|
@ -1114,6 +1114,14 @@ vpif_init_free_channel_objects:
|
||||
return err;
|
||||
}
|
||||
|
||||
static void free_vpif_objs(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++)
|
||||
kfree(vpif_obj.dev[i]);
|
||||
}
|
||||
|
||||
static int vpif_async_bound(struct v4l2_async_notifier *notifier,
|
||||
struct v4l2_subdev *subdev,
|
||||
struct v4l2_async_subdev *asd)
|
||||
@ -1250,11 +1258,6 @@ static __init int vpif_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!pdev->dev.platform_data) {
|
||||
dev_warn(&pdev->dev, "Missing platform data. Giving up.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
vpif_dev = &pdev->dev;
|
||||
err = initialize_vpif();
|
||||
|
||||
@ -1266,7 +1269,7 @@ static __init int vpif_probe(struct platform_device *pdev)
|
||||
err = v4l2_device_register(vpif_dev, &vpif_obj.v4l2_dev);
|
||||
if (err) {
|
||||
v4l2_err(vpif_dev->driver, "Error registering v4l2 device\n");
|
||||
return err;
|
||||
goto vpif_free;
|
||||
}
|
||||
|
||||
while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, res_idx))) {
|
||||
@ -1309,7 +1312,10 @@ static __init int vpif_probe(struct platform_device *pdev)
|
||||
if (vpif_obj.sd[i])
|
||||
vpif_obj.sd[i]->grp_id = 1 << i;
|
||||
}
|
||||
vpif_probe_complete();
|
||||
err = vpif_probe_complete();
|
||||
if (err) {
|
||||
goto probe_subdev_out;
|
||||
}
|
||||
} else {
|
||||
vpif_obj.notifier.subdevs = vpif_obj.config->asd;
|
||||
vpif_obj.notifier.num_subdevs = vpif_obj.config->asd_sizes[0];
|
||||
@ -1330,6 +1336,8 @@ probe_subdev_out:
|
||||
kfree(vpif_obj.sd);
|
||||
vpif_unregister:
|
||||
v4l2_device_unregister(&vpif_obj.v4l2_dev);
|
||||
vpif_free:
|
||||
free_vpif_objs();
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -1351,8 +1359,8 @@ static int vpif_remove(struct platform_device *device)
|
||||
ch = vpif_obj.dev[i];
|
||||
/* Unregister video device */
|
||||
video_unregister_device(&ch->video_dev);
|
||||
kfree(vpif_obj.dev[i]);
|
||||
}
|
||||
free_vpif_objs();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -392,9 +392,6 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
|
||||
!media_entity_remote_pad(&csid->pads[MSM_CSID_PAD_SINK]))
|
||||
return -ENOLINK;
|
||||
|
||||
dt = csid_get_fmt_entry(csid->fmt[MSM_CSID_PAD_SRC].code)->
|
||||
data_type;
|
||||
|
||||
if (tg->enabled) {
|
||||
/* Config Test Generator */
|
||||
struct v4l2_mbus_framefmt *f =
|
||||
@ -416,6 +413,9 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
|
||||
writel_relaxed(val, csid->base +
|
||||
CAMSS_CSID_TG_DT_n_CGG_0(0));
|
||||
|
||||
dt = csid_get_fmt_entry(
|
||||
csid->fmt[MSM_CSID_PAD_SRC].code)->data_type;
|
||||
|
||||
/* 5:0 data type */
|
||||
val = dt;
|
||||
writel_relaxed(val, csid->base +
|
||||
@ -425,6 +425,9 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
|
||||
val = tg->payload_mode;
|
||||
writel_relaxed(val, csid->base +
|
||||
CAMSS_CSID_TG_DT_n_CGG_2(0));
|
||||
|
||||
df = csid_get_fmt_entry(
|
||||
csid->fmt[MSM_CSID_PAD_SRC].code)->decode_format;
|
||||
} else {
|
||||
struct csid_phy_config *phy = &csid->phy;
|
||||
|
||||
@ -439,13 +442,16 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
|
||||
|
||||
writel_relaxed(val,
|
||||
csid->base + CAMSS_CSID_CORE_CTRL_1);
|
||||
|
||||
dt = csid_get_fmt_entry(
|
||||
csid->fmt[MSM_CSID_PAD_SINK].code)->data_type;
|
||||
df = csid_get_fmt_entry(
|
||||
csid->fmt[MSM_CSID_PAD_SINK].code)->decode_format;
|
||||
}
|
||||
|
||||
/* Config LUT */
|
||||
|
||||
dt_shift = (cid % 4) * 8;
|
||||
df = csid_get_fmt_entry(csid->fmt[MSM_CSID_PAD_SINK].code)->
|
||||
decode_format;
|
||||
|
||||
val = readl_relaxed(csid->base + CAMSS_CSID_CID_LUT_VC_n(vc));
|
||||
val &= ~(0xff << dt_shift);
|
||||
|
@ -254,24 +254,24 @@ static void s5p_mfc_handle_frame_all_extracted(struct s5p_mfc_ctx *ctx)
|
||||
static void s5p_mfc_handle_frame_copy_time(struct s5p_mfc_ctx *ctx)
|
||||
{
|
||||
struct s5p_mfc_dev *dev = ctx->dev;
|
||||
struct s5p_mfc_buf *dst_buf, *src_buf;
|
||||
size_t dec_y_addr;
|
||||
struct s5p_mfc_buf *dst_buf, *src_buf;
|
||||
u32 dec_y_addr;
|
||||
unsigned int frame_type;
|
||||
|
||||
/* Make sure we actually have a new frame before continuing. */
|
||||
frame_type = s5p_mfc_hw_call(dev->mfc_ops, get_dec_frame_type, dev);
|
||||
if (frame_type == S5P_FIMV_DECODE_FRAME_SKIPPED)
|
||||
return;
|
||||
dec_y_addr = s5p_mfc_hw_call(dev->mfc_ops, get_dec_y_adr, dev);
|
||||
dec_y_addr = (u32)s5p_mfc_hw_call(dev->mfc_ops, get_dec_y_adr, dev);
|
||||
|
||||
/* Copy timestamp / timecode from decoded src to dst and set
|
||||
appropriate flags. */
|
||||
src_buf = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);
|
||||
list_for_each_entry(dst_buf, &ctx->dst_queue, list) {
|
||||
if (vb2_dma_contig_plane_dma_addr(&dst_buf->b->vb2_buf, 0)
|
||||
== dec_y_addr) {
|
||||
dst_buf->b->timecode =
|
||||
src_buf->b->timecode;
|
||||
u32 addr = (u32)vb2_dma_contig_plane_dma_addr(&dst_buf->b->vb2_buf, 0);
|
||||
|
||||
if (addr == dec_y_addr) {
|
||||
dst_buf->b->timecode = src_buf->b->timecode;
|
||||
dst_buf->b->vb2_buf.timestamp =
|
||||
src_buf->b->vb2_buf.timestamp;
|
||||
dst_buf->b->flags &=
|
||||
@ -307,10 +307,10 @@ static void s5p_mfc_handle_frame_new(struct s5p_mfc_ctx *ctx, unsigned int err)
|
||||
{
|
||||
struct s5p_mfc_dev *dev = ctx->dev;
|
||||
struct s5p_mfc_buf *dst_buf;
|
||||
size_t dspl_y_addr;
|
||||
u32 dspl_y_addr;
|
||||
unsigned int frame_type;
|
||||
|
||||
dspl_y_addr = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_y_adr, dev);
|
||||
dspl_y_addr = (u32)s5p_mfc_hw_call(dev->mfc_ops, get_dspl_y_adr, dev);
|
||||
if (IS_MFCV6_PLUS(dev))
|
||||
frame_type = s5p_mfc_hw_call(dev->mfc_ops,
|
||||
get_disp_frame_type, ctx);
|
||||
@ -329,9 +329,10 @@ static void s5p_mfc_handle_frame_new(struct s5p_mfc_ctx *ctx, unsigned int err)
|
||||
/* The MFC returns address of the buffer, now we have to
|
||||
* check which videobuf does it correspond to */
|
||||
list_for_each_entry(dst_buf, &ctx->dst_queue, list) {
|
||||
u32 addr = (u32)vb2_dma_contig_plane_dma_addr(&dst_buf->b->vb2_buf, 0);
|
||||
|
||||
/* Check if this is the buffer we're looking for */
|
||||
if (vb2_dma_contig_plane_dma_addr(&dst_buf->b->vb2_buf, 0)
|
||||
== dspl_y_addr) {
|
||||
if (addr == dspl_y_addr) {
|
||||
list_del(&dst_buf->list);
|
||||
ctx->dst_queue_cnt--;
|
||||
dst_buf->b->sequence = ctx->sequence;
|
||||
|
@ -2103,14 +2103,12 @@ static struct dvb_usb_device_properties s6x0_properties = {
|
||||
}
|
||||
};
|
||||
|
||||
static struct dvb_usb_device_properties *p1100;
|
||||
static const struct dvb_usb_device_description d1100 = {
|
||||
"Prof 1100 USB ",
|
||||
{&dw2102_table[PROF_1100], NULL},
|
||||
{NULL},
|
||||
};
|
||||
|
||||
static struct dvb_usb_device_properties *s660;
|
||||
static const struct dvb_usb_device_description d660 = {
|
||||
"TeVii S660 USB",
|
||||
{&dw2102_table[TEVII_S660], NULL},
|
||||
@ -2129,14 +2127,12 @@ static const struct dvb_usb_device_description d480_2 = {
|
||||
{NULL},
|
||||
};
|
||||
|
||||
static struct dvb_usb_device_properties *p7500;
|
||||
static const struct dvb_usb_device_description d7500 = {
|
||||
"Prof 7500 USB DVB-S2",
|
||||
{&dw2102_table[PROF_7500], NULL},
|
||||
{NULL},
|
||||
};
|
||||
|
||||
static struct dvb_usb_device_properties *s421;
|
||||
static const struct dvb_usb_device_description d421 = {
|
||||
"TeVii S421 PCI",
|
||||
{&dw2102_table[TEVII_S421], NULL},
|
||||
@ -2336,6 +2332,11 @@ static int dw2102_probe(struct usb_interface *intf,
|
||||
const struct usb_device_id *id)
|
||||
{
|
||||
int retval = -ENOMEM;
|
||||
struct dvb_usb_device_properties *p1100;
|
||||
struct dvb_usb_device_properties *s660;
|
||||
struct dvb_usb_device_properties *p7500;
|
||||
struct dvb_usb_device_properties *s421;
|
||||
|
||||
p1100 = kmemdup(&s6x0_properties,
|
||||
sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
|
||||
if (!p1100)
|
||||
@ -2404,8 +2405,16 @@ static int dw2102_probe(struct usb_interface *intf,
|
||||
0 == dvb_usb_device_init(intf, &t220_properties,
|
||||
THIS_MODULE, NULL, adapter_nr) ||
|
||||
0 == dvb_usb_device_init(intf, &tt_s2_4600_properties,
|
||||
THIS_MODULE, NULL, adapter_nr))
|
||||
THIS_MODULE, NULL, adapter_nr)) {
|
||||
|
||||
/* clean up copied properties */
|
||||
kfree(s421);
|
||||
kfree(p7500);
|
||||
kfree(s660);
|
||||
kfree(p1100);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
retval = -ENODEV;
|
||||
kfree(s421);
|
||||
|
@ -210,14 +210,13 @@ static int ti_tscadc_probe(struct platform_device *pdev)
|
||||
* The TSC_ADC_SS controller design assumes the OCP clock is
|
||||
* at least 6x faster than the ADC clock.
|
||||
*/
|
||||
clk = clk_get(&pdev->dev, "adc_tsc_fck");
|
||||
clk = devm_clk_get(&pdev->dev, "adc_tsc_fck");
|
||||
if (IS_ERR(clk)) {
|
||||
dev_err(&pdev->dev, "failed to get TSC fck\n");
|
||||
err = PTR_ERR(clk);
|
||||
goto err_disable_clk;
|
||||
}
|
||||
clock_rate = clk_get_rate(clk);
|
||||
clk_put(clk);
|
||||
tscadc->clk_div = clock_rate / ADC_CLK;
|
||||
|
||||
/* TSCADC_CLKDIV needs to be configured to the value minus 1 */
|
||||
|
@ -370,11 +370,10 @@ int scif_bind(scif_epd_t epd, u16 pn)
|
||||
goto scif_bind_exit;
|
||||
}
|
||||
} else {
|
||||
pn = scif_get_new_port();
|
||||
if (!pn) {
|
||||
ret = -ENOSPC;
|
||||
ret = scif_get_new_port();
|
||||
if (ret < 0)
|
||||
goto scif_bind_exit;
|
||||
}
|
||||
pn = ret;
|
||||
}
|
||||
|
||||
ep->state = SCIFEP_BOUND;
|
||||
@ -648,13 +647,12 @@ int __scif_connect(scif_epd_t epd, struct scif_port_id *dst, bool non_block)
|
||||
err = -EISCONN;
|
||||
break;
|
||||
case SCIFEP_UNBOUND:
|
||||
ep->port.port = scif_get_new_port();
|
||||
if (!ep->port.port) {
|
||||
err = -ENOSPC;
|
||||
} else {
|
||||
ep->port.node = scif_info.nodeid;
|
||||
ep->conn_async_state = ASYNC_CONN_IDLE;
|
||||
}
|
||||
err = scif_get_new_port();
|
||||
if (err < 0)
|
||||
break;
|
||||
ep->port.port = err;
|
||||
ep->port.node = scif_info.nodeid;
|
||||
ep->conn_async_state = ASYNC_CONN_IDLE;
|
||||
/* Fall through */
|
||||
case SCIFEP_BOUND:
|
||||
/*
|
||||
|
@ -756,14 +756,14 @@ static int kim_probe(struct platform_device *pdev)
|
||||
err = gpio_request(kim_gdata->nshutdown, "kim");
|
||||
if (unlikely(err)) {
|
||||
pr_err(" gpio %d request failed ", kim_gdata->nshutdown);
|
||||
return err;
|
||||
goto err_sysfs_group;
|
||||
}
|
||||
|
||||
/* Configure nShutdown GPIO as output=0 */
|
||||
err = gpio_direction_output(kim_gdata->nshutdown, 0);
|
||||
if (unlikely(err)) {
|
||||
pr_err(" unable to configure gpio %d", kim_gdata->nshutdown);
|
||||
return err;
|
||||
goto err_sysfs_group;
|
||||
}
|
||||
/* get reference of pdev for request_firmware
|
||||
*/
|
||||
|
@ -1615,8 +1615,10 @@ int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai)
|
||||
cond_resched();
|
||||
|
||||
e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL);
|
||||
if (!e)
|
||||
if (!e) {
|
||||
err = -ENOMEM;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
e->pnum = aeb->pnum;
|
||||
e->ec = aeb->ec;
|
||||
@ -1635,8 +1637,10 @@ int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai)
|
||||
cond_resched();
|
||||
|
||||
e = kmem_cache_alloc(ubi_wl_entry_slab, GFP_KERNEL);
|
||||
if (!e)
|
||||
if (!e) {
|
||||
err = -ENOMEM;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
e->pnum = aeb->pnum;
|
||||
e->ec = aeb->ec;
|
||||
|
@ -3195,7 +3195,6 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu)
|
||||
|
||||
on_each_cpu(mvneta_percpu_enable, pp, true);
|
||||
mvneta_start_dev(pp);
|
||||
mvneta_port_up(pp);
|
||||
|
||||
netdev_update_features(dev);
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <linux/mdio-mux.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#define MDIO_PARAM_OFFSET 0x00
|
||||
#define MDIO_PARAM_OFFSET 0x23c
|
||||
#define MDIO_PARAM_MIIM_CYCLE 29
|
||||
#define MDIO_PARAM_INTERNAL_SEL 25
|
||||
#define MDIO_PARAM_BUS_ID 22
|
||||
@ -30,20 +30,22 @@
|
||||
#define MDIO_PARAM_PHY_ID 16
|
||||
#define MDIO_PARAM_PHY_DATA 0
|
||||
|
||||
#define MDIO_READ_OFFSET 0x04
|
||||
#define MDIO_READ_OFFSET 0x240
|
||||
#define MDIO_READ_DATA_MASK 0xffff
|
||||
#define MDIO_ADDR_OFFSET 0x08
|
||||
#define MDIO_ADDR_OFFSET 0x244
|
||||
|
||||
#define MDIO_CTRL_OFFSET 0x0C
|
||||
#define MDIO_CTRL_OFFSET 0x248
|
||||
#define MDIO_CTRL_WRITE_OP 0x1
|
||||
#define MDIO_CTRL_READ_OP 0x2
|
||||
|
||||
#define MDIO_STAT_OFFSET 0x10
|
||||
#define MDIO_STAT_OFFSET 0x24c
|
||||
#define MDIO_STAT_DONE 1
|
||||
|
||||
#define BUS_MAX_ADDR 32
|
||||
#define EXT_BUS_START_ADDR 16
|
||||
|
||||
#define MDIO_REG_ADDR_SPACE_SIZE 0x250
|
||||
|
||||
struct iproc_mdiomux_desc {
|
||||
void *mux_handle;
|
||||
void __iomem *base;
|
||||
@ -169,6 +171,14 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev)
|
||||
md->dev = &pdev->dev;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (res->start & 0xfff) {
|
||||
/* For backward compatibility in case the
|
||||
* base address is specified with an offset.
|
||||
*/
|
||||
dev_info(&pdev->dev, "fix base address in dt-blob\n");
|
||||
res->start &= ~0xfff;
|
||||
res->end = res->start + MDIO_REG_ADDR_SPACE_SIZE - 1;
|
||||
}
|
||||
md->base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(md->base)) {
|
||||
dev_err(&pdev->dev, "failed to ioremap register\n");
|
||||
|
@ -534,14 +534,6 @@ static void tun_queue_purge(struct tun_file *tfile)
|
||||
skb_queue_purge(&tfile->sk.sk_error_queue);
|
||||
}
|
||||
|
||||
static void tun_cleanup_tx_array(struct tun_file *tfile)
|
||||
{
|
||||
if (tfile->tx_array.ring.queue) {
|
||||
skb_array_cleanup(&tfile->tx_array);
|
||||
memset(&tfile->tx_array, 0, sizeof(tfile->tx_array));
|
||||
}
|
||||
}
|
||||
|
||||
static void __tun_detach(struct tun_file *tfile, bool clean)
|
||||
{
|
||||
struct tun_file *ntfile;
|
||||
@ -583,7 +575,7 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
|
||||
tun->dev->reg_state == NETREG_REGISTERED)
|
||||
unregister_netdevice(tun->dev);
|
||||
}
|
||||
tun_cleanup_tx_array(tfile);
|
||||
skb_array_cleanup(&tfile->tx_array);
|
||||
sock_put(&tfile->sk);
|
||||
}
|
||||
}
|
||||
@ -623,13 +615,11 @@ static void tun_detach_all(struct net_device *dev)
|
||||
/* Drop read queue */
|
||||
tun_queue_purge(tfile);
|
||||
sock_put(&tfile->sk);
|
||||
tun_cleanup_tx_array(tfile);
|
||||
}
|
||||
list_for_each_entry_safe(tfile, tmp, &tun->disabled, next) {
|
||||
tun_enable_queue(tfile);
|
||||
tun_queue_purge(tfile);
|
||||
sock_put(&tfile->sk);
|
||||
tun_cleanup_tx_array(tfile);
|
||||
}
|
||||
BUG_ON(tun->numdisabled != 0);
|
||||
|
||||
@ -675,7 +665,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file, bool skip_filte
|
||||
}
|
||||
|
||||
if (!tfile->detached &&
|
||||
skb_array_init(&tfile->tx_array, dev->tx_queue_len, GFP_KERNEL)) {
|
||||
skb_array_resize(&tfile->tx_array, dev->tx_queue_len, GFP_KERNEL)) {
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
@ -2630,6 +2620,11 @@ static int tun_chr_open(struct inode *inode, struct file * file)
|
||||
&tun_proto, 0);
|
||||
if (!tfile)
|
||||
return -ENOMEM;
|
||||
if (skb_array_init(&tfile->tx_array, 0, GFP_KERNEL)) {
|
||||
sk_free(&tfile->sk);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
RCU_INIT_POINTER(tfile->tun, NULL);
|
||||
tfile->flags = 0;
|
||||
tfile->ifindex = 0;
|
||||
@ -2650,8 +2645,6 @@ static int tun_chr_open(struct inode *inode, struct file * file)
|
||||
|
||||
sock_set_flag(&tfile->sk, SOCK_ZEROCOPY);
|
||||
|
||||
memset(&tfile->tx_array, 0, sizeof(tfile->tx_array));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3074,6 +3074,13 @@ static int ath10k_update_channel_list(struct ath10k *ar)
|
||||
passive = channel->flags & IEEE80211_CHAN_NO_IR;
|
||||
ch->passive = passive;
|
||||
|
||||
/* the firmware is ignoring the "radar" flag of the
|
||||
* channel and is scanning actively using Probe Requests
|
||||
* on "Radar detection"/DFS channels which are not
|
||||
* marked as "available"
|
||||
*/
|
||||
ch->passive |= ch->chan_radar;
|
||||
|
||||
ch->freq = channel->center_freq;
|
||||
ch->band_center_freq1 = channel->center_freq;
|
||||
ch->min_power = 0;
|
||||
|
@ -1451,6 +1451,11 @@ static struct sk_buff *ath10k_wmi_tlv_op_gen_init(struct ath10k *ar)
|
||||
cfg->keep_alive_pattern_size = __cpu_to_le32(0);
|
||||
cfg->max_tdls_concurrent_sleep_sta = __cpu_to_le32(1);
|
||||
cfg->max_tdls_concurrent_buffer_sta = __cpu_to_le32(1);
|
||||
cfg->wmi_send_separate = __cpu_to_le32(0);
|
||||
cfg->num_ocb_vdevs = __cpu_to_le32(0);
|
||||
cfg->num_ocb_channels = __cpu_to_le32(0);
|
||||
cfg->num_ocb_schedules = __cpu_to_le32(0);
|
||||
cfg->host_capab = __cpu_to_le32(0);
|
||||
|
||||
ath10k_wmi_put_host_mem_chunks(ar, chunks);
|
||||
|
||||
|
@ -1228,6 +1228,11 @@ struct wmi_tlv_resource_config {
|
||||
__le32 keep_alive_pattern_size;
|
||||
__le32 max_tdls_concurrent_sleep_sta;
|
||||
__le32 max_tdls_concurrent_buffer_sta;
|
||||
__le32 wmi_send_separate;
|
||||
__le32 num_ocb_vdevs;
|
||||
__le32 num_ocb_channels;
|
||||
__le32 num_ocb_schedules;
|
||||
__le32 host_capab;
|
||||
} __packed;
|
||||
|
||||
struct wmi_tlv_init_cmd {
|
||||
|
@ -2915,16 +2915,19 @@ void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
|
||||
struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
|
||||
struct ieee80211_channel *channel;
|
||||
int chan_pwr, new_pwr;
|
||||
u16 ctl = NO_CTL;
|
||||
|
||||
if (!chan)
|
||||
return;
|
||||
|
||||
if (!test)
|
||||
ctl = ath9k_regd_get_ctl(reg, chan);
|
||||
|
||||
channel = chan->chan;
|
||||
chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER);
|
||||
new_pwr = min_t(int, chan_pwr, reg->power_limit);
|
||||
|
||||
ah->eep_ops->set_txpower(ah, chan,
|
||||
ath9k_regd_get_ctl(reg, chan),
|
||||
ah->eep_ops->set_txpower(ah, chan, ctl,
|
||||
get_antenna_gain(ah, chan), new_pwr, test);
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,8 @@ static void ath_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
struct ieee80211_sta *sta = info->status.status_driver_data[0];
|
||||
|
||||
if (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS) {
|
||||
if (info->flags & (IEEE80211_TX_CTL_REQ_TX_STATUS |
|
||||
IEEE80211_TX_STATUS_EOSP)) {
|
||||
ieee80211_tx_status(hw, skb);
|
||||
return;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ static u32 wlcore_rx_get_align_buf_size(struct wl1271 *wl, u32 pkt_len)
|
||||
static void wl1271_rx_status(struct wl1271 *wl,
|
||||
struct wl1271_rx_descriptor *desc,
|
||||
struct ieee80211_rx_status *status,
|
||||
u8 beacon)
|
||||
u8 beacon, u8 probe_rsp)
|
||||
{
|
||||
memset(status, 0, sizeof(struct ieee80211_rx_status));
|
||||
|
||||
@ -106,6 +106,9 @@ static void wl1271_rx_status(struct wl1271 *wl,
|
||||
}
|
||||
}
|
||||
|
||||
if (beacon || probe_rsp)
|
||||
status->boottime_ns = ktime_get_boot_ns();
|
||||
|
||||
if (beacon)
|
||||
wlcore_set_pending_regdomain_ch(wl, (u16)desc->channel,
|
||||
status->band);
|
||||
@ -191,7 +194,8 @@ static int wl1271_rx_handle_data(struct wl1271 *wl, u8 *data, u32 length,
|
||||
if (ieee80211_is_data_present(hdr->frame_control))
|
||||
is_data = 1;
|
||||
|
||||
wl1271_rx_status(wl, desc, IEEE80211_SKB_RXCB(skb), beacon);
|
||||
wl1271_rx_status(wl, desc, IEEE80211_SKB_RXCB(skb), beacon,
|
||||
ieee80211_is_probe_resp(hdr->frame_control));
|
||||
wlcore_hw_set_rx_csum(wl, desc, skb);
|
||||
|
||||
seq_num = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4;
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include <linux/cdev.h>
|
||||
#include <linux/wait.h>
|
||||
|
||||
#include <linux/nospec.h>
|
||||
|
||||
MODULE_DESCRIPTION("Microsemi Switchtec(tm) PCIe Management Driver");
|
||||
MODULE_VERSION("0.1");
|
||||
MODULE_LICENSE("GPL");
|
||||
@ -1173,6 +1175,8 @@ static int ioctl_port_to_pff(struct switchtec_dev *stdev,
|
||||
default:
|
||||
if (p.port > ARRAY_SIZE(pcfg->dsp_pff_inst_id))
|
||||
return -EINVAL;
|
||||
p.port = array_index_nospec(p.port,
|
||||
ARRAY_SIZE(pcfg->dsp_pff_inst_id) + 1);
|
||||
p.pff = ioread32(&pcfg->dsp_pff_inst_id[p.port - 1]);
|
||||
break;
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ static void imx_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
|
||||
const char *name;
|
||||
int i, ret;
|
||||
|
||||
if (group > pctldev->num_groups)
|
||||
if (group >= pctldev->num_groups)
|
||||
return;
|
||||
|
||||
seq_printf(s, "\n");
|
||||
|
@ -530,7 +530,8 @@ static irqreturn_t amd_gpio_irq_handler(int irq, void *dev_id)
|
||||
/* Each status bit covers four pins */
|
||||
for (i = 0; i < 4; i++) {
|
||||
regval = readl(regs + i);
|
||||
if (!(regval & PIN_IRQ_PENDING))
|
||||
if (!(regval & PIN_IRQ_PENDING) ||
|
||||
!(regval & BIT(INTERRUPT_MASK_OFF)))
|
||||
continue;
|
||||
irq = irq_find_mapping(gc->irqdomain, irqnr + i);
|
||||
generic_handle_irq(irq);
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/rpmsg.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/pm_domain.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include "rpmsg_internal.h"
|
||||
@ -418,6 +419,10 @@ static int rpmsg_dev_probe(struct device *dev)
|
||||
struct rpmsg_endpoint *ept = NULL;
|
||||
int err;
|
||||
|
||||
err = dev_pm_domain_attach(dev, true);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
if (rpdrv->callback) {
|
||||
strncpy(chinfo.name, rpdev->id.name, RPMSG_NAME_SIZE);
|
||||
chinfo.src = rpdev->src;
|
||||
@ -459,6 +464,8 @@ static int rpmsg_dev_remove(struct device *dev)
|
||||
|
||||
rpdrv->remove(rpdev);
|
||||
|
||||
dev_pm_domain_detach(dev, true);
|
||||
|
||||
if (rpdev->ept)
|
||||
rpmsg_destroy_ept(rpdev->ept);
|
||||
|
||||
|
@ -2042,6 +2042,7 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
|
||||
|
||||
if (twa_initialize_device_extension(tw_dev)) {
|
||||
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x25, "Failed to initialize device extension");
|
||||
retval = -ENOMEM;
|
||||
goto out_free_device_extension;
|
||||
}
|
||||
|
||||
@ -2064,6 +2065,7 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
|
||||
tw_dev->base_addr = ioremap(mem_addr, mem_len);
|
||||
if (!tw_dev->base_addr) {
|
||||
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x35, "Failed to ioremap");
|
||||
retval = -ENOMEM;
|
||||
goto out_release_mem_region;
|
||||
}
|
||||
|
||||
@ -2071,8 +2073,10 @@ static int twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
|
||||
TW_DISABLE_INTERRUPTS(tw_dev);
|
||||
|
||||
/* Initialize the card */
|
||||
if (twa_reset_sequence(tw_dev, 0))
|
||||
if (twa_reset_sequence(tw_dev, 0)) {
|
||||
retval = -ENOMEM;
|
||||
goto out_iounmap;
|
||||
}
|
||||
|
||||
/* Set host specific parameters */
|
||||
if ((pdev->device == PCI_DEVICE_ID_3WARE_9650SE) ||
|
||||
|
@ -1597,6 +1597,7 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
|
||||
|
||||
if (twl_initialize_device_extension(tw_dev)) {
|
||||
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1a, "Failed to initialize device extension");
|
||||
retval = -ENOMEM;
|
||||
goto out_free_device_extension;
|
||||
}
|
||||
|
||||
@ -1611,6 +1612,7 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
|
||||
tw_dev->base_addr = pci_iomap(pdev, 1, 0);
|
||||
if (!tw_dev->base_addr) {
|
||||
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1c, "Failed to ioremap");
|
||||
retval = -ENOMEM;
|
||||
goto out_release_mem_region;
|
||||
}
|
||||
|
||||
@ -1620,6 +1622,7 @@ static int twl_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
|
||||
/* Initialize the card */
|
||||
if (twl_reset_sequence(tw_dev, 0)) {
|
||||
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1d, "Controller reset failed during probe");
|
||||
retval = -ENOMEM;
|
||||
goto out_iounmap;
|
||||
}
|
||||
|
||||
|
@ -2280,6 +2280,7 @@ static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
|
||||
|
||||
if (tw_initialize_device_extension(tw_dev)) {
|
||||
printk(KERN_WARNING "3w-xxxx: Failed to initialize device extension.");
|
||||
retval = -ENOMEM;
|
||||
goto out_free_device_extension;
|
||||
}
|
||||
|
||||
@ -2294,6 +2295,7 @@ static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
|
||||
tw_dev->base_addr = pci_resource_start(pdev, 0);
|
||||
if (!tw_dev->base_addr) {
|
||||
printk(KERN_WARNING "3w-xxxx: Failed to get io address.");
|
||||
retval = -ENOMEM;
|
||||
goto out_release_mem_region;
|
||||
}
|
||||
|
||||
|
@ -676,7 +676,7 @@ struct lpfc_hba {
|
||||
#define LS_NPIV_FAB_SUPPORTED 0x2 /* Fabric supports NPIV */
|
||||
#define LS_IGNORE_ERATT 0x4 /* intr handler should ignore ERATT */
|
||||
#define LS_MDS_LINK_DOWN 0x8 /* MDS Diagnostics Link Down */
|
||||
#define LS_MDS_LOOPBACK 0x16 /* MDS Diagnostics Link Up (Loopback) */
|
||||
#define LS_MDS_LOOPBACK 0x10 /* MDS Diagnostics Link Up (Loopback) */
|
||||
|
||||
uint32_t hba_flag; /* hba generic flags */
|
||||
#define HBA_ERATT_HANDLED 0x1 /* This flag is set when eratt handled */
|
||||
|
@ -317,6 +317,7 @@ void __transport_register_session(
|
||||
{
|
||||
const struct target_core_fabric_ops *tfo = se_tpg->se_tpg_tfo;
|
||||
unsigned char buf[PR_REG_ISID_LEN];
|
||||
unsigned long flags;
|
||||
|
||||
se_sess->se_tpg = se_tpg;
|
||||
se_sess->fabric_sess_ptr = fabric_sess_ptr;
|
||||
@ -353,7 +354,7 @@ void __transport_register_session(
|
||||
se_sess->sess_bin_isid = get_unaligned_be64(&buf[0]);
|
||||
}
|
||||
|
||||
spin_lock_irq(&se_nacl->nacl_sess_lock);
|
||||
spin_lock_irqsave(&se_nacl->nacl_sess_lock, flags);
|
||||
/*
|
||||
* The se_nacl->nacl_sess pointer will be set to the
|
||||
* last active I_T Nexus for each struct se_node_acl.
|
||||
@ -362,7 +363,7 @@ void __transport_register_session(
|
||||
|
||||
list_add_tail(&se_sess->sess_acl_list,
|
||||
&se_nacl->acl_sess_list);
|
||||
spin_unlock_irq(&se_nacl->nacl_sess_lock);
|
||||
spin_unlock_irqrestore(&se_nacl->nacl_sess_lock, flags);
|
||||
}
|
||||
list_add_tail(&se_sess->sess_list, &se_tpg->tpg_sess_list);
|
||||
|
||||
|
@ -1894,7 +1894,7 @@ static __init int register_PCI(int i, struct pci_dev *dev)
|
||||
ByteIO_t UPCIRingInd = 0;
|
||||
|
||||
if (!dev || !pci_match_id(rocket_pci_ids, dev) ||
|
||||
pci_enable_device(dev))
|
||||
pci_enable_device(dev) || i >= NUM_BOARDS)
|
||||
return 0;
|
||||
|
||||
rcktpt_io_addr[i] = pci_resource_start(dev, 0);
|
||||
|
@ -841,8 +841,6 @@ int __uio_register_device(struct module *owner,
|
||||
if (ret)
|
||||
goto err_uio_dev_add_attributes;
|
||||
|
||||
info->uio_dev = idev;
|
||||
|
||||
if (info->irq && (info->irq != UIO_IRQ_CUSTOM)) {
|
||||
/*
|
||||
* Note that we deliberately don't use devm_request_irq
|
||||
@ -858,6 +856,7 @@ int __uio_register_device(struct module *owner,
|
||||
goto err_request_irq;
|
||||
}
|
||||
|
||||
info->uio_dev = idev;
|
||||
return 0;
|
||||
|
||||
err_request_irq:
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <linux/list.h>
|
||||
#include <linux/completion.h>
|
||||
#include <asm/current.h>
|
||||
#include <linux/magic.h>
|
||||
|
||||
/* This is the range of ioctl() numbers we claim as ours */
|
||||
#define AUTOFS_IOC_FIRST AUTOFS_IOC_READY
|
||||
@ -124,7 +125,8 @@ struct autofs_sb_info {
|
||||
|
||||
static inline struct autofs_sb_info *autofs4_sbi(struct super_block *sb)
|
||||
{
|
||||
return (struct autofs_sb_info *)(sb->s_fs_info);
|
||||
return sb->s_magic != AUTOFS_SUPER_MAGIC ?
|
||||
NULL : (struct autofs_sb_info *)(sb->s_fs_info);
|
||||
}
|
||||
|
||||
static inline struct autofs_info *autofs4_dentry_ino(struct dentry *dentry)
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/parser.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/magic.h>
|
||||
#include "autofs_i.h"
|
||||
#include <linux/module.h>
|
||||
|
||||
|
@ -3158,6 +3158,25 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen,
|
||||
|
||||
same_lock_start = min_t(u64, loff, dst_loff);
|
||||
same_lock_len = max_t(u64, loff, dst_loff) + len - same_lock_start;
|
||||
} else {
|
||||
/*
|
||||
* If the source and destination inodes are different, the
|
||||
* source's range end offset matches the source's i_size, that
|
||||
* i_size is not a multiple of the sector size, and the
|
||||
* destination range does not go past the destination's i_size,
|
||||
* we must round down the length to the nearest sector size
|
||||
* multiple. If we don't do this adjustment we end replacing
|
||||
* with zeroes the bytes in the range that starts at the
|
||||
* deduplication range's end offset and ends at the next sector
|
||||
* size multiple.
|
||||
*/
|
||||
if (loff + olen == i_size_read(src) &&
|
||||
dst_loff + len < i_size_read(dst)) {
|
||||
const u64 sz = BTRFS_I(src)->root->fs_info->sectorsize;
|
||||
|
||||
len = round_down(i_size_read(src), sz) - loff;
|
||||
olen = len;
|
||||
}
|
||||
}
|
||||
|
||||
/* don't make the dst file partly checksummed */
|
||||
|
@ -467,6 +467,8 @@ cifs_sfu_type(struct cifs_fattr *fattr, const char *path,
|
||||
oparms.cifs_sb = cifs_sb;
|
||||
oparms.desired_access = GENERIC_READ;
|
||||
oparms.create_options = CREATE_NOT_DIR;
|
||||
if (backup_cred(cifs_sb))
|
||||
oparms.create_options |= CREATE_OPEN_BACKUP_INTENT;
|
||||
oparms.disposition = FILE_OPEN;
|
||||
oparms.path = path;
|
||||
oparms.fid = &fid;
|
||||
|
@ -385,7 +385,10 @@ smb2_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon,
|
||||
oparms.tcon = tcon;
|
||||
oparms.desired_access = FILE_READ_ATTRIBUTES;
|
||||
oparms.disposition = FILE_OPEN;
|
||||
oparms.create_options = 0;
|
||||
if (backup_cred(cifs_sb))
|
||||
oparms.create_options = CREATE_OPEN_BACKUP_INTENT;
|
||||
else
|
||||
oparms.create_options = 0;
|
||||
oparms.fid = &fid;
|
||||
oparms.reconnect = false;
|
||||
|
||||
@ -534,7 +537,10 @@ smb2_query_eas(const unsigned int xid, struct cifs_tcon *tcon,
|
||||
oparms.tcon = tcon;
|
||||
oparms.desired_access = FILE_READ_EA;
|
||||
oparms.disposition = FILE_OPEN;
|
||||
oparms.create_options = 0;
|
||||
if (backup_cred(cifs_sb))
|
||||
oparms.create_options = CREATE_OPEN_BACKUP_INTENT;
|
||||
else
|
||||
oparms.create_options = 0;
|
||||
oparms.fid = &fid;
|
||||
oparms.reconnect = false;
|
||||
|
||||
@ -613,7 +619,10 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
|
||||
oparms.tcon = tcon;
|
||||
oparms.desired_access = FILE_WRITE_EA;
|
||||
oparms.disposition = FILE_OPEN;
|
||||
oparms.create_options = 0;
|
||||
if (backup_cred(cifs_sb))
|
||||
oparms.create_options = CREATE_OPEN_BACKUP_INTENT;
|
||||
else
|
||||
oparms.create_options = 0;
|
||||
oparms.fid = &fid;
|
||||
oparms.reconnect = false;
|
||||
|
||||
@ -1215,7 +1224,10 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon,
|
||||
oparms.tcon = tcon;
|
||||
oparms.desired_access = FILE_READ_ATTRIBUTES | FILE_READ_DATA;
|
||||
oparms.disposition = FILE_OPEN;
|
||||
oparms.create_options = 0;
|
||||
if (backup_cred(cifs_sb))
|
||||
oparms.create_options = CREATE_OPEN_BACKUP_INTENT;
|
||||
else
|
||||
oparms.create_options = 0;
|
||||
oparms.fid = fid;
|
||||
oparms.reconnect = false;
|
||||
|
||||
@ -1491,7 +1503,10 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
|
||||
oparms.tcon = tcon;
|
||||
oparms.desired_access = FILE_READ_ATTRIBUTES;
|
||||
oparms.disposition = FILE_OPEN;
|
||||
oparms.create_options = 0;
|
||||
if (backup_cred(cifs_sb))
|
||||
oparms.create_options = CREATE_OPEN_BACKUP_INTENT;
|
||||
else
|
||||
oparms.create_options = 0;
|
||||
oparms.fid = &fid;
|
||||
oparms.reconnect = false;
|
||||
|
||||
@ -3200,7 +3215,7 @@ struct smb_version_values smb21_values = {
|
||||
struct smb_version_values smb3any_values = {
|
||||
.version_string = SMB3ANY_VERSION_STRING,
|
||||
.protocol_id = SMB302_PROT_ID, /* doesn't matter, send protocol array */
|
||||
.req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU | SMB2_GLOBAL_CAP_PERSISTENT_HANDLES | SMB2_GLOBAL_CAP_ENCRYPTION,
|
||||
.req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU | SMB2_GLOBAL_CAP_PERSISTENT_HANDLES | SMB2_GLOBAL_CAP_ENCRYPTION | SMB2_GLOBAL_CAP_DIRECTORY_LEASING,
|
||||
.large_lock_type = 0,
|
||||
.exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
|
||||
.shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
|
||||
@ -3220,7 +3235,7 @@ struct smb_version_values smb3any_values = {
|
||||
struct smb_version_values smbdefault_values = {
|
||||
.version_string = SMBDEFAULT_VERSION_STRING,
|
||||
.protocol_id = SMB302_PROT_ID, /* doesn't matter, send protocol array */
|
||||
.req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU | SMB2_GLOBAL_CAP_PERSISTENT_HANDLES | SMB2_GLOBAL_CAP_ENCRYPTION,
|
||||
.req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU | SMB2_GLOBAL_CAP_PERSISTENT_HANDLES | SMB2_GLOBAL_CAP_ENCRYPTION | SMB2_GLOBAL_CAP_DIRECTORY_LEASING,
|
||||
.large_lock_type = 0,
|
||||
.exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
|
||||
.shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
|
||||
@ -3240,7 +3255,7 @@ struct smb_version_values smbdefault_values = {
|
||||
struct smb_version_values smb30_values = {
|
||||
.version_string = SMB30_VERSION_STRING,
|
||||
.protocol_id = SMB30_PROT_ID,
|
||||
.req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU | SMB2_GLOBAL_CAP_PERSISTENT_HANDLES | SMB2_GLOBAL_CAP_ENCRYPTION,
|
||||
.req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU | SMB2_GLOBAL_CAP_PERSISTENT_HANDLES | SMB2_GLOBAL_CAP_ENCRYPTION | SMB2_GLOBAL_CAP_DIRECTORY_LEASING,
|
||||
.large_lock_type = 0,
|
||||
.exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
|
||||
.shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
|
||||
@ -3260,7 +3275,7 @@ struct smb_version_values smb30_values = {
|
||||
struct smb_version_values smb302_values = {
|
||||
.version_string = SMB302_VERSION_STRING,
|
||||
.protocol_id = SMB302_PROT_ID,
|
||||
.req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU | SMB2_GLOBAL_CAP_PERSISTENT_HANDLES | SMB2_GLOBAL_CAP_ENCRYPTION,
|
||||
.req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU | SMB2_GLOBAL_CAP_PERSISTENT_HANDLES | SMB2_GLOBAL_CAP_ENCRYPTION | SMB2_GLOBAL_CAP_DIRECTORY_LEASING,
|
||||
.large_lock_type = 0,
|
||||
.exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
|
||||
.shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
|
||||
@ -3281,7 +3296,7 @@ struct smb_version_values smb302_values = {
|
||||
struct smb_version_values smb311_values = {
|
||||
.version_string = SMB311_VERSION_STRING,
|
||||
.protocol_id = SMB311_PROT_ID,
|
||||
.req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU | SMB2_GLOBAL_CAP_PERSISTENT_HANDLES | SMB2_GLOBAL_CAP_ENCRYPTION,
|
||||
.req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU | SMB2_GLOBAL_CAP_PERSISTENT_HANDLES | SMB2_GLOBAL_CAP_ENCRYPTION | SMB2_GLOBAL_CAP_DIRECTORY_LEASING,
|
||||
.large_lock_type = 0,
|
||||
.exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
|
||||
.shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
|
||||
|
@ -1816,6 +1816,9 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
|
||||
if (!(server->capabilities & SMB2_GLOBAL_CAP_LEASING) ||
|
||||
*oplock == SMB2_OPLOCK_LEVEL_NONE)
|
||||
req->RequestedOplockLevel = *oplock;
|
||||
else if (!(server->capabilities & SMB2_GLOBAL_CAP_DIRECTORY_LEASING) &&
|
||||
(oparms->create_options & CREATE_NOT_FILE))
|
||||
req->RequestedOplockLevel = *oplock; /* no srv lease support */
|
||||
else {
|
||||
rc = add_lease_context(server, iov, &n_iov, oplock);
|
||||
if (rc) {
|
||||
|
@ -1935,8 +1935,13 @@ static inline struct page *f2fs_grab_cache_page(struct address_space *mapping,
|
||||
pgoff_t index, bool for_write)
|
||||
{
|
||||
#ifdef CONFIG_F2FS_FAULT_INJECTION
|
||||
struct page *page = find_lock_page(mapping, index);
|
||||
struct page *page;
|
||||
|
||||
if (!for_write)
|
||||
page = find_get_page_flags(mapping, index,
|
||||
FGP_LOCK | FGP_ACCESSED);
|
||||
else
|
||||
page = find_lock_page(mapping, index);
|
||||
if (page)
|
||||
return page;
|
||||
|
||||
|
@ -1845,7 +1845,7 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg)
|
||||
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
|
||||
struct super_block *sb = sbi->sb;
|
||||
__u32 in;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
|
@ -976,7 +976,13 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
|
||||
goto next;
|
||||
|
||||
sum = page_address(sum_page);
|
||||
f2fs_bug_on(sbi, type != GET_SUM_TYPE((&sum->footer)));
|
||||
if (type != GET_SUM_TYPE((&sum->footer))) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR, "Inconsistent segment (%u) "
|
||||
"type [%d, %d] in SSA and SIT",
|
||||
segno, type, GET_SUM_TYPE((&sum->footer)));
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
goto next;
|
||||
}
|
||||
|
||||
/*
|
||||
* this is to avoid deadlock:
|
||||
|
@ -147,6 +147,16 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (unlikely(dn->data_blkaddr != NEW_ADDR)) {
|
||||
f2fs_put_dnode(dn);
|
||||
set_sbi_flag(fio.sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(fio.sbi->sb, KERN_WARNING,
|
||||
"%s: corrupted inline inode ino=%lx, i_addr[0]:0x%x, "
|
||||
"run fsck to fix.",
|
||||
__func__, dn->inode->i_ino, dn->data_blkaddr);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
f2fs_bug_on(F2FS_P_SB(page), PageWriteback(page));
|
||||
|
||||
read_inline_data(page, dn->inode_page);
|
||||
@ -385,6 +395,17 @@ static int f2fs_move_inline_dirents(struct inode *dir, struct page *ipage,
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
if (unlikely(dn.data_blkaddr != NEW_ADDR)) {
|
||||
f2fs_put_dnode(&dn);
|
||||
set_sbi_flag(F2FS_P_SB(page), SBI_NEED_FSCK);
|
||||
f2fs_msg(F2FS_P_SB(page)->sb, KERN_WARNING,
|
||||
"%s: corrupted inline inode ino=%lx, i_addr[0]:0x%x, "
|
||||
"run fsck to fix.",
|
||||
__func__, dir->i_ino, dn.data_blkaddr);
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
f2fs_wait_on_page_writeback(page, DATA, true);
|
||||
zero_user_segment(page, MAX_INLINE_DATA(dir), PAGE_SIZE);
|
||||
|
||||
@ -500,6 +521,7 @@ static int f2fs_move_rehashed_dirents(struct inode *dir, struct page *ipage,
|
||||
return 0;
|
||||
recover:
|
||||
lock_page(ipage);
|
||||
f2fs_wait_on_page_writeback(ipage, NODE, true);
|
||||
memcpy(inline_dentry, backup_dentry, MAX_INLINE_DATA(dir));
|
||||
f2fs_i_depth_write(dir, 0);
|
||||
f2fs_i_size_write(dir, MAX_INLINE_DATA(dir));
|
||||
|
@ -1648,7 +1648,9 @@ next_step:
|
||||
!is_cold_node(page)))
|
||||
continue;
|
||||
lock_node:
|
||||
if (!trylock_page(page))
|
||||
if (wbc->sync_mode == WB_SYNC_ALL)
|
||||
lock_page(page);
|
||||
else if (!trylock_page(page))
|
||||
continue;
|
||||
|
||||
if (unlikely(page->mapping != NODE_MAPPING(sbi))) {
|
||||
|
@ -445,6 +445,8 @@ static inline void __set_test_and_free(struct f2fs_sb_info *sbi,
|
||||
if (test_and_clear_bit(segno, free_i->free_segmap)) {
|
||||
free_i->free_segments++;
|
||||
|
||||
if (IS_CURSEC(sbi, secno))
|
||||
goto skip_free;
|
||||
next = find_next_bit(free_i->free_segmap,
|
||||
start_segno + sbi->segs_per_sec, start_segno);
|
||||
if (next >= start_segno + sbi->segs_per_sec) {
|
||||
@ -452,6 +454,7 @@ static inline void __set_test_and_free(struct f2fs_sb_info *sbi,
|
||||
free_i->free_sections++;
|
||||
}
|
||||
}
|
||||
skip_free:
|
||||
spin_unlock(&free_i->segmap_lock);
|
||||
}
|
||||
|
||||
|
@ -2228,12 +2228,17 @@ int sanity_check_ckpt(struct f2fs_sb_info *sbi)
|
||||
struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
|
||||
unsigned int ovp_segments, reserved_segments;
|
||||
unsigned int main_segs, blocks_per_seg;
|
||||
unsigned int sit_segs, nat_segs;
|
||||
unsigned int sit_bitmap_size, nat_bitmap_size;
|
||||
unsigned int log_blocks_per_seg;
|
||||
int i;
|
||||
|
||||
total = le32_to_cpu(raw_super->segment_count);
|
||||
fsmeta = le32_to_cpu(raw_super->segment_count_ckpt);
|
||||
fsmeta += le32_to_cpu(raw_super->segment_count_sit);
|
||||
fsmeta += le32_to_cpu(raw_super->segment_count_nat);
|
||||
sit_segs = le32_to_cpu(raw_super->segment_count_sit);
|
||||
fsmeta += sit_segs;
|
||||
nat_segs = le32_to_cpu(raw_super->segment_count_nat);
|
||||
fsmeta += nat_segs;
|
||||
fsmeta += le32_to_cpu(ckpt->rsvd_segment_count);
|
||||
fsmeta += le32_to_cpu(raw_super->segment_count_ssa);
|
||||
|
||||
@ -2264,6 +2269,18 @@ int sanity_check_ckpt(struct f2fs_sb_info *sbi)
|
||||
return 1;
|
||||
}
|
||||
|
||||
sit_bitmap_size = le32_to_cpu(ckpt->sit_ver_bitmap_bytesize);
|
||||
nat_bitmap_size = le32_to_cpu(ckpt->nat_ver_bitmap_bytesize);
|
||||
log_blocks_per_seg = le32_to_cpu(raw_super->log_blocks_per_seg);
|
||||
|
||||
if (sit_bitmap_size != ((sit_segs / 2) << log_blocks_per_seg) / 8 ||
|
||||
nat_bitmap_size != ((nat_segs / 2) << log_blocks_per_seg) / 8) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"Wrong bitmap size: sit: %u, nat:%u",
|
||||
sit_bitmap_size, nat_bitmap_size);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unlikely(f2fs_cp_error(sbi))) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR, "A bug case: need to run fsck");
|
||||
return 1;
|
||||
|
@ -9,6 +9,7 @@
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/f2fs_fs.h>
|
||||
#include <linux/seq_file.h>
|
||||
@ -482,7 +483,8 @@ static struct kobject f2fs_feat = {
|
||||
.kset = &f2fs_kset,
|
||||
};
|
||||
|
||||
static int segment_info_seq_show(struct seq_file *seq, void *offset)
|
||||
static int __maybe_unused segment_info_seq_show(struct seq_file *seq,
|
||||
void *offset)
|
||||
{
|
||||
struct super_block *sb = seq->private;
|
||||
struct f2fs_sb_info *sbi = F2FS_SB(sb);
|
||||
@ -509,7 +511,8 @@ static int segment_info_seq_show(struct seq_file *seq, void *offset)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int segment_bits_seq_show(struct seq_file *seq, void *offset)
|
||||
static int __maybe_unused segment_bits_seq_show(struct seq_file *seq,
|
||||
void *offset)
|
||||
{
|
||||
struct super_block *sb = seq->private;
|
||||
struct f2fs_sb_info *sbi = F2FS_SB(sb);
|
||||
@ -533,7 +536,8 @@ static int segment_bits_seq_show(struct seq_file *seq, void *offset)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int iostat_info_seq_show(struct seq_file *seq, void *offset)
|
||||
static int __maybe_unused iostat_info_seq_show(struct seq_file *seq,
|
||||
void *offset)
|
||||
{
|
||||
struct super_block *sb = seq->private;
|
||||
struct f2fs_sb_info *sbi = F2FS_SB(sb);
|
||||
|
@ -213,9 +213,9 @@ static u32 pnfs_check_callback_stateid(struct pnfs_layout_hdr *lo,
|
||||
{
|
||||
u32 oldseq, newseq;
|
||||
|
||||
/* Is the stateid still not initialised? */
|
||||
/* Is the stateid not initialised? */
|
||||
if (!pnfs_layout_is_valid(lo))
|
||||
return NFS4ERR_DELAY;
|
||||
return NFS4ERR_NOMATCHING_LAYOUT;
|
||||
|
||||
/* Mismatched stateid? */
|
||||
if (!nfs4_stateid_match_other(&lo->plh_stateid, new))
|
||||
|
@ -904,16 +904,21 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp)
|
||||
|
||||
if (hdr_arg.minorversion == 0) {
|
||||
cps.clp = nfs4_find_client_ident(SVC_NET(rqstp), hdr_arg.cb_ident);
|
||||
if (!cps.clp || !check_gss_callback_principal(cps.clp, rqstp))
|
||||
if (!cps.clp || !check_gss_callback_principal(cps.clp, rqstp)) {
|
||||
if (cps.clp)
|
||||
nfs_put_client(cps.clp);
|
||||
goto out_invalidcred;
|
||||
}
|
||||
}
|
||||
|
||||
cps.minorversion = hdr_arg.minorversion;
|
||||
hdr_res.taglen = hdr_arg.taglen;
|
||||
hdr_res.tag = hdr_arg.tag;
|
||||
if (encode_compound_hdr_res(&xdr_out, &hdr_res) != 0)
|
||||
if (encode_compound_hdr_res(&xdr_out, &hdr_res) != 0) {
|
||||
if (cps.clp)
|
||||
nfs_put_client(cps.clp);
|
||||
return rpc_system_err;
|
||||
|
||||
}
|
||||
while (status == 0 && nops != hdr_arg.nops) {
|
||||
status = process_op(nops, rqstp, &xdr_in,
|
||||
rqstp->rq_argp, &xdr_out, rqstp->rq_resp,
|
||||
|
@ -361,7 +361,7 @@ struct kioctx_table;
|
||||
struct mm_struct {
|
||||
struct vm_area_struct *mmap; /* list of VMAs */
|
||||
struct rb_root mm_rb;
|
||||
u32 vmacache_seqnum; /* per-thread vmacache */
|
||||
u64 vmacache_seqnum; /* per-thread vmacache */
|
||||
#ifdef CONFIG_MMU
|
||||
unsigned long (*get_unmapped_area) (struct file *filp,
|
||||
unsigned long addr, unsigned long len,
|
||||
|
@ -32,7 +32,7 @@
|
||||
#define VMACACHE_MASK (VMACACHE_SIZE - 1)
|
||||
|
||||
struct vmacache {
|
||||
u32 seqnum;
|
||||
u64 seqnum;
|
||||
struct vm_area_struct *vmas[VMACACHE_SIZE];
|
||||
};
|
||||
|
||||
|
@ -152,25 +152,25 @@ struct rhashtable_params {
|
||||
/**
|
||||
* struct rhashtable - Hash table handle
|
||||
* @tbl: Bucket table
|
||||
* @nelems: Number of elements in table
|
||||
* @key_len: Key length for hashfn
|
||||
* @p: Configuration parameters
|
||||
* @max_elems: Maximum number of elements in table
|
||||
* @p: Configuration parameters
|
||||
* @rhlist: True if this is an rhltable
|
||||
* @run_work: Deferred worker to expand/shrink asynchronously
|
||||
* @mutex: Mutex to protect current/future table swapping
|
||||
* @lock: Spin lock to protect walker list
|
||||
* @nelems: Number of elements in table
|
||||
*/
|
||||
struct rhashtable {
|
||||
struct bucket_table __rcu *tbl;
|
||||
atomic_t nelems;
|
||||
unsigned int key_len;
|
||||
struct rhashtable_params p;
|
||||
unsigned int max_elems;
|
||||
struct rhashtable_params p;
|
||||
bool rhlist;
|
||||
struct work_struct run_work;
|
||||
struct mutex mutex;
|
||||
spinlock_t lock;
|
||||
atomic_t nelems;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -663,21 +663,26 @@ struct sk_buff {
|
||||
struct sk_buff *prev;
|
||||
|
||||
union {
|
||||
ktime_t tstamp;
|
||||
u64 skb_mstamp;
|
||||
struct net_device *dev;
|
||||
/* Some protocols might use this space to store information,
|
||||
* while device pointer would be NULL.
|
||||
* UDP receive path is one user.
|
||||
*/
|
||||
unsigned long dev_scratch;
|
||||
};
|
||||
};
|
||||
struct rb_node rbnode; /* used in netem & tcp stack */
|
||||
struct rb_node rbnode; /* used in netem, ip4 defrag, and tcp stack */
|
||||
struct list_head list;
|
||||
};
|
||||
struct sock *sk;
|
||||
|
||||
union {
|
||||
struct net_device *dev;
|
||||
/* Some protocols might use this space to store information,
|
||||
* while device pointer would be NULL.
|
||||
* UDP receive path is one user.
|
||||
*/
|
||||
unsigned long dev_scratch;
|
||||
struct sock *sk;
|
||||
int ip_defrag_offset;
|
||||
};
|
||||
|
||||
union {
|
||||
ktime_t tstamp;
|
||||
u64 skb_mstamp;
|
||||
};
|
||||
/*
|
||||
* This is the control buffer. It is free to use for every
|
||||
@ -2580,7 +2585,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
|
||||
kfree_skb(skb);
|
||||
}
|
||||
|
||||
void skb_rbtree_purge(struct rb_root *root);
|
||||
unsigned int skb_rbtree_purge(struct rb_root *root);
|
||||
|
||||
void *netdev_alloc_frag(unsigned int fragsz);
|
||||
|
||||
@ -3134,6 +3139,7 @@ static inline void *skb_push_rcsum(struct sk_buff *skb, unsigned int len)
|
||||
return skb->data;
|
||||
}
|
||||
|
||||
int pskb_trim_rcsum_slow(struct sk_buff *skb, unsigned int len);
|
||||
/**
|
||||
* pskb_trim_rcsum - trim received skb and update checksum
|
||||
* @skb: buffer to trim
|
||||
@ -3147,9 +3153,7 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
|
||||
{
|
||||
if (likely(len >= skb->len))
|
||||
return 0;
|
||||
if (skb->ip_summed == CHECKSUM_COMPLETE)
|
||||
skb->ip_summed = CHECKSUM_NONE;
|
||||
return __pskb_trim(skb, len);
|
||||
return pskb_trim_rcsum_slow(skb, len);
|
||||
}
|
||||
|
||||
static inline int __skb_trim_rcsum(struct sk_buff *skb, unsigned int len)
|
||||
@ -3169,6 +3173,12 @@ static inline int __skb_grow_rcsum(struct sk_buff *skb, unsigned int len)
|
||||
|
||||
#define rb_to_skb(rb) rb_entry_safe(rb, struct sk_buff, rbnode)
|
||||
|
||||
#define rb_to_skb(rb) rb_entry_safe(rb, struct sk_buff, rbnode)
|
||||
#define skb_rb_first(root) rb_to_skb(rb_first(root))
|
||||
#define skb_rb_last(root) rb_to_skb(rb_last(root))
|
||||
#define skb_rb_next(skb) rb_to_skb(rb_next(&(skb)->rbnode))
|
||||
#define skb_rb_prev(skb) rb_to_skb(rb_prev(&(skb)->rbnode))
|
||||
|
||||
#define skb_queue_walk(queue, skb) \
|
||||
for (skb = (queue)->next; \
|
||||
skb != (struct sk_buff *)(queue); \
|
||||
@ -3183,6 +3193,18 @@ static inline int __skb_grow_rcsum(struct sk_buff *skb, unsigned int len)
|
||||
for (; skb != (struct sk_buff *)(queue); \
|
||||
skb = skb->next)
|
||||
|
||||
#define skb_rbtree_walk(skb, root) \
|
||||
for (skb = skb_rb_first(root); skb != NULL; \
|
||||
skb = skb_rb_next(skb))
|
||||
|
||||
#define skb_rbtree_walk_from(skb) \
|
||||
for (; skb != NULL; \
|
||||
skb = skb_rb_next(skb))
|
||||
|
||||
#define skb_rbtree_walk_from_safe(skb, tmp) \
|
||||
for (; tmp = skb ? skb_rb_next(skb) : NULL, (skb != NULL); \
|
||||
skb = tmp)
|
||||
|
||||
#define skb_queue_walk_from_safe(queue, skb, tmp) \
|
||||
for (tmp = skb->next; \
|
||||
skb != (struct sk_buff *)(queue); \
|
||||
|
@ -48,6 +48,8 @@ struct tpm_class_ops {
|
||||
u8 (*status) (struct tpm_chip *chip);
|
||||
bool (*update_timeouts)(struct tpm_chip *chip,
|
||||
unsigned long *timeout_cap);
|
||||
int (*go_idle)(struct tpm_chip *chip);
|
||||
int (*cmd_ready)(struct tpm_chip *chip);
|
||||
int (*request_locality)(struct tpm_chip *chip, int loc);
|
||||
int (*relinquish_locality)(struct tpm_chip *chip, int loc);
|
||||
void (*clk_enable)(struct tpm_chip *chip, bool value);
|
||||
|
@ -105,7 +105,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
|
||||
#ifdef CONFIG_DEBUG_VM_VMACACHE
|
||||
VMACACHE_FIND_CALLS,
|
||||
VMACACHE_FIND_HITS,
|
||||
VMACACHE_FULL_FLUSHES,
|
||||
#endif
|
||||
#ifdef CONFIG_SWAP
|
||||
SWAP_RA,
|
||||
|
@ -16,7 +16,6 @@ static inline void vmacache_flush(struct task_struct *tsk)
|
||||
memset(tsk->vmacache.vmas, 0, sizeof(tsk->vmacache.vmas));
|
||||
}
|
||||
|
||||
extern void vmacache_flush_all(struct mm_struct *mm);
|
||||
extern void vmacache_update(unsigned long addr, struct vm_area_struct *newvma);
|
||||
extern struct vm_area_struct *vmacache_find(struct mm_struct *mm,
|
||||
unsigned long addr);
|
||||
@ -30,10 +29,6 @@ extern struct vm_area_struct *vmacache_find_exact(struct mm_struct *mm,
|
||||
static inline void vmacache_invalidate(struct mm_struct *mm)
|
||||
{
|
||||
mm->vmacache_seqnum++;
|
||||
|
||||
/* deal with overflows */
|
||||
if (unlikely(mm->vmacache_seqnum == 0))
|
||||
vmacache_flush_all(mm);
|
||||
}
|
||||
|
||||
#endif /* __LINUX_VMACACHE_H */
|
||||
|
@ -2,14 +2,20 @@
|
||||
#ifndef __NET_FRAG_H__
|
||||
#define __NET_FRAG_H__
|
||||
|
||||
#include <linux/rhashtable.h>
|
||||
|
||||
struct netns_frags {
|
||||
/* Keep atomic mem on separate cachelines in structs that include it */
|
||||
atomic_t mem ____cacheline_aligned_in_smp;
|
||||
/* sysctls */
|
||||
long high_thresh;
|
||||
long low_thresh;
|
||||
int timeout;
|
||||
int high_thresh;
|
||||
int low_thresh;
|
||||
int max_dist;
|
||||
struct inet_frags *f;
|
||||
|
||||
struct rhashtable rhashtable ____cacheline_aligned_in_smp;
|
||||
|
||||
/* Keep atomic mem on separate cachelines in structs that include it */
|
||||
atomic_long_t mem ____cacheline_aligned_in_smp;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -25,130 +31,115 @@ enum {
|
||||
INET_FRAG_COMPLETE = BIT(2),
|
||||
};
|
||||
|
||||
struct frag_v4_compare_key {
|
||||
__be32 saddr;
|
||||
__be32 daddr;
|
||||
u32 user;
|
||||
u32 vif;
|
||||
__be16 id;
|
||||
u16 protocol;
|
||||
};
|
||||
|
||||
struct frag_v6_compare_key {
|
||||
struct in6_addr saddr;
|
||||
struct in6_addr daddr;
|
||||
u32 user;
|
||||
__be32 id;
|
||||
u32 iif;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct inet_frag_queue - fragment queue
|
||||
*
|
||||
* @lock: spinlock protecting the queue
|
||||
* @node: rhash node
|
||||
* @key: keys identifying this frag.
|
||||
* @timer: queue expiration timer
|
||||
* @list: hash bucket list
|
||||
* @lock: spinlock protecting this frag
|
||||
* @refcnt: reference count of the queue
|
||||
* @fragments: received fragments head
|
||||
* @rb_fragments: received fragments rb-tree root
|
||||
* @fragments_tail: received fragments tail
|
||||
* @last_run_head: the head of the last "run". see ip_fragment.c
|
||||
* @stamp: timestamp of the last received fragment
|
||||
* @len: total length of the original datagram
|
||||
* @meat: length of received fragments so far
|
||||
* @flags: fragment queue flags
|
||||
* @max_size: maximum received fragment size
|
||||
* @net: namespace that this frag belongs to
|
||||
* @list_evictor: list of queues to forcefully evict (e.g. due to low memory)
|
||||
* @rcu: rcu head for freeing deferall
|
||||
*/
|
||||
struct inet_frag_queue {
|
||||
spinlock_t lock;
|
||||
struct rhash_head node;
|
||||
union {
|
||||
struct frag_v4_compare_key v4;
|
||||
struct frag_v6_compare_key v6;
|
||||
} key;
|
||||
struct timer_list timer;
|
||||
struct hlist_node list;
|
||||
spinlock_t lock;
|
||||
refcount_t refcnt;
|
||||
struct sk_buff *fragments;
|
||||
struct sk_buff *fragments; /* Used in IPv6. */
|
||||
struct rb_root rb_fragments; /* Used in IPv4. */
|
||||
struct sk_buff *fragments_tail;
|
||||
struct sk_buff *last_run_head;
|
||||
ktime_t stamp;
|
||||
int len;
|
||||
int meat;
|
||||
__u8 flags;
|
||||
u16 max_size;
|
||||
struct netns_frags *net;
|
||||
struct hlist_node list_evictor;
|
||||
};
|
||||
|
||||
#define INETFRAGS_HASHSZ 1024
|
||||
|
||||
/* averaged:
|
||||
* max_depth = default ipfrag_high_thresh / INETFRAGS_HASHSZ /
|
||||
* rounded up (SKB_TRUELEN(0) + sizeof(struct ipq or
|
||||
* struct frag_queue))
|
||||
*/
|
||||
#define INETFRAGS_MAXDEPTH 128
|
||||
|
||||
struct inet_frag_bucket {
|
||||
struct hlist_head chain;
|
||||
spinlock_t chain_lock;
|
||||
struct netns_frags *net;
|
||||
struct rcu_head rcu;
|
||||
};
|
||||
|
||||
struct inet_frags {
|
||||
struct inet_frag_bucket hash[INETFRAGS_HASHSZ];
|
||||
|
||||
struct work_struct frags_work;
|
||||
unsigned int next_bucket;
|
||||
unsigned long last_rebuild_jiffies;
|
||||
bool rebuild;
|
||||
|
||||
/* The first call to hashfn is responsible to initialize
|
||||
* rnd. This is best done with net_get_random_once.
|
||||
*
|
||||
* rnd_seqlock is used to let hash insertion detect
|
||||
* when it needs to re-lookup the hash chain to use.
|
||||
*/
|
||||
u32 rnd;
|
||||
seqlock_t rnd_seqlock;
|
||||
unsigned int qsize;
|
||||
|
||||
unsigned int (*hashfn)(const struct inet_frag_queue *);
|
||||
bool (*match)(const struct inet_frag_queue *q,
|
||||
const void *arg);
|
||||
void (*constructor)(struct inet_frag_queue *q,
|
||||
const void *arg);
|
||||
void (*destructor)(struct inet_frag_queue *);
|
||||
void (*frag_expire)(unsigned long data);
|
||||
void (*frag_expire)(struct timer_list *t);
|
||||
struct kmem_cache *frags_cachep;
|
||||
const char *frags_cache_name;
|
||||
struct rhashtable_params rhash_params;
|
||||
};
|
||||
|
||||
int inet_frags_init(struct inet_frags *);
|
||||
void inet_frags_fini(struct inet_frags *);
|
||||
|
||||
static inline void inet_frags_init_net(struct netns_frags *nf)
|
||||
static inline int inet_frags_init_net(struct netns_frags *nf)
|
||||
{
|
||||
atomic_set(&nf->mem, 0);
|
||||
atomic_long_set(&nf->mem, 0);
|
||||
return rhashtable_init(&nf->rhashtable, &nf->f->rhash_params);
|
||||
}
|
||||
void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f);
|
||||
void inet_frags_exit_net(struct netns_frags *nf);
|
||||
|
||||
void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f);
|
||||
void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f);
|
||||
struct inet_frag_queue *inet_frag_find(struct netns_frags *nf,
|
||||
struct inet_frags *f, void *key, unsigned int hash);
|
||||
void inet_frag_kill(struct inet_frag_queue *q);
|
||||
void inet_frag_destroy(struct inet_frag_queue *q);
|
||||
struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, void *key);
|
||||
|
||||
void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q,
|
||||
const char *prefix);
|
||||
/* Free all skbs in the queue; return the sum of their truesizes. */
|
||||
unsigned int inet_frag_rbtree_purge(struct rb_root *root);
|
||||
|
||||
static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f)
|
||||
static inline void inet_frag_put(struct inet_frag_queue *q)
|
||||
{
|
||||
if (refcount_dec_and_test(&q->refcnt))
|
||||
inet_frag_destroy(q, f);
|
||||
}
|
||||
|
||||
static inline bool inet_frag_evicting(struct inet_frag_queue *q)
|
||||
{
|
||||
return !hlist_unhashed(&q->list_evictor);
|
||||
inet_frag_destroy(q);
|
||||
}
|
||||
|
||||
/* Memory Tracking Functions. */
|
||||
|
||||
static inline int frag_mem_limit(struct netns_frags *nf)
|
||||
static inline long frag_mem_limit(const struct netns_frags *nf)
|
||||
{
|
||||
return atomic_read(&nf->mem);
|
||||
return atomic_long_read(&nf->mem);
|
||||
}
|
||||
|
||||
static inline void sub_frag_mem_limit(struct netns_frags *nf, int i)
|
||||
static inline void sub_frag_mem_limit(struct netns_frags *nf, long val)
|
||||
{
|
||||
atomic_sub(i, &nf->mem);
|
||||
atomic_long_sub(val, &nf->mem);
|
||||
}
|
||||
|
||||
static inline void add_frag_mem_limit(struct netns_frags *nf, int i)
|
||||
static inline void add_frag_mem_limit(struct netns_frags *nf, long val)
|
||||
{
|
||||
atomic_add(i, &nf->mem);
|
||||
}
|
||||
|
||||
static inline int sum_frag_mem_limit(struct netns_frags *nf)
|
||||
{
|
||||
return atomic_read(&nf->mem);
|
||||
atomic_long_add(val, &nf->mem);
|
||||
}
|
||||
|
||||
/* RFC 3168 support :
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user