This is the 4.9.112 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAltGE6YACgkQONu9yGCS aT4a9A//ap2CPrG5XxpkUc49TOmaVqE8XS044kX90BCiqwd4u5tKdT/cQZpkoGXo +BkU43oRCf6Net2bfGDrdQBFV5VH+2ekuhyOaCXo5SXbLw3t4QqiVq4LWh/biwwP 5bfiJvb/8eyRBQfyQJosNMS5z9oNLkN+vZ9Y7W49BV6PV92/RMq2bgTshDaztMIA fMCOONJX5nZgbRja+WeXOA01NFK2w6wSc+hz3pSVYAwdCYK0ypQllwswYk67+m9P 4BrUJnX+3wlSteJc3etTcm0qk/g+ed+bqsIuhDc9bzIiWvhCa7hIaWcqtJuoExra jFWu37QGH8D82pvwN9cpJV8JQogiFJqqVmmZ1V9aBym8iKMU73/pAWFdKcp5NQWH 916JRe/b4+Ge0oZ1d1p69IDb92H49XaID9BqxRxvy2GjBDjFsLY6XfeBug/uB0xU llU9k8e0fCm7Wvr4JZMkMNlQyzDIpFTav0mTHam4AkjMp2ujbuHP6j3amTRplAVf RIDos296gZvqHq9A2KpTbpLYtZKVk5uFyYI+zaLD2xf8RIOvoa8a0ua8bNv+nBDA YMtTYrHbGkGG8zhoYBG5ko5paYjWjKZq447VxfOHRgmQRmFzGunY25ONXPmFvLWw mXdSFkMvqstxbVgak7Fvu0jS4vK4GzUVVJXO38cOXZQqJ/F1B20= =mDnR -----END PGP SIGNATURE----- Merge 4.9.112 into android-4.9 Changes in 4.9.112 usb: cdc_acm: Add quirk for Uniden UBC125 scanner USB: serial: cp210x: add CESINEL device ids USB: serial: cp210x: add Silicon Labs IDs for Windows Update usb: dwc2: fix the incorrect bitmaps for the ports of multi_tt hub n_tty: Fix stall at n_tty_receive_char_special(). n_tty: Access echo_* variables carefully. staging: android: ion: Return an ERR_PTR in ion_map_kernel vt: prevent leaking uninitialized data to userspace via /dev/vcs* i2c: rcar: fix resume by always initializing registers before transfer ipv4: Fix error return value in fib_convert_metrics() kprobes/x86: Do not modify singlestep buffer while resuming netfilter: nf_tables: use WARN_ON_ONCE instead of BUG_ON in nft_do_chain() Revert "sit: reload iphdr in ipip6_rcv" net: phy: micrel: fix crash when statistic requested for KSZ9031 phy ARM: dts: imx6q: Use correct SDMA script for SPI5 core IB/hfi1: Fix user context tail allocation for DMA_RTAIL x86/xen: Add call of speculative_store_bypass_ht_init() to PV paths x86/cpu: Re-apply forced caps every time CPU caps are re-read mm: hugetlb: yield when prepping struct pages tracing: Fix missing return symbol in function_graph output scsi: sg: mitigate read/write abuse s390: Correct register corruption in critical section cleanup drbd: fix access after free cifs: Fix infinite loop when using hard mount option drm/udl: fix display corruption of the last line jbd2: don't mark block as modified if the handle is out of credits ext4: make sure bitmaps and the inode table don't overlap with bg descriptors ext4: always check block group bounds in ext4_init_block_bitmap() ext4: only look at the bg_flags field if it is valid ext4: verify the depth of extent tree in ext4_find_extent() ext4: include the illegal physical block in the bad map ext4_error msg ext4: clear i_data in ext4_inode_info when removing inline data ext4: add more inode number paranoia checks ext4: add more mount time checks of the superblock ext4: check superblock mapped prior to committing mlxsw: spectrum: Forbid linking of VLAN devices to devices that have uppers HID: i2c-hid: Fix "incomplete report" noise HID: hiddev: fix potential Spectre v1 HID: debug: check length before copy_to_user() PM / OPP: Update voltage in case freq == old_freq Kbuild: fix # escaping in .cmd files for future Make media: cx25840: Use subdev host data for PLL override mm, page_alloc: do not break __GFP_THISNODE by zonelist reset dm bufio: avoid sleeping while holding the dm_bufio lock dm bufio: drop the lock when doing GFP_NOIO allocation mtd: rawnand: mxc: set spare area size register explicitly dm bufio: don't take the lock in dm_bufio_shrink_count mtd: cfi_cmdset_0002: Change definition naming to retry write operation mtd: cfi_cmdset_0002: Change erase functions to retry for error mtd: cfi_cmdset_0002: Change erase functions to check chip good only netfilter: nf_log: don't hold nf_log_mutex during user access staging: comedi: quatech_daqp_cs: fix no-op loop daqp_ao_insn_write() Linux 4.9.112 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
9e79039544
54 changed files with 404 additions and 178 deletions
2
Makefile
2
Makefile
|
|
@ -1,6 +1,6 @@
|
|||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 111
|
||||
SUBLEVEL = 112
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@
|
|||
clocks = <&clks IMX6Q_CLK_ECSPI5>,
|
||||
<&clks IMX6Q_CLK_ECSPI5>;
|
||||
clock-names = "ipg", "per";
|
||||
dmas = <&sdma 11 7 1>, <&sdma 12 7 2>;
|
||||
dmas = <&sdma 11 8 1>, <&sdma 12 8 2>;
|
||||
dma-names = "rx", "tx";
|
||||
status = "disabled";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1187,7 +1187,7 @@ cleanup_critical:
|
|||
jl 0f
|
||||
clg %r9,BASED(.Lcleanup_table+104) # .Lload_fpu_regs_end
|
||||
jl .Lcleanup_load_fpu_regs
|
||||
0: BR_EX %r14
|
||||
0: BR_EX %r14,%r11
|
||||
|
||||
.align 8
|
||||
.Lcleanup_table:
|
||||
|
|
@ -1217,7 +1217,7 @@ cleanup_critical:
|
|||
ni __SIE_PROG0C+3(%r9),0xfe # no longer in SIE
|
||||
lctlg %c1,%c1,__LC_USER_ASCE # load primary asce
|
||||
larl %r9,sie_exit # skip forward to sie_exit
|
||||
BR_EX %r14
|
||||
BR_EX %r14,%r11
|
||||
#endif
|
||||
|
||||
.Lcleanup_system_call:
|
||||
|
|
|
|||
|
|
@ -848,6 +848,13 @@ void get_cpu_cap(struct cpuinfo_x86 *c)
|
|||
|
||||
init_scattered_cpuid_features(c);
|
||||
init_speculation_control(c);
|
||||
|
||||
/*
|
||||
* Clear/Set all flags overridden by options, after probe.
|
||||
* This needs to happen each time we re-probe, which may happen
|
||||
* several times during CPU initialization.
|
||||
*/
|
||||
apply_forced_caps(c);
|
||||
}
|
||||
|
||||
static void identify_cpu_without_cpuid(struct cpuinfo_x86 *c)
|
||||
|
|
|
|||
|
|
@ -414,25 +414,38 @@ void free_insn_page(void *page)
|
|||
module_memfree(page);
|
||||
}
|
||||
|
||||
/* Prepare reljump right after instruction to boost */
|
||||
static void prepare_boost(struct kprobe *p, int length)
|
||||
{
|
||||
if (can_boost(p->ainsn.insn, p->addr) &&
|
||||
MAX_INSN_SIZE - length >= RELATIVEJUMP_SIZE) {
|
||||
/*
|
||||
* These instructions can be executed directly if it
|
||||
* jumps back to correct address.
|
||||
*/
|
||||
synthesize_reljump(p->ainsn.insn + length, p->addr + length);
|
||||
p->ainsn.boostable = 1;
|
||||
} else {
|
||||
p->ainsn.boostable = -1;
|
||||
}
|
||||
}
|
||||
|
||||
static int arch_copy_kprobe(struct kprobe *p)
|
||||
{
|
||||
int ret;
|
||||
int len;
|
||||
|
||||
set_memory_rw((unsigned long)p->ainsn.insn & PAGE_MASK, 1);
|
||||
|
||||
/* Copy an instruction with recovering if other optprobe modifies it.*/
|
||||
ret = __copy_instruction(p->ainsn.insn, p->addr);
|
||||
if (!ret)
|
||||
len = __copy_instruction(p->ainsn.insn, p->addr);
|
||||
if (!len)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* __copy_instruction can modify the displacement of the instruction,
|
||||
* but it doesn't affect boostable check.
|
||||
*/
|
||||
if (can_boost(p->ainsn.insn, p->addr))
|
||||
p->ainsn.boostable = 0;
|
||||
else
|
||||
p->ainsn.boostable = -1;
|
||||
prepare_boost(p, len);
|
||||
|
||||
set_memory_ro((unsigned long)p->ainsn.insn & PAGE_MASK, 1);
|
||||
|
||||
|
|
@ -897,21 +910,6 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs,
|
|||
break;
|
||||
}
|
||||
|
||||
if (p->ainsn.boostable == 0) {
|
||||
if ((regs->ip > copy_ip) &&
|
||||
(regs->ip - copy_ip) + 5 < MAX_INSN_SIZE) {
|
||||
/*
|
||||
* These instructions can be executed directly if it
|
||||
* jumps back to correct address.
|
||||
*/
|
||||
synthesize_reljump((void *)regs->ip,
|
||||
(void *)orig_ip + (regs->ip - copy_ip));
|
||||
p->ainsn.boostable = 1;
|
||||
} else {
|
||||
p->ainsn.boostable = -1;
|
||||
}
|
||||
}
|
||||
|
||||
regs->ip += orig_ip - copy_ip;
|
||||
|
||||
no_change:
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include <xen/interface/vcpu.h>
|
||||
#include <xen/interface/xenpmu.h>
|
||||
|
||||
#include <asm/spec-ctrl.h>
|
||||
#include <asm/xen/interface.h>
|
||||
#include <asm/xen/hypercall.h>
|
||||
|
||||
|
|
@ -87,6 +88,8 @@ static void cpu_bringup(void)
|
|||
cpu_data(cpu).x86_max_cores = 1;
|
||||
set_cpu_sibling_map(cpu);
|
||||
|
||||
speculative_store_bypass_ht_init();
|
||||
|
||||
xen_setup_cpu_clockevents();
|
||||
|
||||
notify_cpu_starting(cpu);
|
||||
|
|
@ -375,6 +378,8 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus)
|
|||
}
|
||||
set_cpu_sibling_map(0);
|
||||
|
||||
speculative_store_bypass_ht_init();
|
||||
|
||||
xen_pmu_init(0);
|
||||
|
||||
if (xen_smp_intr_init(0))
|
||||
|
|
|
|||
|
|
@ -651,7 +651,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
|
|||
rcu_read_unlock();
|
||||
|
||||
/* Scaling up? Scale voltage before frequency */
|
||||
if (freq > old_freq) {
|
||||
if (freq >= old_freq) {
|
||||
ret = _set_opp_voltage(dev, reg, u_volt, u_volt_min,
|
||||
u_volt_max);
|
||||
if (ret)
|
||||
|
|
|
|||
|
|
@ -269,8 +269,8 @@ void drbd_request_endio(struct bio *bio)
|
|||
what = COMPLETED_OK;
|
||||
}
|
||||
|
||||
bio_put(req->private_bio);
|
||||
req->private_bio = ERR_PTR(bio->bi_error);
|
||||
bio_put(bio);
|
||||
|
||||
/* not req_mod(), we need irqsave here! */
|
||||
spin_lock_irqsave(&device->resource->req_lock, flags);
|
||||
|
|
|
|||
|
|
@ -136,7 +136,10 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y,
|
|||
|
||||
if (cmd > (char *) urb->transfer_buffer) {
|
||||
/* Send partial buffer remaining before exiting */
|
||||
int len = cmd - (char *) urb->transfer_buffer;
|
||||
int len;
|
||||
if (cmd < (char *) urb->transfer_buffer + urb->transfer_buffer_length)
|
||||
*cmd++ = 0xAF;
|
||||
len = cmd - (char *) urb->transfer_buffer;
|
||||
ret = udl_submit_urb(dev, urb, len);
|
||||
bytes_sent += len;
|
||||
} else
|
||||
|
|
|
|||
|
|
@ -152,11 +152,11 @@ static void udl_compress_hline16(
|
|||
raw_pixels_count_byte = cmd++; /* we'll know this later */
|
||||
raw_pixel_start = pixel;
|
||||
|
||||
cmd_pixel_end = pixel + (min(MAX_CMD_PIXELS + 1,
|
||||
min((int)(pixel_end - pixel) / bpp,
|
||||
(int)(cmd_buffer_end - cmd) / 2))) * bpp;
|
||||
cmd_pixel_end = pixel + min3(MAX_CMD_PIXELS + 1UL,
|
||||
(unsigned long)(pixel_end - pixel) / bpp,
|
||||
(unsigned long)(cmd_buffer_end - 1 - cmd) / 2) * bpp;
|
||||
|
||||
prefetch_range((void *) pixel, (cmd_pixel_end - pixel) * bpp);
|
||||
prefetch_range((void *) pixel, cmd_pixel_end - pixel);
|
||||
pixel_val16 = get_pixel_val16(pixel, bpp);
|
||||
|
||||
while (pixel < cmd_pixel_end) {
|
||||
|
|
@ -192,6 +192,9 @@ static void udl_compress_hline16(
|
|||
if (pixel > raw_pixel_start) {
|
||||
/* finalize last RAW span */
|
||||
*raw_pixels_count_byte = ((pixel-raw_pixel_start) / bpp) & 0xFF;
|
||||
} else {
|
||||
/* undo unused byte */
|
||||
cmd--;
|
||||
}
|
||||
|
||||
*cmd_pixels_count_byte = ((pixel - cmd_pixel_start) / bpp) & 0xFF;
|
||||
|
|
|
|||
|
|
@ -1152,6 +1152,8 @@ copy_rest:
|
|||
goto out;
|
||||
if (list->tail > list->head) {
|
||||
len = list->tail - list->head;
|
||||
if (len > count)
|
||||
len = count;
|
||||
|
||||
if (copy_to_user(buffer + ret, &list->hid_debug_buf[list->head], len)) {
|
||||
ret = -EFAULT;
|
||||
|
|
@ -1161,6 +1163,8 @@ copy_rest:
|
|||
list->head += len;
|
||||
} else {
|
||||
len = HID_DEBUG_BUFSIZE - list->head;
|
||||
if (len > count)
|
||||
len = count;
|
||||
|
||||
if (copy_to_user(buffer, &list->hid_debug_buf[list->head], len)) {
|
||||
ret = -EFAULT;
|
||||
|
|
@ -1168,7 +1172,9 @@ copy_rest:
|
|||
}
|
||||
list->head = 0;
|
||||
ret += len;
|
||||
goto copy_rest;
|
||||
count -= len;
|
||||
if (count > 0)
|
||||
goto copy_rest;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ static void i2c_hid_get_input(struct i2c_hid *ihid)
|
|||
return;
|
||||
}
|
||||
|
||||
if ((ret_size > size) || (ret_size <= 2)) {
|
||||
if ((ret_size > size) || (ret_size < 2)) {
|
||||
dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n",
|
||||
__func__, size, ret_size);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include <linux/hiddev.h>
|
||||
#include <linux/compat.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/nospec.h>
|
||||
#include "usbhid.h"
|
||||
|
||||
#ifdef CONFIG_USB_DYNAMIC_MINORS
|
||||
|
|
@ -478,10 +479,14 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
|
|||
|
||||
if (uref->field_index >= report->maxfield)
|
||||
goto inval;
|
||||
uref->field_index = array_index_nospec(uref->field_index,
|
||||
report->maxfield);
|
||||
|
||||
field = report->field[uref->field_index];
|
||||
if (uref->usage_index >= field->maxusage)
|
||||
goto inval;
|
||||
uref->usage_index = array_index_nospec(uref->usage_index,
|
||||
field->maxusage);
|
||||
|
||||
uref->usage_code = field->usage[uref->usage_index].hid;
|
||||
|
||||
|
|
@ -508,6 +513,8 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
|
|||
|
||||
if (uref->field_index >= report->maxfield)
|
||||
goto inval;
|
||||
uref->field_index = array_index_nospec(uref->field_index,
|
||||
report->maxfield);
|
||||
|
||||
field = report->field[uref->field_index];
|
||||
|
||||
|
|
@ -761,6 +768,8 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|||
|
||||
if (finfo.field_index >= report->maxfield)
|
||||
break;
|
||||
finfo.field_index = array_index_nospec(finfo.field_index,
|
||||
report->maxfield);
|
||||
|
||||
field = report->field[finfo.field_index];
|
||||
memset(&finfo, 0, sizeof(finfo));
|
||||
|
|
@ -801,6 +810,8 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
|||
|
||||
if (cinfo.index >= hid->maxcollection)
|
||||
break;
|
||||
cinfo.index = array_index_nospec(cinfo.index,
|
||||
hid->maxcollection);
|
||||
|
||||
cinfo.type = hid->collection[cinfo.index].type;
|
||||
cinfo.usage = hid->collection[cinfo.index].usage;
|
||||
|
|
|
|||
|
|
@ -700,6 +700,8 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
|
|||
|
||||
pm_runtime_get_sync(dev);
|
||||
|
||||
rcar_i2c_init(priv);
|
||||
|
||||
ret = rcar_i2c_bus_barrier(priv);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
|
@ -857,8 +859,6 @@ static int rcar_i2c_probe(struct platform_device *pdev)
|
|||
if (ret < 0)
|
||||
goto out_pm_put;
|
||||
|
||||
rcar_i2c_init(priv);
|
||||
|
||||
/* Don't suspend when multi-master to keep arbitration working */
|
||||
if (of_property_read_bool(dev->of_node, "multi-master"))
|
||||
priv->flags |= ID_P_PM_BLOCKED;
|
||||
|
|
|
|||
|
|
@ -6717,7 +6717,7 @@ static void rxe_kernel_unfreeze(struct hfi1_devdata *dd)
|
|||
for (i = 0; i < dd->n_krcv_queues; i++) {
|
||||
rcvmask = HFI1_RCVCTRL_CTXT_ENB;
|
||||
/* HFI1_RCVCTRL_TAILUPD_[ENB|DIS] needs to be set explicitly */
|
||||
rcvmask |= HFI1_CAP_KGET_MASK(dd->rcd[i]->flags, DMA_RTAIL) ?
|
||||
rcvmask |= dd->rcd[i]->rcvhdrtail_kvaddr ?
|
||||
HFI1_RCVCTRL_TAILUPD_ENB : HFI1_RCVCTRL_TAILUPD_DIS;
|
||||
hfi1_rcvctrl(dd, rcvmask, i);
|
||||
}
|
||||
|
|
@ -8211,7 +8211,7 @@ static inline int check_packet_present(struct hfi1_ctxtdata *rcd)
|
|||
u32 tail;
|
||||
int present;
|
||||
|
||||
if (!HFI1_CAP_IS_KSET(DMA_RTAIL))
|
||||
if (!rcd->rcvhdrtail_kvaddr)
|
||||
present = (rcd->seq_cnt ==
|
||||
rhf_rcv_seq(rhf_to_cpu(get_rhf_addr(rcd))));
|
||||
else /* is RDMA rtail */
|
||||
|
|
@ -11550,7 +11550,7 @@ void hfi1_rcvctrl(struct hfi1_devdata *dd, unsigned int op, int ctxt)
|
|||
/* reset the tail and hdr addresses, and sequence count */
|
||||
write_kctxt_csr(dd, ctxt, RCV_HDR_ADDR,
|
||||
rcd->rcvhdrq_dma);
|
||||
if (HFI1_CAP_KGET_MASK(rcd->flags, DMA_RTAIL))
|
||||
if (rcd->rcvhdrtail_kvaddr)
|
||||
write_kctxt_csr(dd, ctxt, RCV_HDR_TAIL_ADDR,
|
||||
rcd->rcvhdrqtailaddr_dma);
|
||||
rcd->seq_cnt = 1;
|
||||
|
|
@ -11630,7 +11630,7 @@ void hfi1_rcvctrl(struct hfi1_devdata *dd, unsigned int op, int ctxt)
|
|||
rcvctrl |= RCV_CTXT_CTRL_INTR_AVAIL_SMASK;
|
||||
if (op & HFI1_RCVCTRL_INTRAVAIL_DIS)
|
||||
rcvctrl &= ~RCV_CTXT_CTRL_INTR_AVAIL_SMASK;
|
||||
if (op & HFI1_RCVCTRL_TAILUPD_ENB && rcd->rcvhdrqtailaddr_dma)
|
||||
if ((op & HFI1_RCVCTRL_TAILUPD_ENB) && rcd->rcvhdrtail_kvaddr)
|
||||
rcvctrl |= RCV_CTXT_CTRL_TAIL_UPD_SMASK;
|
||||
if (op & HFI1_RCVCTRL_TAILUPD_DIS) {
|
||||
/* See comment on RcvCtxtCtrl.TailUpd above */
|
||||
|
|
|
|||
|
|
@ -609,7 +609,7 @@ static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma)
|
|||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
if (flags & VM_WRITE) {
|
||||
if ((flags & VM_WRITE) || !uctxt->rcvhdrtail_kvaddr) {
|
||||
ret = -EPERM;
|
||||
goto done;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1618,7 +1618,6 @@ int hfi1_create_rcvhdrq(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd)
|
|||
u64 reg;
|
||||
|
||||
if (!rcd->rcvhdrq) {
|
||||
dma_addr_t dma_hdrqtail;
|
||||
gfp_t gfp_flags;
|
||||
|
||||
/*
|
||||
|
|
@ -1641,13 +1640,13 @@ int hfi1_create_rcvhdrq(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd)
|
|||
goto bail;
|
||||
}
|
||||
|
||||
if (HFI1_CAP_KGET_MASK(rcd->flags, DMA_RTAIL)) {
|
||||
if (HFI1_CAP_KGET_MASK(rcd->flags, DMA_RTAIL) ||
|
||||
HFI1_CAP_UGET_MASK(rcd->flags, DMA_RTAIL)) {
|
||||
rcd->rcvhdrtail_kvaddr = dma_zalloc_coherent(
|
||||
&dd->pcidev->dev, PAGE_SIZE, &dma_hdrqtail,
|
||||
gfp_flags);
|
||||
&dd->pcidev->dev, PAGE_SIZE,
|
||||
&rcd->rcvhdrqtailaddr_dma, gfp_flags);
|
||||
if (!rcd->rcvhdrtail_kvaddr)
|
||||
goto bail_free;
|
||||
rcd->rcvhdrqtailaddr_dma = dma_hdrqtail;
|
||||
}
|
||||
|
||||
rcd->rcvhdrq_size = amt;
|
||||
|
|
|
|||
|
|
@ -819,6 +819,7 @@ enum new_flag {
|
|||
static struct dm_buffer *__alloc_buffer_wait_no_callback(struct dm_bufio_client *c, enum new_flag nf)
|
||||
{
|
||||
struct dm_buffer *b;
|
||||
bool tried_noio_alloc = false;
|
||||
|
||||
/*
|
||||
* dm-bufio is resistant to allocation failures (it just keeps
|
||||
|
|
@ -843,6 +844,15 @@ static struct dm_buffer *__alloc_buffer_wait_no_callback(struct dm_bufio_client
|
|||
if (nf == NF_PREFETCH)
|
||||
return NULL;
|
||||
|
||||
if (dm_bufio_cache_size_latch != 1 && !tried_noio_alloc) {
|
||||
dm_bufio_unlock(c);
|
||||
b = alloc_buffer(c, GFP_NOIO | __GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN);
|
||||
dm_bufio_lock(c);
|
||||
if (b)
|
||||
return b;
|
||||
tried_noio_alloc = true;
|
||||
}
|
||||
|
||||
if (!list_empty(&c->reserved_buffers)) {
|
||||
b = list_entry(c->reserved_buffers.next,
|
||||
struct dm_buffer, lru_list);
|
||||
|
|
@ -1588,19 +1598,11 @@ dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
|
|||
static unsigned long
|
||||
dm_bufio_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
|
||||
{
|
||||
struct dm_bufio_client *c;
|
||||
unsigned long count;
|
||||
unsigned long retain_target;
|
||||
struct dm_bufio_client *c = container_of(shrink, struct dm_bufio_client, shrinker);
|
||||
unsigned long count = READ_ONCE(c->n_buffers[LIST_CLEAN]) +
|
||||
READ_ONCE(c->n_buffers[LIST_DIRTY]);
|
||||
unsigned long retain_target = get_retain_buffers(c);
|
||||
|
||||
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))
|
||||
return 0;
|
||||
|
||||
count = c->n_buffers[LIST_CLEAN] + c->n_buffers[LIST_DIRTY];
|
||||
retain_target = get_retain_buffers(c);
|
||||
dm_bufio_unlock(c);
|
||||
return (count < retain_target) ? 0 : (count - retain_target);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -467,8 +467,13 @@ static void cx23885_initialize(struct i2c_client *client)
|
|||
{
|
||||
DEFINE_WAIT(wait);
|
||||
struct cx25840_state *state = to_state(i2c_get_clientdata(client));
|
||||
u32 clk_freq = 0;
|
||||
struct workqueue_struct *q;
|
||||
|
||||
/* cx23885 sets hostdata to clk_freq pointer */
|
||||
if (v4l2_get_subdev_hostdata(&state->sd))
|
||||
clk_freq = *((u32 *)v4l2_get_subdev_hostdata(&state->sd));
|
||||
|
||||
/*
|
||||
* Come out of digital power down
|
||||
* The CX23888, at least, needs this, otherwise registers aside from
|
||||
|
|
@ -504,8 +509,13 @@ static void cx23885_initialize(struct i2c_client *client)
|
|||
* 50.0 MHz * (0xb + 0xe8ba26/0x2000000)/4 = 5 * 28.636363 MHz
|
||||
* 572.73 MHz before post divide
|
||||
*/
|
||||
/* HVR1850 or 50MHz xtal */
|
||||
cx25840_write(client, 0x2, 0x71);
|
||||
if (clk_freq == 25000000) {
|
||||
/* 888/ImpactVCBe or 25Mhz xtal */
|
||||
; /* nothing to do */
|
||||
} else {
|
||||
/* HVR1850 or 50MHz xtal */
|
||||
cx25840_write(client, 0x2, 0x71);
|
||||
}
|
||||
cx25840_write4(client, 0x11c, 0x01d1744c);
|
||||
cx25840_write4(client, 0x118, 0x00000416);
|
||||
cx25840_write4(client, 0x404, 0x0010253e);
|
||||
|
|
@ -548,9 +558,15 @@ static void cx23885_initialize(struct i2c_client *client)
|
|||
/* HVR1850 */
|
||||
switch (state->id) {
|
||||
case CX23888_AV:
|
||||
/* 888/HVR1250 specific */
|
||||
cx25840_write4(client, 0x10c, 0x13333333);
|
||||
cx25840_write4(client, 0x108, 0x00000515);
|
||||
if (clk_freq == 25000000) {
|
||||
/* 888/ImpactVCBe or 25MHz xtal */
|
||||
cx25840_write4(client, 0x10c, 0x01b6db7b);
|
||||
cx25840_write4(client, 0x108, 0x00000512);
|
||||
} else {
|
||||
/* 888/HVR1250 or 50MHz xtal */
|
||||
cx25840_write4(client, 0x10c, 0x13333333);
|
||||
cx25840_write4(client, 0x108, 0x00000515);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
cx25840_write4(client, 0x10c, 0x002be2c9);
|
||||
|
|
@ -580,7 +596,7 @@ static void cx23885_initialize(struct i2c_client *client)
|
|||
* 368.64 MHz before post divide
|
||||
* 122.88 MHz / 0xa = 12.288 MHz
|
||||
*/
|
||||
/* HVR1850 or 50MHz xtal */
|
||||
/* HVR1850 or 50MHz xtal or 25MHz xtal */
|
||||
cx25840_write4(client, 0x114, 0x017dbf48);
|
||||
cx25840_write4(client, 0x110, 0x000a030e);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
#define AMD_BOOTLOC_BUG
|
||||
#define FORCE_WORD_WRITE 0
|
||||
|
||||
#define MAX_WORD_RETRIES 3
|
||||
#define MAX_RETRIES 3
|
||||
|
||||
#define SST49LF004B 0x0060
|
||||
#define SST49LF040B 0x0050
|
||||
|
|
@ -1643,7 +1643,7 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
|
|||
map_write( map, CMD(0xF0), chip->start );
|
||||
/* FIXME - should have reset delay before continuing */
|
||||
|
||||
if (++retry_cnt <= MAX_WORD_RETRIES)
|
||||
if (++retry_cnt <= MAX_RETRIES)
|
||||
goto retry;
|
||||
|
||||
ret = -EIO;
|
||||
|
|
@ -2102,7 +2102,7 @@ retry:
|
|||
map_write(map, CMD(0xF0), chip->start);
|
||||
/* FIXME - should have reset delay before continuing */
|
||||
|
||||
if (++retry_cnt <= MAX_WORD_RETRIES)
|
||||
if (++retry_cnt <= MAX_RETRIES)
|
||||
goto retry;
|
||||
|
||||
ret = -EIO;
|
||||
|
|
@ -2237,6 +2237,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
|
|||
unsigned long int adr;
|
||||
DECLARE_WAITQUEUE(wait, current);
|
||||
int ret = 0;
|
||||
int retry_cnt = 0;
|
||||
|
||||
adr = cfi->addr_unlock1;
|
||||
|
||||
|
|
@ -2254,6 +2255,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
|
|||
ENABLE_VPP(map);
|
||||
xip_disable(map, chip, adr);
|
||||
|
||||
retry:
|
||||
cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
|
||||
cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL);
|
||||
cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
|
||||
|
|
@ -2290,12 +2292,13 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
|
|||
chip->erase_suspended = 0;
|
||||
}
|
||||
|
||||
if (chip_ready(map, adr))
|
||||
if (chip_good(map, adr, map_word_ff(map)))
|
||||
break;
|
||||
|
||||
if (time_after(jiffies, timeo)) {
|
||||
printk(KERN_WARNING "MTD %s(): software timeout\n",
|
||||
__func__ );
|
||||
ret = -EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2303,12 +2306,15 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
|
|||
UDELAY(map, chip, adr, 1000000/HZ);
|
||||
}
|
||||
/* Did we succeed? */
|
||||
if (!chip_good(map, adr, map_word_ff(map))) {
|
||||
if (ret) {
|
||||
/* reset on all failures. */
|
||||
map_write( map, CMD(0xF0), chip->start );
|
||||
/* FIXME - should have reset delay before continuing */
|
||||
|
||||
ret = -EIO;
|
||||
if (++retry_cnt <= MAX_RETRIES) {
|
||||
ret = 0;
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
||||
chip->state = FL_READY;
|
||||
|
|
@ -2327,6 +2333,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
|
|||
unsigned long timeo = jiffies + HZ;
|
||||
DECLARE_WAITQUEUE(wait, current);
|
||||
int ret = 0;
|
||||
int retry_cnt = 0;
|
||||
|
||||
adr += chip->start;
|
||||
|
||||
|
|
@ -2344,6 +2351,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
|
|||
ENABLE_VPP(map);
|
||||
xip_disable(map, chip, adr);
|
||||
|
||||
retry:
|
||||
cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
|
||||
cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL);
|
||||
cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
|
||||
|
|
@ -2380,7 +2388,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
|
|||
chip->erase_suspended = 0;
|
||||
}
|
||||
|
||||
if (chip_ready(map, adr)) {
|
||||
if (chip_good(map, adr, map_word_ff(map))) {
|
||||
xip_enable(map, chip, adr);
|
||||
break;
|
||||
}
|
||||
|
|
@ -2389,6 +2397,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
|
|||
xip_enable(map, chip, adr);
|
||||
printk(KERN_WARNING "MTD %s(): software timeout\n",
|
||||
__func__ );
|
||||
ret = -EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2396,12 +2405,15 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
|
|||
UDELAY(map, chip, adr, 1000000/HZ);
|
||||
}
|
||||
/* Did we succeed? */
|
||||
if (!chip_good(map, adr, map_word_ff(map))) {
|
||||
if (ret) {
|
||||
/* reset on all failures. */
|
||||
map_write( map, CMD(0xF0), chip->start );
|
||||
/* FIXME - should have reset delay before continuing */
|
||||
|
||||
ret = -EIO;
|
||||
if (++retry_cnt <= MAX_RETRIES) {
|
||||
ret = 0;
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
||||
chip->state = FL_READY;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue