Merge 4.19.226 into android-4.19-stable
Changes in 4.19.226
Bluetooth: bfusb: fix division by zero in send path
USB: core: Fix bug in resuming hub's handling of wakeup requests
USB: Fix "slab-out-of-bounds Write" bug in usb_hcd_poll_rh_status
can: bcm: switch timer to HRTIMER_MODE_SOFT and remove hrtimer_tasklet
veth: Do not record rx queue hint in veth_xmit
mfd: intel-lpss: Fix too early PM enablement in the ACPI ->probe()
can: gs_usb: fix use of uninitialized variable, detach device on reception of invalid USB data
can: gs_usb: gs_can_start_xmit(): zero-initialize hf->{flags,reserved}
random: fix data race on crng_node_pool
random: fix data race on crng init time
staging: wlan-ng: Avoid bitwise vs logical OR warning in hfa384x_usb_throttlefn()
drm/i915: Avoid bitwise vs logical OR warning in snb_wm_latency_quirk()
kbuild: Add $(KBUILD_HOSTLDFLAGS) to 'has_libelf' test
orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc()
KVM: s390: Clarify SIGP orders versus STOP/RESTART
media: uvcvideo: fix division by zero at stream start
rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled
firmware: qemu_fw_cfg: fix sysfs information leak
firmware: qemu_fw_cfg: fix NULL-pointer deref on duplicate entries
firmware: qemu_fw_cfg: fix kobject leak in probe error path
ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Master after reboot from Windows
HID: uhid: Fix worker destroying device without any protection
HID: wacom: Reset expected and received contact counts at the same time
HID: wacom: Ignore the confidence flag when a touch is removed
HID: wacom: Avoid using stale array indicies to read contact count
f2fs: fix to do sanity check in is_alive()
nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind()
mtd: rawnand: gpmi: Remove explicit default gpmi clock setting for i.MX6
x86/gpu: Reserve stolen memory for first integrated Intel GPU
rtc: cmos: take rtc_lock while reading from CMOS
media: flexcop-usb: fix control-message timeouts
media: mceusb: fix control-message timeouts
media: em28xx: fix control-message timeouts
media: cpia2: fix control-message timeouts
media: s2255: fix control-message timeouts
media: dib0700: fix undefined behavior in tuner shutdown
media: redrat3: fix control-message timeouts
media: pvrusb2: fix control-message timeouts
media: stk1160: fix control-message timeouts
can: softing_cs: softingcs_probe(): fix memleak on registration failure
lkdtm: Fix content of section containing lkdtm_rodata_do_nothing()
PCI: Add function 1 DMA alias quirk for Marvell 88SE9125 SATA controller
shmem: fix a race between shmem_unused_huge_shrink and shmem_evict_inode
drm/panel: innolux-p079zca: Delete panel on attach() failure
Bluetooth: cmtp: fix possible panic when cmtp_init_sockets() fails
clk: bcm-2835: Pick the closest clock rate
clk: bcm-2835: Remove rounding up the dividers
wcn36xx: Indicate beacon not connection loss on MISSED_BEACON_IND
wcn36xx: Release DMA channel descriptor allocations
media: videobuf2: Fix the size printk format
media: em28xx: fix memory leak in em28xx_init_dev
arm64: dts: meson-gxbb-wetek: fix missing GPIO binding
Bluetooth: stop proccessing malicious adv data
tee: fix put order in teedev_close_context()
media: dmxdev: fix UAF when dvb_register_device() fails
crypto: qce - fix uaf on qce_ahash_register_one
tty: serial: atmel: Check return code of dmaengine_submit()
tty: serial: atmel: Call dma_async_issue_pending()
media: rcar-csi2: Correct the selection of hsfreqrange
media: si470x-i2c: fix possible memory leak in si470x_i2c_probe()
media: mtk-vcodec: call v4l2_m2m_ctx_release first when file is released
netfilter: bridge: add support for pppoe filtering
arm64: dts: qcom: msm8916: fix MMC controller aliases
drm/amdgpu: Fix a NULL pointer dereference in amdgpu_connector_lcd_native_mode()
drm/radeon/radeon_kms: Fix a NULL pointer dereference in radeon_driver_open_kms()
tty: serial: uartlite: allow 64 bit address
serial: amba-pl011: do not request memory region twice
floppy: Fix hang in watchdog when disk is ejected
media: dib8000: Fix a memleak in dib8000_init()
media: saa7146: mxb: Fix a NULL pointer dereference in mxb_attach()
media: si2157: Fix "warm" tuner state detection
sched/rt: Try to restart rt period timer when rt runtime exceeded
xfrm: fix a small bug in xfrm_sa_len()
crypto: stm32/cryp - fix double pm exit
media: dw2102: Fix use after free
media: msi001: fix possible null-ptr-deref in msi001_probe()
media: coda/imx-vdoa: Handle dma_set_coherent_mask error codes
drm/msm/dpu: fix safe status debugfs file
xfrm: interface with if_id 0 should return error
xfrm: state and policy should fail if XFRMA_IF_ID 0
usb: ftdi-elan: fix memory leak on device disconnect
ARM: dts: armada-38x: Add generic compatible to UART nodes
mmc: meson-mx-sdio: add IRQ check
x86/mce/inject: Avoid out-of-bounds write when setting flags
pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in __nonstatic_find_io_region()
pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in nonstatic_find_mem_region()
netfilter: ipt_CLUSTERIP: fix refcount leak in clusterip_tg_check()
ppp: ensure minimum packet size in ppp_write()
staging: greybus: audio: Check null pointer
fsl/fman: Check for null pointer after calling devm_ioremap
Bluetooth: hci_bcm: Check for error irq
spi: spi-meson-spifc: Add missing pm_runtime_disable() in meson_spifc_probe
tpm: add request_locality before write TPM_INT_ENABLE
can: softing: softing_startstop(): fix set but not used variable warning
can: xilinx_can: xcan_probe(): check for error irq
pcmcia: fix setting of kthread task states
net: mcs7830: handle usb read errors properly
ext4: avoid trim error on fs with small groups
ALSA: jack: Add missing rwsem around snd_ctl_remove() calls
ALSA: PCM: Add missing rwsem around snd_ctl_remove() calls
ALSA: hda: Add missing rwsem around snd_ctl_remove() calls
RDMA/hns: Validate the pkey index
powerpc/prom_init: Fix improper check of prom_getprop()
ASoC: uniphier: drop selecting non-existing SND_SOC_UNIPHIER_AIO_DMA
ALSA: oss: fix compile error when OSS_DEBUG is enabled
char/mwave: Adjust io port register size
iommu/io-pgtable-arm: Fix table descriptor paddr formatting
scsi: ufs: Fix race conditions related to driver data
RDMA/core: Let ib_find_gid() continue search even after empty entry
ASoC: rt5663: Handle device_property_read_u32_array error codes
dmaengine: pxa/mmp: stop referencing config->slave_id
iommu/iova: Fix race between FQ timeout and teardown
ASoC: mediatek: Check for error clk pointer
ASoC: samsung: idma: Check of ioremap return value
misc: lattice-ecp3-config: Fix task hung when firmware load failed
mips: lantiq: add support for clk_set_parent()
mips: bcm63xx: add support for clk_set_parent()
RDMA/cxgb4: Set queue pair state when being queried
Bluetooth: Fix debugfs entry leak in hci_register_dev()
fs: dlm: filter user dlm messages for kernel locks
ar5523: Fix null-ptr-deref with unexpected WDCMSG_TARGET_START reply
drm/nouveau/pmu/gm200-: avoid touching PMU outside of DEVINIT/PREOS/ACR
usb: gadget: f_fs: Use stream_open() for endpoint files
HID: apple: Do not reset quirks when the Fn key is not found
media: b2c2: Add missing check in flexcop_pci_isr:
mlxsw: pci: Add shutdown method in PCI driver
drm/bridge: megachips: Ensure both bridges are probed before registration
gpiolib: acpi: Do not set the IRQ type if the IRQ is already in use
HSI: core: Fix return freed object in hsi_new_client
mwifiex: Fix skb_over_panic in mwifiex_usb_recv()
rsi: Fix out-of-bounds read in rsi_read_pkt()
usb: uhci: add aspeed ast2600 uhci support
floppy: Add max size check for user space request
media: uvcvideo: Increase UVC_CTRL_CONTROL_TIMEOUT to 5 seconds.
media: saa7146: hexium_orion: Fix a NULL pointer dereference in hexium_attach()
media: m920x: don't use stack on USB reads
iwlwifi: mvm: synchronize with FW after multicast commands
ath10k: Fix tx hanging
net-sysfs: update the queue counts in the unregistration path
x86/mce: Mark mce_panic() noinstr
x86/mce: Mark mce_end() noinstr
x86/mce: Mark mce_read_aux() noinstr
net: bonding: debug: avoid printing debug logs when bond is not notifying peers
bpf: Do not WARN in bpf_warn_invalid_xdp_action()
HID: quirks: Allow inverting the absolute X/Y values
media: igorplugusb: receiver overflow should be reported
media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach()
mmc: core: Fixup storing of OCR for MMC_QUIRK_NONSTD_SDIO
audit: ensure userspace is penalized the same as the kernel when under pressure
arm64: tegra: Adjust length of CCPLEX cluster MMIO region
usb: hub: Add delay for SuperSpeed hub resume to let links transit to U0
ath9k: Fix out-of-bound memcpy in ath9k_hif_usb_rx_stream
iwlwifi: fix leaks/bad data after failed firmware load
iwlwifi: remove module loading failure message
iwlwifi: mvm: Fix calculation of frame length
um: registers: Rename function names to avoid conflicts and build problems
jffs2: GC deadlock reading a page that is used in jffs2_write_begin()
ACPICA: actypes.h: Expand the ACPI_ACCESS_ definitions
ACPICA: Utilities: Avoid deleting the same object twice in a row
ACPICA: Executer: Fix the REFCLASS_REFOF case in acpi_ex_opcode_1A_0T_1R()
ACPICA: Hardware: Do not flush CPU cache when entering S4 and S5
drm/amdgpu: fixup bad vram size on gmc v8
ACPI: battery: Add the ThinkPad "Not Charging" quirk
btrfs: remove BUG_ON() in find_parent_nodes()
btrfs: remove BUG_ON(!eie) in find_parent_nodes
net: mdio: Demote probed message to debug print
mac80211: allow non-standard VHT MCS-10/11
dm btree: add a defensive bounds check to insert_at()
dm space map common: add bounds check to sm_ll_lookup_bitmap()
net: phy: marvell: configure RGMII delays for 88E1118
net: gemini: allow any RGMII interface mode
regulator: qcom_smd: Align probe function with rpmh-regulator
serial: pl010: Drop CR register reset on set_termios
serial: core: Keep mctrl register state and cached copy in sync
parisc: Avoid calling faulthandler_disabled() twice
powerpc/6xx: add missing of_node_put
powerpc/powernv: add missing of_node_put
powerpc/cell: add missing of_node_put
powerpc/btext: add missing of_node_put
powerpc/watchdog: Fix missed watchdog reset due to memory ordering race
i2c: i801: Don't silently correct invalid transfer size
powerpc/smp: Move setup_profiling_timer() under CONFIG_PROFILING
i2c: mpc: Correct I2C reset procedure
w1: Misuse of get_user()/put_user() reported by sparse
ALSA: seq: Set upper limit of processed events
powerpc: handle kdump appropriately with crash_kexec_post_notifiers option
MIPS: OCTEON: add put_device() after of_find_device_by_node()
i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters
MIPS: Octeon: Fix build errors using clang
scsi: sr: Don't use GFP_DMA
ASoC: mediatek: mt8173: fix device_node leak
power: bq25890: Enable continuous conversion for ADC at charging
rpmsg: core: Clean up resources on announce_create failure.
ubifs: Error path in ubifs_remount_rw() seems to wrongly free write buffers
serial: Fix incorrect rs485 polarity on uart open
cputime, cpuacct: Include guest time in user time in cpuacct.stat
iwlwifi: mvm: Increase the scan timeout guard to 30 seconds
s390/mm: fix 2KB pgtable release race
drm/etnaviv: limit submit sizes
ext4: make sure to reset inode lockdep class when quota enabling fails
ext4: make sure quota gets properly shutdown on error
ext4: set csum seed in tmp inode while migrating to extents
ext4: Fix BUG_ON in ext4_bread when write quota data
ext4: don't use the orphan list when migrating an inode
crypto: stm32/crc32 - Fix kernel BUG triggered in probe()
ASoC: dpcm: prevent snd_soc_dpcm use after free
regulator: core: Let boot-on regulators be powered off
drm/radeon: fix error handling in radeon_driver_open_kms
ARM: dts: Fix vcsi regulator to be always-on for droid4 to prevent hangs
firmware: Update Kconfig help text for Google firmware
media: rcar-csi2: Optimize the selection PHTW register
Documentation: refer to config RANDOMIZE_BASE for kernel address-space randomization
RDMA/hns: Modify the mapping attribute of doorbell to device
RDMA/rxe: Fix a typo in opcode name
dmaengine: stm32-mdma: fix STM32_MDMA_CTBR_TSEL_MASK
powerpc/cell: Fix clang -Wimplicit-fallthrough warning
powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses
net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module
parisc: pdc_stable: Fix memory leak in pdcs_register_pathentries
af_unix: annote lockless accesses to unix_tot_inflight & gc_in_progress
net: axienet: Wait for PhyRstCmplt after core reset
net: axienet: fix number of TX ring slots for available check
rtc: pxa: fix null pointer dereference
netns: add schedule point in ops_exit_list()
libcxgb: Don't accidentally set RTO_ONLINK in cxgb_find_route()
dmaengine: at_xdmac: Don't start transactions at tx_submit level
dmaengine: at_xdmac: Print debug message after realeasing the lock
dmaengine: at_xdmac: Fix lld view setting
dmaengine: at_xdmac: Fix at_xdmac_lld struct definition
net_sched: restore "mpu xxx" handling
bcmgenet: add WOL IRQ check
scripts/dtc: dtx_diff: remove broken example from help text
lib82596: Fix IRQ check in sni_82596_probe
mtd: nand: bbt: Fix corner case in bad block table handling
mips,s390,sh,sparc: gup: Work around the "COW can break either way" issue
fuse: fix bad inode
fuse: fix live lock in fuse_iget()
Linux 4.19.226
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie7599317fe668c46e0ceca652b4172ad2ce6533d
This commit is contained in:
@@ -468,7 +468,7 @@ Spectre variant 2
|
||||
before invoking any firmware code to prevent Spectre variant 2 exploits
|
||||
using the firmware.
|
||||
|
||||
Using kernel address space randomization (CONFIG_RANDOMIZE_SLAB=y
|
||||
Using kernel address space randomization (CONFIG_RANDOMIZE_BASE=y
|
||||
and CONFIG_SLAB_FREELIST_RANDOM=y in the kernel configuration) makes
|
||||
attacks on the kernel generally more difficult.
|
||||
|
||||
|
||||
4
Makefile
4
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 19
|
||||
SUBLEVEL = 225
|
||||
SUBLEVEL = 226
|
||||
EXTRAVERSION =
|
||||
NAME = "People's Front"
|
||||
|
||||
@@ -1069,7 +1069,7 @@ HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf)
|
||||
|
||||
ifdef CONFIG_STACK_VALIDATION
|
||||
has_libelf := $(call try-run,\
|
||||
echo "int main() {}" | $(HOSTCC) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0)
|
||||
echo "int main() {}" | $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0)
|
||||
ifeq ($(has_libelf),1)
|
||||
objtool_target := tools/objtool FORCE
|
||||
else
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
};
|
||||
|
||||
uart0: serial@12000 {
|
||||
compatible = "marvell,armada-38x-uart";
|
||||
compatible = "marvell,armada-38x-uart", "ns16550a";
|
||||
reg = <0x12000 0x100>;
|
||||
reg-shift = <2>;
|
||||
interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
|
||||
@@ -173,7 +173,7 @@
|
||||
};
|
||||
|
||||
uart1: serial@12100 {
|
||||
compatible = "marvell,armada-38x-uart";
|
||||
compatible = "marvell,armada-38x-uart", "ns16550a";
|
||||
reg = <0x12100 0x100>;
|
||||
reg-shift = <2>;
|
||||
interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
@@ -165,12 +165,12 @@
|
||||
regulator-enable-ramp-delay = <1000>;
|
||||
};
|
||||
|
||||
/* Used by DSS */
|
||||
/* Used by DSS and is the "zerov_regulator" trigger for SoC off mode */
|
||||
vcsi: VCSI {
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-enable-ramp-delay = <1000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
vdac: VDAC {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "meson-gxbb.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
|
||||
@@ -372,7 +372,7 @@
|
||||
|
||||
ccplex@e000000 {
|
||||
compatible = "nvidia,tegra186-ccplex-cluster";
|
||||
reg = <0x0 0x0e000000 0x0 0x3fffff>;
|
||||
reg = <0x0 0x0e000000 0x0 0x400000>;
|
||||
|
||||
nvidia,bpmp = <&bpmp>;
|
||||
};
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
#size-cells = <2>;
|
||||
|
||||
aliases {
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
sdhc2 = &sdhc_2; /* SDC2 SD card slot */
|
||||
mmc0 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
mmc1 = &sdhc_2; /* SDC2 SD card slot */
|
||||
};
|
||||
|
||||
chosen { };
|
||||
|
||||
@@ -387,6 +387,12 @@ struct clk *clk_get_parent(struct clk *clk)
|
||||
}
|
||||
EXPORT_SYMBOL(clk_get_parent);
|
||||
|
||||
int clk_set_parent(struct clk *clk, struct clk *parent)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(clk_set_parent);
|
||||
|
||||
unsigned long clk_get_rate(struct clk *clk)
|
||||
{
|
||||
if (!clk)
|
||||
|
||||
@@ -328,6 +328,7 @@ static int __init octeon_ehci_device_init(void)
|
||||
|
||||
pd->dev.platform_data = &octeon_ehci_pdata;
|
||||
octeon_ehci_hw_start(&pd->dev);
|
||||
put_device(&pd->dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -391,6 +392,7 @@ static int __init octeon_ohci_device_init(void)
|
||||
|
||||
pd->dev.platform_data = &octeon_ohci_pdata;
|
||||
octeon_ohci_hw_start(&pd->dev);
|
||||
put_device(&pd->dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -543,6 +543,7 @@ static int __init dwc3_octeon_device_init(void)
|
||||
devm_iounmap(&pdev->dev, base);
|
||||
devm_release_mem_region(&pdev->dev, res->start,
|
||||
resource_size(res));
|
||||
put_device(&pdev->dev);
|
||||
}
|
||||
} while (node != NULL);
|
||||
|
||||
|
||||
@@ -315,7 +315,7 @@ enum cvmx_chip_types_enum {
|
||||
|
||||
/* Functions to return string based on type */
|
||||
#define ENUM_BRD_TYPE_CASE(x) \
|
||||
case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */
|
||||
case x: return (&#x[16]); /* Skip CVMX_BOARD_TYPE_ */
|
||||
static inline const char *cvmx_board_type_to_string(enum
|
||||
cvmx_board_types_enum type)
|
||||
{
|
||||
@@ -404,7 +404,7 @@ static inline const char *cvmx_board_type_to_string(enum
|
||||
}
|
||||
|
||||
#define ENUM_CHIP_TYPE_CASE(x) \
|
||||
case x: return(#x + 15); /* Skip CVMX_CHIP_TYPE */
|
||||
case x: return (&#x[15]); /* Skip CVMX_CHIP_TYPE */
|
||||
static inline const char *cvmx_chip_type_to_string(enum
|
||||
cvmx_chip_types_enum type)
|
||||
{
|
||||
|
||||
@@ -166,6 +166,12 @@ struct clk *clk_get_parent(struct clk *clk)
|
||||
}
|
||||
EXPORT_SYMBOL(clk_get_parent);
|
||||
|
||||
int clk_set_parent(struct clk *clk, struct clk *parent)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(clk_set_parent);
|
||||
|
||||
static inline u32 get_counter_resolution(void)
|
||||
{
|
||||
u32 res;
|
||||
|
||||
@@ -274,7 +274,14 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
|
||||
next = pgd_addr_end(addr, end);
|
||||
if (pgd_none(pgd))
|
||||
goto slow;
|
||||
if (!gup_pud_range(pgd, addr, next, write, pages, &nr))
|
||||
/*
|
||||
* The FAST_GUP case requires FOLL_WRITE even for pure reads,
|
||||
* because get_user_pages() may need to cause an early COW in
|
||||
* order to avoid confusing the normal COW routines. So only
|
||||
* targets that are already writable are safe to do by just
|
||||
* looking at the page tables.
|
||||
*/
|
||||
if (!gup_pud_range(pgd, addr, next, 1, pages, &nr))
|
||||
goto slow;
|
||||
} while (pgdp++, addr = next, addr != end);
|
||||
local_irq_enable();
|
||||
|
||||
@@ -750,7 +750,7 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
|
||||
* unless pagefault_disable() was called before.
|
||||
*/
|
||||
|
||||
if (fault_space == 0 && !faulthandler_disabled())
|
||||
if (faulthandler_disabled() || fault_space == 0)
|
||||
{
|
||||
/* Clean up and return if in exception table. */
|
||||
if (fixup_exception(regs))
|
||||
|
||||
@@ -79,6 +79,7 @@ fman0: fman@400000 {
|
||||
#size-cells = <0>;
|
||||
compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
|
||||
reg = <0xfc000 0x1000>;
|
||||
fsl,erratum-a009885;
|
||||
};
|
||||
|
||||
xmdio0: mdio@fd000 {
|
||||
@@ -86,6 +87,7 @@ fman0: fman@400000 {
|
||||
#size-cells = <0>;
|
||||
compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
|
||||
reg = <0xfd000 0x1000>;
|
||||
fsl,erratum-a009885;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -258,8 +258,10 @@ int __init btext_find_display(int allow_nonstdout)
|
||||
rc = btext_initialize(np);
|
||||
printk("result: %d\n", rc);
|
||||
}
|
||||
if (rc == 0)
|
||||
if (rc == 0) {
|
||||
of_node_put(np);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -2805,7 +2805,7 @@ static void __init fixup_device_tree_efika_add_phy(void)
|
||||
|
||||
/* Check if the phy-handle property exists - bail if it does */
|
||||
rv = prom_getprop(node, "phy-handle", prop, sizeof(prop));
|
||||
if (!rv)
|
||||
if (rv <= 0)
|
||||
return;
|
||||
|
||||
/*
|
||||
|
||||
@@ -564,6 +564,36 @@ void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *))
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NMI_IPI
|
||||
static void crash_stop_this_cpu(struct pt_regs *regs)
|
||||
#else
|
||||
static void crash_stop_this_cpu(void *dummy)
|
||||
#endif
|
||||
{
|
||||
/*
|
||||
* Just busy wait here and avoid marking CPU as offline to ensure
|
||||
* register data is captured appropriately.
|
||||
*/
|
||||
while (1)
|
||||
cpu_relax();
|
||||
}
|
||||
|
||||
void crash_smp_send_stop(void)
|
||||
{
|
||||
static bool stopped = false;
|
||||
|
||||
if (stopped)
|
||||
return;
|
||||
|
||||
stopped = true;
|
||||
|
||||
#ifdef CONFIG_NMI_IPI
|
||||
smp_send_nmi_ipi(NMI_IPI_ALL_OTHERS, crash_stop_this_cpu, 1000000);
|
||||
#else
|
||||
smp_call_function(crash_stop_this_cpu, NULL, 0);
|
||||
#endif /* CONFIG_NMI_IPI */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NMI_IPI
|
||||
static void nmi_stop_this_cpu(struct pt_regs *regs)
|
||||
{
|
||||
@@ -1070,10 +1100,12 @@ void start_secondary(void *unused)
|
||||
BUG();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PROFILING
|
||||
int setup_profiling_timer(unsigned int multiplier)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SCHED_SMT
|
||||
/* cpumask of CPUs with asymetric SMT dependancy */
|
||||
|
||||
@@ -132,6 +132,10 @@ static void set_cpumask_stuck(const struct cpumask *cpumask, u64 tb)
|
||||
{
|
||||
cpumask_or(&wd_smp_cpus_stuck, &wd_smp_cpus_stuck, cpumask);
|
||||
cpumask_andnot(&wd_smp_cpus_pending, &wd_smp_cpus_pending, cpumask);
|
||||
/*
|
||||
* See wd_smp_clear_cpu_pending()
|
||||
*/
|
||||
smp_mb();
|
||||
if (cpumask_empty(&wd_smp_cpus_pending)) {
|
||||
wd_smp_last_reset_tb = tb;
|
||||
cpumask_andnot(&wd_smp_cpus_pending,
|
||||
@@ -217,13 +221,44 @@ static void wd_smp_clear_cpu_pending(int cpu, u64 tb)
|
||||
|
||||
cpumask_clear_cpu(cpu, &wd_smp_cpus_stuck);
|
||||
wd_smp_unlock(&flags);
|
||||
} else {
|
||||
/*
|
||||
* The last CPU to clear pending should have reset the
|
||||
* watchdog so we generally should not find it empty
|
||||
* here if our CPU was clear. However it could happen
|
||||
* due to a rare race with another CPU taking the
|
||||
* last CPU out of the mask concurrently.
|
||||
*
|
||||
* We can't add a warning for it. But just in case
|
||||
* there is a problem with the watchdog that is causing
|
||||
* the mask to not be reset, try to kick it along here.
|
||||
*/
|
||||
if (unlikely(cpumask_empty(&wd_smp_cpus_pending)))
|
||||
goto none_pending;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
cpumask_clear_cpu(cpu, &wd_smp_cpus_pending);
|
||||
|
||||
/*
|
||||
* Order the store to clear pending with the load(s) to check all
|
||||
* words in the pending mask to check they are all empty. This orders
|
||||
* with the same barrier on another CPU. This prevents two CPUs
|
||||
* clearing the last 2 pending bits, but neither seeing the other's
|
||||
* store when checking if the mask is empty, and missing an empty
|
||||
* mask, which ends with a false positive.
|
||||
*/
|
||||
smp_mb();
|
||||
if (cpumask_empty(&wd_smp_cpus_pending)) {
|
||||
unsigned long flags;
|
||||
|
||||
none_pending:
|
||||
/*
|
||||
* Double check under lock because more than one CPU could see
|
||||
* a clear mask with the lockless check after clearing their
|
||||
* pending bits.
|
||||
*/
|
||||
wd_smp_lock(&flags);
|
||||
if (cpumask_empty(&wd_smp_cpus_pending)) {
|
||||
wd_smp_last_reset_tb = tb;
|
||||
@@ -314,8 +349,12 @@ void arch_touch_nmi_watchdog(void)
|
||||
{
|
||||
unsigned long ticks = tb_ticks_per_usec * wd_timer_period_ms * 1000;
|
||||
int cpu = smp_processor_id();
|
||||
u64 tb = get_tb();
|
||||
u64 tb;
|
||||
|
||||
if (!cpumask_test_cpu(cpu, &watchdog_cpumask))
|
||||
return;
|
||||
|
||||
tb = get_tb();
|
||||
if (tb - per_cpu(wd_timer_tb, cpu) >= ticks) {
|
||||
per_cpu(wd_timer_tb, cpu) = tb;
|
||||
wd_smp_clear_cpu_pending(cpu, tb);
|
||||
|
||||
@@ -1088,6 +1088,7 @@ static int __init cell_iommu_fixed_mapping_init(void)
|
||||
if (hbase < dbase || (hend > (dbase + dsize))) {
|
||||
pr_debug("iommu: hash window doesn't fit in"
|
||||
"real DMA window\n");
|
||||
of_node_put(np);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ static int cbe_system_reset_exception(struct pt_regs *regs)
|
||||
switch (regs->msr & SRR1_WAKEMASK) {
|
||||
case SRR1_WAKEDEC:
|
||||
set_dec(1);
|
||||
break;
|
||||
case SRR1_WAKEEE:
|
||||
/*
|
||||
* Handle these when interrupts get re-enabled and we take
|
||||
|
||||
@@ -220,6 +220,7 @@ void hlwd_pic_probe(void)
|
||||
irq_set_chained_handler(cascade_virq,
|
||||
hlwd_pic_irq_cascade);
|
||||
hlwd_irq_host = host;
|
||||
of_node_put(np);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,6 +400,7 @@ void __init opal_lpc_init(void)
|
||||
if (!of_get_property(np, "primary", NULL))
|
||||
continue;
|
||||
opal_lpc_chip_id = of_get_ibm_chip_id(np);
|
||||
of_node_put(np);
|
||||
break;
|
||||
}
|
||||
if (opal_lpc_chip_id < 0)
|
||||
|
||||
@@ -1900,6 +1900,13 @@ int kvm_s390_is_stop_irq_pending(struct kvm_vcpu *vcpu)
|
||||
return test_bit(IRQ_PEND_SIGP_STOP, &li->pending_irqs);
|
||||
}
|
||||
|
||||
int kvm_s390_is_restart_irq_pending(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
|
||||
|
||||
return test_bit(IRQ_PEND_RESTART, &li->pending_irqs);
|
||||
}
|
||||
|
||||
void kvm_s390_clear_stop_irq(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
|
||||
|
||||
@@ -3844,10 +3844,15 @@ void kvm_s390_vcpu_stop(struct kvm_vcpu *vcpu)
|
||||
spin_lock(&vcpu->kvm->arch.start_stop_lock);
|
||||
online_vcpus = atomic_read(&vcpu->kvm->online_vcpus);
|
||||
|
||||
/* SIGP STOP and SIGP STOP AND STORE STATUS has been fully processed */
|
||||
/*
|
||||
* Set the VCPU to STOPPED and THEN clear the interrupt flag,
|
||||
* now that the SIGP STOP and SIGP STOP AND STORE STATUS orders
|
||||
* have been fully processed. This will ensure that the VCPU
|
||||
* is kept BUSY if another VCPU is inquiring with SIGP SENSE.
|
||||
*/
|
||||
kvm_s390_set_cpuflags(vcpu, CPUSTAT_STOPPED);
|
||||
kvm_s390_clear_stop_irq(vcpu);
|
||||
|
||||
kvm_s390_set_cpuflags(vcpu, CPUSTAT_STOPPED);
|
||||
__disable_ibs_on_vcpu(vcpu);
|
||||
|
||||
for (i = 0; i < online_vcpus; i++) {
|
||||
|
||||
@@ -372,6 +372,7 @@ void kvm_s390_destroy_adapters(struct kvm *kvm);
|
||||
int kvm_s390_ext_call_pending(struct kvm_vcpu *vcpu);
|
||||
extern struct kvm_device_ops kvm_flic_ops;
|
||||
int kvm_s390_is_stop_irq_pending(struct kvm_vcpu *vcpu);
|
||||
int kvm_s390_is_restart_irq_pending(struct kvm_vcpu *vcpu);
|
||||
void kvm_s390_clear_stop_irq(struct kvm_vcpu *vcpu);
|
||||
int kvm_s390_set_irq_state(struct kvm_vcpu *vcpu,
|
||||
void __user *buf, int len);
|
||||
|
||||
@@ -288,6 +288,34 @@ static int handle_sigp_dst(struct kvm_vcpu *vcpu, u8 order_code,
|
||||
if (!dst_vcpu)
|
||||
return SIGP_CC_NOT_OPERATIONAL;
|
||||
|
||||
/*
|
||||
* SIGP RESTART, SIGP STOP, and SIGP STOP AND STORE STATUS orders
|
||||
* are processed asynchronously. Until the affected VCPU finishes
|
||||
* its work and calls back into KVM to clear the (RESTART or STOP)
|
||||
* interrupt, we need to return any new non-reset orders "busy".
|
||||
*
|
||||
* This is important because a single VCPU could issue:
|
||||
* 1) SIGP STOP $DESTINATION
|
||||
* 2) SIGP SENSE $DESTINATION
|
||||
*
|
||||
* If the SIGP SENSE would not be rejected as "busy", it could
|
||||
* return an incorrect answer as to whether the VCPU is STOPPED
|
||||
* or OPERATING.
|
||||
*/
|
||||
if (order_code != SIGP_INITIAL_CPU_RESET &&
|
||||
order_code != SIGP_CPU_RESET) {
|
||||
/*
|
||||
* Lockless check. Both SIGP STOP and SIGP (RE)START
|
||||
* properly synchronize everything while processing
|
||||
* their orders, while the guest cannot observe a
|
||||
* difference when issuing other orders from two
|
||||
* different VCPUs.
|
||||
*/
|
||||
if (kvm_s390_is_stop_irq_pending(dst_vcpu) ||
|
||||
kvm_s390_is_restart_irq_pending(dst_vcpu))
|
||||
return SIGP_CC_BUSY;
|
||||
}
|
||||
|
||||
switch (order_code) {
|
||||
case SIGP_SENSE:
|
||||
vcpu->stat.instruction_sigp_sense++;
|
||||
|
||||
@@ -287,7 +287,14 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
|
||||
|
||||
might_sleep();
|
||||
start &= PAGE_MASK;
|
||||
nr = __get_user_pages_fast(start, nr_pages, write, pages);
|
||||
/*
|
||||
* The FAST_GUP case requires FOLL_WRITE even for pure reads,
|
||||
* because get_user_pages() may need to cause an early COW in
|
||||
* order to avoid confusing the normal COW routines. So only
|
||||
* targets that are already writable are safe to do by just
|
||||
* looking at the page tables.
|
||||
*/
|
||||
nr = __get_user_pages_fast(start, nr_pages, 1, pages);
|
||||
if (nr == nr_pages)
|
||||
return nr;
|
||||
|
||||
|
||||
@@ -256,13 +256,15 @@ void page_table_free(struct mm_struct *mm, unsigned long *table)
|
||||
/* Free 2K page table fragment of a 4K page */
|
||||
bit = (__pa(table) & ~PAGE_MASK)/(PTRS_PER_PTE*sizeof(pte_t));
|
||||
spin_lock_bh(&mm->context.lock);
|
||||
mask = atomic_xor_bits(&page->_refcount, 1U << (bit + 24));
|
||||
mask = atomic_xor_bits(&page->_refcount, 0x11U << (bit + 24));
|
||||
mask >>= 24;
|
||||
if (mask & 3)
|
||||
list_add(&page->lru, &mm->context.pgtable_list);
|
||||
else
|
||||
list_del(&page->lru);
|
||||
spin_unlock_bh(&mm->context.lock);
|
||||
mask = atomic_xor_bits(&page->_refcount, 0x10U << (bit + 24));
|
||||
mask >>= 24;
|
||||
if (mask != 0)
|
||||
return;
|
||||
} else {
|
||||
|
||||
@@ -242,7 +242,14 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
|
||||
next = pgd_addr_end(addr, end);
|
||||
if (pgd_none(pgd))
|
||||
goto slow;
|
||||
if (!gup_pud_range(pgd, addr, next, write, pages, &nr))
|
||||
/*
|
||||
* The FAST_GUP case requires FOLL_WRITE even for pure reads,
|
||||
* because get_user_pages() may need to cause an early COW in
|
||||
* order to avoid confusing the normal COW routines. So only
|
||||
* targets that are already writable are safe to do by just
|
||||
* looking at the page tables.
|
||||
*/
|
||||
if (!gup_pud_range(pgd, addr, next, 1, pages, &nr))
|
||||
goto slow;
|
||||
} while (pgdp++, addr = next, addr != end);
|
||||
local_irq_enable();
|
||||
|
||||
@@ -303,7 +303,14 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
|
||||
next = pgd_addr_end(addr, end);
|
||||
if (pgd_none(pgd))
|
||||
goto slow;
|
||||
if (!gup_pud_range(pgd, addr, next, write, pages, &nr))
|
||||
/*
|
||||
* The FAST_GUP case requires FOLL_WRITE even for pure reads,
|
||||
* because get_user_pages() may need to cause an early COW in
|
||||
* order to avoid confusing the normal COW routines. So only
|
||||
* targets that are already writable are safe to do by just
|
||||
* looking at the page tables.
|
||||
*/
|
||||
if (!gup_pud_range(pgd, addr, next, 1, pages, &nr))
|
||||
goto slow;
|
||||
} while (pgdp++, addr = next, addr != end);
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ extern int restore_fp_registers(int pid, unsigned long *fp_regs);
|
||||
extern int save_fpx_registers(int pid, unsigned long *fp_regs);
|
||||
extern int restore_fpx_registers(int pid, unsigned long *fp_regs);
|
||||
extern int save_registers(int pid, struct uml_pt_regs *regs);
|
||||
extern int restore_registers(int pid, struct uml_pt_regs *regs);
|
||||
extern int init_registers(int pid);
|
||||
extern int restore_pid_registers(int pid, struct uml_pt_regs *regs);
|
||||
extern int init_pid_registers(int pid);
|
||||
extern void get_safe_registers(unsigned long *regs, unsigned long *fp_regs);
|
||||
extern unsigned long get_thread_reg(int reg, jmp_buf *buf);
|
||||
extern int get_fp_registers(int pid, unsigned long *regs);
|
||||
|
||||
@@ -21,7 +21,7 @@ int save_registers(int pid, struct uml_pt_regs *regs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int restore_registers(int pid, struct uml_pt_regs *regs)
|
||||
int restore_pid_registers(int pid, struct uml_pt_regs *regs)
|
||||
{
|
||||
int err;
|
||||
|
||||
@@ -36,7 +36,7 @@ int restore_registers(int pid, struct uml_pt_regs *regs)
|
||||
static unsigned long exec_regs[MAX_REG_NR];
|
||||
static unsigned long exec_fp_regs[FP_SIZE];
|
||||
|
||||
int init_registers(int pid)
|
||||
int init_pid_registers(int pid)
|
||||
{
|
||||
int err;
|
||||
|
||||
|
||||
@@ -336,7 +336,7 @@ void __init os_early_checks(void)
|
||||
check_tmpexec();
|
||||
|
||||
pid = start_ptraced_child();
|
||||
if (init_registers(pid))
|
||||
if (init_pid_registers(pid))
|
||||
fatal("Failed to initialize default registers");
|
||||
stop_ptraced_child(pid, 1, 1);
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ static ssize_t flags_write(struct file *filp, const char __user *ubuf,
|
||||
char buf[MAX_FLAG_OPT_SIZE], *__buf;
|
||||
int err;
|
||||
|
||||
if (cnt > MAX_FLAG_OPT_SIZE)
|
||||
if (!cnt || cnt > MAX_FLAG_OPT_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
if (copy_from_user(&buf, ubuf, cnt))
|
||||
|
||||
@@ -295,11 +295,17 @@ static void wait_for_panic(void)
|
||||
panic("Panicing machine check CPU died");
|
||||
}
|
||||
|
||||
static void mce_panic(const char *msg, struct mce *final, char *exp)
|
||||
static noinstr void mce_panic(const char *msg, struct mce *final, char *exp)
|
||||
{
|
||||
int apei_err = 0;
|
||||
struct llist_node *pending;
|
||||
struct mce_evt_llist *l;
|
||||
int apei_err = 0;
|
||||
|
||||
/*
|
||||
* Allow instrumentation around external facilities usage. Not that it
|
||||
* matters a whole lot since the machine is going to panic anyway.
|
||||
*/
|
||||
instrumentation_begin();
|
||||
|
||||
if (!fake_panic) {
|
||||
/*
|
||||
@@ -314,7 +320,7 @@ static void mce_panic(const char *msg, struct mce *final, char *exp)
|
||||
} else {
|
||||
/* Don't log too much for fake panic */
|
||||
if (atomic_inc_return(&mce_fake_panicked) > 1)
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
pending = mce_gen_pool_prepare_records();
|
||||
/* First print corrected ones that are still unlogged */
|
||||
@@ -352,6 +358,9 @@ static void mce_panic(const char *msg, struct mce *final, char *exp)
|
||||
panic(msg);
|
||||
} else
|
||||
pr_emerg(HW_ERR "Fake kernel panic: %s\n", msg);
|
||||
|
||||
out:
|
||||
instrumentation_end();
|
||||
}
|
||||
|
||||
/* Support code for software error injection */
|
||||
@@ -642,7 +651,7 @@ static struct notifier_block mce_default_nb = {
|
||||
/*
|
||||
* Read ADDR and MISC registers.
|
||||
*/
|
||||
static void mce_read_aux(struct mce *m, int i)
|
||||
static noinstr void mce_read_aux(struct mce *m, int i)
|
||||
{
|
||||
if (m->status & MCI_STATUS_MISCV)
|
||||
m->misc = mce_rdmsrl(msr_ops.misc(i));
|
||||
@@ -1021,10 +1030,13 @@ static int mce_start(int *no_way_out)
|
||||
* Synchronize between CPUs after main scanning loop.
|
||||
* This invokes the bulk of the Monarch processing.
|
||||
*/
|
||||
static int mce_end(int order)
|
||||
static noinstr int mce_end(int order)
|
||||
{
|
||||
int ret = -1;
|
||||
u64 timeout = (u64)mca_cfg.monarch_timeout * NSEC_PER_USEC;
|
||||
int ret = -1;
|
||||
|
||||
/* Allow instrumentation around external facilities. */
|
||||
instrumentation_begin();
|
||||
|
||||
if (!timeout)
|
||||
goto reset;
|
||||
@@ -1068,7 +1080,8 @@ static int mce_end(int order)
|
||||
/*
|
||||
* Don't reset anything. That's done by the Monarch.
|
||||
*/
|
||||
return 0;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1083,6 +1096,10 @@ static int mce_end(int order)
|
||||
* Let others run again.
|
||||
*/
|
||||
atomic_set(&mce_executing, 0);
|
||||
|
||||
out:
|
||||
instrumentation_end();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -515,6 +515,7 @@ static const struct intel_early_ops gen11_early_ops __initconst = {
|
||||
.stolen_size = gen9_stolen_size,
|
||||
};
|
||||
|
||||
/* Intel integrated GPUs for which we need to reserve "stolen memory" */
|
||||
static const struct pci_device_id intel_early_ids[] __initconst = {
|
||||
INTEL_I830_IDS(&i830_early_ops),
|
||||
INTEL_I845G_IDS(&i845_early_ops),
|
||||
@@ -584,6 +585,13 @@ static void __init intel_graphics_quirks(int num, int slot, int func)
|
||||
u16 device;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Reserve "stolen memory" for an integrated GPU. If we've already
|
||||
* found one, there's nothing to do for other (discrete) GPUs.
|
||||
*/
|
||||
if (resource_size(&intel_graphics_stolen_res))
|
||||
return;
|
||||
|
||||
device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(intel_early_ids); i++) {
|
||||
@@ -696,7 +704,7 @@ static struct chipset early_qrk[] __initdata = {
|
||||
{ PCI_VENDOR_ID_INTEL, 0x3406, PCI_CLASS_BRIDGE_HOST,
|
||||
PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check },
|
||||
{ PCI_VENDOR_ID_INTEL, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA, PCI_ANY_ID,
|
||||
QFLAG_APPLY_ONCE, intel_graphics_quirks },
|
||||
0, intel_graphics_quirks },
|
||||
/*
|
||||
* HPET on the current version of the Baytrail platform has accuracy
|
||||
* problems: it will halt in deep idle state - so we disable it.
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <linux/uaccess.h>
|
||||
#include <asm/prctl.h> /* XXX This should get the constants from libc */
|
||||
#include <os.h>
|
||||
#include <registers.h>
|
||||
|
||||
long arch_prctl(struct task_struct *task, int option,
|
||||
unsigned long __user *arg2)
|
||||
@@ -35,7 +36,7 @@ long arch_prctl(struct task_struct *task, int option,
|
||||
switch (option) {
|
||||
case ARCH_SET_FS:
|
||||
case ARCH_SET_GS:
|
||||
ret = restore_registers(pid, ¤t->thread.regs.regs);
|
||||
ret = restore_pid_registers(pid, ¤t->thread.regs.regs);
|
||||
if (ret)
|
||||
return ret;
|
||||
break;
|
||||
|
||||
@@ -1007,7 +1007,8 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
|
||||
(walk_state, return_desc,
|
||||
&temp_desc);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
goto cleanup;
|
||||
return_ACPI_STATUS
|
||||
(status);
|
||||
}
|
||||
|
||||
return_desc = temp_desc;
|
||||
|
||||
@@ -104,7 +104,9 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state)
|
||||
|
||||
/* Flush caches, as per ACPI specification */
|
||||
|
||||
ACPI_FLUSH_CPU_CACHE();
|
||||
if (sleep_state < ACPI_STATE_S4) {
|
||||
ACPI_FLUSH_CPU_CACHE();
|
||||
}
|
||||
|
||||
status = acpi_os_enter_sleep(sleep_state, sleep_control, 0);
|
||||
if (status == AE_CTRL_TERMINATE) {
|
||||
|
||||
@@ -110,7 +110,9 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state)
|
||||
|
||||
/* Flush caches, as per ACPI specification */
|
||||
|
||||
ACPI_FLUSH_CPU_CACHE();
|
||||
if (sleep_state < ACPI_STATE_S4) {
|
||||
ACPI_FLUSH_CPU_CACHE();
|
||||
}
|
||||
|
||||
status = acpi_os_enter_sleep(sleep_state, pm1a_control, pm1b_control);
|
||||
if (status == AE_CTRL_TERMINATE) {
|
||||
|
||||
@@ -189,8 +189,6 @@ acpi_status acpi_enter_sleep_state_s4bios(void)
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
ACPI_FLUSH_CPU_CACHE();
|
||||
|
||||
status = acpi_hw_write_port(acpi_gbl_FADT.smi_command,
|
||||
(u32)acpi_gbl_FADT.s4_bios_request, 8);
|
||||
|
||||
|
||||
@@ -410,6 +410,7 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action)
|
||||
ACPI_WARNING((AE_INFO,
|
||||
"Obj %p, Reference Count is already zero, cannot decrement\n",
|
||||
object));
|
||||
return;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_ALLOCATIONS,
|
||||
|
||||
@@ -78,6 +78,7 @@ static int battery_bix_broken_package;
|
||||
static int battery_notification_delay_ms;
|
||||
static int battery_ac_is_broken;
|
||||
static int battery_check_pmic = 1;
|
||||
static int battery_quirk_notcharging;
|
||||
static unsigned int cache_time = 1000;
|
||||
module_param(cache_time, uint, 0644);
|
||||
MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
|
||||
@@ -246,6 +247,8 @@ static int acpi_battery_get_property(struct power_supply *psy,
|
||||
val->intval = POWER_SUPPLY_STATUS_CHARGING;
|
||||
else if (acpi_battery_is_charged(battery))
|
||||
val->intval = POWER_SUPPLY_STATUS_FULL;
|
||||
else if (battery_quirk_notcharging)
|
||||
val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
|
||||
else
|
||||
val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
|
||||
break;
|
||||
@@ -1350,6 +1353,12 @@ battery_do_not_check_pmic_quirk(const struct dmi_system_id *d)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init battery_quirk_not_charging(const struct dmi_system_id *d)
|
||||
{
|
||||
battery_quirk_notcharging = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct dmi_system_id bat_dmi_table[] __initconst = {
|
||||
{
|
||||
/* NEC LZ750/LS */
|
||||
@@ -1394,6 +1403,19 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = {
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/*
|
||||
* On Lenovo ThinkPads the BIOS specification defines
|
||||
* a state when the bits for charging and discharging
|
||||
* are both set to 0. That state is "Not Charging".
|
||||
*/
|
||||
.callback = battery_quirk_not_charging,
|
||||
.ident = "Lenovo ThinkPad",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad"),
|
||||
},
|
||||
},
|
||||
{},
|
||||
};
|
||||
|
||||
|
||||
@@ -1002,7 +1002,7 @@ static DECLARE_DELAYED_WORK(fd_timer, fd_timer_workfn);
|
||||
static void cancel_activity(void)
|
||||
{
|
||||
do_floppy = NULL;
|
||||
cancel_delayed_work_sync(&fd_timer);
|
||||
cancel_delayed_work(&fd_timer);
|
||||
cancel_work_sync(&floppy_work);
|
||||
}
|
||||
|
||||
@@ -3123,6 +3123,8 @@ static void raw_cmd_free(struct floppy_raw_cmd **ptr)
|
||||
}
|
||||
}
|
||||
|
||||
#define MAX_LEN (1UL << MAX_ORDER << PAGE_SHIFT)
|
||||
|
||||
static int raw_cmd_copyin(int cmd, void __user *param,
|
||||
struct floppy_raw_cmd **rcmd)
|
||||
{
|
||||
@@ -3160,7 +3162,7 @@ static int raw_cmd_copyin(int cmd, void __user *param,
|
||||
ptr->resultcode = 0;
|
||||
|
||||
if (ptr->flags & (FD_RAW_READ | FD_RAW_WRITE)) {
|
||||
if (ptr->length <= 0)
|
||||
if (ptr->length <= 0 || ptr->length >= MAX_LEN)
|
||||
return -EINVAL;
|
||||
ptr->kernel_data = (char *)fd_dma_mem_alloc(ptr->length);
|
||||
fallback_on_nodma_alloc(&ptr->kernel_data, ptr->length);
|
||||
|
||||
@@ -644,6 +644,9 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
|
||||
data->bulk_out_ep = bulk_out_ep->desc.bEndpointAddress;
|
||||
data->bulk_pkt_size = le16_to_cpu(bulk_out_ep->desc.wMaxPacketSize);
|
||||
|
||||
if (!data->bulk_pkt_size)
|
||||
goto done;
|
||||
|
||||
rwlock_init(&data->lock);
|
||||
|
||||
data->reassembly = NULL;
|
||||
|
||||
@@ -1052,7 +1052,12 @@ static int bcm_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
|
||||
dev->dev = &pdev->dev;
|
||||
dev->irq = platform_get_irq(pdev, 0);
|
||||
|
||||
ret = platform_get_irq(pdev, 0);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
dev->irq = ret;
|
||||
|
||||
if (has_acpi_companion(&pdev->dev)) {
|
||||
ret = bcm_acpi_probe(dev);
|
||||
|
||||
@@ -68,7 +68,7 @@ typedef struct {
|
||||
unsigned char ClockControl:1; /* RW: Clock control: 0=normal, 1=stop 3780i clocks */
|
||||
unsigned char SoftReset:1; /* RW: Soft reset 0=normal, 1=soft reset active */
|
||||
unsigned char ConfigMode:1; /* RW: Configuration mode, 0=normal, 1=config mode */
|
||||
unsigned char Reserved:5; /* 0: Reserved */
|
||||
unsigned short Reserved:13; /* 0: Reserved */
|
||||
} DSP_ISA_SLAVE_CONTROL;
|
||||
|
||||
|
||||
|
||||
@@ -825,8 +825,8 @@ static void do_numa_crng_init(struct work_struct *work)
|
||||
crng_initialize(crng);
|
||||
pool[i] = crng;
|
||||
}
|
||||
mb();
|
||||
if (cmpxchg(&crng_node_pool, NULL, pool)) {
|
||||
/* pairs with READ_ONCE() in select_crng() */
|
||||
if (cmpxchg_release(&crng_node_pool, NULL, pool) != NULL) {
|
||||
for_each_node(i)
|
||||
kfree(pool[i]);
|
||||
kfree(pool);
|
||||
@@ -839,8 +839,26 @@ static void numa_crng_init(void)
|
||||
{
|
||||
schedule_work(&numa_crng_init_work);
|
||||
}
|
||||
|
||||
static struct crng_state *select_crng(void)
|
||||
{
|
||||
struct crng_state **pool;
|
||||
int nid = numa_node_id();
|
||||
|
||||
/* pairs with cmpxchg_release() in do_numa_crng_init() */
|
||||
pool = READ_ONCE(crng_node_pool);
|
||||
if (pool && pool[nid])
|
||||
return pool[nid];
|
||||
|
||||
return &primary_crng;
|
||||
}
|
||||
#else
|
||||
static void numa_crng_init(void) {}
|
||||
|
||||
static struct crng_state *select_crng(void)
|
||||
{
|
||||
return &primary_crng;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -944,7 +962,7 @@ static void crng_reseed(struct crng_state *crng, struct entropy_store *r)
|
||||
crng->state[i+4] ^= buf.key[i] ^ rv;
|
||||
}
|
||||
memzero_explicit(&buf, sizeof(buf));
|
||||
crng->init_time = jiffies;
|
||||
WRITE_ONCE(crng->init_time, jiffies);
|
||||
spin_unlock_irqrestore(&crng->lock, flags);
|
||||
if (crng == &primary_crng && crng_init < 2) {
|
||||
invalidate_batched_entropy();
|
||||
@@ -970,12 +988,15 @@ static void crng_reseed(struct crng_state *crng, struct entropy_store *r)
|
||||
static void _extract_crng(struct crng_state *crng,
|
||||
__u8 out[CHACHA_BLOCK_SIZE])
|
||||
{
|
||||
unsigned long v, flags;
|
||||
unsigned long v, flags, init_time;
|
||||
|
||||
if (crng_ready() &&
|
||||
(time_after(crng_global_init_time, crng->init_time) ||
|
||||
time_after(jiffies, crng->init_time + CRNG_RESEED_INTERVAL)))
|
||||
crng_reseed(crng, crng == &primary_crng ? &input_pool : NULL);
|
||||
if (crng_ready()) {
|
||||
init_time = READ_ONCE(crng->init_time);
|
||||
if (time_after(READ_ONCE(crng_global_init_time), init_time) ||
|
||||
time_after(jiffies, init_time + CRNG_RESEED_INTERVAL))
|
||||
crng_reseed(crng, crng == &primary_crng ?
|
||||
&input_pool : NULL);
|
||||
}
|
||||
spin_lock_irqsave(&crng->lock, flags);
|
||||
if (arch_get_random_long(&v))
|
||||
crng->state[14] ^= v;
|
||||
@@ -987,15 +1008,7 @@ static void _extract_crng(struct crng_state *crng,
|
||||
|
||||
static void extract_crng(__u8 out[CHACHA_BLOCK_SIZE])
|
||||
{
|
||||
struct crng_state *crng = NULL;
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
if (crng_node_pool)
|
||||
crng = crng_node_pool[numa_node_id()];
|
||||
if (crng == NULL)
|
||||
#endif
|
||||
crng = &primary_crng;
|
||||
_extract_crng(crng, out);
|
||||
_extract_crng(select_crng(), out);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1024,15 +1037,7 @@ static void _crng_backtrack_protect(struct crng_state *crng,
|
||||
|
||||
static void crng_backtrack_protect(__u8 tmp[CHACHA_BLOCK_SIZE], int used)
|
||||
{
|
||||
struct crng_state *crng = NULL;
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
if (crng_node_pool)
|
||||
crng = crng_node_pool[numa_node_id()];
|
||||
if (crng == NULL)
|
||||
#endif
|
||||
crng = &primary_crng;
|
||||
_crng_backtrack_protect(crng, tmp, used);
|
||||
_crng_backtrack_protect(select_crng(), tmp, used);
|
||||
}
|
||||
|
||||
static ssize_t extract_crng_user(void __user *buf, size_t nbytes)
|
||||
@@ -1944,7 +1949,7 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
|
||||
if (crng_init < 2)
|
||||
return -ENODATA;
|
||||
crng_reseed(&primary_crng, &input_pool);
|
||||
crng_global_init_time = jiffies - 1;
|
||||
WRITE_ONCE(crng_global_init_time, jiffies - 1);
|
||||
return 0;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
||||
@@ -874,7 +874,15 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
|
||||
intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
|
||||
TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
|
||||
intmask &= ~TPM_GLOBAL_INT_ENABLE;
|
||||
|
||||
rc = request_locality(chip, 0);
|
||||
if (rc < 0) {
|
||||
rc = -ENODEV;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
tpm_tis_write32(priv, TPM_INT_ENABLE(priv->locality), intmask);
|
||||
release_locality(chip, 0);
|
||||
|
||||
rc = tpm2_probe(chip);
|
||||
if (rc)
|
||||
|
||||
@@ -915,8 +915,7 @@ static int bcm2835_clock_is_on(struct clk_hw *hw)
|
||||
|
||||
static u32 bcm2835_clock_choose_div(struct clk_hw *hw,
|
||||
unsigned long rate,
|
||||
unsigned long parent_rate,
|
||||
bool round_up)
|
||||
unsigned long parent_rate)
|
||||
{
|
||||
struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw);
|
||||
const struct bcm2835_clock_data *data = clock->data;
|
||||
@@ -928,10 +927,6 @@ static u32 bcm2835_clock_choose_div(struct clk_hw *hw,
|
||||
|
||||
rem = do_div(temp, rate);
|
||||
div = temp;
|
||||
|
||||
/* Round up and mask off the unused bits */
|
||||
if (round_up && ((div & unused_frac_mask) != 0 || rem != 0))
|
||||
div += unused_frac_mask + 1;
|
||||
div &= ~unused_frac_mask;
|
||||
|
||||
/* different clamping limits apply for a mash clock */
|
||||
@@ -1062,7 +1057,7 @@ static int bcm2835_clock_set_rate(struct clk_hw *hw,
|
||||
struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw);
|
||||
struct bcm2835_cprman *cprman = clock->cprman;
|
||||
const struct bcm2835_clock_data *data = clock->data;
|
||||
u32 div = bcm2835_clock_choose_div(hw, rate, parent_rate, false);
|
||||
u32 div = bcm2835_clock_choose_div(hw, rate, parent_rate);
|
||||
u32 ctl;
|
||||
|
||||
spin_lock(&cprman->regs_lock);
|
||||
@@ -1113,7 +1108,7 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw,
|
||||
|
||||
if (!(BIT(parent_idx) & data->set_rate_parent)) {
|
||||
*prate = clk_hw_get_rate(parent);
|
||||
*div = bcm2835_clock_choose_div(hw, rate, *prate, true);
|
||||
*div = bcm2835_clock_choose_div(hw, rate, *prate);
|
||||
|
||||
*avgrate = bcm2835_clock_rate_from_divisor(clock, *prate, *div);
|
||||
|
||||
@@ -1199,7 +1194,7 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw,
|
||||
rate = bcm2835_clock_choose_div_and_prate(hw, i, req->rate,
|
||||
&div, &prate,
|
||||
&avgrate);
|
||||
if (rate > best_rate && rate <= req->rate) {
|
||||
if (abs(req->rate - rate) < abs(req->rate - best_rate)) {
|
||||
best_parent = parent;
|
||||
best_prate = prate;
|
||||
best_rate = rate;
|
||||
|
||||
@@ -521,8 +521,8 @@ static int qce_ahash_register_one(const struct qce_ahash_def *def,
|
||||
|
||||
ret = crypto_register_ahash(alg);
|
||||
if (ret) {
|
||||
kfree(tmpl);
|
||||
dev_err(qce->dev, "%s registration failed\n", base->cra_name);
|
||||
kfree(tmpl);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -2036,8 +2036,6 @@ static int stm32_cryp_probe(struct platform_device *pdev)
|
||||
list_del(&cryp->list);
|
||||
spin_unlock(&cryp_list.lock);
|
||||
|
||||
pm_runtime_disable(dev);
|
||||
pm_runtime_put_noidle(dev);
|
||||
pm_runtime_disable(dev);
|
||||
pm_runtime_put_noidle(dev);
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ static struct shash_alg algs[] = {
|
||||
.digestsize = CHKSUM_DIGEST_SIZE,
|
||||
.base = {
|
||||
.cra_name = "crc32",
|
||||
.cra_driver_name = DRIVER_NAME,
|
||||
.cra_driver_name = "stm32-crc32-crc32",
|
||||
.cra_priority = 200,
|
||||
.cra_flags = CRYPTO_ALG_OPTIONAL_KEY,
|
||||
.cra_blocksize = CHKSUM_BLOCK_SIZE,
|
||||
@@ -252,7 +252,7 @@ static struct shash_alg algs[] = {
|
||||
.digestsize = CHKSUM_DIGEST_SIZE,
|
||||
.base = {
|
||||
.cra_name = "crc32c",
|
||||
.cra_driver_name = DRIVER_NAME,
|
||||
.cra_driver_name = "stm32-crc32-crc32c",
|
||||
.cra_priority = 200,
|
||||
.cra_flags = CRYPTO_ALG_OPTIONAL_KEY,
|
||||
.cra_blocksize = CHKSUM_BLOCK_SIZE,
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
#define AT_XDMAC_CNDC_NDE (0x1 << 0) /* Channel x Next Descriptor Enable */
|
||||
#define AT_XDMAC_CNDC_NDSUP (0x1 << 1) /* Channel x Next Descriptor Source Update */
|
||||
#define AT_XDMAC_CNDC_NDDUP (0x1 << 2) /* Channel x Next Descriptor Destination Update */
|
||||
#define AT_XDMAC_CNDC_NDVIEW_MASK GENMASK(28, 27)
|
||||
#define AT_XDMAC_CNDC_NDVIEW_NDV0 (0x0 << 3) /* Channel x Next Descriptor View 0 */
|
||||
#define AT_XDMAC_CNDC_NDVIEW_NDV1 (0x1 << 3) /* Channel x Next Descriptor View 1 */
|
||||
#define AT_XDMAC_CNDC_NDVIEW_NDV2 (0x2 << 3) /* Channel x Next Descriptor View 2 */
|
||||
@@ -231,15 +232,15 @@ struct at_xdmac {
|
||||
|
||||
/* Linked List Descriptor */
|
||||
struct at_xdmac_lld {
|
||||
dma_addr_t mbr_nda; /* Next Descriptor Member */
|
||||
u32 mbr_ubc; /* Microblock Control Member */
|
||||
dma_addr_t mbr_sa; /* Source Address Member */
|
||||
dma_addr_t mbr_da; /* Destination Address Member */
|
||||
u32 mbr_cfg; /* Configuration Register */
|
||||
u32 mbr_bc; /* Block Control Register */
|
||||
u32 mbr_ds; /* Data Stride Register */
|
||||
u32 mbr_sus; /* Source Microblock Stride Register */
|
||||
u32 mbr_dus; /* Destination Microblock Stride Register */
|
||||
u32 mbr_nda; /* Next Descriptor Member */
|
||||
u32 mbr_ubc; /* Microblock Control Member */
|
||||
u32 mbr_sa; /* Source Address Member */
|
||||
u32 mbr_da; /* Destination Address Member */
|
||||
u32 mbr_cfg; /* Configuration Register */
|
||||
u32 mbr_bc; /* Block Control Register */
|
||||
u32 mbr_ds; /* Data Stride Register */
|
||||
u32 mbr_sus; /* Source Microblock Stride Register */
|
||||
u32 mbr_dus; /* Destination Microblock Stride Register */
|
||||
};
|
||||
|
||||
/* 64-bit alignment needed to update CNDA and CUBC registers in an atomic way. */
|
||||
@@ -344,9 +345,6 @@ static void at_xdmac_start_xfer(struct at_xdmac_chan *atchan,
|
||||
|
||||
dev_vdbg(chan2dev(&atchan->chan), "%s: desc 0x%p\n", __func__, first);
|
||||
|
||||
if (at_xdmac_chan_is_enabled(atchan))
|
||||
return;
|
||||
|
||||
/* Set transfer as active to not try to start it again. */
|
||||
first->active_xfer = true;
|
||||
|
||||
@@ -362,7 +360,8 @@ static void at_xdmac_start_xfer(struct at_xdmac_chan *atchan,
|
||||
*/
|
||||
if (at_xdmac_chan_is_cyclic(atchan))
|
||||
reg = AT_XDMAC_CNDC_NDVIEW_NDV1;
|
||||
else if (first->lld.mbr_ubc & AT_XDMAC_MBR_UBC_NDV3)
|
||||
else if ((first->lld.mbr_ubc &
|
||||
AT_XDMAC_CNDC_NDVIEW_MASK) == AT_XDMAC_MBR_UBC_NDV3)
|
||||
reg = AT_XDMAC_CNDC_NDVIEW_NDV3;
|
||||
else
|
||||
reg = AT_XDMAC_CNDC_NDVIEW_NDV2;
|
||||
@@ -427,13 +426,12 @@ static dma_cookie_t at_xdmac_tx_submit(struct dma_async_tx_descriptor *tx)
|
||||
spin_lock_irqsave(&atchan->lock, irqflags);
|
||||
cookie = dma_cookie_assign(tx);
|
||||
|
||||
list_add_tail(&desc->xfer_node, &atchan->xfers_list);
|
||||
spin_unlock_irqrestore(&atchan->lock, irqflags);
|
||||
|
||||
dev_vdbg(chan2dev(tx->chan), "%s: atchan 0x%p, add desc 0x%p to xfers_list\n",
|
||||
__func__, atchan, desc);
|
||||
list_add_tail(&desc->xfer_node, &atchan->xfers_list);
|
||||
if (list_is_singular(&atchan->xfers_list))
|
||||
at_xdmac_start_xfer(atchan, desc);
|
||||
|
||||
spin_unlock_irqrestore(&atchan->lock, irqflags);
|
||||
return cookie;
|
||||
}
|
||||
|
||||
|
||||
@@ -722,12 +722,6 @@ static int mmp_pdma_config(struct dma_chan *dchan,
|
||||
|
||||
chan->dir = cfg->direction;
|
||||
chan->dev_addr = addr;
|
||||
/* FIXME: drivers should be ported over to use the filter
|
||||
* function. Once that's done, the following two lines can
|
||||
* be removed.
|
||||
*/
|
||||
if (cfg->slave_id)
|
||||
chan->drcmr = cfg->slave_id;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -960,13 +960,6 @@ static void pxad_get_config(struct pxad_chan *chan,
|
||||
*dcmd |= PXA_DCMD_BURST16;
|
||||
else if (maxburst == 32)
|
||||
*dcmd |= PXA_DCMD_BURST32;
|
||||
|
||||
/* FIXME: drivers should be ported over to use the filter
|
||||
* function. Once that's done, the following two lines can
|
||||
* be removed.
|
||||
*/
|
||||
if (chan->cfg.slave_id)
|
||||
chan->drcmr = chan->cfg.slave_id;
|
||||
}
|
||||
|
||||
static struct dma_async_tx_descriptor *
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
#define STM32_MDMA_CTBR(x) (0x68 + 0x40 * (x))
|
||||
#define STM32_MDMA_CTBR_DBUS BIT(17)
|
||||
#define STM32_MDMA_CTBR_SBUS BIT(16)
|
||||
#define STM32_MDMA_CTBR_TSEL_MASK GENMASK(7, 0)
|
||||
#define STM32_MDMA_CTBR_TSEL_MASK GENMASK(5, 0)
|
||||
#define STM32_MDMA_CTBR_TSEL(n) STM32_MDMA_SET(n, \
|
||||
STM32_MDMA_CTBR_TSEL_MASK)
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ menuconfig GOOGLE_FIRMWARE
|
||||
bool "Google Firmware Drivers"
|
||||
default n
|
||||
help
|
||||
These firmware drivers are used by Google's servers. They are
|
||||
only useful if you are working directly on one of their
|
||||
proprietary servers. If in doubt, say "N".
|
||||
These firmware drivers are used by Google servers,
|
||||
Chromebooks and other devices using coreboot firmware.
|
||||
If in doubt, say "N".
|
||||
|
||||
if GOOGLE_FIRMWARE
|
||||
|
||||
|
||||
@@ -385,9 +385,7 @@ static void fw_cfg_sysfs_cache_cleanup(void)
|
||||
struct fw_cfg_sysfs_entry *entry, *next;
|
||||
|
||||
list_for_each_entry_safe(entry, next, &fw_cfg_entry_cache, list) {
|
||||
/* will end up invoking fw_cfg_sysfs_cache_delist()
|
||||
* via each object's release() method (i.e. destructor)
|
||||
*/
|
||||
fw_cfg_sysfs_cache_delist(entry);
|
||||
kobject_put(&entry->kobj);
|
||||
}
|
||||
}
|
||||
@@ -445,7 +443,6 @@ static void fw_cfg_sysfs_release_entry(struct kobject *kobj)
|
||||
{
|
||||
struct fw_cfg_sysfs_entry *entry = to_entry(kobj);
|
||||
|
||||
fw_cfg_sysfs_cache_delist(entry);
|
||||
kfree(entry);
|
||||
}
|
||||
|
||||
@@ -598,20 +595,18 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f)
|
||||
/* set file entry information */
|
||||
entry->size = be32_to_cpu(f->size);
|
||||
entry->select = be16_to_cpu(f->select);
|
||||
memcpy(entry->name, f->name, FW_CFG_MAX_FILE_PATH);
|
||||
strscpy(entry->name, f->name, FW_CFG_MAX_FILE_PATH);
|
||||
|
||||
/* register entry under "/sys/firmware/qemu_fw_cfg/by_key/" */
|
||||
err = kobject_init_and_add(&entry->kobj, &fw_cfg_sysfs_entry_ktype,
|
||||
fw_cfg_sel_ko, "%d", entry->select);
|
||||
if (err) {
|
||||
kobject_put(&entry->kobj);
|
||||
return err;
|
||||
}
|
||||
if (err)
|
||||
goto err_put_entry;
|
||||
|
||||
/* add raw binary content access */
|
||||
err = sysfs_create_bin_file(&entry->kobj, &fw_cfg_sysfs_attr_raw);
|
||||
if (err)
|
||||
goto err_add_raw;
|
||||
goto err_del_entry;
|
||||
|
||||
/* try adding "/sys/firmware/qemu_fw_cfg/by_name/" symlink */
|
||||
fw_cfg_build_symlink(fw_cfg_fname_kset, &entry->kobj, entry->name);
|
||||
@@ -620,9 +615,10 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f)
|
||||
fw_cfg_sysfs_cache_enlist(entry);
|
||||
return 0;
|
||||
|
||||
err_add_raw:
|
||||
err_del_entry:
|
||||
kobject_del(&entry->kobj);
|
||||
kfree(entry);
|
||||
err_put_entry:
|
||||
kobject_put(&entry->kobj);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -904,10 +904,17 @@ int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index)
|
||||
irq_flags = acpi_dev_get_irq_type(info.triggering,
|
||||
info.polarity);
|
||||
|
||||
/* Set type if specified and different than the current one */
|
||||
if (irq_flags != IRQ_TYPE_NONE &&
|
||||
irq_flags != irq_get_trigger_type(irq))
|
||||
irq_set_irq_type(irq, irq_flags);
|
||||
/*
|
||||
* If the IRQ is not already in use then set type
|
||||
* if specified and different than the current one.
|
||||
*/
|
||||
if (can_request_irq(irq, irq_flags)) {
|
||||
if (irq_flags != IRQ_TYPE_NONE &&
|
||||
irq_flags != irq_get_trigger_type(irq))
|
||||
irq_set_irq_type(irq, irq_flags);
|
||||
} else {
|
||||
dev_dbg(&adev->dev, "IRQ %d already in use\n", irq);
|
||||
}
|
||||
|
||||
return irq;
|
||||
}
|
||||
|
||||
@@ -388,6 +388,9 @@ amdgpu_connector_lcd_native_mode(struct drm_encoder *encoder)
|
||||
native_mode->vdisplay != 0 &&
|
||||
native_mode->clock != 0) {
|
||||
mode = drm_mode_duplicate(dev, native_mode);
|
||||
if (!mode)
|
||||
return NULL;
|
||||
|
||||
mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
|
||||
drm_mode_set_name(mode);
|
||||
|
||||
@@ -402,6 +405,9 @@ amdgpu_connector_lcd_native_mode(struct drm_encoder *encoder)
|
||||
* simpler.
|
||||
*/
|
||||
mode = drm_cvt_mode(dev, native_mode->hdisplay, native_mode->vdisplay, 60, true, false, false);
|
||||
if (!mode)
|
||||
return NULL;
|
||||
|
||||
mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
|
||||
DRM_DEBUG_KMS("Adding cvt approximation of native panel mode %s\n", mode->name);
|
||||
}
|
||||
|
||||
@@ -520,10 +520,10 @@ static void gmc_v8_0_mc_program(struct amdgpu_device *adev)
|
||||
static int gmc_v8_0_mc_init(struct amdgpu_device *adev)
|
||||
{
|
||||
int r;
|
||||
u32 tmp;
|
||||
|
||||
adev->gmc.vram_width = amdgpu_atombios_get_vram_width(adev);
|
||||
if (!adev->gmc.vram_width) {
|
||||
u32 tmp;
|
||||
int chansize, numchan;
|
||||
|
||||
/* Get VRAM informations */
|
||||
@@ -567,8 +567,15 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev)
|
||||
adev->gmc.vram_width = numchan * chansize;
|
||||
}
|
||||
/* size in MB on si */
|
||||
adev->gmc.mc_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
|
||||
adev->gmc.real_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
|
||||
tmp = RREG32(mmCONFIG_MEMSIZE);
|
||||
/* some boards may have garbage in the upper 16 bits */
|
||||
if (tmp & 0xffff0000) {
|
||||
DRM_INFO("Probable bad vram size: 0x%08x\n", tmp);
|
||||
if (tmp & 0xffff)
|
||||
tmp &= 0xffff;
|
||||
}
|
||||
adev->gmc.mc_vram_size = tmp * 1024ULL * 1024ULL;
|
||||
adev->gmc.real_vram_size = adev->gmc.mc_vram_size;
|
||||
|
||||
if (!(adev->flags & AMD_IS_APU)) {
|
||||
r = amdgpu_device_resize_fb_bar(adev);
|
||||
|
||||
@@ -302,19 +302,10 @@ static void ge_b850v3_lvds_remove(void)
|
||||
mutex_unlock(&ge_b850v3_lvds_dev_mutex);
|
||||
}
|
||||
|
||||
static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c,
|
||||
const struct i2c_device_id *id)
|
||||
static int ge_b850v3_register(void)
|
||||
{
|
||||
struct i2c_client *stdp4028_i2c = ge_b850v3_lvds_ptr->stdp4028_i2c;
|
||||
struct device *dev = &stdp4028_i2c->dev;
|
||||
int ret;
|
||||
|
||||
ret = ge_b850v3_lvds_init(dev);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ge_b850v3_lvds_ptr->stdp4028_i2c = stdp4028_i2c;
|
||||
i2c_set_clientdata(stdp4028_i2c, ge_b850v3_lvds_ptr);
|
||||
|
||||
/* drm bridge initialization */
|
||||
ge_b850v3_lvds_ptr->bridge.funcs = &ge_b850v3_lvds_funcs;
|
||||
@@ -336,6 +327,27 @@ static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c,
|
||||
"ge-b850v3-lvds-dp", ge_b850v3_lvds_ptr);
|
||||
}
|
||||
|
||||
static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c,
|
||||
const struct i2c_device_id *id)
|
||||
{
|
||||
struct device *dev = &stdp4028_i2c->dev;
|
||||
int ret;
|
||||
|
||||
ret = ge_b850v3_lvds_init(dev);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ge_b850v3_lvds_ptr->stdp4028_i2c = stdp4028_i2c;
|
||||
i2c_set_clientdata(stdp4028_i2c, ge_b850v3_lvds_ptr);
|
||||
|
||||
/* Only register after both bridges are probed */
|
||||
if (!ge_b850v3_lvds_ptr->stdp2690_i2c)
|
||||
return 0;
|
||||
|
||||
return ge_b850v3_register();
|
||||
}
|
||||
|
||||
static int stdp4028_ge_b850v3_fw_remove(struct i2c_client *stdp4028_i2c)
|
||||
{
|
||||
ge_b850v3_lvds_remove();
|
||||
@@ -379,7 +391,11 @@ static int stdp2690_ge_b850v3_fw_probe(struct i2c_client *stdp2690_i2c,
|
||||
ge_b850v3_lvds_ptr->stdp2690_i2c = stdp2690_i2c;
|
||||
i2c_set_clientdata(stdp2690_i2c, ge_b850v3_lvds_ptr);
|
||||
|
||||
return 0;
|
||||
/* Only register after both bridges are probed */
|
||||
if (!ge_b850v3_lvds_ptr->stdp4028_i2c)
|
||||
return 0;
|
||||
|
||||
return ge_b850v3_register();
|
||||
}
|
||||
|
||||
static int stdp2690_ge_b850v3_fw_remove(struct i2c_client *stdp2690_i2c)
|
||||
|
||||
@@ -444,6 +444,12 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (args->stream_size > SZ_64K || args->nr_relocs > SZ_64K ||
|
||||
args->nr_bos > SZ_64K || args->nr_pmrs > 128) {
|
||||
DRM_ERROR("submit arguments out of size limits\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the command submission and bo array to kernel space in
|
||||
* one go, and do this outside of any locks.
|
||||
|
||||
@@ -3002,9 +3002,9 @@ static void snb_wm_latency_quirk(struct drm_i915_private *dev_priv)
|
||||
* The BIOS provided WM memory latency values are often
|
||||
* inadequate for high resolution displays. Adjust them.
|
||||
*/
|
||||
changed = ilk_increase_wm_latency(dev_priv, dev_priv->wm.pri_latency, 12) |
|
||||
ilk_increase_wm_latency(dev_priv, dev_priv->wm.spr_latency, 12) |
|
||||
ilk_increase_wm_latency(dev_priv, dev_priv->wm.cur_latency, 12);
|
||||
changed = ilk_increase_wm_latency(dev_priv, dev_priv->wm.pri_latency, 12);
|
||||
changed |= ilk_increase_wm_latency(dev_priv, dev_priv->wm.spr_latency, 12);
|
||||
changed |= ilk_increase_wm_latency(dev_priv, dev_priv->wm.cur_latency, 12);
|
||||
|
||||
if (!changed)
|
||||
return;
|
||||
|
||||
@@ -97,8 +97,8 @@ static int _dpu_danger_signal_status(struct seq_file *s,
|
||||
&status);
|
||||
} else {
|
||||
seq_puts(s, "\nSafe signal status:\n");
|
||||
if (kms->hw_mdp->ops.get_danger_status)
|
||||
kms->hw_mdp->ops.get_danger_status(kms->hw_mdp,
|
||||
if (kms->hw_mdp->ops.get_safe_status)
|
||||
kms->hw_mdp->ops.get_safe_status(kms->hw_mdp,
|
||||
&status);
|
||||
}
|
||||
pm_runtime_put_sync(&kms->pdev->dev);
|
||||
|
||||
@@ -70,20 +70,13 @@ nvkm_pmu_fini(struct nvkm_subdev *subdev, bool suspend)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
nvkm_pmu_reset(struct nvkm_pmu *pmu)
|
||||
{
|
||||
struct nvkm_device *device = pmu->subdev.device;
|
||||
|
||||
if (!pmu->func->enabled(pmu))
|
||||
return 0;
|
||||
|
||||
/* Inhibit interrupts, and wait for idle. */
|
||||
nvkm_wr32(device, 0x10a014, 0x0000ffff);
|
||||
nvkm_msec(device, 2000,
|
||||
if (!nvkm_rd32(device, 0x10a04c))
|
||||
break;
|
||||
);
|
||||
return;
|
||||
|
||||
/* Reset. */
|
||||
if (pmu->func->reset)
|
||||
@@ -94,25 +87,37 @@ nvkm_pmu_reset(struct nvkm_pmu *pmu)
|
||||
if (!(nvkm_rd32(device, 0x10a10c) & 0x00000006))
|
||||
break;
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nvkm_pmu_preinit(struct nvkm_subdev *subdev)
|
||||
{
|
||||
struct nvkm_pmu *pmu = nvkm_pmu(subdev);
|
||||
return nvkm_pmu_reset(pmu);
|
||||
nvkm_pmu_reset(pmu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nvkm_pmu_init(struct nvkm_subdev *subdev)
|
||||
{
|
||||
struct nvkm_pmu *pmu = nvkm_pmu(subdev);
|
||||
int ret = nvkm_pmu_reset(pmu);
|
||||
if (ret == 0 && pmu->func->init)
|
||||
ret = pmu->func->init(pmu);
|
||||
return ret;
|
||||
struct nvkm_device *device = pmu->subdev.device;
|
||||
|
||||
if (!pmu->func->init)
|
||||
return 0;
|
||||
|
||||
if (pmu->func->enabled(pmu)) {
|
||||
/* Inhibit interrupts, and wait for idle. */
|
||||
nvkm_wr32(device, 0x10a014, 0x0000ffff);
|
||||
nvkm_msec(device, 2000,
|
||||
if (!nvkm_rd32(device, 0x10a04c))
|
||||
break;
|
||||
);
|
||||
|
||||
nvkm_pmu_reset(pmu);
|
||||
}
|
||||
|
||||
return pmu->func->init(pmu);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -512,6 +512,7 @@ static void innolux_panel_del(struct innolux_panel *innolux)
|
||||
static int innolux_panel_probe(struct mipi_dsi_device *dsi)
|
||||
{
|
||||
const struct panel_desc *desc;
|
||||
struct innolux_panel *innolux;
|
||||
int err;
|
||||
|
||||
desc = of_device_get_match_data(&dsi->dev);
|
||||
@@ -523,7 +524,14 @@ static int innolux_panel_probe(struct mipi_dsi_device *dsi)
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
return mipi_dsi_attach(dsi);
|
||||
err = mipi_dsi_attach(dsi);
|
||||
if (err < 0) {
|
||||
innolux = mipi_dsi_get_drvdata(dsi);
|
||||
innolux_panel_del(innolux);
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int innolux_panel_remove(struct mipi_dsi_device *dsi)
|
||||
|
||||
@@ -623,6 +623,8 @@ void radeon_driver_lastclose_kms(struct drm_device *dev)
|
||||
int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
|
||||
{
|
||||
struct radeon_device *rdev = dev->dev_private;
|
||||
struct radeon_fpriv *fpriv;
|
||||
struct radeon_vm *vm;
|
||||
int r;
|
||||
|
||||
file_priv->driver_priv = NULL;
|
||||
@@ -635,48 +637,52 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
|
||||
|
||||
/* new gpu have virtual address space support */
|
||||
if (rdev->family >= CHIP_CAYMAN) {
|
||||
struct radeon_fpriv *fpriv;
|
||||
struct radeon_vm *vm;
|
||||
|
||||
fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL);
|
||||
if (unlikely(!fpriv)) {
|
||||
r = -ENOMEM;
|
||||
goto out_suspend;
|
||||
goto err_suspend;
|
||||
}
|
||||
|
||||
if (rdev->accel_working) {
|
||||
vm = &fpriv->vm;
|
||||
r = radeon_vm_init(rdev, vm);
|
||||
if (r) {
|
||||
kfree(fpriv);
|
||||
goto out_suspend;
|
||||
}
|
||||
if (r)
|
||||
goto err_fpriv;
|
||||
|
||||
r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
|
||||
if (r) {
|
||||
radeon_vm_fini(rdev, vm);
|
||||
kfree(fpriv);
|
||||
goto out_suspend;
|
||||
}
|
||||
if (r)
|
||||
goto err_vm_fini;
|
||||
|
||||
/* map the ib pool buffer read only into
|
||||
* virtual address space */
|
||||
vm->ib_bo_va = radeon_vm_bo_add(rdev, vm,
|
||||
rdev->ring_tmp_bo.bo);
|
||||
if (!vm->ib_bo_va) {
|
||||
r = -ENOMEM;
|
||||
goto err_vm_fini;
|
||||
}
|
||||
|
||||
r = radeon_vm_bo_set_addr(rdev, vm->ib_bo_va,
|
||||
RADEON_VA_IB_OFFSET,
|
||||
RADEON_VM_PAGE_READABLE |
|
||||
RADEON_VM_PAGE_SNOOPED);
|
||||
if (r) {
|
||||
radeon_vm_fini(rdev, vm);
|
||||
kfree(fpriv);
|
||||
goto out_suspend;
|
||||
}
|
||||
if (r)
|
||||
goto err_vm_fini;
|
||||
}
|
||||
file_priv->driver_priv = fpriv;
|
||||
}
|
||||
|
||||
out_suspend:
|
||||
pm_runtime_mark_last_busy(dev->dev);
|
||||
pm_runtime_put_autosuspend(dev->dev);
|
||||
return 0;
|
||||
|
||||
err_vm_fini:
|
||||
radeon_vm_fini(rdev, vm);
|
||||
err_fpriv:
|
||||
kfree(fpriv);
|
||||
|
||||
err_suspend:
|
||||
pm_runtime_mark_last_busy(dev->dev);
|
||||
pm_runtime_put_autosuspend(dev->dev);
|
||||
return r;
|
||||
|
||||
@@ -392,7 +392,7 @@ static int apple_input_configured(struct hid_device *hdev,
|
||||
|
||||
if ((asc->quirks & APPLE_HAS_FN) && !asc->fn_found) {
|
||||
hid_info(hdev, "Fn key not found (Apple Wireless Keyboard clone?), disabling Fn key handling\n");
|
||||
asc->quirks = 0;
|
||||
asc->quirks &= ~APPLE_HAS_FN;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1246,6 +1246,12 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
|
||||
|
||||
input = field->hidinput->input;
|
||||
|
||||
if (usage->type == EV_ABS &&
|
||||
(((*quirks & HID_QUIRK_X_INVERT) && usage->code == ABS_X) ||
|
||||
((*quirks & HID_QUIRK_Y_INVERT) && usage->code == ABS_Y))) {
|
||||
value = field->logical_maximum - value;
|
||||
}
|
||||
|
||||
if (usage->hat_min < usage->hat_max || usage->hat_dir) {
|
||||
int hat_dir = usage->hat_dir;
|
||||
if (!hat_dir)
|
||||
|
||||
@@ -31,11 +31,22 @@
|
||||
|
||||
struct uhid_device {
|
||||
struct mutex devlock;
|
||||
|
||||
/* This flag tracks whether the HID device is usable for commands from
|
||||
* userspace. The flag is already set before hid_add_device(), which
|
||||
* runs in workqueue context, to allow hid_add_device() to communicate
|
||||
* with userspace.
|
||||
* However, if hid_add_device() fails, the flag is cleared without
|
||||
* holding devlock.
|
||||
* We guarantee that if @running changes from true to false while you're
|
||||
* holding @devlock, it's still fine to access @hid.
|
||||
*/
|
||||
bool running;
|
||||
|
||||
__u8 *rd_data;
|
||||
uint rd_size;
|
||||
|
||||
/* When this is NULL, userspace may use UHID_CREATE/UHID_CREATE2. */
|
||||
struct hid_device *hid;
|
||||
struct uhid_event input_buf;
|
||||
|
||||
@@ -66,9 +77,18 @@ static void uhid_device_add_worker(struct work_struct *work)
|
||||
if (ret) {
|
||||
hid_err(uhid->hid, "Cannot register HID device: error %d\n", ret);
|
||||
|
||||
hid_destroy_device(uhid->hid);
|
||||
uhid->hid = NULL;
|
||||
/* We used to call hid_destroy_device() here, but that's really
|
||||
* messy to get right because we have to coordinate with
|
||||
* concurrent writes from userspace that might be in the middle
|
||||
* of using uhid->hid.
|
||||
* Just leave uhid->hid as-is for now, and clean it up when
|
||||
* userspace tries to close or reinitialize the uhid instance.
|
||||
*
|
||||
* However, we do have to clear the ->running flag and do a
|
||||
* wakeup to make sure userspace knows that the device is gone.
|
||||
*/
|
||||
uhid->running = false;
|
||||
wake_up_interruptible(&uhid->report_wait);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,7 +497,7 @@ static int uhid_dev_create2(struct uhid_device *uhid,
|
||||
void *rd_data;
|
||||
int ret;
|
||||
|
||||
if (uhid->running)
|
||||
if (uhid->hid)
|
||||
return -EALREADY;
|
||||
|
||||
rd_size = ev->u.create2.rd_size;
|
||||
@@ -559,7 +579,7 @@ static int uhid_dev_create(struct uhid_device *uhid,
|
||||
|
||||
static int uhid_dev_destroy(struct uhid_device *uhid)
|
||||
{
|
||||
if (!uhid->running)
|
||||
if (!uhid->hid)
|
||||
return -EINVAL;
|
||||
|
||||
uhid->running = false;
|
||||
@@ -568,6 +588,7 @@ static int uhid_dev_destroy(struct uhid_device *uhid)
|
||||
cancel_work_sync(&uhid->worker);
|
||||
|
||||
hid_destroy_device(uhid->hid);
|
||||
uhid->hid = NULL;
|
||||
kfree(uhid->rd_data);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -2529,6 +2529,24 @@ static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac,
|
||||
}
|
||||
}
|
||||
|
||||
static bool wacom_wac_slot_is_active(struct input_dev *dev, int key)
|
||||
{
|
||||
struct input_mt *mt = dev->mt;
|
||||
struct input_mt_slot *s;
|
||||
|
||||
if (!mt)
|
||||
return false;
|
||||
|
||||
for (s = mt->slots; s != mt->slots + mt->num_slots; s++) {
|
||||
if (s->key == key &&
|
||||
input_mt_get_value(s, ABS_MT_TRACKING_ID) >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void wacom_wac_finger_event(struct hid_device *hdev,
|
||||
struct hid_field *field, struct hid_usage *usage, __s32 value)
|
||||
{
|
||||
@@ -2571,9 +2589,14 @@ static void wacom_wac_finger_event(struct hid_device *hdev,
|
||||
|
||||
|
||||
if (usage->usage_index + 1 == field->report_count) {
|
||||
if (equivalent_usage == wacom_wac->hid_data.last_slot_field &&
|
||||
wacom_wac->hid_data.confidence)
|
||||
wacom_wac_finger_slot(wacom_wac, wacom_wac->touch_input);
|
||||
if (equivalent_usage == wacom_wac->hid_data.last_slot_field) {
|
||||
bool touch_removed = wacom_wac_slot_is_active(wacom_wac->touch_input,
|
||||
wacom_wac->hid_data.id) && !wacom_wac->hid_data.tipswitch;
|
||||
|
||||
if (wacom_wac->hid_data.confidence || touch_removed) {
|
||||
wacom_wac_finger_slot(wacom_wac, wacom_wac->touch_input);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2587,6 +2610,10 @@ static void wacom_wac_finger_pre_report(struct hid_device *hdev,
|
||||
|
||||
hid_data->confidence = true;
|
||||
|
||||
hid_data->cc_report = 0;
|
||||
hid_data->cc_index = -1;
|
||||
hid_data->cc_value_index = -1;
|
||||
|
||||
for (i = 0; i < report->maxfield; i++) {
|
||||
struct hid_field *field = report->field[i];
|
||||
int j;
|
||||
@@ -2620,11 +2647,14 @@ static void wacom_wac_finger_pre_report(struct hid_device *hdev,
|
||||
hid_data->cc_index >= 0) {
|
||||
struct hid_field *field = report->field[hid_data->cc_index];
|
||||
int value = field->value[hid_data->cc_value_index];
|
||||
if (value)
|
||||
if (value) {
|
||||
hid_data->num_expected = value;
|
||||
hid_data->num_received = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
hid_data->num_expected = wacom_wac->features.touch_max;
|
||||
hid_data->num_received = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2648,6 +2678,7 @@ static void wacom_wac_finger_report(struct hid_device *hdev,
|
||||
|
||||
input_sync(input);
|
||||
wacom_wac->hid_data.num_received = 0;
|
||||
wacom_wac->hid_data.num_expected = 0;
|
||||
|
||||
/* keep touch state for pen event */
|
||||
wacom_wac->shared->touch_down = wacom_wac_finger_count_touches(wacom_wac);
|
||||
|
||||
@@ -115,6 +115,7 @@ struct hsi_client *hsi_new_client(struct hsi_port *port,
|
||||
if (device_register(&cl->device) < 0) {
|
||||
pr_err("hsi: failed to register client: %s\n", info->name);
|
||||
put_device(&cl->device);
|
||||
goto err;
|
||||
}
|
||||
|
||||
return cl;
|
||||
|
||||
@@ -36,10 +36,10 @@ enum dw_pci_ctl_id_t {
|
||||
};
|
||||
|
||||
struct dw_scl_sda_cfg {
|
||||
u32 ss_hcnt;
|
||||
u32 fs_hcnt;
|
||||
u32 ss_lcnt;
|
||||
u32 fs_lcnt;
|
||||
u16 ss_hcnt;
|
||||
u16 fs_hcnt;
|
||||
u16 ss_lcnt;
|
||||
u16 fs_lcnt;
|
||||
u32 sda_hold;
|
||||
};
|
||||
|
||||
|
||||
@@ -774,6 +774,11 @@ static int i801_block_transaction(struct i801_priv *priv,
|
||||
int result = 0;
|
||||
unsigned char hostc;
|
||||
|
||||
if (read_write == I2C_SMBUS_READ && command == I2C_SMBUS_BLOCK_DATA)
|
||||
data->block[0] = I2C_SMBUS_BLOCK_MAX;
|
||||
else if (data->block[0] < 1 || data->block[0] > I2C_SMBUS_BLOCK_MAX)
|
||||
return -EPROTO;
|
||||
|
||||
if (command == I2C_SMBUS_I2C_BLOCK_DATA) {
|
||||
if (read_write == I2C_SMBUS_WRITE) {
|
||||
/* set I2C_EN bit in configuration register */
|
||||
@@ -787,16 +792,6 @@ static int i801_block_transaction(struct i801_priv *priv,
|
||||
}
|
||||
}
|
||||
|
||||
if (read_write == I2C_SMBUS_WRITE
|
||||
|| command == I2C_SMBUS_I2C_BLOCK_DATA) {
|
||||
if (data->block[0] < 1)
|
||||
data->block[0] = 1;
|
||||
if (data->block[0] > I2C_SMBUS_BLOCK_MAX)
|
||||
data->block[0] = I2C_SMBUS_BLOCK_MAX;
|
||||
} else {
|
||||
data->block[0] = 32; /* max for SMBus block reads */
|
||||
}
|
||||
|
||||
/* Experience has shown that the block buffer can only be used for
|
||||
SMBus (not I2C) block transactions, even though the datasheet
|
||||
doesn't mention this limitation. */
|
||||
|
||||
@@ -105,23 +105,30 @@ static irqreturn_t mpc_i2c_isr(int irq, void *dev_id)
|
||||
/* Sometimes 9th clock pulse isn't generated, and slave doesn't release
|
||||
* the bus, because it wants to send ACK.
|
||||
* Following sequence of enabling/disabling and sending start/stop generates
|
||||
* the 9 pulses, so it's all OK.
|
||||
* the 9 pulses, each with a START then ending with STOP, so it's all OK.
|
||||
*/
|
||||
static void mpc_i2c_fixup(struct mpc_i2c *i2c)
|
||||
{
|
||||
int k;
|
||||
u32 delay_val = 1000000 / i2c->real_clk + 1;
|
||||
|
||||
if (delay_val < 2)
|
||||
delay_val = 2;
|
||||
unsigned long flags;
|
||||
|
||||
for (k = 9; k; k--) {
|
||||
writeccr(i2c, 0);
|
||||
writeccr(i2c, CCR_MSTA | CCR_MTX | CCR_MEN);
|
||||
writeb(0, i2c->base + MPC_I2C_SR); /* clear any status bits */
|
||||
writeccr(i2c, CCR_MEN | CCR_MSTA); /* START */
|
||||
readb(i2c->base + MPC_I2C_DR); /* init xfer */
|
||||
udelay(15); /* let it hit the bus */
|
||||
local_irq_save(flags); /* should not be delayed further */
|
||||
writeccr(i2c, CCR_MEN | CCR_MSTA | CCR_RSTA); /* delay SDA */
|
||||
readb(i2c->base + MPC_I2C_DR);
|
||||
writeccr(i2c, CCR_MEN);
|
||||
udelay(delay_val << 1);
|
||||
if (k != 1)
|
||||
udelay(5);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
writeccr(i2c, CCR_MEN); /* Initiate STOP */
|
||||
readb(i2c->base + MPC_I2C_DR);
|
||||
udelay(15); /* Let STOP propagate */
|
||||
writeccr(i2c, 0);
|
||||
}
|
||||
|
||||
static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
|
||||
|
||||
@@ -1039,7 +1039,8 @@ int ib_find_gid(struct ib_device *device, union ib_gid *gid,
|
||||
for (i = 0; i < device->port_immutable[port].gid_tbl_len; ++i) {
|
||||
ret = rdma_query_gid(device, port, i, &tmp_gid);
|
||||
if (ret)
|
||||
return ret;
|
||||
continue;
|
||||
|
||||
if (!memcmp(&tmp_gid, gid, sizeof *gid)) {
|
||||
*port_num = port;
|
||||
if (index)
|
||||
|
||||
@@ -2483,6 +2483,7 @@ int c4iw_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
|
||||
memset(attr, 0, sizeof *attr);
|
||||
memset(init_attr, 0, sizeof *init_attr);
|
||||
attr->qp_state = to_ib_qp_state(qhp->attr.state);
|
||||
attr->cur_qp_state = to_ib_qp_state(qhp->attr.state);
|
||||
init_attr->cap.max_send_wr = qhp->attr.sq_num_entries;
|
||||
init_attr->cap.max_recv_wr = qhp->attr.rq_num_entries;
|
||||
init_attr->cap.max_send_sge = qhp->attr.sq_max_sges;
|
||||
|
||||
@@ -295,6 +295,9 @@ static enum rdma_link_layer hns_roce_get_link_layer(struct ib_device *device,
|
||||
static int hns_roce_query_pkey(struct ib_device *ib_dev, u8 port, u16 index,
|
||||
u16 *pkey)
|
||||
{
|
||||
if (index > 0)
|
||||
return -EINVAL;
|
||||
|
||||
*pkey = PKEY_ID;
|
||||
|
||||
return 0;
|
||||
@@ -429,7 +432,7 @@ static int hns_roce_mmap(struct ib_ucontext *context,
|
||||
return -EINVAL;
|
||||
|
||||
if (vma->vm_pgoff == 0) {
|
||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
||||
vma->vm_page_prot = pgprot_device(vma->vm_page_prot);
|
||||
if (io_remap_pfn_range(vma, vma->vm_start,
|
||||
to_hr_ucontext(context)->uar.pfn,
|
||||
PAGE_SIZE, vma->vm_page_prot))
|
||||
|
||||
@@ -137,7 +137,7 @@ struct rxe_opcode_info rxe_opcode[RXE_NUM_OPCODE] = {
|
||||
}
|
||||
},
|
||||
[IB_OPCODE_RC_SEND_MIDDLE] = {
|
||||
.name = "IB_OPCODE_RC_SEND_MIDDLE]",
|
||||
.name = "IB_OPCODE_RC_SEND_MIDDLE",
|
||||
.mask = RXE_PAYLOAD_MASK | RXE_REQ_MASK | RXE_SEND_MASK
|
||||
| RXE_MIDDLE_MASK,
|
||||
.length = RXE_BTH_BYTES,
|
||||
|
||||
@@ -76,8 +76,7 @@ static void free_iova_flush_queue(struct iova_domain *iovad)
|
||||
if (!has_iova_flush_queue(iovad))
|
||||
return;
|
||||
|
||||
if (timer_pending(&iovad->fq_timer))
|
||||
del_timer(&iovad->fq_timer);
|
||||
del_timer_sync(&iovad->fq_timer);
|
||||
|
||||
fq_destroy_all_entries(iovad);
|
||||
|
||||
|
||||
@@ -83,14 +83,16 @@ void inc_children(struct dm_transaction_manager *tm, struct btree_node *n,
|
||||
}
|
||||
|
||||
static int insert_at(size_t value_size, struct btree_node *node, unsigned index,
|
||||
uint64_t key, void *value)
|
||||
__dm_written_to_disk(value)
|
||||
uint64_t key, void *value)
|
||||
__dm_written_to_disk(value)
|
||||
{
|
||||
uint32_t nr_entries = le32_to_cpu(node->header.nr_entries);
|
||||
uint32_t max_entries = le32_to_cpu(node->header.max_entries);
|
||||
__le64 key_le = cpu_to_le64(key);
|
||||
|
||||
if (index > nr_entries ||
|
||||
index >= le32_to_cpu(node->header.max_entries)) {
|
||||
index >= max_entries ||
|
||||
nr_entries >= max_entries) {
|
||||
DMERR("too many entries in btree node for insert");
|
||||
__dm_unbless_for_disk(value);
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -279,6 +279,11 @@ int sm_ll_lookup_bitmap(struct ll_disk *ll, dm_block_t b, uint32_t *result)
|
||||
struct disk_index_entry ie_disk;
|
||||
struct dm_block *blk;
|
||||
|
||||
if (b >= ll->nr_blocks) {
|
||||
DMERR_LIMIT("metadata block out of bounds");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
b = do_div(index, ll->entries_per_block);
|
||||
r = ll->load_ie(ll, index, &ie_disk);
|
||||
if (r < 0)
|
||||
|
||||
@@ -524,7 +524,7 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)
|
||||
ERR("out of memory. aborting.\n");
|
||||
kfree(vv);
|
||||
v4l2_ctrl_handler_free(hdl);
|
||||
return -1;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
saa7146_video_uops.init(dev,vv);
|
||||
|
||||
@@ -154,7 +154,7 @@ static void *vb2_dc_alloc(struct device *dev, unsigned long attrs,
|
||||
buf->cookie = dma_alloc_attrs(dev, size, &buf->dma_addr,
|
||||
GFP_KERNEL | gfp_flags, buf->attrs);
|
||||
if (!buf->cookie) {
|
||||
dev_err(dev, "dma_alloc_coherent of size %ld failed\n", size);
|
||||
dev_err(dev, "dma_alloc_coherent of size %lu failed\n", size);
|
||||
kfree(buf);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
@@ -206,9 +206,9 @@ static int vb2_dc_mmap(void *buf_priv, struct vm_area_struct *vma)
|
||||
|
||||
vma->vm_ops->open(vma);
|
||||
|
||||
pr_debug("%s: mapped dma addr 0x%08lx at 0x%08lx, size %ld\n",
|
||||
__func__, (unsigned long)buf->dma_addr, vma->vm_start,
|
||||
buf->size);
|
||||
pr_debug("%s: mapped dma addr 0x%08lx at 0x%08lx, size %lu\n",
|
||||
__func__, (unsigned long)buf->dma_addr, vma->vm_start,
|
||||
buf->size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1412,7 +1412,7 @@ static const struct dvb_device dvbdev_dvr = {
|
||||
};
|
||||
int dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *dvb_adapter)
|
||||
{
|
||||
int i;
|
||||
int i, ret;
|
||||
|
||||
if (dmxdev->demux->open(dmxdev->demux) < 0)
|
||||
return -EUSERS;
|
||||
@@ -1431,14 +1431,26 @@ int dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *dvb_adapter)
|
||||
DMXDEV_STATE_FREE);
|
||||
}
|
||||
|
||||
dvb_register_device(dvb_adapter, &dmxdev->dvbdev, &dvbdev_demux, dmxdev,
|
||||
ret = dvb_register_device(dvb_adapter, &dmxdev->dvbdev, &dvbdev_demux, dmxdev,
|
||||
DVB_DEVICE_DEMUX, dmxdev->filternum);
|
||||
dvb_register_device(dvb_adapter, &dmxdev->dvr_dvbdev, &dvbdev_dvr,
|
||||
if (ret < 0)
|
||||
goto err_register_dvbdev;
|
||||
|
||||
ret = dvb_register_device(dvb_adapter, &dmxdev->dvr_dvbdev, &dvbdev_dvr,
|
||||
dmxdev, DVB_DEVICE_DVR, dmxdev->filternum);
|
||||
if (ret < 0)
|
||||
goto err_register_dvr_dvbdev;
|
||||
|
||||
dvb_ringbuffer_init(&dmxdev->dvr_buffer, NULL, 8192);
|
||||
|
||||
return 0;
|
||||
|
||||
err_register_dvr_dvbdev:
|
||||
dvb_unregister_device(dmxdev->dvbdev);
|
||||
err_register_dvbdev:
|
||||
vfree(dmxdev->filter);
|
||||
dmxdev->filter = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(dvb_dmxdev_init);
|
||||
|
||||
@@ -4476,8 +4476,10 @@ static struct dvb_frontend *dib8000_init(struct i2c_adapter *i2c_adap, u8 i2c_ad
|
||||
|
||||
state->timf_default = cfg->pll->timf;
|
||||
|
||||
if (dib8000_identify(&state->i2c) == 0)
|
||||
if (dib8000_identify(&state->i2c) == 0) {
|
||||
kfree(fe);
|
||||
goto error;
|
||||
}
|
||||
|
||||
dibx000_init_i2c_master(&state->i2c_master, DIB8000, state->i2c.adap, state->i2c.addr);
|
||||
|
||||
|
||||
@@ -184,6 +184,8 @@ static irqreturn_t flexcop_pci_isr(int irq, void *dev_id)
|
||||
dma_addr_t cur_addr =
|
||||
fc->read_ibi_reg(fc,dma1_008).dma_0x8.dma_cur_addr << 2;
|
||||
u32 cur_pos = cur_addr - fc_pci->dma[0].dma_addr0;
|
||||
if (cur_pos > fc_pci->dma[0].size * 2)
|
||||
goto error;
|
||||
|
||||
deb_irq("%u irq: %08x cur_addr: %llx: cur_pos: %08x, last_cur_pos: %08x ",
|
||||
jiffies_to_usecs(jiffies - fc_pci->last_irq),
|
||||
@@ -224,6 +226,7 @@ static irqreturn_t flexcop_pci_isr(int irq, void *dev_id)
|
||||
ret = IRQ_NONE;
|
||||
}
|
||||
|
||||
error:
|
||||
spin_unlock_irqrestore(&fc_pci->irq_lock, flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -296,7 +296,12 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d
|
||||
hexium_set_input(hexium, 0);
|
||||
hexium->cur_input = 0;
|
||||
|
||||
saa7146_vv_init(dev, &vv_data);
|
||||
ret = saa7146_vv_init(dev, &vv_data);
|
||||
if (ret) {
|
||||
i2c_del_adapter(&hexium->i2c_adapter);
|
||||
kfree(hexium);
|
||||
return ret;
|
||||
}
|
||||
|
||||
vv_data.vid_ops.vidioc_enum_input = vidioc_enum_input;
|
||||
vv_data.vid_ops.vidioc_g_input = vidioc_g_input;
|
||||
|
||||
@@ -367,10 +367,16 @@ static struct saa7146_ext_vv vv_data;
|
||||
static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_data *info)
|
||||
{
|
||||
struct hexium *hexium = (struct hexium *) dev->ext_priv;
|
||||
int ret;
|
||||
|
||||
DEB_EE("\n");
|
||||
|
||||
saa7146_vv_init(dev, &vv_data);
|
||||
ret = saa7146_vv_init(dev, &vv_data);
|
||||
if (ret) {
|
||||
pr_err("Error in saa7146_vv_init()\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
vv_data.vid_ops.vidioc_enum_input = vidioc_enum_input;
|
||||
vv_data.vid_ops.vidioc_g_input = vidioc_g_input;
|
||||
vv_data.vid_ops.vidioc_s_input = vidioc_s_input;
|
||||
|
||||
@@ -695,10 +695,16 @@ static struct saa7146_ext_vv vv_data;
|
||||
static int mxb_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_data *info)
|
||||
{
|
||||
struct mxb *mxb;
|
||||
int ret;
|
||||
|
||||
DEB_EE("dev:%p\n", dev);
|
||||
|
||||
saa7146_vv_init(dev, &vv_data);
|
||||
ret = saa7146_vv_init(dev, &vv_data);
|
||||
if (ret) {
|
||||
ERR("Error in saa7146_vv_init()");
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (mxb_probe(dev)) {
|
||||
saa7146_vv_release(dev);
|
||||
return -1;
|
||||
|
||||
@@ -295,7 +295,11 @@ static int vdoa_probe(struct platform_device *pdev)
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
|
||||
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "DMA enable failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
vdoa = devm_kzalloc(&pdev->dev, sizeof(*vdoa), GFP_KERNEL);
|
||||
if (!vdoa)
|
||||
|
||||
@@ -217,11 +217,11 @@ static int fops_vcodec_release(struct file *file)
|
||||
mtk_v4l2_debug(1, "[%d] encoder", ctx->id);
|
||||
mutex_lock(&dev->dev_mutex);
|
||||
|
||||
v4l2_m2m_ctx_release(ctx->m2m_ctx);
|
||||
mtk_vcodec_enc_release(ctx);
|
||||
v4l2_fh_del(&ctx->fh);
|
||||
v4l2_fh_exit(&ctx->fh);
|
||||
v4l2_ctrl_handler_free(&ctx->ctrl_hdl);
|
||||
v4l2_m2m_ctx_release(ctx->m2m_ctx);
|
||||
|
||||
list_del_init(&ctx->list);
|
||||
kfree(ctx);
|
||||
|
||||
@@ -416,16 +416,23 @@ static int rcsi2_wait_phy_start(struct rcar_csi2 *priv)
|
||||
static int rcsi2_set_phypll(struct rcar_csi2 *priv, unsigned int mbps)
|
||||
{
|
||||
const struct rcsi2_mbps_reg *hsfreq;
|
||||
const struct rcsi2_mbps_reg *hsfreq_prev = NULL;
|
||||
|
||||
for (hsfreq = priv->info->hsfreqrange; hsfreq->mbps != 0; hsfreq++)
|
||||
for (hsfreq = priv->info->hsfreqrange; hsfreq->mbps != 0; hsfreq++) {
|
||||
if (hsfreq->mbps >= mbps)
|
||||
break;
|
||||
hsfreq_prev = hsfreq;
|
||||
}
|
||||
|
||||
if (!hsfreq->mbps) {
|
||||
dev_err(priv->dev, "Unsupported PHY speed (%u Mbps)", mbps);
|
||||
return -ERANGE;
|
||||
}
|
||||
|
||||
if (hsfreq_prev &&
|
||||
((mbps - hsfreq_prev->mbps) <= (hsfreq->mbps - mbps)))
|
||||
hsfreq = hsfreq_prev;
|
||||
|
||||
rcsi2_write(priv, PHYPLL_REG, PHYPLL_HSFREQRANGE(hsfreq->reg));
|
||||
|
||||
return 0;
|
||||
@@ -836,10 +843,17 @@ static int rcsi2_phtw_write_mbps(struct rcar_csi2 *priv, unsigned int mbps,
|
||||
const struct rcsi2_mbps_reg *values, u16 code)
|
||||
{
|
||||
const struct rcsi2_mbps_reg *value;
|
||||
const struct rcsi2_mbps_reg *prev_value = NULL;
|
||||
|
||||
for (value = values; value->mbps; value++)
|
||||
for (value = values; value->mbps; value++) {
|
||||
if (value->mbps >= mbps)
|
||||
break;
|
||||
prev_value = value;
|
||||
}
|
||||
|
||||
if (prev_value &&
|
||||
((mbps - prev_value->mbps) <= (value->mbps - mbps)))
|
||||
value = prev_value;
|
||||
|
||||
if (!value->mbps) {
|
||||
dev_err(priv->dev, "Unsupported PHY speed (%u Mbps)", mbps);
|
||||
|
||||
@@ -381,7 +381,7 @@ static int si470x_i2c_probe(struct i2c_client *client,
|
||||
if (radio->hdl.error) {
|
||||
retval = radio->hdl.error;
|
||||
dev_err(&client->dev, "couldn't register control\n");
|
||||
goto err_dev;
|
||||
goto err_all;
|
||||
}
|
||||
|
||||
/* video device initialization */
|
||||
@@ -465,7 +465,6 @@ static int si470x_i2c_probe(struct i2c_client *client,
|
||||
kfree(radio->buffer);
|
||||
err_ctrl:
|
||||
v4l2_ctrl_handler_free(&radio->hdl);
|
||||
err_dev:
|
||||
v4l2_device_unregister(&radio->v4l2_dev);
|
||||
err_radio:
|
||||
kfree(radio);
|
||||
|
||||
@@ -73,9 +73,11 @@ static void igorplugusb_irdata(struct igorplugusb *ir, unsigned len)
|
||||
if (start >= len) {
|
||||
dev_err(ir->dev, "receive overflow invalid: %u", overflow);
|
||||
} else {
|
||||
if (overflow > 0)
|
||||
if (overflow > 0) {
|
||||
dev_warn(ir->dev, "receive overflow, at least %u lost",
|
||||
overflow);
|
||||
ir_raw_event_reset(ir->rc);
|
||||
}
|
||||
|
||||
do {
|
||||
rawir.duration = ir->buf_in[i] * 85333;
|
||||
|
||||
@@ -1367,7 +1367,7 @@ static void mceusb_gen1_init(struct mceusb_dev *ir)
|
||||
*/
|
||||
ret = usb_control_msg(ir->usbdev, usb_rcvctrlpipe(ir->usbdev, 0),
|
||||
USB_REQ_SET_ADDRESS, USB_TYPE_VENDOR, 0, 0,
|
||||
data, USB_CTRL_MSG_SZ, HZ * 3);
|
||||
data, USB_CTRL_MSG_SZ, 3000);
|
||||
dev_dbg(dev, "set address - ret = %d", ret);
|
||||
dev_dbg(dev, "set address - data[0] = %d, data[1] = %d",
|
||||
data[0], data[1]);
|
||||
@@ -1375,20 +1375,20 @@ static void mceusb_gen1_init(struct mceusb_dev *ir)
|
||||
/* set feature: bit rate 38400 bps */
|
||||
ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
|
||||
USB_REQ_SET_FEATURE, USB_TYPE_VENDOR,
|
||||
0xc04e, 0x0000, NULL, 0, HZ * 3);
|
||||
0xc04e, 0x0000, NULL, 0, 3000);
|
||||
|
||||
dev_dbg(dev, "set feature - ret = %d", ret);
|
||||
|
||||
/* bRequest 4: set char length to 8 bits */
|
||||
ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
|
||||
4, USB_TYPE_VENDOR,
|
||||
0x0808, 0x0000, NULL, 0, HZ * 3);
|
||||
0x0808, 0x0000, NULL, 0, 3000);
|
||||
dev_dbg(dev, "set char length - retB = %d", ret);
|
||||
|
||||
/* bRequest 2: set handshaking to use DTR/DSR */
|
||||
ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
|
||||
2, USB_TYPE_VENDOR,
|
||||
0x0000, 0x0100, NULL, 0, HZ * 3);
|
||||
0x0000, 0x0100, NULL, 0, 3000);
|
||||
dev_dbg(dev, "set handshake - retC = %d", ret);
|
||||
|
||||
/* device resume */
|
||||
|
||||
@@ -415,7 +415,7 @@ static int redrat3_send_cmd(int cmd, struct redrat3_dev *rr3)
|
||||
udev = rr3->udev;
|
||||
res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), cmd,
|
||||
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
|
||||
0x0000, 0x0000, data, sizeof(u8), HZ * 10);
|
||||
0x0000, 0x0000, data, sizeof(u8), 10000);
|
||||
|
||||
if (res < 0) {
|
||||
dev_err(rr3->dev, "%s: Error sending rr3 cmd res %d, data %d",
|
||||
@@ -491,7 +491,7 @@ static u32 redrat3_get_timeout(struct redrat3_dev *rr3)
|
||||
pipe = usb_rcvctrlpipe(rr3->udev, 0);
|
||||
ret = usb_control_msg(rr3->udev, pipe, RR3_GET_IR_PARAM,
|
||||
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
|
||||
RR3_IR_IO_SIG_TIMEOUT, 0, tmp, len, HZ * 5);
|
||||
RR3_IR_IO_SIG_TIMEOUT, 0, tmp, len, 5000);
|
||||
if (ret != len)
|
||||
dev_warn(rr3->dev, "Failed to read timeout from hardware\n");
|
||||
else {
|
||||
@@ -521,7 +521,7 @@ static int redrat3_set_timeout(struct rc_dev *rc_dev, unsigned int timeoutns)
|
||||
ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), RR3_SET_IR_PARAM,
|
||||
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
|
||||
RR3_IR_IO_SIG_TIMEOUT, 0, timeout, sizeof(*timeout),
|
||||
HZ * 25);
|
||||
25000);
|
||||
dev_dbg(dev, "set ir parm timeout %d ret 0x%02x\n",
|
||||
be32_to_cpu(*timeout), ret);
|
||||
|
||||
@@ -553,32 +553,32 @@ static void redrat3_reset(struct redrat3_dev *rr3)
|
||||
*val = 0x01;
|
||||
rc = usb_control_msg(udev, rxpipe, RR3_RESET,
|
||||
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
|
||||
RR3_CPUCS_REG_ADDR, 0, val, len, HZ * 25);
|
||||
RR3_CPUCS_REG_ADDR, 0, val, len, 25000);
|
||||
dev_dbg(dev, "reset returned 0x%02x\n", rc);
|
||||
|
||||
*val = length_fuzz;
|
||||
rc = usb_control_msg(udev, txpipe, RR3_SET_IR_PARAM,
|
||||
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
|
||||
RR3_IR_IO_LENGTH_FUZZ, 0, val, len, HZ * 25);
|
||||
RR3_IR_IO_LENGTH_FUZZ, 0, val, len, 25000);
|
||||
dev_dbg(dev, "set ir parm len fuzz %d rc 0x%02x\n", *val, rc);
|
||||
|
||||
*val = (65536 - (minimum_pause * 2000)) / 256;
|
||||
rc = usb_control_msg(udev, txpipe, RR3_SET_IR_PARAM,
|
||||
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
|
||||
RR3_IR_IO_MIN_PAUSE, 0, val, len, HZ * 25);
|
||||
RR3_IR_IO_MIN_PAUSE, 0, val, len, 25000);
|
||||
dev_dbg(dev, "set ir parm min pause %d rc 0x%02x\n", *val, rc);
|
||||
|
||||
*val = periods_measure_carrier;
|
||||
rc = usb_control_msg(udev, txpipe, RR3_SET_IR_PARAM,
|
||||
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
|
||||
RR3_IR_IO_PERIODS_MF, 0, val, len, HZ * 25);
|
||||
RR3_IR_IO_PERIODS_MF, 0, val, len, 25000);
|
||||
dev_dbg(dev, "set ir parm periods measure carrier %d rc 0x%02x", *val,
|
||||
rc);
|
||||
|
||||
*val = RR3_DRIVER_MAXLENS;
|
||||
rc = usb_control_msg(udev, txpipe, RR3_SET_IR_PARAM,
|
||||
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
|
||||
RR3_IR_IO_MAX_LENGTHS, 0, val, len, HZ * 25);
|
||||
RR3_IR_IO_MAX_LENGTHS, 0, val, len, 25000);
|
||||
dev_dbg(dev, "set ir parm max lens %d rc 0x%02x\n", *val, rc);
|
||||
|
||||
kfree(val);
|
||||
@@ -596,7 +596,7 @@ static void redrat3_get_firmware_rev(struct redrat3_dev *rr3)
|
||||
rc = usb_control_msg(rr3->udev, usb_rcvctrlpipe(rr3->udev, 0),
|
||||
RR3_FW_VERSION,
|
||||
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
|
||||
0, 0, buffer, RR3_FW_VERSION_LEN, HZ * 5);
|
||||
0, 0, buffer, RR3_FW_VERSION_LEN, 5000);
|
||||
|
||||
if (rc >= 0)
|
||||
dev_info(rr3->dev, "Firmware rev: %s", buffer);
|
||||
@@ -836,14 +836,14 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf,
|
||||
|
||||
pipe = usb_sndbulkpipe(rr3->udev, rr3->ep_out->bEndpointAddress);
|
||||
ret = usb_bulk_msg(rr3->udev, pipe, irdata,
|
||||
sendbuf_len, &ret_len, 10 * HZ);
|
||||
sendbuf_len, &ret_len, 10000);
|
||||
dev_dbg(dev, "sent %d bytes, (ret %d)\n", ret_len, ret);
|
||||
|
||||
/* now tell the hardware to transmit what we sent it */
|
||||
pipe = usb_rcvctrlpipe(rr3->udev, 0);
|
||||
ret = usb_control_msg(rr3->udev, pipe, RR3_TX_SEND_SIGNAL,
|
||||
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
|
||||
0, 0, irdata, 2, HZ * 10);
|
||||
0, 0, irdata, 2, 10000);
|
||||
|
||||
if (ret < 0)
|
||||
dev_err(dev, "Error: control msg send failed, rc %d\n", ret);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user