mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 11:54:14 -04:00
This is the 5.4.301 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmkCD9kACgkQONu9yGCS
aT756BAAwEcL3lKO/0QKjMUrvgv7FRoRm9TH9Usq7Nswmiax6YKI3oPgZKfZZL6u
yLGSnYqV8f+Jo8kALMJAybu+Oc3Z8WbBZJG/dvlAkvR7iN19ZCuKa2NwWmh8BTGd
5ZP4/nyXlNlg0/IIZ8xJa3067U895y9IhgMDmSvOZoUFGFecqUmJNBoj8bHgJaPL
/MENYb7D0CcKWbgCwzsqN0EEm9UKb7xgtaaC52sfZD+GHUPF/RLq9QNyUGtyL0m8
y20HG6zXmBiVP+zdtYpTaaEP6OSNOCmiOweSZOFafnatd2XO1hRdnAoEk7+t2Lj+
Xa5GowVUuglmBd8bPbeY8cwVihMxr81DxMns+OpQJTiDD8Q6Whcxbaqwv+tVe7z4
cVDh1xlKG4U2rsDTeiGhbZVNb6gqqy3LnVFqImQE+dcZqlwC0pbqwO2lLdHMa8NF
f+l1U3ab0k9qYx8HQegYDTufW5Eb0Rki/3YyHk8o3alOYd2Oc3r16lw9rpSw2Nq3
Rku+VMSy6z8uvmIP7Ywobla6j73SGFrDc61F0nsU1x+Gd/dMIgkn36dfxciBCgPa
/AmkK1Psx04s7dIPMowx/nXy5Jk8J4k3JlVMeBnMCuFVUNCNp3qzq5WXdeL1G5f5
GFPJPblaZrfKQNSSlpUAmstl8v5t8aJcjxobmHn28fVliFAJdDI=
=XPvH
-----END PGP SIGNATURE-----
Merge 5.4.301 into android11-5.4-lts
Changes in 5.4.301
scsi: target: target_core_configfs: Add length check to avoid buffer overflow
media: b2c2: Fix use-after-free causing by irq_check_work in flexcop_pci_remove
udp: Fix memory accounting leak.
media: tunner: xc5000: Refactor firmware load
media: tuner: xc5000: Fix use-after-free in xc5000_release
media: i2c: tc358743: Fix use-after-free bugs caused by orphan timer in probe
media: rc: Add support for another iMON 0xffdc device
media: imon: reorganize serialization
media: imon: grab lock earlier in imon_ir_change_protocol()
media: rc: fix races with imon_disconnect()
USB: serial: option: add SIMCom 8230C compositions
wifi: rtlwifi: rtl8192cu: Don't claim USB ID 07b8:8188
dm-integrity: limit MAX_TAG_SIZE to 255
perf subcmd: avoid crash in exclude_cmds when excludes is empty
staging: axis-fifo: fix maximum TX packet length check
staging: axis-fifo: flush RX FIFO on read errors
driver core/PM: Set power.no_callbacks along with power.no_pm
perf: arm_spe: Prevent overflow in PERF_IDX2OFF()
x86/vdso: Fix output operand size of RDPID
regmap: Remove superfluous check for !config in __regmap_init()
ACPI: processor: idle: Fix memory leak when register cpuidle device failed
soc: qcom: rpmh-rsc: Unconditionally clear _TRIGGER bit for TCS
pinctrl: meson-gxl: add missing i2c_d pinmux
blk-mq: check kobject state_in_sysfs before deleting in blk_mq_unregister_hctx
block: use int to store blk_stack_limits() return value
pwm: tiehrpwm: Fix corner case in clock divisor calculation
selftests: watchdog: skip ping loop if WDIOF_KEEPALIVEPING not supported
bpf: Explicitly check accesses to bpf_sock_addr
i2c: mediatek: fix potential incorrect use of I2C_MASTER_WRRD
i2c: designware: Add disabling clocks when probe fails
drm/radeon/r600_cs: clean up of dead code in r600_cs
usb: host: max3421-hcd: Fix error pointer dereference in probe cleanup
serial: max310x: Add error checking in probe()
scsi: pm80xx: Fix array-index-out-of-of-bounds on rmmod
scsi: myrs: Fix dma_alloc_coherent() error check
media: rj54n1cb0c: Fix memleak in rj54n1_probe()
ALSA: lx_core: use int type to store negative error codes
wifi: mwifiex: send world regulatory domain to driver
PCI: tegra: Fix devm_kcalloc() argument order for port->phys allocation
tcp: fix __tcp_close() to only send RST when required
usb: phy: twl6030: Fix incorrect type for ret
usb: gadget: configfs: Correctly set use_os_string at bind
misc: genwqe: Fix incorrect cmd field being reported in error
pps: fix warning in pps_register_cdev when register device fail
ASoC: Intel: bytcht_es8316: Fix invalid quirk input mapping
ASoC: Intel: bytcr_rt5640: Fix invalid quirk input mapping
ASoC: Intel: bytcr_rt5651: Fix invalid quirk input mapping
iio: consumers: Fix offset handling in iio_convert_raw_to_processed()
netfilter: ipset: Remove unused htable_bits in macro ahash_region
watchdog: mpc8xxx_wdt: Reload the watchdog timer when enabling the watchdog
drivers/base/node: handle error properly in register_one_node()
wifi: mt76: fix potential memory leak in mt76_wmac_probe()
RDMA/core: Resolve MAC of next-hop device without ARP support
IB/sa: Fix sa_local_svc_timeout_ms read race
sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC
sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC III
sparc: fix accurate exception reporting in copy_{from_to}_user for Niagara
sparc: fix accurate exception reporting in copy_to_user for Niagara 4
sparc: fix accurate exception reporting in copy_{from,to}_user for M7
remoteproc: qcom: q6v5: Avoid disabling handover IRQ twice
NFSv4.1: fix backchannel max_resp_sz verification check
ipvs: Defer ip_vs_ftp unregister during netns cleanup
scsi: mpt3sas: Fix crash in transport port remove by using ioc_info()
usb: vhci-hcd: Prevent suspending virtually attached devices
RDMA/siw: Always report immediate post SQ errors
net: usb: Remove disruptive netif_wake_queue in rtl8150_set_multicast
ocfs2: fix double free in user_cluster_connect()
drivers/base/node: fix double free in register_one_node()
nfp: fix RSS hash key size when RSS is not supported
net: ena: return 0 in ena_get_rxfh_key_size() when RSS hash key is not configurable
Revert "net/mlx5e: Update and set Xon/Xoff upon MTU set"
Squashfs: fix uninit-value in squashfs_get_parent
uio_hv_generic: Let userspace take care of interrupt mask
mm: hugetlb: avoid soft lockup when mprotect to large memory area
Input: uinput - zero-initialize uinput_ff_upload_compat to avoid info leak
pinctrl: check the return value of pinmux_ops::get_function_name()
clocksource/drivers/clps711x: Fix resource leaks in error paths
iio: frequency: adf4350: Fix ADF4350_REG3_12BIT_CLKDIV_MODE
perf util: Fix compression checks returning -1 as bool
rtc: x1205: Fix Xicor X1205 vendor prefix
perf session: Fix handling when buffer exceeds 2 GiB
clk: nxp: lpc18xx-cgu: convert from round_rate() to determine_rate()
clk: nxp: Fix pll0 rate check condition in LPC18xx CGU driver
scsi: libsas: Add sas_task_find_rq()
scsi: mvsas: Delete mvs_tag_init()
scsi: mvsas: Use sas_task_find_rq() for tagging
scsi: mvsas: Fix use-after-free bugs in mvs_work_queue
net/mlx4: prevent potential use after free in mlx4_en_do_uc_filter()
drm/vmwgfx: Fix Use-after-free in validation
net/sctp: fix a null dereference in sctp_disposition sctp_sf_do_5_1D_ce()
tcp: Don't call reqsk_fastopen_remove() in tcp_conn_request().
net: fsl_pq_mdio: Fix device node reference leak in fsl_pq_mdio_probe
tools build: Align warning options with perf
mailbox: zynqmp-ipi: Remove redundant mbox_controller_unregister() call
mailbox: zynqmp-ipi: Remove dev.parent check in zynqmp_ipi_free_mboxes
crypto: essiv - Check ssize for decryption and in-place encryption
tpm, tpm_tis: Claim locality before writing interrupt registers
tpm_tis: Fix incorrect arguments in tpm_tis_probe_irq_single
ACPI: TAD: Add missing sysfs_remove_group() for ACPI_TAD_RT
ACPI: debug: fix signedness issues in read/write helpers
arm64: dts: qcom: msm8916: Add missing MDSS reset
xen/manage: Fix suspend error path
firmware: meson_sm: fix device leak at probe
media: i2c: mt9v111: fix incorrect type for ret
drm/nouveau: fix bad ret code in nouveau_bo_move_prep
cpufreq: intel_pstate: Fix object lifecycle issue in update_qos_request()
crypto: atmel - Fix dma_unmap_sg() direction
iio: dac: ad5360: use int type to store negative error codes
iio: dac: ad5421: use int type to store negative error codes
iio: frequency: adf4350: Fix prescaler usage.
lib/genalloc: fix device leak in of_gen_pool_get()
parisc: don't reference obsolete termio struct for TC* constants
scsi: hpsa: Fix potential memory leak in hpsa_big_passthru_ioctl()
sctp: Fix MAC comparison to be constant-time
sparc64: fix hugetlb for sun4u
sparc: fix error handling in scan_one_device()
mtd: rawnand: fsmc: Default to autodetect buswidth
mmc: core: SPI mode remove cmd7
rtc: interface: Ensure alarm irq is enabled when UIE is enabled
rtc: interface: Fix long-standing race when setting alarm
rseq/selftests: Use weak symbol reference, not definition, to link with glibc
PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV
PCI/AER: Fix missing uevent on recovery when a reset is requested
PCI: keystone: Use devm_request_irq() to free "ks-pcie-error-irq" on exit
x86/umip: Check that the instruction opcode is at least two bytes
x86/umip: Fix decoding of register forms of 0F 01 (SGDT and SIDT aliases)
nfsd: nfserr_jukebox in nlm_fopen should lead to a retry
ext4: increase i_disksize to offset + len in ext4_update_disksize_before_punch()
ext4: correctly handle queries for metadata mappings
ext4: guard against EA inode refcount underflow in xattr update
net/9p: fix double req put in p9_fd_cancelled
KVM: x86: Don't (re)check L1 intercepts when completing userspace I/O
fs: udf: fix OOB read in lengthAllocDescs handling
mfd: vexpress-sysreg: Check the return value of devm_gpiochip_add_data()
media: mc: Clear minor number before put device
Squashfs: add additional inode sanity checking
Squashfs: reject negative file sizes in squashfs_read_inode()
mfd: intel_soc_pmic_chtdc_ti: Fix invalid regmap-config max_register value
mfd: intel_soc_pmic_chtdc_ti: Drop unneeded assignment for cache_type
mfd: intel_soc_pmic_chtdc_ti: Set use_single_read regmap_config flag
dm: fix NULL pointer dereference in __dm_suspend()
tracing: Fix race condition in kprobe initialization causing NULL pointer dereference
minixfs: Verify inode mode when loading from disk
pid: Add a judgment for ns null in pid_nr_ns
fs: Add 'initramfs_options' to set initramfs mount options
cramfs: Verify inode mode when loading from disk
xen/events: Cleanup find_virq() return codes
media: cx18: Add missing check after DMA map
pwm: berlin: Fix wrong register in suspend/resume
btrfs: avoid potential out-of-bounds in btrfs_encode_fh()
drm/exynos: exynos7_drm_decon: remove ctx->suspended
media: rc: Directly use ida_free()
media: lirc: Fix error handling in lirc_register()
xen/events: Update virq_to_irq on migration
media: pci/ivtv: switch from 'pci_' to 'dma_' API
media: pci: ivtv: Add missing check after DMA map
net: dl2k: switch from 'pci_' to 'dma_' API
net: dlink: handle dma_map_single() failure properly
net/ip6_tunnel: Prevent perpetual tunnel growth
amd-xgbe: Avoid spurious link down messages during interface toggle
tcp: fix tcp_tso_should_defer() vs large RTT
tg3: prevent use of uninitialized remote_adv and local_adv variables
tls: always set record_type in tls_process_cmsg
tls: don't rely on tx_work during send()
sched: Make newidle_balance() static again
sched/fair: Trivial correction of the newidle_balance() comment
sched/balancing: Rename newidle_balance() => sched_balance_newidle()
sched/fair: Fix pelt lost idle time detection
ALSA: firewire: amdtp-stream: fix enum kernel-doc warnings
hfsplus: fix slab-out-of-bounds read in hfsplus_strcasecmp()
exec: Fix incorrect type for ret
hfs: clear offset and space out of valid records in b-tree node
hfs: make proper initalization of struct hfs_find_data
hfsplus: fix KMSAN uninit-value issue in __hfsplus_ext_cache_extent()
hfs: validate record offset in hfsplus_bmap_alloc
hfsplus: fix KMSAN uninit-value issue in hfsplus_delete_cat()
dlm: check for defined force value in dlm_lockspace_release
hfs: fix KMSAN uninit-value issue in hfs_find_set_zero_bits()
hfsplus: return EIO when type of hidden directory mismatch in hfsplus_fill_super()
m68k: bitops: Fix find_*_bit() signatures
net: rtnetlink: remove redundant assignment to variable err
net: rtnetlink: add msg kind names
net: rtnetlink: add helper to extract msg type's kind
net: rtnetlink: use BIT for flag values
net: netlink: add NLM_F_BULK delete request modifier
net: rtnetlink: add bulk delete support flag
net: add ndo_fdb_del_bulk
net: rtnetlink: add NLM_F_BULK support to rtnl_fdb_del
rtnetlink: Allow deleting FDB entries in user namespace
net: enetc: correct the value of ENETC_RXB_TRUESIZE
arm64, mm: avoid always making PTE dirty in pte_mkwrite()
sctp: avoid NULL dereference when chunk data buffer is missing
net: bonding: fix possible peer notify event loss or dup issue
Revert "cpuidle: menu: Avoid discarding useful information"
MIPS: Malta: Fix keyboard resource preventing i8042 driver from registering
ocfs2: clear extent cache after moving/defragmenting extents
net: usb: rtl8150: Fix frame padding
net: ravb: Ensure memory write completes before ringing TX doorbell
USB: serial: option: add UNISOC UIS7720
USB: serial: option: add Quectel RG255C
USB: serial: option: add Telit FN920C04 ECM compositions
usb/core/quirks: Add Huawei ME906S to wakeup quirk
xhci: dbc: enable back DbC in resume if it was enabled before suspend
binder: remove "invalid inc weak" check
comedi: fix divide-by-zero in comedi_buf_munge()
arm64: cputype: Add Neoverse-V3AE definitions
arm64: errata: Apply workarounds for Neoverse-V3AE
memory: samsung: exynos-srom: Correct alignment
memory: samsung: exynos-srom: Fix of_iomap leak in exynos_srom_probe
spi: cadence-quadspi: Flush posted register writes before INDAC access
spi: cadence-quadspi: Flush posted register writes before DAC access
ext4: avoid potential buffer over-read in parse_apply_sb_mount_options()
drm/amdgpu: use atomic functions with memory barriers for vm fault info
ext4: detect invalid INLINE_DATA + EXTENTS flag combination
jbd2: ensure that all ongoing I/O complete before freeing blocks
vfs: Don't leak disconnected dentries on umount
NFSD: Define a proc_layoutcommit for the FlexFiles layout type
KEYS: trusted_tpm1: Compare HMAC values in constant time
padata: Reset next CPU when reorder sequence wraps around
NFSD: Minor cleanup in layoutcommit processing
NFSD: Fix last write offset handling in layoutcommit
media: s5p-mfc: remove an unused/uninitialized variable
net: rtnetlink: fix module reference count leak issue in rtnetlink_rcv_msg
Linux 5.4.301
Change-Id: Ie2685625a0f630cb01ac8d8c9ddcd68c64ea6ed7
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
f6520a7c91
215 changed files with 1508 additions and 918 deletions
|
|
@ -4415,6 +4415,9 @@
|
|||
|
||||
rootflags= [KNL] Set root filesystem mount option string
|
||||
|
||||
initramfs_options= [KNL]
|
||||
Specify mount options for for the initramfs mount.
|
||||
|
||||
rootfstype= [KNL] Set root filesystem type
|
||||
|
||||
rootwait [KNL] Wait (indefinitely) for root device to show up.
|
||||
|
|
|
|||
|
|
@ -134,6 +134,8 @@ stable kernels.
|
|||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Neoverse-V3AE | #3312417 | ARM64_ERRATUM_3194386 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | MMU-500 | #841119,826419 | N/A |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
SUBLEVEL = 300
|
||||
SUBLEVEL = 301
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
|
|
|
|||
|
|
@ -620,6 +620,7 @@ config ARM64_ERRATUM_3194386
|
|||
* ARM Neoverse-V1 erratum 3324341
|
||||
* ARM Neoverse V2 erratum 3324336
|
||||
* ARM Neoverse-V3 erratum 3312417
|
||||
* ARM Neoverse-V3AE erratum 3312417
|
||||
|
||||
On affected cores "MSR SSBS, #0" instructions may not affect
|
||||
subsequent speculative instructions, which may permit unexepected
|
||||
|
|
|
|||
|
|
@ -1599,6 +1599,8 @@
|
|||
hexagon_smp2p_in: slave-kernel {
|
||||
qcom,entry-name = "slave-kernel";
|
||||
|
||||
resets = <&gcc GCC_MDSS_BCR>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@
|
|||
#define ARM_CPU_PART_NEOVERSE_V2 0xD4F
|
||||
#define ARM_CPU_PART_CORTEX_A720 0xD81
|
||||
#define ARM_CPU_PART_CORTEX_X4 0xD82
|
||||
#define ARM_CPU_PART_NEOVERSE_V3AE 0xD83
|
||||
#define ARM_CPU_PART_NEOVERSE_V3 0xD84
|
||||
#define ARM_CPU_PART_CORTEX_X925 0xD85
|
||||
#define ARM_CPU_PART_CORTEX_A725 0xD87
|
||||
|
|
@ -139,6 +140,7 @@
|
|||
#define MIDR_NEOVERSE_V2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V2)
|
||||
#define MIDR_CORTEX_A720 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A720)
|
||||
#define MIDR_CORTEX_X4 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X4)
|
||||
#define MIDR_NEOVERSE_V3AE MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3AE)
|
||||
#define MIDR_NEOVERSE_V3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_V3)
|
||||
#define MIDR_CORTEX_X925 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X925)
|
||||
#define MIDR_CORTEX_A725 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A725)
|
||||
|
|
|
|||
|
|
@ -145,7 +145,8 @@ static inline pte_t set_pte_bit(pte_t pte, pgprot_t prot)
|
|||
static inline pte_t pte_mkwrite(pte_t pte)
|
||||
{
|
||||
pte = set_pte_bit(pte, __pgprot(PTE_WRITE));
|
||||
pte = clear_pte_bit(pte, __pgprot(PTE_RDONLY));
|
||||
if (pte_sw_dirty(pte))
|
||||
pte = clear_pte_bit(pte, __pgprot(PTE_RDONLY));
|
||||
return pte;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -863,6 +863,7 @@ static const struct midr_range erratum_spec_ssbs_list[] = {
|
|||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3),
|
||||
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3AE),
|
||||
{}
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -314,12 +314,12 @@ static inline int bfchg_mem_test_and_change_bit(int nr,
|
|||
#include <asm-generic/bitops/ffz.h>
|
||||
#else
|
||||
|
||||
static inline int find_first_zero_bit(const unsigned long *vaddr,
|
||||
unsigned size)
|
||||
static inline unsigned long find_first_zero_bit(const unsigned long *vaddr,
|
||||
unsigned long size)
|
||||
{
|
||||
const unsigned long *p = vaddr;
|
||||
int res = 32;
|
||||
unsigned int words;
|
||||
unsigned long res = 32;
|
||||
unsigned long words;
|
||||
unsigned long num;
|
||||
|
||||
if (!size)
|
||||
|
|
@ -340,8 +340,9 @@ out:
|
|||
}
|
||||
#define find_first_zero_bit find_first_zero_bit
|
||||
|
||||
static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
|
||||
int offset)
|
||||
static inline unsigned long find_next_zero_bit(const unsigned long *vaddr,
|
||||
unsigned long size,
|
||||
unsigned long offset)
|
||||
{
|
||||
const unsigned long *p = vaddr + (offset >> 5);
|
||||
int bit = offset & 31UL, res;
|
||||
|
|
@ -370,11 +371,12 @@ static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
|
|||
}
|
||||
#define find_next_zero_bit find_next_zero_bit
|
||||
|
||||
static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
|
||||
static inline unsigned long find_first_bit(const unsigned long *vaddr,
|
||||
unsigned long size)
|
||||
{
|
||||
const unsigned long *p = vaddr;
|
||||
int res = 32;
|
||||
unsigned int words;
|
||||
unsigned long res = 32;
|
||||
unsigned long words;
|
||||
unsigned long num;
|
||||
|
||||
if (!size)
|
||||
|
|
@ -395,8 +397,9 @@ out:
|
|||
}
|
||||
#define find_first_bit find_first_bit
|
||||
|
||||
static inline int find_next_bit(const unsigned long *vaddr, int size,
|
||||
int offset)
|
||||
static inline unsigned long find_next_bit(const unsigned long *vaddr,
|
||||
unsigned long size,
|
||||
unsigned long offset)
|
||||
{
|
||||
const unsigned long *p = vaddr + (offset >> 5);
|
||||
int bit = offset & 31UL, res;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ static struct resource standard_io_resources[] = {
|
|||
.name = "keyboard",
|
||||
.start = 0x60,
|
||||
.end = 0x6f,
|
||||
.flags = IORESOURCE_IO | IORESOURCE_BUSY
|
||||
.flags = IORESOURCE_IO
|
||||
},
|
||||
{
|
||||
.name = "dma page reg",
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@
|
|||
#define TCSETS _IOW('T', 17, struct termios) /* TCSETATTR */
|
||||
#define TCSETSW _IOW('T', 18, struct termios) /* TCSETATTRD */
|
||||
#define TCSETSF _IOW('T', 19, struct termios) /* TCSETATTRF */
|
||||
#define TCGETA _IOR('T', 1, struct termio)
|
||||
#define TCSETA _IOW('T', 2, struct termio)
|
||||
#define TCSETAW _IOW('T', 3, struct termio)
|
||||
#define TCSETAF _IOW('T', 4, struct termio)
|
||||
#define TCGETA 0x40125401
|
||||
#define TCSETA 0x80125402
|
||||
#define TCSETAW 0x80125403
|
||||
#define TCSETAF 0x80125404
|
||||
#define TCSBRK _IO('T', 5)
|
||||
#define TCXONC _IO('T', 6)
|
||||
#define TCFLSH _IO('T', 7)
|
||||
|
|
|
|||
|
|
@ -387,6 +387,7 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
|
|||
|
||||
if (of_device_register(op)) {
|
||||
printk("%pOF: Could not register of device.\n", dp);
|
||||
put_device(&op->dev);
|
||||
kfree(op);
|
||||
op = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -680,6 +680,7 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
|
|||
|
||||
if (of_device_register(op)) {
|
||||
printk("%pOF: Could not register of device.\n", dp);
|
||||
put_device(&op->dev);
|
||||
kfree(op);
|
||||
op = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -696,16 +696,16 @@ FUNC_NAME:
|
|||
EX_LD_FP(LOAD(ldd, %o4+40, %f26), memcpy_retl_o2_plus_o5_plus_40)
|
||||
faligndata %f24, %f26, %f10
|
||||
EX_ST_FP(STORE(std, %f6, %o0+24), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_LD_FP(LOAD(ldd, %o4+48, %f28), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_LD_FP(LOAD(ldd, %o4+48, %f28), memcpy_retl_o2_plus_o5_plus_32)
|
||||
faligndata %f26, %f28, %f12
|
||||
EX_ST_FP(STORE(std, %f8, %o0+32), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_ST_FP(STORE(std, %f8, %o0+32), memcpy_retl_o2_plus_o5_plus_32)
|
||||
add %o4, 64, %o4
|
||||
EX_LD_FP(LOAD(ldd, %o4-8, %f30), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_LD_FP(LOAD(ldd, %o4-8, %f30), memcpy_retl_o2_plus_o5_plus_24)
|
||||
faligndata %f28, %f30, %f14
|
||||
EX_ST_FP(STORE(std, %f10, %o0+40), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_ST_FP(STORE(std, %f12, %o0+48), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_ST_FP(STORE(std, %f10, %o0+40), memcpy_retl_o2_plus_o5_plus_24)
|
||||
EX_ST_FP(STORE(std, %f12, %o0+48), memcpy_retl_o2_plus_o5_plus_16)
|
||||
add %o0, 64, %o0
|
||||
EX_ST_FP(STORE(std, %f14, %o0-8), memcpy_retl_o2_plus_o5_plus_40)
|
||||
EX_ST_FP(STORE(std, %f14, %o0-8), memcpy_retl_o2_plus_o5_plus_8)
|
||||
fsrc2 %f30, %f14
|
||||
bgu,pt %xcc, .Lunalign_sloop
|
||||
prefetch [%o4 + (8 * BLOCK_SIZE)], 20
|
||||
|
|
@ -728,7 +728,7 @@ FUNC_NAME:
|
|||
add %o4, 8, %o4
|
||||
faligndata %f0, %f2, %f16
|
||||
subcc %o5, 8, %o5
|
||||
EX_ST_FP(STORE(std, %f16, %o0), memcpy_retl_o2_plus_o5)
|
||||
EX_ST_FP(STORE(std, %f16, %o0), memcpy_retl_o2_plus_o5_plus_8)
|
||||
fsrc2 %f2, %f0
|
||||
bgu,pt %xcc, .Lunalign_by8
|
||||
add %o0, 8, %o0
|
||||
|
|
@ -772,7 +772,7 @@ FUNC_NAME:
|
|||
subcc %o5, 0x20, %o5
|
||||
EX_ST(STORE(stx, %o3, %o0 + 0x00), memcpy_retl_o2_plus_o5_plus_32)
|
||||
EX_ST(STORE(stx, %g2, %o0 + 0x08), memcpy_retl_o2_plus_o5_plus_24)
|
||||
EX_ST(STORE(stx, %g7, %o0 + 0x10), memcpy_retl_o2_plus_o5_plus_24)
|
||||
EX_ST(STORE(stx, %g7, %o0 + 0x10), memcpy_retl_o2_plus_o5_plus_16)
|
||||
EX_ST(STORE(stx, %o4, %o0 + 0x18), memcpy_retl_o2_plus_o5_plus_8)
|
||||
bne,pt %xcc, 1b
|
||||
add %o0, 0x20, %o0
|
||||
|
|
@ -804,12 +804,12 @@ FUNC_NAME:
|
|||
brz,pt %o3, 2f
|
||||
sub %o2, %o3, %o2
|
||||
|
||||
1: EX_LD(LOAD(ldub, %o1 + 0x00, %g2), memcpy_retl_o2_plus_g1)
|
||||
1: EX_LD(LOAD(ldub, %o1 + 0x00, %g2), memcpy_retl_o2_plus_o3)
|
||||
add %o1, 1, %o1
|
||||
subcc %o3, 1, %o3
|
||||
add %o0, 1, %o0
|
||||
bne,pt %xcc, 1b
|
||||
EX_ST(STORE(stb, %g2, %o0 - 0x01), memcpy_retl_o2_plus_g1_plus_1)
|
||||
EX_ST(STORE(stb, %g2, %o0 - 0x01), memcpy_retl_o2_plus_o3_plus_1)
|
||||
2:
|
||||
and %o1, 0x7, %o3
|
||||
brz,pn %o3, .Lmedium_noprefetch_cp
|
||||
|
|
|
|||
|
|
@ -137,6 +137,15 @@ ENTRY(memcpy_retl_o2_plus_63_8)
|
|||
ba,pt %xcc, __restore_asi
|
||||
add %o2, 8, %o0
|
||||
ENDPROC(memcpy_retl_o2_plus_63_8)
|
||||
ENTRY(memcpy_retl_o2_plus_o3)
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %o2, %o3, %o0
|
||||
ENDPROC(memcpy_retl_o2_plus_o3)
|
||||
ENTRY(memcpy_retl_o2_plus_o3_plus_1)
|
||||
add %o3, 1, %o3
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %o2, %o3, %o0
|
||||
ENDPROC(memcpy_retl_o2_plus_o3_plus_1)
|
||||
ENTRY(memcpy_retl_o2_plus_o5)
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %o2, %o5, %o0
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
|
|||
subcc %o5, 0x20, %o5
|
||||
EX_ST(STORE(stx, %g1, %o0 + 0x00), memcpy_retl_o2_plus_o5_plus_32)
|
||||
EX_ST(STORE(stx, %g2, %o0 + 0x08), memcpy_retl_o2_plus_o5_plus_24)
|
||||
EX_ST(STORE(stx, GLOBAL_SPARE, %o0 + 0x10), memcpy_retl_o2_plus_o5_plus_24)
|
||||
EX_ST(STORE(stx, GLOBAL_SPARE, %o0 + 0x10), memcpy_retl_o2_plus_o5_plus_16)
|
||||
EX_ST(STORE(stx, %o4, %o0 + 0x18), memcpy_retl_o2_plus_o5_plus_8)
|
||||
bne,pt %icc, 1b
|
||||
add %o0, 0x20, %o0
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@
|
|||
#ifndef EX_RETVAL
|
||||
#define EX_RETVAL(x) x
|
||||
__restore_asi:
|
||||
ret
|
||||
wr %g0, ASI_AIUS, %asi
|
||||
ret
|
||||
restore
|
||||
ENTRY(NG_ret_i2_plus_i4_plus_1)
|
||||
ba,pt %xcc, __restore_asi
|
||||
|
|
@ -126,15 +126,16 @@ ENTRY(NG_ret_i2_plus_g1_minus_56)
|
|||
ba,pt %xcc, __restore_asi
|
||||
add %i2, %g1, %i0
|
||||
ENDPROC(NG_ret_i2_plus_g1_minus_56)
|
||||
ENTRY(NG_ret_i2_plus_i4)
|
||||
ENTRY(NG_ret_i2_plus_i4_plus_16)
|
||||
add %i4, 16, %i4
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %i2, %i4, %i0
|
||||
ENDPROC(NG_ret_i2_plus_i4)
|
||||
ENTRY(NG_ret_i2_plus_i4_minus_8)
|
||||
sub %i4, 8, %i4
|
||||
ENDPROC(NG_ret_i2_plus_i4_plus_16)
|
||||
ENTRY(NG_ret_i2_plus_i4_plus_8)
|
||||
add %i4, 8, %i4
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %i2, %i4, %i0
|
||||
ENDPROC(NG_ret_i2_plus_i4_minus_8)
|
||||
ENDPROC(NG_ret_i2_plus_i4_plus_8)
|
||||
ENTRY(NG_ret_i2_plus_8)
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %i2, 8, %i0
|
||||
|
|
@ -161,6 +162,12 @@ ENTRY(NG_ret_i2_and_7_plus_i4)
|
|||
ba,pt %xcc, __restore_asi
|
||||
add %i2, %i4, %i0
|
||||
ENDPROC(NG_ret_i2_and_7_plus_i4)
|
||||
ENTRY(NG_ret_i2_and_7_plus_i4_plus_8)
|
||||
and %i2, 7, %i2
|
||||
add %i4, 8, %i4
|
||||
ba,pt %xcc, __restore_asi
|
||||
add %i2, %i4, %i0
|
||||
ENDPROC(NG_ret_i2_and_7_plus_i4)
|
||||
#endif
|
||||
|
||||
.align 64
|
||||
|
|
@ -406,13 +413,13 @@ FUNC_NAME: /* %i0=dst, %i1=src, %i2=len */
|
|||
andn %i2, 0xf, %i4
|
||||
and %i2, 0xf, %i2
|
||||
1: subcc %i4, 0x10, %i4
|
||||
EX_LD(LOAD(ldx, %i1, %o4), NG_ret_i2_plus_i4)
|
||||
EX_LD(LOAD(ldx, %i1, %o4), NG_ret_i2_plus_i4_plus_16)
|
||||
add %i1, 0x08, %i1
|
||||
EX_LD(LOAD(ldx, %i1, %g1), NG_ret_i2_plus_i4)
|
||||
EX_LD(LOAD(ldx, %i1, %g1), NG_ret_i2_plus_i4_plus_16)
|
||||
sub %i1, 0x08, %i1
|
||||
EX_ST(STORE(stx, %o4, %i1 + %i3), NG_ret_i2_plus_i4)
|
||||
EX_ST(STORE(stx, %o4, %i1 + %i3), NG_ret_i2_plus_i4_plus_16)
|
||||
add %i1, 0x8, %i1
|
||||
EX_ST(STORE(stx, %g1, %i1 + %i3), NG_ret_i2_plus_i4_minus_8)
|
||||
EX_ST(STORE(stx, %g1, %i1 + %i3), NG_ret_i2_plus_i4_plus_8)
|
||||
bgu,pt %XCC, 1b
|
||||
add %i1, 0x8, %i1
|
||||
73: andcc %i2, 0x8, %g0
|
||||
|
|
@ -469,7 +476,7 @@ FUNC_NAME: /* %i0=dst, %i1=src, %i2=len */
|
|||
subcc %i4, 0x8, %i4
|
||||
srlx %g3, %i3, %i5
|
||||
or %i5, %g2, %i5
|
||||
EX_ST(STORE(stx, %i5, %o0), NG_ret_i2_and_7_plus_i4)
|
||||
EX_ST(STORE(stx, %i5, %o0), NG_ret_i2_and_7_plus_i4_plus_8)
|
||||
add %o0, 0x8, %o0
|
||||
bgu,pt %icc, 1b
|
||||
sllx %g3, %g1, %g2
|
||||
|
|
|
|||
|
|
@ -164,17 +164,18 @@ ENTRY(U1_gs_40_fp)
|
|||
retl
|
||||
add %o0, %o2, %o0
|
||||
ENDPROC(U1_gs_40_fp)
|
||||
ENTRY(U1_g3_0_fp)
|
||||
VISExitHalf
|
||||
retl
|
||||
add %g3, %o2, %o0
|
||||
ENDPROC(U1_g3_0_fp)
|
||||
ENTRY(U1_g3_8_fp)
|
||||
VISExitHalf
|
||||
add %g3, 8, %g3
|
||||
retl
|
||||
add %g3, %o2, %o0
|
||||
ENDPROC(U1_g3_8_fp)
|
||||
ENTRY(U1_g3_16_fp)
|
||||
VISExitHalf
|
||||
add %g3, 16, %g3
|
||||
retl
|
||||
add %g3, %o2, %o0
|
||||
ENDPROC(U1_g3_16_fp)
|
||||
ENTRY(U1_o2_0_fp)
|
||||
VISExitHalf
|
||||
retl
|
||||
|
|
@ -547,18 +548,18 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
|
|||
62: FINISH_VISCHUNK(o0, f44, f46)
|
||||
63: UNEVEN_VISCHUNK_LAST(o0, f46, f0)
|
||||
|
||||
93: EX_LD_FP(LOAD(ldd, %o1, %f2), U1_g3_0_fp)
|
||||
93: EX_LD_FP(LOAD(ldd, %o1, %f2), U1_g3_8_fp)
|
||||
add %o1, 8, %o1
|
||||
subcc %g3, 8, %g3
|
||||
faligndata %f0, %f2, %f8
|
||||
EX_ST_FP(STORE(std, %f8, %o0), U1_g3_8_fp)
|
||||
EX_ST_FP(STORE(std, %f8, %o0), U1_g3_16_fp)
|
||||
bl,pn %xcc, 95f
|
||||
add %o0, 8, %o0
|
||||
EX_LD_FP(LOAD(ldd, %o1, %f0), U1_g3_0_fp)
|
||||
EX_LD_FP(LOAD(ldd, %o1, %f0), U1_g3_8_fp)
|
||||
add %o1, 8, %o1
|
||||
subcc %g3, 8, %g3
|
||||
faligndata %f2, %f0, %f8
|
||||
EX_ST_FP(STORE(std, %f8, %o0), U1_g3_8_fp)
|
||||
EX_ST_FP(STORE(std, %f8, %o0), U1_g3_16_fp)
|
||||
bge,pt %xcc, 93b
|
||||
add %o0, 8, %o0
|
||||
|
||||
|
|
|
|||
|
|
@ -267,6 +267,7 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
|
|||
faligndata %f10, %f12, %f26
|
||||
EX_LD_FP(LOAD(ldd, %o1 + 0x040, %f0), U3_retl_o2)
|
||||
|
||||
and %o2, 0x3f, %o2
|
||||
subcc GLOBAL_SPARE, 0x80, GLOBAL_SPARE
|
||||
add %o1, 0x40, %o1
|
||||
bgu,pt %XCC, 1f
|
||||
|
|
@ -336,7 +337,6 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
|
|||
* Also notice how this code is careful not to perform a
|
||||
* load past the end of the src buffer.
|
||||
*/
|
||||
and %o2, 0x3f, %o2
|
||||
andcc %o2, 0x38, %g2
|
||||
be,pn %XCC, 2f
|
||||
subcc %g2, 0x8, %g2
|
||||
|
|
|
|||
|
|
@ -134,6 +134,26 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
|
|||
|
||||
static pte_t sun4u_hugepage_shift_to_tte(pte_t entry, unsigned int shift)
|
||||
{
|
||||
unsigned long hugepage_size = _PAGE_SZ4MB_4U;
|
||||
|
||||
pte_val(entry) = pte_val(entry) & ~_PAGE_SZALL_4U;
|
||||
|
||||
switch (shift) {
|
||||
case HPAGE_256MB_SHIFT:
|
||||
hugepage_size = _PAGE_SZ256MB_4U;
|
||||
pte_val(entry) |= _PAGE_PMD_HUGE;
|
||||
break;
|
||||
case HPAGE_SHIFT:
|
||||
pte_val(entry) |= _PAGE_PMD_HUGE;
|
||||
break;
|
||||
case HPAGE_64K_SHIFT:
|
||||
hugepage_size = _PAGE_SZ64K_4U;
|
||||
break;
|
||||
default:
|
||||
WARN_ONCE(1, "unsupported hugepage shift=%u\n", shift);
|
||||
}
|
||||
|
||||
pte_val(entry) = pte_val(entry) | hugepage_size;
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ bool x86_page_table_writing_insn(struct x86_emulate_ctxt *ctxt);
|
|||
#define EMULATION_RESTART 1
|
||||
#define EMULATION_INTERCEPTED 2
|
||||
void init_decode_cache(struct x86_emulate_ctxt *ctxt);
|
||||
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt);
|
||||
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt, bool check_intercepts);
|
||||
int emulator_task_switch(struct x86_emulate_ctxt *ctxt,
|
||||
u16 tss_selector, int idt_index, int reason,
|
||||
bool has_error_code, u32 error_code);
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ static inline unsigned long vdso_encode_cpunode(int cpu, unsigned long node)
|
|||
|
||||
static inline void vdso_read_cpunode(unsigned *cpu, unsigned *node)
|
||||
{
|
||||
unsigned int p;
|
||||
unsigned long p;
|
||||
|
||||
/*
|
||||
* Load CPU and node number from the GDT. LSL is faster than RDTSCP
|
||||
|
|
@ -263,10 +263,10 @@ static inline void vdso_read_cpunode(unsigned *cpu, unsigned *node)
|
|||
*
|
||||
* If RDPID is available, use it.
|
||||
*/
|
||||
alternative_io ("lsl %[seg],%[p]",
|
||||
".byte 0xf3,0x0f,0xc7,0xf8", /* RDPID %eax/rax */
|
||||
alternative_io ("lsl %[seg],%k[p]",
|
||||
"rdpid %[p]",
|
||||
X86_FEATURE_RDPID,
|
||||
[p] "=a" (p), [seg] "r" (__CPUNODE_SEG));
|
||||
[p] "=r" (p), [seg] "r" (__CPUNODE_SEG));
|
||||
|
||||
if (cpu)
|
||||
*cpu = (p & VDSO_CPUNODE_MASK);
|
||||
|
|
|
|||
|
|
@ -155,15 +155,26 @@ static int identify_insn(struct insn *insn)
|
|||
if (!insn->modrm.nbytes)
|
||||
return -EINVAL;
|
||||
|
||||
/* All the instructions of interest start with 0x0f. */
|
||||
if (insn->opcode.bytes[0] != 0xf)
|
||||
/* The instructions of interest have 2-byte opcodes: 0F 00 or 0F 01. */
|
||||
if (insn->opcode.nbytes < 2 || insn->opcode.bytes[0] != 0xf)
|
||||
return -EINVAL;
|
||||
|
||||
if (insn->opcode.bytes[1] == 0x1) {
|
||||
switch (X86_MODRM_REG(insn->modrm.value)) {
|
||||
case 0:
|
||||
/* The reg form of 0F 01 /0 encodes VMX instructions. */
|
||||
if (X86_MODRM_MOD(insn->modrm.value) == 3)
|
||||
return -EINVAL;
|
||||
|
||||
return UMIP_INST_SGDT;
|
||||
case 1:
|
||||
/*
|
||||
* The reg form of 0F 01 /1 encodes MONITOR/MWAIT,
|
||||
* STAC/CLAC, and ENCLS.
|
||||
*/
|
||||
if (X86_MODRM_MOD(insn->modrm.value) == 3)
|
||||
return -EINVAL;
|
||||
|
||||
return UMIP_INST_SIDT;
|
||||
case 4:
|
||||
return UMIP_INST_SMSW;
|
||||
|
|
|
|||
|
|
@ -5605,12 +5605,11 @@ void init_decode_cache(struct x86_emulate_ctxt *ctxt)
|
|||
ctxt->mem_read.end = 0;
|
||||
}
|
||||
|
||||
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
|
||||
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt, bool check_intercepts)
|
||||
{
|
||||
const struct x86_emulate_ops *ops = ctxt->ops;
|
||||
int rc = X86EMUL_CONTINUE;
|
||||
int saved_dst_type = ctxt->dst.type;
|
||||
unsigned emul_flags;
|
||||
|
||||
ctxt->mem_read.pos = 0;
|
||||
|
||||
|
|
@ -5625,7 +5624,6 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
|
|||
goto done;
|
||||
}
|
||||
|
||||
emul_flags = ctxt->ops->get_hflags(ctxt);
|
||||
if (unlikely(ctxt->d &
|
||||
(No64|Undefined|Sse|Mmx|Intercept|CheckPerm|Priv|Prot|String))) {
|
||||
if ((ctxt->mode == X86EMUL_MODE_PROT64 && (ctxt->d & No64)) ||
|
||||
|
|
@ -5659,7 +5657,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
|
|||
fetch_possible_mmx_operand(ctxt, &ctxt->dst);
|
||||
}
|
||||
|
||||
if (unlikely(emul_flags & X86EMUL_GUEST_MASK) && ctxt->intercept) {
|
||||
if (unlikely(check_intercepts) && ctxt->intercept) {
|
||||
rc = emulator_check_intercept(ctxt, ctxt->intercept,
|
||||
X86_ICPT_PRE_EXCEPT);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
|
|
@ -5688,7 +5686,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
|
|||
goto done;
|
||||
}
|
||||
|
||||
if (unlikely(emul_flags & X86EMUL_GUEST_MASK) && (ctxt->d & Intercept)) {
|
||||
if (unlikely(check_intercepts) && (ctxt->d & Intercept)) {
|
||||
rc = emulator_check_intercept(ctxt, ctxt->intercept,
|
||||
X86_ICPT_POST_EXCEPT);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
|
|
@ -5742,7 +5740,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
|
|||
|
||||
special_insn:
|
||||
|
||||
if (unlikely(emul_flags & X86EMUL_GUEST_MASK) && (ctxt->d & Intercept)) {
|
||||
if (unlikely(check_intercepts) && (ctxt->d & Intercept)) {
|
||||
rc = emulator_check_intercept(ctxt, ctxt->intercept,
|
||||
X86_ICPT_POST_MEMACCESS);
|
||||
if (rc != X86EMUL_CONTINUE)
|
||||
|
|
|
|||
|
|
@ -6855,7 +6855,14 @@ restart:
|
|||
/* Save the faulting GPA (cr2) in the address field */
|
||||
ctxt->exception.address = cr2_or_gpa;
|
||||
|
||||
r = x86_emulate_insn(ctxt);
|
||||
/*
|
||||
* Check L1's instruction intercepts when emulating instructions for
|
||||
* L2, unless KVM is re-emulating a previously decoded instruction,
|
||||
* e.g. to complete userspace I/O, in which case KVM has already
|
||||
* checked the intercepts.
|
||||
*/
|
||||
r = x86_emulate_insn(ctxt, is_guest_mode(vcpu) &&
|
||||
!(emulation_type & EMULTYPE_NO_DECODE));
|
||||
|
||||
if (r == EMULATION_INTERCEPTED)
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -241,9 +241,11 @@ static void blk_mq_unregister_hctx(struct blk_mq_hw_ctx *hctx)
|
|||
return;
|
||||
|
||||
hctx_for_each_ctx(hctx, ctx, i)
|
||||
kobject_del(&ctx->kobj);
|
||||
if (ctx->kobj.state_in_sysfs)
|
||||
kobject_del(&ctx->kobj);
|
||||
|
||||
kobject_del(&hctx->kobj);
|
||||
if (hctx->kobj.state_in_sysfs)
|
||||
kobject_del(&hctx->kobj);
|
||||
}
|
||||
|
||||
static int blk_mq_register_hctx(struct blk_mq_hw_ctx *hctx)
|
||||
|
|
|
|||
|
|
@ -505,7 +505,8 @@ static unsigned int blk_round_down_sectors(unsigned int sectors, unsigned int lb
|
|||
int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
|
||||
sector_t start)
|
||||
{
|
||||
unsigned int top, bottom, alignment, ret = 0;
|
||||
unsigned int top, bottom, alignment;
|
||||
int ret = 0;
|
||||
|
||||
t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);
|
||||
t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors);
|
||||
|
|
|
|||
|
|
@ -203,9 +203,14 @@ static int essiv_aead_crypt(struct aead_request *req, bool enc)
|
|||
const struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
|
||||
struct essiv_aead_request_ctx *rctx = aead_request_ctx(req);
|
||||
struct aead_request *subreq = &rctx->aead_req;
|
||||
int ivsize = crypto_aead_ivsize(tfm);
|
||||
int ssize = req->assoclen - ivsize;
|
||||
struct scatterlist *src = req->src;
|
||||
int err;
|
||||
|
||||
if (ssize < 0)
|
||||
return -EINVAL;
|
||||
|
||||
crypto_cipher_encrypt_one(tctx->essiv_cipher, req->iv, req->iv);
|
||||
|
||||
/*
|
||||
|
|
@ -215,19 +220,12 @@ static int essiv_aead_crypt(struct aead_request *req, bool enc)
|
|||
*/
|
||||
rctx->assoc = NULL;
|
||||
if (req->src == req->dst || !enc) {
|
||||
scatterwalk_map_and_copy(req->iv, req->dst,
|
||||
req->assoclen - crypto_aead_ivsize(tfm),
|
||||
crypto_aead_ivsize(tfm), 1);
|
||||
scatterwalk_map_and_copy(req->iv, req->dst, ssize, ivsize, 1);
|
||||
} else {
|
||||
u8 *iv = (u8 *)aead_request_ctx(req) + tctx->ivoffset;
|
||||
int ivsize = crypto_aead_ivsize(tfm);
|
||||
int ssize = req->assoclen - ivsize;
|
||||
struct scatterlist *sg;
|
||||
int nents;
|
||||
|
||||
if (ssize < 0)
|
||||
return -EINVAL;
|
||||
|
||||
nents = sg_nents_for_len(req->src, ssize);
|
||||
if (nents < 0)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -576,11 +576,11 @@ static int acpi_aml_release(struct inode *inode, struct file *file)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_aml_read_user(char __user *buf, int len)
|
||||
static ssize_t acpi_aml_read_user(char __user *buf, size_t len)
|
||||
{
|
||||
int ret;
|
||||
struct circ_buf *crc = &acpi_aml_io.out_crc;
|
||||
int n;
|
||||
ssize_t ret;
|
||||
size_t n;
|
||||
char *p;
|
||||
|
||||
ret = acpi_aml_lock_read(crc, ACPI_AML_OUT_USER);
|
||||
|
|
@ -589,7 +589,7 @@ static int acpi_aml_read_user(char __user *buf, int len)
|
|||
/* sync head before removing logs */
|
||||
smp_rmb();
|
||||
p = &crc->buf[crc->tail];
|
||||
n = min(len, circ_count_to_end(crc));
|
||||
n = min_t(size_t, len, circ_count_to_end(crc));
|
||||
if (copy_to_user(buf, p, n)) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
|
|
@ -606,8 +606,8 @@ out:
|
|||
static ssize_t acpi_aml_read(struct file *file, char __user *buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
int ret = 0;
|
||||
int size = 0;
|
||||
ssize_t ret = 0;
|
||||
ssize_t size = 0;
|
||||
|
||||
if (!count)
|
||||
return 0;
|
||||
|
|
@ -646,11 +646,11 @@ again:
|
|||
return size > 0 ? size : ret;
|
||||
}
|
||||
|
||||
static int acpi_aml_write_user(const char __user *buf, int len)
|
||||
static ssize_t acpi_aml_write_user(const char __user *buf, size_t len)
|
||||
{
|
||||
int ret;
|
||||
struct circ_buf *crc = &acpi_aml_io.in_crc;
|
||||
int n;
|
||||
ssize_t ret;
|
||||
size_t n;
|
||||
char *p;
|
||||
|
||||
ret = acpi_aml_lock_write(crc, ACPI_AML_IN_USER);
|
||||
|
|
@ -659,7 +659,7 @@ static int acpi_aml_write_user(const char __user *buf, int len)
|
|||
/* sync tail before inserting cmds */
|
||||
smp_mb();
|
||||
p = &crc->buf[crc->head];
|
||||
n = min(len, circ_space_to_end(crc));
|
||||
n = min_t(size_t, len, circ_space_to_end(crc));
|
||||
if (copy_from_user(p, buf, n)) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
|
|
@ -670,14 +670,14 @@ static int acpi_aml_write_user(const char __user *buf, int len)
|
|||
ret = n;
|
||||
out:
|
||||
acpi_aml_unlock_fifo(ACPI_AML_IN_USER, ret >= 0);
|
||||
return n;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t acpi_aml_write(struct file *file, const char __user *buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
int ret = 0;
|
||||
int size = 0;
|
||||
ssize_t ret = 0;
|
||||
ssize_t size = 0;
|
||||
|
||||
if (!count)
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -563,6 +563,9 @@ static int acpi_tad_remove(struct platform_device *pdev)
|
|||
|
||||
pm_runtime_get_sync(dev);
|
||||
|
||||
if (dd->capabilities & ACPI_TAD_RT)
|
||||
sysfs_remove_group(&dev->kobj, &acpi_tad_time_attr_group);
|
||||
|
||||
if (dd->capabilities & ACPI_TAD_DC_WAKE)
|
||||
sysfs_remove_group(&dev->kobj, &acpi_tad_dc_attr_group);
|
||||
|
||||
|
|
|
|||
|
|
@ -1508,6 +1508,9 @@ int acpi_processor_power_init(struct acpi_processor *pr)
|
|||
if (retval) {
|
||||
if (acpi_processor_registered == 0)
|
||||
cpuidle_unregister_driver(&acpi_idle_driver);
|
||||
|
||||
per_cpu(acpi_cpuidle_device, pr->id) = NULL;
|
||||
kfree(dev);
|
||||
return retval;
|
||||
}
|
||||
acpi_processor_registered++;
|
||||
|
|
|
|||
|
|
@ -974,17 +974,8 @@ static int binder_inc_node_nilocked(struct binder_node *node, int strong,
|
|||
} else {
|
||||
if (!internal)
|
||||
node->local_weak_refs++;
|
||||
if (!node->has_weak_ref && list_empty(&node->work.entry)) {
|
||||
if (target_list == NULL) {
|
||||
pr_err("invalid inc weak node for %d\n",
|
||||
node->debug_id);
|
||||
return -EINVAL;
|
||||
}
|
||||
/*
|
||||
* See comment above
|
||||
*/
|
||||
if (!node->has_weak_ref && target_list && list_empty(&node->work.entry))
|
||||
binder_enqueue_work_ilocked(&node->work, target_list);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -944,6 +944,10 @@ int __register_one_node(int nid)
|
|||
return -ENOMEM;
|
||||
|
||||
error = register_node(node_devices[nid], nid);
|
||||
if (error) {
|
||||
node_devices[nid] = NULL;
|
||||
return error;
|
||||
}
|
||||
|
||||
/* link cpu under this node */
|
||||
for_each_present_cpu(cpu) {
|
||||
|
|
|
|||
|
|
@ -633,16 +633,10 @@ static void tpm_tis_gen_interrupt(struct tpm_chip *chip)
|
|||
cap_t cap;
|
||||
int ret;
|
||||
|
||||
ret = request_locality(chip, 0);
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
if (chip->flags & TPM_CHIP_FLAG_TPM2)
|
||||
ret = tpm2_get_tpm_pt(chip, 0x100, &cap2, desc);
|
||||
else
|
||||
ret = tpm1_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, desc, 0);
|
||||
|
||||
release_locality(chip, 0);
|
||||
}
|
||||
|
||||
/* Register the IRQ and issue a command that will cause an interrupt. If an
|
||||
|
|
@ -665,11 +659,17 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
|
|||
}
|
||||
priv->irq = irq;
|
||||
|
||||
rc = tpm_tis_read8(priv, TPM_INT_VECTOR(priv->locality),
|
||||
&original_int_vec);
|
||||
rc = request_locality(chip, 0);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
rc = tpm_tis_read8(priv, TPM_INT_VECTOR(priv->locality),
|
||||
&original_int_vec);
|
||||
if (rc < 0) {
|
||||
release_locality(chip, priv->locality);
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = tpm_tis_write8(priv, TPM_INT_VECTOR(priv->locality), irq);
|
||||
if (rc < 0)
|
||||
goto restore_irqs;
|
||||
|
|
@ -700,12 +700,14 @@ restore_irqs:
|
|||
* will call disable_irq which undoes all of the above.
|
||||
*/
|
||||
if (!(chip->flags & TPM_CHIP_FLAG_IRQ)) {
|
||||
tpm_tis_write8(priv, original_int_vec,
|
||||
TPM_INT_VECTOR(priv->locality));
|
||||
return -1;
|
||||
tpm_tis_write8(priv, TPM_INT_VECTOR(priv->locality),
|
||||
original_int_vec);
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
release_locality(chip, priv->locality);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Try to find the IRQ the TPM is using. This is for legacy x86 systems that
|
||||
|
|
|
|||
|
|
@ -374,23 +374,25 @@ static unsigned long lpc18xx_pll0_recalc_rate(struct clk_hw *hw,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static long lpc18xx_pll0_round_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long *prate)
|
||||
static int lpc18xx_pll0_determine_rate(struct clk_hw *hw,
|
||||
struct clk_rate_request *req)
|
||||
{
|
||||
unsigned long m;
|
||||
|
||||
if (*prate < rate) {
|
||||
if (req->best_parent_rate < req->rate) {
|
||||
pr_warn("%s: pll dividers not supported\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
m = DIV_ROUND_UP_ULL(*prate, rate * 2);
|
||||
if (m <= 0 && m > LPC18XX_PLL0_MSEL_MAX) {
|
||||
pr_warn("%s: unable to support rate %lu\n", __func__, rate);
|
||||
m = DIV_ROUND_UP_ULL(req->best_parent_rate, req->rate * 2);
|
||||
if (m == 0 || m > LPC18XX_PLL0_MSEL_MAX) {
|
||||
pr_warn("%s: unable to support rate %lu\n", __func__, req->rate);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 2 * *prate * m;
|
||||
req->rate = 2 * req->best_parent_rate * m;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lpc18xx_pll0_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
|
|
@ -406,7 +408,7 @@ static int lpc18xx_pll0_set_rate(struct clk_hw *hw, unsigned long rate,
|
|||
}
|
||||
|
||||
m = DIV_ROUND_UP_ULL(parent_rate, rate * 2);
|
||||
if (m <= 0 && m > LPC18XX_PLL0_MSEL_MAX) {
|
||||
if (m == 0 || m > LPC18XX_PLL0_MSEL_MAX) {
|
||||
pr_warn("%s: unable to support rate %lu\n", __func__, rate);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -447,7 +449,7 @@ static int lpc18xx_pll0_set_rate(struct clk_hw *hw, unsigned long rate,
|
|||
|
||||
static const struct clk_ops lpc18xx_pll0_ops = {
|
||||
.recalc_rate = lpc18xx_pll0_recalc_rate,
|
||||
.round_rate = lpc18xx_pll0_round_rate,
|
||||
.determine_rate = lpc18xx_pll0_determine_rate,
|
||||
.set_rate = lpc18xx_pll0_set_rate,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -78,24 +78,33 @@ static int __init clps711x_timer_init(struct device_node *np)
|
|||
unsigned int irq = irq_of_parse_and_map(np, 0);
|
||||
struct clk *clock = of_clk_get(np, 0);
|
||||
void __iomem *base = of_iomap(np, 0);
|
||||
int ret = 0;
|
||||
|
||||
if (!base)
|
||||
return -ENOMEM;
|
||||
if (!irq)
|
||||
return -EINVAL;
|
||||
if (IS_ERR(clock))
|
||||
return PTR_ERR(clock);
|
||||
if (!irq) {
|
||||
ret = -EINVAL;
|
||||
goto unmap_io;
|
||||
}
|
||||
if (IS_ERR(clock)) {
|
||||
ret = PTR_ERR(clock);
|
||||
goto unmap_io;
|
||||
}
|
||||
|
||||
switch (of_alias_get_id(np, "timer")) {
|
||||
case CLPS711X_CLKSRC_CLOCKSOURCE:
|
||||
clps711x_clksrc_init(clock, base);
|
||||
break;
|
||||
case CLPS711X_CLKSRC_CLOCKEVENT:
|
||||
return _clps711x_clkevt_init(clock, base, irq);
|
||||
ret = _clps711x_clkevt_init(clock, base, irq);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
unmap_io:
|
||||
iounmap(base);
|
||||
return ret;
|
||||
}
|
||||
TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init);
|
||||
|
|
|
|||
|
|
@ -1092,10 +1092,10 @@ static void update_qos_request(enum freq_qos_req_type type)
|
|||
continue;
|
||||
|
||||
req = policy->driver_data;
|
||||
cpufreq_cpu_put(policy);
|
||||
|
||||
if (!req)
|
||||
if (!req) {
|
||||
cpufreq_cpu_put(policy);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hwp_active)
|
||||
intel_pstate_get_hwp_max(i, &turbo_max, &max_state);
|
||||
|
|
@ -1114,6 +1114,8 @@ static void update_qos_request(enum freq_qos_req_type type)
|
|||
|
||||
if (freq_qos_update_request(req, freq) < 0)
|
||||
pr_warn("Failed to update freq constraint: CPU%d\n", i);
|
||||
|
||||
cpufreq_cpu_put(policy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -258,20 +258,17 @@ again:
|
|||
*
|
||||
* This can deal with workloads that have long pauses interspersed
|
||||
* with sporadic activity with a bunch of short pauses.
|
||||
*
|
||||
* However, if the number of remaining samples is too small to exclude
|
||||
* any more outliers, allow the deepest available idle state to be
|
||||
* selected because there are systems where the time spent by CPUs in
|
||||
* deep idle states is correlated to the maximum frequency the CPUs
|
||||
* can get to. On those systems, shallow idle states should be avoided
|
||||
* unless there is a clear indication that the given CPU is most likley
|
||||
* going to be woken up shortly.
|
||||
*/
|
||||
if (divisor * 4 <= INTERVALS * 3) {
|
||||
/*
|
||||
* If there are sufficiently many data points still under
|
||||
* consideration after the outliers have been eliminated,
|
||||
* returning without a prediction would be a mistake because it
|
||||
* is likely that the next interval will not exceed the current
|
||||
* maximum, so return the latter in that case.
|
||||
*/
|
||||
if (divisor >= INTERVALS / 2)
|
||||
return max;
|
||||
|
||||
if (divisor * 4 <= INTERVALS * 3)
|
||||
return UINT_MAX;
|
||||
}
|
||||
|
||||
thresh = max - 1;
|
||||
goto again;
|
||||
|
|
|
|||
|
|
@ -565,7 +565,7 @@ static int atmel_tdes_crypt_start(struct atmel_tdes_dev *dd)
|
|||
|
||||
if (err && (dd->flags & TDES_FLAGS_FAST)) {
|
||||
dma_unmap_sg(dd->dev, dd->in_sg, 1, DMA_TO_DEVICE);
|
||||
dma_unmap_sg(dd->dev, dd->out_sg, 1, DMA_TO_DEVICE);
|
||||
dma_unmap_sg(dd->dev, dd->out_sg, 1, DMA_FROM_DEVICE);
|
||||
}
|
||||
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -223,11 +223,16 @@ EXPORT_SYMBOL(meson_sm_call_write);
|
|||
struct meson_sm_firmware *meson_sm_get(struct device_node *sm_node)
|
||||
{
|
||||
struct platform_device *pdev = of_find_device_by_node(sm_node);
|
||||
struct meson_sm_firmware *fw;
|
||||
|
||||
if (!pdev)
|
||||
return NULL;
|
||||
|
||||
return platform_get_drvdata(pdev);
|
||||
fw = platform_get_drvdata(pdev);
|
||||
|
||||
put_device(&pdev->dev);
|
||||
|
||||
return fw;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(meson_sm_get);
|
||||
|
||||
|
|
|
|||
|
|
@ -1572,10 +1572,9 @@ int amdgpu_amdkfd_gpuvm_get_vm_fault_info(struct kgd_dev *kgd,
|
|||
struct amdgpu_device *adev;
|
||||
|
||||
adev = (struct amdgpu_device *)kgd;
|
||||
if (atomic_read(&adev->gmc.vm_fault_info_updated) == 1) {
|
||||
if (atomic_read_acquire(&adev->gmc.vm_fault_info_updated) == 1) {
|
||||
*mem = *adev->gmc.vm_fault_info;
|
||||
mb();
|
||||
atomic_set(&adev->gmc.vm_fault_info_updated, 0);
|
||||
atomic_set_release(&adev->gmc.vm_fault_info_updated, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1042,7 +1042,7 @@ static int gmc_v7_0_sw_init(void *handle)
|
|||
GFP_KERNEL);
|
||||
if (!adev->gmc.vm_fault_info)
|
||||
return -ENOMEM;
|
||||
atomic_set(&adev->gmc.vm_fault_info_updated, 0);
|
||||
atomic_set_release(&adev->gmc.vm_fault_info_updated, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1272,7 +1272,7 @@ static int gmc_v7_0_process_interrupt(struct amdgpu_device *adev,
|
|||
vmid = REG_GET_FIELD(status, VM_CONTEXT1_PROTECTION_FAULT_STATUS,
|
||||
VMID);
|
||||
if (amdgpu_amdkfd_is_kfd_vmid(adev, vmid)
|
||||
&& !atomic_read(&adev->gmc.vm_fault_info_updated)) {
|
||||
&& !atomic_read_acquire(&adev->gmc.vm_fault_info_updated)) {
|
||||
struct kfd_vm_fault_info *info = adev->gmc.vm_fault_info;
|
||||
u32 protections = REG_GET_FIELD(status,
|
||||
VM_CONTEXT1_PROTECTION_FAULT_STATUS,
|
||||
|
|
@ -1288,8 +1288,7 @@ static int gmc_v7_0_process_interrupt(struct amdgpu_device *adev,
|
|||
info->prot_read = protections & 0x8 ? true : false;
|
||||
info->prot_write = protections & 0x10 ? true : false;
|
||||
info->prot_exec = protections & 0x20 ? true : false;
|
||||
mb();
|
||||
atomic_set(&adev->gmc.vm_fault_info_updated, 1);
|
||||
atomic_set_release(&adev->gmc.vm_fault_info_updated, 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1175,7 +1175,7 @@ static int gmc_v8_0_sw_init(void *handle)
|
|||
GFP_KERNEL);
|
||||
if (!adev->gmc.vm_fault_info)
|
||||
return -ENOMEM;
|
||||
atomic_set(&adev->gmc.vm_fault_info_updated, 0);
|
||||
atomic_set_release(&adev->gmc.vm_fault_info_updated, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1464,7 +1464,7 @@ static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev,
|
|||
vmid = REG_GET_FIELD(status, VM_CONTEXT1_PROTECTION_FAULT_STATUS,
|
||||
VMID);
|
||||
if (amdgpu_amdkfd_is_kfd_vmid(adev, vmid)
|
||||
&& !atomic_read(&adev->gmc.vm_fault_info_updated)) {
|
||||
&& !atomic_read_acquire(&adev->gmc.vm_fault_info_updated)) {
|
||||
struct kfd_vm_fault_info *info = adev->gmc.vm_fault_info;
|
||||
u32 protections = REG_GET_FIELD(status,
|
||||
VM_CONTEXT1_PROTECTION_FAULT_STATUS,
|
||||
|
|
@ -1480,8 +1480,7 @@ static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev,
|
|||
info->prot_read = protections & 0x8 ? true : false;
|
||||
info->prot_write = protections & 0x10 ? true : false;
|
||||
info->prot_exec = protections & 0x20 ? true : false;
|
||||
mb();
|
||||
atomic_set(&adev->gmc.vm_fault_info_updated, 1);
|
||||
atomic_set_release(&adev->gmc.vm_fault_info_updated, 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ struct decon_context {
|
|||
void __iomem *regs;
|
||||
unsigned long irq_flags;
|
||||
bool i80_if;
|
||||
bool suspended;
|
||||
wait_queue_head_t wait_vsync_queue;
|
||||
atomic_t wait_vsync_event;
|
||||
|
||||
|
|
@ -85,9 +84,6 @@ static void decon_wait_for_vblank(struct exynos_drm_crtc *crtc)
|
|||
{
|
||||
struct decon_context *ctx = crtc->ctx;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
atomic_set(&ctx->wait_vsync_event, 1);
|
||||
|
||||
/*
|
||||
|
|
@ -155,9 +151,6 @@ static void decon_commit(struct exynos_drm_crtc *crtc)
|
|||
struct drm_display_mode *mode = &crtc->base.state->adjusted_mode;
|
||||
u32 val, clkdiv;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
/* nothing to do if we haven't set the mode yet */
|
||||
if (mode->htotal == 0 || mode->vtotal == 0)
|
||||
return;
|
||||
|
|
@ -219,9 +212,6 @@ static int decon_enable_vblank(struct exynos_drm_crtc *crtc)
|
|||
struct decon_context *ctx = crtc->ctx;
|
||||
u32 val;
|
||||
|
||||
if (ctx->suspended)
|
||||
return -EPERM;
|
||||
|
||||
if (!test_and_set_bit(0, &ctx->irq_flags)) {
|
||||
val = readl(ctx->regs + VIDINTCON0);
|
||||
|
||||
|
|
@ -244,9 +234,6 @@ static void decon_disable_vblank(struct exynos_drm_crtc *crtc)
|
|||
struct decon_context *ctx = crtc->ctx;
|
||||
u32 val;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
if (test_and_clear_bit(0, &ctx->irq_flags)) {
|
||||
val = readl(ctx->regs + VIDINTCON0);
|
||||
|
||||
|
|
@ -369,9 +356,6 @@ static void decon_atomic_begin(struct exynos_drm_crtc *crtc)
|
|||
struct decon_context *ctx = crtc->ctx;
|
||||
int i;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
for (i = 0; i < WINDOWS_NR; i++)
|
||||
decon_shadow_protect_win(ctx, i, true);
|
||||
}
|
||||
|
|
@ -391,9 +375,6 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc,
|
|||
unsigned int cpp = fb->format->cpp[0];
|
||||
unsigned int pitch = fb->pitches[0];
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
/*
|
||||
* SHADOWCON/PRTCON register is used for enabling timing.
|
||||
*
|
||||
|
|
@ -481,9 +462,6 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc,
|
|||
unsigned int win = plane->index;
|
||||
u32 val;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
/* protect windows */
|
||||
decon_shadow_protect_win(ctx, win, true);
|
||||
|
||||
|
|
@ -502,9 +480,6 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc)
|
|||
struct decon_context *ctx = crtc->ctx;
|
||||
int i;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
for (i = 0; i < WINDOWS_NR; i++)
|
||||
decon_shadow_protect_win(ctx, i, false);
|
||||
exynos_crtc_handle_event(crtc);
|
||||
|
|
@ -531,9 +506,6 @@ static void decon_enable(struct exynos_drm_crtc *crtc)
|
|||
{
|
||||
struct decon_context *ctx = crtc->ctx;
|
||||
|
||||
if (!ctx->suspended)
|
||||
return;
|
||||
|
||||
pm_runtime_get_sync(ctx->dev);
|
||||
|
||||
decon_init(ctx);
|
||||
|
|
@ -543,8 +515,6 @@ static void decon_enable(struct exynos_drm_crtc *crtc)
|
|||
decon_enable_vblank(ctx->crtc);
|
||||
|
||||
decon_commit(ctx->crtc);
|
||||
|
||||
ctx->suspended = false;
|
||||
}
|
||||
|
||||
static void decon_disable(struct exynos_drm_crtc *crtc)
|
||||
|
|
@ -552,9 +522,6 @@ static void decon_disable(struct exynos_drm_crtc *crtc)
|
|||
struct decon_context *ctx = crtc->ctx;
|
||||
int i;
|
||||
|
||||
if (ctx->suspended)
|
||||
return;
|
||||
|
||||
/*
|
||||
* We need to make sure that all windows are disabled before we
|
||||
* suspend that connector. Otherwise we might try to scan from
|
||||
|
|
@ -564,8 +531,6 @@ static void decon_disable(struct exynos_drm_crtc *crtc)
|
|||
decon_disable_plane(crtc, &ctx->planes[i]);
|
||||
|
||||
pm_runtime_put_sync(ctx->dev);
|
||||
|
||||
ctx->suspended = true;
|
||||
}
|
||||
|
||||
static const struct exynos_drm_crtc_ops decon_crtc_ops = {
|
||||
|
|
@ -683,7 +648,6 @@ static int decon_probe(struct platform_device *pdev)
|
|||
return -ENOMEM;
|
||||
|
||||
ctx->dev = dev;
|
||||
ctx->suspended = true;
|
||||
|
||||
i80_if_timings = of_get_child_by_name(dev->of_node, "i80-if-timings");
|
||||
if (i80_if_timings)
|
||||
|
|
|
|||
|
|
@ -1122,7 +1122,7 @@ done:
|
|||
nvif_vmm_put(vmm, &old_mem->vma[1]);
|
||||
nvif_vmm_put(vmm, &old_mem->vma[0]);
|
||||
}
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -1411,7 +1411,7 @@ static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned llevel,
|
|||
unsigned block_align, unsigned height_align, unsigned base_align,
|
||||
unsigned *l0_size, unsigned *mipmap_size)
|
||||
{
|
||||
unsigned offset, i, level;
|
||||
unsigned offset, i;
|
||||
unsigned width, height, depth, size;
|
||||
unsigned blocksize;
|
||||
unsigned nbx, nby;
|
||||
|
|
@ -1423,7 +1423,7 @@ static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned llevel,
|
|||
w0 = r600_mip_minify(w0, 0);
|
||||
h0 = r600_mip_minify(h0, 0);
|
||||
d0 = r600_mip_minify(d0, 0);
|
||||
for(i = 0, offset = 0, level = blevel; i < nlevels; i++, level++) {
|
||||
for (i = 0, offset = 0; i < nlevels; i++) {
|
||||
width = r600_mip_minify(w0, i);
|
||||
nbx = r600_fmt_get_nblocksx(format, width);
|
||||
|
||||
|
|
|
|||
|
|
@ -339,8 +339,10 @@ int vmw_validation_add_resource(struct vmw_validation_context *ctx,
|
|||
}
|
||||
}
|
||||
node->res = vmw_resource_reference_unless_doomed(res);
|
||||
if (!node->res)
|
||||
if (!node->res) {
|
||||
hash_del_rcu(&node->hash.head);
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
node->first_usage = 1;
|
||||
if (!res->dev_priv->has_mob) {
|
||||
|
|
|
|||
|
|
@ -414,6 +414,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
|
|||
|
||||
exit_probe:
|
||||
dw_i2c_plat_pm_cleanup(dev);
|
||||
i2c_dw_prepare_clk(dev, false);
|
||||
exit_reset:
|
||||
reset_control_assert(dev->rst);
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -782,6 +782,7 @@ static int mtk_i2c_transfer(struct i2c_adapter *adap,
|
|||
{
|
||||
int ret;
|
||||
int left_num = num;
|
||||
bool write_then_read_en = false;
|
||||
struct mtk_i2c *i2c = i2c_get_adapdata(adap);
|
||||
|
||||
ret = mtk_i2c_clock_enable(i2c);
|
||||
|
|
@ -795,6 +796,7 @@ static int mtk_i2c_transfer(struct i2c_adapter *adap,
|
|||
if (!(msgs[0].flags & I2C_M_RD) && (msgs[1].flags & I2C_M_RD) &&
|
||||
msgs[0].addr == msgs[1].addr) {
|
||||
i2c->auto_restart = 0;
|
||||
write_then_read_en = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -818,12 +820,10 @@ static int mtk_i2c_transfer(struct i2c_adapter *adap,
|
|||
else
|
||||
i2c->op = I2C_MASTER_WR;
|
||||
|
||||
if (!i2c->auto_restart) {
|
||||
if (num > 1) {
|
||||
/* combined two messages into one transaction */
|
||||
i2c->op = I2C_MASTER_WRRD;
|
||||
left_num--;
|
||||
}
|
||||
if (write_then_read_en) {
|
||||
/* combined two messages into one transaction */
|
||||
i2c->op = I2C_MASTER_WRRD;
|
||||
left_num--;
|
||||
}
|
||||
|
||||
/* always use DMA mode. */
|
||||
|
|
@ -831,7 +831,10 @@ static int mtk_i2c_transfer(struct i2c_adapter *adap,
|
|||
if (ret < 0)
|
||||
goto err_exit;
|
||||
|
||||
msgs++;
|
||||
if (i2c->op == I2C_MASTER_WRRD)
|
||||
msgs += 2;
|
||||
else
|
||||
msgs++;
|
||||
}
|
||||
/* the return value is number of executed messages */
|
||||
ret = num;
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ static int ad5360_update_ctrl(struct iio_dev *indio_dev, unsigned int set,
|
|||
unsigned int clr)
|
||||
{
|
||||
struct ad5360_state *st = iio_priv(indio_dev);
|
||||
unsigned int ret;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ static int ad5421_update_ctrl(struct iio_dev *indio_dev, unsigned int set,
|
|||
unsigned int clr)
|
||||
{
|
||||
struct ad5421_state *st = iio_priv(indio_dev);
|
||||
unsigned int ret;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
|
||||
|
|
|
|||
|
|
@ -137,6 +137,19 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
|
|||
if (freq > ADF4350_MAX_OUT_FREQ || freq < st->min_out_freq)
|
||||
return -EINVAL;
|
||||
|
||||
st->r4_rf_div_sel = 0;
|
||||
|
||||
/*
|
||||
* !\TODO: The below computation is making sure we get a power of 2
|
||||
* shift (st->r4_rf_div_sel) so that freq becomes higher or equal to
|
||||
* ADF4350_MIN_VCO_FREQ. This might be simplified with fls()/fls_long()
|
||||
* and friends.
|
||||
*/
|
||||
while (freq < ADF4350_MIN_VCO_FREQ) {
|
||||
freq <<= 1;
|
||||
st->r4_rf_div_sel++;
|
||||
}
|
||||
|
||||
if (freq > ADF4350_MAX_FREQ_45_PRESC) {
|
||||
prescaler = ADF4350_REG1_PRESCALER;
|
||||
mdiv = 75;
|
||||
|
|
@ -145,13 +158,6 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
|
|||
mdiv = 23;
|
||||
}
|
||||
|
||||
st->r4_rf_div_sel = 0;
|
||||
|
||||
while (freq < ADF4350_MIN_VCO_FREQ) {
|
||||
freq <<= 1;
|
||||
st->r4_rf_div_sel++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allow a predefined reference division factor
|
||||
* if not set, compute our own
|
||||
|
|
|
|||
|
|
@ -627,7 +627,7 @@ static int iio_convert_raw_to_processed_unlocked(struct iio_channel *chan,
|
|||
* If no channel scaling is available apply consumer scale to
|
||||
* raw value and return.
|
||||
*/
|
||||
*processed = raw * scale;
|
||||
*processed = raw64 * scale;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -459,14 +459,10 @@ static int addr_resolve_neigh(const struct dst_entry *dst,
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
if (ndev_flags & IFF_LOOPBACK) {
|
||||
if (ndev_flags & IFF_LOOPBACK)
|
||||
memcpy(addr->dst_dev_addr, addr->src_dev_addr, MAX_ADDR_LEN);
|
||||
} else {
|
||||
if (!(ndev_flags & IFF_NOARP)) {
|
||||
/* If the device doesn't do ARP internally */
|
||||
ret = fetch_ha(dst, addr, dst_in, seq);
|
||||
}
|
||||
}
|
||||
else
|
||||
ret = fetch_ha(dst, addr, dst_in, seq);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1036,6 +1036,8 @@ int ib_nl_handle_set_timeout(struct sk_buff *skb,
|
|||
if (timeout > IB_SA_LOCAL_SVC_TIMEOUT_MAX)
|
||||
timeout = IB_SA_LOCAL_SVC_TIMEOUT_MAX;
|
||||
|
||||
spin_lock_irqsave(&ib_nl_request_lock, flags);
|
||||
|
||||
delta = timeout - sa_local_svc_timeout_ms;
|
||||
if (delta < 0)
|
||||
abs_delta = -delta;
|
||||
|
|
@ -1043,7 +1045,6 @@ int ib_nl_handle_set_timeout(struct sk_buff *skb,
|
|||
abs_delta = delta;
|
||||
|
||||
if (delta != 0) {
|
||||
spin_lock_irqsave(&ib_nl_request_lock, flags);
|
||||
sa_local_svc_timeout_ms = timeout;
|
||||
list_for_each_entry(query, &ib_nl_request_list, list) {
|
||||
if (delta < 0 && abs_delta > query->timeout)
|
||||
|
|
@ -1061,9 +1062,10 @@ int ib_nl_handle_set_timeout(struct sk_buff *skb,
|
|||
if (delay)
|
||||
mod_delayed_work(ib_nl_wq, &ib_nl_timed_work,
|
||||
(unsigned long)delay);
|
||||
spin_unlock_irqrestore(&ib_nl_request_lock, flags);
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&ib_nl_request_lock, flags);
|
||||
|
||||
settimeout_out:
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -779,7 +779,7 @@ int siw_post_send(struct ib_qp *base_qp, const struct ib_send_wr *wr,
|
|||
struct siw_wqe *wqe = tx_wqe(qp);
|
||||
|
||||
unsigned long flags;
|
||||
int rv = 0;
|
||||
int rv = 0, imm_err = 0;
|
||||
|
||||
if (wr && !qp->kernel_verbs) {
|
||||
siw_dbg_qp(qp, "wr must be empty for user mapped sq\n");
|
||||
|
|
@ -965,9 +965,17 @@ int siw_post_send(struct ib_qp *base_qp, const struct ib_send_wr *wr,
|
|||
* Send directly if SQ processing is not in progress.
|
||||
* Eventual immediate errors (rv < 0) do not affect the involved
|
||||
* RI resources (Verbs, 8.3.1) and thus do not prevent from SQ
|
||||
* processing, if new work is already pending. But rv must be passed
|
||||
* to caller.
|
||||
* processing, if new work is already pending. But rv and pointer
|
||||
* to failed work request must be passed to caller.
|
||||
*/
|
||||
if (unlikely(rv < 0)) {
|
||||
/*
|
||||
* Immediate error
|
||||
*/
|
||||
siw_dbg_qp(qp, "Immediate error %d\n", rv);
|
||||
imm_err = rv;
|
||||
*bad_wr = wr;
|
||||
}
|
||||
if (wqe->wr_status != SIW_WR_IDLE) {
|
||||
spin_unlock_irqrestore(&qp->sq_lock, flags);
|
||||
goto skip_direct_sending;
|
||||
|
|
@ -992,15 +1000,10 @@ skip_direct_sending:
|
|||
|
||||
up_read(&qp->state_lock);
|
||||
|
||||
if (rv >= 0)
|
||||
return 0;
|
||||
/*
|
||||
* Immediate error
|
||||
*/
|
||||
siw_dbg_qp(qp, "error %d\n", rv);
|
||||
if (unlikely(imm_err))
|
||||
return imm_err;
|
||||
|
||||
*bad_wr = wr;
|
||||
return rv;
|
||||
return (rv >= 0) ? 0 : rv;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -774,6 +774,7 @@ static int uinput_ff_upload_to_user(char __user *buffer,
|
|||
if (in_compat_syscall()) {
|
||||
struct uinput_ff_upload_compat ff_up_compat;
|
||||
|
||||
memset(&ff_up_compat, 0, sizeof(ff_up_compat));
|
||||
ff_up_compat.request_id = ff_up->request_id;
|
||||
ff_up_compat.retval = ff_up->retval;
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -618,11 +618,8 @@ static void zynqmp_ipi_free_mboxes(struct zynqmp_ipi_pdata *pdata)
|
|||
i = pdata->num_mboxes;
|
||||
for (; i >= 0; i--) {
|
||||
ipi_mbox = &pdata->ipi_mboxes[i];
|
||||
if (ipi_mbox->dev.parent) {
|
||||
mbox_controller_unregister(&ipi_mbox->mbox);
|
||||
if (device_is_registered(&ipi_mbox->dev))
|
||||
device_unregister(&ipi_mbox->dev);
|
||||
}
|
||||
if (device_is_registered(&ipi_mbox->dev))
|
||||
device_unregister(&ipi_mbox->dev);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ struct journal_sector {
|
|||
commit_id_t commit_id;
|
||||
};
|
||||
|
||||
#define MAX_TAG_SIZE (JOURNAL_SECTOR_DATA - JOURNAL_MAC_PER_SECTOR - offsetof(struct journal_entry, last_bytes[MAX_SECTORS_PER_BLOCK]))
|
||||
#define MAX_TAG_SIZE 255
|
||||
|
||||
#define METADATA_PADDING_SECTORS 8
|
||||
|
||||
|
|
|
|||
|
|
@ -2747,7 +2747,7 @@ static int __dm_suspend(struct mapped_device *md, struct dm_table *map,
|
|||
{
|
||||
bool do_lockfs = suspend_flags & DM_SUSPEND_LOCKFS_FLAG;
|
||||
bool noflush = suspend_flags & DM_SUSPEND_NOFLUSH_FLAG;
|
||||
int r;
|
||||
int r = 0;
|
||||
|
||||
lockdep_assert_held(&md->suspend_lock);
|
||||
|
||||
|
|
@ -2800,7 +2800,7 @@ static int __dm_suspend(struct mapped_device *md, struct dm_table *map,
|
|||
* Stop md->queue before flushing md->wq in case request-based
|
||||
* dm defers requests to md->wq from md->queue.
|
||||
*/
|
||||
if (dm_request_based(md))
|
||||
if (map && dm_request_based(md))
|
||||
dm_stop_queue(md->queue);
|
||||
|
||||
flush_workqueue(md->wq);
|
||||
|
|
@ -2810,7 +2810,8 @@ static int __dm_suspend(struct mapped_device *md, struct dm_table *map,
|
|||
* We call dm_wait_for_completion to wait for all existing requests
|
||||
* to finish.
|
||||
*/
|
||||
r = dm_wait_for_completion(md, task_state);
|
||||
if (map)
|
||||
r = dm_wait_for_completion(md, task_state);
|
||||
if (!r)
|
||||
set_bit(dmf_suspended_flag, &md->flags);
|
||||
|
||||
|
|
|
|||
|
|
@ -534,8 +534,8 @@ static int mt9v111_calc_frame_rate(struct mt9v111_dev *mt9v111,
|
|||
static int mt9v111_hw_config(struct mt9v111_dev *mt9v111)
|
||||
{
|
||||
struct i2c_client *c = mt9v111->client;
|
||||
unsigned int ret;
|
||||
u16 outfmtctrl2;
|
||||
int ret;
|
||||
|
||||
/* Force device reset. */
|
||||
ret = __mt9v111_hw_reset(mt9v111);
|
||||
|
|
|
|||
|
|
@ -1332,10 +1332,13 @@ static int rj54n1_probe(struct i2c_client *client,
|
|||
V4L2_CID_GAIN, 0, 127, 1, 66);
|
||||
v4l2_ctrl_new_std(&rj54n1->hdl, &rj54n1_ctrl_ops,
|
||||
V4L2_CID_AUTO_WHITE_BALANCE, 0, 1, 1, 1);
|
||||
rj54n1->subdev.ctrl_handler = &rj54n1->hdl;
|
||||
if (rj54n1->hdl.error)
|
||||
return rj54n1->hdl.error;
|
||||
|
||||
if (rj54n1->hdl.error) {
|
||||
ret = rj54n1->hdl.error;
|
||||
goto err_free_ctrl;
|
||||
}
|
||||
|
||||
rj54n1->subdev.ctrl_handler = &rj54n1->hdl;
|
||||
rj54n1->clk_div = clk_div;
|
||||
rj54n1->rect.left = RJ54N1_COLUMN_SKIP;
|
||||
rj54n1->rect.top = RJ54N1_ROW_SKIP;
|
||||
|
|
|
|||
|
|
@ -2200,10 +2200,10 @@ static int tc358743_probe(struct i2c_client *client)
|
|||
err_work_queues:
|
||||
cec_unregister_adapter(state->cec_adap);
|
||||
if (!state->i2c_client->irq) {
|
||||
del_timer(&state->timer);
|
||||
timer_delete_sync(&state->timer);
|
||||
flush_work(&state->work_i2c_poll);
|
||||
}
|
||||
cancel_delayed_work(&state->delayed_work_enable_hotplug);
|
||||
cancel_delayed_work_sync(&state->delayed_work_enable_hotplug);
|
||||
mutex_destroy(&state->confctl_mutex);
|
||||
err_hdl:
|
||||
media_entity_cleanup(&sd->entity);
|
||||
|
|
|
|||
|
|
@ -50,11 +50,6 @@ static void media_devnode_release(struct device *cd)
|
|||
{
|
||||
struct media_devnode *devnode = to_media_devnode(cd);
|
||||
|
||||
mutex_lock(&media_devnode_lock);
|
||||
/* Mark device node number as free */
|
||||
clear_bit(devnode->minor, media_devnode_nums);
|
||||
mutex_unlock(&media_devnode_lock);
|
||||
|
||||
/* Release media_devnode and perform other cleanups as needed. */
|
||||
if (devnode->release)
|
||||
devnode->release(devnode);
|
||||
|
|
@ -283,6 +278,7 @@ void media_devnode_unregister(struct media_devnode *devnode)
|
|||
/* Delete the cdev on this minor as well */
|
||||
cdev_device_del(&devnode->cdev, &devnode->dev);
|
||||
devnode->media_dev = NULL;
|
||||
clear_bit(devnode->minor, media_devnode_nums);
|
||||
mutex_unlock(&media_devnode_lock);
|
||||
|
||||
put_device(&devnode->dev);
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ static void flexcop_pci_remove(struct pci_dev *pdev)
|
|||
struct flexcop_pci *fc_pci = pci_get_drvdata(pdev);
|
||||
|
||||
if (irq_chk_intv > 0)
|
||||
cancel_delayed_work(&fc_pci->irq_check_work);
|
||||
cancel_delayed_work_sync(&fc_pci->irq_check_work);
|
||||
|
||||
flexcop_pci_dma_exit(fc_pci);
|
||||
flexcop_device_exit(fc_pci->fc_dev);
|
||||
|
|
|
|||
|
|
@ -379,14 +379,22 @@ int cx18_stream_alloc(struct cx18_stream *s)
|
|||
break;
|
||||
}
|
||||
|
||||
buf->dma_handle = dma_map_single(&s->cx->pci_dev->dev,
|
||||
buf->buf, s->buf_size,
|
||||
s->dma);
|
||||
if (dma_mapping_error(&s->cx->pci_dev->dev, buf->dma_handle)) {
|
||||
kfree(buf->buf);
|
||||
kfree(mdl);
|
||||
kfree(buf);
|
||||
break;
|
||||
}
|
||||
|
||||
INIT_LIST_HEAD(&mdl->list);
|
||||
INIT_LIST_HEAD(&mdl->buf_list);
|
||||
mdl->id = s->mdl_base_idx; /* a somewhat safe value */
|
||||
cx18_enqueue(s, mdl, &s->q_idle);
|
||||
|
||||
INIT_LIST_HEAD(&buf->list);
|
||||
buf->dma_handle = pci_map_single(s->cx->pci_dev,
|
||||
buf->buf, s->buf_size, s->dma);
|
||||
cx18_buf_sync_for_cpu(s, buf);
|
||||
list_add_tail(&buf->list, &s->buf_pool);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -843,7 +843,7 @@ static int ivtv_setup_pci(struct ivtv *itv, struct pci_dev *pdev,
|
|||
IVTV_ERR("Can't enable device!\n");
|
||||
return -EIO;
|
||||
}
|
||||
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
|
||||
if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
|
||||
IVTV_ERR("No suitable DMA available.\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ void ivtv_dma_stream_dec_prepare(struct ivtv_stream *s, u32 offset, int lock)
|
|||
|
||||
/* Insert buffer block for YUV if needed */
|
||||
if (s->type == IVTV_DEC_STREAM_TYPE_YUV && f->offset_y) {
|
||||
if (yi->blanking_dmaptr) {
|
||||
if (yi->blanking_ptr) {
|
||||
s->sg_pending[idx].src = yi->blanking_dmaptr;
|
||||
s->sg_pending[idx].dst = offset;
|
||||
s->sg_pending[idx].size = 720 * 16;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ int ivtv_stream_alloc(struct ivtv_stream *s)
|
|||
return 0;
|
||||
|
||||
IVTV_DEBUG_INFO("Allocate %s%s stream: %d x %d buffers (%dkB total)\n",
|
||||
s->dma != PCI_DMA_NONE ? "DMA " : "",
|
||||
s->dma != DMA_NONE ? "DMA " : "",
|
||||
s->name, s->buffers, s->buf_size, s->buffers * s->buf_size / 1024);
|
||||
|
||||
s->sg_pending = kzalloc(SGsize, GFP_KERNEL|__GFP_NOWARN);
|
||||
|
|
@ -218,8 +218,9 @@ int ivtv_stream_alloc(struct ivtv_stream *s)
|
|||
return -ENOMEM;
|
||||
}
|
||||
if (ivtv_might_use_dma(s)) {
|
||||
s->sg_handle = pci_map_single(itv->pdev, s->sg_dma,
|
||||
sizeof(struct ivtv_sg_element), PCI_DMA_TODEVICE);
|
||||
s->sg_handle = dma_map_single(&itv->pdev->dev, s->sg_dma,
|
||||
sizeof(struct ivtv_sg_element),
|
||||
DMA_TO_DEVICE);
|
||||
ivtv_stream_sync_for_cpu(s);
|
||||
}
|
||||
|
||||
|
|
@ -237,7 +238,7 @@ int ivtv_stream_alloc(struct ivtv_stream *s)
|
|||
}
|
||||
INIT_LIST_HEAD(&buf->list);
|
||||
if (ivtv_might_use_dma(s)) {
|
||||
buf->dma_handle = pci_map_single(s->itv->pdev,
|
||||
buf->dma_handle = dma_map_single(&s->itv->pdev->dev,
|
||||
buf->buf, s->buf_size + 256, s->dma);
|
||||
ivtv_buf_sync_for_cpu(s, buf);
|
||||
}
|
||||
|
|
@ -260,8 +261,8 @@ void ivtv_stream_free(struct ivtv_stream *s)
|
|||
/* empty q_free */
|
||||
while ((buf = ivtv_dequeue(s, &s->q_free))) {
|
||||
if (ivtv_might_use_dma(s))
|
||||
pci_unmap_single(s->itv->pdev, buf->dma_handle,
|
||||
s->buf_size + 256, s->dma);
|
||||
dma_unmap_single(&s->itv->pdev->dev, buf->dma_handle,
|
||||
s->buf_size + 256, s->dma);
|
||||
kfree(buf->buf);
|
||||
kfree(buf);
|
||||
}
|
||||
|
|
@ -269,8 +270,9 @@ void ivtv_stream_free(struct ivtv_stream *s)
|
|||
/* Free SG Array/Lists */
|
||||
if (s->sg_dma != NULL) {
|
||||
if (s->sg_handle != IVTV_DMA_UNMAPPED) {
|
||||
pci_unmap_single(s->itv->pdev, s->sg_handle,
|
||||
sizeof(struct ivtv_sg_element), PCI_DMA_TODEVICE);
|
||||
dma_unmap_single(&s->itv->pdev->dev, s->sg_handle,
|
||||
sizeof(struct ivtv_sg_element),
|
||||
DMA_TO_DEVICE);
|
||||
s->sg_handle = IVTV_DMA_UNMAPPED;
|
||||
}
|
||||
kfree(s->sg_pending);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ static struct {
|
|||
{ /* IVTV_ENC_STREAM_TYPE_MPG */
|
||||
"encoder MPG",
|
||||
VFL_TYPE_GRABBER, 0,
|
||||
PCI_DMA_FROMDEVICE, 0,
|
||||
DMA_FROM_DEVICE, 0,
|
||||
V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TUNER |
|
||||
V4L2_CAP_AUDIO | V4L2_CAP_READWRITE,
|
||||
&ivtv_v4l2_enc_fops
|
||||
|
|
@ -108,7 +108,7 @@ static struct {
|
|||
{ /* IVTV_ENC_STREAM_TYPE_YUV */
|
||||
"encoder YUV",
|
||||
VFL_TYPE_GRABBER, IVTV_V4L2_ENC_YUV_OFFSET,
|
||||
PCI_DMA_FROMDEVICE, 0,
|
||||
DMA_FROM_DEVICE, 0,
|
||||
V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TUNER |
|
||||
V4L2_CAP_AUDIO | V4L2_CAP_READWRITE,
|
||||
&ivtv_v4l2_enc_fops
|
||||
|
|
@ -116,7 +116,7 @@ static struct {
|
|||
{ /* IVTV_ENC_STREAM_TYPE_VBI */
|
||||
"encoder VBI",
|
||||
VFL_TYPE_VBI, 0,
|
||||
PCI_DMA_FROMDEVICE, 0,
|
||||
DMA_FROM_DEVICE, 0,
|
||||
V4L2_CAP_VBI_CAPTURE | V4L2_CAP_SLICED_VBI_CAPTURE | V4L2_CAP_TUNER |
|
||||
V4L2_CAP_AUDIO | V4L2_CAP_READWRITE,
|
||||
&ivtv_v4l2_enc_fops
|
||||
|
|
@ -124,42 +124,42 @@ static struct {
|
|||
{ /* IVTV_ENC_STREAM_TYPE_PCM */
|
||||
"encoder PCM",
|
||||
VFL_TYPE_GRABBER, IVTV_V4L2_ENC_PCM_OFFSET,
|
||||
PCI_DMA_FROMDEVICE, 0,
|
||||
DMA_FROM_DEVICE, 0,
|
||||
V4L2_CAP_TUNER | V4L2_CAP_AUDIO | V4L2_CAP_READWRITE,
|
||||
&ivtv_v4l2_enc_fops
|
||||
},
|
||||
{ /* IVTV_ENC_STREAM_TYPE_RAD */
|
||||
"encoder radio",
|
||||
VFL_TYPE_RADIO, 0,
|
||||
PCI_DMA_NONE, 1,
|
||||
DMA_NONE, 1,
|
||||
V4L2_CAP_RADIO | V4L2_CAP_TUNER,
|
||||
&ivtv_v4l2_radio_fops
|
||||
},
|
||||
{ /* IVTV_DEC_STREAM_TYPE_MPG */
|
||||
"decoder MPG",
|
||||
VFL_TYPE_GRABBER, IVTV_V4L2_DEC_MPG_OFFSET,
|
||||
PCI_DMA_TODEVICE, 0,
|
||||
DMA_TO_DEVICE, 0,
|
||||
V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_AUDIO | V4L2_CAP_READWRITE,
|
||||
&ivtv_v4l2_dec_fops
|
||||
},
|
||||
{ /* IVTV_DEC_STREAM_TYPE_VBI */
|
||||
"decoder VBI",
|
||||
VFL_TYPE_VBI, IVTV_V4L2_DEC_VBI_OFFSET,
|
||||
PCI_DMA_NONE, 1,
|
||||
DMA_NONE, 1,
|
||||
V4L2_CAP_SLICED_VBI_CAPTURE | V4L2_CAP_READWRITE,
|
||||
&ivtv_v4l2_enc_fops
|
||||
},
|
||||
{ /* IVTV_DEC_STREAM_TYPE_VOUT */
|
||||
"decoder VOUT",
|
||||
VFL_TYPE_VBI, IVTV_V4L2_DEC_VOUT_OFFSET,
|
||||
PCI_DMA_NONE, 1,
|
||||
DMA_NONE, 1,
|
||||
V4L2_CAP_SLICED_VBI_OUTPUT | V4L2_CAP_AUDIO | V4L2_CAP_READWRITE,
|
||||
&ivtv_v4l2_dec_fops
|
||||
},
|
||||
{ /* IVTV_DEC_STREAM_TYPE_YUV */
|
||||
"decoder YUV",
|
||||
VFL_TYPE_GRABBER, IVTV_V4L2_DEC_YUV_OFFSET,
|
||||
PCI_DMA_TODEVICE, 0,
|
||||
DMA_TO_DEVICE, 0,
|
||||
V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_AUDIO | V4L2_CAP_READWRITE,
|
||||
&ivtv_v4l2_dec_fops
|
||||
}
|
||||
|
|
@ -179,7 +179,7 @@ static void ivtv_stream_init(struct ivtv *itv, int type)
|
|||
s->vdev.device_caps = ivtv_stream_info[type].v4l2_caps;
|
||||
|
||||
if (ivtv_stream_info[type].pio)
|
||||
s->dma = PCI_DMA_NONE;
|
||||
s->dma = DMA_NONE;
|
||||
else
|
||||
s->dma = ivtv_stream_info[type].dma;
|
||||
s->buf_size = itv->stream_buf_size[type];
|
||||
|
|
@ -217,7 +217,7 @@ static int ivtv_prep_dev(struct ivtv *itv, int type)
|
|||
|
||||
/* User explicitly selected 0 buffers for these streams, so don't
|
||||
create them. */
|
||||
if (ivtv_stream_info[type].dma != PCI_DMA_NONE &&
|
||||
if (ivtv_stream_info[type].dma != DMA_NONE &&
|
||||
itv->options.kilobytes[type] == 0) {
|
||||
IVTV_INFO("Disabled %s device\n", ivtv_stream_info[type].name);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -81,8 +81,10 @@ void ivtv_udma_alloc(struct ivtv *itv)
|
|||
{
|
||||
if (itv->udma.SG_handle == 0) {
|
||||
/* Map DMA Page Array Buffer */
|
||||
itv->udma.SG_handle = pci_map_single(itv->pdev, itv->udma.SGarray,
|
||||
sizeof(itv->udma.SGarray), PCI_DMA_TODEVICE);
|
||||
itv->udma.SG_handle = dma_map_single(&itv->pdev->dev,
|
||||
itv->udma.SGarray,
|
||||
sizeof(itv->udma.SGarray),
|
||||
DMA_TO_DEVICE);
|
||||
ivtv_udma_sync_for_cpu(itv);
|
||||
}
|
||||
}
|
||||
|
|
@ -138,7 +140,8 @@ int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr,
|
|||
}
|
||||
|
||||
/* Map SG List */
|
||||
dma->SG_length = pci_map_sg(itv->pdev, dma->SGlist, dma->page_count, PCI_DMA_TODEVICE);
|
||||
dma->SG_length = dma_map_sg(&itv->pdev->dev, dma->SGlist,
|
||||
dma->page_count, DMA_TO_DEVICE);
|
||||
|
||||
/* Fill SG Array with new values */
|
||||
ivtv_udma_fill_sg_array (dma, ivtv_dest_addr, 0, -1);
|
||||
|
|
@ -163,7 +166,8 @@ void ivtv_udma_unmap(struct ivtv *itv)
|
|||
|
||||
/* Unmap Scatterlist */
|
||||
if (dma->SG_length) {
|
||||
pci_unmap_sg(itv->pdev, dma->SGlist, dma->page_count, PCI_DMA_TODEVICE);
|
||||
dma_unmap_sg(&itv->pdev->dev, dma->SGlist, dma->page_count,
|
||||
DMA_TO_DEVICE);
|
||||
dma->SG_length = 0;
|
||||
}
|
||||
/* sync DMA */
|
||||
|
|
@ -182,13 +186,14 @@ void ivtv_udma_free(struct ivtv *itv)
|
|||
|
||||
/* Unmap SG Array */
|
||||
if (itv->udma.SG_handle) {
|
||||
pci_unmap_single(itv->pdev, itv->udma.SG_handle,
|
||||
sizeof(itv->udma.SGarray), PCI_DMA_TODEVICE);
|
||||
dma_unmap_single(&itv->pdev->dev, itv->udma.SG_handle,
|
||||
sizeof(itv->udma.SGarray), DMA_TO_DEVICE);
|
||||
}
|
||||
|
||||
/* Unmap Scatterlist */
|
||||
if (itv->udma.SG_length) {
|
||||
pci_unmap_sg(itv->pdev, itv->udma.SGlist, itv->udma.page_count, PCI_DMA_TODEVICE);
|
||||
dma_unmap_sg(&itv->pdev->dev, itv->udma.SGlist,
|
||||
itv->udma.page_count, DMA_TO_DEVICE);
|
||||
}
|
||||
|
||||
for (i = 0; i < IVTV_DMA_SG_OSD_ENT; i++) {
|
||||
|
|
|
|||
|
|
@ -118,13 +118,14 @@ static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma,
|
|||
dma->page_count = 0;
|
||||
return -ENOMEM;
|
||||
}
|
||||
dma->SG_length = pci_map_sg(itv->pdev, dma->SGlist, dma->page_count, PCI_DMA_TODEVICE);
|
||||
dma->SG_length = dma_map_sg(&itv->pdev->dev, dma->SGlist,
|
||||
dma->page_count, DMA_TO_DEVICE);
|
||||
|
||||
/* Fill SG Array with new values */
|
||||
ivtv_udma_fill_sg_array(dma, y_buffer_offset, uv_buffer_offset, y_size);
|
||||
|
||||
/* If we've offset the y plane, ensure top area is blanked */
|
||||
if (f->offset_y && yi->blanking_dmaptr) {
|
||||
if (f->offset_y && yi->blanking_ptr) {
|
||||
dma->SGarray[dma->SG_length].size = cpu_to_le32(720*16);
|
||||
dma->SGarray[dma->SG_length].src = cpu_to_le32(yi->blanking_dmaptr);
|
||||
dma->SGarray[dma->SG_length].dst = cpu_to_le32(IVTV_DECODER_OFFSET + yuv_offset[frame]);
|
||||
|
|
@ -925,7 +926,15 @@ static void ivtv_yuv_init(struct ivtv *itv)
|
|||
/* We need a buffer for blanking when Y plane is offset - non-fatal if we can't get one */
|
||||
yi->blanking_ptr = kzalloc(720 * 16, GFP_ATOMIC|__GFP_NOWARN);
|
||||
if (yi->blanking_ptr) {
|
||||
yi->blanking_dmaptr = pci_map_single(itv->pdev, yi->blanking_ptr, 720*16, PCI_DMA_TODEVICE);
|
||||
yi->blanking_dmaptr = dma_map_single(&itv->pdev->dev,
|
||||
yi->blanking_ptr,
|
||||
720 * 16, DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(&itv->pdev->dev, yi->blanking_dmaptr)) {
|
||||
kfree(yi->blanking_ptr);
|
||||
yi->blanking_ptr = NULL;
|
||||
yi->blanking_dmaptr = 0;
|
||||
IVTV_DEBUG_WARN("Failed to dma_map yuv blanking buffer\n");
|
||||
}
|
||||
} else {
|
||||
yi->blanking_dmaptr = 0;
|
||||
IVTV_DEBUG_WARN("Failed to allocate yuv blanking buffer\n");
|
||||
|
|
@ -1269,7 +1278,8 @@ void ivtv_yuv_close(struct ivtv *itv)
|
|||
if (yi->blanking_ptr) {
|
||||
kfree(yi->blanking_ptr);
|
||||
yi->blanking_ptr = NULL;
|
||||
pci_unmap_single(itv->pdev, yi->blanking_dmaptr, 720*16, PCI_DMA_TODEVICE);
|
||||
dma_unmap_single(&itv->pdev->dev, yi->blanking_dmaptr,
|
||||
720 * 16, DMA_TO_DEVICE);
|
||||
}
|
||||
|
||||
/* Invalidate the old dimension information */
|
||||
|
|
|
|||
|
|
@ -14,8 +14,7 @@
|
|||
#include "s5p_mfc_opr.h"
|
||||
#include "s5p_mfc_cmd_v6.h"
|
||||
|
||||
static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd,
|
||||
struct s5p_mfc_cmd_args *args)
|
||||
static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd)
|
||||
{
|
||||
mfc_debug(2, "Issue the command: %d\n", cmd);
|
||||
|
||||
|
|
@ -31,7 +30,6 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd,
|
|||
|
||||
static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev)
|
||||
{
|
||||
struct s5p_mfc_cmd_args h2r_args;
|
||||
struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv;
|
||||
int ret;
|
||||
|
||||
|
|
@ -41,33 +39,23 @@ static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev)
|
|||
|
||||
mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6);
|
||||
mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6);
|
||||
return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6,
|
||||
&h2r_args);
|
||||
return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6);
|
||||
}
|
||||
|
||||
static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev)
|
||||
{
|
||||
struct s5p_mfc_cmd_args h2r_args;
|
||||
|
||||
memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args));
|
||||
return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6,
|
||||
&h2r_args);
|
||||
return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6);
|
||||
}
|
||||
|
||||
static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev)
|
||||
{
|
||||
struct s5p_mfc_cmd_args h2r_args;
|
||||
|
||||
memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args));
|
||||
return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6,
|
||||
&h2r_args);
|
||||
return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6);
|
||||
}
|
||||
|
||||
/* Open a new instance and get its number */
|
||||
static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx)
|
||||
{
|
||||
struct s5p_mfc_dev *dev = ctx->dev;
|
||||
struct s5p_mfc_cmd_args h2r_args;
|
||||
int codec_type;
|
||||
|
||||
mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode);
|
||||
|
|
@ -129,23 +117,20 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx)
|
|||
mfc_write(dev, ctx->ctx.size, S5P_FIMV_CONTEXT_MEM_SIZE_V6);
|
||||
mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */
|
||||
|
||||
return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6,
|
||||
&h2r_args);
|
||||
return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6);
|
||||
}
|
||||
|
||||
/* Close instance */
|
||||
static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx)
|
||||
{
|
||||
struct s5p_mfc_dev *dev = ctx->dev;
|
||||
struct s5p_mfc_cmd_args h2r_args;
|
||||
int ret = 0;
|
||||
|
||||
dev->curr_ctx = ctx->num;
|
||||
if (ctx->state != MFCINST_FREE) {
|
||||
mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6);
|
||||
ret = s5p_mfc_cmd_host2risc_v6(dev,
|
||||
S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6,
|
||||
&h2r_args);
|
||||
S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6);
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
|
@ -153,9 +138,15 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int s5p_mfc_cmd_host2risc_v6_args(struct s5p_mfc_dev *dev, int cmd,
|
||||
struct s5p_mfc_cmd_args *ignored)
|
||||
{
|
||||
return s5p_mfc_cmd_host2risc_v6(dev, cmd);
|
||||
}
|
||||
|
||||
/* Initialize cmd function pointers for MFC v6 */
|
||||
static struct s5p_mfc_hw_cmds s5p_mfc_cmds_v6 = {
|
||||
.cmd_host2risc = s5p_mfc_cmd_host2risc_v6,
|
||||
.cmd_host2risc = s5p_mfc_cmd_host2risc_v6_args,
|
||||
.sys_init_cmd = s5p_mfc_sys_init_cmd_v6,
|
||||
.sleep_cmd = s5p_mfc_sleep_cmd_v6,
|
||||
.wakeup_cmd = s5p_mfc_wakeup_cmd_v6,
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ struct imon_usb_dev_descr {
|
|||
__u16 flags;
|
||||
#define IMON_NO_FLAGS 0
|
||||
#define IMON_NEED_20MS_PKT_DELAY 1
|
||||
#define IMON_SUPPRESS_REPEATED_KEYS 2
|
||||
struct imon_panel_key_table key_table[];
|
||||
};
|
||||
|
||||
|
|
@ -149,8 +150,27 @@ struct imon_context {
|
|||
struct timer_list ttimer; /* touch screen timer */
|
||||
int touch_x; /* x coordinate on touchscreen */
|
||||
int touch_y; /* y coordinate on touchscreen */
|
||||
struct imon_usb_dev_descr *dev_descr; /* device description with key
|
||||
table for front panels */
|
||||
const struct imon_usb_dev_descr *dev_descr;
|
||||
/* device description with key */
|
||||
/* table for front panels */
|
||||
/*
|
||||
* Fields for deferring free_imon_context().
|
||||
*
|
||||
* Since reference to "struct imon_context" is stored into
|
||||
* "struct file"->private_data, we need to remember
|
||||
* how many file descriptors might access this "struct imon_context".
|
||||
*/
|
||||
refcount_t users;
|
||||
/*
|
||||
* Use a flag for telling display_open()/vfd_write()/lcd_write() that
|
||||
* imon_disconnect() was already called.
|
||||
*/
|
||||
bool disconnected;
|
||||
/*
|
||||
* We need to wait for RCU grace period in order to allow
|
||||
* display_open() to safely check ->disconnected and increment ->users.
|
||||
*/
|
||||
struct rcu_head rcu;
|
||||
};
|
||||
|
||||
#define TOUCH_TIMEOUT (HZ/30)
|
||||
|
|
@ -158,18 +178,18 @@ struct imon_context {
|
|||
/* vfd character device file operations */
|
||||
static const struct file_operations vfd_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = &display_open,
|
||||
.write = &vfd_write,
|
||||
.release = &display_close,
|
||||
.open = display_open,
|
||||
.write = vfd_write,
|
||||
.release = display_close,
|
||||
.llseek = noop_llseek,
|
||||
};
|
||||
|
||||
/* lcd character device file operations */
|
||||
static const struct file_operations lcd_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = &display_open,
|
||||
.write = &lcd_write,
|
||||
.release = &display_close,
|
||||
.open = display_open,
|
||||
.write = lcd_write,
|
||||
.release = display_close,
|
||||
.llseek = noop_llseek,
|
||||
};
|
||||
|
||||
|
|
@ -315,6 +335,32 @@ static const struct imon_usb_dev_descr imon_DH102 = {
|
|||
}
|
||||
};
|
||||
|
||||
/* imon ultrabay front panel key table */
|
||||
static const struct imon_usb_dev_descr ultrabay_table = {
|
||||
.flags = IMON_SUPPRESS_REPEATED_KEYS,
|
||||
.key_table = {
|
||||
{ 0x0000000f0000ffeell, KEY_MEDIA }, /* Go */
|
||||
{ 0x000000000100ffeell, KEY_UP },
|
||||
{ 0x000000000001ffeell, KEY_DOWN },
|
||||
{ 0x000000160000ffeell, KEY_ENTER },
|
||||
{ 0x0000001f0000ffeell, KEY_AUDIO }, /* Music */
|
||||
{ 0x000000200000ffeell, KEY_VIDEO }, /* Movie */
|
||||
{ 0x000000210000ffeell, KEY_CAMERA }, /* Photo */
|
||||
{ 0x000000270000ffeell, KEY_DVD }, /* DVD */
|
||||
{ 0x000000230000ffeell, KEY_TV }, /* TV */
|
||||
{ 0x000000050000ffeell, KEY_PREVIOUS }, /* Previous */
|
||||
{ 0x000000070000ffeell, KEY_REWIND },
|
||||
{ 0x000000040000ffeell, KEY_STOP },
|
||||
{ 0x000000020000ffeell, KEY_PLAYPAUSE },
|
||||
{ 0x000000080000ffeell, KEY_FASTFORWARD },
|
||||
{ 0x000000060000ffeell, KEY_NEXT }, /* Next */
|
||||
{ 0x000100000000ffeell, KEY_VOLUMEUP },
|
||||
{ 0x010000000000ffeell, KEY_VOLUMEDOWN },
|
||||
{ 0x000000010000ffeell, KEY_MUTE },
|
||||
{ 0, KEY_RESERVED },
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* USB Device ID for iMON USB Control Boards
|
||||
*
|
||||
|
|
@ -411,9 +457,6 @@ static struct usb_driver imon_driver = {
|
|||
.id_table = imon_usb_id_table,
|
||||
};
|
||||
|
||||
/* to prevent races between open() and disconnect(), probing, etc */
|
||||
static DEFINE_MUTEX(driver_lock);
|
||||
|
||||
/* Module bookkeeping bits */
|
||||
MODULE_AUTHOR(MOD_AUTHOR);
|
||||
MODULE_DESCRIPTION(MOD_DESC);
|
||||
|
|
@ -453,9 +496,11 @@ static void free_imon_context(struct imon_context *ictx)
|
|||
struct device *dev = ictx->dev;
|
||||
|
||||
usb_free_urb(ictx->tx_urb);
|
||||
WARN_ON(ictx->dev_present_intf0);
|
||||
usb_free_urb(ictx->rx_urb_intf0);
|
||||
WARN_ON(ictx->dev_present_intf1);
|
||||
usb_free_urb(ictx->rx_urb_intf1);
|
||||
kfree(ictx);
|
||||
kfree_rcu(ictx, rcu);
|
||||
|
||||
dev_dbg(dev, "%s: iMON context freed\n", __func__);
|
||||
}
|
||||
|
|
@ -471,9 +516,6 @@ static int display_open(struct inode *inode, struct file *file)
|
|||
int subminor;
|
||||
int retval = 0;
|
||||
|
||||
/* prevent races with disconnect */
|
||||
mutex_lock(&driver_lock);
|
||||
|
||||
subminor = iminor(inode);
|
||||
interface = usb_find_interface(&imon_driver, subminor);
|
||||
if (!interface) {
|
||||
|
|
@ -481,17 +523,22 @@ static int display_open(struct inode *inode, struct file *file)
|
|||
retval = -ENODEV;
|
||||
goto exit;
|
||||
}
|
||||
ictx = usb_get_intfdata(interface);
|
||||
|
||||
if (!ictx) {
|
||||
rcu_read_lock();
|
||||
ictx = usb_get_intfdata(interface);
|
||||
if (!ictx || ictx->disconnected || !refcount_inc_not_zero(&ictx->users)) {
|
||||
rcu_read_unlock();
|
||||
pr_err("no context found for minor %d\n", subminor);
|
||||
retval = -ENODEV;
|
||||
goto exit;
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
mutex_lock(&ictx->lock);
|
||||
|
||||
if (!ictx->display_supported) {
|
||||
if (ictx->disconnected) {
|
||||
retval = -ENODEV;
|
||||
} else if (!ictx->display_supported) {
|
||||
pr_err("display not supported by device\n");
|
||||
retval = -ENODEV;
|
||||
} else if (ictx->display_isopen) {
|
||||
|
|
@ -505,8 +552,10 @@ static int display_open(struct inode *inode, struct file *file)
|
|||
|
||||
mutex_unlock(&ictx->lock);
|
||||
|
||||
if (retval && refcount_dec_and_test(&ictx->users))
|
||||
free_imon_context(ictx);
|
||||
|
||||
exit:
|
||||
mutex_unlock(&driver_lock);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -516,16 +565,9 @@ exit:
|
|||
*/
|
||||
static int display_close(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct imon_context *ictx = NULL;
|
||||
struct imon_context *ictx = file->private_data;
|
||||
int retval = 0;
|
||||
|
||||
ictx = file->private_data;
|
||||
|
||||
if (!ictx) {
|
||||
pr_err("no context for device\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
mutex_lock(&ictx->lock);
|
||||
|
||||
if (!ictx->display_supported) {
|
||||
|
|
@ -540,6 +582,8 @@ static int display_close(struct inode *inode, struct file *file)
|
|||
}
|
||||
|
||||
mutex_unlock(&ictx->lock);
|
||||
if (refcount_dec_and_test(&ictx->users))
|
||||
free_imon_context(ictx);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -556,6 +600,11 @@ static int send_packet(struct imon_context *ictx)
|
|||
int retval = 0;
|
||||
struct usb_ctrlrequest *control_req = NULL;
|
||||
|
||||
lockdep_assert_held(&ictx->lock);
|
||||
|
||||
if (ictx->disconnected)
|
||||
return -ENODEV;
|
||||
|
||||
/* Check if we need to use control or interrupt urb */
|
||||
if (!ictx->tx_control) {
|
||||
pipe = usb_sndintpipe(ictx->usbdev_intf0,
|
||||
|
|
@ -908,19 +957,18 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
|
|||
int offset;
|
||||
int seq;
|
||||
int retval = 0;
|
||||
struct imon_context *ictx;
|
||||
struct imon_context *ictx = file->private_data;
|
||||
static const unsigned char vfd_packet6[] = {
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF };
|
||||
|
||||
ictx = file->private_data;
|
||||
if (!ictx) {
|
||||
pr_err_ratelimited("no context for device\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (mutex_lock_interruptible(&ictx->lock))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
if (ictx->disconnected) {
|
||||
retval = -ENODEV;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!ictx->dev_present_intf0) {
|
||||
pr_err_ratelimited("no iMON device present\n");
|
||||
retval = -ENODEV;
|
||||
|
|
@ -993,16 +1041,15 @@ static ssize_t lcd_write(struct file *file, const char __user *buf,
|
|||
size_t n_bytes, loff_t *pos)
|
||||
{
|
||||
int retval = 0;
|
||||
struct imon_context *ictx;
|
||||
|
||||
ictx = file->private_data;
|
||||
if (!ictx) {
|
||||
pr_err_ratelimited("no context for device\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
struct imon_context *ictx = file->private_data;
|
||||
|
||||
mutex_lock(&ictx->lock);
|
||||
|
||||
if (ictx->disconnected) {
|
||||
retval = -ENODEV;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!ictx->display_supported) {
|
||||
pr_err_ratelimited("no iMON display present\n");
|
||||
retval = -ENODEV;
|
||||
|
|
@ -1090,7 +1137,7 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 *rc_proto)
|
|||
int retval;
|
||||
struct imon_context *ictx = rc->priv;
|
||||
struct device *dev = ictx->dev;
|
||||
bool unlock = false;
|
||||
const bool unlock = mutex_trylock(&ictx->lock);
|
||||
unsigned char ir_proto_packet[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 };
|
||||
|
||||
|
|
@ -1117,8 +1164,6 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 *rc_proto)
|
|||
|
||||
memcpy(ictx->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet));
|
||||
|
||||
unlock = mutex_trylock(&ictx->lock);
|
||||
|
||||
retval = send_packet(ictx);
|
||||
if (retval)
|
||||
goto out;
|
||||
|
|
@ -1261,9 +1306,11 @@ static u32 imon_mce_key_lookup(struct imon_context *ictx, u32 scancode)
|
|||
|
||||
static u32 imon_panel_key_lookup(struct imon_context *ictx, u64 code)
|
||||
{
|
||||
int i;
|
||||
const struct imon_panel_key_table *key_table;
|
||||
u32 keycode = KEY_RESERVED;
|
||||
struct imon_panel_key_table *key_table = ictx->dev_descr->key_table;
|
||||
int i;
|
||||
|
||||
key_table = ictx->dev_descr->key_table;
|
||||
|
||||
for (i = 0; key_table[i].hw_code != 0; i++) {
|
||||
if (key_table[i].hw_code == (code | 0xffee)) {
|
||||
|
|
@ -1547,7 +1594,6 @@ static void imon_incoming_packet(struct imon_context *ictx,
|
|||
u32 kc;
|
||||
u64 scancode;
|
||||
int press_type = 0;
|
||||
long msec;
|
||||
ktime_t t;
|
||||
static ktime_t prev_time;
|
||||
u8 ktype;
|
||||
|
|
@ -1649,14 +1695,16 @@ static void imon_incoming_packet(struct imon_context *ictx,
|
|||
spin_lock_irqsave(&ictx->kc_lock, flags);
|
||||
|
||||
t = ktime_get();
|
||||
/* KEY_MUTE repeats from knob need to be suppressed */
|
||||
if (ictx->kc == KEY_MUTE && ictx->kc == ictx->last_keycode) {
|
||||
msec = ktime_ms_delta(t, prev_time);
|
||||
if (msec < ictx->idev->rep[REP_DELAY]) {
|
||||
/* KEY repeats from knob and panel that need to be suppressed */
|
||||
if (ictx->kc == KEY_MUTE ||
|
||||
ictx->dev_descr->flags & IMON_SUPPRESS_REPEATED_KEYS) {
|
||||
if (ictx->kc == ictx->last_keycode &&
|
||||
ktime_ms_delta(t, prev_time) < ictx->idev->rep[REP_DELAY]) {
|
||||
spin_unlock_irqrestore(&ictx->kc_lock, flags);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
prev_time = t;
|
||||
kc = ictx->kc;
|
||||
|
||||
|
|
@ -1844,6 +1892,14 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
|
|||
dev_info(ictx->dev, "0xffdc iMON Inside, iMON IR");
|
||||
ictx->display_supported = false;
|
||||
break;
|
||||
/* Soundgraph iMON UltraBay */
|
||||
case 0x98:
|
||||
dev_info(ictx->dev, "0xffdc iMON UltraBay, LCD + IR");
|
||||
detected_display_type = IMON_DISPLAY_TYPE_LCD;
|
||||
allowed_protos = RC_PROTO_BIT_IMON | RC_PROTO_BIT_RC6_MCE;
|
||||
ictx->dev_descr = &ultrabay_table;
|
||||
break;
|
||||
|
||||
default:
|
||||
dev_info(ictx->dev, "Unknown 0xffdc device, defaulting to VFD and iMON IR");
|
||||
detected_display_type = IMON_DISPLAY_TYPE_VFD;
|
||||
|
|
@ -1975,10 +2031,12 @@ out:
|
|||
|
||||
static struct input_dev *imon_init_idev(struct imon_context *ictx)
|
||||
{
|
||||
struct imon_panel_key_table *key_table = ictx->dev_descr->key_table;
|
||||
const struct imon_panel_key_table *key_table;
|
||||
struct input_dev *idev;
|
||||
int ret, i;
|
||||
|
||||
key_table = ictx->dev_descr->key_table;
|
||||
|
||||
idev = input_allocate_device();
|
||||
if (!idev)
|
||||
goto out;
|
||||
|
|
@ -2361,7 +2419,6 @@ static int imon_probe(struct usb_interface *interface,
|
|||
int ifnum, sysfs_err;
|
||||
int ret = 0;
|
||||
struct imon_context *ictx = NULL;
|
||||
struct imon_context *first_if_ctx = NULL;
|
||||
u16 vendor, product;
|
||||
|
||||
usbdev = usb_get_dev(interface_to_usbdev(interface));
|
||||
|
|
@ -2373,17 +2430,12 @@ static int imon_probe(struct usb_interface *interface,
|
|||
dev_dbg(dev, "%s: found iMON device (%04x:%04x, intf%d)\n",
|
||||
__func__, vendor, product, ifnum);
|
||||
|
||||
/* prevent races probing devices w/multiple interfaces */
|
||||
mutex_lock(&driver_lock);
|
||||
|
||||
first_if = usb_ifnum_to_if(usbdev, 0);
|
||||
if (!first_if) {
|
||||
ret = -ENODEV;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
first_if_ctx = usb_get_intfdata(first_if);
|
||||
|
||||
if (ifnum == 0) {
|
||||
ictx = imon_init_intf0(interface, id);
|
||||
if (!ictx) {
|
||||
|
|
@ -2391,9 +2443,11 @@ static int imon_probe(struct usb_interface *interface,
|
|||
ret = -ENODEV;
|
||||
goto fail;
|
||||
}
|
||||
refcount_set(&ictx->users, 1);
|
||||
|
||||
} else {
|
||||
/* this is the secondary interface on the device */
|
||||
struct imon_context *first_if_ctx = usb_get_intfdata(first_if);
|
||||
|
||||
/* fail early if first intf failed to register */
|
||||
if (!first_if_ctx) {
|
||||
|
|
@ -2407,14 +2461,13 @@ static int imon_probe(struct usb_interface *interface,
|
|||
ret = -ENODEV;
|
||||
goto fail;
|
||||
}
|
||||
refcount_inc(&ictx->users);
|
||||
|
||||
}
|
||||
|
||||
usb_set_intfdata(interface, ictx);
|
||||
|
||||
if (ifnum == 0) {
|
||||
mutex_lock(&ictx->lock);
|
||||
|
||||
if (product == 0xffdc && ictx->rf_device) {
|
||||
sysfs_err = sysfs_create_group(&interface->dev.kobj,
|
||||
&imon_rf_attr_group);
|
||||
|
|
@ -2425,21 +2478,17 @@ static int imon_probe(struct usb_interface *interface,
|
|||
|
||||
if (ictx->display_supported)
|
||||
imon_init_display(ictx, interface);
|
||||
|
||||
mutex_unlock(&ictx->lock);
|
||||
}
|
||||
|
||||
dev_info(dev, "iMON device (%04x:%04x, intf%d) on usb<%d:%d> initialized\n",
|
||||
vendor, product, ifnum,
|
||||
usbdev->bus->busnum, usbdev->devnum);
|
||||
|
||||
mutex_unlock(&driver_lock);
|
||||
usb_put_dev(usbdev);
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
mutex_unlock(&driver_lock);
|
||||
usb_put_dev(usbdev);
|
||||
dev_err(dev, "unable to register, err %d\n", ret);
|
||||
|
||||
|
|
@ -2455,10 +2504,12 @@ static void imon_disconnect(struct usb_interface *interface)
|
|||
struct device *dev;
|
||||
int ifnum;
|
||||
|
||||
/* prevent races with multi-interface device probing and display_open */
|
||||
mutex_lock(&driver_lock);
|
||||
|
||||
ictx = usb_get_intfdata(interface);
|
||||
|
||||
mutex_lock(&ictx->lock);
|
||||
ictx->disconnected = true;
|
||||
mutex_unlock(&ictx->lock);
|
||||
|
||||
dev = ictx->dev;
|
||||
ifnum = interface->cur_altsetting->desc.bInterfaceNumber;
|
||||
|
||||
|
|
@ -2499,11 +2550,9 @@ static void imon_disconnect(struct usb_interface *interface)
|
|||
}
|
||||
}
|
||||
|
||||
if (!ictx->dev_present_intf0 && !ictx->dev_present_intf1)
|
||||
if (refcount_dec_and_test(&ictx->users))
|
||||
free_imon_context(ictx);
|
||||
|
||||
mutex_unlock(&driver_lock);
|
||||
|
||||
dev_dbg(dev, "%s: iMON device (intf%d) disconnected\n",
|
||||
__func__, ifnum);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -746,7 +746,7 @@ int ir_lirc_register(struct rc_dev *dev)
|
|||
const char *rx_type, *tx_type;
|
||||
int err, minor;
|
||||
|
||||
minor = ida_simple_get(&lirc_ida, 0, RC_DEV_MAX, GFP_KERNEL);
|
||||
minor = ida_alloc_max(&lirc_ida, RC_DEV_MAX - 1, GFP_KERNEL);
|
||||
if (minor < 0)
|
||||
return minor;
|
||||
|
||||
|
|
@ -762,11 +762,11 @@ int ir_lirc_register(struct rc_dev *dev)
|
|||
|
||||
cdev_init(&dev->lirc_cdev, &lirc_fops);
|
||||
|
||||
get_device(&dev->dev);
|
||||
|
||||
err = cdev_device_add(&dev->lirc_cdev, &dev->lirc_dev);
|
||||
if (err)
|
||||
goto out_ida;
|
||||
|
||||
get_device(&dev->dev);
|
||||
goto out_put_device;
|
||||
|
||||
switch (dev->driver_type) {
|
||||
case RC_DRIVER_SCANCODE:
|
||||
|
|
@ -790,8 +790,9 @@ int ir_lirc_register(struct rc_dev *dev)
|
|||
|
||||
return 0;
|
||||
|
||||
out_ida:
|
||||
ida_simple_remove(&lirc_ida, minor);
|
||||
out_put_device:
|
||||
put_device(&dev->lirc_dev);
|
||||
ida_free(&lirc_ida, minor);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -809,7 +810,7 @@ void ir_lirc_unregister(struct rc_dev *dev)
|
|||
spin_unlock_irqrestore(&dev->lirc_fh_lock, flags);
|
||||
|
||||
cdev_device_del(&dev->lirc_cdev, &dev->lirc_dev);
|
||||
ida_simple_remove(&lirc_ida, MINOR(dev->lirc_dev.devt));
|
||||
ida_free(&lirc_ida, MINOR(dev->lirc_dev.devt));
|
||||
}
|
||||
|
||||
int __init lirc_dev_init(void)
|
||||
|
|
|
|||
|
|
@ -1861,7 +1861,7 @@ int rc_register_device(struct rc_dev *dev)
|
|||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
||||
minor = ida_simple_get(&rc_ida, 0, RC_DEV_MAX, GFP_KERNEL);
|
||||
minor = ida_alloc_max(&rc_ida, RC_DEV_MAX - 1, GFP_KERNEL);
|
||||
if (minor < 0)
|
||||
return minor;
|
||||
|
||||
|
|
@ -1944,7 +1944,7 @@ out_rx_free:
|
|||
out_raw:
|
||||
ir_raw_event_free(dev);
|
||||
out_minor:
|
||||
ida_simple_remove(&rc_ida, minor);
|
||||
ida_free(&rc_ida, minor);
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rc_register_device);
|
||||
|
|
@ -2004,7 +2004,7 @@ void rc_unregister_device(struct rc_dev *dev)
|
|||
|
||||
device_del(&dev->dev);
|
||||
|
||||
ida_simple_remove(&rc_ida, dev->minor);
|
||||
ida_free(&rc_ida, dev->minor);
|
||||
|
||||
if (!dev->managed_alloc)
|
||||
rc_free_device(dev);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ struct xc5000_priv {
|
|||
struct dvb_frontend *fe;
|
||||
struct delayed_work timer_sleep;
|
||||
|
||||
const struct firmware *firmware;
|
||||
bool inited;
|
||||
};
|
||||
|
||||
/* Misc Defines */
|
||||
|
|
@ -1110,23 +1110,19 @@ static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe, int force)
|
|||
if (!force && xc5000_is_firmware_loaded(fe) == 0)
|
||||
return 0;
|
||||
|
||||
if (!priv->firmware) {
|
||||
ret = request_firmware(&fw, desired_fw->name,
|
||||
priv->i2c_props.adap->dev.parent);
|
||||
if (ret) {
|
||||
pr_err("xc5000: Upload failed. rc %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
dprintk(1, "firmware read %zu bytes.\n", fw->size);
|
||||
ret = request_firmware(&fw, desired_fw->name,
|
||||
priv->i2c_props.adap->dev.parent);
|
||||
if (ret) {
|
||||
pr_err("xc5000: Upload failed. rc %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
dprintk(1, "firmware read %zu bytes.\n", fw->size);
|
||||
|
||||
if (fw->size != desired_fw->size) {
|
||||
pr_err("xc5000: Firmware file with incorrect size\n");
|
||||
release_firmware(fw);
|
||||
return -EINVAL;
|
||||
}
|
||||
priv->firmware = fw;
|
||||
} else
|
||||
fw = priv->firmware;
|
||||
if (fw->size != desired_fw->size) {
|
||||
pr_err("xc5000: Firmware file with incorrect size\n");
|
||||
release_firmware(fw);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Try up to 5 times to load firmware */
|
||||
for (i = 0; i < 5; i++) {
|
||||
|
|
@ -1204,6 +1200,7 @@ static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe, int force)
|
|||
}
|
||||
|
||||
err:
|
||||
release_firmware(fw);
|
||||
if (!ret)
|
||||
printk(KERN_INFO "xc5000: Firmware %s loaded and running.\n",
|
||||
desired_fw->name);
|
||||
|
|
@ -1274,7 +1271,7 @@ static int xc5000_resume(struct dvb_frontend *fe)
|
|||
|
||||
/* suspended before firmware is loaded.
|
||||
Avoid firmware load in resume path. */
|
||||
if (!priv->firmware)
|
||||
if (!priv->inited)
|
||||
return 0;
|
||||
|
||||
return xc5000_set_params(fe);
|
||||
|
|
@ -1293,6 +1290,8 @@ static int xc5000_init(struct dvb_frontend *fe)
|
|||
if (debug)
|
||||
xc_debug_dump(priv);
|
||||
|
||||
priv->inited = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1305,11 +1304,7 @@ static void xc5000_release(struct dvb_frontend *fe)
|
|||
mutex_lock(&xc5000_list_mutex);
|
||||
|
||||
if (priv) {
|
||||
cancel_delayed_work(&priv->timer_sleep);
|
||||
if (priv->firmware) {
|
||||
release_firmware(priv->firmware);
|
||||
priv->firmware = NULL;
|
||||
}
|
||||
cancel_delayed_work_sync(&priv->timer_sleep);
|
||||
hybrid_tuner_release_state(priv);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ struct exynos_srom {
|
|||
struct exynos_srom_reg_dump *reg_offset;
|
||||
};
|
||||
|
||||
static struct exynos_srom_reg_dump *exynos_srom_alloc_reg_dump(
|
||||
const unsigned long *rdump,
|
||||
unsigned long nr_rdump)
|
||||
static struct exynos_srom_reg_dump *
|
||||
exynos_srom_alloc_reg_dump(const unsigned long *rdump,
|
||||
unsigned long nr_rdump)
|
||||
{
|
||||
struct exynos_srom_reg_dump *rd;
|
||||
unsigned int i;
|
||||
|
|
@ -116,25 +116,23 @@ static int exynos_srom_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
srom = devm_kzalloc(&pdev->dev,
|
||||
sizeof(struct exynos_srom), GFP_KERNEL);
|
||||
sizeof(struct exynos_srom), GFP_KERNEL);
|
||||
if (!srom)
|
||||
return -ENOMEM;
|
||||
|
||||
srom->dev = dev;
|
||||
srom->reg_base = of_iomap(np, 0);
|
||||
if (!srom->reg_base) {
|
||||
srom->reg_base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(srom->reg_base)) {
|
||||
dev_err(&pdev->dev, "iomap of exynos srom controller failed\n");
|
||||
return -ENOMEM;
|
||||
return PTR_ERR(srom->reg_base);
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, srom);
|
||||
|
||||
srom->reg_offset = exynos_srom_alloc_reg_dump(exynos_srom_offsets,
|
||||
ARRAY_SIZE(exynos_srom_offsets));
|
||||
if (!srom->reg_offset) {
|
||||
iounmap(srom->reg_base);
|
||||
ARRAY_SIZE(exynos_srom_offsets));
|
||||
if (!srom->reg_offset)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
for_each_child_of_node(np, child) {
|
||||
if (exynos_srom_configure_bank(srom, child)) {
|
||||
|
|
@ -157,16 +155,16 @@ static int exynos_srom_probe(struct platform_device *pdev)
|
|||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static void exynos_srom_save(void __iomem *base,
|
||||
struct exynos_srom_reg_dump *rd,
|
||||
unsigned int num_regs)
|
||||
struct exynos_srom_reg_dump *rd,
|
||||
unsigned int num_regs)
|
||||
{
|
||||
for (; num_regs > 0; --num_regs, ++rd)
|
||||
rd->value = readl(base + rd->offset);
|
||||
}
|
||||
|
||||
static void exynos_srom_restore(void __iomem *base,
|
||||
const struct exynos_srom_reg_dump *rd,
|
||||
unsigned int num_regs)
|
||||
const struct exynos_srom_reg_dump *rd,
|
||||
unsigned int num_regs)
|
||||
{
|
||||
for (; num_regs > 0; --num_regs, ++rd)
|
||||
writel(rd->value, base + rd->offset);
|
||||
|
|
@ -177,7 +175,7 @@ static int exynos_srom_suspend(struct device *dev)
|
|||
struct exynos_srom *srom = dev_get_drvdata(dev);
|
||||
|
||||
exynos_srom_save(srom->reg_base, srom->reg_offset,
|
||||
ARRAY_SIZE(exynos_srom_offsets));
|
||||
ARRAY_SIZE(exynos_srom_offsets));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -186,7 +184,7 @@ static int exynos_srom_resume(struct device *dev)
|
|||
struct exynos_srom *srom = dev_get_drvdata(dev);
|
||||
|
||||
exynos_srom_restore(srom->reg_base, srom->reg_offset,
|
||||
ARRAY_SIZE(exynos_srom_offsets));
|
||||
ARRAY_SIZE(exynos_srom_offsets));
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -81,8 +81,9 @@ static struct mfd_cell chtdc_ti_dev[] = {
|
|||
static const struct regmap_config chtdc_ti_regmap_config = {
|
||||
.reg_bits = 8,
|
||||
.val_bits = 8,
|
||||
.max_register = 128,
|
||||
.cache_type = REGCACHE_NONE,
|
||||
.max_register = 0xff,
|
||||
/* The hardware does not support reading multiple registers at once */
|
||||
.use_single_read = true,
|
||||
};
|
||||
|
||||
static const struct regmap_irq chtdc_ti_irqs[] = {
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
|
|||
struct gpio_chip *mmc_gpio_chip;
|
||||
int master;
|
||||
u32 dt_hbi;
|
||||
int ret;
|
||||
|
||||
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!mem)
|
||||
|
|
@ -195,7 +196,10 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
|
|||
bgpio_init(mmc_gpio_chip, &pdev->dev, 0x4, base + SYS_MCI,
|
||||
NULL, NULL, NULL, NULL, 0);
|
||||
mmc_gpio_chip->ngpio = 2;
|
||||
gpiochip_add_data(mmc_gpio_chip, NULL);
|
||||
|
||||
ret = gpiochip_add_data(mmc_gpio_chip, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
|
||||
vexpress_sysreg_cells,
|
||||
|
|
|
|||
|
|
@ -918,7 +918,7 @@ int __genwqe_execute_raw_ddcb(struct genwqe_dev *cd,
|
|||
}
|
||||
if (cmd->asv_length > DDCB_ASV_LENGTH) {
|
||||
dev_err(&pci_dev->dev, "[%s] err: wrong asv_length of %d\n",
|
||||
__func__, cmd->asiv_length);
|
||||
__func__, cmd->asv_length);
|
||||
return -EINVAL;
|
||||
}
|
||||
rc = __genwqe_enqueue_ddcb(cd, req, f_flags);
|
||||
|
|
|
|||
|
|
@ -868,7 +868,11 @@ static void mmc_sdio_remove(struct mmc_host *host)
|
|||
*/
|
||||
static int mmc_sdio_alive(struct mmc_host *host)
|
||||
{
|
||||
return mmc_select_card(host->card);
|
||||
if (!mmc_host_is_spi(host))
|
||||
return mmc_select_card(host->card);
|
||||
else
|
||||
return mmc_io_rw_direct(host->card, 0, 0, SDIO_CCCR_CCCR, 0,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -861,10 +861,14 @@ static int fsmc_nand_probe_config_dt(struct platform_device *pdev,
|
|||
if (!of_property_read_u32(np, "bank-width", &val)) {
|
||||
if (val == 2) {
|
||||
nand->options |= NAND_BUSWIDTH_16;
|
||||
} else if (val != 1) {
|
||||
} else if (val == 1) {
|
||||
nand->options |= NAND_BUSWIDTH_AUTO;
|
||||
} else {
|
||||
dev_err(&pdev->dev, "invalid bank-width %u\n", val);
|
||||
return -EINVAL;
|
||||
}
|
||||
} else {
|
||||
nand->options |= NAND_BUSWIDTH_AUTO;
|
||||
}
|
||||
|
||||
if (of_get_property(np, "nand-skip-bbtscan", NULL))
|
||||
|
|
|
|||
|
|
@ -496,6 +496,7 @@ static int cqspi_read_setup(struct spi_nor *nor)
|
|||
reg &= ~CQSPI_REG_SIZE_ADDRESS_MASK;
|
||||
reg |= (nor->addr_width - 1);
|
||||
writel(reg, reg_base + CQSPI_REG_SIZE);
|
||||
readl(reg_base + CQSPI_REG_SIZE); /* Flush posted write. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -523,6 +524,7 @@ static int cqspi_indirect_read_execute(struct spi_nor *nor, u8 *rxbuf,
|
|||
reinit_completion(&cqspi->transfer_complete);
|
||||
writel(CQSPI_REG_INDIRECTRD_START_MASK,
|
||||
reg_base + CQSPI_REG_INDIRECTRD);
|
||||
readl(reg_base + CQSPI_REG_INDIRECTRD); /* Flush posted write. */
|
||||
|
||||
while (remaining > 0) {
|
||||
if (!wait_for_completion_timeout(&cqspi->transfer_complete,
|
||||
|
|
@ -608,6 +610,7 @@ static int cqspi_write_setup(struct spi_nor *nor)
|
|||
reg &= ~CQSPI_REG_SIZE_ADDRESS_MASK;
|
||||
reg |= (nor->addr_width - 1);
|
||||
writel(reg, reg_base + CQSPI_REG_SIZE);
|
||||
readl(reg_base + CQSPI_REG_SIZE); /* Flush posted write. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -633,6 +636,8 @@ static int cqspi_indirect_write_execute(struct spi_nor *nor, loff_t to_addr,
|
|||
reinit_completion(&cqspi->transfer_complete);
|
||||
writel(CQSPI_REG_INDIRECTWR_START_MASK,
|
||||
reg_base + CQSPI_REG_INDIRECTWR);
|
||||
readl(reg_base + CQSPI_REG_INDIRECTWR); /* Flush posted write. */
|
||||
|
||||
/*
|
||||
* As per 66AK2G02 TRM SPRUHY8F section 11.15.5.3 Indirect Access
|
||||
* Controller programming sequence, couple of cycles of
|
||||
|
|
|
|||
|
|
@ -2331,7 +2331,7 @@ static void bond_mii_monitor(struct work_struct *work)
|
|||
{
|
||||
struct bonding *bond = container_of(work, struct bonding,
|
||||
mii_work.work);
|
||||
bool should_notify_peers = false;
|
||||
bool should_notify_peers;
|
||||
bool commit;
|
||||
unsigned long delay;
|
||||
struct slave *slave;
|
||||
|
|
@ -2343,30 +2343,33 @@ static void bond_mii_monitor(struct work_struct *work)
|
|||
goto re_arm;
|
||||
|
||||
rcu_read_lock();
|
||||
|
||||
should_notify_peers = bond_should_notify_peers(bond);
|
||||
commit = !!bond_miimon_inspect(bond);
|
||||
if (bond->send_peer_notif) {
|
||||
rcu_read_unlock();
|
||||
if (rtnl_trylock()) {
|
||||
bond->send_peer_notif--;
|
||||
rtnl_unlock();
|
||||
}
|
||||
} else {
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
if (commit) {
|
||||
rcu_read_unlock();
|
||||
|
||||
if (commit || bond->send_peer_notif) {
|
||||
/* Race avoidance with bond_close cancel of workqueue */
|
||||
if (!rtnl_trylock()) {
|
||||
delay = 1;
|
||||
should_notify_peers = false;
|
||||
goto re_arm;
|
||||
}
|
||||
|
||||
bond_for_each_slave(bond, slave, iter) {
|
||||
bond_commit_link_state(slave, BOND_SLAVE_NOTIFY_LATER);
|
||||
if (commit) {
|
||||
bond_for_each_slave(bond, slave, iter) {
|
||||
bond_commit_link_state(slave,
|
||||
BOND_SLAVE_NOTIFY_LATER);
|
||||
}
|
||||
bond_miimon_commit(bond);
|
||||
}
|
||||
|
||||
if (bond->send_peer_notif) {
|
||||
bond->send_peer_notif--;
|
||||
if (should_notify_peers)
|
||||
call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
|
||||
bond->dev);
|
||||
}
|
||||
bond_miimon_commit(bond);
|
||||
|
||||
rtnl_unlock(); /* might sleep, hold no other locks */
|
||||
}
|
||||
|
|
@ -2374,13 +2377,6 @@ static void bond_mii_monitor(struct work_struct *work)
|
|||
re_arm:
|
||||
if (bond->params.miimon)
|
||||
queue_delayed_work(bond->wq, &bond->mii_work, delay);
|
||||
|
||||
if (should_notify_peers) {
|
||||
if (!rtnl_trylock())
|
||||
return;
|
||||
call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, bond->dev);
|
||||
rtnl_unlock();
|
||||
}
|
||||
}
|
||||
|
||||
static int bond_upper_dev_walk(struct net_device *upper, void *data)
|
||||
|
|
|
|||
|
|
@ -633,7 +633,10 @@ static u32 ena_get_rxfh_indir_size(struct net_device *netdev)
|
|||
|
||||
static u32 ena_get_rxfh_key_size(struct net_device *netdev)
|
||||
{
|
||||
return ENA_HASH_KEY_SIZE;
|
||||
struct ena_adapter *adapter = netdev_priv(netdev);
|
||||
struct ena_rss *rss = &adapter->ena_dev->rss;
|
||||
|
||||
return rss->hash_key ? ENA_HASH_KEY_SIZE : 0;
|
||||
}
|
||||
|
||||
static int ena_indirection_table_get(struct ena_adapter *adapter, u32 *indir)
|
||||
|
|
|
|||
|
|
@ -1247,7 +1247,6 @@ static void xgbe_free_rx_data(struct xgbe_prv_data *pdata)
|
|||
|
||||
static int xgbe_phy_reset(struct xgbe_prv_data *pdata)
|
||||
{
|
||||
pdata->phy_link = -1;
|
||||
pdata->phy_speed = SPEED_UNKNOWN;
|
||||
|
||||
return pdata->phy_if.phy_reset(pdata);
|
||||
|
|
|
|||
|
|
@ -1637,6 +1637,7 @@ static int xgbe_phy_init(struct xgbe_prv_data *pdata)
|
|||
pdata->phy.duplex = DUPLEX_FULL;
|
||||
}
|
||||
|
||||
pdata->phy_link = 0;
|
||||
pdata->phy.link = 0;
|
||||
|
||||
pdata->phy.pause_autoneg = pdata->pause_autoneg;
|
||||
|
|
|
|||
|
|
@ -5827,7 +5827,7 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, bool force_reset)
|
|||
u32 current_speed = SPEED_UNKNOWN;
|
||||
u8 current_duplex = DUPLEX_UNKNOWN;
|
||||
bool current_link_up = false;
|
||||
u32 local_adv, remote_adv, sgsr;
|
||||
u32 local_adv = 0, remote_adv = 0, sgsr;
|
||||
|
||||
if ((tg3_asic_rev(tp) == ASIC_REV_5719 ||
|
||||
tg3_asic_rev(tp) == ASIC_REV_5720) &&
|
||||
|
|
@ -5968,9 +5968,6 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, bool force_reset)
|
|||
else
|
||||
current_duplex = DUPLEX_HALF;
|
||||
|
||||
local_adv = 0;
|
||||
remote_adv = 0;
|
||||
|
||||
if (bmcr & BMCR_ANENABLE) {
|
||||
u32 common;
|
||||
|
||||
|
|
|
|||
|
|
@ -233,13 +233,15 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
|
||||
pci_set_drvdata (pdev, dev);
|
||||
|
||||
ring_space = pci_alloc_consistent (pdev, TX_TOTAL_SIZE, &ring_dma);
|
||||
ring_space = dma_alloc_coherent(&pdev->dev, TX_TOTAL_SIZE, &ring_dma,
|
||||
GFP_KERNEL);
|
||||
if (!ring_space)
|
||||
goto err_out_iounmap;
|
||||
np->tx_ring = ring_space;
|
||||
np->tx_ring_dma = ring_dma;
|
||||
|
||||
ring_space = pci_alloc_consistent (pdev, RX_TOTAL_SIZE, &ring_dma);
|
||||
ring_space = dma_alloc_coherent(&pdev->dev, RX_TOTAL_SIZE, &ring_dma,
|
||||
GFP_KERNEL);
|
||||
if (!ring_space)
|
||||
goto err_out_unmap_tx;
|
||||
np->rx_ring = ring_space;
|
||||
|
|
@ -290,9 +292,11 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
return 0;
|
||||
|
||||
err_out_unmap_rx:
|
||||
pci_free_consistent (pdev, RX_TOTAL_SIZE, np->rx_ring, np->rx_ring_dma);
|
||||
dma_free_coherent(&pdev->dev, RX_TOTAL_SIZE, np->rx_ring,
|
||||
np->rx_ring_dma);
|
||||
err_out_unmap_tx:
|
||||
pci_free_consistent (pdev, TX_TOTAL_SIZE, np->tx_ring, np->tx_ring_dma);
|
||||
dma_free_coherent(&pdev->dev, TX_TOTAL_SIZE, np->tx_ring,
|
||||
np->tx_ring_dma);
|
||||
err_out_iounmap:
|
||||
#ifdef MEM_MAPPING
|
||||
pci_iounmap(pdev, np->ioaddr);
|
||||
|
|
@ -446,8 +450,9 @@ static void free_list(struct net_device *dev)
|
|||
for (i = 0; i < RX_RING_SIZE; i++) {
|
||||
skb = np->rx_skbuff[i];
|
||||
if (skb) {
|
||||
pci_unmap_single(np->pdev, desc_to_dma(&np->rx_ring[i]),
|
||||
skb->len, PCI_DMA_FROMDEVICE);
|
||||
dma_unmap_single(&np->pdev->dev,
|
||||
desc_to_dma(&np->rx_ring[i]),
|
||||
skb->len, DMA_FROM_DEVICE);
|
||||
dev_kfree_skb(skb);
|
||||
np->rx_skbuff[i] = NULL;
|
||||
}
|
||||
|
|
@ -457,8 +462,9 @@ static void free_list(struct net_device *dev)
|
|||
for (i = 0; i < TX_RING_SIZE; i++) {
|
||||
skb = np->tx_skbuff[i];
|
||||
if (skb) {
|
||||
pci_unmap_single(np->pdev, desc_to_dma(&np->tx_ring[i]),
|
||||
skb->len, PCI_DMA_TODEVICE);
|
||||
dma_unmap_single(&np->pdev->dev,
|
||||
desc_to_dma(&np->tx_ring[i]),
|
||||
skb->len, DMA_TO_DEVICE);
|
||||
dev_kfree_skb(skb);
|
||||
np->tx_skbuff[i] = NULL;
|
||||
}
|
||||
|
|
@ -502,26 +508,34 @@ static int alloc_list(struct net_device *dev)
|
|||
for (i = 0; i < RX_RING_SIZE; i++) {
|
||||
/* Allocated fixed size of skbuff */
|
||||
struct sk_buff *skb;
|
||||
dma_addr_t addr;
|
||||
|
||||
skb = netdev_alloc_skb_ip_align(dev, np->rx_buf_sz);
|
||||
np->rx_skbuff[i] = skb;
|
||||
if (!skb) {
|
||||
free_list(dev);
|
||||
return -ENOMEM;
|
||||
}
|
||||
if (!skb)
|
||||
goto err_free_list;
|
||||
|
||||
addr = dma_map_single(&np->pdev->dev, skb->data,
|
||||
np->rx_buf_sz, DMA_FROM_DEVICE);
|
||||
if (dma_mapping_error(&np->pdev->dev, addr))
|
||||
goto err_kfree_skb;
|
||||
|
||||
np->rx_ring[i].next_desc = cpu_to_le64(np->rx_ring_dma +
|
||||
((i + 1) % RX_RING_SIZE) *
|
||||
sizeof(struct netdev_desc));
|
||||
/* Rubicon now supports 40 bits of addressing space. */
|
||||
np->rx_ring[i].fraginfo =
|
||||
cpu_to_le64(pci_map_single(
|
||||
np->pdev, skb->data, np->rx_buf_sz,
|
||||
PCI_DMA_FROMDEVICE));
|
||||
np->rx_ring[i].fraginfo = cpu_to_le64(addr);
|
||||
np->rx_ring[i].fraginfo |= cpu_to_le64((u64)np->rx_buf_sz << 48);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_kfree_skb:
|
||||
dev_kfree_skb(np->rx_skbuff[i]);
|
||||
np->rx_skbuff[i] = NULL;
|
||||
err_free_list:
|
||||
free_list(dev);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static void rio_hw_init(struct net_device *dev)
|
||||
|
|
@ -683,9 +697,8 @@ rio_timer (struct timer_list *t)
|
|||
}
|
||||
np->rx_skbuff[entry] = skb;
|
||||
np->rx_ring[entry].fraginfo =
|
||||
cpu_to_le64 (pci_map_single
|
||||
(np->pdev, skb->data, np->rx_buf_sz,
|
||||
PCI_DMA_FROMDEVICE));
|
||||
cpu_to_le64 (dma_map_single(&np->pdev->dev, skb->data,
|
||||
np->rx_buf_sz, DMA_FROM_DEVICE));
|
||||
}
|
||||
np->rx_ring[entry].fraginfo |=
|
||||
cpu_to_le64((u64)np->rx_buf_sz << 48);
|
||||
|
|
@ -739,9 +752,8 @@ start_xmit (struct sk_buff *skb, struct net_device *dev)
|
|||
((u64)np->vlan << 32) |
|
||||
((u64)skb->priority << 45);
|
||||
}
|
||||
txdesc->fraginfo = cpu_to_le64 (pci_map_single (np->pdev, skb->data,
|
||||
skb->len,
|
||||
PCI_DMA_TODEVICE));
|
||||
txdesc->fraginfo = cpu_to_le64 (dma_map_single(&np->pdev->dev, skb->data,
|
||||
skb->len, DMA_TO_DEVICE));
|
||||
txdesc->fraginfo |= cpu_to_le64((u64)skb->len << 48);
|
||||
|
||||
/* DL2K bug: DMA fails to get next descriptor ptr in 10Mbps mode
|
||||
|
|
@ -838,9 +850,9 @@ rio_free_tx (struct net_device *dev, int irq)
|
|||
if (!(np->tx_ring[entry].status & cpu_to_le64(TFDDone)))
|
||||
break;
|
||||
skb = np->tx_skbuff[entry];
|
||||
pci_unmap_single (np->pdev,
|
||||
desc_to_dma(&np->tx_ring[entry]),
|
||||
skb->len, PCI_DMA_TODEVICE);
|
||||
dma_unmap_single(&np->pdev->dev,
|
||||
desc_to_dma(&np->tx_ring[entry]), skb->len,
|
||||
DMA_TO_DEVICE);
|
||||
if (irq)
|
||||
dev_consume_skb_irq(skb);
|
||||
else
|
||||
|
|
@ -965,25 +977,25 @@ receive_packet (struct net_device *dev)
|
|||
|
||||
/* Small skbuffs for short packets */
|
||||
if (pkt_len > copy_thresh) {
|
||||
pci_unmap_single (np->pdev,
|
||||
desc_to_dma(desc),
|
||||
np->rx_buf_sz,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
dma_unmap_single(&np->pdev->dev,
|
||||
desc_to_dma(desc),
|
||||
np->rx_buf_sz,
|
||||
DMA_FROM_DEVICE);
|
||||
skb_put (skb = np->rx_skbuff[entry], pkt_len);
|
||||
np->rx_skbuff[entry] = NULL;
|
||||
} else if ((skb = netdev_alloc_skb_ip_align(dev, pkt_len))) {
|
||||
pci_dma_sync_single_for_cpu(np->pdev,
|
||||
desc_to_dma(desc),
|
||||
np->rx_buf_sz,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
dma_sync_single_for_cpu(&np->pdev->dev,
|
||||
desc_to_dma(desc),
|
||||
np->rx_buf_sz,
|
||||
DMA_FROM_DEVICE);
|
||||
skb_copy_to_linear_data (skb,
|
||||
np->rx_skbuff[entry]->data,
|
||||
pkt_len);
|
||||
skb_put (skb, pkt_len);
|
||||
pci_dma_sync_single_for_device(np->pdev,
|
||||
desc_to_dma(desc),
|
||||
np->rx_buf_sz,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
dma_sync_single_for_device(&np->pdev->dev,
|
||||
desc_to_dma(desc),
|
||||
np->rx_buf_sz,
|
||||
DMA_FROM_DEVICE);
|
||||
}
|
||||
skb->protocol = eth_type_trans (skb, dev);
|
||||
#if 0
|
||||
|
|
@ -1016,9 +1028,8 @@ receive_packet (struct net_device *dev)
|
|||
}
|
||||
np->rx_skbuff[entry] = skb;
|
||||
np->rx_ring[entry].fraginfo =
|
||||
cpu_to_le64 (pci_map_single
|
||||
(np->pdev, skb->data, np->rx_buf_sz,
|
||||
PCI_DMA_FROMDEVICE));
|
||||
cpu_to_le64(dma_map_single(&np->pdev->dev, skb->data,
|
||||
np->rx_buf_sz, DMA_FROM_DEVICE));
|
||||
}
|
||||
np->rx_ring[entry].fraginfo |=
|
||||
cpu_to_le64((u64)np->rx_buf_sz << 48);
|
||||
|
|
@ -1818,10 +1829,10 @@ rio_remove1 (struct pci_dev *pdev)
|
|||
struct netdev_private *np = netdev_priv(dev);
|
||||
|
||||
unregister_netdev (dev);
|
||||
pci_free_consistent (pdev, RX_TOTAL_SIZE, np->rx_ring,
|
||||
np->rx_ring_dma);
|
||||
pci_free_consistent (pdev, TX_TOTAL_SIZE, np->tx_ring,
|
||||
np->tx_ring_dma);
|
||||
dma_free_coherent(&pdev->dev, RX_TOTAL_SIZE, np->rx_ring,
|
||||
np->rx_ring_dma);
|
||||
dma_free_coherent(&pdev->dev, TX_TOTAL_SIZE, np->tx_ring,
|
||||
np->tx_ring_dma);
|
||||
#ifdef MEM_MAPPING
|
||||
pci_iounmap(pdev, np->ioaddr);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ struct enetc_tx_swbd {
|
|||
};
|
||||
|
||||
#define ENETC_RX_MAXFRM_SIZE ENETC_MAC_MAXFRM_SIZE
|
||||
#define ENETC_RXB_TRUESIZE 2048 /* PAGE_SIZE >> 1 */
|
||||
#define ENETC_RXB_TRUESIZE (PAGE_SIZE >> 1)
|
||||
#define ENETC_RXB_PAD NET_SKB_PAD /* add extra space if needed */
|
||||
#define ENETC_RXB_DMA_SIZE \
|
||||
(SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - ENETC_RXB_PAD)
|
||||
|
|
|
|||
|
|
@ -482,10 +482,12 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev)
|
|||
"missing 'reg' property in node %pOF\n",
|
||||
tbi);
|
||||
err = -EBUSY;
|
||||
of_node_put(tbi);
|
||||
goto error;
|
||||
}
|
||||
set_tbipa(*prop, pdev,
|
||||
data->get_tbipa, priv->map, &res);
|
||||
of_node_put(tbi);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1175,9 +1175,9 @@ static void mlx4_en_do_uc_filter(struct mlx4_en_priv *priv,
|
|||
mlx4_unregister_mac(mdev->dev, priv->port, mac);
|
||||
|
||||
hlist_del_rcu(&entry->hlist);
|
||||
kfree_rcu(entry, rcu);
|
||||
en_dbg(DRV, priv, "Removed MAC %pM on port:%d\n",
|
||||
entry->mac, priv->port);
|
||||
kfree_rcu(entry, rcu);
|
||||
++removed;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,23 +64,11 @@ struct mlx5e_port_buffer {
|
|||
struct mlx5e_bufferx_reg buffer[MLX5E_MAX_BUFFER];
|
||||
};
|
||||
|
||||
#ifdef CONFIG_MLX5_CORE_EN_DCB
|
||||
int mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv,
|
||||
u32 change, unsigned int mtu,
|
||||
struct ieee_pfc *pfc,
|
||||
u32 *buffer_size,
|
||||
u8 *prio2buffer);
|
||||
#else
|
||||
static inline int
|
||||
mlx5e_port_manual_buffer_config(struct mlx5e_priv *priv,
|
||||
u32 change, unsigned int mtu,
|
||||
void *pfc,
|
||||
u32 *buffer_size,
|
||||
u8 *prio2buffer)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int mlx5e_port_query_buffer(struct mlx5e_priv *priv,
|
||||
struct mlx5e_port_buffer *port_buffer);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@
|
|||
#include "eswitch.h"
|
||||
#include "en.h"
|
||||
#include "en/txrx.h"
|
||||
#include "en/port_buffer.h"
|
||||
#include "en_tc.h"
|
||||
#include "en_rep.h"
|
||||
#include "en_accel/ipsec.h"
|
||||
|
|
@ -2895,11 +2894,9 @@ int mlx5e_set_dev_port_mtu(struct mlx5e_priv *priv)
|
|||
struct mlx5e_params *params = &priv->channels.params;
|
||||
struct net_device *netdev = priv->netdev;
|
||||
struct mlx5_core_dev *mdev = priv->mdev;
|
||||
u16 mtu, prev_mtu;
|
||||
u16 mtu;
|
||||
int err;
|
||||
|
||||
mlx5e_query_mtu(mdev, params, &prev_mtu);
|
||||
|
||||
err = mlx5e_set_mtu(mdev, params, params->sw_mtu);
|
||||
if (err)
|
||||
return err;
|
||||
|
|
@ -2909,18 +2906,6 @@ int mlx5e_set_dev_port_mtu(struct mlx5e_priv *priv)
|
|||
netdev_warn(netdev, "%s: VPort MTU %d is different than netdev mtu %d\n",
|
||||
__func__, mtu, params->sw_mtu);
|
||||
|
||||
if (mtu != prev_mtu && MLX5_BUFFER_SUPPORTED(mdev)) {
|
||||
err = mlx5e_port_manual_buffer_config(priv, 0, mtu,
|
||||
NULL, NULL, NULL);
|
||||
if (err) {
|
||||
netdev_warn(netdev, "%s: Failed to set Xon/Xoff values with MTU %d (err %d), setting back to previous MTU %d\n",
|
||||
__func__, mtu, err, prev_mtu);
|
||||
|
||||
mlx5e_set_mtu(mdev, params, prev_mtu);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
params->sw_mtu = mtu;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -914,7 +914,7 @@ static u32 nfp_net_get_rxfh_key_size(struct net_device *netdev)
|
|||
struct nfp_net *nn = netdev_priv(netdev);
|
||||
|
||||
if (!(nn->cap & NFP_NET_CFG_CTRL_RSS_ANY))
|
||||
return -EOPNOTSUPP;
|
||||
return 0;
|
||||
|
||||
return nfp_net_rss_key_sz(nn);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1602,6 +1602,14 @@ static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
|||
} else {
|
||||
desc->die_dt = DT_FSINGLE;
|
||||
}
|
||||
|
||||
/* Before ringing the doorbell we need to make sure that the latest
|
||||
* writes have been committed to memory, otherwise it could delay
|
||||
* things until the doorbell is rang again.
|
||||
* This is in replacement of the read operation mentioned in the HW
|
||||
* manuals.
|
||||
*/
|
||||
dma_wmb();
|
||||
ravb_modify(ndev, TCCR, TCCR_TSRQ0 << q, TCCR_TSRQ0 << q);
|
||||
|
||||
priv->cur_tx[q] += num_tx_desc;
|
||||
|
|
|
|||
|
|
@ -676,7 +676,6 @@ static void rtl8150_set_multicast(struct net_device *netdev)
|
|||
rtl8150_t *dev = netdev_priv(netdev);
|
||||
u16 rx_creg = 0x9e;
|
||||
|
||||
netif_stop_queue(netdev);
|
||||
if (netdev->flags & IFF_PROMISC) {
|
||||
rx_creg |= 0x0001;
|
||||
dev_info(&netdev->dev, "%s: promiscuous mode\n", netdev->name);
|
||||
|
|
@ -690,7 +689,6 @@ static void rtl8150_set_multicast(struct net_device *netdev)
|
|||
rx_creg &= 0x00fc;
|
||||
}
|
||||
async_set_registers(dev, RCR, sizeof(rx_creg), rx_creg);
|
||||
netif_wake_queue(netdev);
|
||||
}
|
||||
|
||||
static netdev_tx_t rtl8150_start_xmit(struct sk_buff *skb,
|
||||
|
|
@ -699,9 +697,16 @@ static netdev_tx_t rtl8150_start_xmit(struct sk_buff *skb,
|
|||
rtl8150_t *dev = netdev_priv(netdev);
|
||||
int count, res;
|
||||
|
||||
/* pad the frame and ensure terminating USB packet, datasheet 9.2.3 */
|
||||
count = max(skb->len, ETH_ZLEN);
|
||||
if (count % 64 == 0)
|
||||
count++;
|
||||
if (skb_padto(skb, count)) {
|
||||
netdev->stats.tx_dropped++;
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
netif_stop_queue(netdev);
|
||||
count = (skb->len < 60) ? 60 : skb->len;
|
||||
count = (count & 0x3f) ? count : count + 1;
|
||||
dev->tx_skb = skb;
|
||||
usb_fill_bulk_urb(dev->tx_urb, dev->udev, usb_sndbulkpipe(dev->udev, 2),
|
||||
skb->data, count, write_bulk_callback, dev);
|
||||
|
|
|
|||
|
|
@ -667,10 +667,9 @@ static void mwifiex_reg_notifier(struct wiphy *wiphy,
|
|||
return;
|
||||
}
|
||||
|
||||
/* Don't send world or same regdom info to firmware */
|
||||
if (strncmp(request->alpha2, "00", 2) &&
|
||||
strncmp(request->alpha2, adapter->country_code,
|
||||
sizeof(request->alpha2))) {
|
||||
/* Don't send same regdom info to firmware */
|
||||
if (strncmp(request->alpha2, adapter->country_code,
|
||||
sizeof(request->alpha2)) != 0) {
|
||||
memcpy(adapter->country_code, request->alpha2,
|
||||
sizeof(request->alpha2));
|
||||
mwifiex_send_domain_info_cmd_fw(wiphy);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ mt76_wmac_probe(struct platform_device *pdev)
|
|||
|
||||
return 0;
|
||||
error:
|
||||
ieee80211_free_hw(mt76_hw(dev));
|
||||
mt76_free_device(mdev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue