This is the 4.9.187 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl1GilkACgkQONu9yGCS aT6ibw//QcoRk+6jjWIzW2R83tvcSpDREIYKF5xDPULqmaUKv7qcbGqdCT4OI0Vf CySao6jvmN+1V+5OlQHHw1qmithHF/Y4yEVi+eL0CcMgB6qA2tQxeA0ffFu0Fzxe oKrAIDANAJ2FKymqbIzTJU8AChNuy+Rc+C60L9O0ZhBHykLYvO7/VepTxdO2aMGs a9tdZyXnOAr/ZgKx+uN1F8Rx2ZorNfFmP2rDxEZ/B8pVrXsOjMAcxWRsZBv+w9mc zWaMPEL1vIR/kG35L18l2EFwZ++uIGvfGR2HxhNRUlTqN4m/3trATIc0eRn5PyAC qBlVdcwUeJKavBqK3cgHvK9CzWQdSMxNefk9A0H66ZGpfSuNCiFjw54AXEiRzx3t OvzUvDjfa36jsKW7yiYXdLbEa52gT14UDzmSIzlAYQLBplEadHikJ0FxCFzAWpFt C13gG1e4G0ZKEHH8wZMuRdanHbN87c/0Sm4rgTLMwCO6I1PeILcUwIq9El9M4RVL MmHSXLKduaHbPJWx+Qopl6NxjqTe/VR8paT6q1QnU00/4kP15aIVE08vZSiGSNP+ Gp6xbv12skAx1m1zP7K82oGdwnCVCJUqlC9wafcjsaxcoCVBWvIgPkyMWAzUeFzc Ub2yIS9iulUeYOxPXBZKWCqgwpl7kovGztf4gwX2Kuy50mXSZQg= =ozfF -----END PGP SIGNATURE----- Merge 4.9.187 into android-4.9-q Changes in 4.9.187 MIPS: ath79: fix ar933x uart parity mode MIPS: fix build on non-linux hosts arm64/efi: Mark __efistub_stext_offset as an absolute symbol explicitly dmaengine: imx-sdma: fix use-after-free on probe error path ath10k: Do not send probe response template for mesh ath9k: Check for errors when reading SREV register ath6kl: add some bounds checking ath: DFS JP domain W56 fixed pulse type 3 RADAR detection batman-adv: fix for leaked TVLV handler. media: dvb: usb: fix use after free in dvb_usb_device_exit crypto: talitos - fix skcipher failure due to wrong output IV media: marvell-ccic: fix DMA s/g desc number calculation media: vpss: fix a potential NULL pointer dereference media: media_device_enum_links32: clean a reserved field net: stmmac: dwmac1000: Clear unused address entries net: stmmac: dwmac4/5: Clear unused address entries signal/pid_namespace: Fix reboot_pid_ns to use send_sig not force_sig af_key: fix leaks in key_pol_get_resp and dump_sp. xfrm: Fix xfrm sel prefix length validation media: mc-device.c: don't memset __user pointer contents media: staging: media: davinci_vpfe: - Fix for memory leak if decoder initialization fails. net: phy: Check against net_device being NULL crypto: talitos - properly handle split ICV. crypto: talitos - Align SEC1 accesses to 32 bits boundaries. tua6100: Avoid build warnings. locking/lockdep: Fix merging of hlocks with non-zero references media: wl128x: Fix some error handling in fm_v4l2_init_video_device() cpupower : frequency-set -r option misses the last cpu in related cpu list net: fec: Do not use netdev messages too early net: axienet: Fix race condition causing TX hang s390/qdio: handle PENDING state for QEBSM devices perf cs-etm: Properly set the value of 'old' and 'head' in snapshot mode perf test 6: Fix missing kvm module load for s390 gpio: omap: fix lack of irqstatus_raw0 for OMAP4 gpio: omap: ensure irq is enabled before wakeup regmap: fix bulk writes on paged registers bpf: silence warning messages in core rcu: Force inlining of rcu_read_lock() blkcg, writeback: dead memcgs shouldn't contribute to writeback ownership arbitration xfrm: fix sa selector validation perf evsel: Make perf_evsel__name() accept a NULL argument vhost_net: disable zerocopy by default ipoib: correcly show a VF hardware address EDAC/sysfs: Fix memory leak when creating a csrow object ipsec: select crypto ciphers for xfrm_algo media: i2c: fix warning same module names ntp: Limit TAI-UTC offset timer_list: Guard procfs specific code acpi/arm64: ignore 5.1 FADTs that are reported as 5.0 media: coda: fix mpeg2 sequence number handling media: coda: increment sequence offset for the last returned frame mt7601u: do not schedule rx_tasklet when the device has been disconnected x86/build: Add 'set -e' to mkcapflags.sh to delete broken capflags.c mt7601u: fix possible memory leak when the device is disconnected ath10k: fix PCIE device wake up failed perf tools: Increase MAX_NR_CPUS and MAX_CACHES libata: don't request sense data on !ZAC ATA devices clocksource/drivers/exynos_mct: Increase priority over ARM arch timer rslib: Fix decoding of shortened codes rslib: Fix handling of of caller provided syndrome ixgbe: Check DDM existence in transceiver before access crypto: asymmetric_keys - select CRYPTO_HASH where needed EDAC: Fix global-out-of-bounds write when setting edac_mc_poll_msec bcache: check c->gc_thread by IS_ERR_OR_NULL in cache_set_flush() iwlwifi: mvm: Drop large non sta frames net: usb: asix: init MAC address buffers gpiolib: Fix references to gpiod_[gs]et_*value_cansleep() variants Bluetooth: hci_bcsp: Fix memory leak in rx_skb Bluetooth: 6lowpan: search for destination address in all peers Bluetooth: Check state in l2cap_disconnect_rsp Bluetooth: validate BLE connection interval updates gtp: fix Illegal context switch in RCU read-side critical section. gtp: fix use-after-free in gtp_newlink() xen: let alloc_xenballooned_pages() fail if not enough memory free scsi: NCR5380: Reduce goto statements in NCR5380_select() scsi: NCR5380: Always re-enable reselection interrupt scsi: mac_scsi: Increase PIO/PDMA transfer length threshold crypto: ghash - fix unaligned memory access in ghash_setkey() crypto: arm64/sha1-ce - correct digest for empty data in finup crypto: arm64/sha2-ce - correct digest for empty data in finup crypto: chacha20poly1305 - fix atomic sleep when using async algorithm crypto: crypto4xx - fix a potential double free in ppc4xx_trng_probe Input: gtco - bounds check collection indent level regulator: s2mps11: Fix buck7 and buck8 wrong voltages arm64: tegra: Update Jetson TX1 GPU regulator timings iwlwifi: pcie: don't service an interrupt that was masked tracing/snapshot: Resize spare buffer if size changed NFSv4: Handle the special Linux file open access mode lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE ALSA: seq: Break too long mutex context in the write loop ALSA: hda/realtek: apply ALC891 headset fixup to one Dell machine media: v4l2: Test type instead of cfg->type in v4l2_ctrl_new_custom() media: coda: Remove unbalanced and unneeded mutex unlock KVM: x86/vPMU: refine kvm_pmu err msg when event creation failed arm64: tegra: Fix AGIC register range fs/proc/proc_sysctl.c: fix the default values of i_uid/i_gid on /proc/sys inodes. drm/nouveau/i2c: Enable i2c pads & busses during preinit padata: use smp_mb in padata_reorder to avoid orphaned padata jobs 9p/virtio: Add cleanup path in p9_virtio_init PCI: Do not poll for PME if the device is in D3cold Btrfs: add missing inode version, ctime and mtime updates when punching hole libnvdimm/pfn: fix fsdax-mode namespace info-block zero-fields take floppy compat ioctls to sodding floppy.c floppy: fix div-by-zero in setup_format_params floppy: fix out-of-bounds read in next_valid_format floppy: fix invalid pointer dereference in drive_name floppy: fix out-of-bounds read in copy_buffer coda: pass the host file in vma->vm_file on mmap gpu: ipu-v3: ipu-ic: Fix saturation bit offset in TPMEM crypto: ccp - Validate the the error value used to index error messages PCI: hv: Delete the device earlier from hbus->children for hot-remove PCI: hv: Fix a use-after-free bug in hv_eject_device_work() crypto: caam - limit output IV to CBC to work around CTR mode DMA issue um: Allow building and running on older hosts um: Fix FP register size for XSTATE/XSAVE parisc: Ensure userspace privilege for ptraced processes in regset functions parisc: Fix kernel panic due invalid values in IAOQ0 or IAOQ1 powerpc/32s: fix suspend/resume when IBATs 4-7 are used powerpc/watchpoint: Restore NV GPRs while returning from exception eCryptfs: fix a couple type promotion bugs intel_th: msu: Fix single mode with disabled IOMMU Bluetooth: Add SMP workaround Microsoft Surface Precision Mouse bug usb: Handle USB3 remote wakeup for LPM enabled devices correctly dm bufio: fix deadlock with loop device compiler.h, kasan: Avoid duplicating __read_once_size_nocheck() compiler.h: Add read_word_at_a_time() function. lib/strscpy: Shut up KASAN false-positives in strscpy() ext4: allow directory holes bnx2x: Prevent load reordering in tx completion processing bnx2x: Prevent ptp_task to be rescheduled indefinitely caif-hsi: fix possible deadlock in cfhsi_exit_module() igmp: fix memory leak in igmpv3_del_delrec() ipv4: don't set IPv6 only flags to IPv4 addresses net: bcmgenet: use promisc for unsupported filters net: dsa: mv88e6xxx: wait after reset deactivation net: neigh: fix multiple neigh timer scheduling net: openvswitch: fix csum updates for MPLS actions nfc: fix potential illegal memory access rxrpc: Fix send on a connected, but unbound socket sky2: Disable MSI on ASUS P6T vrf: make sure skb->data contains ip header to make routing macsec: fix use-after-free of skb during RX macsec: fix checksumming after decryption netrom: fix a memory leak in nr_rx_frame() netrom: hold sock when setting skb->destructor bonding: validate ip header before check IPPROTO_IGMP tcp: Reset bytes_acked and bytes_received when disconnecting net: bridge: mcast: fix stale nsrcs pointer in igmp3/mld2 report handling net: bridge: mcast: fix stale ipv6 hdr pointer when handling v6 query net: bridge: stp: don't cache eth dest pointer before skb pull perf/x86/amd/uncore: Rename 'L2' to 'LLC' perf/x86/amd/uncore: Get correct number of cores sharing last level cache perf/events/amd/uncore: Fix amd_uncore_llc ID to use pre-defined cpu_llc_id NFSv4: Fix open create exclusive when the server reboots nfsd: increase DRC cache limit nfsd: give out fewer session slots as limit approaches nfsd: fix performance-limiting session calculation nfsd: Fix overflow causing non-working mounts on 1 TB machines drm/panel: simple: Fix panel_simple_dsi_probe usb: core: hub: Disable hub-initiated U1/U2 tty: max310x: Fix invalid baudrate divisors calculator pinctrl: rockchip: fix leaked of_node references tty: serial: cpm_uart - fix init when SMC is relocated drm/bridge: tc358767: read display_props in get_modes() drm/bridge: sii902x: pixel clock unit is 10kHz instead of 1kHz memstick: Fix error cleanup path of memstick_init tty/serial: digicolor: Fix digicolor-usart already registered warning tty: serial: msm_serial: avoid system lockup condition serial: 8250: Fix TX interrupt handling condition drm/virtio: Add memory barriers for capset cache. phy: renesas: rcar-gen2: Fix memory leak at error paths drm/rockchip: Properly adjust to a true clock in adjusted_mode tty: serial_core: Set port active bit in uart_port_activate usb: gadget: Zero ffs_io_data powerpc/pci/of: Fix OF flags parsing for 64bit BARs PCI: sysfs: Ignore lockdep for remove attribute kbuild: Add -Werror=unknown-warning-option to CLANG_FLAGS PCI: xilinx-nwl: Fix Multi MSI data programming iio: iio-utils: Fix possible incorrect mask calculation recordmcount: Fix spurious mcount entries on powerpc mfd: core: Set fwnode for created devices mfd: arizona: Fix undefined behavior mfd: hi655x-pmic: Fix missing return value check for devm_regmap_init_mmio_clk um: Silence lockdep complaint about mmap_sem powerpc/4xx/uic: clear pending interrupt after irq type/pol change RDMA/i40iw: Set queue pair state when being queried serial: sh-sci: Terminate TX DMA during buffer flushing serial: sh-sci: Fix TX DMA buffer flushing and workqueue races kallsyms: exclude kasan local symbols on s390 perf test mmap-thread-lookup: Initialize variable to suppress memory sanitizer warning RDMA/rxe: Fill in wc byte_len with IB_WC_RECV_RDMA_WITH_IMM powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h f2fs: avoid out-of-range memory access mailbox: handle failed named mailbox channel request powerpc/eeh: Handle hugepages in ioremap space sh: prevent warnings when using iounmap mm/kmemleak.c: fix check for softirq context 9p: pass the correct prototype to read_cache_page mm/mmu_notifier: use hlist_add_head_rcu() locking/lockdep: Fix lock used or unused stats error locking/lockdep: Hide unused 'class' variable usb: wusbcore: fix unbalanced get/put cluster_id usb: pci-quirks: Correct AMD PLL quirk detection x86/sysfb_efi: Add quirks for some devices with swapped width and height x86/speculation/mds: Apply more accurate check on hypervisor platform hpet: Fix division by zero in hpet_time_div() ALSA: line6: Fix wrong altsetting for LINE6_PODHD500_1 ALSA: hda - Add a conexant codec entry to let mute led work powerpc/tm: Fix oops on sigreturn on systems without TM access: avoid the RCU grace period for the temporary subjective credentials ipv6: check sk sk_type and protocol early in ip_mroute_set/getsockopt tcp: reset sk_send_head in tcp_write_queue_purge arm64: dts: marvell: Fix A37xx UART0 register size i2c: qup: fixed releasing dma without flush operation completion arm64: compat: Provide definition for COMPAT_SIGMINSTKSZ ISDN: hfcsusb: checking idx of ep configuration media: au0828: fix null dereference in error path media: cpia2_usb: first wake up, then free in disconnect media: radio-raremono: change devm_k*alloc to k*alloc Bluetooth: hci_uart: check for missing tty operations sched/fair: Don't free p->numa_faults with concurrent readers drivers/pps/pps.c: clear offset flags in PPS_SETPARAMS ioctl ceph: hold i_ceph_lock when removing caps for freeing inode Linux 4.9.187 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
0eb90dd8f7
228 changed files with 2289 additions and 1078 deletions
|
@ -8,6 +8,6 @@ Required properties:
|
|||
Example:
|
||||
serial@12000 {
|
||||
compatible = "marvell,armada-3700-uart";
|
||||
reg = <0x12000 0x400>;
|
||||
reg = <0x12000 0x200>;
|
||||
interrupts = <43>;
|
||||
};
|
||||
|
|
3
Makefile
3
Makefile
|
@ -1,6 +1,6 @@
|
|||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 186
|
||||
SUBLEVEL = 187
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
|
@ -520,6 +520,7 @@ ifneq ($(GCC_TOOLCHAIN),)
|
|||
CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN)
|
||||
endif
|
||||
CLANG_FLAGS += -no-integrated-as
|
||||
CLANG_FLAGS += -Werror=unknown-warning-option
|
||||
KBUILD_CFLAGS += $(CLANG_FLAGS)
|
||||
KBUILD_AFLAGS += $(CLANG_FLAGS)
|
||||
endif
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
|
||||
uart0: serial@12000 {
|
||||
compatible = "marvell,armada-3700-uart";
|
||||
reg = <0x12000 0x400>;
|
||||
reg = <0x12000 0x200>;
|
||||
interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
|
|
@ -306,7 +306,8 @@
|
|||
regulator-max-microvolt = <1320000>;
|
||||
enable-gpios = <&pmic 6 GPIO_ACTIVE_HIGH>;
|
||||
regulator-ramp-delay = <80>;
|
||||
regulator-enable-ramp-delay = <1000>;
|
||||
regulator-enable-ramp-delay = <2000>;
|
||||
regulator-settling-time-us = <160>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1020,7 +1020,7 @@
|
|||
compatible = "nvidia,tegra210-agic";
|
||||
#interrupt-cells = <3>;
|
||||
interrupt-controller;
|
||||
reg = <0x702f9000 0x2000>,
|
||||
reg = <0x702f9000 0x1000>,
|
||||
<0x702fa000 0x2000>;
|
||||
interrupts = <GIC_SPI 102 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
|
||||
clocks = <&tegra_car TEGRA210_CLK_APE>;
|
||||
|
|
|
@ -58,7 +58,7 @@ static int sha1_ce_finup(struct shash_desc *desc, const u8 *data,
|
|||
unsigned int len, u8 *out)
|
||||
{
|
||||
struct sha1_ce_state *sctx = shash_desc_ctx(desc);
|
||||
bool finalize = !sctx->sst.count && !(len % SHA1_BLOCK_SIZE);
|
||||
bool finalize = !sctx->sst.count && !(len % SHA1_BLOCK_SIZE) && len;
|
||||
|
||||
/*
|
||||
* Allow the asm code to perform the finalization if there is no
|
||||
|
|
|
@ -60,7 +60,7 @@ static int sha256_ce_finup(struct shash_desc *desc, const u8 *data,
|
|||
unsigned int len, u8 *out)
|
||||
{
|
||||
struct sha256_ce_state *sctx = shash_desc_ctx(desc);
|
||||
bool finalize = !sctx->sst.count && !(len % SHA256_BLOCK_SIZE);
|
||||
bool finalize = !sctx->sst.count && !(len % SHA256_BLOCK_SIZE) && len;
|
||||
|
||||
/*
|
||||
* Allow the asm code to perform the finalization if there is no
|
||||
|
|
|
@ -234,6 +234,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
|
|||
}
|
||||
|
||||
#define compat_user_stack_pointer() (user_stack_pointer(task_pt_regs(current)))
|
||||
#define COMPAT_MINSIGSTKSZ 2048
|
||||
|
||||
static inline void __user *arch_compat_alloc_user_space(long len)
|
||||
{
|
||||
|
|
|
@ -157,10 +157,14 @@ static int __init acpi_fadt_sanity_check(void)
|
|||
*/
|
||||
if (table->revision < 5 ||
|
||||
(table->revision == 5 && fadt->minor_revision < 1)) {
|
||||
pr_err("Unsupported FADT revision %d.%d, should be 5.1+\n",
|
||||
pr_err(FW_BUG "Unsupported FADT revision %d.%d, should be 5.1+\n",
|
||||
table->revision, fadt->minor_revision);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
|
||||
if (!fadt->arm_boot_flags) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
pr_err("FADT has ARM boot flags set, assuming 5.1\n");
|
||||
}
|
||||
|
||||
if (!(fadt->flags & ACPI_FADT_HW_REDUCED)) {
|
||||
|
|
|
@ -73,7 +73,11 @@
|
|||
|
||||
#ifdef CONFIG_EFI
|
||||
|
||||
__efistub_stext_offset = stext - _text;
|
||||
/*
|
||||
* Use ABSOLUTE() to avoid ld.lld treating this as a relative symbol:
|
||||
* https://github.com/ClangBuiltLinux/linux/issues/561
|
||||
*/
|
||||
__efistub_stext_offset = ABSOLUTE(stext - _text);
|
||||
|
||||
/*
|
||||
* Prevent the symbol aliases below from being emitted into the kallsyms
|
||||
|
|
|
@ -75,6 +75,8 @@ OBJCOPYFLAGS_piggy.o := --add-section=.image=$(obj)/vmlinux.bin.z \
|
|||
$(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
HOSTCFLAGS_calc_vmlinuz_load_addr.o += $(LINUXINCLUDE)
|
||||
|
||||
# Calculate the load address of the compressed kernel image
|
||||
hostprogs-y := calc_vmlinuz_load_addr
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "../../../../include/linux/sizes.h"
|
||||
#include <linux/sizes.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#define AR933X_UART_CS_PARITY_S 0
|
||||
#define AR933X_UART_CS_PARITY_M 0x3
|
||||
#define AR933X_UART_CS_PARITY_NONE 0
|
||||
#define AR933X_UART_CS_PARITY_ODD 1
|
||||
#define AR933X_UART_CS_PARITY_EVEN 2
|
||||
#define AR933X_UART_CS_PARITY_ODD 2
|
||||
#define AR933X_UART_CS_PARITY_EVEN 3
|
||||
#define AR933X_UART_CS_IF_MODE_S 2
|
||||
#define AR933X_UART_CS_IF_MODE_M 0x3
|
||||
#define AR933X_UART_CS_IF_MODE_NONE 0
|
||||
|
|
|
@ -170,6 +170,9 @@ long arch_ptrace(struct task_struct *child, long request,
|
|||
if ((addr & (sizeof(unsigned long)-1)) ||
|
||||
addr >= sizeof(struct pt_regs))
|
||||
break;
|
||||
if (addr == PT_IAOQ0 || addr == PT_IAOQ1) {
|
||||
data |= 3; /* ensure userspace privilege */
|
||||
}
|
||||
if ((addr >= PT_GR1 && addr <= PT_GR31) ||
|
||||
addr == PT_IAOQ0 || addr == PT_IAOQ1 ||
|
||||
(addr >= PT_FR0 && addr <= PT_FR31 + 4) ||
|
||||
|
@ -231,16 +234,18 @@ long arch_ptrace(struct task_struct *child, long request,
|
|||
|
||||
static compat_ulong_t translate_usr_offset(compat_ulong_t offset)
|
||||
{
|
||||
if (offset < 0)
|
||||
return sizeof(struct pt_regs);
|
||||
else if (offset <= 32*4) /* gr[0..31] */
|
||||
return offset * 2 + 4;
|
||||
else if (offset <= 32*4+32*8) /* gr[0..31] + fr[0..31] */
|
||||
return offset + 32*4;
|
||||
else if (offset < sizeof(struct pt_regs)/2 + 32*4)
|
||||
return offset * 2 + 4 - 32*8;
|
||||
compat_ulong_t pos;
|
||||
|
||||
if (offset < 32*4) /* gr[0..31] */
|
||||
pos = offset * 2 + 4;
|
||||
else if (offset < 32*4+32*8) /* fr[0] ... fr[31] */
|
||||
pos = (offset - 32*4) + PT_FR0;
|
||||
else if (offset < sizeof(struct pt_regs)/2 + 32*4) /* sr[0] ... ipsw */
|
||||
pos = (offset - 32*4 - 32*8) * 2 + PT_SR0 + 4;
|
||||
else
|
||||
return sizeof(struct pt_regs);
|
||||
pos = sizeof(struct pt_regs);
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
|
||||
|
@ -284,9 +289,12 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
|
|||
addr = translate_usr_offset(addr);
|
||||
if (addr >= sizeof(struct pt_regs))
|
||||
break;
|
||||
if (addr == PT_IAOQ0+4 || addr == PT_IAOQ1+4) {
|
||||
data |= 3; /* ensure userspace privilege */
|
||||
}
|
||||
if (addr >= PT_FR0 && addr <= PT_FR31 + 4) {
|
||||
/* Special case, fp regs are 64 bits anyway */
|
||||
*(__u64 *) ((char *) task_regs(child) + addr) = data;
|
||||
*(__u32 *) ((char *) task_regs(child) + addr) = data;
|
||||
ret = 0;
|
||||
}
|
||||
else if ((addr >= PT_GR1+4 && addr <= PT_GR31+4) ||
|
||||
|
@ -499,7 +507,8 @@ static void set_reg(struct pt_regs *regs, int num, unsigned long val)
|
|||
return;
|
||||
case RI(iaoq[0]):
|
||||
case RI(iaoq[1]):
|
||||
regs->iaoq[num - RI(iaoq[0])] = val;
|
||||
/* set 2 lowest bits to ensure userspace privilege: */
|
||||
regs->iaoq[num - RI(iaoq[0])] = val | 3;
|
||||
return;
|
||||
case RI(sar): regs->sar = val;
|
||||
return;
|
||||
|
|
|
@ -19,10 +19,30 @@ static inline uint32_t swab32p(void *p)
|
|||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#define get_le32(p) (*((uint32_t *) (p)))
|
||||
#define cpu_to_be32(x) swab32(x)
|
||||
static inline u32 be32_to_cpup(const u32 *p)
|
||||
{
|
||||
return swab32p((u32 *)p);
|
||||
}
|
||||
#else
|
||||
#define get_le32(p) swab32p(p)
|
||||
#define cpu_to_be32(x) (x)
|
||||
static inline u32 be32_to_cpup(const u32 *p)
|
||||
{
|
||||
return *p;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline uint32_t get_unaligned_be32(const void *p)
|
||||
{
|
||||
return be32_to_cpup(p);
|
||||
}
|
||||
|
||||
static inline void put_unaligned_be32(u32 val, void *p)
|
||||
{
|
||||
*((u32 *)p) = cpu_to_be32(val);
|
||||
}
|
||||
|
||||
#define memeq(a, b, size) (memcmp(a, b, size) == 0)
|
||||
#define memzero(buf, size) memset(buf, 0, size)
|
||||
|
||||
|
|
|
@ -362,10 +362,19 @@ static inline unsigned long eeh_token_to_phys(unsigned long token)
|
|||
NULL, &hugepage_shift);
|
||||
if (!ptep)
|
||||
return token;
|
||||
WARN_ON(hugepage_shift);
|
||||
pa = pte_pfn(*ptep) << PAGE_SHIFT;
|
||||
|
||||
return pa | (token & (PAGE_SIZE-1));
|
||||
pa = pte_pfn(*ptep);
|
||||
|
||||
/* On radix we can do hugepage mappings for io, so handle that */
|
||||
if (hugepage_shift) {
|
||||
pa <<= hugepage_shift;
|
||||
pa |= token & ((1ul << hugepage_shift) - 1);
|
||||
} else {
|
||||
pa <<= PAGE_SHIFT;
|
||||
pa |= token & (PAGE_SIZE - 1);
|
||||
}
|
||||
|
||||
return pa;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1505,7 +1505,7 @@ handle_page_fault:
|
|||
addi r3,r1,STACK_FRAME_OVERHEAD
|
||||
bl do_page_fault
|
||||
cmpdi r3,0
|
||||
beq+ 12f
|
||||
beq+ ret_from_except_lite
|
||||
bl save_nvgprs
|
||||
mr r5,r3
|
||||
addi r3,r1,STACK_FRAME_OVERHEAD
|
||||
|
@ -1520,7 +1520,12 @@ handle_dabr_fault:
|
|||
ld r5,_DSISR(r1)
|
||||
addi r3,r1,STACK_FRAME_OVERHEAD
|
||||
bl do_break
|
||||
12: b ret_from_except_lite
|
||||
/*
|
||||
* do_break() may have changed the NV GPRS while handling a breakpoint.
|
||||
* If so, we need to restore them with their updated values. Don't use
|
||||
* ret_from_except_lite here.
|
||||
*/
|
||||
b ret_from_except
|
||||
|
||||
|
||||
#ifdef CONFIG_PPC_STD_MMU_64
|
||||
|
|
|
@ -45,6 +45,8 @@ static unsigned int pci_parse_of_flags(u32 addr0, int bridge)
|
|||
if (addr0 & 0x02000000) {
|
||||
flags = IORESOURCE_MEM | PCI_BASE_ADDRESS_SPACE_MEMORY;
|
||||
flags |= (addr0 >> 22) & PCI_BASE_ADDRESS_MEM_TYPE_64;
|
||||
if (flags & PCI_BASE_ADDRESS_MEM_TYPE_64)
|
||||
flags |= IORESOURCE_MEM_64;
|
||||
flags |= (addr0 >> 28) & PCI_BASE_ADDRESS_MEM_TYPE_1M;
|
||||
if (addr0 & 0x40000000)
|
||||
flags |= IORESOURCE_PREFETCH
|
||||
|
|
|
@ -1281,6 +1281,9 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
|
|||
goto bad;
|
||||
|
||||
if (MSR_TM_ACTIVE(msr_hi<<32)) {
|
||||
/* Trying to start TM on non TM system */
|
||||
if (!cpu_has_feature(CPU_FTR_TM))
|
||||
goto bad;
|
||||
/* We only recheckpoint on return if we're
|
||||
* transaction.
|
||||
*/
|
||||
|
|
|
@ -741,6 +741,11 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
|
|||
if (MSR_TM_ACTIVE(msr)) {
|
||||
/* We recheckpoint on return. */
|
||||
struct ucontext __user *uc_transact;
|
||||
|
||||
/* Trying to start TM on non TM system */
|
||||
if (!cpu_has_feature(CPU_FTR_TM))
|
||||
goto badframe;
|
||||
|
||||
if (__get_user(uc_transact, &uc->uc_link))
|
||||
goto badframe;
|
||||
if (restore_tm_sigcontexts(current, &uc->uc_mcontext,
|
||||
|
|
|
@ -23,11 +23,19 @@
|
|||
#define SL_IBAT2 0x48
|
||||
#define SL_DBAT3 0x50
|
||||
#define SL_IBAT3 0x58
|
||||
#define SL_TB 0x60
|
||||
#define SL_R2 0x68
|
||||
#define SL_CR 0x6c
|
||||
#define SL_LR 0x70
|
||||
#define SL_R12 0x74 /* r12 to r31 */
|
||||
#define SL_DBAT4 0x60
|
||||
#define SL_IBAT4 0x68
|
||||
#define SL_DBAT5 0x70
|
||||
#define SL_IBAT5 0x78
|
||||
#define SL_DBAT6 0x80
|
||||
#define SL_IBAT6 0x88
|
||||
#define SL_DBAT7 0x90
|
||||
#define SL_IBAT7 0x98
|
||||
#define SL_TB 0xa0
|
||||
#define SL_R2 0xa8
|
||||
#define SL_CR 0xac
|
||||
#define SL_LR 0xb0
|
||||
#define SL_R12 0xb4 /* r12 to r31 */
|
||||
#define SL_SIZE (SL_R12 + 80)
|
||||
|
||||
.section .data
|
||||
|
@ -112,6 +120,41 @@ _GLOBAL(swsusp_arch_suspend)
|
|||
mfibatl r4,3
|
||||
stw r4,SL_IBAT3+4(r11)
|
||||
|
||||
BEGIN_MMU_FTR_SECTION
|
||||
mfspr r4,SPRN_DBAT4U
|
||||
stw r4,SL_DBAT4(r11)
|
||||
mfspr r4,SPRN_DBAT4L
|
||||
stw r4,SL_DBAT4+4(r11)
|
||||
mfspr r4,SPRN_DBAT5U
|
||||
stw r4,SL_DBAT5(r11)
|
||||
mfspr r4,SPRN_DBAT5L
|
||||
stw r4,SL_DBAT5+4(r11)
|
||||
mfspr r4,SPRN_DBAT6U
|
||||
stw r4,SL_DBAT6(r11)
|
||||
mfspr r4,SPRN_DBAT6L
|
||||
stw r4,SL_DBAT6+4(r11)
|
||||
mfspr r4,SPRN_DBAT7U
|
||||
stw r4,SL_DBAT7(r11)
|
||||
mfspr r4,SPRN_DBAT7L
|
||||
stw r4,SL_DBAT7+4(r11)
|
||||
mfspr r4,SPRN_IBAT4U
|
||||
stw r4,SL_IBAT4(r11)
|
||||
mfspr r4,SPRN_IBAT4L
|
||||
stw r4,SL_IBAT4+4(r11)
|
||||
mfspr r4,SPRN_IBAT5U
|
||||
stw r4,SL_IBAT5(r11)
|
||||
mfspr r4,SPRN_IBAT5L
|
||||
stw r4,SL_IBAT5+4(r11)
|
||||
mfspr r4,SPRN_IBAT6U
|
||||
stw r4,SL_IBAT6(r11)
|
||||
mfspr r4,SPRN_IBAT6L
|
||||
stw r4,SL_IBAT6+4(r11)
|
||||
mfspr r4,SPRN_IBAT7U
|
||||
stw r4,SL_IBAT7(r11)
|
||||
mfspr r4,SPRN_IBAT7L
|
||||
stw r4,SL_IBAT7+4(r11)
|
||||
END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
|
||||
|
||||
#if 0
|
||||
/* Backup various CPU config stuffs */
|
||||
bl __save_cpu_setup
|
||||
|
@ -277,27 +320,41 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
|
|||
mtibatu 3,r4
|
||||
lwz r4,SL_IBAT3+4(r11)
|
||||
mtibatl 3,r4
|
||||
#endif
|
||||
|
||||
BEGIN_MMU_FTR_SECTION
|
||||
li r4,0
|
||||
lwz r4,SL_DBAT4(r11)
|
||||
mtspr SPRN_DBAT4U,r4
|
||||
lwz r4,SL_DBAT4+4(r11)
|
||||
mtspr SPRN_DBAT4L,r4
|
||||
lwz r4,SL_DBAT5(r11)
|
||||
mtspr SPRN_DBAT5U,r4
|
||||
lwz r4,SL_DBAT5+4(r11)
|
||||
mtspr SPRN_DBAT5L,r4
|
||||
lwz r4,SL_DBAT6(r11)
|
||||
mtspr SPRN_DBAT6U,r4
|
||||
lwz r4,SL_DBAT6+4(r11)
|
||||
mtspr SPRN_DBAT6L,r4
|
||||
lwz r4,SL_DBAT7(r11)
|
||||
mtspr SPRN_DBAT7U,r4
|
||||
lwz r4,SL_DBAT7+4(r11)
|
||||
mtspr SPRN_DBAT7L,r4
|
||||
lwz r4,SL_IBAT4(r11)
|
||||
mtspr SPRN_IBAT4U,r4
|
||||
lwz r4,SL_IBAT4+4(r11)
|
||||
mtspr SPRN_IBAT4L,r4
|
||||
lwz r4,SL_IBAT5(r11)
|
||||
mtspr SPRN_IBAT5U,r4
|
||||
lwz r4,SL_IBAT5+4(r11)
|
||||
mtspr SPRN_IBAT5L,r4
|
||||
lwz r4,SL_IBAT6(r11)
|
||||
mtspr SPRN_IBAT6U,r4
|
||||
lwz r4,SL_IBAT6+4(r11)
|
||||
mtspr SPRN_IBAT6L,r4
|
||||
lwz r4,SL_IBAT7(r11)
|
||||
mtspr SPRN_IBAT7U,r4
|
||||
lwz r4,SL_IBAT7+4(r11)
|
||||
mtspr SPRN_IBAT7L,r4
|
||||
END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
|
||||
#endif
|
||||
|
||||
/* Flush all TLBs */
|
||||
lis r4,0x1000
|
||||
|
|
|
@ -37,10 +37,18 @@
|
|||
#define SL_IBAT2 0x48
|
||||
#define SL_DBAT3 0x50
|
||||
#define SL_IBAT3 0x58
|
||||
#define SL_TB 0x60
|
||||
#define SL_R2 0x68
|
||||
#define SL_CR 0x6c
|
||||
#define SL_R12 0x70 /* r12 to r31 */
|
||||
#define SL_DBAT4 0x60
|
||||
#define SL_IBAT4 0x68
|
||||
#define SL_DBAT5 0x70
|
||||
#define SL_IBAT5 0x78
|
||||
#define SL_DBAT6 0x80
|
||||
#define SL_IBAT6 0x88
|
||||
#define SL_DBAT7 0x90
|
||||
#define SL_IBAT7 0x98
|
||||
#define SL_TB 0xa0
|
||||
#define SL_R2 0xa8
|
||||
#define SL_CR 0xac
|
||||
#define SL_R12 0xb0 /* r12 to r31 */
|
||||
#define SL_SIZE (SL_R12 + 80)
|
||||
|
||||
.section .text
|
||||
|
@ -125,6 +133,41 @@ _GLOBAL(low_sleep_handler)
|
|||
mfibatl r4,3
|
||||
stw r4,SL_IBAT3+4(r1)
|
||||
|
||||
BEGIN_MMU_FTR_SECTION
|
||||
mfspr r4,SPRN_DBAT4U
|
||||
stw r4,SL_DBAT4(r1)
|
||||
mfspr r4,SPRN_DBAT4L
|
||||
stw r4,SL_DBAT4+4(r1)
|
||||
mfspr r4,SPRN_DBAT5U
|
||||
stw r4,SL_DBAT5(r1)
|
||||
mfspr r4,SPRN_DBAT5L
|
||||
stw r4,SL_DBAT5+4(r1)
|
||||
mfspr r4,SPRN_DBAT6U
|
||||
stw r4,SL_DBAT6(r1)
|
||||
mfspr r4,SPRN_DBAT6L
|
||||
stw r4,SL_DBAT6+4(r1)
|
||||
mfspr r4,SPRN_DBAT7U
|
||||
stw r4,SL_DBAT7(r1)
|
||||
mfspr r4,SPRN_DBAT7L
|
||||
stw r4,SL_DBAT7+4(r1)
|
||||
mfspr r4,SPRN_IBAT4U
|
||||
stw r4,SL_IBAT4(r1)
|
||||
mfspr r4,SPRN_IBAT4L
|
||||
stw r4,SL_IBAT4+4(r1)
|
||||
mfspr r4,SPRN_IBAT5U
|
||||
stw r4,SL_IBAT5(r1)
|
||||
mfspr r4,SPRN_IBAT5L
|
||||
stw r4,SL_IBAT5+4(r1)
|
||||
mfspr r4,SPRN_IBAT6U
|
||||
stw r4,SL_IBAT6(r1)
|
||||
mfspr r4,SPRN_IBAT6L
|
||||
stw r4,SL_IBAT6+4(r1)
|
||||
mfspr r4,SPRN_IBAT7U
|
||||
stw r4,SL_IBAT7(r1)
|
||||
mfspr r4,SPRN_IBAT7L
|
||||
stw r4,SL_IBAT7+4(r1)
|
||||
END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
|
||||
|
||||
/* Backup various CPU config stuffs */
|
||||
bl __save_cpu_setup
|
||||
|
||||
|
@ -325,22 +368,37 @@ grackle_wake_up:
|
|||
mtibatl 3,r4
|
||||
|
||||
BEGIN_MMU_FTR_SECTION
|
||||
li r4,0
|
||||
lwz r4,SL_DBAT4(r1)
|
||||
mtspr SPRN_DBAT4U,r4
|
||||
lwz r4,SL_DBAT4+4(r1)
|
||||
mtspr SPRN_DBAT4L,r4
|
||||
lwz r4,SL_DBAT5(r1)
|
||||
mtspr SPRN_DBAT5U,r4
|
||||
lwz r4,SL_DBAT5+4(r1)
|
||||
mtspr SPRN_DBAT5L,r4
|
||||
lwz r4,SL_DBAT6(r1)
|
||||
mtspr SPRN_DBAT6U,r4
|
||||
lwz r4,SL_DBAT6+4(r1)
|
||||
mtspr SPRN_DBAT6L,r4
|
||||
lwz r4,SL_DBAT7(r1)
|
||||
mtspr SPRN_DBAT7U,r4
|
||||
lwz r4,SL_DBAT7+4(r1)
|
||||
mtspr SPRN_DBAT7L,r4
|
||||
lwz r4,SL_IBAT4(r1)
|
||||
mtspr SPRN_IBAT4U,r4
|
||||
lwz r4,SL_IBAT4+4(r1)
|
||||
mtspr SPRN_IBAT4L,r4
|
||||
lwz r4,SL_IBAT5(r1)
|
||||
mtspr SPRN_IBAT5U,r4
|
||||
lwz r4,SL_IBAT5+4(r1)
|
||||
mtspr SPRN_IBAT5L,r4
|
||||
lwz r4,SL_IBAT6(r1)
|
||||
mtspr SPRN_IBAT6U,r4
|
||||
lwz r4,SL_IBAT6+4(r1)
|
||||
mtspr SPRN_IBAT6L,r4
|
||||
lwz r4,SL_IBAT7(r1)
|
||||
mtspr SPRN_IBAT7U,r4
|
||||
lwz r4,SL_IBAT7+4(r1)
|
||||
mtspr SPRN_IBAT7L,r4
|
||||
END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
|
||||
|
||||
|
|
|
@ -158,6 +158,7 @@ static int uic_set_irq_type(struct irq_data *d, unsigned int flow_type)
|
|||
|
||||
mtdcr(uic->dcrbase + UIC_PR, pr);
|
||||
mtdcr(uic->dcrbase + UIC_TR, tr);
|
||||
mtdcr(uic->dcrbase + UIC_SR, ~mask);
|
||||
|
||||
raw_spin_unlock_irqrestore(&uic->lock, flags);
|
||||
|
||||
|
|
|
@ -370,7 +370,11 @@ static inline int iounmap_fixed(void __iomem *addr) { return -EINVAL; }
|
|||
|
||||
#define ioremap_nocache ioremap
|
||||
#define ioremap_uc ioremap
|
||||
#define iounmap __iounmap
|
||||
|
||||
static inline void iounmap(void __iomem *addr)
|
||||
{
|
||||
__iounmap(addr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
|
||||
|
|
|
@ -56,7 +56,7 @@ static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
|
|||
* when the new ->mm is used for the first time.
|
||||
*/
|
||||
__switch_mm(&new->context.id);
|
||||
down_write(&new->mmap_sem);
|
||||
down_write_nested(&new->mmap_sem, 1);
|
||||
uml_setup_stubs(new);
|
||||
up_write(&new->mmap_sem);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <asm/types.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/segment.h>
|
||||
#include <sysdep/ptrace_user.h>
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
|
@ -22,6 +23,8 @@ struct thread_info {
|
|||
0-0xBFFFFFFF for user
|
||||
0-0xFFFFFFFF for kernel */
|
||||
struct thread_info *real_thread; /* Points to non-IRQ stack */
|
||||
unsigned long aux_fp_regs[FP_SIZE]; /* auxiliary fp_regs to save/restore
|
||||
them out-of-band */
|
||||
};
|
||||
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
|
|
|
@ -274,7 +274,7 @@ extern int protect(struct mm_id * mm_idp, unsigned long addr,
|
|||
extern int is_skas_winch(int pid, int fd, void *data);
|
||||
extern int start_userspace(unsigned long stub_stack);
|
||||
extern int copy_context_skas0(unsigned long stack, int pid);
|
||||
extern void userspace(struct uml_pt_regs *regs);
|
||||
extern void userspace(struct uml_pt_regs *regs, unsigned long *aux_fp_regs);
|
||||
extern int map_stub_pages(int fd, unsigned long code, unsigned long data,
|
||||
unsigned long stack);
|
||||
extern void new_thread(void *stack, jmp_buf *buf, void (*handler)(void));
|
||||
|
|
|
@ -128,7 +128,7 @@ void new_thread_handler(void)
|
|||
* callback returns only if the kernel thread execs a process
|
||||
*/
|
||||
n = fn(arg);
|
||||
userspace(¤t->thread.regs.regs);
|
||||
userspace(¤t->thread.regs.regs, current_thread_info()->aux_fp_regs);
|
||||
}
|
||||
|
||||
/* Called magically, see new_thread_handler above */
|
||||
|
@ -147,7 +147,7 @@ void fork_handler(void)
|
|||
|
||||
current->thread.prev_sched = NULL;
|
||||
|
||||
userspace(¤t->thread.regs.regs);
|
||||
userspace(¤t->thread.regs.regs, current_thread_info()->aux_fp_regs);
|
||||
}
|
||||
|
||||
int copy_thread(unsigned long clone_flags, unsigned long sp,
|
||||
|
|
|
@ -87,12 +87,11 @@ bad_wait:
|
|||
|
||||
extern unsigned long current_stub_stack(void);
|
||||
|
||||
static void get_skas_faultinfo(int pid, struct faultinfo *fi)
|
||||
static void get_skas_faultinfo(int pid, struct faultinfo *fi, unsigned long *aux_fp_regs)
|
||||
{
|
||||
int err;
|
||||
unsigned long fpregs[FP_SIZE];
|
||||
|
||||
err = get_fp_registers(pid, fpregs);
|
||||
err = get_fp_registers(pid, aux_fp_regs);
|
||||
if (err < 0) {
|
||||
printk(UM_KERN_ERR "save_fp_registers returned %d\n",
|
||||
err);
|
||||
|
@ -112,7 +111,7 @@ static void get_skas_faultinfo(int pid, struct faultinfo *fi)
|
|||
*/
|
||||
memcpy(fi, (void *)current_stub_stack(), sizeof(*fi));
|
||||
|
||||
err = put_fp_registers(pid, fpregs);
|
||||
err = put_fp_registers(pid, aux_fp_regs);
|
||||
if (err < 0) {
|
||||
printk(UM_KERN_ERR "put_fp_registers returned %d\n",
|
||||
err);
|
||||
|
@ -120,9 +119,9 @@ static void get_skas_faultinfo(int pid, struct faultinfo *fi)
|
|||
}
|
||||
}
|
||||
|
||||
static void handle_segv(int pid, struct uml_pt_regs * regs)
|
||||
static void handle_segv(int pid, struct uml_pt_regs *regs, unsigned long *aux_fp_regs)
|
||||
{
|
||||
get_skas_faultinfo(pid, ®s->faultinfo);
|
||||
get_skas_faultinfo(pid, ®s->faultinfo, aux_fp_regs);
|
||||
segv(regs->faultinfo, 0, 1, NULL);
|
||||
}
|
||||
|
||||
|
@ -305,7 +304,7 @@ int start_userspace(unsigned long stub_stack)
|
|||
return err;
|
||||
}
|
||||
|
||||
void userspace(struct uml_pt_regs *regs)
|
||||
void userspace(struct uml_pt_regs *regs, unsigned long *aux_fp_regs)
|
||||
{
|
||||
int err, status, op, pid = userspace_pid[0];
|
||||
/* To prevent races if using_sysemu changes under us.*/
|
||||
|
@ -374,11 +373,11 @@ void userspace(struct uml_pt_regs *regs)
|
|||
case SIGSEGV:
|
||||
if (PTRACE_FULL_FAULTINFO) {
|
||||
get_skas_faultinfo(pid,
|
||||
®s->faultinfo);
|
||||
®s->faultinfo, aux_fp_regs);
|
||||
(*sig_info[SIGSEGV])(SIGSEGV, (struct siginfo *)&si,
|
||||
regs);
|
||||
}
|
||||
else handle_segv(pid, regs);
|
||||
else handle_segv(pid, regs, aux_fp_regs);
|
||||
break;
|
||||
case SIGTRAP + 0x80:
|
||||
handle_trap(pid, regs, local_using_sysemu);
|
||||
|
|
|
@ -19,13 +19,14 @@
|
|||
#include <asm/cpufeature.h>
|
||||
#include <asm/perf_event.h>
|
||||
#include <asm/msr.h>
|
||||
#include <asm/smp.h>
|
||||
|
||||
#define NUM_COUNTERS_NB 4
|
||||
#define NUM_COUNTERS_L2 4
|
||||
#define MAX_COUNTERS NUM_COUNTERS_NB
|
||||
|
||||
#define RDPMC_BASE_NB 6
|
||||
#define RDPMC_BASE_L2 10
|
||||
#define RDPMC_BASE_LLC 10
|
||||
|
||||
#define COUNTER_SHIFT 16
|
||||
|
||||
|
@ -45,30 +46,30 @@ struct amd_uncore {
|
|||
};
|
||||
|
||||
static struct amd_uncore * __percpu *amd_uncore_nb;
|
||||
static struct amd_uncore * __percpu *amd_uncore_l2;
|
||||
static struct amd_uncore * __percpu *amd_uncore_llc;
|
||||
|
||||
static struct pmu amd_nb_pmu;
|
||||
static struct pmu amd_l2_pmu;
|
||||
static struct pmu amd_llc_pmu;
|
||||
|
||||
static cpumask_t amd_nb_active_mask;
|
||||
static cpumask_t amd_l2_active_mask;
|
||||
static cpumask_t amd_llc_active_mask;
|
||||
|
||||
static bool is_nb_event(struct perf_event *event)
|
||||
{
|
||||
return event->pmu->type == amd_nb_pmu.type;
|
||||
}
|
||||
|
||||
static bool is_l2_event(struct perf_event *event)
|
||||
static bool is_llc_event(struct perf_event *event)
|
||||
{
|
||||
return event->pmu->type == amd_l2_pmu.type;
|
||||
return event->pmu->type == amd_llc_pmu.type;
|
||||
}
|
||||
|
||||
static struct amd_uncore *event_to_amd_uncore(struct perf_event *event)
|
||||
{
|
||||
if (is_nb_event(event) && amd_uncore_nb)
|
||||
return *per_cpu_ptr(amd_uncore_nb, event->cpu);
|
||||
else if (is_l2_event(event) && amd_uncore_l2)
|
||||
return *per_cpu_ptr(amd_uncore_l2, event->cpu);
|
||||
else if (is_llc_event(event) && amd_uncore_llc)
|
||||
return *per_cpu_ptr(amd_uncore_llc, event->cpu);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -183,16 +184,16 @@ static int amd_uncore_event_init(struct perf_event *event)
|
|||
return -ENOENT;
|
||||
|
||||
/*
|
||||
* NB and L2 counters (MSRs) are shared across all cores that share the
|
||||
* same NB / L2 cache. Interrupts can be directed to a single target
|
||||
* core, however, event counts generated by processes running on other
|
||||
* cores cannot be masked out. So we do not support sampling and
|
||||
* per-thread events.
|
||||
* NB and Last level cache counters (MSRs) are shared across all cores
|
||||
* that share the same NB / Last level cache. Interrupts can be directed
|
||||
* to a single target core, however, event counts generated by processes
|
||||
* running on other cores cannot be masked out. So we do not support
|
||||
* sampling and per-thread events.
|
||||
*/
|
||||
if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK)
|
||||
return -EINVAL;
|
||||
|
||||
/* NB and L2 counters do not have usr/os/guest/host bits */
|
||||
/* NB and Last level cache counters do not have usr/os/guest/host bits */
|
||||
if (event->attr.exclude_user || event->attr.exclude_kernel ||
|
||||
event->attr.exclude_host || event->attr.exclude_guest)
|
||||
return -EINVAL;
|
||||
|
@ -226,8 +227,8 @@ static ssize_t amd_uncore_attr_show_cpumask(struct device *dev,
|
|||
|
||||
if (pmu->type == amd_nb_pmu.type)
|
||||
active_mask = &amd_nb_active_mask;
|
||||
else if (pmu->type == amd_l2_pmu.type)
|
||||
active_mask = &amd_l2_active_mask;
|
||||
else if (pmu->type == amd_llc_pmu.type)
|
||||
active_mask = &amd_llc_active_mask;
|
||||
else
|
||||
return 0;
|
||||
|
||||
|
@ -276,7 +277,7 @@ static struct pmu amd_nb_pmu = {
|
|||
.read = amd_uncore_read,
|
||||
};
|
||||
|
||||
static struct pmu amd_l2_pmu = {
|
||||
static struct pmu amd_llc_pmu = {
|
||||
.task_ctx_nr = perf_invalid_context,
|
||||
.attr_groups = amd_uncore_attr_groups,
|
||||
.name = "amd_l2",
|
||||
|
@ -296,7 +297,7 @@ static struct amd_uncore *amd_uncore_alloc(unsigned int cpu)
|
|||
|
||||
static int amd_uncore_cpu_up_prepare(unsigned int cpu)
|
||||
{
|
||||
struct amd_uncore *uncore_nb = NULL, *uncore_l2;
|
||||
struct amd_uncore *uncore_nb = NULL, *uncore_llc;
|
||||
|
||||
if (amd_uncore_nb) {
|
||||
uncore_nb = amd_uncore_alloc(cpu);
|
||||
|
@ -312,18 +313,18 @@ static int amd_uncore_cpu_up_prepare(unsigned int cpu)
|
|||
*per_cpu_ptr(amd_uncore_nb, cpu) = uncore_nb;
|
||||
}
|
||||
|
||||
if (amd_uncore_l2) {
|
||||
uncore_l2 = amd_uncore_alloc(cpu);
|
||||
if (!uncore_l2)
|
||||
if (amd_uncore_llc) {
|
||||
uncore_llc = amd_uncore_alloc(cpu);
|
||||
if (!uncore_llc)
|
||||
goto fail;
|
||||
uncore_l2->cpu = cpu;
|
||||
uncore_l2->num_counters = NUM_COUNTERS_L2;
|
||||
uncore_l2->rdpmc_base = RDPMC_BASE_L2;
|
||||
uncore_l2->msr_base = MSR_F16H_L2I_PERF_CTL;
|
||||
uncore_l2->active_mask = &amd_l2_active_mask;
|
||||
uncore_l2->pmu = &amd_l2_pmu;
|
||||
uncore_l2->id = -1;
|
||||
*per_cpu_ptr(amd_uncore_l2, cpu) = uncore_l2;
|
||||
uncore_llc->cpu = cpu;
|
||||
uncore_llc->num_counters = NUM_COUNTERS_L2;
|
||||
uncore_llc->rdpmc_base = RDPMC_BASE_LLC;
|
||||
uncore_llc->msr_base = MSR_F16H_L2I_PERF_CTL;
|
||||
uncore_llc->active_mask = &amd_llc_active_mask;
|
||||
uncore_llc->pmu = &amd_llc_pmu;
|
||||
uncore_llc->id = -1;
|
||||
*per_cpu_ptr(amd_uncore_llc, cpu) = uncore_llc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -376,17 +377,12 @@ static int amd_uncore_cpu_starting(unsigned int cpu)
|
|||
*per_cpu_ptr(amd_uncore_nb, cpu) = uncore;
|
||||
}
|
||||
|
||||
if (amd_uncore_l2) {
|
||||
unsigned int apicid = cpu_data(cpu).apicid;
|
||||
unsigned int nshared;
|
||||
if (amd_uncore_llc) {
|
||||
uncore = *per_cpu_ptr(amd_uncore_llc, cpu);
|
||||
uncore->id = per_cpu(cpu_llc_id, cpu);
|
||||
|
||||
uncore = *per_cpu_ptr(amd_uncore_l2, cpu);
|
||||
cpuid_count(0x8000001d, 2, &eax, &ebx, &ecx, &edx);
|
||||
nshared = ((eax >> 14) & 0xfff) + 1;
|
||||
uncore->id = apicid - (apicid % nshared);
|
||||
|
||||
uncore = amd_uncore_find_online_sibling(uncore, amd_uncore_l2);
|
||||
*per_cpu_ptr(amd_uncore_l2, cpu) = uncore;
|
||||
uncore = amd_uncore_find_online_sibling(uncore, amd_uncore_llc);
|
||||
*per_cpu_ptr(amd_uncore_llc, cpu) = uncore;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -419,8 +415,8 @@ static int amd_uncore_cpu_online(unsigned int cpu)
|
|||
if (amd_uncore_nb)
|
||||
uncore_online(cpu, amd_uncore_nb);
|
||||
|
||||
if (amd_uncore_l2)
|
||||
uncore_online(cpu, amd_uncore_l2);
|
||||
if (amd_uncore_llc)
|
||||
uncore_online(cpu, amd_uncore_llc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -456,8 +452,8 @@ static int amd_uncore_cpu_down_prepare(unsigned int cpu)
|
|||
if (amd_uncore_nb)
|
||||
uncore_down_prepare(cpu, amd_uncore_nb);
|
||||
|
||||
if (amd_uncore_l2)
|
||||
uncore_down_prepare(cpu, amd_uncore_l2);
|
||||
if (amd_uncore_llc)
|
||||
uncore_down_prepare(cpu, amd_uncore_llc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -479,8 +475,8 @@ static int amd_uncore_cpu_dead(unsigned int cpu)
|
|||
if (amd_uncore_nb)
|
||||
uncore_dead(cpu, amd_uncore_nb);
|
||||
|
||||
if (amd_uncore_l2)
|
||||
uncore_dead(cpu, amd_uncore_l2);
|
||||
if (amd_uncore_llc)
|
||||
uncore_dead(cpu, amd_uncore_llc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -510,16 +506,16 @@ static int __init amd_uncore_init(void)
|
|||
}
|
||||
|
||||
if (boot_cpu_has(X86_FEATURE_PERFCTR_L2)) {
|
||||
amd_uncore_l2 = alloc_percpu(struct amd_uncore *);
|
||||
if (!amd_uncore_l2) {
|
||||
amd_uncore_llc = alloc_percpu(struct amd_uncore *);
|
||||
if (!amd_uncore_llc) {
|
||||
ret = -ENOMEM;
|
||||
goto fail_l2;
|
||||
goto fail_llc;
|
||||
}
|
||||
ret = perf_pmu_register(&amd_l2_pmu, amd_l2_pmu.name, -1);
|
||||
ret = perf_pmu_register(&amd_llc_pmu, amd_llc_pmu.name, -1);
|
||||
if (ret)
|
||||
goto fail_l2;
|
||||
goto fail_llc;
|
||||
|
||||
pr_info("perf: AMD L2I counters detected\n");
|
||||
pr_info("perf: AMD LLC counters detected\n");
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
|
@ -529,7 +525,7 @@ static int __init amd_uncore_init(void)
|
|||
if (cpuhp_setup_state(CPUHP_PERF_X86_AMD_UNCORE_PREP,
|
||||
"PERF_X86_AMD_UNCORE_PREP",
|
||||
amd_uncore_cpu_up_prepare, amd_uncore_cpu_dead))
|
||||
goto fail_l2;
|
||||
goto fail_llc;
|
||||
|
||||
if (cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING,
|
||||
"AP_PERF_X86_AMD_UNCORE_STARTING",
|
||||
|
@ -546,11 +542,11 @@ fail_start:
|
|||
cpuhp_remove_state(CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING);
|
||||
fail_prep:
|
||||
cpuhp_remove_state(CPUHP_PERF_X86_AMD_UNCORE_PREP);
|
||||
fail_l2:
|
||||
fail_llc:
|
||||
if (boot_cpu_has(X86_FEATURE_PERFCTR_NB))
|
||||
perf_pmu_unregister(&amd_nb_pmu);
|
||||
if (amd_uncore_l2)
|
||||
free_percpu(amd_uncore_l2);
|
||||
if (amd_uncore_llc)
|
||||
free_percpu(amd_uncore_llc);
|
||||
fail_nb:
|
||||
if (amd_uncore_nb)
|
||||
free_percpu(amd_uncore_nb);
|
||||
|
|
|
@ -1205,7 +1205,7 @@ static ssize_t l1tf_show_state(char *buf)
|
|||
static ssize_t mds_show_state(char *buf)
|
||||
{
|
||||
#ifdef CONFIG_HYPERVISOR_GUEST
|
||||
if (x86_hyper) {
|
||||
if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
|
||||
return sprintf(buf, "%s; SMT Host state unknown\n",
|
||||
mds_strings[mds_mitigation]);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
# Generate the x86_cap/bug_flags[] arrays from include/asm/cpufeatures.h
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
IN=$1
|
||||
OUT=$2
|
||||
|
||||
|
|
|
@ -231,9 +231,55 @@ static const struct dmi_system_id efifb_dmi_system_table[] __initconst = {
|
|||
{},
|
||||
};
|
||||
|
||||
/*
|
||||
* Some devices have a portrait LCD but advertise a landscape resolution (and
|
||||
* pitch). We simply swap width and height for these devices so that we can
|
||||
* correctly deal with some of them coming with multiple resolutions.
|
||||
*/
|
||||
static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = {
|
||||
{
|
||||
/*
|
||||
* Lenovo MIIX310-10ICR, only some batches have the troublesome
|
||||
* 800x1280 portrait screen. Luckily the portrait version has
|
||||
* its own BIOS version, so we match on that.
|
||||
*/
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "MIIX 310-10ICR"),
|
||||
DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1HCN44WW"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Lenovo MIIX 320-10ICR with 800x1280 portrait screen */
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION,
|
||||
"Lenovo MIIX 320-10ICR"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Lenovo D330 with 800x1280 or 1200x1920 portrait screen */
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION,
|
||||
"Lenovo ideapad D330-10IGM"),
|
||||
},
|
||||
},
|
||||
{},
|
||||
};
|
||||
|
||||
__init void sysfb_apply_efi_quirks(void)
|
||||
{
|
||||
if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI ||
|
||||
!(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS))
|
||||
dmi_check_system(efifb_dmi_system_table);
|
||||
|
||||
if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI &&
|
||||
dmi_check_system(efifb_dmi_swap_width_height)) {
|
||||
u16 temp = screen_info.lfb_width;
|
||||
|
||||
screen_info.lfb_width = screen_info.lfb_height;
|
||||
screen_info.lfb_height = temp;
|
||||
screen_info.lfb_linelength = 4 * screen_info.lfb_width;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,8 +124,8 @@ static void pmc_reprogram_counter(struct kvm_pmc *pmc, u32 type,
|
|||
intr ? kvm_perf_overflow_intr :
|
||||
kvm_perf_overflow, pmc);
|
||||
if (IS_ERR(event)) {
|
||||
printk_once("kvm_pmu: event creation failed %ld\n",
|
||||
PTR_ERR(event));
|
||||
pr_debug_ratelimited("kvm_pmu: event creation failed %ld for pmc->idx = %d\n",
|
||||
PTR_ERR(event), pmc->idx);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/ptrace.h>
|
||||
#ifdef __i386__
|
||||
#include <sys/user.h>
|
||||
|
@ -26,17 +27,18 @@ int save_i387_registers(int pid, unsigned long *fp_regs)
|
|||
|
||||
int save_fp_registers(int pid, unsigned long *fp_regs)
|
||||
{
|
||||
#ifdef PTRACE_GETREGSET
|
||||
struct iovec iov;
|
||||
|
||||
if (have_xstate_support) {
|
||||
iov.iov_base = fp_regs;
|
||||
iov.iov_len = sizeof(struct _xstate);
|
||||
iov.iov_len = FP_SIZE * sizeof(unsigned long);
|
||||
if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
return save_i387_registers(pid, fp_regs);
|
||||
}
|
||||
}
|
||||
|
||||
int restore_i387_registers(int pid, unsigned long *fp_regs)
|
||||
|
@ -48,17 +50,17 @@ int restore_i387_registers(int pid, unsigned long *fp_regs)
|
|||
|
||||
int restore_fp_registers(int pid, unsigned long *fp_regs)
|
||||
{
|
||||
#ifdef PTRACE_SETREGSET
|
||||
struct iovec iov;
|
||||
|
||||
if (have_xstate_support) {
|
||||
iov.iov_base = fp_regs;
|
||||
iov.iov_len = sizeof(struct _xstate);
|
||||
iov.iov_len = FP_SIZE * sizeof(unsigned long);
|
||||
if (ptrace(PTRACE_SETREGSET, pid, NT_X86_XSTATE, &iov) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
return restore_i387_registers(pid, fp_regs);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __i386__
|
||||
|
@ -122,13 +124,21 @@ int put_fp_registers(int pid, unsigned long *regs)
|
|||
|
||||
void arch_init_registers(int pid)
|
||||
{
|
||||
struct _xstate fp_regs;
|
||||
#ifdef PTRACE_GETREGSET
|
||||
void * fp_regs;
|
||||
struct iovec iov;
|
||||
|
||||
iov.iov_base = &fp_regs;
|
||||
iov.iov_len = sizeof(struct _xstate);
|
||||
fp_regs = malloc(FP_SIZE * sizeof(unsigned long));
|
||||
if(fp_regs == NULL)
|
||||
return;
|
||||
|
||||
iov.iov_base = fp_regs;
|
||||
iov.iov_len = FP_SIZE * sizeof(unsigned long);
|
||||
if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) == 0)
|
||||
have_xstate_support = 1;
|
||||
|
||||
free(fp_regs);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -50,7 +50,11 @@ void foo(void)
|
|||
DEFINE(HOST_GS, GS);
|
||||
DEFINE(HOST_ORIG_AX, ORIG_EAX);
|
||||
#else
|
||||
DEFINE(HOST_FP_SIZE, sizeof(struct _xstate) / sizeof(unsigned long));
|
||||
#ifdef FP_XSTATE_MAGIC1
|
||||
DEFINE_LONGS(HOST_FP_SIZE, 2696);
|
||||
#else
|
||||
DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long));
|
||||
#endif
|
||||
DEFINE_LONGS(HOST_BX, RBX);
|
||||
DEFINE_LONGS(HOST_CX, RCX);
|
||||
DEFINE_LONGS(HOST_DI, RDI);
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <linux/cdrom.h>
|
||||
#include <linux/compat.h>
|
||||
#include <linux/elevator.h>
|
||||
#include <linux/fd.h>
|
||||
#include <linux/hdreg.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/syscalls.h>
|
||||
|
@ -209,318 +208,6 @@ static int compat_blkpg_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
#define BLKBSZSET_32 _IOW(0x12, 113, int)
|
||||
#define BLKGETSIZE64_32 _IOR(0x12, 114, int)
|
||||
|
||||
struct compat_floppy_drive_params {
|
||||
char cmos;
|
||||
compat_ulong_t max_dtr;
|
||||
compat_ulong_t hlt;
|
||||
compat_ulong_t hut;
|
||||
compat_ulong_t srt;
|
||||
compat_ulong_t spinup;
|
||||
compat_ulong_t spindown;
|
||||
unsigned char spindown_offset;
|
||||
unsigned char select_delay;
|
||||
unsigned char rps;
|
||||
unsigned char tracks;
|
||||
compat_ulong_t timeout;
|
||||
unsigned char interleave_sect;
|
||||
struct floppy_max_errors max_errors;
|
||||
char flags;
|
||||
char read_track;
|
||||
short autodetect[8];
|
||||
compat_int_t checkfreq;
|
||||
compat_int_t native_format;
|
||||
};
|
||||
|
||||
struct compat_floppy_drive_struct {
|
||||
signed char flags;
|
||||
compat_ulong_t spinup_date;
|
||||
compat_ulong_t select_date;
|
||||
compat_ulong_t first_read_date;
|
||||
short probed_format;
|
||||
short track;
|
||||
short maxblock;
|
||||
short maxtrack;
|
||||
compat_int_t generation;
|
||||
compat_int_t keep_data;
|
||||
compat_int_t fd_ref;
|
||||
compat_int_t fd_device;
|
||||
compat_int_t last_checked;
|
||||
compat_caddr_t dmabuf;
|
||||
compat_int_t bufblocks;
|
||||
};
|
||||
|
||||
struct compat_floppy_fdc_state {
|
||||
compat_int_t spec1;
|
||||
compat_int_t spec2;
|
||||
compat_int_t dtr;
|
||||
unsigned char version;
|
||||
unsigned char dor;
|
||||
compat_ulong_t address;
|
||||
unsigned int rawcmd:2;
|
||||
unsigned int reset:1;
|
||||
unsigned int need_configure:1;
|
||||
unsigned int perp_mode:2;
|
||||
unsigned int has_fifo:1;
|
||||
unsigned int driver_version;
|
||||
unsigned char track[4];
|
||||
};
|
||||
|
||||
struct compat_floppy_write_errors {
|
||||
unsigned int write_errors;
|
||||
compat_ulong_t first_error_sector;
|
||||
compat_int_t first_error_generation;
|
||||
compat_ulong_t last_error_sector;
|
||||
compat_int_t last_error_generation;
|
||||
compat_uint_t badness;
|
||||
};
|
||||
|
||||
#define FDSETPRM32 _IOW(2, 0x42, struct compat_floppy_struct)
|
||||
#define FDDEFPRM32 _IOW(2, 0x43, struct compat_floppy_struct)
|
||||
#define FDSETDRVPRM32 _IOW(2, 0x90, struct compat_floppy_drive_params)
|
||||
#define FDGETDRVPRM32 _IOR(2, 0x11, struct compat_floppy_drive_params)
|
||||
#define FDGETDRVSTAT32 _IOR(2, 0x12, struct compat_floppy_drive_struct)
|
||||
#define FDPOLLDRVSTAT32 _IOR(2, 0x13, struct compat_floppy_drive_struct)
|
||||
#define FDGETFDCSTAT32 _IOR(2, 0x15, struct compat_floppy_fdc_state)
|
||||
#define FDWERRORGET32 _IOR(2, 0x17, struct compat_floppy_write_errors)
|
||||
|
||||
static struct {
|
||||
unsigned int cmd32;
|
||||
unsigned int cmd;
|
||||
} fd_ioctl_trans_table[] = {
|
||||
{ FDSETPRM32, FDSETPRM },
|
||||
{ FDDEFPRM32, FDDEFPRM },
|
||||
{ FDGETPRM32, FDGETPRM },
|
||||
{ FDSETDRVPRM32, FDSETDRVPRM },
|
||||
{ FDGETDRVPRM32, FDGETDRVPRM },
|
||||
{ FDGETDRVSTAT32, FDGETDRVSTAT },
|
||||
{ FDPOLLDRVSTAT32, FDPOLLDRVSTAT },
|
||||
{ FDGETFDCSTAT32, FDGETFDCSTAT },
|
||||
{ FDWERRORGET32, FDWERRORGET }
|
||||
};
|
||||
|
||||
#define NR_FD_IOCTL_TRANS ARRAY_SIZE(fd_ioctl_trans_table)
|
||||
|
||||
static int compat_fd_ioctl(struct block_device *bdev, fmode_t mode,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
mm_segment_t old_fs = get_fs();
|
||||
void *karg = NULL;
|
||||
unsigned int kcmd = 0;
|
||||
int i, err;
|
||||
|
||||
for (i = 0; i < NR_FD_IOCTL_TRANS; i++)
|
||||
if (cmd == fd_ioctl_trans_table[i].cmd32) {
|
||||
kcmd = fd_ioctl_trans_table[i].cmd;
|
||||
break;
|
||||
}
|
||||
if (!kcmd)
|
||||
return -EINVAL;
|
||||
|
||||
switch (cmd) {
|
||||
case FDSETPRM32:
|
||||
case FDDEFPRM32:
|
||||
case FDGETPRM32:
|
||||
{
|
||||
compat_uptr_t name;
|
||||
struct compat_floppy_struct __user *uf;
|
||||
struct floppy_struct *f;
|
||||
|
||||
uf = compat_ptr(arg);
|
||||
f = karg = kmalloc(sizeof(struct floppy_struct), GFP_KERNEL);
|
||||
if (!karg)
|
||||
return -ENOMEM;
|
||||
if (cmd == FDGETPRM32)
|
||||
break;
|
||||
err = __get_user(f->size, &uf->size);
|
||||
err |= __get_user(f->sect, &uf->sect);
|
||||
err |= __get_user(f->head, &uf->head);
|
||||
err |= __get_user(f->track, &uf->track);
|
||||
err |= __get_user(f->stretch, &uf->stretch);
|
||||
err |= __get_user(f->gap, &uf->gap);
|
||||
err |= __get_user(f->rate, &uf->rate);
|
||||
err |= __get_user(f->spec1, &uf->spec1);
|
||||
err |= __get_user(f->fmt_gap, &uf->fmt_gap);
|
||||
err |= __get_user(name, &uf->name);
|
||||
f->name = compat_ptr(name);
|
||||
if (err) {
|
||||
err = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FDSETDRVPRM32:
|
||||
case FDGETDRVPRM32:
|
||||
{
|
||||
struct compat_floppy_drive_params __user *uf;
|
||||
struct floppy_drive_params *f;
|
||||
|
||||
uf = compat_ptr(arg);
|
||||
f = karg = kmalloc(sizeof(struct floppy_drive_params), GFP_KERNEL);
|
||||
if (!karg)
|
||||
return -ENOMEM;
|
||||
if (cmd == FDGETDRVPRM32)
|
||||
break;
|
||||
err = __get_user(f->cmos, &uf->cmos);
|
||||
err |= __get_user(f->max_dtr, &uf->max_dtr);
|
||||
err |= __get_user(f->hlt, &uf->hlt);
|
||||
err |= __get_user(f->hut, &uf->hut);
|
||||
err |= __get_user(f->srt, &uf->srt);
|
||||
err |= __get_user(f->spinup, &uf->spinup);
|
||||
err |= __get_user(f->spindown, &uf->spindown);
|
||||
err |= __get_user(f->spindown_offset, &uf->spindown_offset);
|
||||
err |= __get_user(f->select_delay, &uf->select_delay);
|
||||
err |= __get_user(f->rps, &uf->rps);
|
||||
err |= __get_user(f->tracks, &uf->tracks);
|
||||
err |= __get_user(f->timeout, &uf->timeout);
|
||||
err |= __get_user(f->interleave_sect, &uf->interleave_sect);
|
||||
err |= __copy_from_user(&f->max_errors, &uf->max_errors, sizeof(f->max_errors));
|
||||
err |= __get_user(f->flags, &uf->flags);
|
||||
err |= __get_user(f->read_track, &uf->read_track);
|
||||
err |= __copy_from_user(f->autodetect, uf->autodetect, sizeof(f->autodetect));
|
||||
err |= __get_user(f->checkfreq, &uf->checkfreq);
|
||||
err |= __get_user(f->native_format, &uf->native_format);
|
||||
if (err) {
|
||||
err = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FDGETDRVSTAT32:
|
||||
case FDPOLLDRVSTAT32:
|
||||
karg = kmalloc(sizeof(struct floppy_drive_struct), GFP_KERNEL);
|
||||
if (!karg)
|
||||
return -ENOMEM;
|
||||
break;
|
||||
case FDGETFDCSTAT32:
|
||||
karg = kmalloc(sizeof(struct floppy_fdc_state), GFP_KERNEL);
|
||||
if (!karg)
|
||||
return -ENOMEM;
|
||||
break;
|
||||
case FDWERRORGET32:
|
||||
karg = kmalloc(sizeof(struct floppy_write_errors), GFP_KERNEL);
|
||||
if (!karg)
|
||||
return -ENOMEM;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
set_fs(KERNEL_DS);
|
||||
err = __blkdev_driver_ioctl(bdev, mode, kcmd, (unsigned long)karg);
|
||||
set_fs(old_fs);
|
||||
if (err)
|
||||
goto out;
|
||||
switch (cmd) {
|
||||
case FDGETPRM32:
|
||||
{
|
||||
struct floppy_struct *f = karg;
|
||||
struct compat_floppy_struct __user *uf = compat_ptr(arg);
|
||||
|
||||
err = __put_user(f->size, &uf->size);
|
||||
err |= __put_user(f->sect, &uf->sect);
|
||||
err |= __put_user(f->head, &uf->head);
|
||||
err |= __put_user(f->track, &uf->track);
|
||||
err |= __put_user(f->stretch, &uf->stretch);
|
||||
err |= __put_user(f->gap, &uf->gap);
|
||||
err |= __put_user(f->rate, &uf->rate);
|
||||
err |= __put_user(f->spec1, &uf->spec1);
|
||||
err |= __put_user(f->fmt_gap, &uf->fmt_gap);
|
||||
err |= __put_user((u64)f->name, (compat_caddr_t __user *)&uf->name);
|
||||
break;
|
||||
}
|
||||
case FDGETDRVPRM32:
|
||||
{
|
||||
struct compat_floppy_drive_params __user *uf;
|
||||
struct floppy_drive_params *f = karg;
|
||||
|
||||
uf = compat_ptr(arg);
|
||||
err = __put_user(f->cmos, &uf->cmos);
|
||||
err |= __put_user(f->max_dtr, &uf->max_dtr);
|
||||
err |= __put_user(f->hlt, &uf->hlt);
|
||||
err |= __put_user(f->hut, &uf->hut);
|
||||
err |= __put_user(f->srt, &uf->srt);
|
||||
err |= __put_user(f->spinup, &uf->spinup);
|
||||
err |= __put_user(f->spindown, &uf->spindown);
|
||||
err |= __put_user(f->spindown_offset, &uf->spindown_offset);
|
||||
err |= __put_user(f->select_delay, &uf->select_delay);
|
||||
err |= __put_user(f->rps, &uf->rps);
|
||||
err |= __put_user(f->tracks, &uf->tracks);
|
||||
err |= __put_user(f->timeout, &uf->timeout);
|
||||
err |= __put_user(f->interleave_sect, &uf->interleave_sect);
|
||||
err |= __copy_to_user(&uf->max_errors, &f->max_errors, sizeof(f->max_errors));
|
||||
err |= __put_user(f->flags, &uf->flags);
|
||||
err |= __put_user(f->read_track, &uf->read_track);
|
||||
err |= __copy_to_user(uf->autodetect, f->autodetect, sizeof(f->autodetect));
|
||||
err |= __put_user(f->checkfreq, &uf->checkfreq);
|
||||
err |= __put_user(f->native_format, &uf->native_format);
|
||||
break;
|
||||
}
|
||||
case FDGETDRVSTAT32:
|
||||
case FDPOLLDRVSTAT32:
|
||||
{
|
||||
struct compat_floppy_drive_struct __user *uf;
|
||||
struct floppy_drive_struct *f = karg;
|
||||
|
||||
uf = compat_ptr(arg);
|
||||
err = __put_user(f->flags, &uf->flags);
|
||||
err |= __put_user(f->spinup_date, &uf->spinup_date);
|
||||
err |= __put_user(f->select_date, &uf->select_date);
|
||||
err |= __put_user(f->first_read_date, &uf->first_read_date);
|
||||
err |= __put_user(f->probed_format, &uf->probed_format);
|
||||
err |= __put_user(f->track, &uf->track);
|
||||
err |= __put_user(f->maxblock, &uf->maxblock);
|
||||
err |= __put_user(f->maxtrack, &uf->maxtrack);
|
||||
err |= __put_user(f->generation, &uf->generation);
|
||||
err |= __put_user(f->keep_data, &uf->keep_data);
|
||||
err |= __put_user(f->fd_ref, &uf->fd_ref);
|
||||
err |= __put_user(f->fd_device, &uf->fd_device);
|
||||
err |= __put_user(f->last_checked, &uf->last_checked);
|
||||
err |= __put_user((u64)f->dmabuf, &uf->dmabuf);
|
||||
err |= __put_user((u64)f->bufblocks, &uf->bufblocks);
|
||||
break;
|
||||
}
|
||||
case FDGETFDCSTAT32:
|
||||
{
|
||||
struct compat_floppy_fdc_state __user *uf;
|
||||
struct floppy_fdc_state *f = karg;
|
||||
|
||||
uf = compat_ptr(arg);
|
||||
err = __put_user(f->spec1, &uf->spec1);
|
||||
err |= __put_user(f->spec2, &uf->spec2);
|
||||
err |= __put_user(f->dtr, &uf->dtr);
|
||||
err |= __put_user(f->version, &uf->version);
|
||||
err |= __put_user(f->dor, &uf->dor);
|
||||
err |= __put_user(f->address, &uf->address);
|
||||
err |= __copy_to_user((char __user *)&uf->address + sizeof(uf->address),
|
||||
(char *)&f->address + sizeof(f->address), sizeof(int));
|
||||
err |= __put_user(f->driver_version, &uf->driver_version);
|
||||
err |= __copy_to_user(uf->track, f->track, sizeof(f->track));
|
||||
break;
|
||||
}
|
||||
case FDWERRORGET32:
|
||||
{
|
||||
struct compat_floppy_write_errors __user *uf;
|
||||
struct floppy_write_errors *f = karg;
|
||||
|
||||
uf = compat_ptr(arg);
|
||||
err = __put_user(f->write_errors, &uf->write_errors);
|
||||
err |= __put_user(f->first_error_sector, &uf->first_error_sector);
|
||||
err |= __put_user(f->first_error_generation, &uf->first_error_generation);
|
||||
err |= __put_user(f->last_error_sector, &uf->last_error_sector);
|
||||
err |= __put_user(f->last_error_generation, &uf->last_error_generation);
|
||||
err |= __put_user(f->badness, &uf->badness);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (err)
|
||||
err = -EFAULT;
|
||||
|
||||
out:
|
||||
kfree(karg);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int compat_blkdev_driver_ioctl(struct block_device *bdev, fmode_t mode,
|
||||
unsigned cmd, unsigned long arg)
|
||||
{
|
||||
|
@ -537,16 +224,6 @@ static int compat_blkdev_driver_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
case HDIO_GET_ADDRESS:
|
||||
case HDIO_GET_BUSSTATE:
|
||||
return compat_hdio_ioctl(bdev, mode, cmd, arg);
|
||||
case FDSETPRM32:
|
||||
case FDDEFPRM32:
|
||||
case FDGETPRM32:
|
||||
case FDSETDRVPRM32:
|
||||
case FDGETDRVPRM32:
|
||||
case FDGETDRVSTAT32:
|
||||
case FDPOLLDRVSTAT32:
|
||||
case FDGETFDCSTAT32:
|
||||
case FDWERRORGET32:
|
||||
return compat_fd_ioctl(bdev, mode, cmd, arg);
|
||||
case CDROMREADAUDIO:
|
||||
return compat_cdrom_read_audio(bdev, mode, cmd, arg);
|
||||
case CDROM_SEND_PACKET:
|
||||
|
@ -566,23 +243,6 @@ static int compat_blkdev_driver_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
case HDIO_DRIVE_CMD:
|
||||
/* 0x330 is reserved -- it used to be HDIO_GETGEO_BIG */
|
||||
case 0x330:
|
||||
/* 0x02 -- Floppy ioctls */
|
||||
case FDMSGON:
|
||||
case FDMSGOFF:
|
||||
case FDSETEMSGTRESH:
|
||||
case FDFLUSH:
|
||||
case FDWERRORCLR:
|
||||
case FDSETMAXERRS:
|
||||
case FDGETMAXERRS:
|
||||
case FDGETDRVTYP:
|
||||
case FDEJECT:
|
||||
case FDCLRPRM:
|
||||
case FDFMTBEG:
|
||||
case FDFMTEND:
|
||||
case FDRESET:
|
||||
case FDTWADDLE:
|
||||
case FDFMTTRK:
|
||||
case FDRAWCMD:
|
||||
/* CDROM stuff */
|
||||
case CDROMPAUSE:
|
||||
case CDROMRESUME:
|
||||
|
|
|
@ -14,6 +14,7 @@ config ASYMMETRIC_PUBLIC_KEY_SUBTYPE
|
|||
select MPILIB
|
||||
select CRYPTO_HASH_INFO
|
||||
select CRYPTO_AKCIPHER
|
||||
select CRYPTO_HASH
|
||||
help
|
||||
This option provides support for asymmetric public key type handling.
|
||||
If signature generation and/or verification are to be used,
|
||||
|
@ -33,6 +34,7 @@ config X509_CERTIFICATE_PARSER
|
|||
config PKCS7_MESSAGE_PARSER
|
||||
tristate "PKCS#7 message parser"
|
||||
depends on X509_CERTIFICATE_PARSER
|
||||
select CRYPTO_HASH
|
||||
select ASN1
|
||||
select OID_REGISTRY
|
||||
help
|
||||
|
@ -55,6 +57,7 @@ config SIGNED_PE_FILE_VERIFICATION
|
|||
bool "Support for PE file signature verification"
|
||||
depends on PKCS7_MESSAGE_PARSER=y
|
||||
depends on SYSTEM_DATA_VERIFICATION
|
||||
select CRYPTO_HASH
|
||||
select ASN1
|
||||
select OID_REGISTRY
|
||||
help
|
||||
|
|
|
@ -67,6 +67,8 @@ struct chachapoly_req_ctx {
|
|||
unsigned int cryptlen;
|
||||
/* Actual AD, excluding IV */
|
||||
unsigned int assoclen;
|
||||
/* request flags, with MAY_SLEEP cleared if needed */
|
||||
u32 flags;
|
||||
union {
|
||||
struct poly_req poly;
|
||||
struct chacha_req chacha;
|
||||
|
@ -76,8 +78,12 @@ struct chachapoly_req_ctx {
|
|||
static inline void async_done_continue(struct aead_request *req, int err,
|
||||
int (*cont)(struct aead_request *))
|
||||
{
|
||||
if (!err)
|
||||
if (!err) {
|
||||
struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
|
||||
|
||||
rctx->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
|
||||
err = cont(req);
|
||||
}
|
||||
|
||||
if (err != -EINPROGRESS && err != -EBUSY)
|
||||
aead_request_complete(req, err);
|
||||
|
@ -144,7 +150,7 @@ static int chacha_decrypt(struct aead_request *req)
|
|||
dst = scatterwalk_ffwd(rctx->dst, req->dst, req->assoclen);
|
||||
}
|
||||
|
||||
skcipher_request_set_callback(&creq->req, aead_request_flags(req),
|
||||
skcipher_request_set_callback(&creq->req, rctx->flags,
|
||||
chacha_decrypt_done, req);
|
||||
skcipher_request_set_tfm(&creq->req, ctx->chacha);
|
||||
skcipher_request_set_crypt(&creq->req, src, dst,
|
||||
|
@ -188,7 +194,7 @@ static int poly_tail(struct aead_request *req)
|
|||
memcpy(&preq->tail.cryptlen, &len, sizeof(len));
|
||||
sg_set_buf(preq->src, &preq->tail, sizeof(preq->tail));
|
||||
|
||||
ahash_request_set_callback(&preq->req, aead_request_flags(req),
|
||||
ahash_request_set_callback(&preq->req, rctx->flags,
|
||||
poly_tail_done, req);
|
||||
ahash_request_set_tfm(&preq->req, ctx->poly);
|
||||
ahash_request_set_crypt(&preq->req, preq->src,
|
||||
|
@ -219,7 +225,7 @@ static int poly_cipherpad(struct aead_request *req)
|
|||
sg_init_table(preq->src, 1);
|
||||
sg_set_buf(preq->src, &preq->pad, padlen);
|
||||
|
||||
ahash_request_set_callback(&preq->req, aead_request_flags(req),
|
||||
ahash_request_set_callback(&preq->req, rctx->flags,
|
||||
poly_cipherpad_done, req);
|
||||
ahash_request_set_tfm(&preq->req, ctx->poly);
|
||||
ahash_request_set_crypt(&preq->req, preq->src, NULL, padlen);
|
||||
|
@ -250,7 +256,7 @@ static int poly_cipher(struct aead_request *req)
|
|||
sg_init_table(rctx->src, 2);
|
||||
crypt = scatterwalk_ffwd(rctx->src, crypt, req->assoclen);
|
||||
|
||||
ahash_request_set_callback(&preq->req, aead_request_flags(req),
|
||||
ahash_request_set_callback(&preq->req, rctx->flags,
|
||||
poly_cipher_done, req);
|
||||
ahash_request_set_tfm(&preq->req, ctx->poly);
|
||||
ahash_request_set_crypt(&preq->req, crypt, NULL, rctx->cryptlen);
|
||||
|
@ -280,7 +286,7 @@ static int poly_adpad(struct aead_request *req)
|
|||
sg_init_table(preq->src, 1);
|
||||
sg_set_buf(preq->src, preq->pad, padlen);
|
||||
|
||||
ahash_request_set_callback(&preq->req, aead_request_flags(req),
|
||||
ahash_request_set_callback(&preq->req, rctx->flags,
|
||||
poly_adpad_done, req);
|
||||
ahash_request_set_tfm(&preq->req, ctx->poly);
|
||||
ahash_request_set_crypt(&preq->req, preq->src, NULL, padlen);
|
||||
|
@ -304,7 +310,7 @@ static int poly_ad(struct aead_request *req)
|
|||
struct poly_req *preq = &rctx->u.poly;
|
||||
int err;
|
||||
|
||||
ahash_request_set_callback(&preq->req, aead_request_flags(req),
|
||||
ahash_request_set_callback(&preq->req, rctx->flags,
|
||||
poly_ad_done, req);
|
||||
ahash_request_set_tfm(&preq->req, ctx->poly);
|
||||
ahash_request_set_crypt(&preq->req, req->src, NULL, rctx->assoclen);
|
||||
|
@ -331,7 +337,7 @@ static int poly_setkey(struct aead_request *req)
|
|||
sg_init_table(preq->src, 1);
|
||||
sg_set_buf(preq->src, rctx->key, sizeof(rctx->key));
|
||||
|
||||
ahash_request_set_callback(&preq->req, aead_request_flags(req),
|
||||
ahash_request_set_callback(&preq->req, rctx->flags,
|
||||
poly_setkey_done, req);
|
||||
ahash_request_set_tfm(&preq->req, ctx->poly);
|
||||
ahash_request_set_crypt(&preq->req, preq->src, NULL, sizeof(rctx->key));
|
||||
|
@ -355,7 +361,7 @@ static int poly_init(struct aead_request *req)
|
|||
struct poly_req *preq = &rctx->u.poly;
|
||||
int err;
|
||||
|
||||
ahash_request_set_callback(&preq->req, aead_request_flags(req),
|
||||
ahash_request_set_callback(&preq->req, rctx->flags,
|
||||
poly_init_done, req);
|
||||
ahash_request_set_tfm(&preq->req, ctx->poly);
|
||||
|
||||
|
@ -393,7 +399,7 @@ static int poly_genkey(struct aead_request *req)
|
|||
|
||||
chacha_iv(creq->iv, req, 0);
|
||||
|
||||
skcipher_request_set_callback(&creq->req, aead_request_flags(req),
|
||||
skcipher_request_set_callback(&creq->req, rctx->flags,
|
||||
poly_genkey_done, req);
|
||||
skcipher_request_set_tfm(&creq->req, ctx->chacha);
|
||||
skcipher_request_set_crypt(&creq->req, creq->src, creq->src,
|
||||
|
@ -433,7 +439,7 @@ static int chacha_encrypt(struct aead_request *req)
|
|||
dst = scatterwalk_ffwd(rctx->dst, req->dst, req->assoclen);
|
||||
}
|
||||
|
||||
skcipher_request_set_callback(&creq->req, aead_request_flags(req),
|
||||
skcipher_request_set_callback(&creq->req, rctx->flags,
|
||||
chacha_encrypt_done, req);
|
||||
skcipher_request_set_tfm(&creq->req, ctx->chacha);
|
||||
skcipher_request_set_crypt(&creq->req, src, dst,
|
||||
|
@ -451,6 +457,7 @@ static int chachapoly_encrypt(struct aead_request *req)
|
|||
struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
|
||||
|
||||
rctx->cryptlen = req->cryptlen;
|
||||
rctx->flags = aead_request_flags(req);
|
||||
|
||||
/* encrypt call chain:
|
||||
* - chacha_encrypt/done()
|
||||
|
@ -472,6 +479,7 @@ static int chachapoly_decrypt(struct aead_request *req)
|
|||
struct chachapoly_req_ctx *rctx = aead_request_ctx(req);
|
||||
|
||||
rctx->cryptlen = req->cryptlen - POLY1305_DIGEST_SIZE;
|
||||
rctx->flags = aead_request_flags(req);
|
||||
|
||||
/* decrypt call chain:
|
||||
* - poly_genkey/done()
|
||||
|
|
|
@ -34,6 +34,7 @@ static int ghash_setkey(struct crypto_shash *tfm,
|
|||
const u8 *key, unsigned int keylen)
|
||||
{
|
||||
struct ghash_ctx *ctx = crypto_shash_ctx(tfm);
|
||||
be128 k;
|
||||
|
||||
if (keylen != GHASH_BLOCK_SIZE) {
|
||||
crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
|
@ -42,7 +43,12 @@ static int ghash_setkey(struct crypto_shash *tfm,
|
|||
|
||||
if (ctx->gf128)
|
||||
gf128mul_free_4k(ctx->gf128);
|
||||
ctx->gf128 = gf128mul_init_4k_lle((be128 *)key);
|
||||
|
||||
BUILD_BUG_ON(sizeof(k) != GHASH_BLOCK_SIZE);
|
||||
memcpy(&k, key, GHASH_BLOCK_SIZE); /* avoid violating alignment rules */
|
||||
ctx->gf128 = gf128mul_init_4k_lle(&k);
|
||||
memzero_explicit(&k, GHASH_BLOCK_SIZE);
|
||||
|
||||
if (!ctx->gf128)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
@ -1600,7 +1600,7 @@ static int ata_eh_read_log_10h(struct ata_device *dev,
|
|||
tf->hob_lbah = buf[10];
|
||||
tf->nsect = buf[12];
|
||||
tf->hob_nsect = buf[13];
|
||||
if (ata_id_has_ncq_autosense(dev->id))
|
||||
if (dev->class == ATA_DEV_ZAC && ata_id_has_ncq_autosense(dev->id))
|
||||
tf->auxiliary = buf[14] << 16 | buf[15] << 8 | buf[16];
|
||||
|
||||
return 0;
|
||||
|
@ -1849,7 +1849,8 @@ void ata_eh_analyze_ncq_error(struct ata_link *link)
|
|||
memcpy(&qc->result_tf, &tf, sizeof(tf));
|
||||
qc->result_tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_LBA | ATA_TFLAG_LBA48;
|
||||
qc->err_mask |= AC_ERR_DEV | AC_ERR_NCQ;
|
||||
if ((qc->result_tf.command & ATA_SENSE) || qc->result_tf.auxiliary) {
|
||||
if (dev->class == ATA_DEV_ZAC &&
|
||||
((qc->result_tf.command & ATA_SENSE) || qc->result_tf.auxiliary)) {
|
||||
char sense_key, asc, ascq;
|
||||
|
||||
sense_key = (qc->result_tf.auxiliary >> 16) & 0xff;
|
||||
|
@ -1903,10 +1904,11 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
|
|||
}
|
||||
|
||||
switch (qc->dev->class) {
|
||||
case ATA_DEV_ATA:
|
||||
case ATA_DEV_ZAC:
|
||||
if (stat & ATA_SENSE)
|
||||
ata_eh_request_sense(qc, qc->scsicmd);
|
||||
/* fall through */
|
||||
case ATA_DEV_ATA:
|
||||
if (err & ATA_ICRC)
|
||||
qc->err_mask |= AC_ERR_ATA_BUS;
|
||||
if (err & (ATA_UNC | ATA_AMNF))
|
||||
|
|
|
@ -1506,6 +1506,8 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg,
|
|||
map->format.reg_bytes +
|
||||
map->format.pad_bytes,
|
||||
val, val_len);
|
||||
else
|
||||
ret = -ENOTSUPP;
|
||||
|
||||
/* If that didn't work fall back on linearising by hand. */
|
||||
if (ret == -ENOTSUPP) {
|
||||
|
|
|
@ -192,6 +192,7 @@ static int print_unex = 1;
|
|||
#include <linux/io.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/async.h>
|
||||
#include <linux/compat.h>
|
||||
|
||||
/*
|
||||
* PS/2 floppies have much slower step rates than regular floppies.
|
||||
|
@ -2113,6 +2114,9 @@ static void setup_format_params(int track)
|
|||
raw_cmd->kernel_data = floppy_track_buffer;
|
||||
raw_cmd->length = 4 * F_SECT_PER_TRACK;
|
||||
|
||||
if (!F_SECT_PER_TRACK)
|
||||
return;
|
||||
|
||||
/* allow for about 30ms for data transport per track */
|
||||
head_shift = (F_SECT_PER_TRACK + 5) / 6;
|
||||
|
||||
|
@ -3233,8 +3237,12 @@ static int set_geometry(unsigned int cmd, struct floppy_struct *g,
|
|||
int cnt;
|
||||
|
||||
/* sanity checking for parameters. */
|
||||
if (g->sect <= 0 ||
|
||||
g->head <= 0 ||
|
||||
if ((int)g->sect <= 0 ||
|
||||
(int)g->head <= 0 ||
|
||||
/* check for overflow in max_sector */
|
||||
(int)(g->sect * g->head) <= 0 ||
|
||||
/* check for zero in F_SECT_PER_TRACK */
|
||||
(unsigned char)((g->sect << 2) >> FD_SIZECODE(g)) == 0 ||
|
||||
g->track <= 0 || g->track > UDP->tracks >> STRETCH(g) ||
|
||||
/* check if reserved bits are set */
|
||||
(g->stretch & ~(FD_STRETCH | FD_SWAPSIDES | FD_SECTBASEMASK)) != 0)
|
||||
|
@ -3378,6 +3386,24 @@ static int fd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static bool valid_floppy_drive_params(const short autodetect[8],
|
||||
int native_format)
|
||||
{
|
||||
size_t floppy_type_size = ARRAY_SIZE(floppy_type);
|
||||
size_t i = 0;
|
||||
|
||||
for (i = 0; i < 8; ++i) {
|
||||
if (autodetect[i] < 0 ||
|
||||
autodetect[i] >= floppy_type_size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (native_format < 0 || native_format >= floppy_type_size)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
|
||||
unsigned long param)
|
||||
{
|
||||
|
@ -3504,6 +3530,9 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
|
|||
SUPBOUND(size, strlen((const char *)outparam) + 1);
|
||||
break;
|
||||
case FDSETDRVPRM:
|
||||
if (!valid_floppy_drive_params(inparam.dp.autodetect,
|
||||
inparam.dp.native_format))
|
||||
return -EINVAL;
|
||||
*UDP = inparam.dp;
|
||||
break;
|
||||
case FDGETDRVPRM:
|
||||
|
@ -3569,6 +3598,332 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
|
||||
struct compat_floppy_drive_params {
|
||||
char cmos;
|
||||
compat_ulong_t max_dtr;
|
||||
compat_ulong_t hlt;
|
||||
compat_ulong_t hut;
|
||||
compat_ulong_t srt;
|
||||
compat_ulong_t spinup;
|
||||
compat_ulong_t spindown;
|
||||
unsigned char spindown_offset;
|
||||
unsigned char select_delay;
|
||||
unsigned char rps;
|
||||
unsigned char tracks;
|
||||
compat_ulong_t timeout;
|
||||
unsigned char interleave_sect;
|
||||
struct floppy_max_errors max_errors;
|
||||
char flags;
|
||||
char read_track;
|
||||
short autodetect[8];
|
||||
compat_int_t checkfreq;
|
||||
compat_int_t native_format;
|
||||
};
|
||||
|
||||
struct compat_floppy_drive_struct {
|
||||
signed char flags;
|
||||
compat_ulong_t spinup_date;
|
||||
compat_ulong_t select_date;
|
||||
compat_ulong_t first_read_date;
|
||||
short probed_format;
|
||||
short track;
|
||||
short maxblock;
|
||||
short maxtrack;
|
||||
compat_int_t generation;
|
||||
compat_int_t keep_data;
|
||||
compat_int_t fd_ref;
|
||||
compat_int_t fd_device;
|
||||
compat_int_t last_checked;
|
||||
compat_caddr_t dmabuf;
|
||||
compat_int_t bufblocks;
|
||||
};
|
||||
|
||||
struct compat_floppy_fdc_state {
|
||||
compat_int_t spec1;
|
||||
compat_int_t spec2;
|
||||
compat_int_t dtr;
|
||||
unsigned char version;
|
||||
unsigned char dor;
|
||||
compat_ulong_t address;
|
||||
unsigned int rawcmd:2;
|
||||
unsigned int reset:1;
|
||||
unsigned int need_configure:1;
|
||||
unsigned int perp_mode:2;
|
||||
unsigned int has_fifo:1;
|
||||
unsigned int driver_version;
|
||||
unsigned char track[4];
|
||||
};
|
||||
|
||||
struct compat_floppy_write_errors {
|
||||
unsigned int write_errors;
|
||||
compat_ulong_t first_error_sector;
|
||||
compat_int_t first_error_generation;
|
||||
compat_ulong_t last_error_sector;
|
||||
compat_int_t last_error_generation;
|
||||
compat_uint_t badness;
|
||||
};
|
||||
|
||||
#define FDSETPRM32 _IOW(2, 0x42, struct compat_floppy_struct)
|
||||
#define FDDEFPRM32 _IOW(2, 0x43, struct compat_floppy_struct)
|
||||
#define FDSETDRVPRM32 _IOW(2, 0x90, struct compat_floppy_drive_params)
|
||||
#define FDGETDRVPRM32 _IOR(2, 0x11, struct compat_floppy_drive_params)
|
||||
#define FDGETDRVSTAT32 _IOR(2, 0x12, struct compat_floppy_drive_struct)
|
||||
#define FDPOLLDRVSTAT32 _IOR(2, 0x13, struct compat_floppy_drive_struct)
|
||||
#define FDGETFDCSTAT32 _IOR(2, 0x15, struct compat_floppy_fdc_state)
|
||||
#define FDWERRORGET32 _IOR(2, 0x17, struct compat_floppy_write_errors)
|
||||
|
||||
static int compat_set_geometry(struct block_device *bdev, fmode_t mode, unsigned int cmd,
|
||||
struct compat_floppy_struct __user *arg)
|
||||
{
|
||||
struct floppy_struct v;
|
||||
int drive, type;
|
||||
int err;
|
||||
|
||||
BUILD_BUG_ON(offsetof(struct floppy_struct, name) !=
|
||||
offsetof(struct compat_floppy_struct, name));
|
||||
|
||||
if (!(mode & (FMODE_WRITE | FMODE_WRITE_IOCTL)))
|
||||
return -EPERM;
|
||||
|
||||
memset(&v, 0, sizeof(struct floppy_struct));
|
||||
if (copy_from_user(&v, arg, offsetof(struct floppy_struct, name)))
|
||||
return -EFAULT;
|
||||
|
||||
mutex_lock(&floppy_mutex);
|
||||
drive = (long)bdev->bd_disk->private_data;
|
||||
type = ITYPE(UDRS->fd_device);
|
||||
err = set_geometry(cmd == FDSETPRM32 ? FDSETPRM : FDDEFPRM,
|
||||
&v, drive, type, bdev);
|
||||
mutex_unlock(&floppy_mutex);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int compat_get_prm(int drive,
|
||||
struct compat_floppy_struct __user *arg)
|
||||
{
|
||||
struct compat_floppy_struct v;
|
||||
struct floppy_struct *p;
|
||||
int err;
|
||||
|
||||
memset(&v, 0, sizeof(v));
|
||||
mutex_lock(&floppy_mutex);
|
||||
err = get_floppy_geometry(drive, ITYPE(UDRS->fd_device), &p);
|
||||
if (err) {
|
||||
mutex_unlock(&floppy_mutex);
|
||||
return err;
|
||||
}
|
||||
memcpy(&v, p, offsetof(struct floppy_struct, name));
|
||||
mutex_unlock(&floppy_mutex);
|
||||
if (copy_to_user(arg, &v, sizeof(struct compat_floppy_struct)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int compat_setdrvprm(int drive,
|
||||
struct compat_floppy_drive_params __user *arg)
|
||||
{
|
||||
struct compat_floppy_drive_params v;
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
if (copy_from_user(&v, arg, sizeof(struct compat_floppy_drive_params)))
|
||||
return -EFAULT;
|
||||
if (!valid_floppy_drive_params(v.autodetect, v.native_format))
|
||||
return -EINVAL;
|
||||
mutex_lock(&floppy_mutex);
|
||||
UDP->cmos = v.cmos;
|
||||
UDP->max_dtr = v.max_dtr;
|
||||
UDP->hlt = v.hlt;
|
||||
UDP->hut = v.hut;
|
||||
UDP->srt = v.srt;
|
||||
UDP->spinup = v.spinup;
|
||||
UDP->spindown = v.spindown;
|
||||
UDP->spindown_offset = v.spindown_offset;
|
||||
UDP->select_delay = v.select_delay;
|
||||
UDP->rps = v.rps;
|
||||
UDP->tracks = v.tracks;
|
||||
UDP->timeout = v.timeout;
|
||||
UDP->interleave_sect = v.interleave_sect;
|
||||
UDP->max_errors = v.max_errors;
|
||||
UDP->flags = v.flags;
|
||||
UDP->read_track = v.read_track;
|
||||
memcpy(UDP->autodetect, v.autodetect, sizeof(v.autodetect));
|
||||
UDP->checkfreq = v.checkfreq;
|
||||
UDP->native_format = v.native_format;
|
||||
mutex_unlock(&floppy_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int compat_getdrvprm(int drive,
|
||||
struct compat_floppy_drive_params __user *arg)
|
||||
{
|
||||
struct compat_floppy_drive_params v;
|
||||
|
||||
memset(&v, 0, sizeof(struct compat_floppy_drive_params));
|
||||
mutex_lock(&floppy_mutex);
|
||||
v.cmos = UDP->cmos;
|
||||
v.max_dtr = UDP->max_dtr;
|
||||
v.hlt = UDP->hlt;
|
||||
v.hut = UDP->hut;
|
||||
v.srt = UDP->srt;
|
||||
v.spinup = UDP->spinup;
|
||||
v.spindown = UDP->spindown;
|
||||
v.spindown_offset = UDP->spindown_offset;
|
||||
v.select_delay = UDP->select_delay;
|
||||
v.rps = UDP->rps;
|
||||
v.tracks = UDP->tracks;
|
||||
v.timeout = UDP->timeout;
|
||||
v.interleave_sect = UDP->interleave_sect;
|
||||
v.max_errors = UDP->max_errors;
|
||||
v.flags = UDP->flags;
|
||||
v.read_track = UDP->read_track;
|
||||
memcpy(v.autodetect, UDP->autodetect, sizeof(v.autodetect));
|
||||
v.checkfreq = UDP->checkfreq;
|
||||
v.native_format = UDP->native_format;
|
||||
mutex_unlock(&floppy_mutex);
|
||||
|
||||
if (copy_from_user(arg, &v, sizeof(struct compat_floppy_drive_params)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int compat_getdrvstat(int drive, bool poll,
|
||||
struct compat_floppy_drive_struct __user *arg)
|
||||
{
|
||||
struct compat_floppy_drive_struct v;
|
||||
|
||||
memset(&v, 0, sizeof(struct compat_floppy_drive_struct));
|
||||
mutex_lock(&floppy_mutex);
|
||||
|
||||
if (poll) {
|
||||
if (lock_fdc(drive))
|
||||
goto Eintr;
|
||||
if (poll_drive(true, FD_RAW_NEED_DISK) == -EINTR)
|
||||
goto Eintr;
|
||||
process_fd_request();
|
||||
}
|
||||
v.spinup_date = UDRS->spinup_date;
|
||||
v.select_date = UDRS->select_date;
|
||||
v.first_read_date = UDRS->first_read_date;
|
||||
v.probed_format = UDRS->probed_format;
|
||||
v.track = UDRS->track;
|
||||
v.maxblock = UDRS->maxblock;
|
||||
v.maxtrack = UDRS->maxtrack;
|
||||
v.generation = UDRS->generation;
|
||||
v.keep_data = UDRS->keep_data;
|
||||
v.fd_ref = UDRS->fd_ref;
|
||||
v.fd_device = UDRS->fd_device;
|
||||
v.last_checked = UDRS->last_checked;
|
||||
v.dmabuf = (uintptr_t)UDRS->dmabuf;
|
||||
v.bufblocks = UDRS->bufblocks;
|
||||
mutex_unlock(&floppy_mutex);
|
||||
|
||||
if (copy_from_user(arg, &v, sizeof(struct compat_floppy_drive_struct)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
Eintr:
|
||||
mutex_unlock(&floppy_mutex);
|
||||
return -EINTR;
|
||||
}
|
||||
|
||||
static int compat_getfdcstat(int drive,
|
||||
struct compat_floppy_fdc_state __user *arg)
|
||||
{
|
||||
struct compat_floppy_fdc_state v32;
|
||||
struct floppy_fdc_state v;
|
||||
|
||||
mutex_lock(&floppy_mutex);
|
||||
v = *UFDCS;
|
||||
mutex_unlock(&floppy_mutex);
|
||||
|
||||
memset(&v32, 0, sizeof(struct compat_floppy_fdc_state));
|
||||
v32.spec1 = v.spec1;
|
||||
v32.spec2 = v.spec2;
|
||||
v32.dtr = v.dtr;
|
||||
v32.version = v.version;
|
||||
v32.dor = v.dor;
|
||||
v32.address = v.address;
|
||||
v32.rawcmd = v.rawcmd;
|
||||
v32.reset = v.reset;
|
||||
v32.need_configure = v.need_configure;
|
||||
v32.perp_mode = v.perp_mode;
|
||||
v32.has_fifo = v.has_fifo;
|
||||
v32.driver_version = v.driver_version;
|
||||
memcpy(v32.track, v.track, 4);
|
||||
if (copy_to_user(arg, &v32, sizeof(struct compat_floppy_fdc_state)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int compat_werrorget(int drive,
|
||||
struct compat_floppy_write_errors __user *arg)
|
||||
{
|
||||
struct compat_floppy_write_errors v32;
|
||||
struct floppy_write_errors v;
|
||||
|
||||
memset(&v32, 0, sizeof(struct compat_floppy_write_errors));
|
||||
mutex_lock(&floppy_mutex);
|
||||
v = *UDRWE;
|
||||
mutex_unlock(&floppy_mutex);
|
||||
v32.write_errors = v.write_errors;
|
||||
v32.first_error_sector = v.first_error_sector;
|
||||
v32.first_error_generation = v.first_error_generation;
|
||||
v32.last_error_sector = v.last_error_sector;
|
||||
v32.last_error_generation = v.last_error_generation;
|
||||
v32.badness = v.badness;
|
||||
if (copy_to_user(arg, &v32, sizeof(struct compat_floppy_write_errors)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fd_compat_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
|
||||
unsigned long param)
|
||||
{
|
||||
int drive = (long)bdev->bd_disk->private_data;
|
||||
switch (cmd) {
|
||||
case FDMSGON:
|
||||
case FDMSGOFF:
|
||||
case FDSETEMSGTRESH:
|
||||
case FDFLUSH:
|
||||
case FDWERRORCLR:
|
||||
case FDEJECT:
|
||||
case FDCLRPRM:
|
||||
case FDFMTBEG:
|
||||
case FDRESET:
|
||||
case FDTWADDLE:
|
||||
return fd_ioctl(bdev, mode, cmd, param);
|
||||
case FDSETMAXERRS:
|
||||
case FDGETMAXERRS:
|
||||
case FDGETDRVTYP:
|
||||
case FDFMTEND:
|
||||
case FDFMTTRK:
|
||||
case FDRAWCMD:
|
||||
return fd_ioctl(bdev, mode, cmd,
|
||||
(unsigned long)compat_ptr(param));
|
||||
case FDSETPRM32:
|
||||
case FDDEFPRM32:
|
||||
return compat_set_geometry(bdev, mode, cmd, compat_ptr(param));
|
||||
case FDGETPRM32:
|
||||
return compat_get_prm(drive, compat_ptr(param));
|
||||
case FDSETDRVPRM32:
|
||||
return compat_setdrvprm(drive, compat_ptr(param));
|
||||
case FDGETDRVPRM32:
|
||||
return compat_getdrvprm(drive, compat_ptr(param));
|
||||
case FDPOLLDRVSTAT32:
|
||||
return compat_getdrvstat(drive, true, compat_ptr(param));
|
||||
case FDGETDRVSTAT32:
|
||||
return compat_getdrvstat(drive, false, compat_ptr(param));
|
||||
case FDGETFDCSTAT32:
|
||||
return compat_getfdcstat(drive, compat_ptr(param));
|
||||
case FDWERRORGET32:
|
||||
return compat_werrorget(drive, compat_ptr(param));
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void __init config_types(void)
|
||||
{
|
||||
bool has_drive = false;
|
||||
|
@ -3891,6 +4246,9 @@ static const struct block_device_operations floppy_fops = {
|
|||
.getgeo = fd_getgeo,
|
||||
.check_events = floppy_check_events,
|
||||
.revalidate_disk = floppy_revalidate,
|
||||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = fd_compat_ioctl,
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -101,6 +101,9 @@ static int ath_open(struct hci_uart *hu)
|
|||
|
||||
BT_DBG("hu %p", hu);
|
||||
|
||||
if (!hci_uart_has_flow_control(hu))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
ath = kzalloc(sizeof(*ath), GFP_KERNEL);
|
||||
if (!ath)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -279,6 +279,9 @@ static int bcm_open(struct hci_uart *hu)
|
|||
|
||||
bt_dev_dbg(hu->hdev, "hu %p", hu);
|
||||
|
||||
if (!hci_uart_has_flow_control(hu))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
bcm = kzalloc(sizeof(*bcm), GFP_KERNEL);
|
||||
if (!bcm)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -759,6 +759,11 @@ static int bcsp_close(struct hci_uart *hu)
|
|||
skb_queue_purge(&bcsp->rel);
|
||||
skb_queue_purge(&bcsp->unrel);
|
||||
|
||||
if (bcsp->rx_skb) {
|
||||
kfree_skb(bcsp->rx_skb);
|
||||
bcsp->rx_skb = NULL;
|
||||
}
|
||||
|
||||
kfree(bcsp);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -407,6 +407,9 @@ static int intel_open(struct hci_uart *hu)
|
|||
|
||||
BT_DBG("hu %p", hu);
|
||||
|
||||
if (!hci_uart_has_flow_control(hu))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
intel = kzalloc(sizeof(*intel), GFP_KERNEL);
|
||||
if (!intel)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -263,6 +263,15 @@ static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Check the underlying device or tty has flow control support */
|
||||
bool hci_uart_has_flow_control(struct hci_uart *hu)
|
||||
{
|
||||
if (hu->tty->driver->ops->tiocmget && hu->tty->driver->ops->tiocmset)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Flow control or un-flow control the device */
|
||||
void hci_uart_set_flow_control(struct hci_uart *hu, bool enable)
|
||||
{
|
||||
|
|
|
@ -66,6 +66,9 @@ static int mrvl_open(struct hci_uart *hu)
|
|||
|
||||
BT_DBG("hu %p", hu);
|
||||
|
||||
if (!hci_uart_has_flow_control(hu))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
mrvl = kzalloc(sizeof(*mrvl), GFP_KERNEL);
|
||||
if (!mrvl)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -109,6 +109,7 @@ int hci_uart_tx_wakeup(struct hci_uart *hu);
|
|||
int hci_uart_init_ready(struct hci_uart *hu);
|
||||
void hci_uart_init_tty(struct hci_uart *hu);
|
||||
void hci_uart_set_baudrate(struct hci_uart *hu, unsigned int speed);
|
||||
bool hci_uart_has_flow_control(struct hci_uart *hu);
|
||||
void hci_uart_set_flow_control(struct hci_uart *hu, bool enable);
|
||||
void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed,
|
||||
unsigned int oper_speed);
|
||||
|
|
|
@ -569,8 +569,7 @@ static inline unsigned long hpet_time_div(struct hpets *hpets,
|
|||
unsigned long long m;
|
||||
|
||||
m = hpets->hp_tick_freq + (dis >> 1);
|
||||
do_div(m, dis);
|
||||
return (unsigned long)m;
|
||||
return div64_ul(m, dis);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -211,7 +211,7 @@ static void exynos4_frc_resume(struct clocksource *cs)
|
|||
|
||||
static struct clocksource mct_frc = {
|
||||
.name = "mct-frc",
|
||||
.rating = 400,
|
||||
.rating = 450, /* use value higher than ARM arch timer */
|
||||
.read = exynos4_frc_read,
|
||||
.mask = CLOCKSOURCE_MASK(32),
|
||||
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
|
||||
|
@ -466,7 +466,7 @@ static int exynos4_mct_starting_cpu(unsigned int cpu)
|
|||
evt->set_state_oneshot_stopped = set_state_shutdown;
|
||||
evt->tick_resume = set_state_shutdown;
|
||||
evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
|
||||
evt->rating = 450;
|
||||
evt->rating = 500; /* use value higher than ARM arch timer */
|
||||
|
||||
exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET);
|
||||
|
||||
|
|
|
@ -111,7 +111,6 @@ void ppc4xx_trng_probe(struct crypto4xx_core_device *core_dev)
|
|||
return;
|
||||
|
||||
err_out:
|
||||
of_node_put(trng);
|
||||
iounmap(dev->trng_base);
|
||||
kfree(rng);
|
||||
dev->trng_base = NULL;
|
||||
|
|
|
@ -2015,6 +2015,7 @@ static void ablkcipher_encrypt_done(struct device *jrdev, u32 *desc, u32 err,
|
|||
struct ablkcipher_request *req = context;
|
||||
struct ablkcipher_edesc *edesc;
|
||||
struct crypto_ablkcipher *ablkcipher = crypto_ablkcipher_reqtfm(req);
|
||||
struct caam_ctx *ctx = crypto_ablkcipher_ctx(ablkcipher);
|
||||
int ivsize = crypto_ablkcipher_ivsize(ablkcipher);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -2040,10 +2041,11 @@ static void ablkcipher_encrypt_done(struct device *jrdev, u32 *desc, u32 err,
|
|||
|
||||
/*
|
||||
* The crypto API expects us to set the IV (req->info) to the last
|
||||
* ciphertext block. This is used e.g. by the CTS mode.
|
||||
* ciphertext block when running in CBC mode.
|
||||
*/
|
||||
scatterwalk_map_and_copy(req->info, req->dst, req->nbytes - ivsize,
|
||||
ivsize, 0);
|
||||
if ((ctx->class1_alg_type & OP_ALG_AAI_MASK) == OP_ALG_AAI_CBC)
|
||||
scatterwalk_map_and_copy(req->info, req->dst, req->nbytes -
|
||||
ivsize, ivsize, 0);
|
||||
|
||||
kfree(edesc);
|
||||
|
||||
|
@ -2056,6 +2058,7 @@ static void ablkcipher_decrypt_done(struct device *jrdev, u32 *desc, u32 err,
|
|||
struct ablkcipher_request *req = context;
|
||||
struct ablkcipher_edesc *edesc;
|
||||
struct crypto_ablkcipher *ablkcipher = crypto_ablkcipher_reqtfm(req);
|
||||
struct caam_ctx *ctx = crypto_ablkcipher_ctx(ablkcipher);
|
||||
int ivsize = crypto_ablkcipher_ivsize(ablkcipher);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -2080,10 +2083,11 @@ static void ablkcipher_decrypt_done(struct device *jrdev, u32 *desc, u32 err,
|
|||
|
||||
/*
|
||||
* The crypto API expects us to set the IV (req->info) to the last
|
||||
* ciphertext block.
|
||||
* ciphertext block when running in CBC mode.
|
||||
*/
|
||||
scatterwalk_map_and_copy(req->info, req->src, req->nbytes - ivsize,
|
||||
ivsize, 0);
|
||||
if ((ctx->class1_alg_type & OP_ALG_AAI_MASK) == OP_ALG_AAI_CBC)
|
||||
scatterwalk_map_and_copy(req->info, req->src, req->nbytes -
|
||||
ivsize, ivsize, 0);
|
||||
|
||||
kfree(edesc);
|
||||
|
||||
|
|
|
@ -40,57 +40,63 @@ struct ccp_tasklet_data {
|
|||
struct ccp_cmd *cmd;
|
||||
};
|
||||
|
||||
/* Human-readable error strings */
|
||||
char *ccp_error_codes[] = {
|
||||
"",
|
||||
"ERR 01: ILLEGAL_ENGINE",
|
||||
"ERR 02: ILLEGAL_KEY_ID",
|
||||
"ERR 03: ILLEGAL_FUNCTION_TYPE",
|
||||
"ERR 04: ILLEGAL_FUNCTION_MODE",
|
||||
"ERR 05: ILLEGAL_FUNCTION_ENCRYPT",
|
||||
"ERR 06: ILLEGAL_FUNCTION_SIZE",
|
||||
"ERR 07: Zlib_MISSING_INIT_EOM",
|
||||
"ERR 08: ILLEGAL_FUNCTION_RSVD",
|
||||
"ERR 09: ILLEGAL_BUFFER_LENGTH",
|
||||
"ERR 10: VLSB_FAULT",
|
||||
"ERR 11: ILLEGAL_MEM_ADDR",
|
||||
"ERR 12: ILLEGAL_MEM_SEL",
|
||||
"ERR 13: ILLEGAL_CONTEXT_ID",
|
||||
"ERR 14: ILLEGAL_KEY_ADDR",
|
||||
"ERR 15: 0xF Reserved",
|
||||
"ERR 16: Zlib_ILLEGAL_MULTI_QUEUE",
|
||||
"ERR 17: Zlib_ILLEGAL_JOBID_CHANGE",
|
||||
"ERR 18: CMD_TIMEOUT",
|
||||
"ERR 19: IDMA0_AXI_SLVERR",
|
||||
"ERR 20: IDMA0_AXI_DECERR",
|
||||
"ERR 21: 0x15 Reserved",
|
||||
"ERR 22: IDMA1_AXI_SLAVE_FAULT",
|
||||
"ERR 23: IDMA1_AIXI_DECERR",
|
||||
"ERR 24: 0x18 Reserved",
|
||||
"ERR 25: ZLIBVHB_AXI_SLVERR",
|
||||
"ERR 26: ZLIBVHB_AXI_DECERR",
|
||||
"ERR 27: 0x1B Reserved",
|
||||
"ERR 27: ZLIB_UNEXPECTED_EOM",
|
||||
"ERR 27: ZLIB_EXTRA_DATA",
|
||||
"ERR 30: ZLIB_BTYPE",
|
||||
"ERR 31: ZLIB_UNDEFINED_SYMBOL",
|
||||
"ERR 32: ZLIB_UNDEFINED_DISTANCE_S",
|
||||
"ERR 33: ZLIB_CODE_LENGTH_SYMBOL",
|
||||
"ERR 34: ZLIB _VHB_ILLEGAL_FETCH",
|
||||
"ERR 35: ZLIB_UNCOMPRESSED_LEN",
|
||||
"ERR 36: ZLIB_LIMIT_REACHED",
|
||||
"ERR 37: ZLIB_CHECKSUM_MISMATCH0",
|
||||
"ERR 38: ODMA0_AXI_SLVERR",
|
||||
"ERR 39: ODMA0_AXI_DECERR",
|
||||
"ERR 40: 0x28 Reserved",
|
||||
"ERR 41: ODMA1_AXI_SLVERR",
|
||||
"ERR 42: ODMA1_AXI_DECERR",
|
||||
"ERR 43: LSB_PARITY_ERR",
|
||||
/* Human-readable error strings */
|
||||
#define CCP_MAX_ERROR_CODE 64
|
||||
static char *ccp_error_codes[] = {
|
||||
"",
|
||||
"ILLEGAL_ENGINE",
|
||||
"ILLEGAL_KEY_ID",
|
||||
"ILLEGAL_FUNCTION_TYPE",
|
||||
"ILLEGAL_FUNCTION_MODE",
|
||||
"ILLEGAL_FUNCTION_ENCRYPT",
|
||||
"ILLEGAL_FUNCTION_SIZE",
|
||||
"Zlib_MISSING_INIT_EOM",
|
||||
"ILLEGAL_FUNCTION_RSVD",
|
||||
"ILLEGAL_BUFFER_LENGTH",
|
||||
"VLSB_FAULT",
|
||||
"ILLEGAL_MEM_ADDR",
|
||||
"ILLEGAL_MEM_SEL",
|
||||
"ILLEGAL_CONTEXT_ID",
|
||||
"ILLEGAL_KEY_ADDR",
|
||||
"0xF Reserved",
|
||||
"Zlib_ILLEGAL_MULTI_QUEUE",
|
||||
"Zlib_ILLEGAL_JOBID_CHANGE",
|
||||
"CMD_TIMEOUT",
|
||||
"IDMA0_AXI_SLVERR",
|
||||
"IDMA0_AXI_DECERR",
|
||||
"0x15 Reserved",
|
||||
"IDMA1_AXI_SLAVE_FAULT",
|
||||
"IDMA1_AIXI_DECERR",
|
||||
"0x18 Reserved",
|
||||
"ZLIBVHB_AXI_SLVERR",
|
||||
"ZLIBVHB_AXI_DECERR",
|
||||
"0x1B Reserved",
|
||||
"ZLIB_UNEXPECTED_EOM",
|
||||
"ZLIB_EXTRA_DATA",
|
||||
"ZLIB_BTYPE",
|
||||
"ZLIB_UNDEFINED_SYMBOL",
|
||||
"ZLIB_UNDEFINED_DISTANCE_S",
|
||||
"ZLIB_CODE_LENGTH_SYMBOL",
|
||||
"ZLIB _VHB_ILLEGAL_FETCH",
|
||||
"ZLIB_UNCOMPRESSED_LEN",
|
||||
"ZLIB_LIMIT_REACHED",
|
||||
"ZLIB_CHECKSUM_MISMATCH0",
|
||||
"ODMA0_AXI_SLVERR",
|
||||
"ODMA0_AXI_DECERR",
|
||||
"0x28 Reserved",
|
||||
"ODMA1_AXI_SLVERR",
|
||||
"ODMA1_AXI_DECERR",
|
||||
};
|
||||
|
||||
void ccp_log_error(struct ccp_device *d, int e)
|
||||
void ccp_log_error(struct ccp_device *d, unsigned int e)
|
||||
{
|
||||
dev_err(d->dev, "CCP error: %s (0x%x)\n", ccp_error_codes[e], e);
|
||||
if (WARN_ON(e >= CCP_MAX_ERROR_CODE))
|
||||
return;
|
||||
|
||||
if (e < ARRAY_SIZE(ccp_error_codes))
|
||||
dev_err(d->dev, "CCP error %d: %s\n", e, ccp_error_codes[e]);
|
||||
else
|
||||
dev_err(d->dev, "CCP error %d: Unknown Error\n", e);
|
||||
}
|
||||
|
||||
/* List of CCPs, CCP count, read-write access lock, and access functions
|
||||
|
|
|
@ -607,7 +607,7 @@ void ccp_platform_exit(void);
|
|||
void ccp_add_device(struct ccp_device *ccp);
|
||||
void ccp_del_device(struct ccp_device *ccp);
|
||||
|
||||
extern void ccp_log_error(struct ccp_device *, int);
|
||||
extern void ccp_log_error(struct ccp_device *, unsigned int);
|
||||
|
||||
struct ccp_device *ccp_alloc_struct(struct device *dev);
|
||||
bool ccp_queues_suspended(struct ccp_device *ccp);
|
||||
|
|
|
@ -984,7 +984,6 @@ static void ipsec_esp_encrypt_done(struct device *dev,
|
|||
struct crypto_aead *authenc = crypto_aead_reqtfm(areq);
|
||||
unsigned int authsize = crypto_aead_authsize(authenc);
|
||||
struct talitos_edesc *edesc;
|
||||
struct scatterlist *sg;
|
||||
void *icvdata;
|
||||
|
||||
edesc = container_of(desc, struct talitos_edesc, desc);
|
||||
|
@ -998,9 +997,8 @@ static void ipsec_esp_encrypt_done(struct device *dev,
|
|||
else
|
||||
icvdata = &edesc->link_tbl[edesc->src_nents +
|
||||
edesc->dst_nents + 2];
|
||||
sg = sg_last(areq->dst, edesc->dst_nents);
|
||||
memcpy((char *)sg_virt(sg) + sg->length - authsize,
|
||||
icvdata, authsize);
|
||||
sg_pcopy_from_buffer(areq->dst, edesc->dst_nents ? : 1, icvdata,
|
||||
authsize, areq->assoclen + areq->cryptlen);
|
||||
}
|
||||
|
||||
kfree(edesc);
|
||||
|
@ -1016,7 +1014,6 @@ static void ipsec_esp_decrypt_swauth_done(struct device *dev,
|
|||
struct crypto_aead *authenc = crypto_aead_reqtfm(req);
|
||||
unsigned int authsize = crypto_aead_authsize(authenc);
|
||||
struct talitos_edesc *edesc;
|
||||
struct scatterlist *sg;
|
||||
char *oicv, *icv;
|
||||
struct talitos_private *priv = dev_get_drvdata(dev);
|
||||
bool is_sec1 = has_ftr_sec1(priv);
|
||||
|
@ -1026,9 +1023,18 @@ static void ipsec_esp_decrypt_swauth_done(struct device *dev,
|
|||
ipsec_esp_unmap(dev, edesc, req);
|
||||
|
||||
if (!err) {
|
||||
char icvdata[SHA512_DIGEST_SIZE];
|
||||
int nents = edesc->dst_nents ? : 1;
|
||||
unsigned int len = req->assoclen + req->cryptlen;
|
||||
|
||||
/* auth check */
|
||||
sg = sg_last(req->dst, edesc->dst_nents ? : 1);
|
||||
icv = (char *)sg_virt(sg) + sg->length - authsize;
|
||||
if (nents > 1) {
|
||||
sg_pcopy_to_buffer(req->dst, nents, icvdata, authsize,
|
||||
len - authsize);
|
||||
icv = icvdata;
|
||||
} else {
|
||||
icv = (char *)sg_virt(req->dst) + len - authsize;
|
||||
}
|
||||
|
||||
if (edesc->dma_len) {
|
||||
if (is_sec1)
|
||||
|
@ -1458,7 +1464,6 @@ static int aead_decrypt(struct aead_request *req)
|
|||
struct talitos_ctx *ctx = crypto_aead_ctx(authenc);
|
||||
struct talitos_private *priv = dev_get_drvdata(ctx->dev);
|
||||
struct talitos_edesc *edesc;
|
||||
struct scatterlist *sg;
|
||||
void *icvdata;
|
||||
|
||||
req->cryptlen -= authsize;
|
||||
|
@ -1493,9 +1498,8 @@ static int aead_decrypt(struct aead_request *req)
|
|||
else
|
||||
icvdata = &edesc->link_tbl[0];
|
||||
|
||||
sg = sg_last(req->src, edesc->src_nents ? : 1);
|
||||
|
||||
memcpy(icvdata, (char *)sg_virt(sg) + sg->length - authsize, authsize);
|
||||
sg_pcopy_to_buffer(req->src, edesc->src_nents ? : 1, icvdata, authsize,
|
||||
req->assoclen + req->cryptlen - authsize);
|
||||
|
||||
return ipsec_esp(edesc, req, ipsec_esp_decrypt_swauth_done);
|
||||
}
|
||||
|
@ -1544,11 +1548,15 @@ static void ablkcipher_done(struct device *dev,
|
|||
int err)
|
||||
{
|
||||
struct ablkcipher_request *areq = context;
|
||||
struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq);
|
||||
struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher);
|
||||
unsigned int ivsize = crypto_ablkcipher_ivsize(cipher);
|
||||
struct talitos_edesc *edesc;
|
||||
|
||||
edesc = container_of(desc, struct talitos_edesc, desc);
|
||||
|
||||
common_nonsnoop_unmap(dev, edesc, areq);
|
||||
memcpy(areq->info, ctx->iv, ivsize);
|
||||
|
||||
kfree(edesc);
|
||||
|
||||
|
@ -3111,7 +3119,10 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
|
|||
alg->cra_priority = t_alg->algt.priority;
|
||||
else
|
||||
alg->cra_priority = TALITOS_CRA_PRIORITY;
|
||||
alg->cra_alignmask = 0;
|
||||
if (has_ftr_sec1(priv))
|
||||
alg->cra_alignmask = 3;
|
||||
else
|
||||
alg->cra_alignmask = 0;
|
||||
alg->cra_ctxsize = sizeof(struct talitos_ctx);
|
||||
alg->cra_flags |= CRYPTO_ALG_KERN_DRIVER_ONLY;
|
||||
|
||||
|
|
|
@ -1821,27 +1821,6 @@ static int sdma_probe(struct platform_device *pdev)
|
|||
if (pdata && pdata->script_addrs)
|
||||
sdma_add_scripts(sdma, pdata->script_addrs);
|
||||
|
||||
if (pdata) {
|
||||
ret = sdma_get_firmware(sdma, pdata->fw_name);
|
||||
if (ret)
|
||||
dev_warn(&pdev->dev, "failed to get firmware from platform data\n");
|
||||
} else {
|
||||
/*
|
||||
* Because that device tree does not encode ROM script address,
|
||||
* the RAM script in firmware is mandatory for device tree
|
||||
* probe, otherwise it fails.
|
||||
*/
|
||||
ret = of_property_read_string(np, "fsl,sdma-ram-script-name",
|
||||
&fw_name);
|
||||
if (ret)
|
||||
dev_warn(&pdev->dev, "failed to get firmware name\n");
|
||||
else {
|
||||
ret = sdma_get_firmware(sdma, fw_name);
|
||||
if (ret)
|
||||
dev_warn(&pdev->dev, "failed to get firmware from device tree\n");
|
||||
}
|
||||
}
|
||||
|
||||
sdma->dma_device.dev = &pdev->dev;
|
||||
|
||||
sdma->dma_device.device_alloc_chan_resources = sdma_alloc_chan_resources;
|
||||
|
@ -1883,6 +1862,33 @@ static int sdma_probe(struct platform_device *pdev)
|
|||
of_node_put(spba_bus);
|
||||
}
|
||||
|
||||
/*
|
||||
* Kick off firmware loading as the very last step:
|
||||
* attempt to load firmware only if we're not on the error path, because
|
||||
* the firmware callback requires a fully functional and allocated sdma
|
||||
* instance.
|
||||
*/
|
||||
if (pdata) {
|
||||
ret = sdma_get_firmware(sdma, pdata->fw_name);
|
||||
if (ret)
|
||||
dev_warn(&pdev->dev, "failed to get firmware from platform data\n");
|
||||
} else {
|
||||
/*
|
||||
* Because that device tree does not encode ROM script address,
|
||||
* the RAM script in firmware is mandatory for device tree
|
||||
* probe, otherwise it fails.
|
||||
*/
|
||||
ret = of_property_read_string(np, "fsl,sdma-ram-script-name",
|
||||
&fw_name);
|
||||
if (ret) {
|
||||
dev_warn(&pdev->dev, "failed to get firmware name\n");
|
||||
} else {
|
||||
ret = sdma_get_firmware(sdma, fw_name);
|
||||
if (ret)
|
||||
dev_warn(&pdev->dev, "failed to get firmware from device tree\n");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_register:
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
static int edac_mc_log_ue = 1;
|
||||
static int edac_mc_log_ce = 1;
|
||||
static int edac_mc_panic_on_ue;
|
||||
static int edac_mc_poll_msec = 1000;
|
||||
static unsigned int edac_mc_poll_msec = 1000;
|
||||
|
||||
/* Getter functions for above */
|
||||
int edac_mc_get_log_ue(void)
|
||||
|
@ -45,30 +45,30 @@ int edac_mc_get_panic_on_ue(void)
|
|||
}
|
||||
|
||||
/* this is temporary */
|
||||
int edac_mc_get_poll_msec(void)
|
||||
unsigned int edac_mc_get_poll_msec(void)
|
||||
{
|
||||
return edac_mc_poll_msec;
|
||||
}
|
||||
|
||||
static int edac_set_poll_msec(const char *val, const struct kernel_param *kp)
|
||||
{
|
||||
unsigned long l;
|
||||
unsigned int i;
|
||||
int ret;
|
||||
|
||||
if (!val)
|
||||
return -EINVAL;
|
||||
|
||||
ret = kstrtoul(val, 0, &l);
|
||||
ret = kstrtouint(val, 0, &i);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (l < 1000)
|
||||
if (i < 1000)
|
||||
return -EINVAL;
|
||||
|
||||
*((unsigned long *)kp->arg) = l;
|
||||
*((unsigned int *)kp->arg) = i;
|
||||
|
||||
/* notify edac_mc engine to reset the poll period */
|
||||
edac_mc_reset_delay_period(l);
|
||||
edac_mc_reset_delay_period(i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ MODULE_PARM_DESC(edac_mc_log_ue,
|
|||
module_param(edac_mc_log_ce, int, 0644);
|
||||
MODULE_PARM_DESC(edac_mc_log_ce,
|
||||
"Log correctable error to console: 0=off 1=on");
|
||||
module_param_call(edac_mc_poll_msec, edac_set_poll_msec, param_get_int,
|
||||
module_param_call(edac_mc_poll_msec, edac_set_poll_msec, param_get_uint,
|
||||
&edac_mc_poll_msec, 0644);
|
||||
MODULE_PARM_DESC(edac_mc_poll_msec, "Polling period in milliseconds");
|
||||
|
||||
|
@ -426,6 +426,8 @@ static inline int nr_pages_per_csrow(struct csrow_info *csrow)
|
|||
static int edac_create_csrow_object(struct mem_ctl_info *mci,
|
||||
struct csrow_info *csrow, int index)
|
||||
{
|
||||
int err;
|
||||
|
||||
csrow->dev.type = &csrow_attr_type;
|
||||
csrow->dev.bus = mci->bus;
|
||||
csrow->dev.groups = csrow_dev_groups;
|
||||
|
@ -438,7 +440,11 @@ static int edac_create_csrow_object(struct mem_ctl_info *mci,
|
|||
edac_dbg(0, "creating (virtual) csrow node %s\n",
|
||||
dev_name(&csrow->dev));
|
||||
|
||||
return device_add(&csrow->dev);
|
||||
err = device_add(&csrow->dev);
|
||||
if (err)
|
||||
put_device(&csrow->dev);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Create a CSROW object under specifed edac_mc_device */
|
||||
|
|
|
@ -33,7 +33,7 @@ extern int edac_mc_get_log_ue(void);
|
|||
extern int edac_mc_get_log_ce(void);
|
||||
extern int edac_mc_get_panic_on_ue(void);
|
||||
extern int edac_get_poll_msec(void);
|
||||
extern int edac_mc_get_poll_msec(void);
|
||||
extern unsigned int edac_mc_get_poll_msec(void);
|
||||
|
||||
unsigned edac_dimm_info_location(struct dimm_info *dimm, char *buf,
|
||||
unsigned len);
|
||||
|
|
|
@ -786,9 +786,9 @@ static void omap_gpio_irq_shutdown(struct irq_data *d)
|
|||
|
||||
raw_spin_lock_irqsave(&bank->lock, flags);
|
||||
bank->irq_usage &= ~(BIT(offset));
|
||||
omap_set_gpio_irqenable(bank, offset, 0);
|
||||
omap_clear_gpio_irqstatus(bank, offset);
|
||||
omap_set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
|
||||
omap_clear_gpio_irqstatus(bank, offset);
|
||||
omap_set_gpio_irqenable(bank, offset, 0);
|
||||
if (!LINE_USED(bank->mod_usage, offset))
|
||||
omap_clear_gpio_debounce(bank, offset);
|
||||
omap_disable_gpio_module(bank, offset);
|
||||
|
@ -830,8 +830,8 @@ static void omap_gpio_mask_irq(struct irq_data *d)
|
|||
unsigned long flags;
|
||||
|
||||
raw_spin_lock_irqsave(&bank->lock, flags);
|
||||
omap_set_gpio_irqenable(bank, offset, 0);
|
||||
omap_set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
|
||||
omap_set_gpio_irqenable(bank, offset, 0);
|
||||
raw_spin_unlock_irqrestore(&bank->lock, flags);
|
||||
}
|
||||
|
||||
|
@ -843,9 +843,6 @@ static void omap_gpio_unmask_irq(struct irq_data *d)
|
|||
unsigned long flags;
|
||||
|
||||
raw_spin_lock_irqsave(&bank->lock, flags);
|
||||
if (trigger)
|
||||
omap_set_gpio_triggering(bank, offset, trigger);
|
||||
|
||||
omap_set_gpio_irqenable(bank, offset, 1);
|
||||
|
||||
/*
|
||||
|
@ -853,9 +850,13 @@ static void omap_gpio_unmask_irq(struct irq_data *d)
|
|||
* is cleared, thus after the handler has run. OMAP4 needs this done
|
||||
* after enabing the interrupt to clear the wakeup status.
|
||||
*/
|
||||
if (bank->level_mask & BIT(offset))
|
||||
if (bank->regs->leveldetect0 && bank->regs->wkup_en &&
|
||||
trigger & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
|
||||
omap_clear_gpio_irqstatus(bank, offset);
|
||||
|
||||
if (trigger)
|
||||
omap_set_gpio_triggering(bank, offset, trigger);
|
||||
|
||||
raw_spin_unlock_irqrestore(&bank->lock, flags);
|
||||
}
|
||||
|
||||
|
@ -1585,6 +1586,8 @@ static struct omap_gpio_reg_offs omap4_gpio_regs = {
|
|||
.clr_dataout = OMAP4_GPIO_CLEARDATAOUT,
|
||||
.irqstatus = OMAP4_GPIO_IRQSTATUS0,
|
||||
.irqstatus2 = OMAP4_GPIO_IRQSTATUS1,
|
||||
.irqstatus_raw0 = OMAP4_GPIO_IRQSTATUSRAW0,
|
||||
.irqstatus_raw1 = OMAP4_GPIO_IRQSTATUSRAW1,
|
||||
.irqenable = OMAP4_GPIO_IRQSTATUSSET0,
|
||||
.irqenable2 = OMAP4_GPIO_IRQSTATUSSET1,
|
||||
.set_irqenable = OMAP4_GPIO_IRQSTATUSSET0,
|
||||
|
|
|
@ -2411,7 +2411,7 @@ static int _gpiod_get_raw_value(const struct gpio_desc *desc)
|
|||
int gpiod_get_raw_value(const struct gpio_desc *desc)
|
||||
{
|
||||
VALIDATE_DESC(desc);
|
||||
/* Should be using gpio_get_value_cansleep() */
|
||||
/* Should be using gpiod_get_raw_value_cansleep() */
|
||||
WARN_ON(desc->gdev->chip->can_sleep);
|
||||
return _gpiod_get_raw_value(desc);
|
||||
}
|
||||
|
@ -2432,7 +2432,7 @@ int gpiod_get_value(const struct gpio_desc *desc)
|
|||
int value;
|
||||
|
||||
VALIDATE_DESC(desc);
|
||||
/* Should be using gpio_get_value_cansleep() */
|
||||
/* Should be using gpiod_get_value_cansleep() */
|
||||
WARN_ON(desc->gdev->chip->can_sleep);
|
||||
|
||||
value = _gpiod_get_raw_value(desc);
|
||||
|
@ -2608,7 +2608,7 @@ void gpiod_set_array_value_complex(bool raw, bool can_sleep,
|
|||
void gpiod_set_raw_value(struct gpio_desc *desc, int value)
|
||||
{
|
||||
VALIDATE_DESC_VOID(desc);
|
||||
/* Should be using gpiod_set_value_cansleep() */
|
||||
/* Should be using gpiod_set_raw_value_cansleep() */
|
||||
WARN_ON(desc->gdev->chip->can_sleep);
|
||||
_gpiod_set_raw_value(desc, value);
|
||||
}
|
||||
|
|
|
@ -250,10 +250,11 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,
|
|||
struct regmap *regmap = sii902x->regmap;
|
||||
u8 buf[HDMI_INFOFRAME_SIZE(AVI)];
|
||||
struct hdmi_avi_infoframe frame;
|
||||
u16 pixel_clock_10kHz = adj->clock / 10;
|
||||
int ret;
|
||||
|
||||
buf[0] = adj->clock;
|
||||
buf[1] = adj->clock >> 8;
|
||||
buf[0] = pixel_clock_10kHz & 0xff;
|
||||
buf[1] = pixel_clock_10kHz >> 8;
|
||||
buf[2] = adj->vrefresh;
|
||||
buf[3] = 0x00;
|
||||
buf[4] = adj->hdisplay;
|
||||
|
|
|
@ -1153,6 +1153,13 @@ static int tc_connector_get_modes(struct drm_connector *connector)
|
|||
struct tc_data *tc = connector_to_tc(connector);
|
||||
struct edid *edid;
|
||||
unsigned int count;
|
||||
int ret;
|
||||
|
||||
ret = tc_get_display_props(tc);
|
||||
if (ret < 0) {
|
||||
dev_err(tc->dev, "failed to read display props: %d\n", ret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (tc->panel && tc->panel->funcs && tc->panel->funcs->get_modes) {
|
||||
count = tc->panel->funcs->get_modes(tc->panel);
|
||||
|
|
|
@ -184,6 +184,25 @@ nvkm_i2c_fini(struct nvkm_subdev *subdev, bool suspend)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nvkm_i2c_preinit(struct nvkm_subdev *subdev)
|
||||
{
|
||||
struct nvkm_i2c *i2c = nvkm_i2c(subdev);
|
||||
struct nvkm_i2c_bus *bus;
|
||||
struct nvkm_i2c_pad *pad;
|
||||
|
||||
/*
|
||||
* We init our i2c busses as early as possible, since they may be
|
||||
* needed by the vbios init scripts on some cards
|
||||
*/
|
||||
list_for_each_entry(pad, &i2c->pad, head)
|
||||
nvkm_i2c_pad_init(pad);
|
||||
list_for_each_entry(bus, &i2c->bus, head)
|
||||
nvkm_i2c_bus_init(bus);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nvkm_i2c_init(struct nvkm_subdev *subdev)
|
||||
{
|
||||
|
@ -238,6 +257,7 @@ nvkm_i2c_dtor(struct nvkm_subdev *subdev)
|
|||
static const struct nvkm_subdev_func
|
||||
nvkm_i2c = {
|
||||
.dtor = nvkm_i2c_dtor,
|
||||
.preinit = nvkm_i2c_preinit,
|
||||
.init = nvkm_i2c_init,
|
||||
.fini = nvkm_i2c_fini,
|
||||
.intr = nvkm_i2c_intr,
|
||||
|
|
|
@ -1944,7 +1944,14 @@ static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
|
|||
dsi->format = desc->format;
|
||||
dsi->lanes = desc->lanes;
|
||||
|
||||
return mipi_dsi_attach(dsi);
|
||||
err = mipi_dsi_attach(dsi);
|
||||
if (err) {
|
||||
struct panel_simple *panel = dev_get_drvdata(&dsi->dev);
|
||||
|
||||
drm_panel_remove(&panel->base);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
|
||||
|
|
|
@ -865,7 +865,8 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
|
|||
struct vop *vop = to_vop(crtc);
|
||||
|
||||
adjusted_mode->clock =
|
||||
clk_round_rate(vop->dclk, mode->clock * 1000) / 1000;
|
||||
DIV_ROUND_UP(clk_round_rate(vop->dclk, mode->clock * 1000),
|
||||
1000);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -521,6 +521,9 @@ static int virtio_gpu_get_caps_ioctl(struct drm_device *dev,
|
|||
ret = wait_event_timeout(vgdev->resp_wq,
|
||||
atomic_read(&cache_ent->is_valid), 5 * HZ);
|
||||
|
||||
/* is_valid check must proceed before copy of the cache entry. */
|
||||
smp_rmb();
|
||||
|
||||
ptr = cache_ent->caps_cache;
|
||||
|
||||
copy_exit:
|
||||
|
|
|
@ -618,6 +618,8 @@ static void virtio_gpu_cmd_capset_cb(struct virtio_gpu_device *vgdev,
|
|||
cache_ent->id == le32_to_cpu(cmd->capset_id)) {
|
||||
memcpy(cache_ent->caps_cache, resp->capset_data,
|
||||
cache_ent->size);
|
||||
/* Copy must occur before is_valid is signalled. */
|
||||
smp_wmb();
|
||||
atomic_set(&cache_ent->is_valid, 1);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ static int init_csc(struct ipu_ic *ic,
|
|||
writel(param, base++);
|
||||
|
||||
param = ((a[0] & 0x1fe0) >> 5) | (params->scale << 8) |
|
||||
(params->sat << 9);
|
||||
(params->sat << 10);
|
||||
writel(param, base++);
|
||||
|
||||
param = ((a[1] & 0x1f) << 27) | ((c[0][1] & 0x1ff) << 18) |
|
||||
|
|
|
@ -638,7 +638,7 @@ static int msc_buffer_contig_alloc(struct msc *msc, unsigned long size)
|
|||
goto err_out;
|
||||
|
||||
ret = -ENOMEM;
|
||||
page = alloc_pages(GFP_KERNEL | __GFP_ZERO, order);
|
||||
page = alloc_pages(GFP_KERNEL | __GFP_ZERO | GFP_DMA32, order);
|
||||
if (!page)
|
||||
goto err_free_sgt;
|
||||
|
||||
|
|
|
@ -808,6 +808,8 @@ static int qup_i2c_bam_do_xfer(struct qup_i2c_dev *qup, struct i2c_msg *msg,
|
|||
}
|
||||
|
||||
if (ret || qup->bus_err || qup->qup_err) {
|
||||
reinit_completion(&qup->xfer);
|
||||
|
||||
if (qup_i2c_change_state(qup, QUP_RUN_STATE)) {
|
||||
dev_err(qup->dev, "change to run state timed out");
|
||||
goto desc_err;
|
||||
|
|
|
@ -812,6 +812,8 @@ static int i40iw_query_qp(struct ib_qp *ibqp,
|
|||
struct i40iw_qp *iwqp = to_iwqp(ibqp);
|
||||
struct i40iw_sc_qp *qp = &iwqp->sc_qp;
|
||||
|
||||
attr->qp_state = iwqp->ibqp_state;
|
||||
attr->cur_qp_state = attr->qp_state;
|
||||
attr->qp_access_flags = 0;
|
||||
attr->cap.max_send_wr = qp->qp_uk.sq_size;
|
||||
attr->cap.max_recv_wr = qp->qp_uk.rq_size;
|
||||
|
|
|
@ -432,6 +432,7 @@ static enum resp_states check_rkey(struct rxe_qp *qp,
|
|||
qp->resp.va = reth_va(pkt);
|
||||
qp->resp.rkey = reth_rkey(pkt);
|
||||
qp->resp.resid = reth_len(pkt);
|
||||
qp->resp.length = reth_len(pkt);
|
||||
}
|
||||
access = (pkt->mask & RXE_READ_MASK) ? IB_ACCESS_REMOTE_READ
|
||||
: IB_ACCESS_REMOTE_WRITE;
|
||||
|
@ -841,7 +842,9 @@ static enum resp_states do_complete(struct rxe_qp *qp,
|
|||
pkt->mask & RXE_WRITE_MASK) ?
|
||||
IB_WC_RECV_RDMA_WITH_IMM : IB_WC_RECV;
|
||||
wc->vendor_err = 0;
|
||||
wc->byte_len = wqe->dma.length - wqe->dma.resid;
|
||||
wc->byte_len = (pkt->mask & RXE_IMMDT_MASK &&
|
||||
pkt->mask & RXE_WRITE_MASK) ?
|
||||
qp->resp.length : wqe->dma.length - wqe->dma.resid;
|
||||
|
||||
/* fields after byte_len are different between kernel and user
|
||||
* space
|
||||
|
|
|
@ -209,6 +209,7 @@ struct rxe_resp_info {
|
|||
struct rxe_mem *mr;
|
||||
u32 resid;
|
||||
u32 rkey;
|
||||
u32 length;
|
||||
u64 atomic_orig;
|
||||
|
||||
/* SRQ only */
|
||||
|
|
|
@ -1751,6 +1751,7 @@ static int ipoib_get_vf_config(struct net_device *dev, int vf,
|
|||
return err;
|
||||
|
||||
ivf->vf = vf;
|
||||
memcpy(ivf->mac, dev->dev_addr, dev->addr_len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ Scott Hill shill@gtcocalcomp.com
|
|||
|
||||
/* Max size of a single report */
|
||||
#define REPORT_MAX_SIZE 10
|
||||
#define MAX_COLLECTION_LEVELS 10
|
||||
|
||||
|
||||
/* Bitmask whether pen is in range */
|
||||
|
@ -223,8 +224,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
|
|||
char maintype = 'x';
|
||||
char globtype[12];
|
||||
int indent = 0;
|
||||
char indentstr[10] = "";
|
||||
|
||||
char indentstr[MAX_COLLECTION_LEVELS + 1] = { 0 };
|
||||
|
||||
dev_dbg(ddev, "======>>>>>>PARSE<<<<<<======\n");
|
||||
|
||||
|
@ -350,6 +350,13 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
|
|||
case TAG_MAIN_COL_START:
|
||||
maintype = 'S';
|
||||
|
||||
if (indent == MAX_COLLECTION_LEVELS) {
|
||||
dev_err(ddev, "Collection level %d would exceed limit of %d\n",
|
||||
indent + 1,
|
||||
MAX_COLLECTION_LEVELS);
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == 0) {
|
||||
dev_dbg(ddev, "======>>>>>> Physical\n");
|
||||
strcpy(globtype, "Physical");
|
||||
|
@ -369,8 +376,15 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
|
|||
break;
|
||||
|
||||
case TAG_MAIN_COL_END:
|
||||
dev_dbg(ddev, "<<<<<<======\n");
|
||||
maintype = 'E';
|
||||
|
||||
if (indent == 0) {
|
||||
dev_err(ddev, "Collection level already at zero\n");
|
||||
break;
|
||||
}
|
||||
|
||||
dev_dbg(ddev, "<<<<<<======\n");
|
||||
|
||||
indent--;
|
||||
for (x = 0; x < indent; x++)
|
||||
indentstr[x] = '-';
|
||||
|
|
|
@ -1963,6 +1963,9 @@ hfcsusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
|||
|
||||
/* get endpoint base */
|
||||
idx = ((ep_addr & 0x7f) - 1) * 2;
|
||||
if (idx > 15)
|
||||
return -EIO;
|
||||
|
||||
if (ep_addr & 0x80)
|
||||
idx++;
|
||||
attr = ep->desc.bmAttributes;
|
||||
|
|
|
@ -389,11 +389,13 @@ struct mbox_chan *mbox_request_channel_byname(struct mbox_client *cl,
|
|||
|
||||
of_property_for_each_string(np, "mbox-names", prop, mbox_name) {
|
||||
if (!strncmp(name, mbox_name, strlen(name)))
|
||||
break;
|
||||
return mbox_request_channel(cl, index);
|
||||
index++;
|
||||
}
|
||||
|
||||
return mbox_request_channel(cl, index);
|
||||
dev_err(cl->dev, "%s() could not locate channel named \"%s\"\n",
|
||||
__func__, name);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mbox_request_channel_byname);
|
||||
|
||||
|
|
|
@ -1405,7 +1405,7 @@ static void cache_set_flush(struct closure *cl)
|
|||
kobject_put(&c->internal);
|
||||
kobject_del(&c->kobj);
|
||||
|
||||
if (c->gc_thread)
|
||||
if (!IS_ERR_OR_NULL(c->gc_thread))
|
||||
kthread_stop(c->gc_thread);
|
||||
|
||||
if (!IS_ERR_OR_NULL(c->root))
|
||||
|
|
|
@ -1585,9 +1585,7 @@ dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
|
|||
unsigned long freed;
|
||||
|
||||
c = container_of(shrink, struct dm_bufio_client, shrinker);
|
||||
if (sc->gfp_mask & __GFP_FS)
|
||||
dm_bufio_lock(c);
|
||||
else if (!dm_bufio_trylock(c))
|
||||
if (!dm_bufio_trylock(c))
|
||||
return SHRINK_STOP;
|
||||
|
||||
freed = __scan(c, sc->nr_to_scan, sc->gfp_mask);
|
||||
|
|
|
@ -80,8 +80,8 @@ static int tua6100_set_params(struct dvb_frontend *fe)
|
|||
struct i2c_msg msg1 = { .addr = priv->i2c_address, .flags = 0, .buf = reg1, .len = 4 };
|
||||
struct i2c_msg msg2 = { .addr = priv->i2c_address, .flags = 0, .buf = reg2, .len = 3 };
|
||||
|
||||
#define _R 4
|
||||
#define _P 32
|
||||
#define _R_VAL 4
|
||||
#define _P_VAL 32
|
||||
#define _ri 4000000
|
||||
|
||||
// setup register 0
|
||||
|
@ -96,14 +96,14 @@ static int tua6100_set_params(struct dvb_frontend *fe)
|
|||
else
|
||||
reg1[1] = 0x0c;
|
||||
|
||||
if (_P == 64)
|
||||
if (_P_VAL == 64)
|
||||
reg1[1] |= 0x40;
|
||||
if (c->frequency >= 1525000)
|
||||
reg1[1] |= 0x80;
|
||||
|
||||
// register 2
|
||||
reg2[1] = (_R >> 8) & 0x03;
|
||||
reg2[2] = _R;
|
||||
reg2[1] = (_R_VAL >> 8) & 0x03;
|
||||
reg2[2] = _R_VAL;
|
||||
if (c->frequency < 1455000)
|
||||
reg2[1] |= 0x1c;
|
||||
else if (c->frequency < 1630000)
|
||||
|
@ -115,18 +115,18 @@ static int tua6100_set_params(struct dvb_frontend *fe)
|
|||
* The N divisor ratio (note: c->frequency is in kHz, but we
|
||||
* need it in Hz)
|
||||
*/
|
||||
prediv = (c->frequency * _R) / (_ri / 1000);
|
||||
div = prediv / _P;
|
||||
prediv = (c->frequency * _R_VAL) / (_ri / 1000);
|
||||
div = prediv / _P_VAL;
|
||||
reg1[1] |= (div >> 9) & 0x03;
|
||||
reg1[2] = div >> 1;
|
||||
reg1[3] = (div << 7);
|
||||
priv->frequency = ((div * _P) * (_ri / 1000)) / _R;
|
||||
priv->frequency = ((div * _P_VAL) * (_ri / 1000)) / _R_VAL;
|
||||
|
||||
// Finally, calculate and store the value for A
|
||||
reg1[3] |= (prediv - (div*_P)) & 0x7f;
|
||||
reg1[3] |= (prediv - (div*_P_VAL)) & 0x7f;
|
||||
|
||||
#undef _R
|
||||
#undef _P
|
||||
#undef _R_VAL
|
||||
#undef _P_VAL
|
||||
#undef _ri
|
||||
|
||||
if (fe->ops.i2c_gate_ctrl)
|
||||
|
|
|
@ -29,7 +29,7 @@ obj-$(CONFIG_VIDEO_ADV7393) += adv7393.o
|
|||
obj-$(CONFIG_VIDEO_ADV7604) += adv7604.o
|
||||
obj-$(CONFIG_VIDEO_ADV7842) += adv7842.o
|
||||
obj-$(CONFIG_VIDEO_AD9389B) += ad9389b.o
|
||||
obj-$(CONFIG_VIDEO_ADV7511) += adv7511.o
|
||||
obj-$(CONFIG_VIDEO_ADV7511) += adv7511-v4l2.o
|
||||
obj-$(CONFIG_VIDEO_VPX3220) += vpx3220.o
|
||||
obj-$(CONFIG_VIDEO_VS6624) += vs6624.o
|
||||
obj-$(CONFIG_VIDEO_BT819) += bt819.o
|
||||
|
|
|
@ -17,6 +17,11 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file is named adv7511-v4l2.c so it doesn't conflict with the Analog
|
||||
* Device ADV7511 (config fragment CONFIG_DRM_I2C_ADV7511).
|
||||
*/
|
||||
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
|
@ -474,6 +474,7 @@ static long media_device_enum_links32(struct media_device *mdev,
|
|||
{
|
||||
struct media_links_enum links;
|
||||
compat_uptr_t pads_ptr, links_ptr;
|
||||
int ret;
|
||||
|
||||
memset(&links, 0, sizeof(links));
|
||||
|
||||
|
@ -485,7 +486,14 @@ static long media_device_enum_links32(struct media_device *mdev,
|
|||
links.pads = compat_ptr(pads_ptr);
|
||||
links.links = compat_ptr(links_ptr);
|
||||
|
||||
return media_device_enum_links(mdev, &links);
|
||||
ret = media_device_enum_links(mdev, &links);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (copy_to_user(ulinks->reserved, links.reserved,
|
||||
sizeof(ulinks->reserved)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define MEDIA_IOC_ENUM_LINKS32 _IOWR('|', 0x02, struct media_links_enum32)
|
||||
|
|
|
@ -1581,6 +1581,7 @@ static int __coda_start_decoding(struct coda_ctx *ctx)
|
|||
coda_write(dev, 0, CODA_REG_BIT_BIT_STREAM_PARAM);
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
ctx->sequence_offset = ~0U;
|
||||
ctx->initialized = 1;
|
||||
|
||||
/* Update kfifo out pointer from coda bitstream read pointer */
|
||||
|
@ -1966,12 +1967,17 @@ static void coda_finish_decode(struct coda_ctx *ctx)
|
|||
else if (ctx->display_idx < 0)
|
||||
ctx->hold = true;
|
||||
} else if (decoded_idx == -2) {
|
||||
if (ctx->display_idx >= 0 &&
|
||||
ctx->display_idx < ctx->num_internal_frames)
|
||||
ctx->sequence_offset++;
|
||||
/* no frame was decoded, we still return remaining buffers */
|
||||
} else if (decoded_idx < 0 || decoded_idx >= ctx->num_internal_frames) {
|
||||
v4l2_err(&dev->v4l2_dev,
|
||||
"decoded frame index out of range: %d\n", decoded_idx);
|
||||
} else {
|
||||
val = coda_read(dev, CODA_RET_DEC_PIC_FRAME_NUM) - 1;
|
||||
val = coda_read(dev, CODA_RET_DEC_PIC_FRAME_NUM);
|
||||
if (ctx->sequence_offset == -1)
|
||||
ctx->sequence_offset = val;
|
||||
val -= ctx->sequence_offset;
|
||||
spin_lock_irqsave(&ctx->buffer_meta_lock, flags);
|
||||
if (!list_empty(&ctx->buffer_meta_list)) {
|
||||
|
@ -2101,7 +2107,6 @@ irqreturn_t coda_irq_handler(int irq, void *data)
|
|||
if (ctx == NULL) {
|
||||
v4l2_err(&dev->v4l2_dev,
|
||||
"Instance released before the end of transaction\n");
|
||||
mutex_unlock(&dev->coda_mutex);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
|
|
|
@ -523,6 +523,11 @@ static int __init vpss_init(void)
|
|||
return -EBUSY;
|
||||
|
||||
oper_cfg.vpss_regs_base2 = ioremap(VPSS_CLK_CTRL, 4);
|
||||
if (unlikely(!oper_cfg.vpss_regs_base2)) {
|
||||
release_mem_region(VPSS_CLK_CTRL, 4);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
writel(VPSS_CLK_CTRL_VENCCLKEN |
|
||||
VPSS_CLK_CTRL_DACCLKEN, oper_cfg.vpss_regs_base2);
|
||||
|
||||
|
|
|
@ -209,7 +209,6 @@ struct mcam_vb_buffer {
|
|||
struct list_head queue;
|
||||
struct mcam_dma_desc *dma_desc; /* Descriptor virtual address */
|
||||
dma_addr_t dma_desc_pa; /* Descriptor physical address */
|
||||
int dma_desc_nent; /* Number of mapped descriptors */
|
||||
};
|
||||
|
||||
static inline struct mcam_vb_buffer *vb_to_mvb(struct vb2_v4l2_buffer *vb)
|
||||
|
@ -616,9 +615,11 @@ static void mcam_dma_contig_done(struct mcam_camera *cam, int frame)
|
|||
static void mcam_sg_next_buffer(struct mcam_camera *cam)
|
||||
{
|
||||
struct mcam_vb_buffer *buf;
|
||||
struct sg_table *sg_table;
|
||||
|
||||
buf = list_first_entry(&cam->buffers, struct mcam_vb_buffer, queue);
|
||||
list_del_init(&buf->queue);
|
||||
sg_table = vb2_dma_sg_plane_desc(&buf->vb_buf.vb2_buf, 0);
|
||||
/*
|
||||
* Very Bad Not Good Things happen if you don't clear
|
||||
* C1_DESC_ENA before making any descriptor changes.
|
||||
|
@ -626,7 +627,7 @@ static void mcam_sg_next_buffer(struct mcam_camera *cam)
|
|||
mcam_reg_clear_bit(cam, REG_CTRL1, C1_DESC_ENA);
|
||||
mcam_reg_write(cam, REG_DMA_DESC_Y, buf->dma_desc_pa);
|
||||
mcam_reg_write(cam, REG_DESC_LEN_Y,
|
||||
buf->dma_desc_nent*sizeof(struct mcam_dma_desc));
|
||||
sg_table->nents * sizeof(struct mcam_dma_desc));
|
||||
mcam_reg_write(cam, REG_DESC_LEN_U, 0);
|
||||
mcam_reg_write(cam, REG_DESC_LEN_V, 0);
|
||||
mcam_reg_set_bit(cam, REG_CTRL1, C1_DESC_ENA);
|
||||
|
|
|
@ -283,6 +283,14 @@ static int vidioc_g_frequency(struct file *file, void *priv,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void raremono_device_release(struct v4l2_device *v4l2_dev)
|
||||
{
|
||||
struct raremono_device *radio = to_raremono_dev(v4l2_dev);
|
||||
|
||||
kfree(radio->buffer);
|
||||
kfree(radio);
|
||||
}
|
||||
|
||||
/* File system interface */
|
||||
static const struct v4l2_file_operations usb_raremono_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
|
@ -307,12 +315,14 @@ static int usb_raremono_probe(struct usb_interface *intf,
|
|||
struct raremono_device *radio;
|
||||
int retval = 0;
|
||||
|
||||
radio = devm_kzalloc(&intf->dev, sizeof(struct raremono_device), GFP_KERNEL);
|
||||
if (radio)
|
||||
radio->buffer = devm_kmalloc(&intf->dev, BUFFER_LENGTH, GFP_KERNEL);
|
||||
|
||||
if (!radio || !radio->buffer)
|
||||
radio = kzalloc(sizeof(*radio), GFP_KERNEL);
|
||||
if (!radio)
|
||||
return -ENOMEM;
|
||||
radio->buffer = kmalloc(BUFFER_LENGTH, GFP_KERNEL);
|
||||
if (!radio->buffer) {
|
||||
kfree(radio);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
radio->usbdev = interface_to_usbdev(intf);
|
||||
radio->intf = intf;
|
||||
|
@ -336,7 +346,8 @@ static int usb_raremono_probe(struct usb_interface *intf,
|
|||
if (retval != 3 ||
|
||||
(get_unaligned_be16(&radio->buffer[1]) & 0xfff) == 0x0242) {
|
||||
dev_info(&intf->dev, "this is not Thanko's Raremono.\n");
|
||||
return -ENODEV;
|
||||
retval = -ENODEV;
|
||||
goto free_mem;
|
||||
}
|
||||
|
||||
dev_info(&intf->dev, "Thanko's Raremono connected: (%04X:%04X)\n",
|
||||
|
@ -345,7 +356,7 @@ static int usb_raremono_probe(struct usb_interface *intf,
|
|||
retval = v4l2_device_register(&intf->dev, &radio->v4l2_dev);
|
||||
if (retval < 0) {
|
||||
dev_err(&intf->dev, "couldn't register v4l2_device\n");
|
||||
return retval;
|
||||
goto free_mem;
|
||||
}
|
||||
|
||||
mutex_init(&radio->lock);
|
||||
|
@ -357,6 +368,7 @@ static int usb_raremono_probe(struct usb_interface *intf,
|
|||
radio->vdev.ioctl_ops = &usb_raremono_ioctl_ops;
|
||||
radio->vdev.lock = &radio->lock;
|
||||
radio->vdev.release = video_device_release_empty;
|
||||
radio->v4l2_dev.release = raremono_device_release;
|
||||
|
||||
usb_set_intfdata(intf, &radio->v4l2_dev);
|
||||
|
||||
|
@ -372,6 +384,10 @@ static int usb_raremono_probe(struct usb_interface *intf,
|
|||
}
|
||||
dev_err(&intf->dev, "could not register video device\n");
|
||||
v4l2_device_unregister(&radio->v4l2_dev);
|
||||
|
||||
free_mem:
|
||||
kfree(radio->buffer);
|
||||
kfree(radio);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
@ -553,6 +553,7 @@ int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)
|
|||
|
||||
/* Register with V4L2 subsystem as RADIO device */
|
||||
if (video_register_device(&gradio_dev, VFL_TYPE_RADIO, radio_nr)) {
|
||||
v4l2_device_unregister(&fmdev->v4l2_dev);
|
||||
fmerr("Could not register video device\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
@ -566,6 +567,8 @@ int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)
|
|||
if (ret < 0) {
|
||||
fmerr("(fmdev): Can't init ctrl handler\n");
|
||||
v4l2_ctrl_handler_free(&fmdev->ctrl_handler);
|
||||
video_unregister_device(fmdev->radio_dev);
|
||||
v4l2_device_unregister(&fmdev->v4l2_dev);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
|
|
|
@ -630,6 +630,12 @@ static int au0828_usb_probe(struct usb_interface *interface,
|
|||
/* Setup */
|
||||
au0828_card_setup(dev);
|
||||
|
||||
/*
|
||||
* Store the pointer to the au0828_dev so it can be accessed in
|
||||
* au0828_usb_disconnect
|
||||
*/
|
||||
usb_set_intfdata(interface, dev);
|
||||
|
||||
/* Analog TV */
|
||||
retval = au0828_analog_register(dev, interface);
|
||||
if (retval) {
|
||||
|
@ -647,12 +653,6 @@ static int au0828_usb_probe(struct usb_interface *interface,
|
|||
/* Remote controller */
|
||||
au0828_rc_register(dev);
|
||||
|
||||
/*
|
||||
* Store the pointer to the au0828_dev so it can be accessed in
|
||||
* au0828_usb_disconnect
|
||||
*/
|
||||
usb_set_intfdata(interface, dev);
|
||||
|
||||
pr_info("Registered device AU0828 [%s]\n",
|
||||
dev->board.name == NULL ? "Unset" : dev->board.name);
|
||||
|
||||
|
|
|
@ -909,7 +909,6 @@ static void cpia2_usb_disconnect(struct usb_interface *intf)
|
|||
cpia2_unregister_camera(cam);
|
||||
v4l2_device_disconnect(&cam->v4l2_dev);
|
||||
mutex_unlock(&cam->v4l2_lock);
|
||||
v4l2_device_put(&cam->v4l2_dev);
|
||||
|
||||
if(cam->buffers) {
|
||||
DBG("Wakeup waiting processes\n");
|
||||
|
@ -921,6 +920,8 @@ static void cpia2_usb_disconnect(struct usb_interface *intf)
|
|||
DBG("Releasing interface\n");
|
||||
usb_driver_release_interface(&cpia2_driver, intf);
|
||||
|
||||
v4l2_device_put(&cam->v4l2_dev);
|
||||
|
||||
LOG("CPiA2 camera disconnected.\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -287,12 +287,15 @@ EXPORT_SYMBOL(dvb_usb_device_init);
|
|||
void dvb_usb_device_exit(struct usb_interface *intf)
|
||||
{
|
||||
struct dvb_usb_device *d = usb_get_intfdata(intf);
|
||||
const char *name = "generic DVB-USB module";
|
||||
const char *default_name = "generic DVB-USB module";
|
||||
char name[40];
|
||||
|
||||
usb_set_intfdata(intf, NULL);
|
||||
if (d != NULL && d->desc != NULL) {
|
||||
name = d->desc->name;
|
||||
strscpy(name, d->desc->name, sizeof(name));
|
||||
dvb_usb_exit(d);
|
||||
} else {
|
||||
strscpy(name, default_name, sizeof(name));
|
||||
}
|
||||
info("%s successfully deinitialized and disconnected.", name);
|
||||
|
||||
|
|
|
@ -2103,16 +2103,15 @@ struct v4l2_ctrl *v4l2_ctrl_new_custom(struct v4l2_ctrl_handler *hdl,
|
|||
v4l2_ctrl_fill(cfg->id, &name, &type, &min, &max, &step,
|
||||
&def, &flags);
|
||||
|
||||
is_menu = (cfg->type == V4L2_CTRL_TYPE_MENU ||
|
||||
cfg->type == V4L2_CTRL_TYPE_INTEGER_MENU);
|
||||
is_menu = (type == V4L2_CTRL_TYPE_MENU ||
|
||||
type == V4L2_CTRL_TYPE_INTEGER_MENU);
|
||||
if (is_menu)
|
||||
WARN_ON(step);
|
||||
else
|
||||
WARN_ON(cfg->menu_skip_mask);
|
||||
if (cfg->type == V4L2_CTRL_TYPE_MENU && qmenu == NULL)
|
||||
if (type == V4L2_CTRL_TYPE_MENU && !qmenu) {
|
||||
qmenu = v4l2_ctrl_get_menu(cfg->id);
|
||||
else if (cfg->type == V4L2_CTRL_TYPE_INTEGER_MENU &&
|
||||
qmenu_int == NULL) {
|
||||
} else if (type == V4L2_CTRL_TYPE_INTEGER_MENU && !qmenu_int) {
|
||||
handler_set_err(hdl, -EINVAL);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -629,13 +629,18 @@ static int __init memstick_init(void)
|
|||
return -ENOMEM;
|
||||
|
||||
rc = bus_register(&memstick_bus_type);
|
||||
if (!rc)
|
||||
rc = class_register(&memstick_host_class);
|
||||
if (rc)
|
||||
goto error_destroy_workqueue;
|
||||
|
||||
if (!rc)
|
||||
return 0;
|
||||
rc = class_register(&memstick_host_class);
|
||||
if (rc)
|
||||
goto error_bus_unregister;
|
||||
|
||||
return 0;
|
||||
|
||||
error_bus_unregister:
|
||||
bus_unregister(&memstick_bus_type);
|
||||
error_destroy_workqueue:
|
||||
destroy_workqueue(workqueue);
|
||||
|
||||
return rc;
|
||||
|
|
|
@ -1038,7 +1038,7 @@ int arizona_dev_init(struct arizona *arizona)
|
|||
unsigned int reg, val, mask;
|
||||
int (*apply_patch)(struct arizona *) = NULL;
|
||||
const struct mfd_cell *subdevs = NULL;
|
||||
int n_subdevs, ret, i;
|
||||
int n_subdevs = 0, ret, i;
|
||||
|
||||
dev_set_drvdata(arizona->dev, arizona);
|
||||
mutex_init(&arizona->clk_lock);
|
||||
|
|
|
@ -111,6 +111,8 @@ static int hi655x_pmic_probe(struct platform_device *pdev)
|
|||
|
||||
pmic->regmap = devm_regmap_init_mmio_clk(dev, NULL, base,
|
||||
&hi655x_regmap_config);
|
||||
if (IS_ERR(pmic->regmap))
|
||||
return PTR_ERR(pmic->regmap);
|
||||
|
||||
regmap_read(pmic->regmap, HI655X_BUS_ADDR(HI655X_VER_REG), &pmic->ver);
|
||||
if ((pmic->ver < PMU_VER_START) || (pmic->ver > PMU_VER_END)) {
|
||||
|
|
|
@ -179,6 +179,7 @@ static int mfd_add_device(struct device *parent, int id,
|
|||
for_each_child_of_node(parent->of_node, np) {
|
||||
if (of_device_is_compatible(np, cell->of_compatible)) {
|
||||
pdev->dev.of_node = np;
|
||||
pdev->dev.fwnode = &np->fwnode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3788,8 +3788,8 @@ static u32 bond_rr_gen_slave_id(struct bonding *bond)
|
|||
static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev)
|
||||
{
|
||||
struct bonding *bond = netdev_priv(bond_dev);
|
||||
struct iphdr *iph = ip_hdr(skb);
|
||||
struct slave *slave;
|
||||
int slave_cnt;
|
||||
u32 slave_id;
|
||||
|
||||
/* Start with the curr_active_slave that joined the bond as the
|
||||
|
@ -3798,23 +3798,32 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev
|
|||
* send the join/membership reports. The curr_active_slave found
|
||||
* will send all of this type of traffic.
|
||||
*/
|
||||
if (iph->protocol == IPPROTO_IGMP && skb->protocol == htons(ETH_P_IP)) {
|
||||
slave = rcu_dereference(bond->curr_active_slave);
|
||||
if (slave)
|
||||
bond_dev_queue_xmit(bond, skb, slave->dev);
|
||||
else
|
||||
bond_xmit_slave_id(bond, skb, 0);
|
||||
} else {
|
||||
int slave_cnt = ACCESS_ONCE(bond->slave_cnt);
|
||||
if (skb->protocol == htons(ETH_P_IP)) {
|
||||
int noff = skb_network_offset(skb);
|
||||
struct iphdr *iph;
|
||||
|
||||
if (likely(slave_cnt)) {
|
||||
slave_id = bond_rr_gen_slave_id(bond);
|
||||
bond_xmit_slave_id(bond, skb, slave_id % slave_cnt);
|
||||
} else {
|
||||
bond_tx_drop(bond_dev, skb);
|
||||
if (unlikely(!pskb_may_pull(skb, noff + sizeof(*iph))))
|
||||
goto non_igmp;
|
||||
|
||||
iph = ip_hdr(skb);
|
||||
if (iph->protocol == IPPROTO_IGMP) {
|
||||
slave = rcu_dereference(bond->curr_active_slave);
|
||||
if (slave)
|
||||
bond_dev_queue_xmit(bond, skb, slave->dev);
|
||||
else
|
||||
bond_xmit_slave_id(bond, skb, 0);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
}
|
||||
|
||||
non_igmp:
|
||||
slave_cnt = ACCESS_ONCE(bond->slave_cnt);
|
||||
if (likely(slave_cnt)) {
|
||||
slave_id = bond_rr_gen_slave_id(bond);
|
||||
bond_xmit_slave_id(bond, skb, slave_id % slave_cnt);
|
||||
} else {
|
||||
bond_tx_drop(bond_dev, skb);
|
||||
}
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1464,7 +1464,7 @@ static void __exit cfhsi_exit_module(void)
|
|||
rtnl_lock();
|
||||
list_for_each_safe(list_node, n, &cfhsi_list) {
|
||||
cfhsi = list_entry(list_node, struct cfhsi, list);
|
||||
unregister_netdev(cfhsi->ndev);
|
||||
unregister_netdevice(cfhsi->ndev);
|
||||
}
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue