Merge android-4.4.187 (8eb3d65
) into msm-4.4
* refs/heads/tmp-8eb3d65
Linux 4.4.187
ceph: hold i_ceph_lock when removing caps for freeing inode
drivers/pps/pps.c: clear offset flags in PPS_SETPARAMS ioctl
sched/fair: Don't free p->numa_faults with concurrent readers
Bluetooth: hci_uart: check for missing tty operations
media: radio-raremono: change devm_k*alloc to k*alloc
media: cpia2_usb: first wake up, then free in disconnect
ISDN: hfcsusb: checking idx of ep configuration
tcp: reset sk_send_head in tcp_write_queue_purge
ipv6: check sk sk_type and protocol early in ip_mroute_set/getsockopt
mm, vmstat: make quiet_vmstat lighter
vmstat: Remove BUG_ON from vmstat_update
access: avoid the RCU grace period for the temporary subjective credentials
powerpc/tm: Fix oops on sigreturn on systems without TM
ALSA: hda - Add a conexant codec entry to let mute led work
ALSA: line6: Fix wrong altsetting for LINE6_PODHD500_1
hpet: Fix division by zero in hpet_time_div()
x86/speculation/mds: Apply more accurate check on hypervisor platform
x86/sysfb_efi: Add quirks for some devices with swapped width and height
usb: pci-quirks: Correct AMD PLL quirk detection
usb: wusbcore: fix unbalanced get/put cluster_id
locking/lockdep: Hide unused 'class' variable
locking/lockdep: Fix lock used or unused stats error
mm/mmu_notifier: use hlist_add_head_rcu()
9p: pass the correct prototype to read_cache_page
mm/kmemleak.c: fix check for softirq context
sh: prevent warnings when using iounmap
powerpc/eeh: Handle hugepages in ioremap space
mailbox: handle failed named mailbox channel request
f2fs: avoid out-of-range memory access
perf test mmap-thread-lookup: Initialize variable to suppress memory sanitizer warning
kallsyms: exclude kasan local symbols on s390
serial: sh-sci: Fix TX DMA buffer flushing and workqueue races
powerpc/4xx/uic: clear pending interrupt after irq type/pol change
um: Silence lockdep complaint about mmap_sem
mfd: arizona: Fix undefined behavior
mfd: core: Set fwnode for created devices
recordmcount: Fix spurious mcount entries on powerpc
iio: iio-utils: Fix possible incorrect mask calculation
PCI: sysfs: Ignore lockdep for remove attribute
powerpc/pci/of: Fix OF flags parsing for 64bit BARs
usb: gadget: Zero ffs_io_data
phy: renesas: rcar-gen2: Fix memory leak at error paths
drm/virtio: Add memory barriers for capset cache.
tty: serial: msm_serial: avoid system lockup condition
tty/serial: digicolor: Fix digicolor-usart already registered warning
memstick: Fix error cleanup path of memstick_init
tty: serial: cpm_uart - fix init when SMC is relocated
pinctrl: rockchip: fix leaked of_node references
tty: max310x: Fix invalid baudrate divisors calculator
usb: core: hub: Disable hub-initiated U1/U2
drm/panel: simple: Fix panel_simple_dsi_probe
nfsd: Fix overflow causing non-working mounts on 1 TB machines
nfsd: fix performance-limiting session calculation
nfsd: give out fewer session slots as limit approaches
nfsd: increase DRC cache limit
NFSv4: Fix open create exclusive when the server reboots
elevator: fix truncation of icq_cache_name
net: bridge: stp: don't cache eth dest pointer before skb pull
net: bridge: mcast: fix stale ipv6 hdr pointer when handling v6 query
net: bridge: mcast: fix stale nsrcs pointer in igmp3/mld2 report handling
bonding: validate ip header before check IPPROTO_IGMP
tcp: Reset bytes_acked and bytes_received when disconnecting
netrom: hold sock when setting skb->destructor
netrom: fix a memory leak in nr_rx_frame()
sky2: Disable MSI on ASUS P6T
nfc: fix potential illegal memory access
net: neigh: fix multiple neigh timer scheduling
net: bcmgenet: use promisc for unsupported filters
ipv4: don't set IPv6 only flags to IPv4 addresses
caif-hsi: fix possible deadlock in cfhsi_exit_module()
bnx2x: Prevent load reordering in tx completion processing
dm bufio: fix deadlock with loop device
usb: Handle USB3 remote wakeup for LPM enabled devices correctly
Bluetooth: Add SMP workaround Microsoft Surface Precision Mouse bug
intel_th: msu: Fix single mode with disabled IOMMU
eCryptfs: fix a couple type promotion bugs
powerpc/watchpoint: Restore NV GPRs while returning from exception
powerpc/32s: fix suspend/resume when IBATs 4-7 are used
parisc: Fix kernel panic due invalid values in IAOQ0 or IAOQ1
gpu: ipu-v3: ipu-ic: Fix saturation bit offset in TPMEM
coda: pass the host file in vma->vm_file on mmap
floppy: fix out-of-bounds read in copy_buffer
floppy: fix invalid pointer dereference in drive_name
floppy: fix out-of-bounds read in next_valid_format
floppy: fix div-by-zero in setup_format_params
take floppy compat ioctls to sodding floppy.c
PCI: Do not poll for PME if the device is in D3cold
9p/virtio: Add cleanup path in p9_virtio_init
padata: use smp_mb in padata_reorder to avoid orphaned padata jobs
drm/nouveau/i2c: Enable i2c pads & busses during preinit
KVM: x86/vPMU: refine kvm_pmu err msg when event creation failed
media: coda: Remove unbalanced and unneeded mutex unlock
media: v4l2: Test type instead of cfg->type in v4l2_ctrl_new_custom()
ALSA: seq: Break too long mutex context in the write loop
lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE
NFSv4: Handle the special Linux file open access mode
tracing/snapshot: Resize spare buffer if size changed
regulator: s2mps11: Fix buck7 and buck8 wrong voltages
Input: gtco - bounds check collection indent level
crypto: arm64/sha2-ce - correct digest for empty data in finup
crypto: arm64/sha1-ce - correct digest for empty data in finup
crypto: ghash - fix unaligned memory access in ghash_setkey()
Bluetooth: validate BLE connection interval updates
Bluetooth: Check state in l2cap_disconnect_rsp
Bluetooth: 6lowpan: search for destination address in all peers
Bluetooth: hci_bcsp: Fix memory leak in rx_skb
bcache: check c->gc_thread by IS_ERR_OR_NULL in cache_set_flush()
EDAC: Fix global-out-of-bounds write when setting edac_mc_poll_msec
ixgbe: Check DDM existence in transceiver before access
rslib: Fix handling of of caller provided syndrome
rslib: Fix decoding of shortened codes
ath10k: fix PCIE device wake up failed
mt7601u: fix possible memory leak when the device is disconnected
x86/build: Add 'set -e' to mkcapflags.sh to delete broken capflags.c
mt7601u: do not schedule rx_tasklet when the device has been disconnected
media: coda: increment sequence offset for the last returned frame
media: coda: fix mpeg2 sequence number handling
acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
timer_list: Guard procfs specific code
ntp: Limit TAI-UTC offset
media: i2c: fix warning same module names
EDAC/sysfs: Fix memory leak when creating a csrow object
vhost_net: disable zerocopy by default
perf evsel: Make perf_evsel__name() accept a NULL argument
xfrm: fix sa selector validation
rcu: Force inlining of rcu_read_lock()
bpf: silence warning messages in core
regmap: fix bulk writes on paged registers
gpio: omap: ensure irq is enabled before wakeup
gpio: omap: fix lack of irqstatus_raw0 for OMAP4
perf test 6: Fix missing kvm module load for s390
s390/qdio: handle PENDING state for QEBSM devices
net: axienet: Fix race condition causing TX hang
net: fec: Do not use netdev messages too early
cpupower : frequency-set -r option misses the last cpu in related cpu list
media: wl128x: Fix some error handling in fm_v4l2_init_video_device()
locking/lockdep: Fix merging of hlocks with non-zero references
tua6100: Avoid build warnings.
net: phy: Check against net_device being NULL
media: staging: media: davinci_vpfe: - Fix for memory leak if decoder initialization fails.
xfrm: Fix xfrm sel prefix length validation
af_key: fix leaks in key_pol_get_resp and dump_sp.
signal/pid_namespace: Fix reboot_pid_ns to use send_sig not force_sig
net: stmmac: dwmac1000: Clear unused address entries
media: vpss: fix a potential NULL pointer dereference
media: marvell-ccic: fix DMA s/g desc number calculation
crypto: talitos - fix skcipher failure due to wrong output IV
media: dvb: usb: fix use after free in dvb_usb_device_exit
batman-adv: fix for leaked TVLV handler.
ath: DFS JP domain W56 fixed pulse type 3 RADAR detection
ath6kl: add some bounds checking
ath9k: Check for errors when reading SREV register
ath10k: Do not send probe response template for mesh
dmaengine: imx-sdma: fix use-after-free on probe error path
MIPS: fix build on non-linux hosts
MIPS: ath79: fix ar933x uart parity mode
f2fs: use EINVAL for superblock with invalid magic
f2fs: fix to read source block before invalidating it
f2fs: remove redundant check from f2fs_setflags_common()
f2fs: use generic checking and prep function for FS_IOC_SETFLAGS
ANDROID: overlayfs: Fix a regression in commit b24be4acd
ANDROID: xfrm: remove in_compat_syscall() checks
ANDROID: enable CONFIG_RTC_DRV_TEST on cuttlefish
BACKPORT: binder: Set end of SG buffer area properly.
f2fs: improve print log in f2fs_sanity_check_ckpt()
f2fs: avoid out-of-range memory access
f2fs: fix to avoid long latency during umount
f2fs: allow all the users to pin a file
f2fs: support swap file w/ DIO
f2fs: allocate blocks for pinned file
f2fs: fix is_idle() check for discard type
f2fs: add a rw_sem to cover quota flag changes
f2fs: set SBI_NEED_FSCK for xattr corruption case
f2fs: use generic EFSBADCRC/EFSCORRUPTED
f2fs: Use DIV_ROUND_UP() instead of open-coding
f2fs: print kernel message if filesystem is inconsistent
f2fs: introduce f2fs_<level> macros to wrap f2fs_printk()
f2fs: avoid get_valid_blocks() for cleanup
f2fs: ioctl for removing a range from F2FS
f2fs: only set project inherit bit for directory
f2fs: separate f2fs i_flags from fs_flags and ext4 i_flags
f2fs: Add option to limit required GC for checkpoint=disable
f2fs: Fix accounting for unusable blocks
f2fs: Fix root reserved on remount
f2fs: Lower threshold for disable_cp_again
f2fs: fix sparse warning
f2fs: fix f2fs_show_options to show nodiscard mount option
f2fs: add error prints for debugging mount failure
f2fs: fix to do sanity check on segment bitmap of LFS curseg
f2fs: add missing sysfs entries in documentation
f2fs: fix to avoid deadloop if data_flush is on
f2fs: always assume that the device is idle under gc_urgent
f2fs: add bio cache for IPU
f2fs: allow ssr block allocation during checkpoint=disable period
f2fs: fix to check layout on last valid checkpoint park
Conflicts:
drivers/net/wireless/ath/ath10k/hw.c
fs/ecryptfs/crypto.c
mm/vmstat.c
Change-Id: Ic268e845f4992a9dbdf5c985cfe9359a56a5c72e
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
This commit is contained in:
commit
27f8e158ab
185 changed files with 3092 additions and 1566 deletions
|
@ -243,3 +243,11 @@ Description:
|
|||
- Del: echo '[h/c]!extension' > /sys/fs/f2fs/<disk>/extension_list
|
||||
- [h] means add/del hot file extension
|
||||
- [c] means add/del cold file extension
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/unusable
|
||||
Date April 2019
|
||||
Contact: "Daniel Rosenberg" <drosen@google.com>
|
||||
Description:
|
||||
If checkpoint=disable, it displays the number of blocks that are unusable.
|
||||
If checkpoint=enable it displays the enumber of blocks that would be unusable
|
||||
if checkpoint=disable were to be set.
|
||||
|
|
|
@ -214,11 +214,22 @@ fsync_mode=%s Control the policy of fsync. Currently supports "posix",
|
|||
non-atomic files likewise "nobarrier" mount option.
|
||||
test_dummy_encryption Enable dummy encryption, which provides a fake fscrypt
|
||||
context. The fake fscrypt context is used by xfstests.
|
||||
checkpoint=%s Set to "disable" to turn off checkpointing. Set to "enable"
|
||||
checkpoint=%s[:%u[%]] Set to "disable" to turn off checkpointing. Set to "enable"
|
||||
to reenable checkpointing. Is enabled by default. While
|
||||
disabled, any unmounting or unexpected shutdowns will cause
|
||||
the filesystem contents to appear as they did when the
|
||||
filesystem was mounted with that option.
|
||||
While mounting with checkpoint=disabled, the filesystem must
|
||||
run garbage collection to ensure that all available space can
|
||||
be used. If this takes too much time, the mount may return
|
||||
EAGAIN. You may optionally add a value to indicate how much
|
||||
of the disk you would be willing to temporarily give up to
|
||||
avoid additional garbage collection. This can be given as a
|
||||
number of blocks, or as a percent. For instance, mounting
|
||||
with checkpoint=disable:100% would always succeed, but it may
|
||||
hide up to all remaining free space. The actual space that
|
||||
would be unusable can be viewed at /sys/fs/f2fs/<disk>/unusable
|
||||
This space is reclaimed once checkpoint=enable.
|
||||
|
||||
================================================================================
|
||||
DEBUGFS ENTRIES
|
||||
|
@ -246,11 +257,14 @@ Files in /sys/fs/f2fs/<devname>
|
|||
..............................................................................
|
||||
File Content
|
||||
|
||||
gc_max_sleep_time This tuning parameter controls the maximum sleep
|
||||
gc_urgent_sleep_time This parameter controls sleep time for gc_urgent.
|
||||
500 ms is set by default. See above gc_urgent.
|
||||
|
||||
gc_min_sleep_time This tuning parameter controls the minimum sleep
|
||||
time for the garbage collection thread. Time is
|
||||
in milliseconds.
|
||||
|
||||
gc_min_sleep_time This tuning parameter controls the minimum sleep
|
||||
gc_max_sleep_time This tuning parameter controls the maximum sleep
|
||||
time for the garbage collection thread. Time is
|
||||
in milliseconds.
|
||||
|
||||
|
@ -270,9 +284,6 @@ Files in /sys/fs/f2fs/<devname>
|
|||
to 1, background thread starts to do GC by given
|
||||
gc_urgent_sleep_time interval.
|
||||
|
||||
gc_urgent_sleep_time This parameter controls sleep time for gc_urgent.
|
||||
500 ms is set by default. See above gc_urgent.
|
||||
|
||||
reclaim_segments This parameter controls the number of prefree
|
||||
segments to be reclaimed. If the number of prefree
|
||||
segments is larger than the number of segments
|
||||
|
@ -287,7 +298,16 @@ Files in /sys/fs/f2fs/<devname>
|
|||
checkpoint is triggered, and issued during the
|
||||
checkpoint. By default, it is disabled with 0.
|
||||
|
||||
trim_sections This parameter controls the number of sections
|
||||
discard_granularity This parameter controls the granularity of discard
|
||||
command size. It will issue discard commands iif
|
||||
the size is larger than given granularity. Its
|
||||
unit size is 4KB, and 4 (=16KB) is set by default.
|
||||
The maximum value is 128 (=512KB).
|
||||
|
||||
reserved_blocks This parameter indicates the number of blocks that
|
||||
f2fs reserves internally for root.
|
||||
|
||||
batched_trim_sections This parameter controls the number of sections
|
||||
to be trimmed out in batch mode when FITRIM
|
||||
conducts. 32 sections is set by default.
|
||||
|
||||
|
@ -309,11 +329,35 @@ Files in /sys/fs/f2fs/<devname>
|
|||
the number is less than this value, it triggers
|
||||
in-place-updates.
|
||||
|
||||
min_seq_blocks This parameter controls the threshold to serialize
|
||||
write IOs issued by multiple threads in parallel.
|
||||
|
||||
min_hot_blocks This parameter controls the threshold to allocate
|
||||
a hot data log for pending data blocks to write.
|
||||
|
||||
min_ssr_sections This parameter adds the threshold when deciding
|
||||
SSR block allocation. If this is large, SSR mode
|
||||
will be enabled early.
|
||||
|
||||
ram_thresh This parameter controls the memory footprint used
|
||||
by free nids and cached nat entries. By default,
|
||||
10 is set, which indicates 10 MB / 1 GB RAM.
|
||||
|
||||
ra_nid_pages When building free nids, F2FS reads NAT blocks
|
||||
ahead for speed up. Default is 0.
|
||||
|
||||
dirty_nats_ratio Given dirty ratio of cached nat entries, F2FS
|
||||
determines flushing them in background.
|
||||
|
||||
max_victim_search This parameter controls the number of trials to
|
||||
find a victim segment when conducting SSR and
|
||||
cleaning operations. The default value is 4096
|
||||
which covers 8GB block address range.
|
||||
|
||||
migration_granularity For large-sized sections, F2FS can stop GC given
|
||||
this granularity instead of reclaiming entire
|
||||
section.
|
||||
|
||||
dir_level This parameter controls the directory level to
|
||||
support large directory. If a directory has a
|
||||
number of files, it can reduce the file lookup
|
||||
|
@ -321,9 +365,53 @@ Files in /sys/fs/f2fs/<devname>
|
|||
Otherwise, it needs to decrease this value to
|
||||
reduce the space overhead. The default value is 0.
|
||||
|
||||
ram_thresh This parameter controls the memory footprint used
|
||||
by free nids and cached nat entries. By default,
|
||||
10 is set, which indicates 10 MB / 1 GB RAM.
|
||||
cp_interval F2FS tries to do checkpoint periodically, 60 secs
|
||||
by default.
|
||||
|
||||
idle_interval F2FS detects system is idle, if there's no F2FS
|
||||
operations during given interval, 5 secs by
|
||||
default.
|
||||
|
||||
discard_idle_interval F2FS detects the discard thread is idle, given
|
||||
time interval. Default is 5 secs.
|
||||
|
||||
gc_idle_interval F2FS detects the GC thread is idle, given time
|
||||
interval. Default is 5 secs.
|
||||
|
||||
umount_discard_timeout When unmounting the disk, F2FS waits for finishing
|
||||
queued discard commands which can take huge time.
|
||||
This gives time out for it, 5 secs by default.
|
||||
|
||||
iostat_enable This controls to enable/disable iostat in F2FS.
|
||||
|
||||
readdir_ra This enables/disabled readahead of inode blocks
|
||||
in readdir, and default is enabled.
|
||||
|
||||
gc_pin_file_thresh This indicates how many GC can be failed for the
|
||||
pinned file. If it exceeds this, F2FS doesn't
|
||||
guarantee its pinning state. 2048 trials is set
|
||||
by default.
|
||||
|
||||
extension_list This enables to change extension_list for hot/cold
|
||||
files in runtime.
|
||||
|
||||
inject_rate This controls injection rate of arbitrary faults.
|
||||
|
||||
inject_type This controls injection type of arbitrary faults.
|
||||
|
||||
dirty_segments This shows # of dirty segments.
|
||||
|
||||
lifetime_write_kbytes This shows # of data written to the disk.
|
||||
|
||||
features This shows current features enabled on F2FS.
|
||||
|
||||
current_reserved_blocks This shows # of blocks currently reserved.
|
||||
|
||||
unusable If checkpoint=disable, this shows the number of
|
||||
blocks that are unusable.
|
||||
If checkpoint=enable it shows the number of blocks
|
||||
that would be unusable if checkpoint=disable were
|
||||
to be set.
|
||||
|
||||
================================================================================
|
||||
USAGE
|
||||
|
@ -656,3 +744,28 @@ algorithm.
|
|||
In order to identify whether the data in the victim segment are valid or not,
|
||||
F2FS manages a bitmap. Each bit represents the validity of a block, and the
|
||||
bitmap is composed of a bit stream covering whole blocks in main area.
|
||||
|
||||
Fallocate(2) Policy
|
||||
-------------------
|
||||
|
||||
The default policy follows the below posix rule.
|
||||
|
||||
Allocating disk space
|
||||
The default operation (i.e., mode is zero) of fallocate() allocates
|
||||
the disk space within the range specified by offset and len. The
|
||||
file size (as reported by stat(2)) will be changed if offset+len is
|
||||
greater than the file size. Any subregion within the range specified
|
||||
by offset and len that did not contain data before the call will be
|
||||
initialized to zero. This default behavior closely resembles the
|
||||
behavior of the posix_fallocate(3) library function, and is intended
|
||||
as a method of optimally implementing that function.
|
||||
|
||||
However, once F2FS receives ioctl(fd, F2FS_IOC_SET_PIN_FILE) in prior to
|
||||
fallocate(fd, DEFAULT_MODE), it allocates on-disk blocks addressess having
|
||||
zero or random data, which is useful to the below scenario where:
|
||||
1. create(fd)
|
||||
2. ioctl(fd, F2FS_IOC_SET_PIN_FILE)
|
||||
3. fallocate(fd, 0, 0, size)
|
||||
4. address = fibmap(fd, offset)
|
||||
5. open(blkdev)
|
||||
6. write(blkdev, address)
|
||||
|
|
2
Makefile
2
Makefile
|
@ -1,6 +1,6 @@
|
|||
VERSION = 4
|
||||
PATCHLEVEL = 4
|
||||
SUBLEVEL = 186
|
||||
SUBLEVEL = 187
|
||||
EXTRAVERSION =
|
||||
NAME = Blurry Fish Butt
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ static int sha1_ce_finup(struct shash_desc *desc, const u8 *data,
|
|||
unsigned int len, u8 *out)
|
||||
{
|
||||
struct sha1_ce_state *sctx = shash_desc_ctx(desc);
|
||||
bool finalize = !sctx->sst.count && !(len % SHA1_BLOCK_SIZE);
|
||||
bool finalize = !sctx->sst.count && !(len % SHA1_BLOCK_SIZE) && len;
|
||||
|
||||
/*
|
||||
* Allow the asm code to perform the finalization if there is no
|
||||
|
|
|
@ -52,7 +52,7 @@ static int sha256_ce_finup(struct shash_desc *desc, const u8 *data,
|
|||
unsigned int len, u8 *out)
|
||||
{
|
||||
struct sha256_ce_state *sctx = shash_desc_ctx(desc);
|
||||
bool finalize = !sctx->sst.count && !(len % SHA256_BLOCK_SIZE);
|
||||
bool finalize = !sctx->sst.count && !(len % SHA256_BLOCK_SIZE) && len;
|
||||
|
||||
/*
|
||||
* Allow the asm code to perform the finalization if there is no
|
||||
|
|
|
@ -141,10 +141,14 @@ static int __init acpi_fadt_sanity_check(void)
|
|||
*/
|
||||
if (table->revision < 5 ||
|
||||
(table->revision == 5 && fadt->minor_revision < 1)) {
|
||||
pr_err("Unsupported FADT revision %d.%d, should be 5.1+\n",
|
||||
pr_err(FW_BUG "Unsupported FADT revision %d.%d, should be 5.1+\n",
|
||||
table->revision, fadt->minor_revision);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
|
||||
if (!fadt->arm_boot_flags) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
pr_err("FADT has ARM boot flags set, assuming 5.1\n");
|
||||
}
|
||||
|
||||
if (!(fadt->flags & ACPI_FADT_HW_REDUCED)) {
|
||||
|
|
|
@ -66,6 +66,8 @@ OBJCOPYFLAGS_piggy.o := --add-section=.image=$(obj)/vmlinux.bin.z \
|
|||
$(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
HOSTCFLAGS_calc_vmlinuz_load_addr.o += $(LINUXINCLUDE)
|
||||
|
||||
# Calculate the load address of the compressed kernel image
|
||||
hostprogs-y := calc_vmlinuz_load_addr
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "../../../../include/linux/sizes.h"
|
||||
#include <linux/sizes.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#define AR933X_UART_CS_PARITY_S 0
|
||||
#define AR933X_UART_CS_PARITY_M 0x3
|
||||
#define AR933X_UART_CS_PARITY_NONE 0
|
||||
#define AR933X_UART_CS_PARITY_ODD 1
|
||||
#define AR933X_UART_CS_PARITY_EVEN 2
|
||||
#define AR933X_UART_CS_PARITY_ODD 2
|
||||
#define AR933X_UART_CS_PARITY_EVEN 3
|
||||
#define AR933X_UART_CS_IF_MODE_S 2
|
||||
#define AR933X_UART_CS_IF_MODE_M 0x3
|
||||
#define AR933X_UART_CS_IF_MODE_NONE 0
|
||||
|
|
|
@ -156,6 +156,9 @@ long arch_ptrace(struct task_struct *child, long request,
|
|||
if ((addr & (sizeof(unsigned long)-1)) ||
|
||||
addr >= sizeof(struct pt_regs))
|
||||
break;
|
||||
if (addr == PT_IAOQ0 || addr == PT_IAOQ1) {
|
||||
data |= 3; /* ensure userspace privilege */
|
||||
}
|
||||
if ((addr >= PT_GR1 && addr <= PT_GR31) ||
|
||||
addr == PT_IAOQ0 || addr == PT_IAOQ1 ||
|
||||
(addr >= PT_FR0 && addr <= PT_FR31 + 4) ||
|
||||
|
@ -189,16 +192,18 @@ long arch_ptrace(struct task_struct *child, long request,
|
|||
|
||||
static compat_ulong_t translate_usr_offset(compat_ulong_t offset)
|
||||
{
|
||||
if (offset < 0)
|
||||
return sizeof(struct pt_regs);
|
||||
else if (offset <= 32*4) /* gr[0..31] */
|
||||
return offset * 2 + 4;
|
||||
else if (offset <= 32*4+32*8) /* gr[0..31] + fr[0..31] */
|
||||
return offset + 32*4;
|
||||
else if (offset < sizeof(struct pt_regs)/2 + 32*4)
|
||||
return offset * 2 + 4 - 32*8;
|
||||
compat_ulong_t pos;
|
||||
|
||||
if (offset < 32*4) /* gr[0..31] */
|
||||
pos = offset * 2 + 4;
|
||||
else if (offset < 32*4+32*8) /* fr[0] ... fr[31] */
|
||||
pos = (offset - 32*4) + PT_FR0;
|
||||
else if (offset < sizeof(struct pt_regs)/2 + 32*4) /* sr[0] ... ipsw */
|
||||
pos = (offset - 32*4 - 32*8) * 2 + PT_SR0 + 4;
|
||||
else
|
||||
return sizeof(struct pt_regs);
|
||||
pos = sizeof(struct pt_regs);
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
|
||||
|
@ -242,9 +247,12 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
|
|||
addr = translate_usr_offset(addr);
|
||||
if (addr >= sizeof(struct pt_regs))
|
||||
break;
|
||||
if (addr == PT_IAOQ0+4 || addr == PT_IAOQ1+4) {
|
||||
data |= 3; /* ensure userspace privilege */
|
||||
}
|
||||
if (addr >= PT_FR0 && addr <= PT_FR31 + 4) {
|
||||
/* Special case, fp regs are 64 bits anyway */
|
||||
*(__u64 *) ((char *) task_regs(child) + addr) = data;
|
||||
*(__u32 *) ((char *) task_regs(child) + addr) = data;
|
||||
ret = 0;
|
||||
}
|
||||
else if ((addr >= PT_GR1+4 && addr <= PT_GR31+4) ||
|
||||
|
|
|
@ -363,10 +363,19 @@ static inline unsigned long eeh_token_to_phys(unsigned long token)
|
|||
NULL, &hugepage_shift);
|
||||
if (!ptep)
|
||||
return token;
|
||||
WARN_ON(hugepage_shift);
|
||||
pa = pte_pfn(*ptep) << PAGE_SHIFT;
|
||||
|
||||
return pa | (token & (PAGE_SIZE-1));
|
||||
pa = pte_pfn(*ptep);
|
||||
|
||||
/* On radix we can do hugepage mappings for io, so handle that */
|
||||
if (hugepage_shift) {
|
||||
pa <<= hugepage_shift;
|
||||
pa |= token & ((1ul << hugepage_shift) - 1);
|
||||
} else {
|
||||
pa <<= PAGE_SHIFT;
|
||||
pa |= token & (PAGE_SIZE - 1);
|
||||
}
|
||||
|
||||
return pa;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1719,7 +1719,7 @@ handle_page_fault:
|
|||
addi r3,r1,STACK_FRAME_OVERHEAD
|
||||
bl do_page_fault
|
||||
cmpdi r3,0
|
||||
beq+ 12f
|
||||
beq+ ret_from_except_lite
|
||||
bl save_nvgprs
|
||||
mr r5,r3
|
||||
addi r3,r1,STACK_FRAME_OVERHEAD
|
||||
|
@ -1734,7 +1734,12 @@ handle_dabr_fault:
|
|||
ld r5,_DSISR(r1)
|
||||
addi r3,r1,STACK_FRAME_OVERHEAD
|
||||
bl do_break
|
||||
12: b ret_from_except_lite
|
||||
/*
|
||||
* do_break() may have changed the NV GPRS while handling a breakpoint.
|
||||
* If so, we need to restore them with their updated values. Don't use
|
||||
* ret_from_except_lite here.
|
||||
*/
|
||||
b ret_from_except
|
||||
|
||||
|
||||
/* We have a page fault that hash_page could handle but HV refused
|
||||
|
|
|
@ -45,6 +45,8 @@ static unsigned int pci_parse_of_flags(u32 addr0, int bridge)
|
|||
if (addr0 & 0x02000000) {
|
||||
flags = IORESOURCE_MEM | PCI_BASE_ADDRESS_SPACE_MEMORY;
|
||||
flags |= (addr0 >> 22) & PCI_BASE_ADDRESS_MEM_TYPE_64;
|
||||
if (flags & PCI_BASE_ADDRESS_MEM_TYPE_64)
|
||||
flags |= IORESOURCE_MEM_64;
|
||||
flags |= (addr0 >> 28) & PCI_BASE_ADDRESS_MEM_TYPE_1M;
|
||||
if (addr0 & 0x40000000)
|
||||
flags |= IORESOURCE_PREFETCH
|
||||
|
|
|
@ -1261,6 +1261,9 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
|
|||
goto bad;
|
||||
|
||||
if (MSR_TM_ACTIVE(msr_hi<<32)) {
|
||||
/* Trying to start TM on non TM system */
|
||||
if (!cpu_has_feature(CPU_FTR_TM))
|
||||
goto bad;
|
||||
/* We only recheckpoint on return if we're
|
||||
* transaction.
|
||||
*/
|
||||
|
|
|
@ -695,6 +695,11 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
|
|||
if (MSR_TM_ACTIVE(msr)) {
|
||||
/* We recheckpoint on return. */
|
||||
struct ucontext __user *uc_transact;
|
||||
|
||||
/* Trying to start TM on non TM system */
|
||||
if (!cpu_has_feature(CPU_FTR_TM))
|
||||
goto badframe;
|
||||
|
||||
if (__get_user(uc_transact, &uc->uc_link))
|
||||
goto badframe;
|
||||
if (restore_tm_sigcontexts(regs, &uc->uc_mcontext,
|
||||
|
|
|
@ -23,11 +23,19 @@
|
|||
#define SL_IBAT2 0x48
|
||||
#define SL_DBAT3 0x50
|
||||
#define SL_IBAT3 0x58
|
||||
#define SL_TB 0x60
|
||||
#define SL_R2 0x68
|
||||
#define SL_CR 0x6c
|
||||
#define SL_LR 0x70
|
||||
#define SL_R12 0x74 /* r12 to r31 */
|
||||
#define SL_DBAT4 0x60
|
||||
#define SL_IBAT4 0x68
|
||||
#define SL_DBAT5 0x70
|
||||
#define SL_IBAT5 0x78
|
||||
#define SL_DBAT6 0x80
|
||||
#define SL_IBAT6 0x88
|
||||
#define SL_DBAT7 0x90
|
||||
#define SL_IBAT7 0x98
|
||||
#define SL_TB 0xa0
|
||||
#define SL_R2 0xa8
|
||||
#define SL_CR 0xac
|
||||
#define SL_LR 0xb0
|
||||
#define SL_R12 0xb4 /* r12 to r31 */
|
||||
#define SL_SIZE (SL_R12 + 80)
|
||||
|
||||
.section .data
|
||||
|
@ -112,6 +120,41 @@ _GLOBAL(swsusp_arch_suspend)
|
|||
mfibatl r4,3
|
||||
stw r4,SL_IBAT3+4(r11)
|
||||
|
||||
BEGIN_MMU_FTR_SECTION
|
||||
mfspr r4,SPRN_DBAT4U
|
||||
stw r4,SL_DBAT4(r11)
|
||||
mfspr r4,SPRN_DBAT4L
|
||||
stw r4,SL_DBAT4+4(r11)
|
||||
mfspr r4,SPRN_DBAT5U
|
||||
stw r4,SL_DBAT5(r11)
|
||||
mfspr r4,SPRN_DBAT5L
|
||||
stw r4,SL_DBAT5+4(r11)
|
||||
mfspr r4,SPRN_DBAT6U
|
||||
stw r4,SL_DBAT6(r11)
|
||||
mfspr r4,SPRN_DBAT6L
|
||||
stw r4,SL_DBAT6+4(r11)
|
||||
mfspr r4,SPRN_DBAT7U
|
||||
stw r4,SL_DBAT7(r11)
|
||||
mfspr r4,SPRN_DBAT7L
|
||||
stw r4,SL_DBAT7+4(r11)
|
||||
mfspr r4,SPRN_IBAT4U
|
||||
stw r4,SL_IBAT4(r11)
|
||||
mfspr r4,SPRN_IBAT4L
|
||||
stw r4,SL_IBAT4+4(r11)
|
||||
mfspr r4,SPRN_IBAT5U
|
||||
stw r4,SL_IBAT5(r11)
|
||||
mfspr r4,SPRN_IBAT5L
|
||||
stw r4,SL_IBAT5+4(r11)
|
||||
mfspr r4,SPRN_IBAT6U
|
||||
stw r4,SL_IBAT6(r11)
|
||||
mfspr r4,SPRN_IBAT6L
|
||||
stw r4,SL_IBAT6+4(r11)
|
||||
mfspr r4,SPRN_IBAT7U
|
||||
stw r4,SL_IBAT7(r11)
|
||||
mfspr r4,SPRN_IBAT7L
|
||||
stw r4,SL_IBAT7+4(r11)
|
||||
END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
|
||||
|
||||
#if 0
|
||||
/* Backup various CPU config stuffs */
|
||||
bl __save_cpu_setup
|
||||
|
@ -277,27 +320,41 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
|
|||
mtibatu 3,r4
|
||||
lwz r4,SL_IBAT3+4(r11)
|
||||
mtibatl 3,r4
|
||||
#endif
|
||||
|
||||
BEGIN_MMU_FTR_SECTION
|
||||
li r4,0
|
||||
lwz r4,SL_DBAT4(r11)
|
||||
mtspr SPRN_DBAT4U,r4
|
||||
lwz r4,SL_DBAT4+4(r11)
|
||||
mtspr SPRN_DBAT4L,r4
|
||||
lwz r4,SL_DBAT5(r11)
|
||||
mtspr SPRN_DBAT5U,r4
|
||||
lwz r4,SL_DBAT5+4(r11)
|
||||
mtspr SPRN_DBAT5L,r4
|
||||
lwz r4,SL_DBAT6(r11)
|
||||
mtspr SPRN_DBAT6U,r4
|
||||
lwz r4,SL_DBAT6+4(r11)
|
||||
mtspr SPRN_DBAT6L,r4
|
||||
lwz r4,SL_DBAT7(r11)
|
||||
mtspr SPRN_DBAT7U,r4
|
||||
lwz r4,SL_DBAT7+4(r11)
|
||||
mtspr SPRN_DBAT7L,r4
|
||||
lwz r4,SL_IBAT4(r11)
|
||||
mtspr SPRN_IBAT4U,r4
|
||||
lwz r4,SL_IBAT4+4(r11)
|
||||
mtspr SPRN_IBAT4L,r4
|
||||
lwz r4,SL_IBAT5(r11)
|
||||
mtspr SPRN_IBAT5U,r4
|
||||
lwz r4,SL_IBAT5+4(r11)
|
||||
mtspr SPRN_IBAT5L,r4
|
||||
lwz r4,SL_IBAT6(r11)
|
||||
mtspr SPRN_IBAT6U,r4
|
||||
lwz r4,SL_IBAT6+4(r11)
|
||||
mtspr SPRN_IBAT6L,r4
|
||||
lwz r4,SL_IBAT7(r11)
|
||||
mtspr SPRN_IBAT7U,r4
|
||||
lwz r4,SL_IBAT7+4(r11)
|
||||
mtspr SPRN_IBAT7L,r4
|
||||
END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
|
||||
#endif
|
||||
|
||||
/* Flush all TLBs */
|
||||
lis r4,0x1000
|
||||
|
|
|
@ -37,10 +37,18 @@
|
|||
#define SL_IBAT2 0x48
|
||||
#define SL_DBAT3 0x50
|
||||
#define SL_IBAT3 0x58
|
||||
#define SL_TB 0x60
|
||||
#define SL_R2 0x68
|
||||
#define SL_CR 0x6c
|
||||
#define SL_R12 0x70 /* r12 to r31 */
|
||||
#define SL_DBAT4 0x60
|
||||
#define SL_IBAT4 0x68
|
||||
#define SL_DBAT5 0x70
|
||||
#define SL_IBAT5 0x78
|
||||
#define SL_DBAT6 0x80
|
||||
#define SL_IBAT6 0x88
|
||||
#define SL_DBAT7 0x90
|
||||
#define SL_IBAT7 0x98
|
||||
#define SL_TB 0xa0
|
||||
#define SL_R2 0xa8
|
||||
#define SL_CR 0xac
|
||||
#define SL_R12 0xb0 /* r12 to r31 */
|
||||
#define SL_SIZE (SL_R12 + 80)
|
||||
|
||||
.section .text
|
||||
|
@ -125,6 +133,41 @@ _GLOBAL(low_sleep_handler)
|
|||
mfibatl r4,3
|
||||
stw r4,SL_IBAT3+4(r1)
|
||||
|
||||
BEGIN_MMU_FTR_SECTION
|
||||
mfspr r4,SPRN_DBAT4U
|
||||
stw r4,SL_DBAT4(r1)
|
||||
mfspr r4,SPRN_DBAT4L
|
||||
stw r4,SL_DBAT4+4(r1)
|
||||
mfspr r4,SPRN_DBAT5U
|
||||
stw r4,SL_DBAT5(r1)
|
||||
mfspr r4,SPRN_DBAT5L
|
||||
stw r4,SL_DBAT5+4(r1)
|
||||
mfspr r4,SPRN_DBAT6U
|
||||
stw r4,SL_DBAT6(r1)
|
||||
mfspr r4,SPRN_DBAT6L
|
||||
stw r4,SL_DBAT6+4(r1)
|
||||
mfspr r4,SPRN_DBAT7U
|
||||
stw r4,SL_DBAT7(r1)
|
||||
mfspr r4,SPRN_DBAT7L
|
||||
stw r4,SL_DBAT7+4(r1)
|
||||
mfspr r4,SPRN_IBAT4U
|
||||
stw r4,SL_IBAT4(r1)
|
||||
mfspr r4,SPRN_IBAT4L
|
||||
stw r4,SL_IBAT4+4(r1)
|
||||
mfspr r4,SPRN_IBAT5U
|
||||
stw r4,SL_IBAT5(r1)
|
||||
mfspr r4,SPRN_IBAT5L
|
||||
stw r4,SL_IBAT5+4(r1)
|
||||
mfspr r4,SPRN_IBAT6U
|
||||
stw r4,SL_IBAT6(r1)
|
||||
mfspr r4,SPRN_IBAT6L
|
||||
stw r4,SL_IBAT6+4(r1)
|
||||
mfspr r4,SPRN_IBAT7U
|
||||
stw r4,SL_IBAT7(r1)
|
||||
mfspr r4,SPRN_IBAT7L
|
||||
stw r4,SL_IBAT7+4(r1)
|
||||
END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
|
||||
|
||||
/* Backup various CPU config stuffs */
|
||||
bl __save_cpu_setup
|
||||
|
||||
|
@ -325,22 +368,37 @@ grackle_wake_up:
|
|||
mtibatl 3,r4
|
||||
|
||||
BEGIN_MMU_FTR_SECTION
|
||||
li r4,0
|
||||
lwz r4,SL_DBAT4(r1)
|
||||
mtspr SPRN_DBAT4U,r4
|
||||
lwz r4,SL_DBAT4+4(r1)
|
||||
mtspr SPRN_DBAT4L,r4
|
||||
lwz r4,SL_DBAT5(r1)
|
||||
mtspr SPRN_DBAT5U,r4
|
||||
lwz r4,SL_DBAT5+4(r1)
|
||||
mtspr SPRN_DBAT5L,r4
|
||||
lwz r4,SL_DBAT6(r1)
|
||||
mtspr SPRN_DBAT6U,r4
|
||||
lwz r4,SL_DBAT6+4(r1)
|
||||
mtspr SPRN_DBAT6L,r4
|
||||
lwz r4,SL_DBAT7(r1)
|
||||
mtspr SPRN_DBAT7U,r4
|
||||
lwz r4,SL_DBAT7+4(r1)
|
||||
mtspr SPRN_DBAT7L,r4
|
||||
lwz r4,SL_IBAT4(r1)
|
||||
mtspr SPRN_IBAT4U,r4
|
||||
lwz r4,SL_IBAT4+4(r1)
|
||||
mtspr SPRN_IBAT4L,r4
|
||||
lwz r4,SL_IBAT5(r1)
|
||||
mtspr SPRN_IBAT5U,r4
|
||||
lwz r4,SL_IBAT5+4(r1)
|
||||
mtspr SPRN_IBAT5L,r4
|
||||
lwz r4,SL_IBAT6(r1)
|
||||
mtspr SPRN_IBAT6U,r4
|
||||
lwz r4,SL_IBAT6+4(r1)
|
||||
mtspr SPRN_IBAT6L,r4
|
||||
lwz r4,SL_IBAT7(r1)
|
||||
mtspr SPRN_IBAT7U,r4
|
||||
lwz r4,SL_IBAT7+4(r1)
|
||||
mtspr SPRN_IBAT7L,r4
|
||||
END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS)
|
||||
|
||||
|
|
|
@ -158,6 +158,7 @@ static int uic_set_irq_type(struct irq_data *d, unsigned int flow_type)
|
|||
|
||||
mtdcr(uic->dcrbase + UIC_PR, pr);
|
||||
mtdcr(uic->dcrbase + UIC_TR, tr);
|
||||
mtdcr(uic->dcrbase + UIC_SR, ~mask);
|
||||
|
||||
raw_spin_unlock_irqrestore(&uic->lock, flags);
|
||||
|
||||
|
|
|
@ -370,7 +370,11 @@ static inline int iounmap_fixed(void __iomem *addr) { return -EINVAL; }
|
|||
|
||||
#define ioremap_nocache ioremap
|
||||
#define ioremap_uc ioremap
|
||||
#define iounmap __iounmap
|
||||
|
||||
static inline void iounmap(void __iomem *addr)
|
||||
{
|
||||
__iounmap(addr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
|
||||
|
|
|
@ -42,7 +42,7 @@ static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
|
|||
* when the new ->mm is used for the first time.
|
||||
*/
|
||||
__switch_mm(&new->context.id);
|
||||
down_write(&new->mmap_sem);
|
||||
down_write_nested(&new->mmap_sem, 1);
|
||||
uml_setup_stubs(new);
|
||||
up_write(&new->mmap_sem);
|
||||
}
|
||||
|
|
|
@ -382,6 +382,7 @@ CONFIG_USB_CONFIGFS_F_AUDIO_SRC=y
|
|||
CONFIG_USB_CONFIGFS_UEVENT=y
|
||||
CONFIG_USB_CONFIGFS_F_MIDI=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
CONFIG_RTC_DRV_TEST=y
|
||||
CONFIG_VIRTIO_PCI=y
|
||||
CONFIG_VIRTIO_BALLOON=y
|
||||
CONFIG_VIRTIO_INPUT=y
|
||||
|
|
|
@ -1094,7 +1094,7 @@ static void __init l1tf_select_mitigation(void)
|
|||
static ssize_t mds_show_state(char *buf)
|
||||
{
|
||||
#ifdef CONFIG_HYPERVISOR_GUEST
|
||||
if (x86_hyper) {
|
||||
if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
|
||||
return sprintf(buf, "%s; SMT Host state unknown\n",
|
||||
mds_strings[mds_mitigation]);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
# Generate the x86_cap/bug_flags[] arrays from include/asm/cpufeatures.h
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
IN=$1
|
||||
OUT=$2
|
||||
|
||||
|
|
|
@ -216,9 +216,55 @@ static const struct dmi_system_id efifb_dmi_system_table[] __initconst = {
|
|||
{},
|
||||
};
|
||||
|
||||
/*
|
||||
* Some devices have a portrait LCD but advertise a landscape resolution (and
|
||||
* pitch). We simply swap width and height for these devices so that we can
|
||||
* correctly deal with some of them coming with multiple resolutions.
|
||||
*/
|
||||
static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = {
|
||||
{
|
||||
/*
|
||||
* Lenovo MIIX310-10ICR, only some batches have the troublesome
|
||||
* 800x1280 portrait screen. Luckily the portrait version has
|
||||
* its own BIOS version, so we match on that.
|
||||
*/
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "MIIX 310-10ICR"),
|
||||
DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1HCN44WW"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Lenovo MIIX 320-10ICR with 800x1280 portrait screen */
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION,
|
||||
"Lenovo MIIX 320-10ICR"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* Lenovo D330 with 800x1280 or 1200x1920 portrait screen */
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION,
|
||||
"Lenovo ideapad D330-10IGM"),
|
||||
},
|
||||
},
|
||||
{},
|
||||
};
|
||||
|
||||
__init void sysfb_apply_efi_quirks(void)
|
||||
{
|
||||
if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI ||
|
||||
!(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS))
|
||||
dmi_check_system(efifb_dmi_system_table);
|
||||
|
||||
if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI &&
|
||||
dmi_check_system(efifb_dmi_swap_width_height)) {
|
||||
u16 temp = screen_info.lfb_width;
|
||||
|
||||
screen_info.lfb_width = screen_info.lfb_height;
|
||||
screen_info.lfb_height = temp;
|
||||
screen_info.lfb_linelength = 4 * screen_info.lfb_width;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,8 +124,8 @@ static void pmc_reprogram_counter(struct kvm_pmc *pmc, u32 type,
|
|||
intr ? kvm_perf_overflow_intr :
|
||||
kvm_perf_overflow, pmc);
|
||||
if (IS_ERR(event)) {
|
||||
printk_once("kvm_pmu: event creation failed %ld\n",
|
||||
PTR_ERR(event));
|
||||
pr_debug_ratelimited("kvm_pmu: event creation failed %ld for pmc->idx = %d\n",
|
||||
PTR_ERR(event), pmc->idx);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <linux/cdrom.h>
|
||||
#include <linux/compat.h>
|
||||
#include <linux/elevator.h>
|
||||
#include <linux/fd.h>
|
||||
#include <linux/hdreg.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/syscalls.h>
|
||||
|
@ -209,318 +208,6 @@ static int compat_blkpg_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
#define BLKBSZSET_32 _IOW(0x12, 113, int)
|
||||
#define BLKGETSIZE64_32 _IOR(0x12, 114, int)
|
||||
|
||||
struct compat_floppy_drive_params {
|
||||
char cmos;
|
||||
compat_ulong_t max_dtr;
|
||||
compat_ulong_t hlt;
|
||||
compat_ulong_t hut;
|
||||
compat_ulong_t srt;
|
||||
compat_ulong_t spinup;
|
||||
compat_ulong_t spindown;
|
||||
unsigned char spindown_offset;
|
||||
unsigned char select_delay;
|
||||
unsigned char rps;
|
||||
unsigned char tracks;
|
||||
compat_ulong_t timeout;
|
||||
unsigned char interleave_sect;
|
||||
struct floppy_max_errors max_errors;
|
||||
char flags;
|
||||
char read_track;
|
||||
short autodetect[8];
|
||||
compat_int_t checkfreq;
|
||||
compat_int_t native_format;
|
||||
};
|
||||
|
||||
struct compat_floppy_drive_struct {
|
||||
signed char flags;
|
||||
compat_ulong_t spinup_date;
|
||||
compat_ulong_t select_date;
|
||||
compat_ulong_t first_read_date;
|
||||
short probed_format;
|
||||
short track;
|
||||
short maxblock;
|
||||
short maxtrack;
|
||||
compat_int_t generation;
|
||||
compat_int_t keep_data;
|
||||
compat_int_t fd_ref;
|
||||
compat_int_t fd_device;
|
||||
compat_int_t last_checked;
|
||||
compat_caddr_t dmabuf;
|
||||
compat_int_t bufblocks;
|
||||
};
|
||||
|
||||
struct compat_floppy_fdc_state {
|
||||
compat_int_t spec1;
|
||||
compat_int_t spec2;
|
||||
compat_int_t dtr;
|
||||
unsigned char version;
|
||||
unsigned char dor;
|
||||
compat_ulong_t address;
|
||||
unsigned int rawcmd:2;
|
||||
unsigned int reset:1;
|
||||
unsigned int need_configure:1;
|
||||
unsigned int perp_mode:2;
|
||||
unsigned int has_fifo:1;
|
||||
unsigned int driver_version;
|
||||
unsigned char track[4];
|
||||
};
|
||||
|
||||
struct compat_floppy_write_errors {
|
||||
unsigned int write_errors;
|
||||
compat_ulong_t first_error_sector;
|
||||
compat_int_t first_error_generation;
|
||||
compat_ulong_t last_error_sector;
|
||||
compat_int_t last_error_generation;
|
||||
compat_uint_t badness;
|
||||
};
|
||||
|
||||
#define FDSETPRM32 _IOW(2, 0x42, struct compat_floppy_struct)
|
||||
#define FDDEFPRM32 _IOW(2, 0x43, struct compat_floppy_struct)
|
||||
#define FDSETDRVPRM32 _IOW(2, 0x90, struct compat_floppy_drive_params)
|
||||
#define FDGETDRVPRM32 _IOR(2, 0x11, struct compat_floppy_drive_params)
|
||||
#define FDGETDRVSTAT32 _IOR(2, 0x12, struct compat_floppy_drive_struct)
|
||||
#define FDPOLLDRVSTAT32 _IOR(2, 0x13, struct compat_floppy_drive_struct)
|
||||
#define FDGETFDCSTAT32 _IOR(2, 0x15, struct compat_floppy_fdc_state)
|
||||
#define FDWERRORGET32 _IOR(2, 0x17, struct compat_floppy_write_errors)
|
||||
|
||||
static struct {
|
||||
unsigned int cmd32;
|
||||
unsigned int cmd;
|
||||
} fd_ioctl_trans_table[] = {
|
||||
{ FDSETPRM32, FDSETPRM },
|
||||
{ FDDEFPRM32, FDDEFPRM },
|
||||
{ FDGETPRM32, FDGETPRM },
|
||||
{ FDSETDRVPRM32, FDSETDRVPRM },
|
||||
{ FDGETDRVPRM32, FDGETDRVPRM },
|
||||
{ FDGETDRVSTAT32, FDGETDRVSTAT },
|
||||
{ FDPOLLDRVSTAT32, FDPOLLDRVSTAT },
|
||||
{ FDGETFDCSTAT32, FDGETFDCSTAT },
|
||||
{ FDWERRORGET32, FDWERRORGET }
|
||||
};
|
||||
|
||||
#define NR_FD_IOCTL_TRANS ARRAY_SIZE(fd_ioctl_trans_table)
|
||||
|
||||
static int compat_fd_ioctl(struct block_device *bdev, fmode_t mode,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
mm_segment_t old_fs = get_fs();
|
||||
void *karg = NULL;
|
||||
unsigned int kcmd = 0;
|
||||
int i, err;
|
||||
|
||||
for (i = 0; i < NR_FD_IOCTL_TRANS; i++)
|
||||
if (cmd == fd_ioctl_trans_table[i].cmd32) {
|
||||
kcmd = fd_ioctl_trans_table[i].cmd;
|
||||
break;
|
||||
}
|
||||
if (!kcmd)
|
||||
return -EINVAL;
|
||||
|
||||
switch (cmd) {
|
||||
case FDSETPRM32:
|
||||
case FDDEFPRM32:
|
||||
case FDGETPRM32:
|
||||
{
|
||||
compat_uptr_t name;
|
||||
struct compat_floppy_struct __user *uf;
|
||||
struct floppy_struct *f;
|
||||
|
||||
uf = compat_ptr(arg);
|
||||
f = karg = kmalloc(sizeof(struct floppy_struct), GFP_KERNEL);
|
||||
if (!karg)
|
||||
return -ENOMEM;
|
||||
if (cmd == FDGETPRM32)
|
||||
break;
|
||||
err = __get_user(f->size, &uf->size);
|
||||
err |= __get_user(f->sect, &uf->sect);
|
||||
err |= __get_user(f->head, &uf->head);
|
||||
err |= __get_user(f->track, &uf->track);
|
||||
err |= __get_user(f->stretch, &uf->stretch);
|
||||
err |= __get_user(f->gap, &uf->gap);
|
||||
err |= __get_user(f->rate, &uf->rate);
|
||||
err |= __get_user(f->spec1, &uf->spec1);
|
||||
err |= __get_user(f->fmt_gap, &uf->fmt_gap);
|
||||
err |= __get_user(name, &uf->name);
|
||||
f->name = compat_ptr(name);
|
||||
if (err) {
|
||||
err = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FDSETDRVPRM32:
|
||||
case FDGETDRVPRM32:
|
||||
{
|
||||
struct compat_floppy_drive_params __user *uf;
|
||||
struct floppy_drive_params *f;
|
||||
|
||||
uf = compat_ptr(arg);
|
||||
f = karg = kmalloc(sizeof(struct floppy_drive_params), GFP_KERNEL);
|
||||
if (!karg)
|
||||
return -ENOMEM;
|
||||
if (cmd == FDGETDRVPRM32)
|
||||
break;
|
||||
err = __get_user(f->cmos, &uf->cmos);
|
||||
err |= __get_user(f->max_dtr, &uf->max_dtr);
|
||||
err |= __get_user(f->hlt, &uf->hlt);
|
||||
err |= __get_user(f->hut, &uf->hut);
|
||||
err |= __get_user(f->srt, &uf->srt);
|
||||
err |= __get_user(f->spinup, &uf->spinup);
|
||||
err |= __get_user(f->spindown, &uf->spindown);
|
||||
err |= __get_user(f->spindown_offset, &uf->spindown_offset);
|
||||
err |= __get_user(f->select_delay, &uf->select_delay);
|
||||
err |= __get_user(f->rps, &uf->rps);
|
||||
err |= __get_user(f->tracks, &uf->tracks);
|
||||
err |= __get_user(f->timeout, &uf->timeout);
|
||||
err |= __get_user(f->interleave_sect, &uf->interleave_sect);
|
||||
err |= __copy_from_user(&f->max_errors, &uf->max_errors, sizeof(f->max_errors));
|
||||
err |= __get_user(f->flags, &uf->flags);
|
||||
err |= __get_user(f->read_track, &uf->read_track);
|
||||
err |= __copy_from_user(f->autodetect, uf->autodetect, sizeof(f->autodetect));
|
||||
err |= __get_user(f->checkfreq, &uf->checkfreq);
|
||||
err |= __get_user(f->native_format, &uf->native_format);
|
||||
if (err) {
|
||||
err = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FDGETDRVSTAT32:
|
||||
case FDPOLLDRVSTAT32:
|
||||
karg = kmalloc(sizeof(struct floppy_drive_struct), GFP_KERNEL);
|
||||
if (!karg)
|
||||
return -ENOMEM;
|
||||
break;
|
||||
case FDGETFDCSTAT32:
|
||||
karg = kmalloc(sizeof(struct floppy_fdc_state), GFP_KERNEL);
|
||||
if (!karg)
|
||||
return -ENOMEM;
|
||||
break;
|
||||
case FDWERRORGET32:
|
||||
karg = kmalloc(sizeof(struct floppy_write_errors), GFP_KERNEL);
|
||||
if (!karg)
|
||||
return -ENOMEM;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
set_fs(KERNEL_DS);
|
||||
err = __blkdev_driver_ioctl(bdev, mode, kcmd, (unsigned long)karg);
|
||||
set_fs(old_fs);
|
||||
if (err)
|
||||
goto out;
|
||||
switch (cmd) {
|
||||
case FDGETPRM32:
|
||||
{
|
||||
struct floppy_struct *f = karg;
|
||||
struct compat_floppy_struct __user *uf = compat_ptr(arg);
|
||||
|
||||
err = __put_user(f->size, &uf->size);
|
||||
err |= __put_user(f->sect, &uf->sect);
|
||||
err |= __put_user(f->head, &uf->head);
|
||||
err |= __put_user(f->track, &uf->track);
|
||||
err |= __put_user(f->stretch, &uf->stretch);
|
||||
err |= __put_user(f->gap, &uf->gap);
|
||||
err |= __put_user(f->rate, &uf->rate);
|
||||
err |= __put_user(f->spec1, &uf->spec1);
|
||||
err |= __put_user(f->fmt_gap, &uf->fmt_gap);
|
||||
err |= __put_user((u64)f->name, (compat_caddr_t __user *)&uf->name);
|
||||
break;
|
||||
}
|
||||
case FDGETDRVPRM32:
|
||||
{
|
||||
struct compat_floppy_drive_params __user *uf;
|
||||
struct floppy_drive_params *f = karg;
|
||||
|
||||
uf = compat_ptr(arg);
|
||||
err = __put_user(f->cmos, &uf->cmos);
|
||||
err |= __put_user(f->max_dtr, &uf->max_dtr);
|
||||
err |= __put_user(f->hlt, &uf->hlt);
|
||||
err |= __put_user(f->hut, &uf->hut);
|
||||
err |= __put_user(f->srt, &uf->srt);
|
||||
err |= __put_user(f->spinup, &uf->spinup);
|
||||
err |= __put_user(f->spindown, &uf->spindown);
|
||||
err |= __put_user(f->spindown_offset, &uf->spindown_offset);
|
||||
err |= __put_user(f->select_delay, &uf->select_delay);
|
||||
err |= __put_user(f->rps, &uf->rps);
|
||||
err |= __put_user(f->tracks, &uf->tracks);
|
||||
err |= __put_user(f->timeout, &uf->timeout);
|
||||
err |= __put_user(f->interleave_sect, &uf->interleave_sect);
|
||||
err |= __copy_to_user(&uf->max_errors, &f->max_errors, sizeof(f->max_errors));
|
||||
err |= __put_user(f->flags, &uf->flags);
|
||||
err |= __put_user(f->read_track, &uf->read_track);
|
||||
err |= __copy_to_user(uf->autodetect, f->autodetect, sizeof(f->autodetect));
|
||||
err |= __put_user(f->checkfreq, &uf->checkfreq);
|
||||
err |= __put_user(f->native_format, &uf->native_format);
|
||||
break;
|
||||
}
|
||||
case FDGETDRVSTAT32:
|
||||
case FDPOLLDRVSTAT32:
|
||||
{
|
||||
struct compat_floppy_drive_struct __user *uf;
|
||||
struct floppy_drive_struct *f = karg;
|
||||
|
||||
uf = compat_ptr(arg);
|
||||
err = __put_user(f->flags, &uf->flags);
|
||||
err |= __put_user(f->spinup_date, &uf->spinup_date);
|
||||
err |= __put_user(f->select_date, &uf->select_date);
|
||||
err |= __put_user(f->first_read_date, &uf->first_read_date);
|
||||
err |= __put_user(f->probed_format, &uf->probed_format);
|
||||
err |= __put_user(f->track, &uf->track);
|
||||
err |= __put_user(f->maxblock, &uf->maxblock);
|
||||
err |= __put_user(f->maxtrack, &uf->maxtrack);
|
||||
err |= __put_user(f->generation, &uf->generation);
|
||||
err |= __put_user(f->keep_data, &uf->keep_data);
|
||||
err |= __put_user(f->fd_ref, &uf->fd_ref);
|
||||
err |= __put_user(f->fd_device, &uf->fd_device);
|
||||
err |= __put_user(f->last_checked, &uf->last_checked);
|
||||
err |= __put_user((u64)f->dmabuf, &uf->dmabuf);
|
||||
err |= __put_user((u64)f->bufblocks, &uf->bufblocks);
|
||||
break;
|
||||
}
|
||||
case FDGETFDCSTAT32:
|
||||
{
|
||||
struct compat_floppy_fdc_state __user *uf;
|
||||
struct floppy_fdc_state *f = karg;
|
||||
|
||||
uf = compat_ptr(arg);
|
||||
err = __put_user(f->spec1, &uf->spec1);
|
||||
err |= __put_user(f->spec2, &uf->spec2);
|
||||
err |= __put_user(f->dtr, &uf->dtr);
|
||||
err |= __put_user(f->version, &uf->version);
|
||||
err |= __put_user(f->dor, &uf->dor);
|
||||
err |= __put_user(f->address, &uf->address);
|
||||
err |= __copy_to_user((char __user *)&uf->address + sizeof(uf->address),
|
||||
(char *)&f->address + sizeof(f->address), sizeof(int));
|
||||
err |= __put_user(f->driver_version, &uf->driver_version);
|
||||
err |= __copy_to_user(uf->track, f->track, sizeof(f->track));
|
||||
break;
|
||||
}
|
||||
case FDWERRORGET32:
|
||||
{
|
||||
struct compat_floppy_write_errors __user *uf;
|
||||
struct floppy_write_errors *f = karg;
|
||||
|
||||
uf = compat_ptr(arg);
|
||||
err = __put_user(f->write_errors, &uf->write_errors);
|
||||
err |= __put_user(f->first_error_sector, &uf->first_error_sector);
|
||||
err |= __put_user(f->first_error_generation, &uf->first_error_generation);
|
||||
err |= __put_user(f->last_error_sector, &uf->last_error_sector);
|
||||
err |= __put_user(f->last_error_generation, &uf->last_error_generation);
|
||||
err |= __put_user(f->badness, &uf->badness);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (err)
|
||||
err = -EFAULT;
|
||||
|
||||
out:
|
||||
kfree(karg);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int compat_blkdev_driver_ioctl(struct block_device *bdev, fmode_t mode,
|
||||
unsigned cmd, unsigned long arg)
|
||||
{
|
||||
|
@ -537,16 +224,6 @@ static int compat_blkdev_driver_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
case HDIO_GET_ADDRESS:
|
||||
case HDIO_GET_BUSSTATE:
|
||||
return compat_hdio_ioctl(bdev, mode, cmd, arg);
|
||||
case FDSETPRM32:
|
||||
case FDDEFPRM32:
|
||||
case FDGETPRM32:
|
||||
case FDSETDRVPRM32:
|
||||
case FDGETDRVPRM32:
|
||||
case FDGETDRVSTAT32:
|
||||
case FDPOLLDRVSTAT32:
|
||||
case FDGETFDCSTAT32:
|
||||
case FDWERRORGET32:
|
||||
return compat_fd_ioctl(bdev, mode, cmd, arg);
|
||||
case CDROMREADAUDIO:
|
||||
return compat_cdrom_read_audio(bdev, mode, cmd, arg);
|
||||
case CDROM_SEND_PACKET:
|
||||
|
@ -566,23 +243,6 @@ static int compat_blkdev_driver_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
case HDIO_DRIVE_CMD:
|
||||
/* 0x330 is reserved -- it used to be HDIO_GETGEO_BIG */
|
||||
case 0x330:
|
||||
/* 0x02 -- Floppy ioctls */
|
||||
case FDMSGON:
|
||||
case FDMSGOFF:
|
||||
case FDSETEMSGTRESH:
|
||||
case FDFLUSH:
|
||||
case FDWERRORCLR:
|
||||
case FDSETMAXERRS:
|
||||
case FDGETMAXERRS:
|
||||
case FDGETDRVTYP:
|
||||
case FDEJECT:
|
||||
case FDCLRPRM:
|
||||
case FDFMTBEG:
|
||||
case FDFMTEND:
|
||||
case FDRESET:
|
||||
case FDTWADDLE:
|
||||
case FDFMTTRK:
|
||||
case FDRAWCMD:
|
||||
/* CDROM stuff */
|
||||
case CDROMPAUSE:
|
||||
case CDROMRESUME:
|
||||
|
|
|
@ -34,6 +34,7 @@ static int ghash_setkey(struct crypto_shash *tfm,
|
|||
const u8 *key, unsigned int keylen)
|
||||
{
|
||||
struct ghash_ctx *ctx = crypto_shash_ctx(tfm);
|
||||
be128 k;
|
||||
|
||||
if (keylen != GHASH_BLOCK_SIZE) {
|
||||
crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
|
@ -42,7 +43,12 @@ static int ghash_setkey(struct crypto_shash *tfm,
|
|||
|
||||
if (ctx->gf128)
|
||||
gf128mul_free_4k(ctx->gf128);
|
||||
ctx->gf128 = gf128mul_init_4k_lle((be128 *)key);
|
||||
|
||||
BUILD_BUG_ON(sizeof(k) != GHASH_BLOCK_SIZE);
|
||||
memcpy(&k, key, GHASH_BLOCK_SIZE); /* avoid violating alignment rules */
|
||||
ctx->gf128 = gf128mul_init_4k_lle(&k);
|
||||
memzero_explicit(&k, GHASH_BLOCK_SIZE);
|
||||
|
||||
if (!ctx->gf128)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
@ -3225,7 +3225,8 @@ static void binder_transaction(struct binder_proc *proc,
|
|||
}
|
||||
off_end = (void *)off_start + tr->offsets_size;
|
||||
sg_bufp = (u8 *)(PTR_ALIGN(off_end, sizeof(void *)));
|
||||
sg_buf_end = sg_bufp + extra_buffers_size;
|
||||
sg_buf_end = sg_bufp + extra_buffers_size -
|
||||
ALIGN(secctx_sz, sizeof(u64));
|
||||
off_min = 0;
|
||||
for (; offp < off_end; offp++) {
|
||||
struct binder_object_header *hdr;
|
||||
|
|
|
@ -1358,6 +1358,8 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg,
|
|||
map->format.reg_bytes +
|
||||
map->format.pad_bytes,
|
||||
val, val_len);
|
||||
else
|
||||
ret = -ENOTSUPP;
|
||||
|
||||
/* If that didn't work fall back on linearising by hand. */
|
||||
if (ret == -ENOTSUPP) {
|
||||
|
|
|
@ -192,6 +192,7 @@ static int print_unex = 1;
|
|||
#include <linux/io.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/async.h>
|
||||
#include <linux/compat.h>
|
||||
|
||||
/*
|
||||
* PS/2 floppies have much slower step rates than regular floppies.
|
||||
|
@ -2113,6 +2114,9 @@ static void setup_format_params(int track)
|
|||
raw_cmd->kernel_data = floppy_track_buffer;
|
||||
raw_cmd->length = 4 * F_SECT_PER_TRACK;
|
||||
|
||||
if (!F_SECT_PER_TRACK)
|
||||
return;
|
||||
|
||||
/* allow for about 30ms for data transport per track */
|
||||
head_shift = (F_SECT_PER_TRACK + 5) / 6;
|
||||
|
||||
|
@ -3233,8 +3237,12 @@ static int set_geometry(unsigned int cmd, struct floppy_struct *g,
|
|||
int cnt;
|
||||
|
||||
/* sanity checking for parameters. */
|
||||
if (g->sect <= 0 ||
|
||||
g->head <= 0 ||
|
||||
if ((int)g->sect <= 0 ||
|
||||
(int)g->head <= 0 ||
|
||||
/* check for overflow in max_sector */
|
||||
(int)(g->sect * g->head) <= 0 ||
|
||||
/* check for zero in F_SECT_PER_TRACK */
|
||||
(unsigned char)((g->sect << 2) >> FD_SIZECODE(g)) == 0 ||
|
||||
g->track <= 0 || g->track > UDP->tracks >> STRETCH(g) ||
|
||||
/* check if reserved bits are set */
|
||||
(g->stretch & ~(FD_STRETCH | FD_SWAPSIDES | FD_SECTBASEMASK)) != 0)
|
||||
|
@ -3378,6 +3386,24 @@ static int fd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static bool valid_floppy_drive_params(const short autodetect[8],
|
||||
int native_format)
|
||||
{
|
||||
size_t floppy_type_size = ARRAY_SIZE(floppy_type);
|
||||
size_t i = 0;
|
||||
|
||||
for (i = 0; i < 8; ++i) {
|
||||
if (autodetect[i] < 0 ||
|
||||
autodetect[i] >= floppy_type_size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (native_format < 0 || native_format >= floppy_type_size)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
|
||||
unsigned long param)
|
||||
{
|
||||
|
@ -3504,6 +3530,9 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
|
|||
SUPBOUND(size, strlen((const char *)outparam) + 1);
|
||||
break;
|
||||
case FDSETDRVPRM:
|
||||
if (!valid_floppy_drive_params(inparam.dp.autodetect,
|
||||
inparam.dp.native_format))
|
||||
return -EINVAL;
|
||||
*UDP = inparam.dp;
|
||||
break;
|
||||
case FDGETDRVPRM:
|
||||
|
@ -3569,6 +3598,332 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
|
||||
struct compat_floppy_drive_params {
|
||||
char cmos;
|
||||
compat_ulong_t max_dtr;
|
||||
compat_ulong_t hlt;
|
||||
compat_ulong_t hut;
|
||||
compat_ulong_t srt;
|
||||
compat_ulong_t spinup;
|
||||
compat_ulong_t spindown;
|
||||
unsigned char spindown_offset;
|
||||
unsigned char select_delay;
|
||||
unsigned char rps;
|
||||
unsigned char tracks;
|
||||
compat_ulong_t timeout;
|
||||
unsigned char interleave_sect;
|
||||
struct floppy_max_errors max_errors;
|
||||
char flags;
|
||||
char read_track;
|
||||
short autodetect[8];
|
||||
compat_int_t checkfreq;
|
||||
compat_int_t native_format;
|
||||
};
|
||||
|
||||
struct compat_floppy_drive_struct {
|
||||
signed char flags;
|
||||
compat_ulong_t spinup_date;
|
||||
compat_ulong_t select_date;
|
||||
compat_ulong_t first_read_date;
|
||||
short probed_format;
|
||||
short track;
|
||||
short maxblock;
|
||||
short maxtrack;
|
||||
compat_int_t generation;
|
||||
compat_int_t keep_data;
|
||||
compat_int_t fd_ref;
|
||||
compat_int_t fd_device;
|
||||
compat_int_t last_checked;
|
||||
compat_caddr_t dmabuf;
|
||||
compat_int_t bufblocks;
|
||||
};
|
||||
|
||||
struct compat_floppy_fdc_state {
|
||||
compat_int_t spec1;
|
||||
compat_int_t spec2;
|
||||
compat_int_t dtr;
|
||||
unsigned char version;
|
||||
unsigned char dor;
|
||||
compat_ulong_t address;
|
||||
unsigned int rawcmd:2;
|
||||
unsigned int reset:1;
|
||||
unsigned int need_configure:1;
|
||||
unsigned int perp_mode:2;
|
||||
unsigned int has_fifo:1;
|
||||
unsigned int driver_version;
|
||||
unsigned char track[4];
|
||||
};
|
||||
|
||||
struct compat_floppy_write_errors {
|
||||
unsigned int write_errors;
|
||||
compat_ulong_t first_error_sector;
|
||||
compat_int_t first_error_generation;
|
||||
compat_ulong_t last_error_sector;
|
||||
compat_int_t last_error_generation;
|
||||
compat_uint_t badness;
|
||||
};
|
||||
|
||||
#define FDSETPRM32 _IOW(2, 0x42, struct compat_floppy_struct)
|
||||
#define FDDEFPRM32 _IOW(2, 0x43, struct compat_floppy_struct)
|
||||
#define FDSETDRVPRM32 _IOW(2, 0x90, struct compat_floppy_drive_params)
|
||||
#define FDGETDRVPRM32 _IOR(2, 0x11, struct compat_floppy_drive_params)
|
||||
#define FDGETDRVSTAT32 _IOR(2, 0x12, struct compat_floppy_drive_struct)
|
||||
#define FDPOLLDRVSTAT32 _IOR(2, 0x13, struct compat_floppy_drive_struct)
|
||||
#define FDGETFDCSTAT32 _IOR(2, 0x15, struct compat_floppy_fdc_state)
|
||||
#define FDWERRORGET32 _IOR(2, 0x17, struct compat_floppy_write_errors)
|
||||
|
||||
static int compat_set_geometry(struct block_device *bdev, fmode_t mode, unsigned int cmd,
|
||||
struct compat_floppy_struct __user *arg)
|
||||
{
|
||||
struct floppy_struct v;
|
||||
int drive, type;
|
||||
int err;
|
||||
|
||||
BUILD_BUG_ON(offsetof(struct floppy_struct, name) !=
|
||||
offsetof(struct compat_floppy_struct, name));
|
||||
|
||||
if (!(mode & (FMODE_WRITE | FMODE_WRITE_IOCTL)))
|
||||
return -EPERM;
|
||||
|
||||
memset(&v, 0, sizeof(struct floppy_struct));
|
||||
if (copy_from_user(&v, arg, offsetof(struct floppy_struct, name)))
|
||||
return -EFAULT;
|
||||
|
||||
mutex_lock(&floppy_mutex);
|
||||
drive = (long)bdev->bd_disk->private_data;
|
||||
type = ITYPE(UDRS->fd_device);
|
||||
err = set_geometry(cmd == FDSETPRM32 ? FDSETPRM : FDDEFPRM,
|
||||
&v, drive, type, bdev);
|
||||
mutex_unlock(&floppy_mutex);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int compat_get_prm(int drive,
|
||||
struct compat_floppy_struct __user *arg)
|
||||
{
|
||||
struct compat_floppy_struct v;
|
||||
struct floppy_struct *p;
|
||||
int err;
|
||||
|
||||
memset(&v, 0, sizeof(v));
|
||||
mutex_lock(&floppy_mutex);
|
||||
err = get_floppy_geometry(drive, ITYPE(UDRS->fd_device), &p);
|
||||
if (err) {
|
||||
mutex_unlock(&floppy_mutex);
|
||||
return err;
|
||||
}
|
||||
memcpy(&v, p, offsetof(struct floppy_struct, name));
|
||||
mutex_unlock(&floppy_mutex);
|
||||
if (copy_to_user(arg, &v, sizeof(struct compat_floppy_struct)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int compat_setdrvprm(int drive,
|
||||
struct compat_floppy_drive_params __user *arg)
|
||||
{
|
||||
struct compat_floppy_drive_params v;
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return -EPERM;
|
||||
if (copy_from_user(&v, arg, sizeof(struct compat_floppy_drive_params)))
|
||||
return -EFAULT;
|
||||
if (!valid_floppy_drive_params(v.autodetect, v.native_format))
|
||||
return -EINVAL;
|
||||
mutex_lock(&floppy_mutex);
|
||||
UDP->cmos = v.cmos;
|
||||
UDP->max_dtr = v.max_dtr;
|
||||
UDP->hlt = v.hlt;
|
||||
UDP->hut = v.hut;
|
||||
UDP->srt = v.srt;
|
||||
UDP->spinup = v.spinup;
|
||||
UDP->spindown = v.spindown;
|
||||
UDP->spindown_offset = v.spindown_offset;
|
||||
UDP->select_delay = v.select_delay;
|
||||
UDP->rps = v.rps;
|
||||
UDP->tracks = v.tracks;
|
||||
UDP->timeout = v.timeout;
|
||||
UDP->interleave_sect = v.interleave_sect;
|
||||
UDP->max_errors = v.max_errors;
|
||||
UDP->flags = v.flags;
|
||||
UDP->read_track = v.read_track;
|
||||
memcpy(UDP->autodetect, v.autodetect, sizeof(v.autodetect));
|
||||
UDP->checkfreq = v.checkfreq;
|
||||
UDP->native_format = v.native_format;
|
||||
mutex_unlock(&floppy_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int compat_getdrvprm(int drive,
|
||||
struct compat_floppy_drive_params __user *arg)
|
||||
{
|
||||
struct compat_floppy_drive_params v;
|
||||
|
||||
memset(&v, 0, sizeof(struct compat_floppy_drive_params));
|
||||
mutex_lock(&floppy_mutex);
|
||||
v.cmos = UDP->cmos;
|
||||
v.max_dtr = UDP->max_dtr;
|
||||
v.hlt = UDP->hlt;
|
||||
v.hut = UDP->hut;
|
||||
v.srt = UDP->srt;
|
||||
v.spinup = UDP->spinup;
|
||||
v.spindown = UDP->spindown;
|
||||
v.spindown_offset = UDP->spindown_offset;
|
||||
v.select_delay = UDP->select_delay;
|
||||
v.rps = UDP->rps;
|
||||
v.tracks = UDP->tracks;
|
||||
v.timeout = UDP->timeout;
|
||||
v.interleave_sect = UDP->interleave_sect;
|
||||
v.max_errors = UDP->max_errors;
|
||||
v.flags = UDP->flags;
|
||||
v.read_track = UDP->read_track;
|
||||
memcpy(v.autodetect, UDP->autodetect, sizeof(v.autodetect));
|
||||
v.checkfreq = UDP->checkfreq;
|
||||
v.native_format = UDP->native_format;
|
||||
mutex_unlock(&floppy_mutex);
|
||||
|
||||
if (copy_from_user(arg, &v, sizeof(struct compat_floppy_drive_params)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int compat_getdrvstat(int drive, bool poll,
|
||||
struct compat_floppy_drive_struct __user *arg)
|
||||
{
|
||||
struct compat_floppy_drive_struct v;
|
||||
|
||||
memset(&v, 0, sizeof(struct compat_floppy_drive_struct));
|
||||
mutex_lock(&floppy_mutex);
|
||||
|
||||
if (poll) {
|
||||
if (lock_fdc(drive, true))
|
||||
goto Eintr;
|
||||
if (poll_drive(true, FD_RAW_NEED_DISK) == -EINTR)
|
||||
goto Eintr;
|
||||
process_fd_request();
|
||||
}
|
||||
v.spinup_date = UDRS->spinup_date;
|
||||
v.select_date = UDRS->select_date;
|
||||
v.first_read_date = UDRS->first_read_date;
|
||||
v.probed_format = UDRS->probed_format;
|
||||
v.track = UDRS->track;
|
||||
v.maxblock = UDRS->maxblock;
|
||||
v.maxtrack = UDRS->maxtrack;
|
||||
v.generation = UDRS->generation;
|
||||
v.keep_data = UDRS->keep_data;
|
||||
v.fd_ref = UDRS->fd_ref;
|
||||
v.fd_device = UDRS->fd_device;
|
||||
v.last_checked = UDRS->last_checked;
|
||||
v.dmabuf = (uintptr_t)UDRS->dmabuf;
|
||||
v.bufblocks = UDRS->bufblocks;
|
||||
mutex_unlock(&floppy_mutex);
|
||||
|
||||
if (copy_from_user(arg, &v, sizeof(struct compat_floppy_drive_struct)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
Eintr:
|
||||
mutex_unlock(&floppy_mutex);
|
||||
return -EINTR;
|
||||
}
|
||||
|
||||
static int compat_getfdcstat(int drive,
|
||||
struct compat_floppy_fdc_state __user *arg)
|
||||
{
|
||||
struct compat_floppy_fdc_state v32;
|
||||
struct floppy_fdc_state v;
|
||||
|
||||
mutex_lock(&floppy_mutex);
|
||||
v = *UFDCS;
|
||||
mutex_unlock(&floppy_mutex);
|
||||
|
||||
memset(&v32, 0, sizeof(struct compat_floppy_fdc_state));
|
||||
v32.spec1 = v.spec1;
|
||||
v32.spec2 = v.spec2;
|
||||
v32.dtr = v.dtr;
|
||||
v32.version = v.version;
|
||||
v32.dor = v.dor;
|
||||
v32.address = v.address;
|
||||
v32.rawcmd = v.rawcmd;
|
||||
v32.reset = v.reset;
|
||||
v32.need_configure = v.need_configure;
|
||||
v32.perp_mode = v.perp_mode;
|
||||
v32.has_fifo = v.has_fifo;
|
||||
v32.driver_version = v.driver_version;
|
||||
memcpy(v32.track, v.track, 4);
|
||||
if (copy_to_user(arg, &v32, sizeof(struct compat_floppy_fdc_state)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int compat_werrorget(int drive,
|
||||
struct compat_floppy_write_errors __user *arg)
|
||||
{
|
||||
struct compat_floppy_write_errors v32;
|
||||
struct floppy_write_errors v;
|
||||
|
||||
memset(&v32, 0, sizeof(struct compat_floppy_write_errors));
|
||||
mutex_lock(&floppy_mutex);
|
||||
v = *UDRWE;
|
||||
mutex_unlock(&floppy_mutex);
|
||||
v32.write_errors = v.write_errors;
|
||||
v32.first_error_sector = v.first_error_sector;
|
||||
v32.first_error_generation = v.first_error_generation;
|
||||
v32.last_error_sector = v.last_error_sector;
|
||||
v32.last_error_generation = v.last_error_generation;
|
||||
v32.badness = v.badness;
|
||||
if (copy_to_user(arg, &v32, sizeof(struct compat_floppy_write_errors)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fd_compat_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
|
||||
unsigned long param)
|
||||
{
|
||||
int drive = (long)bdev->bd_disk->private_data;
|
||||
switch (cmd) {
|
||||
case FDMSGON:
|
||||
case FDMSGOFF:
|
||||
case FDSETEMSGTRESH:
|
||||
case FDFLUSH:
|
||||
case FDWERRORCLR:
|
||||
case FDEJECT:
|
||||
case FDCLRPRM:
|
||||
case FDFMTBEG:
|
||||
case FDRESET:
|
||||
case FDTWADDLE:
|
||||
return fd_ioctl(bdev, mode, cmd, param);
|
||||
case FDSETMAXERRS:
|
||||
case FDGETMAXERRS:
|
||||
case FDGETDRVTYP:
|
||||
case FDFMTEND:
|
||||
case FDFMTTRK:
|
||||
case FDRAWCMD:
|
||||
return fd_ioctl(bdev, mode, cmd,
|
||||
(unsigned long)compat_ptr(param));
|
||||
case FDSETPRM32:
|
||||
case FDDEFPRM32:
|
||||
return compat_set_geometry(bdev, mode, cmd, compat_ptr(param));
|
||||
case FDGETPRM32:
|
||||
return compat_get_prm(drive, compat_ptr(param));
|
||||
case FDSETDRVPRM32:
|
||||
return compat_setdrvprm(drive, compat_ptr(param));
|
||||
case FDGETDRVPRM32:
|
||||
return compat_getdrvprm(drive, compat_ptr(param));
|
||||
case FDPOLLDRVSTAT32:
|
||||
return compat_getdrvstat(drive, true, compat_ptr(param));
|
||||
case FDGETDRVSTAT32:
|
||||
return compat_getdrvstat(drive, false, compat_ptr(param));
|
||||
case FDGETFDCSTAT32:
|
||||
return compat_getfdcstat(drive, compat_ptr(param));
|
||||
case FDWERRORGET32:
|
||||
return compat_werrorget(drive, compat_ptr(param));
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void __init config_types(void)
|
||||
{
|
||||
bool has_drive = false;
|
||||
|
@ -3885,6 +4240,9 @@ static const struct block_device_operations floppy_fops = {
|
|||
.getgeo = fd_getgeo,
|
||||
.check_events = floppy_check_events,
|
||||
.revalidate_disk = floppy_revalidate,
|
||||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = fd_compat_ioctl,
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -101,6 +101,9 @@ static int ath_open(struct hci_uart *hu)
|
|||
|
||||
BT_DBG("hu %p", hu);
|
||||
|
||||
if (!hci_uart_has_flow_control(hu))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
ath = kzalloc(sizeof(*ath), GFP_KERNEL);
|
||||
if (!ath)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -279,6 +279,9 @@ static int bcm_open(struct hci_uart *hu)
|
|||
|
||||
bt_dev_dbg(hu->hdev, "hu %p", hu);
|
||||
|
||||
if (!hci_uart_has_flow_control(hu))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
bcm = kzalloc(sizeof(*bcm), GFP_KERNEL);
|
||||
if (!bcm)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -729,6 +729,11 @@ static int bcsp_close(struct hci_uart *hu)
|
|||
skb_queue_purge(&bcsp->rel);
|
||||
skb_queue_purge(&bcsp->unrel);
|
||||
|
||||
if (bcsp->rx_skb) {
|
||||
kfree_skb(bcsp->rx_skb);
|
||||
bcsp->rx_skb = NULL;
|
||||
}
|
||||
|
||||
kfree(bcsp);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -407,6 +407,9 @@ static int intel_open(struct hci_uart *hu)
|
|||
|
||||
BT_DBG("hu %p", hu);
|
||||
|
||||
if (!hci_uart_has_flow_control(hu))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
intel = kzalloc(sizeof(*intel), GFP_KERNEL);
|
||||
if (!intel)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -276,6 +276,15 @@ static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Check the underlying device or tty has flow control support */
|
||||
bool hci_uart_has_flow_control(struct hci_uart *hu)
|
||||
{
|
||||
if (hu->tty->driver->ops->tiocmget && hu->tty->driver->ops->tiocmset)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Flow control or un-flow control the device */
|
||||
void hci_uart_set_flow_control(struct hci_uart *hu, bool enable)
|
||||
{
|
||||
|
|
|
@ -106,6 +106,7 @@ int hci_uart_tx_wakeup(struct hci_uart *hu);
|
|||
int hci_uart_init_ready(struct hci_uart *hu);
|
||||
void hci_uart_init_tty(struct hci_uart *hu);
|
||||
void hci_uart_set_baudrate(struct hci_uart *hu, unsigned int speed);
|
||||
bool hci_uart_has_flow_control(struct hci_uart *hu);
|
||||
void hci_uart_set_flow_control(struct hci_uart *hu, bool enable);
|
||||
void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed,
|
||||
unsigned int oper_speed);
|
||||
|
|
|
@ -569,8 +569,7 @@ static inline unsigned long hpet_time_div(struct hpets *hpets,
|
|||
unsigned long long m;
|
||||
|
||||
m = hpets->hp_tick_freq + (dis >> 1);
|
||||
do_div(m, dis);
|
||||
return (unsigned long)m;
|
||||
return div64_ul(m, dis);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -1446,11 +1446,15 @@ static void ablkcipher_done(struct device *dev,
|
|||
int err)
|
||||
{
|
||||
struct ablkcipher_request *areq = context;
|
||||
struct crypto_ablkcipher *cipher = crypto_ablkcipher_reqtfm(areq);
|
||||
struct talitos_ctx *ctx = crypto_ablkcipher_ctx(cipher);
|
||||
unsigned int ivsize = crypto_ablkcipher_ivsize(cipher);
|
||||
struct talitos_edesc *edesc;
|
||||
|
||||
edesc = container_of(desc, struct talitos_edesc, desc);
|
||||
|
||||
common_nonsnoop_unmap(dev, edesc, areq);
|
||||
memcpy(areq->info, ctx->iv, ivsize);
|
||||
|
||||
kfree(edesc);
|
||||
|
||||
|
|
|
@ -1786,27 +1786,6 @@ static int sdma_probe(struct platform_device *pdev)
|
|||
if (pdata && pdata->script_addrs)
|
||||
sdma_add_scripts(sdma, pdata->script_addrs);
|
||||
|
||||
if (pdata) {
|
||||
ret = sdma_get_firmware(sdma, pdata->fw_name);
|
||||
if (ret)
|
||||
dev_warn(&pdev->dev, "failed to get firmware from platform data\n");
|
||||
} else {
|
||||
/*
|
||||
* Because that device tree does not encode ROM script address,
|
||||
* the RAM script in firmware is mandatory for device tree
|
||||
* probe, otherwise it fails.
|
||||
*/
|
||||
ret = of_property_read_string(np, "fsl,sdma-ram-script-name",
|
||||
&fw_name);
|
||||
if (ret)
|
||||
dev_warn(&pdev->dev, "failed to get firmware name\n");
|
||||
else {
|
||||
ret = sdma_get_firmware(sdma, fw_name);
|
||||
if (ret)
|
||||
dev_warn(&pdev->dev, "failed to get firmware from device tree\n");
|
||||
}
|
||||
}
|
||||
|
||||
sdma->dma_device.dev = &pdev->dev;
|
||||
|
||||
sdma->dma_device.device_alloc_chan_resources = sdma_alloc_chan_resources;
|
||||
|
@ -1848,6 +1827,33 @@ static int sdma_probe(struct platform_device *pdev)
|
|||
of_node_put(spba_bus);
|
||||
}
|
||||
|
||||
/*
|
||||
* Kick off firmware loading as the very last step:
|
||||
* attempt to load firmware only if we're not on the error path, because
|
||||
* the firmware callback requires a fully functional and allocated sdma
|
||||
* instance.
|
||||
*/
|
||||
if (pdata) {
|
||||
ret = sdma_get_firmware(sdma, pdata->fw_name);
|
||||
if (ret)
|
||||
dev_warn(&pdev->dev, "failed to get firmware from platform data\n");
|
||||
} else {
|
||||
/*
|
||||
* Because that device tree does not encode ROM script address,
|
||||
* the RAM script in firmware is mandatory for device tree
|
||||
* probe, otherwise it fails.
|
||||
*/
|
||||
ret = of_property_read_string(np, "fsl,sdma-ram-script-name",
|
||||
&fw_name);
|
||||
if (ret) {
|
||||
dev_warn(&pdev->dev, "failed to get firmware name\n");
|
||||
} else {
|
||||
ret = sdma_get_firmware(sdma, fw_name);
|
||||
if (ret)
|
||||
dev_warn(&pdev->dev, "failed to get firmware from device tree\n");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_register:
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
static int edac_mc_log_ue = 1;
|
||||
static int edac_mc_log_ce = 1;
|
||||
static int edac_mc_panic_on_ue;
|
||||
static int edac_mc_poll_msec = 1000;
|
||||
static unsigned int edac_mc_poll_msec = 1000;
|
||||
|
||||
/* Getter functions for above */
|
||||
int edac_mc_get_log_ue(void)
|
||||
|
@ -45,30 +45,30 @@ int edac_mc_get_panic_on_ue(void)
|
|||
}
|
||||
|
||||
/* this is temporary */
|
||||
int edac_mc_get_poll_msec(void)
|
||||
unsigned int edac_mc_get_poll_msec(void)
|
||||
{
|
||||
return edac_mc_poll_msec;
|
||||
}
|
||||
|
||||
static int edac_set_poll_msec(const char *val, struct kernel_param *kp)
|
||||
{
|
||||
unsigned long l;
|
||||
unsigned int i;
|
||||
int ret;
|
||||
|
||||
if (!val)
|
||||
return -EINVAL;
|
||||
|
||||
ret = kstrtoul(val, 0, &l);
|
||||
ret = kstrtouint(val, 0, &i);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (l < 1000)
|
||||
if (i < 1000)
|
||||
return -EINVAL;
|
||||
|
||||
*((unsigned long *)kp->arg) = l;
|
||||
*((unsigned int *)kp->arg) = i;
|
||||
|
||||
/* notify edac_mc engine to reset the poll period */
|
||||
edac_mc_reset_delay_period(l);
|
||||
edac_mc_reset_delay_period(i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ MODULE_PARM_DESC(edac_mc_log_ue,
|
|||
module_param(edac_mc_log_ce, int, 0644);
|
||||
MODULE_PARM_DESC(edac_mc_log_ce,
|
||||
"Log correctable error to console: 0=off 1=on");
|
||||
module_param_call(edac_mc_poll_msec, edac_set_poll_msec, param_get_int,
|
||||
module_param_call(edac_mc_poll_msec, edac_set_poll_msec, param_get_uint,
|
||||
&edac_mc_poll_msec, 0644);
|
||||
MODULE_PARM_DESC(edac_mc_poll_msec, "Polling period in milliseconds");
|
||||
|
||||
|
@ -426,6 +426,8 @@ static inline int nr_pages_per_csrow(struct csrow_info *csrow)
|
|||
static int edac_create_csrow_object(struct mem_ctl_info *mci,
|
||||
struct csrow_info *csrow, int index)
|
||||
{
|
||||
int err;
|
||||
|
||||
csrow->dev.type = &csrow_attr_type;
|
||||
csrow->dev.bus = mci->bus;
|
||||
csrow->dev.groups = csrow_dev_groups;
|
||||
|
@ -438,7 +440,11 @@ static int edac_create_csrow_object(struct mem_ctl_info *mci,
|
|||
edac_dbg(0, "creating (virtual) csrow node %s\n",
|
||||
dev_name(&csrow->dev));
|
||||
|
||||
return device_add(&csrow->dev);
|
||||
err = device_add(&csrow->dev);
|
||||
if (err)
|
||||
put_device(&csrow->dev);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Create a CSROW object under specifed edac_mc_device */
|
||||
|
|
|
@ -33,7 +33,7 @@ extern int edac_mc_get_log_ue(void);
|
|||
extern int edac_mc_get_log_ce(void);
|
||||
extern int edac_mc_get_panic_on_ue(void);
|
||||
extern int edac_get_poll_msec(void);
|
||||
extern int edac_mc_get_poll_msec(void);
|
||||
extern unsigned int edac_mc_get_poll_msec(void);
|
||||
|
||||
unsigned edac_dimm_info_location(struct dimm_info *dimm, char *buf,
|
||||
unsigned len);
|
||||
|
|
|
@ -821,9 +821,9 @@ static void omap_gpio_irq_shutdown(struct irq_data *d)
|
|||
|
||||
raw_spin_lock_irqsave(&bank->lock, flags);
|
||||
bank->irq_usage &= ~(BIT(offset));
|
||||
omap_set_gpio_irqenable(bank, offset, 0);
|
||||
omap_clear_gpio_irqstatus(bank, offset);
|
||||
omap_set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
|
||||
omap_clear_gpio_irqstatus(bank, offset);
|
||||
omap_set_gpio_irqenable(bank, offset, 0);
|
||||
if (!LINE_USED(bank->mod_usage, offset))
|
||||
omap_clear_gpio_debounce(bank, offset);
|
||||
omap_disable_gpio_module(bank, offset);
|
||||
|
@ -865,8 +865,8 @@ static void omap_gpio_mask_irq(struct irq_data *d)
|
|||
unsigned long flags;
|
||||
|
||||
raw_spin_lock_irqsave(&bank->lock, flags);
|
||||
omap_set_gpio_irqenable(bank, offset, 0);
|
||||
omap_set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
|
||||
omap_set_gpio_irqenable(bank, offset, 0);
|
||||
raw_spin_unlock_irqrestore(&bank->lock, flags);
|
||||
}
|
||||
|
||||
|
@ -878,9 +878,6 @@ static void omap_gpio_unmask_irq(struct irq_data *d)
|
|||
unsigned long flags;
|
||||
|
||||
raw_spin_lock_irqsave(&bank->lock, flags);
|
||||
if (trigger)
|
||||
omap_set_gpio_triggering(bank, offset, trigger);
|
||||
|
||||
omap_set_gpio_irqenable(bank, offset, 1);
|
||||
|
||||
/*
|
||||
|
@ -888,9 +885,13 @@ static void omap_gpio_unmask_irq(struct irq_data *d)
|
|||
* is cleared, thus after the handler has run. OMAP4 needs this done
|
||||
* after enabing the interrupt to clear the wakeup status.
|
||||
*/
|
||||
if (bank->level_mask & BIT(offset))
|
||||
if (bank->regs->leveldetect0 && bank->regs->wkup_en &&
|
||||
trigger & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
|
||||
omap_clear_gpio_irqstatus(bank, offset);
|
||||
|
||||
if (trigger)
|
||||
omap_set_gpio_triggering(bank, offset, trigger);
|
||||
|
||||
raw_spin_unlock_irqrestore(&bank->lock, flags);
|
||||
}
|
||||
|
||||
|
@ -1611,6 +1612,8 @@ static struct omap_gpio_reg_offs omap4_gpio_regs = {
|
|||
.clr_dataout = OMAP4_GPIO_CLEARDATAOUT,
|
||||
.irqstatus = OMAP4_GPIO_IRQSTATUS0,
|
||||
.irqstatus2 = OMAP4_GPIO_IRQSTATUS1,
|
||||
.irqstatus_raw0 = OMAP4_GPIO_IRQSTATUSRAW0,
|
||||
.irqstatus_raw1 = OMAP4_GPIO_IRQSTATUSRAW1,
|
||||
.irqenable = OMAP4_GPIO_IRQSTATUSSET0,
|
||||
.irqenable2 = OMAP4_GPIO_IRQSTATUSSET1,
|
||||
.set_irqenable = OMAP4_GPIO_IRQSTATUSSET0,
|
||||
|
|
|
@ -184,6 +184,25 @@ nvkm_i2c_fini(struct nvkm_subdev *subdev, bool suspend)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nvkm_i2c_preinit(struct nvkm_subdev *subdev)
|
||||
{
|
||||
struct nvkm_i2c *i2c = nvkm_i2c(subdev);
|
||||
struct nvkm_i2c_bus *bus;
|
||||
struct nvkm_i2c_pad *pad;
|
||||
|
||||
/*
|
||||
* We init our i2c busses as early as possible, since they may be
|
||||
* needed by the vbios init scripts on some cards
|
||||
*/
|
||||
list_for_each_entry(pad, &i2c->pad, head)
|
||||
nvkm_i2c_pad_init(pad);
|
||||
list_for_each_entry(bus, &i2c->bus, head)
|
||||
nvkm_i2c_bus_init(bus);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nvkm_i2c_init(struct nvkm_subdev *subdev)
|
||||
{
|
||||
|
@ -238,6 +257,7 @@ nvkm_i2c_dtor(struct nvkm_subdev *subdev)
|
|||
static const struct nvkm_subdev_func
|
||||
nvkm_i2c = {
|
||||
.dtor = nvkm_i2c_dtor,
|
||||
.preinit = nvkm_i2c_preinit,
|
||||
.init = nvkm_i2c_init,
|
||||
.fini = nvkm_i2c_fini,
|
||||
.intr = nvkm_i2c_intr,
|
||||
|
|
|
@ -1389,7 +1389,14 @@ static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
|
|||
dsi->format = desc->format;
|
||||
dsi->lanes = desc->lanes;
|
||||
|
||||
return mipi_dsi_attach(dsi);
|
||||
err = mipi_dsi_attach(dsi);
|
||||
if (err) {
|
||||
struct panel_simple *panel = dev_get_drvdata(&dsi->dev);
|
||||
|
||||
drm_panel_remove(&panel->base);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
|
||||
|
|
|
@ -535,6 +535,9 @@ static int virtio_gpu_get_caps_ioctl(struct drm_device *dev,
|
|||
ret = wait_event_timeout(vgdev->resp_wq,
|
||||
atomic_read(&cache_ent->is_valid), 5 * HZ);
|
||||
|
||||
/* is_valid check must proceed before copy of the cache entry. */
|
||||
smp_rmb();
|
||||
|
||||
ptr = cache_ent->caps_cache;
|
||||
|
||||
copy_exit:
|
||||
|
|
|
@ -618,6 +618,8 @@ static void virtio_gpu_cmd_capset_cb(struct virtio_gpu_device *vgdev,
|
|||
cache_ent->id == le32_to_cpu(cmd->capset_id)) {
|
||||
memcpy(cache_ent->caps_cache, resp->capset_data,
|
||||
cache_ent->size);
|
||||
/* Copy must occur before is_valid is signalled. */
|
||||
smp_wmb();
|
||||
atomic_set(&cache_ent->is_valid, 1);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ static int init_csc(struct ipu_ic *ic,
|
|||
writel(param, base++);
|
||||
|
||||
param = ((a[0] & 0x1fe0) >> 5) | (params->scale << 8) |
|
||||
(params->sat << 9);
|
||||
(params->sat << 10);
|
||||
writel(param, base++);
|
||||
|
||||
param = ((a[1] & 0x1f) << 27) | ((c[0][1] & 0x1ff) << 18) |
|
||||
|
|
|
@ -625,7 +625,7 @@ static int msc_buffer_contig_alloc(struct msc *msc, unsigned long size)
|
|||
goto err_out;
|
||||
|
||||
ret = -ENOMEM;
|
||||
page = alloc_pages(GFP_KERNEL | __GFP_ZERO, order);
|
||||
page = alloc_pages(GFP_KERNEL | __GFP_ZERO | GFP_DMA32, order);
|
||||
if (!page)
|
||||
goto err_free_sgt;
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@ Scott Hill shill@gtcocalcomp.com
|
|||
|
||||
/* Max size of a single report */
|
||||
#define REPORT_MAX_SIZE 10
|
||||
#define MAX_COLLECTION_LEVELS 10
|
||||
|
||||
|
||||
/* Bitmask whether pen is in range */
|
||||
|
@ -224,8 +225,7 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
|
|||
char maintype = 'x';
|
||||
char globtype[12];
|
||||
int indent = 0;
|
||||
char indentstr[10] = "";
|
||||
|
||||
char indentstr[MAX_COLLECTION_LEVELS + 1] = { 0 };
|
||||
|
||||
dev_dbg(ddev, "======>>>>>>PARSE<<<<<<======\n");
|
||||
|
||||
|
@ -351,6 +351,13 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
|
|||
case TAG_MAIN_COL_START:
|
||||
maintype = 'S';
|
||||
|
||||
if (indent == MAX_COLLECTION_LEVELS) {
|
||||
dev_err(ddev, "Collection level %d would exceed limit of %d\n",
|
||||
indent + 1,
|
||||
MAX_COLLECTION_LEVELS);
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == 0) {
|
||||
dev_dbg(ddev, "======>>>>>> Physical\n");
|
||||
strcpy(globtype, "Physical");
|
||||
|
@ -370,8 +377,15 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report,
|
|||
break;
|
||||
|
||||
case TAG_MAIN_COL_END:
|
||||
dev_dbg(ddev, "<<<<<<======\n");
|
||||
maintype = 'E';
|
||||
|
||||
if (indent == 0) {
|
||||
dev_err(ddev, "Collection level already at zero\n");
|
||||
break;
|
||||
}
|
||||
|
||||
dev_dbg(ddev, "<<<<<<======\n");
|
||||
|
||||
indent--;
|
||||
for (x = 0; x < indent; x++)
|
||||
indentstr[x] = '-';
|
||||
|
|
|
@ -1963,6 +1963,9 @@ hfcsusb_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
|||
|
||||
/* get endpoint base */
|
||||
idx = ((ep_addr & 0x7f) - 1) * 2;
|
||||
if (idx > 15)
|
||||
return -EIO;
|
||||
|
||||
if (ep_addr & 0x80)
|
||||
idx++;
|
||||
attr = ep->desc.bmAttributes;
|
||||
|
|
|
@ -389,11 +389,13 @@ struct mbox_chan *mbox_request_channel_byname(struct mbox_client *cl,
|
|||
|
||||
of_property_for_each_string(np, "mbox-names", prop, mbox_name) {
|
||||
if (!strncmp(name, mbox_name, strlen(name)))
|
||||
break;
|
||||
return mbox_request_channel(cl, index);
|
||||
index++;
|
||||
}
|
||||
|
||||
return mbox_request_channel(cl, index);
|
||||
dev_err(cl->dev, "%s() could not locate channel named \"%s\"\n",
|
||||
__func__, name);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mbox_request_channel_byname);
|
||||
|
||||
|
|
|
@ -1403,7 +1403,7 @@ static void cache_set_flush(struct closure *cl)
|
|||
kobject_put(&c->internal);
|
||||
kobject_del(&c->kobj);
|
||||
|
||||
if (c->gc_thread)
|
||||
if (!IS_ERR_OR_NULL(c->gc_thread))
|
||||
kthread_stop(c->gc_thread);
|
||||
|
||||
if (!IS_ERR_OR_NULL(c->root))
|
||||
|
|
|
@ -1561,9 +1561,7 @@ dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
|
|||
unsigned long freed;
|
||||
|
||||
c = container_of(shrink, struct dm_bufio_client, shrinker);
|
||||
if (sc->gfp_mask & __GFP_FS)
|
||||
dm_bufio_lock(c);
|
||||
else if (!dm_bufio_trylock(c))
|
||||
if (!dm_bufio_trylock(c))
|
||||
return SHRINK_STOP;
|
||||
|
||||
freed = __scan(c, sc->nr_to_scan, sc->gfp_mask);
|
||||
|
|
|
@ -80,8 +80,8 @@ static int tua6100_set_params(struct dvb_frontend *fe)
|
|||
struct i2c_msg msg1 = { .addr = priv->i2c_address, .flags = 0, .buf = reg1, .len = 4 };
|
||||
struct i2c_msg msg2 = { .addr = priv->i2c_address, .flags = 0, .buf = reg2, .len = 3 };
|
||||
|
||||
#define _R 4
|
||||
#define _P 32
|
||||
#define _R_VAL 4
|
||||
#define _P_VAL 32
|
||||
#define _ri 4000000
|
||||
|
||||
// setup register 0
|
||||
|
@ -96,14 +96,14 @@ static int tua6100_set_params(struct dvb_frontend *fe)
|
|||
else
|
||||
reg1[1] = 0x0c;
|
||||
|
||||
if (_P == 64)
|
||||
if (_P_VAL == 64)
|
||||
reg1[1] |= 0x40;
|
||||
if (c->frequency >= 1525000)
|
||||
reg1[1] |= 0x80;
|
||||
|
||||
// register 2
|
||||
reg2[1] = (_R >> 8) & 0x03;
|
||||
reg2[2] = _R;
|
||||
reg2[1] = (_R_VAL >> 8) & 0x03;
|
||||
reg2[2] = _R_VAL;
|
||||
if (c->frequency < 1455000)
|
||||
reg2[1] |= 0x1c;
|
||||
else if (c->frequency < 1630000)
|
||||
|
@ -115,18 +115,18 @@ static int tua6100_set_params(struct dvb_frontend *fe)
|
|||
* The N divisor ratio (note: c->frequency is in kHz, but we
|
||||
* need it in Hz)
|
||||
*/
|
||||
prediv = (c->frequency * _R) / (_ri / 1000);
|
||||
div = prediv / _P;
|
||||
prediv = (c->frequency * _R_VAL) / (_ri / 1000);
|
||||
div = prediv / _P_VAL;
|
||||
reg1[1] |= (div >> 9) & 0x03;
|
||||
reg1[2] = div >> 1;
|
||||
reg1[3] = (div << 7);
|
||||
priv->frequency = ((div * _P) * (_ri / 1000)) / _R;
|
||||
priv->frequency = ((div * _P_VAL) * (_ri / 1000)) / _R_VAL;
|
||||
|
||||
// Finally, calculate and store the value for A
|
||||
reg1[3] |= (prediv - (div*_P)) & 0x7f;
|
||||
reg1[3] |= (prediv - (div*_P_VAL)) & 0x7f;
|
||||
|
||||
#undef _R
|
||||
#undef _P
|
||||
#undef _R_VAL
|
||||
#undef _P_VAL
|
||||
#undef _ri
|
||||
|
||||
if (fe->ops.i2c_gate_ctrl)
|
||||
|
|
|
@ -41,7 +41,7 @@ endif
|
|||
obj-$(CONFIG_VIDEO_ADV7481) += adv7481.o
|
||||
obj-$(CONFIG_VIDEO_TVTUNER) += tvtuner.o
|
||||
obj-$(CONFIG_VIDEO_AD9389B) += ad9389b.o
|
||||
obj-$(CONFIG_VIDEO_ADV7511) += adv7511.o
|
||||
obj-$(CONFIG_VIDEO_ADV7511) += adv7511-v4l2.o
|
||||
obj-$(CONFIG_VIDEO_VPX3220) += vpx3220.o
|
||||
obj-$(CONFIG_VIDEO_VS6624) += vs6624.o
|
||||
obj-$(CONFIG_VIDEO_BT819) += bt819.o
|
||||
|
|
|
@ -17,6 +17,11 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file is named adv7511-v4l2.c so it doesn't conflict with the Analog
|
||||
* Device ADV7511 (config fragment CONFIG_DRM_I2C_ADV7511).
|
||||
*/
|
||||
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
|
@ -1581,6 +1581,7 @@ static int __coda_start_decoding(struct coda_ctx *ctx)
|
|||
coda_write(dev, 0, CODA_REG_BIT_BIT_STREAM_PARAM);
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
ctx->sequence_offset = ~0U;
|
||||
ctx->initialized = 1;
|
||||
|
||||
/* Update kfifo out pointer from coda bitstream read pointer */
|
||||
|
@ -1966,12 +1967,17 @@ static void coda_finish_decode(struct coda_ctx *ctx)
|
|||
else if (ctx->display_idx < 0)
|
||||
ctx->hold = true;
|
||||
} else if (decoded_idx == -2) {
|
||||
if (ctx->display_idx >= 0 &&
|
||||
ctx->display_idx < ctx->num_internal_frames)
|
||||
ctx->sequence_offset++;
|
||||
/* no frame was decoded, we still return remaining buffers */
|
||||
} else if (decoded_idx < 0 || decoded_idx >= ctx->num_internal_frames) {
|
||||
v4l2_err(&dev->v4l2_dev,
|
||||
"decoded frame index out of range: %d\n", decoded_idx);
|
||||
} else {
|
||||
val = coda_read(dev, CODA_RET_DEC_PIC_FRAME_NUM) - 1;
|
||||
val = coda_read(dev, CODA_RET_DEC_PIC_FRAME_NUM);
|
||||
if (ctx->sequence_offset == -1)
|
||||
ctx->sequence_offset = val;
|
||||
val -= ctx->sequence_offset;
|
||||
spin_lock_irqsave(&ctx->buffer_meta_lock, flags);
|
||||
if (!list_empty(&ctx->buffer_meta_list)) {
|
||||
|
@ -2101,7 +2107,6 @@ irqreturn_t coda_irq_handler(int irq, void *data)
|
|||
if (ctx == NULL) {
|
||||
v4l2_err(&dev->v4l2_dev,
|
||||
"Instance released before the end of transaction\n");
|
||||
mutex_unlock(&dev->coda_mutex);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
|
|
|
@ -523,6 +523,11 @@ static int __init vpss_init(void)
|
|||
return -EBUSY;
|
||||
|
||||
oper_cfg.vpss_regs_base2 = ioremap(VPSS_CLK_CTRL, 4);
|
||||
if (unlikely(!oper_cfg.vpss_regs_base2)) {
|
||||
release_mem_region(VPSS_CLK_CTRL, 4);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
writel(VPSS_CLK_CTRL_VENCCLKEN |
|
||||
VPSS_CLK_CTRL_DACCLKEN, oper_cfg.vpss_regs_base2);
|
||||
|
||||
|
|
|
@ -209,7 +209,6 @@ struct mcam_vb_buffer {
|
|||
struct list_head queue;
|
||||
struct mcam_dma_desc *dma_desc; /* Descriptor virtual address */
|
||||
dma_addr_t dma_desc_pa; /* Descriptor physical address */
|
||||
int dma_desc_nent; /* Number of mapped descriptors */
|
||||
};
|
||||
|
||||
static inline struct mcam_vb_buffer *vb_to_mvb(struct vb2_v4l2_buffer *vb)
|
||||
|
@ -616,9 +615,11 @@ static void mcam_dma_contig_done(struct mcam_camera *cam, int frame)
|
|||
static void mcam_sg_next_buffer(struct mcam_camera *cam)
|
||||
{
|
||||
struct mcam_vb_buffer *buf;
|
||||
struct sg_table *sg_table;
|
||||
|
||||
buf = list_first_entry(&cam->buffers, struct mcam_vb_buffer, queue);
|
||||
list_del_init(&buf->queue);
|
||||
sg_table = vb2_dma_sg_plane_desc(&buf->vb_buf.vb2_buf, 0);
|
||||
/*
|
||||
* Very Bad Not Good Things happen if you don't clear
|
||||
* C1_DESC_ENA before making any descriptor changes.
|
||||
|
@ -626,7 +627,7 @@ static void mcam_sg_next_buffer(struct mcam_camera *cam)
|
|||
mcam_reg_clear_bit(cam, REG_CTRL1, C1_DESC_ENA);
|
||||
mcam_reg_write(cam, REG_DMA_DESC_Y, buf->dma_desc_pa);
|
||||
mcam_reg_write(cam, REG_DESC_LEN_Y,
|
||||
buf->dma_desc_nent*sizeof(struct mcam_dma_desc));
|
||||
sg_table->nents * sizeof(struct mcam_dma_desc));
|
||||
mcam_reg_write(cam, REG_DESC_LEN_U, 0);
|
||||
mcam_reg_write(cam, REG_DESC_LEN_V, 0);
|
||||
mcam_reg_set_bit(cam, REG_CTRL1, C1_DESC_ENA);
|
||||
|
|
|
@ -283,6 +283,14 @@ static int vidioc_g_frequency(struct file *file, void *priv,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void raremono_device_release(struct v4l2_device *v4l2_dev)
|
||||
{
|
||||
struct raremono_device *radio = to_raremono_dev(v4l2_dev);
|
||||
|
||||
kfree(radio->buffer);
|
||||
kfree(radio);
|
||||
}
|
||||
|
||||
/* File system interface */
|
||||
static const struct v4l2_file_operations usb_raremono_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
|
@ -307,12 +315,14 @@ static int usb_raremono_probe(struct usb_interface *intf,
|
|||
struct raremono_device *radio;
|
||||
int retval = 0;
|
||||
|
||||
radio = devm_kzalloc(&intf->dev, sizeof(struct raremono_device), GFP_KERNEL);
|
||||
if (radio)
|
||||
radio->buffer = devm_kmalloc(&intf->dev, BUFFER_LENGTH, GFP_KERNEL);
|
||||
|
||||
if (!radio || !radio->buffer)
|
||||
radio = kzalloc(sizeof(*radio), GFP_KERNEL);
|
||||
if (!radio)
|
||||
return -ENOMEM;
|
||||
radio->buffer = kmalloc(BUFFER_LENGTH, GFP_KERNEL);
|
||||
if (!radio->buffer) {
|
||||
kfree(radio);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
radio->usbdev = interface_to_usbdev(intf);
|
||||
radio->intf = intf;
|
||||
|
@ -336,7 +346,8 @@ static int usb_raremono_probe(struct usb_interface *intf,
|
|||
if (retval != 3 ||
|
||||
(get_unaligned_be16(&radio->buffer[1]) & 0xfff) == 0x0242) {
|
||||
dev_info(&intf->dev, "this is not Thanko's Raremono.\n");
|
||||
return -ENODEV;
|
||||
retval = -ENODEV;
|
||||
goto free_mem;
|
||||
}
|
||||
|
||||
dev_info(&intf->dev, "Thanko's Raremono connected: (%04X:%04X)\n",
|
||||
|
@ -345,7 +356,7 @@ static int usb_raremono_probe(struct usb_interface *intf,
|
|||
retval = v4l2_device_register(&intf->dev, &radio->v4l2_dev);
|
||||
if (retval < 0) {
|
||||
dev_err(&intf->dev, "couldn't register v4l2_device\n");
|
||||
return retval;
|
||||
goto free_mem;
|
||||
}
|
||||
|
||||
mutex_init(&radio->lock);
|
||||
|
@ -357,6 +368,7 @@ static int usb_raremono_probe(struct usb_interface *intf,
|
|||
radio->vdev.ioctl_ops = &usb_raremono_ioctl_ops;
|
||||
radio->vdev.lock = &radio->lock;
|
||||
radio->vdev.release = video_device_release_empty;
|
||||
radio->v4l2_dev.release = raremono_device_release;
|
||||
|
||||
usb_set_intfdata(intf, &radio->v4l2_dev);
|
||||
|
||||
|
@ -372,6 +384,10 @@ static int usb_raremono_probe(struct usb_interface *intf,
|
|||
}
|
||||
dev_err(&intf->dev, "could not register video device\n");
|
||||
v4l2_device_unregister(&radio->v4l2_dev);
|
||||
|
||||
free_mem:
|
||||
kfree(radio->buffer);
|
||||
kfree(radio);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
@ -553,6 +553,7 @@ int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)
|
|||
|
||||
/* Register with V4L2 subsystem as RADIO device */
|
||||
if (video_register_device(&gradio_dev, VFL_TYPE_RADIO, radio_nr)) {
|
||||
v4l2_device_unregister(&fmdev->v4l2_dev);
|
||||
fmerr("Could not register video device\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
@ -566,6 +567,8 @@ int fm_v4l2_init_video_device(struct fmdev *fmdev, int radio_nr)
|
|||
if (ret < 0) {
|
||||
fmerr("(fmdev): Can't init ctrl handler\n");
|
||||
v4l2_ctrl_handler_free(&fmdev->ctrl_handler);
|
||||
video_unregister_device(fmdev->radio_dev);
|
||||
v4l2_device_unregister(&fmdev->v4l2_dev);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
|
|
|
@ -884,7 +884,6 @@ static void cpia2_usb_disconnect(struct usb_interface *intf)
|
|||
cpia2_unregister_camera(cam);
|
||||
v4l2_device_disconnect(&cam->v4l2_dev);
|
||||
mutex_unlock(&cam->v4l2_lock);
|
||||
v4l2_device_put(&cam->v4l2_dev);
|
||||
|
||||
if(cam->buffers) {
|
||||
DBG("Wakeup waiting processes\n");
|
||||
|
@ -897,6 +896,8 @@ static void cpia2_usb_disconnect(struct usb_interface *intf)
|
|||
DBG("Releasing interface\n");
|
||||
usb_driver_release_interface(&cpia2_driver, intf);
|
||||
|
||||
v4l2_device_put(&cam->v4l2_dev);
|
||||
|
||||
LOG("CPiA2 camera disconnected.\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -286,12 +286,15 @@ EXPORT_SYMBOL(dvb_usb_device_init);
|
|||
void dvb_usb_device_exit(struct usb_interface *intf)
|
||||
{
|
||||
struct dvb_usb_device *d = usb_get_intfdata(intf);
|
||||
const char *name = "generic DVB-USB module";
|
||||
const char *default_name = "generic DVB-USB module";
|
||||
char name[40];
|
||||
|
||||
usb_set_intfdata(intf, NULL);
|
||||
if (d != NULL && d->desc != NULL) {
|
||||
name = d->desc->name;
|
||||
strscpy(name, d->desc->name, sizeof(name));
|
||||
dvb_usb_exit(d);
|
||||
} else {
|
||||
strscpy(name, default_name, sizeof(name));
|
||||
}
|
||||
info("%s successfully deinitialized and disconnected.", name);
|
||||
|
||||
|
|
|
@ -2078,16 +2078,15 @@ struct v4l2_ctrl *v4l2_ctrl_new_custom(struct v4l2_ctrl_handler *hdl,
|
|||
v4l2_ctrl_fill(cfg->id, &name, &type, &min, &max, &step,
|
||||
&def, &flags);
|
||||
|
||||
is_menu = (cfg->type == V4L2_CTRL_TYPE_MENU ||
|
||||
cfg->type == V4L2_CTRL_TYPE_INTEGER_MENU);
|
||||
is_menu = (type == V4L2_CTRL_TYPE_MENU ||
|
||||
type == V4L2_CTRL_TYPE_INTEGER_MENU);
|
||||
if (is_menu)
|
||||
WARN_ON(step);
|
||||
else
|
||||
WARN_ON(cfg->menu_skip_mask);
|
||||
if (cfg->type == V4L2_CTRL_TYPE_MENU && qmenu == NULL)
|
||||
if (type == V4L2_CTRL_TYPE_MENU && !qmenu) {
|
||||
qmenu = v4l2_ctrl_get_menu(cfg->id);
|
||||
else if (cfg->type == V4L2_CTRL_TYPE_INTEGER_MENU &&
|
||||
qmenu_int == NULL) {
|
||||
} else if (type == V4L2_CTRL_TYPE_INTEGER_MENU && !qmenu_int) {
|
||||
handler_set_err(hdl, -EINVAL);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -629,13 +629,18 @@ static int __init memstick_init(void)
|
|||
return -ENOMEM;
|
||||
|
||||
rc = bus_register(&memstick_bus_type);
|
||||
if (!rc)
|
||||
rc = class_register(&memstick_host_class);
|
||||
if (rc)
|
||||
goto error_destroy_workqueue;
|
||||
|
||||
if (!rc)
|
||||
return 0;
|
||||
rc = class_register(&memstick_host_class);
|
||||
if (rc)
|
||||
goto error_bus_unregister;
|
||||
|
||||
return 0;
|
||||
|
||||
error_bus_unregister:
|
||||
bus_unregister(&memstick_bus_type);
|
||||
error_destroy_workqueue:
|
||||
destroy_workqueue(workqueue);
|
||||
|
||||
return rc;
|
||||
|
|
|
@ -967,7 +967,7 @@ int arizona_dev_init(struct arizona *arizona)
|
|||
unsigned int reg, val, mask;
|
||||
int (*apply_patch)(struct arizona *) = NULL;
|
||||
const struct mfd_cell *subdevs = NULL;
|
||||
int n_subdevs, ret, i;
|
||||
int n_subdevs = 0, ret, i;
|
||||
|
||||
dev_set_drvdata(arizona->dev, arizona);
|
||||
mutex_init(&arizona->clk_lock);
|
||||
|
|
|
@ -178,6 +178,7 @@ static int mfd_add_device(struct device *parent, int id,
|
|||
for_each_child_of_node(parent->of_node, np) {
|
||||
if (of_device_is_compatible(np, cell->of_compatible)) {
|
||||
pdev->dev.of_node = np;
|
||||
pdev->dev.fwnode = &np->fwnode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3714,8 +3714,8 @@ static u32 bond_rr_gen_slave_id(struct bonding *bond)
|
|||
static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev)
|
||||
{
|
||||
struct bonding *bond = netdev_priv(bond_dev);
|
||||
struct iphdr *iph = ip_hdr(skb);
|
||||
struct slave *slave;
|
||||
int slave_cnt;
|
||||
u32 slave_id;
|
||||
|
||||
/* Start with the curr_active_slave that joined the bond as the
|
||||
|
@ -3724,23 +3724,32 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev
|
|||
* send the join/membership reports. The curr_active_slave found
|
||||
* will send all of this type of traffic.
|
||||
*/
|
||||
if (iph->protocol == IPPROTO_IGMP && skb->protocol == htons(ETH_P_IP)) {
|
||||
slave = rcu_dereference(bond->curr_active_slave);
|
||||
if (slave)
|
||||
bond_dev_queue_xmit(bond, skb, slave->dev);
|
||||
else
|
||||
bond_xmit_slave_id(bond, skb, 0);
|
||||
} else {
|
||||
int slave_cnt = ACCESS_ONCE(bond->slave_cnt);
|
||||
if (skb->protocol == htons(ETH_P_IP)) {
|
||||
int noff = skb_network_offset(skb);
|
||||
struct iphdr *iph;
|
||||
|
||||
if (likely(slave_cnt)) {
|
||||
slave_id = bond_rr_gen_slave_id(bond);
|
||||
bond_xmit_slave_id(bond, skb, slave_id % slave_cnt);
|
||||
} else {
|
||||
bond_tx_drop(bond_dev, skb);
|
||||
if (unlikely(!pskb_may_pull(skb, noff + sizeof(*iph))))
|
||||
goto non_igmp;
|
||||
|
||||
iph = ip_hdr(skb);
|
||||
if (iph->protocol == IPPROTO_IGMP) {
|
||||
slave = rcu_dereference(bond->curr_active_slave);
|
||||
if (slave)
|
||||
bond_dev_queue_xmit(bond, skb, slave->dev);
|
||||
else
|
||||
bond_xmit_slave_id(bond, skb, 0);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
}
|
||||
|
||||
non_igmp:
|
||||
slave_cnt = ACCESS_ONCE(bond->slave_cnt);
|
||||
if (likely(slave_cnt)) {
|
||||
slave_id = bond_rr_gen_slave_id(bond);
|
||||
bond_xmit_slave_id(bond, skb, slave_id % slave_cnt);
|
||||
} else {
|
||||
bond_tx_drop(bond_dev, skb);
|
||||
}
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1467,7 +1467,7 @@ static void __exit cfhsi_exit_module(void)
|
|||
rtnl_lock();
|
||||
list_for_each_safe(list_node, n, &cfhsi_list) {
|
||||
cfhsi = list_entry(list_node, struct cfhsi, list);
|
||||
unregister_netdev(cfhsi->ndev);
|
||||
unregister_netdevice(cfhsi->ndev);
|
||||
}
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
|
|
@ -288,6 +288,9 @@ int bnx2x_tx_int(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata)
|
|||
hw_cons = le16_to_cpu(*txdata->tx_cons_sb);
|
||||
sw_cons = txdata->tx_pkt_cons;
|
||||
|
||||
/* Ensure subsequent loads occur after hw_cons */
|
||||
smp_rmb();
|
||||
|
||||
while (sw_cons != hw_cons) {
|
||||
u16 pkt_cons;
|
||||
|
||||
|
|
|
@ -3090,39 +3090,42 @@ static void bcmgenet_timeout(struct net_device *dev)
|
|||
netif_tx_wake_all_queues(dev);
|
||||
}
|
||||
|
||||
#define MAX_MC_COUNT 16
|
||||
#define MAX_MDF_FILTER 17
|
||||
|
||||
static inline void bcmgenet_set_mdf_addr(struct bcmgenet_priv *priv,
|
||||
unsigned char *addr,
|
||||
int *i,
|
||||
int *mc)
|
||||
int *i)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
bcmgenet_umac_writel(priv, addr[0] << 8 | addr[1],
|
||||
UMAC_MDF_ADDR + (*i * 4));
|
||||
bcmgenet_umac_writel(priv, addr[2] << 24 | addr[3] << 16 |
|
||||
addr[4] << 8 | addr[5],
|
||||
UMAC_MDF_ADDR + ((*i + 1) * 4));
|
||||
reg = bcmgenet_umac_readl(priv, UMAC_MDF_CTRL);
|
||||
reg |= (1 << (MAX_MC_COUNT - *mc));
|
||||
bcmgenet_umac_writel(priv, reg, UMAC_MDF_CTRL);
|
||||
*i += 2;
|
||||
(*mc)++;
|
||||
}
|
||||
|
||||
static void bcmgenet_set_rx_mode(struct net_device *dev)
|
||||
{
|
||||
struct bcmgenet_priv *priv = netdev_priv(dev);
|
||||
struct netdev_hw_addr *ha;
|
||||
int i, mc;
|
||||
int i, nfilter;
|
||||
u32 reg;
|
||||
|
||||
netif_dbg(priv, hw, dev, "%s: %08X\n", __func__, dev->flags);
|
||||
|
||||
/* Promiscuous mode */
|
||||
/* Number of filters needed */
|
||||
nfilter = netdev_uc_count(dev) + netdev_mc_count(dev) + 2;
|
||||
|
||||
/*
|
||||
* Turn on promicuous mode for three scenarios
|
||||
* 1. IFF_PROMISC flag is set
|
||||
* 2. IFF_ALLMULTI flag is set
|
||||
* 3. The number of filters needed exceeds the number filters
|
||||
* supported by the hardware.
|
||||
*/
|
||||
reg = bcmgenet_umac_readl(priv, UMAC_CMD);
|
||||
if (dev->flags & IFF_PROMISC) {
|
||||
if ((dev->flags & (IFF_PROMISC | IFF_ALLMULTI)) ||
|
||||
(nfilter > MAX_MDF_FILTER)) {
|
||||
reg |= CMD_PROMISC;
|
||||
bcmgenet_umac_writel(priv, reg, UMAC_CMD);
|
||||
bcmgenet_umac_writel(priv, 0, UMAC_MDF_CTRL);
|
||||
|
@ -3132,32 +3135,24 @@ static void bcmgenet_set_rx_mode(struct net_device *dev)
|
|||
bcmgenet_umac_writel(priv, reg, UMAC_CMD);
|
||||
}
|
||||
|
||||
/* UniMac doesn't support ALLMULTI */
|
||||
if (dev->flags & IFF_ALLMULTI) {
|
||||
netdev_warn(dev, "ALLMULTI is not supported\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* update MDF filter */
|
||||
i = 0;
|
||||
mc = 0;
|
||||
/* Broadcast */
|
||||
bcmgenet_set_mdf_addr(priv, dev->broadcast, &i, &mc);
|
||||
bcmgenet_set_mdf_addr(priv, dev->broadcast, &i);
|
||||
/* my own address.*/
|
||||
bcmgenet_set_mdf_addr(priv, dev->dev_addr, &i, &mc);
|
||||
/* Unicast list*/
|
||||
if (netdev_uc_count(dev) > (MAX_MC_COUNT - mc))
|
||||
return;
|
||||
bcmgenet_set_mdf_addr(priv, dev->dev_addr, &i);
|
||||
|
||||
/* Unicast */
|
||||
netdev_for_each_uc_addr(ha, dev)
|
||||
bcmgenet_set_mdf_addr(priv, ha->addr, &i);
|
||||
|
||||
if (!netdev_uc_empty(dev))
|
||||
netdev_for_each_uc_addr(ha, dev)
|
||||
bcmgenet_set_mdf_addr(priv, ha->addr, &i, &mc);
|
||||
/* Multicast */
|
||||
if (netdev_mc_empty(dev) || netdev_mc_count(dev) >= (MAX_MC_COUNT - mc))
|
||||
return;
|
||||
|
||||
netdev_for_each_mc_addr(ha, dev)
|
||||
bcmgenet_set_mdf_addr(priv, ha->addr, &i, &mc);
|
||||
bcmgenet_set_mdf_addr(priv, ha->addr, &i);
|
||||
|
||||
/* Enable filters */
|
||||
reg = GENMASK(MAX_MDF_FILTER - 1, MAX_MDF_FILTER - nfilter);
|
||||
bcmgenet_umac_writel(priv, reg, UMAC_MDF_CTRL);
|
||||
}
|
||||
|
||||
/* Set the hardware MAC address. */
|
||||
|
|
|
@ -1699,10 +1699,10 @@ static void fec_get_mac(struct net_device *ndev)
|
|||
*/
|
||||
if (!is_valid_ether_addr(iap)) {
|
||||
/* Report it and use a random ethernet address instead */
|
||||
netdev_err(ndev, "Invalid MAC address: %pM\n", iap);
|
||||
dev_err(&fep->pdev->dev, "Invalid MAC address: %pM\n", iap);
|
||||
eth_hw_addr_random(ndev);
|
||||
netdev_info(ndev, "Using random MAC address: %pM\n",
|
||||
ndev->dev_addr);
|
||||
dev_info(&fep->pdev->dev, "Using random MAC address: %pM\n",
|
||||
ndev->dev_addr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -3133,7 +3133,8 @@ static int ixgbe_get_module_info(struct net_device *dev,
|
|||
page_swap = true;
|
||||
}
|
||||
|
||||
if (sff8472_rev == IXGBE_SFF_SFF_8472_UNSUP || page_swap) {
|
||||
if (sff8472_rev == IXGBE_SFF_SFF_8472_UNSUP || page_swap ||
|
||||
!(addr_mode & IXGBE_SFF_DDM_IMPLEMENTED)) {
|
||||
/* We have a SFP, but it does not support SFF-8472 */
|
||||
modinfo->type = ETH_MODULE_SFF_8079;
|
||||
modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
|
||||
|
|
|
@ -70,6 +70,7 @@
|
|||
#define IXGBE_SFF_SOFT_RS_SELECT_10G 0x8
|
||||
#define IXGBE_SFF_SOFT_RS_SELECT_1G 0x0
|
||||
#define IXGBE_SFF_ADDRESSING_MODE 0x4
|
||||
#define IXGBE_SFF_DDM_IMPLEMENTED 0x40
|
||||
#define IXGBE_SFF_QSFP_DA_ACTIVE_CABLE 0x1
|
||||
#define IXGBE_SFF_QSFP_DA_PASSIVE_CABLE 0x8
|
||||
#define IXGBE_SFF_QSFP_CONNECTOR_NOT_SEPARABLE 0x23
|
||||
|
|
|
@ -4939,6 +4939,13 @@ static const struct dmi_system_id msi_blacklist[] = {
|
|||
DMI_MATCH(DMI_PRODUCT_NAME, "P-79"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.ident = "ASUS P6T",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "P6T"),
|
||||
},
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
|
|
|
@ -187,6 +187,12 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
|
|||
GMAC_ADDR_LOW(reg));
|
||||
reg++;
|
||||
}
|
||||
|
||||
while (reg <= perfect_addr_number) {
|
||||
writel(0, ioaddr + GMAC_ADDR_HIGH(reg));
|
||||
writel(0, ioaddr + GMAC_ADDR_LOW(reg));
|
||||
reg++;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FRAME_FILTER_DEBUG
|
||||
|
|
|
@ -613,6 +613,10 @@ static void axienet_start_xmit_done(struct net_device *ndev)
|
|||
|
||||
ndev->stats.tx_packets += packets;
|
||||
ndev->stats.tx_bytes += size;
|
||||
|
||||
/* Matches barrier in axienet_start_xmit */
|
||||
smp_mb();
|
||||
|
||||
netif_wake_queue(ndev);
|
||||
}
|
||||
|
||||
|
@ -667,9 +671,19 @@ static int axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
|||
cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
|
||||
|
||||
if (axienet_check_tx_bd_space(lp, num_frag)) {
|
||||
if (!netif_queue_stopped(ndev))
|
||||
netif_stop_queue(ndev);
|
||||
return NETDEV_TX_BUSY;
|
||||
if (netif_queue_stopped(ndev))
|
||||
return NETDEV_TX_BUSY;
|
||||
|
||||
netif_stop_queue(ndev);
|
||||
|
||||
/* Matches barrier in axienet_start_xmit_done */
|
||||
smp_mb();
|
||||
|
||||
/* Space might have just been freed - check again */
|
||||
if (axienet_check_tx_bd_space(lp, num_frag))
|
||||
return NETDEV_TX_BUSY;
|
||||
|
||||
netif_wake_queue(ndev);
|
||||
}
|
||||
|
||||
if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
|
|
|
@ -472,6 +472,9 @@ int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
|
|||
{
|
||||
int rc;
|
||||
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
||||
rc = phy_attach_direct(dev, phydev, phydev->dev_flags, interface);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
@ -704,6 +707,9 @@ struct phy_device *phy_attach(struct net_device *dev, const char *bus_id,
|
|||
struct device *d;
|
||||
int rc;
|
||||
|
||||
if (!dev)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
/* Search the list of PHY devices on the mdio bus for the
|
||||
* PHY with the requested name
|
||||
*/
|
||||
|
|
|
@ -488,7 +488,7 @@ const struct ath10k_hw_values qca6174_values = {
|
|||
|
||||
const struct ath10k_hw_values qca99x0_values = {
|
||||
.pdev_suspend_option = WMI_PDEV_SUSPEND_AND_DISABLE_INTR,
|
||||
.rtc_state_val_on = 5,
|
||||
.rtc_state_val_on = 7,
|
||||
.ce_count = 12,
|
||||
.msi_assign_ce_max = 12,
|
||||
.num_target_ce_config_wlan = 10,
|
||||
|
|
|
@ -1615,6 +1615,10 @@ static int ath10k_mac_setup_prb_tmpl(struct ath10k_vif *arvif)
|
|||
if (arvif->vdev_type != WMI_VDEV_TYPE_AP)
|
||||
return 0;
|
||||
|
||||
/* For mesh, probe response and beacon share the same template */
|
||||
if (ieee80211_vif_is_mesh(vif))
|
||||
return 0;
|
||||
|
||||
prb = ieee80211_proberesp_get(hw, vif);
|
||||
if (!prb) {
|
||||
ath10k_warn(ar, "failed to get probe resp template from mac80211\n");
|
||||
|
|
|
@ -1178,6 +1178,10 @@ static int ath6kl_wmi_pstream_timeout_event_rx(struct wmi *wmi, u8 *datap,
|
|||
return -EINVAL;
|
||||
|
||||
ev = (struct wmi_pstream_timeout_event *) datap;
|
||||
if (ev->traffic_class >= WMM_NUM_AC) {
|
||||
ath6kl_err("invalid traffic class: %d\n", ev->traffic_class);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* When the pstream (fat pipe == AC) timesout, it means there were
|
||||
|
@ -1519,6 +1523,10 @@ static int ath6kl_wmi_cac_event_rx(struct wmi *wmi, u8 *datap, int len,
|
|||
return -EINVAL;
|
||||
|
||||
reply = (struct wmi_cac_event *) datap;
|
||||
if (reply->ac >= WMM_NUM_AC) {
|
||||
ath6kl_err("invalid AC: %d\n", reply->ac);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((reply->cac_indication == CAC_INDICATION_ADMISSION_RESP) &&
|
||||
(reply->status_code != IEEE80211_TSPEC_STATUS_ADMISS_ACCEPTED)) {
|
||||
|
@ -2631,7 +2639,7 @@ int ath6kl_wmi_delete_pstream_cmd(struct wmi *wmi, u8 if_idx, u8 traffic_class,
|
|||
u16 active_tsids = 0;
|
||||
int ret;
|
||||
|
||||
if (traffic_class > 3) {
|
||||
if (traffic_class >= WMM_NUM_AC) {
|
||||
ath6kl_err("invalid traffic class: %d\n", traffic_class);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
@ -250,8 +250,9 @@ void ath9k_hw_get_channel_centers(struct ath_hw *ah,
|
|||
/* Chip Revisions */
|
||||
/******************/
|
||||
|
||||
static void ath9k_hw_read_revisions(struct ath_hw *ah)
|
||||
static bool ath9k_hw_read_revisions(struct ath_hw *ah)
|
||||
{
|
||||
u32 srev;
|
||||
u32 val;
|
||||
|
||||
if (ah->get_mac_revision)
|
||||
|
@ -267,25 +268,33 @@ static void ath9k_hw_read_revisions(struct ath_hw *ah)
|
|||
val = REG_READ(ah, AR_SREV);
|
||||
ah->hw_version.macRev = MS(val, AR_SREV_REVISION2);
|
||||
}
|
||||
return;
|
||||
return true;
|
||||
case AR9300_DEVID_AR9340:
|
||||
ah->hw_version.macVersion = AR_SREV_VERSION_9340;
|
||||
return;
|
||||
return true;
|
||||
case AR9300_DEVID_QCA955X:
|
||||
ah->hw_version.macVersion = AR_SREV_VERSION_9550;
|
||||
return;
|
||||
return true;
|
||||
case AR9300_DEVID_AR953X:
|
||||
ah->hw_version.macVersion = AR_SREV_VERSION_9531;
|
||||
return;
|
||||
return true;
|
||||
case AR9300_DEVID_QCA956X:
|
||||
ah->hw_version.macVersion = AR_SREV_VERSION_9561;
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
val = REG_READ(ah, AR_SREV) & AR_SREV_ID;
|
||||
srev = REG_READ(ah, AR_SREV);
|
||||
|
||||
if (srev == -EIO) {
|
||||
ath_err(ath9k_hw_common(ah),
|
||||
"Failed to read SREV register");
|
||||
return false;
|
||||
}
|
||||
|
||||
val = srev & AR_SREV_ID;
|
||||
|
||||
if (val == 0xFF) {
|
||||
val = REG_READ(ah, AR_SREV);
|
||||
val = srev;
|
||||
ah->hw_version.macVersion =
|
||||
(val & AR_SREV_VERSION2) >> AR_SREV_TYPE2_S;
|
||||
ah->hw_version.macRev = MS(val, AR_SREV_REVISION2);
|
||||
|
@ -304,6 +313,8 @@ static void ath9k_hw_read_revisions(struct ath_hw *ah)
|
|||
if (ah->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE)
|
||||
ah->is_pciexpress = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/************************************/
|
||||
|
@ -556,7 +567,10 @@ static int __ath9k_hw_init(struct ath_hw *ah)
|
|||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
int r = 0;
|
||||
|
||||
ath9k_hw_read_revisions(ah);
|
||||
if (!ath9k_hw_read_revisions(ah)) {
|
||||
ath_err(common, "Could not read hardware revisions");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
switch (ah->hw_version.macVersion) {
|
||||
case AR_SREV_VERSION_5416_PCI:
|
||||
|
|
|
@ -111,7 +111,7 @@ static const struct radar_detector_specs jp_radar_ref_types[] = {
|
|||
JP_PATTERN(0, 0, 1, 1428, 1428, 1, 18, 29, false),
|
||||
JP_PATTERN(1, 2, 3, 3846, 3846, 1, 18, 29, false),
|
||||
JP_PATTERN(2, 0, 1, 1388, 1388, 1, 18, 50, false),
|
||||
JP_PATTERN(3, 1, 2, 4000, 4000, 1, 18, 50, false),
|
||||
JP_PATTERN(3, 0, 4, 4000, 4000, 1, 18, 50, false),
|
||||
JP_PATTERN(4, 0, 5, 150, 230, 1, 23, 50, false),
|
||||
JP_PATTERN(5, 6, 10, 200, 500, 1, 16, 50, false),
|
||||
JP_PATTERN(6, 11, 20, 200, 500, 1, 12, 50, false),
|
||||
|
|
|
@ -193,10 +193,23 @@ static void mt7601u_complete_rx(struct urb *urb)
|
|||
struct mt7601u_rx_queue *q = &dev->rx_q;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&dev->rx_lock, flags);
|
||||
/* do no schedule rx tasklet if urb has been unlinked
|
||||
* or the device has been removed
|
||||
*/
|
||||
switch (urb->status) {
|
||||
case -ECONNRESET:
|
||||
case -ESHUTDOWN:
|
||||
case -ENOENT:
|
||||
return;
|
||||
default:
|
||||
dev_err_ratelimited(dev->dev, "rx urb failed: %d\n",
|
||||
urb->status);
|
||||
/* fall through */
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
|
||||
if (mt7601u_urb_has_error(urb))
|
||||
dev_err(dev->dev, "Error: RX urb failed:%d\n", urb->status);
|
||||
spin_lock_irqsave(&dev->rx_lock, flags);
|
||||
if (WARN_ONCE(q->e[q->end].urb != urb, "RX urb mismatch"))
|
||||
goto out;
|
||||
|
||||
|
@ -228,14 +241,25 @@ static void mt7601u_complete_tx(struct urb *urb)
|
|||
struct sk_buff *skb;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&dev->tx_lock, flags);
|
||||
switch (urb->status) {
|
||||
case -ECONNRESET:
|
||||
case -ESHUTDOWN:
|
||||
case -ENOENT:
|
||||
return;
|
||||
default:
|
||||
dev_err_ratelimited(dev->dev, "tx urb failed: %d\n",
|
||||
urb->status);
|
||||
/* fall through */
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
|
||||
if (mt7601u_urb_has_error(urb))
|
||||
dev_err(dev->dev, "Error: TX urb failed:%d\n", urb->status);
|
||||
spin_lock_irqsave(&dev->tx_lock, flags);
|
||||
if (WARN_ONCE(q->e[q->start].urb != urb, "TX urb mismatch"))
|
||||
goto out;
|
||||
|
||||
skb = q->e[q->start].skb;
|
||||
q->e[q->start].skb = NULL;
|
||||
trace_mt_tx_dma_done(dev, skb);
|
||||
|
||||
__skb_queue_tail(&dev->tx_skb_done, skb);
|
||||
|
@ -363,19 +387,9 @@ int mt7601u_dma_enqueue_tx(struct mt7601u_dev *dev, struct sk_buff *skb,
|
|||
static void mt7601u_kill_rx(struct mt7601u_dev *dev)
|
||||
{
|
||||
int i;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&dev->rx_lock, flags);
|
||||
|
||||
for (i = 0; i < dev->rx_q.entries; i++) {
|
||||
int next = dev->rx_q.end;
|
||||
|
||||
spin_unlock_irqrestore(&dev->rx_lock, flags);
|
||||
usb_poison_urb(dev->rx_q.e[next].urb);
|
||||
spin_lock_irqsave(&dev->rx_lock, flags);
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&dev->rx_lock, flags);
|
||||
for (i = 0; i < dev->rx_q.entries; i++)
|
||||
usb_poison_urb(dev->rx_q.e[i].urb);
|
||||
}
|
||||
|
||||
static int mt7601u_submit_rx_buf(struct mt7601u_dev *dev,
|
||||
|
@ -445,10 +459,10 @@ static void mt7601u_free_tx_queue(struct mt7601u_tx_queue *q)
|
|||
{
|
||||
int i;
|
||||
|
||||
WARN_ON(q->used);
|
||||
|
||||
for (i = 0; i < q->entries; i++) {
|
||||
usb_poison_urb(q->e[i].urb);
|
||||
if (q->e[i].skb)
|
||||
mt7601u_tx_status(q->dev, q->e[i].skb);
|
||||
usb_free_urb(q->e[i].urb);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,9 +117,9 @@ void mt7601u_tx_status(struct mt7601u_dev *dev, struct sk_buff *skb)
|
|||
info->status.rates[0].idx = -1;
|
||||
info->flags |= IEEE80211_TX_STAT_ACK;
|
||||
|
||||
spin_lock(&dev->mac_lock);
|
||||
spin_lock_bh(&dev->mac_lock);
|
||||
ieee80211_tx_status(dev->hw, skb);
|
||||
spin_unlock(&dev->mac_lock);
|
||||
spin_unlock_bh(&dev->mac_lock);
|
||||
}
|
||||
|
||||
static int mt7601u_skb_rooms(struct mt7601u_dev *dev, struct sk_buff *skb)
|
||||
|
|
|
@ -371,7 +371,7 @@ static ssize_t remove_store(struct device *dev, struct device_attribute *attr,
|
|||
pci_stop_and_remove_bus_device_locked(to_pci_dev(dev));
|
||||
return count;
|
||||
}
|
||||
static struct device_attribute dev_remove_attr = __ATTR(remove,
|
||||
static struct device_attribute dev_remove_attr = __ATTR_IGNORE_LOCKDEP(remove,
|
||||
(S_IWUSR|S_IWGRP),
|
||||
NULL, remove_store);
|
||||
|
||||
|
|
|
@ -1736,6 +1736,13 @@ static void pci_pme_list_scan(struct work_struct *work)
|
|||
*/
|
||||
if (bridge && bridge->current_state != PCI_D0)
|
||||
continue;
|
||||
/*
|
||||
* If the device is in D3cold it should not be
|
||||
* polled either.
|
||||
*/
|
||||
if (pme_dev->dev->current_state == PCI_D3cold)
|
||||
continue;
|
||||
|
||||
pci_pme_wakeup(pme_dev->dev, NULL);
|
||||
} else {
|
||||
list_del(&pme_dev->list);
|
||||
|
|
|
@ -287,6 +287,7 @@ static int rcar_gen2_phy_probe(struct platform_device *pdev)
|
|||
error = of_property_read_u32(np, "reg", &channel_num);
|
||||
if (error || channel_num > 2) {
|
||||
dev_err(dev, "Invalid \"reg\" property\n");
|
||||
of_node_put(np);
|
||||
return error;
|
||||
}
|
||||
channel->select_mask = select_mask[channel_num];
|
||||
|
@ -302,6 +303,7 @@ static int rcar_gen2_phy_probe(struct platform_device *pdev)
|
|||
&rcar_gen2_phy_ops);
|
||||
if (IS_ERR(phy->phy)) {
|
||||
dev_err(dev, "Failed to create PHY\n");
|
||||
of_node_put(np);
|
||||
return PTR_ERR(phy->phy);
|
||||
}
|
||||
phy_set_drvdata(phy->phy, phy);
|
||||
|
|
|
@ -1837,6 +1837,7 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank,
|
|||
base,
|
||||
&rockchip_regmap_config);
|
||||
}
|
||||
of_node_put(node);
|
||||
}
|
||||
|
||||
bank->irq = irq_of_parse_and_map(bank->of_node, 0);
|
||||
|
|
|
@ -129,6 +129,14 @@ static long pps_cdev_ioctl(struct file *file,
|
|||
pps->params.mode |= PPS_CANWAIT;
|
||||
pps->params.api_version = PPS_API_VERS;
|
||||
|
||||
/*
|
||||
* Clear unused fields of pps_kparams to avoid leaking
|
||||
* uninitialized data of the PPS_SETPARAMS caller via
|
||||
* PPS_GETPARAMS
|
||||
*/
|
||||
pps->params.assert_off_tu.flags = 0;
|
||||
pps->params.clear_off_tu.flags = 0;
|
||||
|
||||
spin_unlock_irq(&pps->lock);
|
||||
|
||||
break;
|
||||
|
|
|
@ -382,8 +382,8 @@ static const struct regulator_desc s2mps11_regulators[] = {
|
|||
regulator_desc_s2mps11_buck1_4(4),
|
||||
regulator_desc_s2mps11_buck5,
|
||||
regulator_desc_s2mps11_buck67810(6, MIN_600_MV, STEP_6_25_MV),
|
||||
regulator_desc_s2mps11_buck67810(7, MIN_600_MV, STEP_12_5_MV),
|
||||
regulator_desc_s2mps11_buck67810(8, MIN_600_MV, STEP_12_5_MV),
|
||||
regulator_desc_s2mps11_buck67810(7, MIN_750_MV, STEP_12_5_MV),
|
||||
regulator_desc_s2mps11_buck67810(8, MIN_750_MV, STEP_12_5_MV),
|
||||
regulator_desc_s2mps11_buck9,
|
||||
regulator_desc_s2mps11_buck67810(10, MIN_750_MV, STEP_12_5_MV),
|
||||
};
|
||||
|
|
|
@ -752,6 +752,7 @@ static int get_outbound_buffer_frontier(struct qdio_q *q)
|
|||
|
||||
switch (state) {
|
||||
case SLSB_P_OUTPUT_EMPTY:
|
||||
case SLSB_P_OUTPUT_PENDING:
|
||||
/* the adapter got it */
|
||||
DBF_DEV_EVENT(DBF_INFO, q->irq_ptr,
|
||||
"out empty:%1d %02x", q->nr, count);
|
||||
|
|
|
@ -406,6 +406,9 @@ static int vpfe_open(struct file *file)
|
|||
/* If decoder is not initialized. initialize it */
|
||||
if (!video->initialized && vpfe_update_pipe_state(video)) {
|
||||
mutex_unlock(&video->lock);
|
||||
v4l2_fh_del(&handle->vfh);
|
||||
v4l2_fh_exit(&handle->vfh);
|
||||
kfree(handle);
|
||||
return -ENODEV;
|
||||
}
|
||||
/* Increment device users counter */
|
||||
|
|
|
@ -421,7 +421,16 @@ static int cpm_uart_startup(struct uart_port *port)
|
|||
clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_RX);
|
||||
}
|
||||
cpm_uart_initbd(pinfo);
|
||||
cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
|
||||
if (IS_SMC(pinfo)) {
|
||||
out_be32(&pinfo->smcup->smc_rstate, 0);
|
||||
out_be32(&pinfo->smcup->smc_tstate, 0);
|
||||
out_be16(&pinfo->smcup->smc_rbptr,
|
||||
in_be16(&pinfo->smcup->smc_rbase));
|
||||
out_be16(&pinfo->smcup->smc_tbptr,
|
||||
in_be16(&pinfo->smcup->smc_tbase));
|
||||
} else {
|
||||
cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
|
||||
}
|
||||
}
|
||||
/* Install interrupt handler. */
|
||||
retval = request_irq(port->irq, cpm_uart_int, 0, "cpm_uart", port);
|
||||
|
@ -875,16 +884,14 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo)
|
|||
(u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);
|
||||
|
||||
/*
|
||||
* In case SMC1 is being relocated...
|
||||
* In case SMC is being relocated...
|
||||
*/
|
||||
#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)
|
||||
out_be16(&up->smc_rbptr, in_be16(&pinfo->smcup->smc_rbase));
|
||||
out_be16(&up->smc_tbptr, in_be16(&pinfo->smcup->smc_tbase));
|
||||
out_be32(&up->smc_rstate, 0);
|
||||
out_be32(&up->smc_tstate, 0);
|
||||
out_be16(&up->smc_brkcr, 1); /* number of break chars */
|
||||
out_be16(&up->smc_brkec, 0);
|
||||
#endif
|
||||
|
||||
/* Set up the uart parameters in the
|
||||
* parameter ram.
|
||||
|
@ -898,8 +905,6 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo)
|
|||
out_be16(&up->smc_brkec, 0);
|
||||
out_be16(&up->smc_brkcr, 1);
|
||||
|
||||
cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
|
||||
|
||||
/* Set UART mode, 8 bit, no parity, one stop.
|
||||
* Enable receive and transmit.
|
||||
*/
|
||||
|
|
|
@ -544,7 +544,11 @@ static int __init digicolor_uart_init(void)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
return platform_driver_register(&digicolor_uart_platform);
|
||||
ret = platform_driver_register(&digicolor_uart_platform);
|
||||
if (ret)
|
||||
uart_unregister_driver(&digicolor_uart);
|
||||
|
||||
return ret;
|
||||
}
|
||||
module_init(digicolor_uart_init);
|
||||
|
||||
|
|
|
@ -486,37 +486,48 @@ static bool max310x_reg_precious(struct device *dev, unsigned int reg)
|
|||
|
||||
static int max310x_set_baud(struct uart_port *port, int baud)
|
||||
{
|
||||
unsigned int mode = 0, clk = port->uartclk, div = clk / baud;
|
||||
unsigned int mode = 0, div = 0, frac = 0, c = 0, F = 0;
|
||||
|
||||
/* Check for minimal value for divider */
|
||||
if (div < 16)
|
||||
div = 16;
|
||||
|
||||
if (clk % baud && (div / 16) < 0x8000) {
|
||||
/*
|
||||
* Calculate the integer divisor first. Select a proper mode
|
||||
* in case if the requested baud is too high for the pre-defined
|
||||
* clocks frequency.
|
||||
*/
|
||||
div = port->uartclk / baud;
|
||||
if (div < 8) {
|
||||
/* Mode x4 */
|
||||
c = 4;
|
||||
mode = MAX310X_BRGCFG_4XMODE_BIT;
|
||||
} else if (div < 16) {
|
||||
/* Mode x2 */
|
||||
c = 8;
|
||||
mode = MAX310X_BRGCFG_2XMODE_BIT;
|
||||
clk = port->uartclk * 2;
|
||||
div = clk / baud;
|
||||
|
||||
if (clk % baud && (div / 16) < 0x8000) {
|
||||
/* Mode x4 */
|
||||
mode = MAX310X_BRGCFG_4XMODE_BIT;
|
||||
clk = port->uartclk * 4;
|
||||
div = clk / baud;
|
||||
}
|
||||
} else {
|
||||
c = 16;
|
||||
}
|
||||
|
||||
max310x_port_write(port, MAX310X_BRGDIVMSB_REG, (div / 16) >> 8);
|
||||
max310x_port_write(port, MAX310X_BRGDIVLSB_REG, div / 16);
|
||||
max310x_port_write(port, MAX310X_BRGCFG_REG, (div % 16) | mode);
|
||||
/* Calculate the divisor in accordance with the fraction coefficient */
|
||||
div /= c;
|
||||
F = c*baud;
|
||||
|
||||
return DIV_ROUND_CLOSEST(clk, div);
|
||||
/* Calculate the baud rate fraction */
|
||||
if (div > 0)
|
||||
frac = (16*(port->uartclk % F)) / F;
|
||||
else
|
||||
div = 1;
|
||||
|
||||
max310x_port_write(port, MAX310X_BRGDIVMSB_REG, div >> 8);
|
||||
max310x_port_write(port, MAX310X_BRGDIVLSB_REG, div);
|
||||
max310x_port_write(port, MAX310X_BRGCFG_REG, frac | mode);
|
||||
|
||||
/* Return the actual baud rate we just programmed */
|
||||
return (16*port->uartclk) / (c*(16*div + frac));
|
||||
}
|
||||
|
||||
static int max310x_update_best_err(unsigned long f, long *besterr)
|
||||
{
|
||||
/* Use baudrate 115200 for calculate error */
|
||||
long err = f % (115200 * 16);
|
||||
long err = f % (460800 * 16);
|
||||
|
||||
if ((*besterr < 0) || (*besterr > err)) {
|
||||
*besterr = err;
|
||||
|
|
|
@ -395,10 +395,14 @@ no_rx:
|
|||
|
||||
static inline void msm_wait_for_xmitr(struct uart_port *port)
|
||||
{
|
||||
unsigned int timeout = 500000;
|
||||
|
||||
while (!(msm_read(port, UART_SR) & UART_SR_TX_EMPTY)) {
|
||||
if (msm_read(port, UART_ISR) & UART_ISR_TX_READY)
|
||||
break;
|
||||
udelay(1);
|
||||
if (!timeout--)
|
||||
break;
|
||||
}
|
||||
msm_write(port, UART_CR_CMD_RESET_TX_READY, UART_CR);
|
||||
}
|
||||
|
|
|
@ -1203,6 +1203,7 @@ static void work_fn_tx(struct work_struct *work)
|
|||
struct uart_port *port = &s->port;
|
||||
struct circ_buf *xmit = &port->state->xmit;
|
||||
dma_addr_t buf;
|
||||
int head, tail;
|
||||
|
||||
/*
|
||||
* DMA is idle now.
|
||||
|
@ -1212,16 +1213,23 @@ static void work_fn_tx(struct work_struct *work)
|
|||
* consistent xmit buffer state.
|
||||
*/
|
||||
spin_lock_irq(&port->lock);
|
||||
buf = s->tx_dma_addr + (xmit->tail & (UART_XMIT_SIZE - 1));
|
||||
head = xmit->head;
|
||||
tail = xmit->tail;
|
||||
buf = s->tx_dma_addr + (tail & (UART_XMIT_SIZE - 1));
|
||||
s->tx_dma_len = min_t(unsigned int,
|
||||
CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE),
|
||||
CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE));
|
||||
spin_unlock_irq(&port->lock);
|
||||
CIRC_CNT(head, tail, UART_XMIT_SIZE),
|
||||
CIRC_CNT_TO_END(head, tail, UART_XMIT_SIZE));
|
||||
if (!s->tx_dma_len) {
|
||||
/* Transmit buffer has been flushed */
|
||||
spin_unlock_irq(&port->lock);
|
||||
return;
|
||||
}
|
||||
|
||||
desc = dmaengine_prep_slave_single(chan, buf, s->tx_dma_len,
|
||||
DMA_MEM_TO_DEV,
|
||||
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||||
if (!desc) {
|
||||
spin_unlock_irq(&port->lock);
|
||||
dev_warn(port->dev, "Failed preparing Tx DMA descriptor\n");
|
||||
/* switch to PIO */
|
||||
sci_tx_dma_release(s, true);
|
||||
|
@ -1231,20 +1239,20 @@ static void work_fn_tx(struct work_struct *work)
|
|||
dma_sync_single_for_device(chan->device->dev, buf, s->tx_dma_len,
|
||||
DMA_TO_DEVICE);
|
||||
|
||||
spin_lock_irq(&port->lock);
|
||||
desc->callback = sci_dma_tx_complete;
|
||||
desc->callback_param = s;
|
||||
spin_unlock_irq(&port->lock);
|
||||
s->cookie_tx = dmaengine_submit(desc);
|
||||
if (dma_submit_error(s->cookie_tx)) {
|
||||
spin_unlock_irq(&port->lock);
|
||||
dev_warn(port->dev, "Failed submitting Tx DMA descriptor\n");
|
||||
/* switch to PIO */
|
||||
sci_tx_dma_release(s, true);
|
||||
return;
|
||||
}
|
||||
|
||||
spin_unlock_irq(&port->lock);
|
||||
dev_dbg(port->dev, "%s: %p: %d...%d, cookie %d\n",
|
||||
__func__, xmit->buf, xmit->tail, xmit->head, s->cookie_tx);
|
||||
__func__, xmit->buf, tail, head, s->cookie_tx);
|
||||
|
||||
dma_async_issue_pending(chan);
|
||||
}
|
||||
|
|
|
@ -3492,6 +3492,7 @@ static int hub_handle_remote_wakeup(struct usb_hub *hub, unsigned int port,
|
|||
struct usb_device *hdev;
|
||||
struct usb_device *udev;
|
||||
int connect_change = 0;
|
||||
u16 link_state;
|
||||
int ret;
|
||||
|
||||
hdev = hub->hdev;
|
||||
|
@ -3501,9 +3502,11 @@ static int hub_handle_remote_wakeup(struct usb_hub *hub, unsigned int port,
|
|||
return 0;
|
||||
usb_clear_port_feature(hdev, port, USB_PORT_FEAT_C_SUSPEND);
|
||||
} else {
|
||||
link_state = portstatus & USB_PORT_STAT_LINK_STATE;
|
||||
if (!udev || udev->state != USB_STATE_SUSPENDED ||
|
||||
(portstatus & USB_PORT_STAT_LINK_STATE) !=
|
||||
USB_SS_PORT_LS_U0)
|
||||
(link_state != USB_SS_PORT_LS_U0 &&
|
||||
link_state != USB_SS_PORT_LS_U1 &&
|
||||
link_state != USB_SS_PORT_LS_U2))
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3833,6 +3836,9 @@ static int usb_set_lpm_timeout(struct usb_device *udev,
|
|||
* control transfers to set the hub timeout or enable device-initiated U1/U2
|
||||
* will be successful.
|
||||
*
|
||||
* If the control transfer to enable device-initiated U1/U2 entry fails, then
|
||||
* hub-initiated U1/U2 will be disabled.
|
||||
*
|
||||
* If we cannot set the parent hub U1/U2 timeout, we attempt to let the xHCI
|
||||
* driver know about it. If that call fails, it should be harmless, and just
|
||||
* take up more slightly more bus bandwidth for unnecessary U1/U2 exit latency.
|
||||
|
@ -3887,23 +3893,24 @@ static void usb_enable_link_state(struct usb_hcd *hcd, struct usb_device *udev,
|
|||
* host know that this link state won't be enabled.
|
||||
*/
|
||||
hcd->driver->disable_usb3_lpm_timeout(hcd, udev, state);
|
||||
} else {
|
||||
/* Only a configured device will accept the Set Feature
|
||||
* U1/U2_ENABLE
|
||||
*/
|
||||
if (udev->actconfig)
|
||||
usb_set_device_initiated_lpm(udev, state, true);
|
||||
return;
|
||||
}
|
||||
|
||||
/* As soon as usb_set_lpm_timeout(timeout) returns 0, the
|
||||
* hub-initiated LPM is enabled. Thus, LPM is enabled no
|
||||
* matter the result of usb_set_device_initiated_lpm().
|
||||
* The only difference is whether device is able to initiate
|
||||
* LPM.
|
||||
*/
|
||||
/* Only a configured device will accept the Set Feature
|
||||
* U1/U2_ENABLE
|
||||
*/
|
||||
if (udev->actconfig &&
|
||||
usb_set_device_initiated_lpm(udev, state, true) == 0) {
|
||||
if (state == USB3_LPM_U1)
|
||||
udev->usb3_lpm_u1_enabled = 1;
|
||||
else if (state == USB3_LPM_U2)
|
||||
udev->usb3_lpm_u2_enabled = 1;
|
||||
} else {
|
||||
/* Don't request U1/U2 entry if the device
|
||||
* cannot transition to U1/U2.
|
||||
*/
|
||||
usb_set_lpm_timeout(udev, state, 0);
|
||||
hcd->driver->disable_usb3_lpm_timeout(hcd, udev, state);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1167,11 +1167,12 @@ static ssize_t ffs_epfile_write_iter(struct kiocb *kiocb, struct iov_iter *from)
|
|||
ffs_log("enter");
|
||||
|
||||
if (!is_sync_kiocb(kiocb)) {
|
||||
p = kmalloc(sizeof(io_data), GFP_KERNEL);
|
||||
p = kzalloc(sizeof(io_data), GFP_KERNEL);
|
||||
if (unlikely(!p))
|
||||
return -ENOMEM;
|
||||
p->aio = true;
|
||||
} else {
|
||||
memset(p, 0, sizeof(*p));
|
||||
p->aio = false;
|
||||
}
|
||||
|
||||
|
@ -1208,11 +1209,12 @@ static ssize_t ffs_epfile_read_iter(struct kiocb *kiocb, struct iov_iter *to)
|
|||
ffs_log("enter");
|
||||
|
||||
if (!is_sync_kiocb(kiocb)) {
|
||||
p = kmalloc(sizeof(io_data), GFP_KERNEL);
|
||||
p = kzalloc(sizeof(io_data), GFP_KERNEL);
|
||||
if (unlikely(!p))
|
||||
return -ENOMEM;
|
||||
p->aio = true;
|
||||
} else {
|
||||
memset(p, 0, sizeof(*p));
|
||||
p->aio = false;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue