Skip to content

Commit f6bfa13

Browse files
committed
Merge 4.9.282 into android-4.9-q
Changes in 4.9.282 ARC: Fix CONFIG_STACKDEPOT 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 usb: dwc3: gadget: Fix dwc3_calc_trbs_left() IB/hfi1: Fix possible null-pointer dereference in _extend_sdma_tx_descs() e1000e: Fix the max snoop/no-snoop latency for 10M ip_gre: add validation for csum_start 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 net/rds: dma_map_sg is entitled to merge entries vt_kdsetmode: extend console locking fbmem: add margin check to fb_check_caps() KVM: x86/mmu: Treat NX as used (not reserved) for all !TDP shadow MMUs Revert "floppy: reintroduce O_NDELAY fix" Linux 4.9.282 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ifc250328155f0b001a5a287d6425820909fdeef4
2 parents 85d9096 + 9f6447b commit f6bfa13

18 files changed

Lines changed: 79 additions & 43 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 9
3-
SUBLEVEL = 281
3+
SUBLEVEL = 282
44
EXTRAVERSION =
55
NAME = Roaring Lionus
66

arch/arc/kernel/vmlinux.lds.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ SECTIONS
9292
CPUIDLE_TEXT
9393
LOCK_TEXT
9494
KPROBES_TEXT
95+
IRQENTRY_TEXT
96+
SOFTIRQENTRY_TEXT
9597
*(.fixup)
9698
*(.gnu.warning)
9799
}

arch/x86/kvm/mmu.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3927,7 +3927,16 @@ static void reset_rsvds_bits_mask_ept(struct kvm_vcpu *vcpu,
39273927
void
39283928
reset_shadow_zero_bits_mask(struct kvm_vcpu *vcpu, struct kvm_mmu *context)
39293929
{
3930-
bool uses_nx = context->nx || context->base_role.smep_andnot_wp;
3930+
/*
3931+
* KVM uses NX when TDP is disabled to handle a variety of scenarios,
3932+
* notably for huge SPTEs if iTLB multi-hit mitigation is enabled and
3933+
* to generate correct permissions for CR0.WP=0/CR4.SMEP=1/EFER.NX=0.
3934+
* The iTLB multi-hit workaround can be toggled at any time, so assume
3935+
* NX can be used by any non-nested shadow MMU to avoid having to reset
3936+
* MMU contexts. Note, KVM forces EFER.NX=1 when TDP is disabled.
3937+
*/
3938+
bool uses_nx = context->nx || !tdp_enabled ||
3939+
context->base_role.smep_andnot_wp;
39313940

39323941
/*
39333942
* Passing "true" to the last argument is okay; it adds a check

drivers/block/floppy.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4067,22 +4067,21 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
40674067
if (UFDCS->rawcmd == 1)
40684068
UFDCS->rawcmd = 2;
40694069

4070-
if (mode & (FMODE_READ|FMODE_WRITE)) {
4071-
UDRS->last_checked = 0;
4072-
clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
4073-
check_disk_change(bdev);
4074-
if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags))
4075-
goto out;
4076-
if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags))
4070+
if (!(mode & FMODE_NDELAY)) {
4071+
if (mode & (FMODE_READ|FMODE_WRITE)) {
4072+
UDRS->last_checked = 0;
4073+
clear_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags);
4074+
check_disk_change(bdev);
4075+
if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags))
4076+
goto out;
4077+
if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &UDRS->flags))
4078+
goto out;
4079+
}
4080+
res = -EROFS;
4081+
if ((mode & FMODE_WRITE) &&
4082+
!test_bit(FD_DISK_WRITABLE_BIT, &UDRS->flags))
40774083
goto out;
40784084
}
4079-
4080-
res = -EROFS;
4081-
4082-
if ((mode & FMODE_WRITE) &&
4083-
!test_bit(FD_DISK_WRITABLE_BIT, &UDRS->flags))
4084-
goto out;
4085-
40864085
mutex_unlock(&open_lock);
40874086
mutex_unlock(&floppy_mutex);
40884087
return 0;

drivers/infiniband/hw/hfi1/sdma.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3028,6 +3028,7 @@ static void __sdma_process_event(struct sdma_engine *sde,
30283028
static int _extend_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx)
30293029
{
30303030
int i;
3031+
struct sdma_desc *descp;
30313032

30323033
/* Handle last descriptor */
30333034
if (unlikely((tx->num_desc == (MAX_DESC - 1)))) {
@@ -3048,12 +3049,10 @@ static int _extend_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx)
30483049
if (unlikely(tx->num_desc == MAX_DESC))
30493050
goto enomem;
30503051

3051-
tx->descp = kmalloc_array(
3052-
MAX_DESC,
3053-
sizeof(struct sdma_desc),
3054-
GFP_ATOMIC);
3055-
if (!tx->descp)
3052+
descp = kmalloc_array(MAX_DESC, sizeof(struct sdma_desc), GFP_ATOMIC);
3053+
if (!descp)
30563054
goto enomem;
3055+
tx->descp = descp;
30573056

30583057
/* reserve last descriptor for coalescing */
30593058
tx->desc_limit = MAX_DESC - 1;

drivers/net/can/usb/esd_usb2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ static void esd_usb2_rx_event(struct esd_usb2_net_priv *priv,
236236
if (id == ESD_EV_CAN_ERROR_EXT) {
237237
u8 state = msg->msg.rx.data[0];
238238
u8 ecc = msg->msg.rx.data[1];
239-
u8 txerr = msg->msg.rx.data[2];
240-
u8 rxerr = msg->msg.rx.data[3];
239+
u8 rxerr = msg->msg.rx.data[2];
240+
u8 txerr = msg->msg.rx.data[3];
241241

242242
skb = alloc_can_err_skb(priv->netdev, &cf);
243243
if (skb == NULL) {

drivers/net/ethernet/intel/e1000e/ich8lan.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,8 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
10101010
{
10111011
u32 reg = link << (E1000_LTRV_REQ_SHIFT + E1000_LTRV_NOSNOOP_SHIFT) |
10121012
link << E1000_LTRV_REQ_SHIFT | E1000_LTRV_SEND;
1013+
u16 max_ltr_enc_d = 0; /* maximum LTR decoded by platform */
1014+
u16 lat_enc_d = 0; /* latency decoded */
10131015
u16 lat_enc = 0; /* latency encoded */
10141016

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

1066-
if (lat_enc > max_ltr_enc)
1068+
lat_enc_d = (lat_enc & E1000_LTRV_VALUE_MASK) *
1069+
(1U << (E1000_LTRV_SCALE_FACTOR *
1070+
((lat_enc & E1000_LTRV_SCALE_MASK)
1071+
>> E1000_LTRV_SCALE_SHIFT)));
1072+
1073+
max_ltr_enc_d = (max_ltr_enc & E1000_LTRV_VALUE_MASK) *
1074+
(1U << (E1000_LTRV_SCALE_FACTOR *
1075+
((max_ltr_enc & E1000_LTRV_SCALE_MASK)
1076+
>> E1000_LTRV_SCALE_SHIFT)));
1077+
1078+
if (lat_enc_d > max_ltr_enc_d)
10671079
lat_enc = max_ltr_enc;
10681080
}
10691081

drivers/net/ethernet/intel/e1000e/ich8lan.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,11 @@
291291

292292
/* Latency Tolerance Reporting */
293293
#define E1000_LTRV 0x000F8
294+
#define E1000_LTRV_VALUE_MASK 0x000003FF
294295
#define E1000_LTRV_SCALE_MAX 5
295296
#define E1000_LTRV_SCALE_FACTOR 5
297+
#define E1000_LTRV_SCALE_SHIFT 10
298+
#define E1000_LTRV_SCALE_MASK 0x00001C00
296299
#define E1000_LTRV_REQ_SHIFT 15
297300
#define E1000_LTRV_NOSNOOP_SHIFT 16
298301
#define E1000_LTRV_SEND (1 << 30)

drivers/net/ethernet/marvell/mvneta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
#define MVNETA_DESC_SWAP BIT(6)
101101
#define MVNETA_TX_BRST_SZ_MASK(burst) ((burst) << 22)
102102
#define MVNETA_PORT_STATUS 0x2444
103-
#define MVNETA_TX_IN_PRGRS BIT(1)
103+
#define MVNETA_TX_IN_PRGRS BIT(0)
104104
#define MVNETA_TX_FIFO_EMPTY BIT(8)
105105
#define MVNETA_RX_MIN_FRAME_SIZE 0x247c
106106
#define MVNETA_SERDES_CFG 0x24A0

drivers/tty/vt/vt_ioctl.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,16 +487,19 @@ int vt_ioctl(struct tty_struct *tty,
487487
ret = -EINVAL;
488488
goto out;
489489
}
490-
/* FIXME: this needs the console lock extending */
491-
if (vc->vc_mode == (unsigned char) arg)
490+
console_lock();
491+
if (vc->vc_mode == (unsigned char) arg) {
492+
console_unlock();
492493
break;
494+
}
493495
vc->vc_mode = (unsigned char) arg;
494-
if (console != fg_console)
496+
if (console != fg_console) {
497+
console_unlock();
495498
break;
499+
}
496500
/*
497501
* explicitly blank/unblank the screen if switching modes
498502
*/
499-
console_lock();
500503
if (arg == KD_TEXT)
501504
do_unblank_screen(1);
502505
else

0 commit comments

Comments
 (0)