This is the 4.9.152 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlxIE4IACgkQONu9yGCS aT6V7xAAvLU/dqvYh0b6FPsYyKVON/OCN7+7MuLV/v0OseL25QboT3GWTZOoEl36 9bm13s71sdHctJsgnIEtc1wLcRO3PhztbH+Rz3hYojhsJkIw3V0eFZH2QOGzqUC8 yoX+MkxuBT3Y0nBNxS78k1eeaMn8OBeLlZHHi2/WTLT4VG+bkl/ZPq8QEnyAkCa5 nPBuEvNfs1iGT7NMf/yJg0LrGMU7OKnR1oLRW88DGwDls+zM1KUa51+T5e8anS2E vOex+sfZ0HezX06dBfzRQFHhkb/SEffk3xWRl6i4CLvOZZHHleIrmYTs1hQCNOHE NcK6P0J92HSjTPXuRDBFsdOIUPWNG+Js6C3AkMBIza4a5XIpmPNy+gOEH+L6ZzfK FwGvbxJAgy/lIWsnULHRetJFvUph+hLIompSR2YBV76PLiuMbcszzeiIvgvZMm91 GU64kgraC8iOblsjbOBbAf98EXPqTP6AyLQjNqCuF2Mp0glMhomiUDk62cUrjkwy ThS0UvHniMlbJIh07lUtf/0+VQr0WN6/V4dw2g2/2K9V4n02665l0PaJKy9ZCI19 qhEm4g3hyXssB0dkgxdPzzzeIMrLUPXeiU0fqi5MZW8qP5YWkwNn/JoOJ7zS9YVt QO9nkidnQmRsdRPndRWCHfKBefOGQ60gRGwaaW4xpQYz+nvzex4= =YtAA -----END PGP SIGNATURE----- Merge 4.9.152 into android-4.9 Changes in 4.9.152 tty/ldsem: Wake up readers after timed out down_write() tty: Hold tty_ldisc_lock() during tty_reopen() tty: Simplify tty->count math in tty_reopen() tty: Don't hold ldisc lock in tty_reopen() if ldisc present can: gw: ensure DLC boundaries after CAN frame modification Revert "f2fs: do not recover from previous remained wrong dnodes" media: em28xx: Fix misplaced reset of dev->v4l::field_count proc: Remove empty line in /proc/self/status Revert "scsi: target: iscsi: cxgbit: fix csk leak" scsi: target: iscsi: cxgbit: fix csk leak arm64/kvm: consistently handle host HCR_EL2 flags arm64: Don't trap host pointer auth use to EL2 ipv6: fix kernel-infoleak in ipv6_local_error() net: bridge: fix a bug on using a neighbour cache entry without checking its state packet: Do not leak dev refcounts on error exit bonding: update nest level on unlink ip: on queued skb use skb_header_pointer instead of pskb_may_pull crypto: caam - fix zero-length buffer DMA mapping crypto: authencesn - Avoid twice completion call in decrypt path crypto: authenc - fix parsing key with misaligned rta_len btrfs: wait on ordered extents on abort cleanup Yama: Check for pid death before checking ancestry scsi: core: Synchronize request queue PM status only on successful resume scsi: sd: Fix cache_type_store() crypto: talitos - reorder code in talitos_edesc_alloc() crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK mips: fix n32 compat_ipc_parse_version mfd: tps6586x: Handle interrupts on suspend arm64: kaslr: ensure randomized quantities are clean to the PoC Disable MSI also when pcie-octeon.pcie_disable on omap2fb: Fix stack memory disclosure media: vivid: fix error handling of kthread_run media: vivid: set min width/height to a value > 0 LSM: Check for NULL cred-security on free media: vb2: vb2_mmap: move lock up sunrpc: handle ENOMEM in rpcb_getport_async netfilter: ebtables: account ebt_table_info to kmemcg selinux: fix GPF on invalid policy blockdev: Fix livelocks on loop device sctp: allocate sctp_sockaddr_entry with kzalloc tipc: fix uninit-value in tipc_nl_compat_link_reset_stats tipc: fix uninit-value in tipc_nl_compat_bearer_enable tipc: fix uninit-value in tipc_nl_compat_link_set tipc: fix uninit-value in tipc_nl_compat_name_table_dump tipc: fix uninit-value in tipc_nl_compat_doit block/loop: Use global lock for ioctl() operation. loop: Fold __loop_release into loop_release loop: Get rid of loop_index_mutex loop: Fix double mutex_unlock(&loop_ctl_mutex) in loop_control_ioctl() drm/fb-helper: Ignore the value of fb_var_screeninfo.pixclock mm, memcg: fix reclaim deadlock with writeback media: vb2: be sure to unlock mutex on errors nbd: set the logical and physical blocksize properly nbd: Use set_blocksize() to set device blocksize Linux 4.9.152 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
fd37e28592
44 changed files with 367 additions and 170 deletions
2
Makefile
2
Makefile
|
|
@ -1,6 +1,6 @@
|
|||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 151
|
||||
SUBLEVEL = 152
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
#include <asm/types.h>
|
||||
|
||||
/* Hyp Configuration Register (HCR) bits */
|
||||
#define HCR_API (UL(1) << 41)
|
||||
#define HCR_APK (UL(1) << 40)
|
||||
#define HCR_E2H (UL(1) << 34)
|
||||
#define HCR_ID (UL(1) << 33)
|
||||
#define HCR_CD (UL(1) << 32)
|
||||
|
|
@ -82,6 +84,7 @@
|
|||
HCR_AMO | HCR_SWIO | HCR_TIDCP | HCR_RW)
|
||||
#define HCR_VIRT_EXCP_MASK (HCR_VSE | HCR_VI | HCR_VF)
|
||||
#define HCR_INT_OVERRIDE (HCR_FMO | HCR_IMO)
|
||||
#define HCR_HOST_NVHE_FLAGS (HCR_RW | HCR_API | HCR_APK)
|
||||
#define HCR_HOST_VHE_FLAGS (HCR_RW | HCR_TGE | HCR_E2H)
|
||||
|
||||
/* TCR_EL2 Registers bits */
|
||||
|
|
|
|||
|
|
@ -518,10 +518,9 @@ CPU_LE( bic x0, x0, #(3 << 24) ) // Clear the EE and E0E bits for EL1
|
|||
#endif
|
||||
|
||||
/* Hyp configuration. */
|
||||
mov x0, #HCR_RW // 64-bit EL1
|
||||
mov_q x0, HCR_HOST_NVHE_FLAGS
|
||||
cbz x2, set_hcr
|
||||
orr x0, x0, #HCR_TGE // Enable Host Extensions
|
||||
orr x0, x0, #HCR_E2H
|
||||
mov_q x0, HCR_HOST_VHE_FLAGS
|
||||
set_hcr:
|
||||
msr hcr_el2, x0
|
||||
isb
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <linux/sched.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/fixmap.h>
|
||||
#include <asm/kernel-pgtable.h>
|
||||
#include <asm/memory.h>
|
||||
|
|
@ -43,7 +44,7 @@ static __init u64 get_kaslr_seed(void *fdt)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static __init const u8 *get_cmdline(void *fdt)
|
||||
static __init const u8 *kaslr_get_cmdline(void *fdt)
|
||||
{
|
||||
static __initconst const u8 default_cmdline[] = CONFIG_CMDLINE;
|
||||
|
||||
|
|
@ -109,7 +110,7 @@ u64 __init kaslr_early_init(u64 dt_phys, u64 modulo_offset)
|
|||
* Check if 'nokaslr' appears on the command line, and
|
||||
* return 0 if that is the case.
|
||||
*/
|
||||
cmdline = get_cmdline(fdt);
|
||||
cmdline = kaslr_get_cmdline(fdt);
|
||||
str = strstr(cmdline, "nokaslr");
|
||||
if (str == cmdline || (str > cmdline && *(str - 1) == ' '))
|
||||
return 0;
|
||||
|
|
@ -178,5 +179,8 @@ u64 __init kaslr_early_init(u64 dt_phys, u64 modulo_offset)
|
|||
module_alloc_base += (module_range * (seed & ((1 << 21) - 1))) >> 21;
|
||||
module_alloc_base &= PAGE_MASK;
|
||||
|
||||
__flush_dcache_area(&module_alloc_base, sizeof(module_alloc_base));
|
||||
__flush_dcache_area(&memstart_offset_seed, sizeof(memstart_offset_seed));
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ static void __hyp_text __deactivate_traps_vhe(void)
|
|||
|
||||
static void __hyp_text __deactivate_traps_nvhe(void)
|
||||
{
|
||||
write_sysreg(HCR_RW, hcr_el2);
|
||||
write_sysreg(HCR_HOST_NVHE_FLAGS, hcr_el2);
|
||||
write_sysreg(CPTR_EL2_DEFAULT, cptr_el2);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3135,6 +3135,7 @@ config MIPS32_O32
|
|||
config MIPS32_N32
|
||||
bool "Kernel support for n32 binaries"
|
||||
depends on 64BIT
|
||||
select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
|
||||
select COMPAT
|
||||
select MIPS32_COMPAT
|
||||
select SYSVIPC_COMPAT if SYSVIPC
|
||||
|
|
|
|||
|
|
@ -369,7 +369,9 @@ int __init octeon_msi_initialize(void)
|
|||
int irq;
|
||||
struct irq_chip *msi;
|
||||
|
||||
if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
|
||||
if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_INVALID) {
|
||||
return 0;
|
||||
} else if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
|
||||
msi_rcv_reg[0] = CVMX_PEXP_NPEI_MSI_RCV0;
|
||||
msi_rcv_reg[1] = CVMX_PEXP_NPEI_MSI_RCV1;
|
||||
msi_rcv_reg[2] = CVMX_PEXP_NPEI_MSI_RCV2;
|
||||
|
|
|
|||
|
|
@ -58,14 +58,22 @@ int crypto_authenc_extractkeys(struct crypto_authenc_keys *keys, const u8 *key,
|
|||
return -EINVAL;
|
||||
if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM)
|
||||
return -EINVAL;
|
||||
if (RTA_PAYLOAD(rta) < sizeof(*param))
|
||||
|
||||
/*
|
||||
* RTA_OK() didn't align the rtattr's payload when validating that it
|
||||
* fits in the buffer. Yet, the keys should start on the next 4-byte
|
||||
* aligned boundary. To avoid confusion, require that the rtattr
|
||||
* payload be exactly the param struct, which has a 4-byte aligned size.
|
||||
*/
|
||||
if (RTA_PAYLOAD(rta) != sizeof(*param))
|
||||
return -EINVAL;
|
||||
BUILD_BUG_ON(sizeof(*param) % RTA_ALIGNTO);
|
||||
|
||||
param = RTA_DATA(rta);
|
||||
keys->enckeylen = be32_to_cpu(param->enckeylen);
|
||||
|
||||
key += RTA_ALIGN(rta->rta_len);
|
||||
keylen -= RTA_ALIGN(rta->rta_len);
|
||||
key += rta->rta_len;
|
||||
keylen -= rta->rta_len;
|
||||
|
||||
if (keylen < keys->enckeylen)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ static void authenc_esn_verify_ahash_done(struct crypto_async_request *areq,
|
|||
struct aead_request *req = areq->data;
|
||||
|
||||
err = err ?: crypto_authenc_esn_decrypt_tail(req, 0);
|
||||
aead_request_complete(req, err);
|
||||
authenc_esn_request_complete(req, err);
|
||||
}
|
||||
|
||||
static int crypto_authenc_esn_decrypt(struct aead_request *req)
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@
|
|||
#include <asm/uaccess.h>
|
||||
|
||||
static DEFINE_IDR(loop_index_idr);
|
||||
static DEFINE_MUTEX(loop_index_mutex);
|
||||
static DEFINE_MUTEX(loop_ctl_mutex);
|
||||
|
||||
static int max_part;
|
||||
static int part_shift;
|
||||
|
|
@ -1033,7 +1033,7 @@ static int loop_clr_fd(struct loop_device *lo)
|
|||
*/
|
||||
if (atomic_read(&lo->lo_refcnt) > 1) {
|
||||
lo->lo_flags |= LO_FLAGS_AUTOCLEAR;
|
||||
mutex_unlock(&lo->lo_ctl_mutex);
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1083,12 +1083,12 @@ static int loop_clr_fd(struct loop_device *lo)
|
|||
if (!part_shift)
|
||||
lo->lo_disk->flags |= GENHD_FL_NO_PART_SCAN;
|
||||
loop_unprepare_queue(lo);
|
||||
mutex_unlock(&lo->lo_ctl_mutex);
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
/*
|
||||
* Need not hold lo_ctl_mutex to fput backing file.
|
||||
* Calling fput holding lo_ctl_mutex triggers a circular
|
||||
* Need not hold loop_ctl_mutex to fput backing file.
|
||||
* Calling fput holding loop_ctl_mutex triggers a circular
|
||||
* lock dependency possibility warning as fput can take
|
||||
* bd_mutex which is usually taken before lo_ctl_mutex.
|
||||
* bd_mutex which is usually taken before loop_ctl_mutex.
|
||||
*/
|
||||
fput(filp);
|
||||
return 0;
|
||||
|
|
@ -1401,7 +1401,7 @@ static int lo_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
struct loop_device *lo = bdev->bd_disk->private_data;
|
||||
int err;
|
||||
|
||||
mutex_lock_nested(&lo->lo_ctl_mutex, 1);
|
||||
mutex_lock_nested(&loop_ctl_mutex, 1);
|
||||
switch (cmd) {
|
||||
case LOOP_SET_FD:
|
||||
err = loop_set_fd(lo, mode, bdev, arg);
|
||||
|
|
@ -1410,7 +1410,7 @@ static int lo_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
err = loop_change_fd(lo, bdev, arg);
|
||||
break;
|
||||
case LOOP_CLR_FD:
|
||||
/* loop_clr_fd would have unlocked lo_ctl_mutex on success */
|
||||
/* loop_clr_fd would have unlocked loop_ctl_mutex on success */
|
||||
err = loop_clr_fd(lo);
|
||||
if (!err)
|
||||
goto out_unlocked;
|
||||
|
|
@ -1451,7 +1451,7 @@ static int lo_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
default:
|
||||
err = lo->ioctl ? lo->ioctl(lo, cmd, arg) : -EINVAL;
|
||||
}
|
||||
mutex_unlock(&lo->lo_ctl_mutex);
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
|
||||
out_unlocked:
|
||||
return err;
|
||||
|
|
@ -1584,16 +1584,16 @@ static int lo_compat_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
|
||||
switch(cmd) {
|
||||
case LOOP_SET_STATUS:
|
||||
mutex_lock(&lo->lo_ctl_mutex);
|
||||
mutex_lock(&loop_ctl_mutex);
|
||||
err = loop_set_status_compat(
|
||||
lo, (const struct compat_loop_info __user *) arg);
|
||||
mutex_unlock(&lo->lo_ctl_mutex);
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
break;
|
||||
case LOOP_GET_STATUS:
|
||||
mutex_lock(&lo->lo_ctl_mutex);
|
||||
mutex_lock(&loop_ctl_mutex);
|
||||
err = loop_get_status_compat(
|
||||
lo, (struct compat_loop_info __user *) arg);
|
||||
mutex_unlock(&lo->lo_ctl_mutex);
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
break;
|
||||
case LOOP_SET_CAPACITY:
|
||||
case LOOP_CLR_FD:
|
||||
|
|
@ -1616,9 +1616,11 @@ static int lo_compat_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
static int lo_open(struct block_device *bdev, fmode_t mode)
|
||||
{
|
||||
struct loop_device *lo;
|
||||
int err = 0;
|
||||
int err;
|
||||
|
||||
mutex_lock(&loop_index_mutex);
|
||||
err = mutex_lock_killable(&loop_ctl_mutex);
|
||||
if (err)
|
||||
return err;
|
||||
lo = bdev->bd_disk->private_data;
|
||||
if (!lo) {
|
||||
err = -ENXIO;
|
||||
|
|
@ -1627,18 +1629,20 @@ static int lo_open(struct block_device *bdev, fmode_t mode)
|
|||
|
||||
atomic_inc(&lo->lo_refcnt);
|
||||
out:
|
||||
mutex_unlock(&loop_index_mutex);
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
return err;
|
||||
}
|
||||
|
||||
static void __lo_release(struct loop_device *lo)
|
||||
static void lo_release(struct gendisk *disk, fmode_t mode)
|
||||
{
|
||||
struct loop_device *lo;
|
||||
int err;
|
||||
|
||||
mutex_lock(&loop_ctl_mutex);
|
||||
lo = disk->private_data;
|
||||
if (atomic_dec_return(&lo->lo_refcnt))
|
||||
return;
|
||||
goto out_unlock;
|
||||
|
||||
mutex_lock(&lo->lo_ctl_mutex);
|
||||
if (lo->lo_flags & LO_FLAGS_AUTOCLEAR) {
|
||||
/*
|
||||
* In autoclear mode, stop the loop thread
|
||||
|
|
@ -1655,14 +1659,8 @@ static void __lo_release(struct loop_device *lo)
|
|||
loop_flush(lo);
|
||||
}
|
||||
|
||||
mutex_unlock(&lo->lo_ctl_mutex);
|
||||
}
|
||||
|
||||
static void lo_release(struct gendisk *disk, fmode_t mode)
|
||||
{
|
||||
mutex_lock(&loop_index_mutex);
|
||||
__lo_release(disk->private_data);
|
||||
mutex_unlock(&loop_index_mutex);
|
||||
out_unlock:
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
}
|
||||
|
||||
static const struct block_device_operations lo_fops = {
|
||||
|
|
@ -1701,10 +1699,10 @@ static int unregister_transfer_cb(int id, void *ptr, void *data)
|
|||
struct loop_device *lo = ptr;
|
||||
struct loop_func_table *xfer = data;
|
||||
|
||||
mutex_lock(&lo->lo_ctl_mutex);
|
||||
mutex_lock(&loop_ctl_mutex);
|
||||
if (lo->lo_encryption == xfer)
|
||||
loop_release_xfer(lo);
|
||||
mutex_unlock(&lo->lo_ctl_mutex);
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1871,7 +1869,6 @@ static int loop_add(struct loop_device **l, int i)
|
|||
if (!part_shift)
|
||||
disk->flags |= GENHD_FL_NO_PART_SCAN;
|
||||
disk->flags |= GENHD_FL_EXT_DEVT;
|
||||
mutex_init(&lo->lo_ctl_mutex);
|
||||
atomic_set(&lo->lo_refcnt, 0);
|
||||
lo->lo_number = i;
|
||||
spin_lock_init(&lo->lo_lock);
|
||||
|
|
@ -1950,7 +1947,7 @@ static struct kobject *loop_probe(dev_t dev, int *part, void *data)
|
|||
struct kobject *kobj;
|
||||
int err;
|
||||
|
||||
mutex_lock(&loop_index_mutex);
|
||||
mutex_lock(&loop_ctl_mutex);
|
||||
err = loop_lookup(&lo, MINOR(dev) >> part_shift);
|
||||
if (err < 0)
|
||||
err = loop_add(&lo, MINOR(dev) >> part_shift);
|
||||
|
|
@ -1958,7 +1955,7 @@ static struct kobject *loop_probe(dev_t dev, int *part, void *data)
|
|||
kobj = NULL;
|
||||
else
|
||||
kobj = get_disk(lo->lo_disk);
|
||||
mutex_unlock(&loop_index_mutex);
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
|
||||
*part = 0;
|
||||
return kobj;
|
||||
|
|
@ -1968,9 +1965,13 @@ static long loop_control_ioctl(struct file *file, unsigned int cmd,
|
|||
unsigned long parm)
|
||||
{
|
||||
struct loop_device *lo;
|
||||
int ret = -ENOSYS;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&loop_index_mutex);
|
||||
ret = mutex_lock_killable(&loop_ctl_mutex);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = -ENOSYS;
|
||||
switch (cmd) {
|
||||
case LOOP_CTL_ADD:
|
||||
ret = loop_lookup(&lo, parm);
|
||||
|
|
@ -1984,19 +1985,15 @@ static long loop_control_ioctl(struct file *file, unsigned int cmd,
|
|||
ret = loop_lookup(&lo, parm);
|
||||
if (ret < 0)
|
||||
break;
|
||||
mutex_lock(&lo->lo_ctl_mutex);
|
||||
if (lo->lo_state != Lo_unbound) {
|
||||
ret = -EBUSY;
|
||||
mutex_unlock(&lo->lo_ctl_mutex);
|
||||
break;
|
||||
}
|
||||
if (atomic_read(&lo->lo_refcnt) > 0) {
|
||||
ret = -EBUSY;
|
||||
mutex_unlock(&lo->lo_ctl_mutex);
|
||||
break;
|
||||
}
|
||||
lo->lo_disk->private_data = NULL;
|
||||
mutex_unlock(&lo->lo_ctl_mutex);
|
||||
idr_remove(&loop_index_idr, lo->lo_number);
|
||||
loop_remove(lo);
|
||||
break;
|
||||
|
|
@ -2006,7 +2003,7 @@ static long loop_control_ioctl(struct file *file, unsigned int cmd,
|
|||
break;
|
||||
ret = loop_add(&lo, -1);
|
||||
}
|
||||
mutex_unlock(&loop_index_mutex);
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -2089,10 +2086,10 @@ static int __init loop_init(void)
|
|||
THIS_MODULE, loop_probe, NULL, NULL);
|
||||
|
||||
/* pre-create number of devices given by config or max_loop */
|
||||
mutex_lock(&loop_index_mutex);
|
||||
mutex_lock(&loop_ctl_mutex);
|
||||
for (i = 0; i < nr; i++)
|
||||
loop_add(&lo, i);
|
||||
mutex_unlock(&loop_index_mutex);
|
||||
mutex_unlock(&loop_ctl_mutex);
|
||||
|
||||
printk(KERN_INFO "loop: module loaded\n");
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ struct loop_device {
|
|||
|
||||
spinlock_t lo_lock;
|
||||
int lo_state;
|
||||
struct mutex lo_ctl_mutex;
|
||||
struct kthread_worker worker;
|
||||
struct task_struct *worker_task;
|
||||
bool use_dio;
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ static const char *nbdcmd_to_ascii(int cmd)
|
|||
|
||||
static int nbd_size_clear(struct nbd_device *nbd, struct block_device *bdev)
|
||||
{
|
||||
bdev->bd_inode->i_size = 0;
|
||||
bd_set_size(bdev, 0);
|
||||
set_capacity(nbd->disk, 0);
|
||||
kobject_uevent(&nbd_to_dev(nbd)->kobj, KOBJ_CHANGE);
|
||||
|
||||
|
|
@ -117,29 +117,21 @@ static int nbd_size_clear(struct nbd_device *nbd, struct block_device *bdev)
|
|||
|
||||
static void nbd_size_update(struct nbd_device *nbd, struct block_device *bdev)
|
||||
{
|
||||
if (!nbd_is_connected(nbd))
|
||||
return;
|
||||
|
||||
bdev->bd_inode->i_size = nbd->bytesize;
|
||||
blk_queue_logical_block_size(nbd->disk->queue, nbd->blksize);
|
||||
blk_queue_physical_block_size(nbd->disk->queue, nbd->blksize);
|
||||
bd_set_size(bdev, nbd->bytesize);
|
||||
set_blocksize(bdev, nbd->blksize);
|
||||
set_capacity(nbd->disk, nbd->bytesize >> 9);
|
||||
kobject_uevent(&nbd_to_dev(nbd)->kobj, KOBJ_CHANGE);
|
||||
}
|
||||
|
||||
static int nbd_size_set(struct nbd_device *nbd, struct block_device *bdev,
|
||||
static void nbd_size_set(struct nbd_device *nbd, struct block_device *bdev,
|
||||
loff_t blocksize, loff_t nr_blocks)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = set_blocksize(bdev, blocksize);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
nbd->blksize = blocksize;
|
||||
nbd->bytesize = blocksize * nr_blocks;
|
||||
|
||||
nbd_size_update(nbd, bdev);
|
||||
|
||||
return 0;
|
||||
if (nbd_is_connected(nbd))
|
||||
nbd_size_update(nbd, bdev);
|
||||
}
|
||||
|
||||
static void nbd_end_request(struct nbd_cmd *cmd)
|
||||
|
|
@ -655,16 +647,17 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
|
|||
case NBD_SET_BLKSIZE: {
|
||||
loff_t bsize = div_s64(nbd->bytesize, arg);
|
||||
|
||||
return nbd_size_set(nbd, bdev, arg, bsize);
|
||||
nbd_size_set(nbd, bdev, arg, bsize);
|
||||
return 0;
|
||||
}
|
||||
|
||||
case NBD_SET_SIZE:
|
||||
return nbd_size_set(nbd, bdev, nbd->blksize,
|
||||
div_s64(arg, nbd->blksize));
|
||||
|
||||
nbd_size_set(nbd, bdev, nbd->blksize,
|
||||
div_s64(arg, nbd->blksize));
|
||||
return 0;
|
||||
case NBD_SET_SIZE_BLOCKS:
|
||||
return nbd_size_set(nbd, bdev, nbd->blksize, arg);
|
||||
|
||||
nbd_size_set(nbd, bdev, nbd->blksize, arg);
|
||||
return 0;
|
||||
case NBD_SET_TIMEOUT:
|
||||
if (arg) {
|
||||
nbd->tag_set.timeout = arg * HZ;
|
||||
|
|
|
|||
|
|
@ -1232,13 +1232,16 @@ static int ahash_final_no_ctx(struct ahash_request *req)
|
|||
|
||||
desc = edesc->hw_desc;
|
||||
|
||||
state->buf_dma = dma_map_single(jrdev, buf, buflen, DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(jrdev, state->buf_dma)) {
|
||||
dev_err(jrdev, "unable to map src\n");
|
||||
goto unmap;
|
||||
}
|
||||
if (buflen) {
|
||||
state->buf_dma = dma_map_single(jrdev, buf, buflen,
|
||||
DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(jrdev, state->buf_dma)) {
|
||||
dev_err(jrdev, "unable to map src\n");
|
||||
goto unmap;
|
||||
}
|
||||
|
||||
append_seq_in_ptr(desc, state->buf_dma, buflen, 0);
|
||||
append_seq_in_ptr(desc, state->buf_dma, buflen, 0);
|
||||
}
|
||||
|
||||
edesc->dst_dma = map_seq_out_ptr_result(desc, jrdev, req->result,
|
||||
digestsize);
|
||||
|
|
|
|||
|
|
@ -1347,23 +1347,18 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev,
|
|||
struct talitos_private *priv = dev_get_drvdata(dev);
|
||||
bool is_sec1 = has_ftr_sec1(priv);
|
||||
int max_len = is_sec1 ? TALITOS1_MAX_DATA_LEN : TALITOS2_MAX_DATA_LEN;
|
||||
void *err;
|
||||
|
||||
if (cryptlen + authsize > max_len) {
|
||||
dev_err(dev, "length exceeds h/w max limit\n");
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
if (ivsize)
|
||||
iv_dma = dma_map_single(dev, iv, ivsize, DMA_TO_DEVICE);
|
||||
|
||||
if (!dst || dst == src) {
|
||||
src_len = assoclen + cryptlen + authsize;
|
||||
src_nents = sg_nents_for_len(src, src_len);
|
||||
if (src_nents < 0) {
|
||||
dev_err(dev, "Invalid number of src SG.\n");
|
||||
err = ERR_PTR(-EINVAL);
|
||||
goto error_sg;
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
src_nents = (src_nents == 1) ? 0 : src_nents;
|
||||
dst_nents = dst ? src_nents : 0;
|
||||
|
|
@ -1373,16 +1368,14 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev,
|
|||
src_nents = sg_nents_for_len(src, src_len);
|
||||
if (src_nents < 0) {
|
||||
dev_err(dev, "Invalid number of src SG.\n");
|
||||
err = ERR_PTR(-EINVAL);
|
||||
goto error_sg;
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
src_nents = (src_nents == 1) ? 0 : src_nents;
|
||||
dst_len = assoclen + cryptlen + (encrypt ? authsize : 0);
|
||||
dst_nents = sg_nents_for_len(dst, dst_len);
|
||||
if (dst_nents < 0) {
|
||||
dev_err(dev, "Invalid number of dst SG.\n");
|
||||
err = ERR_PTR(-EINVAL);
|
||||
goto error_sg;
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
dst_nents = (dst_nents == 1) ? 0 : dst_nents;
|
||||
}
|
||||
|
|
@ -1405,12 +1398,14 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev,
|
|||
dma_len = 0;
|
||||
alloc_len += icv_stashing ? authsize : 0;
|
||||
}
|
||||
alloc_len += ivsize;
|
||||
|
||||
edesc = kmalloc(alloc_len, GFP_DMA | flags);
|
||||
if (!edesc) {
|
||||
dev_err(dev, "could not allocate edescriptor\n");
|
||||
err = ERR_PTR(-ENOMEM);
|
||||
goto error_sg;
|
||||
if (!edesc)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
if (ivsize) {
|
||||
iv = memcpy(((u8 *)edesc) + alloc_len - ivsize, iv, ivsize);
|
||||
iv_dma = dma_map_single(dev, iv, ivsize, DMA_TO_DEVICE);
|
||||
}
|
||||
|
||||
edesc->src_nents = src_nents;
|
||||
|
|
@ -1423,10 +1418,6 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev,
|
|||
DMA_BIDIRECTIONAL);
|
||||
|
||||
return edesc;
|
||||
error_sg:
|
||||
if (iv_dma)
|
||||
dma_unmap_single(dev, iv_dma, ivsize, DMA_TO_DEVICE);
|
||||
return err;
|
||||
}
|
||||
|
||||
static struct talitos_edesc *aead_edesc_alloc(struct aead_request *areq, u8 *iv,
|
||||
|
|
|
|||
|
|
@ -1238,9 +1238,14 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
|
|||
struct drm_framebuffer *fb = fb_helper->fb;
|
||||
int depth;
|
||||
|
||||
if (var->pixclock != 0 || in_dbg_master())
|
||||
if (in_dbg_master())
|
||||
return -EINVAL;
|
||||
|
||||
if (var->pixclock != 0) {
|
||||
DRM_DEBUG("fbdev emulation doesn't support changing the pixel clock, value of pixclock is ignored\n");
|
||||
var->pixclock = 0;
|
||||
}
|
||||
|
||||
/* Need to resize the fb object !!! */
|
||||
if (var->bits_per_pixel > fb->bits_per_pixel ||
|
||||
var->xres > fb->width || var->yres > fb->height ||
|
||||
|
|
|
|||
|
|
@ -877,8 +877,11 @@ int vivid_start_generating_vid_cap(struct vivid_dev *dev, bool *pstreaming)
|
|||
"%s-vid-cap", dev->v4l2_dev.name);
|
||||
|
||||
if (IS_ERR(dev->kthread_vid_cap)) {
|
||||
int err = PTR_ERR(dev->kthread_vid_cap);
|
||||
|
||||
dev->kthread_vid_cap = NULL;
|
||||
v4l2_err(&dev->v4l2_dev, "kernel_thread() failed\n");
|
||||
return PTR_ERR(dev->kthread_vid_cap);
|
||||
return err;
|
||||
}
|
||||
*pstreaming = true;
|
||||
vivid_grab_controls(dev, true);
|
||||
|
|
|
|||
|
|
@ -248,8 +248,11 @@ int vivid_start_generating_vid_out(struct vivid_dev *dev, bool *pstreaming)
|
|||
"%s-vid-out", dev->v4l2_dev.name);
|
||||
|
||||
if (IS_ERR(dev->kthread_vid_out)) {
|
||||
int err = PTR_ERR(dev->kthread_vid_out);
|
||||
|
||||
dev->kthread_vid_out = NULL;
|
||||
v4l2_err(&dev->v4l2_dev, "kernel_thread() failed\n");
|
||||
return PTR_ERR(dev->kthread_vid_out);
|
||||
return err;
|
||||
}
|
||||
*pstreaming = true;
|
||||
vivid_grab_controls(dev, true);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ const struct v4l2_dv_timings_cap vivid_dv_timings_cap = {
|
|||
.type = V4L2_DV_BT_656_1120,
|
||||
/* keep this initialization for compatibility with GCC < 4.4.6 */
|
||||
.reserved = { 0 },
|
||||
V4L2_INIT_BT_TIMINGS(0, MAX_WIDTH, 0, MAX_HEIGHT, 14000000, 775000000,
|
||||
V4L2_INIT_BT_TIMINGS(16, MAX_WIDTH, 16, MAX_HEIGHT, 14000000, 775000000,
|
||||
V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
|
||||
V4L2_DV_BT_STD_CVT | V4L2_DV_BT_STD_GTF,
|
||||
V4L2_DV_BT_CAP_PROGRESSIVE | V4L2_DV_BT_CAP_INTERLACED)
|
||||
|
|
|
|||
|
|
@ -1062,6 +1062,8 @@ int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count)
|
|||
|
||||
em28xx_videodbg("%s\n", __func__);
|
||||
|
||||
dev->v4l2->field_count = 0;
|
||||
|
||||
/* Make sure streaming is not already in progress for this type
|
||||
of filehandle (e.g. video, vbi) */
|
||||
rc = res_get(dev, vq->type);
|
||||
|
|
@ -1290,8 +1292,6 @@ static void em28xx_ctrl_notify(struct v4l2_ctrl *ctrl, void *priv)
|
|||
{
|
||||
struct em28xx *dev = priv;
|
||||
|
||||
dev->v4l2->field_count = 0;
|
||||
|
||||
/*
|
||||
* In the case of non-AC97 volume controls, we still need
|
||||
* to do some setups at em28xx, in order to mute/unmute
|
||||
|
|
|
|||
|
|
@ -1916,9 +1916,13 @@ int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma)
|
|||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
mutex_lock(&q->mmap_lock);
|
||||
|
||||
if (vb2_fileio_is_active(q)) {
|
||||
dprintk(1, "mmap: file io in progress\n");
|
||||
return -EBUSY;
|
||||
ret = -EBUSY;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1926,7 +1930,7 @@ int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma)
|
|||
*/
|
||||
ret = __find_plane_by_offset(q, off, &buffer, &plane);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto unlock;
|
||||
|
||||
vb = q->bufs[buffer];
|
||||
|
||||
|
|
@ -1939,11 +1943,13 @@ int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma)
|
|||
if (length < (vma->vm_end - vma->vm_start)) {
|
||||
dprintk(1,
|
||||
"MMAP invalid, as it would overflow buffer length\n");
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
mutex_lock(&q->mmap_lock);
|
||||
ret = call_memop(vb, mmap, vb->planes[plane].mem_priv, vma);
|
||||
|
||||
unlock:
|
||||
mutex_unlock(&q->mmap_lock);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue