Skip to content

Commit

Permalink
Merge 4.4.283 into android-4.4-p
Browse files Browse the repository at this point in the history
Changes in 4.4.283
	can: usb: esd_usb2: esd_usb2_rx_event(): fix the interchange of the CAN RX and TX error counters
	Revert "USB: serial: ch341: fix character loss at high transfer rates"
	USB: serial: option: add new VID/PID to support Fibocom FG150
	e1000e: Fix the max snoop/no-snoop latency for 10M
	net: marvell: fix MVNETA_TX_IN_PRGRS bit number
	virtio: Improve vq->broken access to avoid any compiler optimization
	vringh: Use wiov->used to check for read/write desc order
	vt_kdsetmode: extend console locking
	fbmem: add margin check to fb_check_caps()
	Revert "floppy: reintroduce O_NDELAY fix"
	Linux 4.4.283

Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: I327e81b91a74a7dff9e1cfb71a7d833ff5f034ff
  • Loading branch information
gregkh committed Sep 3, 2021
2 parents d1ac4a2 + cbc3014 commit 3f066f3
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 4
SUBLEVEL = 282
SUBLEVEL = 283
EXTRAVERSION =
NAME = Blurry Fish Butt

Expand Down
27 changes: 13 additions & 14 deletions drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -4066,22 +4066,21 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
if (UFDCS->rawcmd == 1)
UFDCS->rawcmd = 2;

if (mode & (FMODE_READ|FMODE_WRITE)) {
UDRS->last_checked = 0;
clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
check_disk_change(bdev);
if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags))
goto out;
if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags))
if (!(mode & FMODE_NDELAY)) {
if (mode & (FMODE_READ|FMODE_WRITE)) {
UDRS->last_checked = 0;
clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
check_disk_change(bdev);
if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags))
goto out;
if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags))
goto out;
}
res = -EROFS;
if ((mode & FMODE_WRITE) &&
!test_bit(FD_DISK_WRITABLE_BIT, &UDRS->flags))
goto out;
}

res = -EROFS;

if ((mode & FMODE_WRITE) &&
!test_bit(FD_DISK_WRITABLE_BIT, &UDRS->flags))
goto out;

mutex_unlock(&open_lock);
mutex_unlock(&floppy_mutex);
return 0;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/can/usb/esd_usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ static void esd_usb2_rx_event(struct esd_usb2_net_priv *priv,
if (id == ESD_EV_CAN_ERROR_EXT) {
u8 state = msg->msg.rx.data[0];
u8 ecc = msg->msg.rx.data[1];
u8 txerr = msg->msg.rx.data[2];
u8 rxerr = msg->msg.rx.data[3];
u8 rxerr = msg->msg.rx.data[2];
u8 txerr = msg->msg.rx.data[3];

skb = alloc_can_err_skb(priv->netdev, &cf);
if (skb == NULL) {
Expand Down
14 changes: 13 additions & 1 deletion drivers/net/ethernet/intel/e1000e/ich8lan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,8 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
{
u32 reg = link << (E1000_LTRV_REQ_SHIFT + E1000_LTRV_NOSNOOP_SHIFT) |
link << E1000_LTRV_REQ_SHIFT | E1000_LTRV_SEND;
u16 max_ltr_enc_d = 0; /* maximum LTR decoded by platform */
u16 lat_enc_d = 0; /* latency decoded */
u16 lat_enc = 0; /* latency encoded */

if (link) {
Expand Down Expand Up @@ -1063,7 +1065,17 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
E1000_PCI_LTR_CAP_LPT + 2, &max_nosnoop);
max_ltr_enc = max_t(u16, max_snoop, max_nosnoop);

if (lat_enc > max_ltr_enc)
lat_enc_d = (lat_enc & E1000_LTRV_VALUE_MASK) *
(1U << (E1000_LTRV_SCALE_FACTOR *
((lat_enc & E1000_LTRV_SCALE_MASK)
>> E1000_LTRV_SCALE_SHIFT)));

max_ltr_enc_d = (max_ltr_enc & E1000_LTRV_VALUE_MASK) *
(1U << (E1000_LTRV_SCALE_FACTOR *
((max_ltr_enc & E1000_LTRV_SCALE_MASK)
>> E1000_LTRV_SCALE_SHIFT)));

if (lat_enc_d > max_ltr_enc_d)
lat_enc = max_ltr_enc;
}

Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/intel/e1000e/ich8lan.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,11 @@

/* Latency Tolerance Reporting */
#define E1000_LTRV 0x000F8
#define E1000_LTRV_VALUE_MASK 0x000003FF
#define E1000_LTRV_SCALE_MAX 5
#define E1000_LTRV_SCALE_FACTOR 5
#define E1000_LTRV_SCALE_SHIFT 10
#define E1000_LTRV_SCALE_MASK 0x00001C00
#define E1000_LTRV_REQ_SHIFT 15
#define E1000_LTRV_NOSNOOP_SHIFT 16
#define E1000_LTRV_SEND (1 << 30)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/marvell/mvneta.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
#define MVNETA_DESC_SWAP BIT(6)
#define MVNETA_TX_BRST_SZ_MASK(burst) ((burst) << 22)
#define MVNETA_PORT_STATUS 0x2444
#define MVNETA_TX_IN_PRGRS BIT(1)
#define MVNETA_TX_IN_PRGRS BIT(0)
#define MVNETA_TX_FIFO_EMPTY BIT(8)
#define MVNETA_RX_MIN_FRAME_SIZE 0x247c
#define MVNETA_SERDES_CFG 0x24A0
Expand Down
11 changes: 7 additions & 4 deletions drivers/tty/vt/vt_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,16 +487,19 @@ int vt_ioctl(struct tty_struct *tty,
ret = -EINVAL;
goto out;
}
/* FIXME: this needs the console lock extending */
if (vc->vc_mode == (unsigned char) arg)
console_lock();
if (vc->vc_mode == (unsigned char) arg) {
console_unlock();
break;
}
vc->vc_mode = (unsigned char) arg;
if (console != fg_console)
if (console != fg_console) {
console_unlock();
break;
}
/*
* explicitly blank/unblank the screen if switching modes
*/
console_lock();
if (arg == KD_TEXT)
do_unblank_screen(1);
else
Expand Down
1 change: 0 additions & 1 deletion drivers/usb/serial/ch341.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,6 @@ static struct usb_serial_driver ch341_device = {
.owner = THIS_MODULE,
.name = "ch341-uart",
},
.bulk_in_size = 512,
.id_table = id_table,
.num_ports = 1,
.open = ch341_open,
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/serial/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -2058,6 +2058,8 @@ static const struct usb_device_id option_ids[] = {
.driver_info = RSVD(4) | RSVD(5) },
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */
.driver_info = RSVD(6) },
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
{ USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */
Expand Down
2 changes: 1 addition & 1 deletion drivers/vhost/vringh.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ __vringh_iov(struct vringh *vrh, u16 i,
iov = wiov;
else {
iov = riov;
if (unlikely(wiov && wiov->i)) {
if (unlikely(wiov && wiov->used)) {
vringh_bad("Readable desc %p after writable",
&descs[i]);
err = -EINVAL;
Expand Down
4 changes: 4 additions & 0 deletions drivers/video/fbdev/core/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,10 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
goto done;
}

/* bitfill_aligned() assumes that it's at least 8x8 */
if (var->xres < 8 || var->yres < 8)
return -EINVAL;

ret = info->fbops->fb_check_var(var, info);

if (ret)
Expand Down
6 changes: 4 additions & 2 deletions drivers/virtio/virtio_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ bool virtqueue_is_broken(struct virtqueue *_vq)
{
struct vring_virtqueue *vq = to_vvq(_vq);

return vq->broken;
return READ_ONCE(vq->broken);
}
EXPORT_SYMBOL_GPL(virtqueue_is_broken);

Expand All @@ -1033,7 +1033,9 @@ void virtio_break_device(struct virtio_device *dev)

list_for_each_entry(_vq, &dev->vqs, list) {
struct vring_virtqueue *vq = to_vvq(_vq);
vq->broken = true;

/* Pairs with READ_ONCE() in virtqueue_is_broken(). */
WRITE_ONCE(vq->broken, true);
}
}
EXPORT_SYMBOL_GPL(virtio_break_device);
Expand Down

0 comments on commit 3f066f3

Please sign in to comment.