Skip to contentSkip to conversation

4.9.215-stable review

PATCH In review Greg Kroah-Hartman 5 participants 174 messages Feb 27, 2020 – Feb 28, 2020 Page 2 of 2

Subsystems (7)
lore
Share & tools
lore
author maintainer
#116 lore raw

PATCH 116/165 enic: prevent waking up stopped tx queues over watchdog reset

In reply to Greg Kroah-Hartman

From: Firo Yang <[email protected]>

[ Upstream commit 0f90522591fd09dd201065c53ebefdfe3c6b55cb ]

Recent months, our customer reported several kernel crashes all preceding with following message:
NETDEV WATCHDOG: eth2 (enic): transmit queue 0 timed out Error message of one of those crashes:

BUG: unable to handle kernel paging request at ffffffffa007e090

After analyzing severl vmcores, I found that most of crashes are caused by memory corruption. And all the corrupted memory areas are overwritten by data of network packets. Moreover, I also found that the tx queues were enabled over watchdog reset.

After going through the source code, I found that in enic_stop(), the tx queues stopped by netif_tx_disable() could be woken up over a small time window between netif_tx_disable() and the napi_disable() by the following code path:
napi_poll->
enic_poll_msix_wq->

     vnic_cq_service->
        enic_wq_service->
           netif_wake_subqueue(enic->netdev, q_number)->
              test_and_clear_bit(__QUEUE_STATE_DRV_XOFF, &txq->state)

In turn, upper netowrk stack could queue skb to ENIC NIC though enic_hard_start_xmit(). And this might introduce some race condition.

Our customer comfirmed that this kind of kernel crash doesn't occur over 90 days since they applied this patch.

---
 drivers/net/ethernet/cisco/enic/enic_main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cisco/enic/enic_main.c +1 -1
@@ -1806,10 +1806,10 @@ static int enic_stop(struct net_device *
 	}
 
 	netif_carrier_off(netdev);
-	netif_tx_disable(netdev);
 	if (vnic_dev_get_intr_mode(enic->vdev) == VNIC_DEV_INTR_MODE_MSIX)
 		for (i = 0; i < enic->wq_count; i++)
 			napi_disable(&enic->napi[enic_cq_wq(enic, i)]);
+	netif_tx_disable(netdev);
 
 	if (!enic_is_dynamic(enic) && !enic_is_sriov_vf(enic))
 		enic_dev_del_station_addr(enic);
author maintainer
#121 lore raw

PATCH 121/165 staging: android: ashmem: Disallow ashmem memory from being remapped

In reply to Greg Kroah-Hartman

From: Suren Baghdasaryan <[email protected]>

commit 6d67b0290b4b84c477e6a2fc6e005e174d3c7786 upstream.

When ashmem file is mmapped, the resulting vma->vm_file points to the backing shmem file with the generic fops that do not check ashmem permissions like fops of ashmem do. If an mremap is done on the ashmem region, then the permission checks will be skipped. Fix that by disallowing mapping operation on the backing shmem file.

---
 drivers/staging/android/ashmem.c |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
drivers/staging/android/ashmem.c +28 -0
@@ -370,8 +370,23 @@ static inline vm_flags_t calc_vm_may_fla
 	       _calc_vm_trans(prot, PROT_EXEC,  VM_MAYEXEC);
 }
 
+static int ashmem_vmfile_mmap(struct file *file, struct vm_area_struct *vma)
+{
+	/* do not allow to mmap ashmem backing shmem file directly */
+	return -EPERM;
+}
+
+static unsigned long
+ashmem_vmfile_get_unmapped_area(struct file *file, unsigned long addr,
+				unsigned long len, unsigned long pgoff,
+				unsigned long flags)
+{
+	return current->mm->get_unmapped_area(file, addr, len, pgoff, flags);
+}
+
 static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
 {
+	static struct file_operations vmfile_fops;
 	struct ashmem_area *asma = file->private_data;
 	int ret = 0;
 
@@ -412,6 +427,19 @@ static int ashmem_mmap(struct file *file
 		}
 		vmfile->f_mode |= FMODE_LSEEK;
 		asma->file = vmfile;
+		/*
+		 * override mmap operation of the vmfile so that it can't be
+		 * remapped which would lead to creation of a new vma with no
+		 * asma permission checks. Have to override get_unmapped_area
+		 * as well to prevent VM_BUG_ON check for f_ops modification.
+		 */
+		if (!vmfile_fops.mmap) {
+			vmfile_fops = *vmfile->f_op;
+			vmfile_fops.mmap = ashmem_vmfile_mmap;
+			vmfile_fops.get_unmapped_area =
+					ashmem_vmfile_get_unmapped_area;
+		}
+		vmfile->f_op = &vmfile_fops;
 	}
 	get_file(asma->file);
 
author maintainer
#120 lore raw

PATCH 120/165 vt: selection, handle pending signals in paste_selection

In reply to Greg Kroah-Hartman

From: Jiri Slaby <[email protected]>

commit 687bff0cd08f790d540cfb7b2349f0d876cdddec upstream.

When pasting a selection to a vt, the task is set as INTERRUPTIBLE while waiting for a tty to unthrottle. But signals are not handled at all. Normally, this is not a problem as tty_ldisc_receive_buf receives all the goods and a user has no reason to interrupt the task.

There are two scenarios where this matters:
1) when the tty is throttled and a signal is sent to the process, it spins on a CPU until the tty is unthrottled. schedule() does not really echedule, but returns immediately, of course.
2) when the sel_buffer becomes invalid, KASAN prevents any reads from it and the loop simply does not proceed and spins forever (causing the tty to throttle, but the code never sleeps, the same as above). This sometimes happens as there is a race in the sel_buffer handling code.

So add signal handling to this ioctl (TIOCL_PASTESEL) and return -EINTR in case a signal is pending.

---
 drivers/tty/vt/selection.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/tty/vt/selection.c +6 -1
@@ -341,6 +341,7 @@ int paste_selection(struct tty_struct *t
 	unsigned int count;
 	struct  tty_ldisc *ld;
 	DECLARE_WAITQUEUE(wait, current);
+	int ret = 0;
 
 	console_lock();
 	poke_blanked_console();
@@ -354,6 +355,10 @@ int paste_selection(struct tty_struct *t
 	add_wait_queue(&vc->paste_wait, &wait);
 	while (sel_buffer && sel_buffer_lth > pasted) {
 		set_current_state(TASK_INTERRUPTIBLE);
+		if (signal_pending(current)) {
+			ret = -EINTR;
+			break;
+		}
 		if (tty_throttled(tty)) {
 			schedule();
 			continue;
@@ -369,5 +374,5 @@ int paste_selection(struct tty_struct *t
 
 	tty_buffer_unlock_exclusive(&vc->port);
 	tty_ldisc_deref(ld);
-	return 0;
+	return ret;
 }
author maintainer
#119 lore raw

PATCH 119/165 floppy: check FDC index for errors before assigning it

In reply to Greg Kroah-Hartman

From: Linus Torvalds <[email protected]>

commit 2e90ca68b0d2f5548804f22f0dd61145516171e3 upstream.

Jordy Zomer reported a KASAN out-of-bounds read in the floppy driver in wait_til_ready().

Which on the face of it can't happen, since as Willy Tarreau points out, the function does no particular memory access. Except through the FDCS macro, which just indexes a static allocation through teh current fdc, which is always checked against N_FDC.

Except the checking happens after we've already assigned the value.

The floppy driver is a disgrace (a lot of it going back to my original horrd "design"), and has no real maintainer. Nobody has the hardware, and nobody really cares. But it still gets used in virtual environment because it's one of those things that everybody supports.

The whole thing should be re-written, or at least parts of it should be seriously cleaned up. The 'current fdc' index, which is used by the FDCS macro, and which is often shadowed by a local 'fdc' variable, is a prime example of how not to write code.

But because nobody has the hardware or the motivation, let's just fix up the immediate problem with a nasty band-aid: test the fdc index before actually assigning it to the static 'fdc' variable.

---
 drivers/block/floppy.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/block/floppy.c +5 -2
@@ -848,14 +848,17 @@ static void reset_fdc_info(int mode)
 /* selects the fdc and drive, and enables the fdc's input/dma. */
 static void set_fdc(int drive)
 {
+	unsigned int new_fdc = fdc;
+
 	if (drive >= 0 && drive < N_DRIVE) {
-		fdc = FDC(drive);
+		new_fdc = FDC(drive);
 		current_drive = drive;
 	}
-	if (fdc != 1 && fdc != 0) {
+	if (new_fdc >= N_FDC) {
 		pr_info("bad fdc value\n");
 		return;
 	}
+	fdc = new_fdc;
 	set_dor(fdc, ~0, 8);
 #if N_FDC > 1
 	set_dor(1 - fdc, ~8, 0);
author maintainer
#112 lore raw

PATCH 112/165 microblaze: Prevent the overflow of the start

In reply to Greg Kroah-Hartman

From: Shubhrajyoti Datta <[email protected]>

[ Upstream commit 061d2c1d593076424c910cb1b64ecdb5c9a6923f ]

In case the start + cache size is more than the max int the start overflows.
Prevent the same.

---
 arch/microblaze/kernel/cpu/cache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/microblaze/kernel/cpu/cache.c +2 -1
index 0bde47e4fa694..dcba53803fa5f 100644
@@ -92,7 +92,8 @@ static inline void __disable_dcache_nomsr(void)
 #define CACHE_LOOP_LIMITS(start, end, cache_line_length, cache_size)	\
 do {									\
 	int align = ~(cache_line_length - 1);				\
-	end = min(start + cache_size, end);				\
+	if (start <  UINT_MAX - cache_size)				\
+		end = min(start + cache_size, end);			\
 	start &= align;							\
 } while (0)
 
Signature · 1 line
2.20.1
author maintainer
#109 lore raw

PATCH 109/165 bcache: explicity type cast in bset_bkey_last()

In reply to Greg Kroah-Hartman

From: Coly Li <[email protected]>

[ Upstream commit 7c02b0055f774ed9afb6e1c7724f33bf148ffdc0 ]

In bset.h, macro bset_bkey_last() is defined as,

    bkey_idx((struct bkey *) (i)->d, (i)->keys)

Parameter i can be variable type of data structure, the macro always works once the type of struct i has member 'd' and 'keys'.

bset_bkey_last() is also used in macro csum_set() to calculate the checksum of a on-disk data structure. When csum_set() is used to calculate checksum of on-disk bcache super block, the parameter 'i' data type is struct cache_sb_disk. Inside struct cache_sb_disk (also in struct cache_sb) the member keys is __u16 type. But bkey_idx() expects unsigned int (a 32bit width), so there is problem when sending parameters via stack to call bkey_idx().

Sparse tool from Intel 0day kbuild system reports this incompatible problem. bkey_idx() is part of user space API, so the simplest fix is to cast the (i)->keys to unsigned int type in macro bset_bkey_last().

---
 drivers/md/bcache/bset.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/bcache/bset.h +2 -1
index b935839ab79c6..f483041eed986 100644
@@ -380,7 +380,8 @@ void bch_btree_keys_stats(struct btree_keys *, struct bset_stats *);
 
 /* Bkey utility code */
 
-#define bset_bkey_last(i)	bkey_idx((struct bkey *) (i)->d, (i)->keys)
+#define bset_bkey_last(i)	bkey_idx((struct bkey *) (i)->d, \
+					 (unsigned int)(i)->keys)
 
 static inline struct bkey *bset_bkey_idx(struct bset *i, unsigned idx)
 {
Signature · 1 line
2.20.1
author maintainer
#103 lore raw

PATCH 103/165 ftrace: fpid_next() should increase position index

In reply to Greg Kroah-Hartman

From: Vasily Averin <[email protected]>

[ Upstream commit e4075e8bdffd93a9b6d6e1d52fabedceeca5a91b ]

if seq_file .next fuction does not change position index, read after some lseek can generate unexpected output.

Without patch:

 # dd bs=4 skip=1 if=/sys/kernel/tracing/set_ftrace_pid
 dd: /sys/kernel/tracing/set_ftrace_pid: cannot skip to specified offset
 id
 no pid
 2+1 records in
 2+1 records out
 10 bytes copied, 0.000213285 s, 46.9 kB/s

Notice the "id" followed by "no pid".

With the patch:

 # dd bs=4 skip=1 if=/sys/kernel/tracing/set_ftrace_pid
 dd: /sys/kernel/tracing/set_ftrace_pid: cannot skip to specified offset
 id
 0+1 records in
 0+1 records out
 3 bytes copied, 0.000202112 s, 14.8 kB/s

Notice that it only prints "id" and not the "no pid" afterward.

https://bugzilla.kernel.org/show_bug.cgi?id=206283

---
 kernel/trace/ftrace.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/trace/ftrace.c +3 -2
index 71a40e5c3a9f0..2ae98f8bce81b 100644
@@ -5455,9 +5455,10 @@ static void *fpid_next(struct seq_file *m, void *v, loff_t *pos)
 	struct trace_array *tr = m->private;
 	struct trace_pid_list *pid_list = rcu_dereference_sched(tr->function_pids);
 
-	if (v == FTRACE_NO_PIDS)
+	if (v == FTRACE_NO_PIDS) {
+		(*pos)++;
 		return NULL;
-
+	}
 	return trace_pid_next(pid_list, v, pos);
 }
 
Signature · 1 line
2.20.1
author maintainer
#51 lore raw

PATCH 51/165 reiserfs: Fix spurious unlock in reiserfs_fill_super() error handling

In reply to Greg Kroah-Hartman

From: Jan Kara <[email protected]>

[ Upstream commit 4d5c1adaf893b8aa52525d2b81995e949bcb3239 ]

When we fail to allocate string for journal device name we jump to 'error' label which tries to unlock reiserfs write lock which is not held. Jump to 'error_unlocked' instead.

Fixes f32485be8397 ("reiserfs: delay reiserfs lock until journal initialization")
---
 fs/reiserfs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/reiserfs/super.c +1 -1
index bfed2a7000154..677608a89b08d 100644
@@ -1928,7 +1928,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
 		if (!sbi->s_jdev) {
 			SWARN(silent, s, "", "Cannot allocate memory for "
 				"journal device name");
-			goto error;
+			goto error_unlocked;
 		}
 	}
 #ifdef CONFIG_QUOTA
Signature · 1 line
2.20.1
author maintainer
#48 lore raw

PATCH 48/165 PCI/IOV: Fix memory leak in pci_iov_add_virtfn()

In reply to Greg Kroah-Hartman

From: Navid Emamdoost <[email protected]>

[ Upstream commit 8c386cc817878588195dde38e919aa6ba9409d58 ]

In the implementation of pci_iov_add_virtfn() the allocated virtfn is leaked if pci_setup_device() fails. The error handling is not calling pci_stop_and_remove_bus_device(). Change the goto label to failed2.

Fixes 156c55325d30 ("PCI: Check for pci_setup_device() failure in pci_iov_add_virtfn()")
---
 drivers/pci/iov.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/iov.c +1 -0
index 1d32fe2d97aa7..9ec3cb628b0b6 100644
@@ -181,6 +181,7 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id, int reset)
 failed2:
 	sysfs_remove_link(&dev->dev.kobj, buf);
 failed1:
+	pci_stop_and_remove_bus_device(virtfn);
 	pci_dev_put(dev);
 	mutex_lock(&iov->dev->sriov->lock);
 	pci_stop_and_remove_bus_device(virtfn);
Signature · 1 line
2.20.1
author maintainer
#83 lore raw

PATCH 83/165 usb: musb: omap2430: Get rid of musb .set_vbus for omap2430 glue

In reply to Greg Kroah-Hartman

From: Tony Lindgren <[email protected]>

[ Upstream commit 91b6dec32e5c25fbdbb564d1e5af23764ec17ef1 ]

We currently have musb_set_vbus() called from two different paths. Mostly it gets called from the USB PHY via omap_musb_set_mailbox(), but in some cases it can get also called from musb_stage0_irq() rather via .set_vbus:

(musb_set_host [musb_hdrc])
(omap2430_musb_set_vbus [omap2430])
(musb_stage0_irq [musb_hdrc])
(musb_interrupt [musb_hdrc])
(omap2430_musb_interrupt [omap2430])

This is racy and will not work with introducing generic helper functions for musb_set_host() and musb_set_peripheral(). We want to get rid of the busy loops in favor of usleep_range().

Let's just get rid of .set_vbus for omap2430 glue layer and let the PHY code handle VBUS with musb_set_vbus(). Note that in the follow-up patch we can completely remove omap2430_musb_set_vbus(), but let's do it in a separate patch as this change may actually turn out to be needed as a fix.

---
 drivers/usb/musb/omap2430.c | 2 --
 1 file changed, 2 deletions(-)
drivers/usb/musb/omap2430.c +0 -2
index e8be8e39ab8fb..457ad33f4caa8 100644
@@ -388,8 +388,6 @@ static const struct musb_platform_ops omap2430_ops = {
 	.init		= omap2430_musb_init,
 	.exit		= omap2430_musb_exit,
 
-	.set_vbus	= omap2430_musb_set_vbus,
-
 	.enable		= omap2430_musb_enable,
 	.disable	= omap2430_musb_disable,
 
Signature · 1 line
2.20.1
author maintainer
#81 lore raw

PATCH 81/165 drm/nouveau: Fix copy-paste error in nouveau_fence_wait_uevent_handler

In reply to Greg Kroah-Hartman

From: YueHaibing <[email protected]>

[ Upstream commit 1eb013473bff5f95b6fe1ca4dd7deda47257b9c2 ]

Like other cases, it should use rcu protected 'chan' rather than 'fence->channel' in nouveau_fence_wait_uevent_handler.

Fixes 0ec5f02f0e2c ("drm/nouveau: prevent stale fence->channel pointers, and protect with rcu")
---
 drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_fence.c +1 -1
index 4bb9ab892ae19..78e521d00251c 100644
@@ -158,7 +158,7 @@ nouveau_fence_wait_uevent_handler(struct nvif_notify *notify)
 
 		fence = list_entry(fctx->pending.next, typeof(*fence), head);
 		chan = rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx->lock));
-		if (nouveau_fence_update(fence->channel, fctx))
+		if (nouveau_fence_update(chan, fctx))
 			ret = NVIF_NOTIFY_DROP;
 	}
 	spin_unlock_irqrestore(&fctx->lock, flags);
Signature · 1 line
2.20.1
author maintainer
#72 lore raw

PATCH 72/165 Input: edt-ft5x06 - work around first register access error

In reply to Greg Kroah-Hartman

From: Philipp Zabel <[email protected]>

[ Upstream commit e112324cc0422c046f1cf54c56f333d34fa20885 ]

The EP0700MLP1 returns bogus data on the first register read access (reading the threshold parameter from register 0x00):

    edt_ft5x06 2-0038: crc error: 0xfc expected, got 0x40

It ignores writes until then. This patch adds a dummy read after which the number of sensors and parameter read/writes work correctly.

---
 drivers/input/touchscreen/edt-ft5x06.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/input/touchscreen/edt-ft5x06.c +7 -0
index 28466e358fee1..22c8d2070faac 100644
@@ -887,6 +887,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 {
 	const struct edt_i2c_chip_data *chip_data;
 	struct edt_ft5x06_ts_data *tsdata;
+	u8 buf[2] = { 0xfc, 0x00 };
 	struct input_dev *input;
 	unsigned long irq_flags;
 	int error;
@@ -956,6 +957,12 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
 		return error;
 	}
 
+	/*
+	 * Dummy read access. EP0700MLP1 returns bogus data on the first
+	 * register read access and ignores writes.
+	 */
+	edt_ft5x06_ts_readwrite(tsdata->client, 2, buf, 2, buf);
+
 	edt_ft5x06_ts_set_regs(tsdata);
 	edt_ft5x06_ts_get_defaults(&client->dev, tsdata);
 	edt_ft5x06_ts_get_parameters(tsdata);
Signature · 1 line
2.20.1
author maintainer
#73 lore raw

PATCH 73/165 wan: ixp4xx_hss: fix compile-testing on 64-bit

In reply to Greg Kroah-Hartman

From: Arnd Bergmann <[email protected]>

[ Upstream commit 504c28c853ec5c626900b914b5833daf0581a344 ]

Change the driver to use portable integer types to avoid warnings during compile testing:

drivers/net/wan/ixp4xx_hss.c:863:21: error: cast to 'u32 *' (aka 'unsigned int *') from smaller integer type 'int' [-Werror,-Wint-to-pointer-cast]

        memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4);
                           ^
drivers/net/wan/ixp4xx_hss.c:979:12: error: incompatible pointer types passing 'u32 *' (aka 'unsigned int *') to parameter of type 'dma_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
                                              &port->desc_tab_phys)))
                                              ^~~~~~~~~~~~~~~~~~~~
include/linux/dmapool.h:27:20: note: passing argument to parameter 'handle' here
                     dma_addr_t *handle);
                                 ^
---
 drivers/net/wan/ixp4xx_hss.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wan/ixp4xx_hss.c +2 -2
index e7bbdb7af53ac..97968e6a6a4eb 100644
@@ -261,7 +261,7 @@ struct port {
 	struct hss_plat_info *plat;
 	buffer_t *rx_buff_tab[RX_DESCS], *tx_buff_tab[TX_DESCS];
 	struct desc *desc_tab;	/* coherent */
-	u32 desc_tab_phys;
+	dma_addr_t desc_tab_phys;
 	unsigned int id;
 	unsigned int clock_type, clock_rate, loopback;
 	unsigned int initialized, carrier;
@@ -861,7 +861,7 @@ static int hss_hdlc_xmit(struct sk_buff *skb, struct net_device *dev)
 		dev->stats.tx_dropped++;
 		return NETDEV_TX_OK;
 	}
-	memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4);
+	memcpy_swab32(mem, (u32 *)((uintptr_t)skb->data & ~3), bytes / 4);
 	dev_kfree_skb(skb);
 #endif
 
Signature · 1 line
2.20.1
author maintainer
#45 lore raw

PATCH 45/165 drm/amdgpu: remove 4 set but not used variable in amdgpu_atombios_get_connector_info_from_object_table

In reply to Greg Kroah-Hartman

From: yu kuai <[email protected]>

[ Upstream commit bae028e3e521e8cb8caf2cc16a455ce4c55f2332 ]

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c: In function 'amdgpu_atombios_get_connector_info_from_object_table':
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:376:26: warning: variable 'grph_obj_num' set but not used [-Wunused-but-set-variable] drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:376:13: warning: variable 'grph_obj_id' set but not used [-Wunused-but-set-variable] drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:341:37: warning: variable 'con_obj_type' set but not used [-Wunused-but-set-variable] drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c:341:24: warning: variable 'con_obj_num' set but not used [-Wunused-but-set-variable]

They are never used, so can be removed.

Fixes d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +2 -17
index 26afdffab5a06..ac8885562919d 100644
@@ -336,17 +336,9 @@ bool amdgpu_atombios_get_connector_info_from_object_table(struct amdgpu_device *
 		path_size += le16_to_cpu(path->usSize);
 
 		if (device_support & le16_to_cpu(path->usDeviceTag)) {
-			uint8_t con_obj_id, con_obj_num, con_obj_type;
-
-			con_obj_id =
+			uint8_t con_obj_id =
 			    (le16_to_cpu(path->usConnObjectId) & OBJECT_ID_MASK)
 			    >> OBJECT_ID_SHIFT;
-			con_obj_num =
-			    (le16_to_cpu(path->usConnObjectId) & ENUM_ID_MASK)
-			    >> ENUM_ID_SHIFT;
-			con_obj_type =
-			    (le16_to_cpu(path->usConnObjectId) &
-			     OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
 
 			/* Skip TV/CV support */
 			if ((le16_to_cpu(path->usDeviceTag) ==
@@ -371,14 +363,7 @@ bool amdgpu_atombios_get_connector_info_from_object_table(struct amdgpu_device *
 			router.ddc_valid = false;
 			router.cd_valid = false;
 			for (j = 0; j < ((le16_to_cpu(path->usSize) - 8) / 2); j++) {
-				uint8_t grph_obj_id, grph_obj_num, grph_obj_type;
-
-				grph_obj_id =
-				    (le16_to_cpu(path->usGraphicObjIds[j]) &
-				     OBJECT_ID_MASK) >> OBJECT_ID_SHIFT;
-				grph_obj_num =
-				    (le16_to_cpu(path->usGraphicObjIds[j]) &
-				     ENUM_ID_MASK) >> ENUM_ID_SHIFT;
+				uint8_t grph_obj_type=
 				grph_obj_type =
 				    (le16_to_cpu(path->usGraphicObjIds[j]) &
 				     OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
Signature · 1 line
2.20.1
author maintainer
#65 lore raw

PATCH 65/165 RDMA/rxe: Fix error type of mmap_offset

In reply to Greg Kroah-Hartman

From: Jiewei Ke <[email protected]>

[ Upstream commit 6ca18d8927d468c763571f78c9a7387a69ffa020 ]

The type of mmap_offset should be u64 instead of int to match the type of mminfo.offset. If otherwise, after we create several thousands of CQs, it will run into overflow issues.

---
 drivers/infiniband/sw/rxe/rxe_verbs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/sw/rxe/rxe_verbs.h +1 -1
index 47003d2a4a46e..dee3853163b60 100644
@@ -422,7 +422,7 @@ struct rxe_dev {
 	struct list_head	pending_mmaps;
 
 	spinlock_t		mmap_offset_lock; /* guard mmap_offset */
-	int			mmap_offset;
+	u64			mmap_offset;
 
 	struct rxe_port		port;
 	struct list_head	list;
Signature · 1 line
2.20.1
author maintainer
#44 lore raw

PATCH 44/165 clk: qcom: rcg2: Dont crash if our parent cant be found; return an error

In reply to Greg Kroah-Hartman

From: Douglas Anderson <[email protected]>

[ Upstream commit 908b050114d8fefdddc57ec9fbc213c3690e7f5f ]

When I got my clock parenting slightly wrong I ended up with a crash that looked like this:

  Unable to handle kernel NULL pointer dereference at virtual
  address 0000000000000000
  ...
  pc : clk_hw_get_rate+0x14/0x44
  ...
  Call trace:
   clk_hw_get_rate+0x14/0x44
   _freq_tbl_determine_rate+0x94/0xfc
   clk_rcg2_determine_rate+0x2c/0x38
   clk_core_determine_round_nolock+0x4c/0x88
   clk_core_round_rate_nolock+0x6c/0xa8
   clk_core_round_rate_nolock+0x9c/0xa8
   clk_core_set_rate_nolock+0x70/0x180
   clk_set_rate+0x3c/0x6c
   of_clk_set_defaults+0x254/0x360
   platform_drv_probe+0x28/0xb0
   really_probe+0x120/0x2dc
   driver_probe_device+0x64/0xfc
   device_driver_attach+0x4c/0x6c
   __driver_attach+0xac/0xc0
   bus_for_each_dev+0x84/0xcc
   driver_attach+0x2c/0x38
   bus_add_driver+0xfc/0x1d0
   driver_register+0x64/0xf8
   __platform_driver_register+0x4c/0x58
   msm_drm_register+0x5c/0x60
   ...

It turned out that clk_hw_get_parent_by_index() was returning NULL and we weren't checking. Let's check it so that we don't crash.

---
 drivers/clk/qcom/clk-rcg2.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clk/qcom/clk-rcg2.c +3 -0
index 0ae1b0a66eb55..d8601b138dc1e 100644
@@ -194,6 +194,9 @@ static int _freq_tbl_determine_rate(struct clk_hw *hw,
 
 	clk_flags = clk_hw_get_flags(hw);
 	p = clk_hw_get_parent_by_index(hw, index);
+	if (!p)
+		return -EINVAL;
+
 	if (clk_flags & CLK_SET_RATE_PARENT) {
 		if (f->pre_div) {
 			if (!rate)
Signature · 1 line
2.20.1
author maintainer
#57 lore raw

PATCH 57/165 orinoco: avoid assertion in case of NULL pointer

In reply to Greg Kroah-Hartman

From: Aditya Pakki <[email protected]>

[ Upstream commit c705f9fc6a1736dcf6ec01f8206707c108dca824 ]

In ezusb_init, if upriv is NULL, the code crashes. However, the caller in ezusb_probe can handle the error and print the failure message. The patch replaces the BUG_ON call to error return.

---
 drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/intersil/orinoco/orinoco_usb.c +2 -1
index 8244d82629511..4e91c74fcfad9 100644
@@ -1351,7 +1351,8 @@ static int ezusb_init(struct hermes *hw)
 	int retval;
 
 	BUG_ON(in_interrupt());
-	BUG_ON(!upriv);
+	if (!upriv)
+		return -EINVAL;
 
 	upriv->reply_count = 0;
 	/* Write the MAGIC number on the simulated registers to keep
Signature · 1 line
2.20.1
author maintainer
#55 lore raw

PATCH 55/165 iwlegacy: Fix -Wcast-function-type

In reply to Greg Kroah-Hartman

From: Phong Tran <[email protected]>

[ Upstream commit da5e57e8a6a3e69dac2937ba63fa86355628fbb2 ]

correct usage prototype of callback in tasklet_init(). Report by https://github.com/KSPP/linux/issues/20

---
 drivers/net/wireless/intel/iwlegacy/3945-mac.c | 5 +++--
 drivers/net/wireless/intel/iwlegacy/4965-mac.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlegacy/3945-mac.c +3 -2
index 466912eb2d874..d853ccbf74cb2 100644
@@ -1399,8 +1399,9 @@ il3945_dump_nic_error_log(struct il_priv *il)
 }
 
 static void
-il3945_irq_tasklet(struct il_priv *il)
+il3945_irq_tasklet(unsigned long data)
 {
+	struct il_priv *il = (struct il_priv *)data;
 	u32 inta, handled = 0;
 	u32 inta_fh;
 	unsigned long flags;
@@ -3432,7 +3433,7 @@ il3945_setup_deferred_work(struct il_priv *il)
 	setup_timer(&il->watchdog, il_bg_watchdog, (unsigned long)il);
 
 	tasklet_init(&il->irq_tasklet,
-		     (void (*)(unsigned long))il3945_irq_tasklet,
+		     il3945_irq_tasklet,
 		     (unsigned long)il);
 }
 
drivers/net/wireless/intel/iwlegacy/4965-mac.c +3 -2
index a91d170a614b6..6c2dcd2367136 100644
@@ -4361,8 +4361,9 @@ il4965_synchronize_irq(struct il_priv *il)
 }
 
 static void
-il4965_irq_tasklet(struct il_priv *il)
+il4965_irq_tasklet(unsigned long data)
 {
+	struct il_priv *il = (struct il_priv *)data;
 	u32 inta, handled = 0;
 	u32 inta_fh;
 	unsigned long flags;
@@ -6260,7 +6261,7 @@ il4965_setup_deferred_work(struct il_priv *il)
 	setup_timer(&il->watchdog, il_bg_watchdog, (unsigned long)il);
 
 	tasklet_init(&il->irq_tasklet,
-		     (void (*)(unsigned long))il4965_irq_tasklet,
+		     il4965_irq_tasklet,
 		     (unsigned long)il);
 }
 
Signature · 1 line
2.20.1
author maintainer
#11 lore raw

PATCH 11/165 btrfs: log message when rw remount is attempted with unclean tree-log

In reply to Greg Kroah-Hartman

From: David Sterba <[email protected]>

commit 10a3a3edc5b89a8cd095bc63495fb1e0f42047d9 upstream.

A remount to a read-write filesystem is not safe when there's tree-log to be replayed. Files that could be opened until now might be affected by the changes in the tree-log.

A regular mount is needed to replay the log so the filesystem presents the consistent view with the pending changes included.

---
 fs/btrfs/super.c |    2 ++
 1 file changed, 2 insertions(+)
fs/btrfs/super.c +2 -0
@@ -1809,6 +1809,8 @@ static int btrfs_remount(struct super_bl
 		}
 
 		if (btrfs_super_log_root(fs_info->super_copy) != 0) {
+			btrfs_warn(fs_info,
+		"mount required to replay tree-log, cannot remount read-write");
 			ret = -EINVAL;
 			goto restore;
 		}
author maintainer
#10 lore raw

PATCH 10/165 Btrfs: fix race between using extent maps and merging them

In reply to Greg Kroah-Hartman

From: Filipe Manana <[email protected]>

commit ac05ca913e9f3871126d61da275bfe8516ff01ca upstream.

We have a few cases where we allow an extent map that is in an extent map tree to be merged with other extents in the tree. Such cases include the unpinning of an extent after the respective ordered extent completed or after logging an extent during a fast fsync. This can lead to subtle and dangerous problems because when doing the merge some other task might be using the same extent map and as consequence see an inconsistent state of the extent map - for example sees the new length but has seen the old start offset.

With luck this triggers a BUG_ON(), and not some silent bug, such as the following one in __do_readpage():

  $ cat -n fs/btrfs/extent_io.c
  3061  static int __do_readpage(struct extent_io_tree *tree,
  3062                           struct page *page,
  (...)
  3127                  em = __get_extent_map(inode, page, pg_offset, cur,
  3128                                        end - cur + 1, get_extent, em_cached);
  3129                  if (IS_ERR_OR_NULL(em)) {
  3130                          SetPageError(page);
  3131                          unlock_extent(tree, cur, end);
  3132                          break;
  3133                  }
  3134                  extent_offset = cur - em->start;
  3135                  BUG_ON(extent_map_end(em) <= cur);
  (...)

Consider the following example scenario, where we end up hitting the BUG_ON() in __do_readpage().

We have an inode with a size of 8KiB and 2 extent maps:

extent A: file offset 0, length 4KiB, disk_bytenr = X, persisted on disk by
a previous transaction

extent B: file offset 4KiB, length 4KiB, disk_bytenr = X + 4KiB, not yet
persisted but writeback started for it already. The extent map is pinned since there's writeback and an ordered extent in progress, so it can not be merged with extent map A yet

The following sequence of steps leads to the BUG_ON():

1) The ordered extent for extent B completes, the respective page gets its writeback bit cleared and the extent map is unpinned, at that point it is not yet merged with extent map A because it's in the list of modified extents;

2) Due to memory pressure, or some other reason, the MM subsystem releases the page corresponding to extent B - btrfs_releasepage() is called and returns 1, meaning the page can be released as it's not dirty, not under writeback anymore and the extent range is not locked in the inode's iotree. However the extent map is not released, either because we are not in a context that allows memory allocations to block or because the inode's size is smaller than 16MiB - in this case our inode has a size of 8KiB;

3) Task B needs to read extent B and ends up __do_readpage() through the btrfs_readpage() callback. At __do_readpage() it gets a reference to extent map B;

4) Task A, doing a fast fsync, calls clear_em_loggin() against extent map B while holding the write lock on the inode's extent map tree - this results in try_merge_map() being called and since it's possible to merge extent map B with extent map A now (the extent map B was removed from the list of modified extents), the merging begins - it sets extent map B's start offset to 0 (was 4KiB), but before it increments the map's length to 8KiB (4kb + 4KiB), task A is at:

   BUG_ON(extent_map_end(em) <= cur);

The call to extent_map_end() sees the extent map has a start of 0 and a length still at 4KiB, so it returns 4KiB and 'cur' is 4KiB, so the BUG_ON() is triggered.

So it's dangerous to modify an extent map that is in the tree, because some other task might have got a reference to it before and still using it, and needs to see a consistent map while using it. Generally this is very rare since most paths that lookup and use extent maps also have the file range locked in the inode's iotree. The fsync path is pretty much the only exception where we don't do it to avoid serialization with concurrent reads.

Fix this by not allowing an extent map do be merged if if it's being used by tasks other then the one attempting to merge the extent map (when the reference count of the extent map is greater than 2).

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=206211

---
 fs/btrfs/extent_map.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
fs/btrfs/extent_map.c +11 -0
@@ -227,6 +227,17 @@ static void try_merge_map(struct extent_
 	struct extent_map *merge = NULL;
 	struct rb_node *rb;
 
+	/*
+	 * We can't modify an extent map that is in the tree and that is being
+	 * used by another task, as it can cause that other task to see it in
+	 * inconsistent state during the merging. We always have 1 reference for
+	 * the tree and 1 for this task (which is unpinning the extent map or
+	 * clearing the logging flag), so anything > 2 means it's being used by
+	 * other tasks too.
+	 */
+	if (atomic_read(&em->refs) > 2)
+		return;
+
 	if (em->start != 0) {
 		rb = rb_prev(&em->rb_node);
 		if (rb)
author maintainer
#6 lore raw

PATCH 6/165 ALSA: usb-audio: Apply sample rate quirk for Audioengine D1

In reply to Greg Kroah-Hartman

From: Arvind Sankar <[email protected]>

commit 93f9d1a4ac5930654c17412e3911b46ece73755a upstream.

The Audioengine D1 (0x2912:0x30c8) does support reading the sample rate, but it returns the rate in byte-reversed order.

When setting sampling rate, the driver produces these warning messages:

[168840.944226] usb 3-2.2: current rate 4500480 is different from the runtime rate 44100
[168854.930414] usb 3-2.2: current rate 8436480 is different from the runtime rate 48000
[168905.185825] usb 3-2.1.2: current rate 30465 is different from the runtime rate 96000

As can be seen from the hexadecimal conversion, the current rate read back is byte-reversed from the rate that was set.

44100 == 0x00ac44, 4500480 == 0x44ac00
48000 == 0x00bb80, 8436480 == 0x80bb00
96000 == 0x017700, 30465 == 0x007701

Rather than implementing a new quirk to reverse the order, just skip checking the rate to avoid spamming the log.

---
 sound/usb/quirks.c |    1 +
 1 file changed, 1 insertion(+)
sound/usb/quirks.c +1 -0
@@ -1149,6 +1149,7 @@ bool snd_usb_get_sample_rate_quirk(struc
 	case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */
 	case USB_ID(0x1de7, 0x0114): /* Phoenix Audio MT202pcs */
 	case USB_ID(0x21B4, 0x0081): /* AudioQuest DragonFly */
+	case USB_ID(0x2912, 0x30c8): /* Audioengine D1 */
 		return true;
 	}
 	return false;
author maintainer
#34 lore raw

PATCH 34/165 MIPS: Loongson: Fix potential NULL dereference in loongson3_platform_init()

In reply to Greg Kroah-Hartman

From: Tiezhu Yang <[email protected]>

[ Upstream commit 72d052e28d1d2363f9107be63ef3a3afdea6143c ]

If kzalloc fails, it should return -ENOMEM, otherwise may trigger a NULL pointer dereference.

Fixes 3adeb2566b9b ("MIPS: Loongson: Improve LEFI firmware interface")
Cc Ralf Baechle <[email protected]>
Cc Huacai Chen <[email protected]>
Cc Jiaxun Yang <[email protected]>
---
 arch/mips/loongson64/loongson-3/platform.c | 3 +++
 1 file changed, 3 insertions(+)
arch/mips/loongson64/loongson-3/platform.c +3 -0
index 25a97cc0ee336..0db4cc3196ebd 100644
@@ -31,6 +31,9 @@ static int __init loongson3_platform_init(void)
 			continue;
 
 		pdev = kzalloc(sizeof(struct platform_device), GFP_KERNEL);
+		if (!pdev)
+			return -ENOMEM;
+
 		pdev->name = loongson_sysconf.sensors[i].name;
 		pdev->id = loongson_sysconf.sensors[i].id;
 		pdev->dev.platform_data = &loongson_sysconf.sensors[i];
Signature · 1 line
2.20.1
author maintainer
#31 lore raw

PATCH 31/165 media: sti: bdisp: fix a possible sleep-in-atomic-context bug in bdisp_device_run()

In reply to Greg Kroah-Hartman

From: Jia-Ju Bai <[email protected]>

[ Upstream commit bb6d42061a05d71dd73f620582d9e09c8fbf7f5b ]

The driver may sleep while holding a spinlock.
The function call path (from bottom to top) in Linux 4.19 is:

drivers/media/platform/sti/bdisp/bdisp-hw.c, 385:
msleep in bdisp_hw_reset
drivers/media/platform/sti/bdisp/bdisp-v4l2.c, 341:
bdisp_hw_reset in bdisp_device_run
drivers/media/platform/sti/bdisp/bdisp-v4l2.c, 317:
_raw_spin_lock_irqsave in bdisp_device_run

To fix this bug, msleep() is replaced with udelay().

This bug is found by a static analysis tool STCheck written by myself.

---
 drivers/media/platform/sti/bdisp/bdisp-hw.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/platform/sti/bdisp/bdisp-hw.c +3 -3
index b7892f3efd988..5c4c3f0c57be1 100644
@@ -14,8 +14,8 @@
 #define MAX_SRC_WIDTH           2048
 
 /* Reset & boot poll config */
-#define POLL_RST_MAX            50
-#define POLL_RST_DELAY_MS       20
+#define POLL_RST_MAX            500
+#define POLL_RST_DELAY_MS       2
 
 enum bdisp_target_plan {
 	BDISP_RGB,
@@ -382,7 +382,7 @@ int bdisp_hw_reset(struct bdisp_dev *bdisp)
 	for (i = 0; i < POLL_RST_MAX; i++) {
 		if (readl(bdisp->regs + BLT_STA1) & BLT_STA1_IDLE)
 			break;
-		msleep(POLL_RST_DELAY_MS);
+		udelay(POLL_RST_DELAY_MS * 1000);
 	}
 	if (i == POLL_RST_MAX)
 		dev_err(bdisp->dev, "Reset timeout\n");
Signature · 1 line
2.20.1
author maintainer
#25 lore raw

PATCH 25/165 gianfar: Fix TX timestamping with a stacked DSA driver

In reply to Greg Kroah-Hartman

From: Vladimir Oltean <[email protected]>

[ Upstream commit c26a2c2ddc0115eb088873f5c309cf46b982f522 ]

The driver wrongly assumes that it is the only entity that can set the SKBTX_IN_PROGRESS bit of the current skb. Therefore, in the gfar_clean_tx_ring function, where the TX timestamp is collected if necessary, the aforementioned bit is used to discriminate whether or not the TX timestamp should be delivered to the socket's error queue.

But a stacked driver such as a DSA switch can also set the SKBTX_IN_PROGRESS bit, which is actually exactly what it should do in order to denote that the hardware timestamping process is undergoing.

Therefore, gianfar would misinterpret the "in progress" bit as being its own, and deliver a second skb clone in the socket's error queue, completely throwing off a PTP process which is not expecting to receive it, _even though_ TX timestamping is not enabled for gianfar.

There have been discussions [0] as to whether non-MAC drivers need or not to set SKBTX_IN_PROGRESS at all (whose purpose is to avoid sending 2 timestamps, a sw and a hw one, to applications which only expect one). But as of this patch, there are at least 2 PTP drivers that would break in conjunction with gianfar: the sja1105 DSA switch and the felix switch, by way of its ocelot core driver.

So regardless of that conclusion, fix the gianfar driver to not do stuff based on flags set by others and not intended for it.

[0]: https://www.spinics.net/lists/netdev/msg619699.html

Fixes f0ee7acfcdd4 ("gianfar: Add hardware TX timestamping support")
---
 drivers/net/ethernet/freescale/gianfar.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ethernet/freescale/gianfar.c +7 -3
index 60bd1b36df606..b665d27f8e299 100644
@@ -2688,13 +2688,17 @@ static void gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
 	skb_dirtytx = tx_queue->skb_dirtytx;
 
 	while ((skb = tx_queue->tx_skbuff[skb_dirtytx])) {
+		bool do_tstamp;
+
+		do_tstamp = (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
+			    priv->hwts_tx_en;
 
 		frags = skb_shinfo(skb)->nr_frags;
 
 		/* When time stamping, one additional TxBD must be freed.
 		 * Also, we need to dma_unmap_single() the TxPAL.
 		 */
-		if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS))
+		if (unlikely(do_tstamp))
 			nr_txbds = frags + 2;
 		else
 			nr_txbds = frags + 1;
@@ -2708,7 +2712,7 @@ static void gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
 		    (lstatus & BD_LENGTH_MASK))
 			break;
 
-		if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS)) {
+		if (unlikely(do_tstamp)) {
 			next = next_txbd(bdp, base, tx_ring_size);
 			buflen = be16_to_cpu(next->length) +
 				 GMAC_FCB_LEN + GMAC_TXPAL_LEN;
@@ -2718,7 +2722,7 @@ static void gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
 		dma_unmap_single(priv->dev, be32_to_cpu(bdp->bufPtr),
 				 buflen, DMA_TO_DEVICE);
 
-		if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS)) {
+		if (unlikely(do_tstamp)) {
 			struct skb_shared_hwtstamps shhwtstamps;
 			u64 *ns = (u64 *)(((uintptr_t)skb->data + 0x10) &
 					  ~0x7UL);
Signature · 1 line
2.20.1
author maintainer
#22 lore raw

PATCH 22/165 drm/gma500: Fixup fbdev stolen size usage evaluation

In reply to Greg Kroah-Hartman

From: Paul Kocialkowski <[email protected]>

[ Upstream commit fd1a5e521c3c083bb43ea731aae0f8b95f12b9bd ]

psbfb_probe performs an evaluation of the required size from the stolen GTT memory, but gets it wrong in two distinct ways:
- The resulting size must be page-size-aligned;
- The size to allocate is derived from the surface dimensions, not the fb dimensions.

When two connectors are connected with different modes, the smallest will be stored in the fb dimensions, but the size that needs to be allocated must match the largest (surface) dimensions. This is what is used in the actual allocation code.

Fix this by correcting the evaluation to conform to the two points above. It allows correctly switching to 16bpp when one connector is e.g. 1920x1080 and the other is 1024x768.

---
 drivers/gpu/drm/gma500/framebuffer.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/gma500/framebuffer.c +6 -2
index 3a44e705db538..d224fc12b7571 100644
@@ -516,6 +516,7 @@ static int psbfb_probe(struct drm_fb_helper *helper,
 		container_of(helper, struct psb_fbdev, psb_fb_helper);
 	struct drm_device *dev = psb_fbdev->psb_fb_helper.dev;
 	struct drm_psb_private *dev_priv = dev->dev_private;
+	unsigned int fb_size;
 	int bytespp;
 
 	bytespp = sizes->surface_bpp / 8;
@@ -525,8 +526,11 @@ static int psbfb_probe(struct drm_fb_helper *helper,
 	/* If the mode will not fit in 32bit then switch to 16bit to get
 	   a console on full resolution. The X mode setting server will
 	   allocate its own 32bit GEM framebuffer */
-	if (ALIGN(sizes->fb_width * bytespp, 64) * sizes->fb_height >
-	                dev_priv->vram_stolen_size) {
+	fb_size = ALIGN(sizes->surface_width * bytespp, 64) *
+		  sizes->surface_height;
+	fb_size = ALIGN(fb_size, PAGE_SIZE);
+
+	if (fb_size > dev_priv->vram_stolen_size) {
                 sizes->surface_bpp = 16;
                 sizes->surface_depth = 16;
         }
Signature · 1 line
2.20.1
author maintainer
#15 lore raw

PATCH 15/165 perf/x86/intel: Fix inaccurate period in context switch for auto-reload

In reply to Greg Kroah-Hartman

From: Kan Liang <[email protected]>

commit f861854e1b435b27197417f6f90d87188003cb24 upstream.

Perf doesn't take the left period into account when auto-reload is enabled with fixed period sampling mode in context switch.

Here is the MSR trace of the perf command as below. (The MSR trace is simplified from a ftrace log.)

    #perf record -e cycles:p -c 2000000 -- ./triad_loop

      //The MSR trace of task schedule out
      //perf disable all counters, disable PEBS, disable GP counter 0,
      //read GP counter 0, and re-enable all counters.
      //The counter 0 stops at 0xfffffff82840
      write_msr: MSR_CORE_PERF_GLOBAL_CTRL(38f), value 0
      write_msr: MSR_IA32_PEBS_ENABLE(3f1), value 0
      write_msr: MSR_P6_EVNTSEL0(186), value 40003003c
      rdpmc: 0, value fffffff82840
      write_msr: MSR_CORE_PERF_GLOBAL_CTRL(38f), value f000000ff

      //The MSR trace of the same task schedule in again
      //perf disable all counters, enable and set GP counter 0,
      //enable PEBS, and re-enable all counters.
      //0xffffffe17b80 (-2000000) is written to GP counter 0.
      write_msr: MSR_CORE_PERF_GLOBAL_CTRL(38f), value 0
      write_msr: MSR_IA32_PMC0(4c1), value ffffffe17b80
      write_msr: MSR_P6_EVNTSEL0(186), value 40043003c
      write_msr: MSR_IA32_PEBS_ENABLE(3f1), value 1
      write_msr: MSR_CORE_PERF_GLOBAL_CTRL(38f), value f000000ff

When the same task schedule in again, the counter should starts from previous left. However, it starts from the fixed period -2000000 again.

A special variant of intel_pmu_save_and_restart() is used for auto-reload, which doesn't update the hwc->period_left. When the monitored task schedules in again, perf doesn't know the left period. The fixed period is used, which is inaccurate.

With auto-reload, the counter always has a negative counter value. So the left period is -value. Update the period_left in intel_pmu_save_and_restart_reload().

With the patch:

      //The MSR trace of task schedule out
      write_msr: MSR_CORE_PERF_GLOBAL_CTRL(38f), value 0
      write_msr: MSR_IA32_PEBS_ENABLE(3f1), value 0
      write_msr: MSR_P6_EVNTSEL0(186), value 40003003c
      rdpmc: 0, value ffffffe25cbc
      write_msr: MSR_CORE_PERF_GLOBAL_CTRL(38f), value f000000ff

      //The MSR trace of the same task schedule in again
      write_msr: MSR_CORE_PERF_GLOBAL_CTRL(38f), value 0
      write_msr: MSR_IA32_PMC0(4c1), value ffffffe25cbc
      write_msr: MSR_P6_EVNTSEL0(186), value 40043003c
      write_msr: MSR_IA32_PEBS_ENABLE(3f1), value 1
      write_msr: MSR_CORE_PERF_GLOBAL_CTRL(38f), value f000000ff
Fixes d31fc13fdcb2 ("perf/x86/intel: Fix event update for auto-reload")
---
 arch/x86/events/intel/ds.c |    2 ++
 1 file changed, 2 insertions(+)
arch/x86/events/intel/ds.c +2 -0
@@ -1326,6 +1326,8 @@ intel_pmu_save_and_restart_reload(struct
 	old = ((s64)(prev_raw_count << shift) >> shift);
 	local64_add(new - old + count * period, &event->count);
 
+	local64_set(&hwc->period_left, -new);
+
 	perf_event_update_userpage(event);
 
 	return 0;

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover 4.9.215-stable review

This is the start of the stable review cycle for the 4.9.215 release. There are 165 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Sat, 29 Feb 2020 13:21:24 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

	https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.215-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <[email protected]>

    Linux 4.9.215-rc1

Nathan Chancellor <[email protected]>
s390/mm: Explicitly compare PAGE_DEFAULT_KEY against zero in storage_key_init_range

Thomas Gleixner <[email protected]>
xen: Enable interrupts when calling _cond_resched()

Prabhakar Kushwaha <[email protected]>
ata: ahci: Add shutdown to freeze hardware resources of ahci

Cong Wang <[email protected]>
netfilter: xt_hashlimit: limit the max size of hashtable

Takashi Iwai <[email protected]>
ALSA: seq: Fix concurrent access to queue current tick/time

Takashi Iwai <[email protected]>
ALSA: seq: Avoid concurrent access to queue flags

Takashi Iwai <[email protected]>
ALSA: rawmidi: Avoid bit fields for state flags

Aditya Pakki <[email protected]>
ecryptfs: replace BUG_ON with error handling code

Dan Carpenter <[email protected]>
staging: greybus: use after free in gb_audio_manager_remove_all()

Jack Pham <[email protected]>
usb: gadget: composite: Fix bMaxPower for SuperSpeedPlus

Bart Van Assche <[email protected]>
scsi: Revert "target: iscsi: Wait for all commands to finish before freeing a session"

Bart Van Assche <[email protected]>
scsi: Revert "RDMA/isert: Fix a recently introduced regression related to logout"

Filipe Manana <[email protected]>
Btrfs: fix btrfs_wait_ordered_range() so that it waits for all ordered extents

Miaohe Lin <[email protected]>
KVM: apic: avoid calculating pending eoi from an uninitialized val

Oliver Upton <[email protected]>
KVM: nVMX: Check IO instruction VM-exit conditions

Oliver Upton <[email protected]>
KVM: nVMX: Refactor IO bitmap checks into helper function

Eric Biggers <[email protected]>
ext4: fix race between writepages and enabling EXT4_EXTENTS_FL

Eric Biggers <[email protected]>
ext4: rename s_journal_flag_rwsem to s_writepages_rwsem

Jan Kara <[email protected]>
ext4: fix mount failure with quota configured as module

Shijie Luo <[email protected]>

    ext4: add cond_resched() to __ext4_find_entry()

Qian Cai <[email protected]>

    ext4: fix a data race in EXT4_I(inode)->i_disksize

Jann Horn <[email protected]>
netfilter: xt_bpf: add overflow checks

Paolo Bonzini <[email protected]>
KVM: nVMX: Don't emulate instructions in guest mode

Alexander Potapenko <[email protected]>
lib/stackdepot.c: fix global out-of-bounds in stack_slabs

Miles Chen <[email protected]>
lib/stackdepot: Fix outdated comments

Gustavo Luiz Duarte <[email protected]>
powerpc/tm: Fix clearing MSR[TS] in current when reclaiming on signal delivery

Gustavo Romero <[email protected]>
powerpc/tm: Fix endianness flip on trap

Michael Neuling <[email protected]>
powerpc/tm: P9 disable transactionally suspended sigcontexts

Eric Dumazet <[email protected]>
vt: vt_ioctl: fix race in VT_RESIZEX

Al Viro <[email protected]>
VT_RESIZEX: get rid of field-by-field copyin

Miaohe Lin <[email protected]>
KVM: x86: don't notify userspace IOAPIC on edge-triggered interrupt EOI

Mathias Nyman <[email protected]>
xhci: apply XHCI_PME_STUCK_QUIRK to Intel Comet Lake platforms

Ioanna Alifieraki <[email protected]>
Revert "ipc,sem: remove uneeded sem_undo_list lock usage in exit_sem()"

Fugang Duan <[email protected]>
tty: serial: imx: setup the correct sg entry for tx dma

Nicolas Ferre <[email protected]>
tty/serial: atmel: manage shutdown in case of RS485 or ISO7816 mode

Thomas Gleixner <[email protected]>
x86/mce/amd: Fix kobject lifetime

Borislav Petkov <[email protected]>
x86/mce/amd: Publish the bank pointer only after setup has succeeded

Larry Finger <[email protected]>
staging: rtl8188eu: Fix potential overuse of kernel memory

Larry Finger <[email protected]>
staging: rtl8188eu: Fix potential security hole

Alan Stern <[email protected]>
USB: hub: Don't record a connect-change event during reset-resume

Richard Dodd <[email protected]>
USB: Fix novation SourceControl XL after suspend

EJ Hsu <[email protected]>
usb: uas: fix a plug & unplug racing

Mathias Nyman <[email protected]>
xhci: Force Maximum Packet size for Full-speed bulk devices to valid range.

Malcolm Priestley <[email protected]>
staging: vt6656: fix sign of rx_dbm to bb_pre_ed_rssi.

Suren Baghdasaryan <[email protected]>
staging: android: ashmem: Disallow ashmem memory from being remapped

Jiri Slaby <[email protected]>
vt: selection, handle pending signals in paste_selection

Linus Torvalds <[email protected]>
floppy: check FDC index for errors before assigning it

Davide Caratti <[email protected]>
net/sched: flower: add missing validation of TCA_FLOWER_FLAGS

Davide Caratti <[email protected]>
net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS

Firo Yang <[email protected]>
enic: prevent waking up stopped tx queues over watchdog reset

Jaihind Yadav <[email protected]>
selinux: ensure we cleanup the internal AVC counters on error in avc_update()

Vasily Averin <[email protected]>
help_next should increase position index

Zhiqiang Liu <[email protected]>
brd: check and limit max_part par

Shubhrajyoti Datta <[email protected]>
microblaze: Prevent the overflow of the start

Andrei Otcheretianski <[email protected]>
iwlwifi: mvm: Fix thermal zone registration

Zenghui Yu <[email protected]>
irqchip/gic-v3-its: Reference to its_invall_cmd descriptor when building INVALL

Coly Li <[email protected]>
bcache: explicity type cast in bset_bkey_last()

Yunfeng Ye <[email protected]>
reiserfs: prevent NULL pointer dereference in reiserfs_insert_item()

Nathan Chancellor <[email protected]>
lib/scatterlist.c: adjust indentation in __sg_alloc_table

wangyan <[email protected]>
ocfs2: fix a NULL pointer dereference when call ocfs2_update_inode_fsync_trans()

Daniel Vetter <[email protected]>
radeon: insert 10ms sleep in dce5_crtc_load_lut

Vasily Averin <[email protected]>
trigger_next should increase position index

Vasily Averin <[email protected]>
ftrace: fpid_next() should increase position index

Ben Skeggs <[email protected]>
drm/nouveau/disp/nv50-: prevent oops when no channel method map provided

Marc Zyngier <[email protected]>
irqchip/gic-v3: Only provision redistributors that are enabled in ACPI

Ronnie Sahlberg <[email protected]>
cifs: fix NULL dereference in match_prepath

Colin Ian King <[email protected]>
iwlegacy: ensure loop counter addr does not wrap and cause an infinite loop

Nathan Chancellor <[email protected]>
hostap: Adjust indentation in prism2_hostapd_add_sta

Vincenzo Frascino <[email protected]>
ARM: 8951/1: Fix Kexec compilation issue.

zhangyi (F) <[email protected]>
jbd2: switch to use jbd2_journal_abort() when failed to submit the commit record

Oliver O'Halloran <[email protected]>
powerpc/sriov: Remove VF eeh_dev state when disabling SR-IOV

Peter Große <[email protected]>
ALSA: hda - Add docking station support for Lenovo Thinkpad T420s

Colin Ian King <[email protected]>
driver core: platform: fix u32 greater or equal to zero comparison

Vasily Gorbik <[email protected]>
s390/ftrace: generate traced function stack frame

Masami Hiramatsu <[email protected]>
x86/decoder: Add TEST opcode to Group3-2

Brandon Maier <[email protected]>
remoteproc: Initialize rproc_class before use

Dan Carpenter <[email protected]>
ide: serverworks: potential overflow in svwks_set_pio_mode()

Dan Carpenter <[email protected]>
cmd64x: potential buffer overflow in cmd64x_program_timings()

Uwe Kleine-König <[email protected]>
pwm: omap-dmtimer: Remove PWM chip in .remove before making it unfunctional

Sami Tolvanen <[email protected]>
arm64: fix alternatives with LLVM's integrated assembler

Nick Black <[email protected]>
scsi: iscsi: Don't destroy session if there are outstanding connections

Will Deacon <[email protected]>
iommu/arm-smmu-v3: Use WRITE_ONCE() when changing validity of an STE

Tony Lindgren <[email protected]>
usb: musb: omap2430: Get rid of musb .set_vbus for omap2430 glue

Navid Emamdoost <[email protected]>
drm/vmwgfx: prevent memory leak in vmw_cmdbuf_res_add

YueHaibing <[email protected]>
drm/nouveau: Fix copy-paste error in nouveau_fence_wait_uevent_handler

Ben Skeggs <[email protected]>
drm/nouveau/gr/gk20a,gm200-: add terminators to method lists read from fw

Arnd Bergmann <[email protected]>
vme: bridges: reduce stack usage

Geert Uytterhoeven <[email protected]>
driver core: Print device when resources present in really_probe()

Simon Schwartz <[email protected]>
driver core: platform: Prevent resouce overflow from causing infinite loops

Nathan Chancellor <[email protected]>
tty: synclink_gt: Adjust indentation in several functions

Nathan Chancellor <[email protected]>
tty: synclinkmp: Adjust indentation in several functions

Chen Zhou <[email protected]>
ASoC: atmel: fix build error with CONFIG_SND_ATMEL_SOC_DMA=m

Arnd Bergmann <[email protected]>
wan: ixp4xx_hss: fix compile-testing on 64-bit

Philipp Zabel <[email protected]>
Input: edt-ft5x06 - work around first register access error

Paul E. McKenney <[email protected]>

    rcu: Use WRITE_ONCE() for assignments to ->pprev for hlist_nulls

Dmitry Osipenko <[email protected]>
soc/tegra: fuse: Correct straps' address for older Tegra124 device trees

Jan Kara <[email protected]>
udf: Fix free space reporting for metadata and virtual partitions

Shuah Khan <[email protected]>
usbip: Fix unsafe unaligned pointer usage

Andrey Zhizhikin <[email protected]>
tools lib api fs: Fix gcc9 stringop-truncation compilation error

Takashi Iwai <[email protected]>
ALSA: sh: Fix compile warning wrt const

Jiewei Ke <[email protected]>
RDMA/rxe: Fix error type of mmap_offset

Geert Uytterhoeven <[email protected]>
pinctrl: sh-pfc: sh7269: Fix CAN function GPIOs

Chanwoo Choi <[email protected]>
PM / devfreq: rk3399_dmc: Add COMPILE_TEST and HAVE_ARM_SMCCC dependency

Valdis Kletnieks <[email protected]>
x86/vdso: Provide missing include file

Geert Uytterhoeven <[email protected]>
ARM: dts: r8a7779: Add device node for ARM global timer

Bibby Hsieh <[email protected]>
drm/mediatek: handle events when enabling/disabling crtc

Nathan Chancellor <[email protected]>
scsi: aic7xxx: Adjust indentation in ahc_find_syncrate

Erik Kaneda <[email protected]>
ACPICA: Disassembler: create buffer fields in ACPI_PARSE_LOAD_PASS1

Aditya Pakki <[email protected]>
orinoco: avoid assertion in case of NULL pointer

Phong Tran <[email protected]>
rtlwifi: rtl_pci: Fix -Wcast-function-type

Phong Tran <[email protected]>
iwlegacy: Fix -Wcast-function-type

Phong Tran <[email protected]>
ipw2x00: Fix -Wcast-function-type

Phong Tran <[email protected]>
b43legacy: Fix -Wcast-function-type

Nathan Chancellor <[email protected]>
ALSA: usx2y: Adjust indentation in snd_usX2Y_hwdep_dsp_status

Jan Kara <[email protected]>
reiserfs: Fix spurious unlock in reiserfs_fill_super() error handling

Nathan Chancellor <[email protected]>
media: v4l2-device.h: Explicitly compare grp{id,mask} to zero in v4l2_device macros

Mao Wenan <[email protected]>

    NFC: port100: Convert cpu_to_le16(le16_to_cpu(E1) + E2) to use le16_add_cpu().

Navid Emamdoost <[email protected]>
PCI/IOV: Fix memory leak in pci_iov_add_virtfn()

Rasmus Villemoes <[email protected]>
net/wan/fsl_ucc_hdlc: reject muram offsets above 64K

Miquel Raynal <[email protected]>
regulator: rk808: Lower log level on optional GPIOs being not available

yu kuai <[email protected]>
drm/amdgpu: remove 4 set but not used variable in amdgpu_atombios_get_connector_info_from_object_table

Douglas Anderson <[email protected]>
clk: qcom: rcg2: Don't crash if our parent can't be found; return an error

Masahiro Yamada <[email protected]>
kconfig: fix broken dependency in randconfig-generated .config

zhangyi (F) <[email protected]>
ext4, jbd2: ensure panic when aborting with zero errno

Steven Rostedt (VMware) <[email protected]>
tracing: Fix very unlikely race of registering two stat tracers

Luis Henriques <[email protected]>
tracing: Fix tracing_stat return values in error handling paths

Arvind Sankar <[email protected]>
x86/sysfb: Fix check for bad VRAM size

Kai Li <[email protected]>
jbd2: clear JBD2_ABORT flag before journal_reset to update log tail info when load journal

Jia-Ju Bai <[email protected]>
usb: gadget: udc: fix possible sleep-in-atomic-context bugs in gr_probe()

Jia-Ju Bai <[email protected]>
uio: fix a sleep-in-atomic-context bug in uio_dmem_genirq_irqcontrol()

David S. Miller <[email protected]>
sparc: Add .exit.data section.

Tiezhu Yang <[email protected]>
MIPS: Loongson: Fix potential NULL dereference in loongson3_platform_init()

Ard Biesheuvel <[email protected]>
efi/x86: Map the entire EFI vendor string before copying it

Hans de Goede <[email protected]>
pinctrl: baytrail: Do not clear IRQ flags on direct-irq enabled pins

Jia-Ju Bai <[email protected]>
media: sti: bdisp: fix a possible sleep-in-atomic-context bug in bdisp_device_run()

Jia-Ju Bai <[email protected]>
gpio: gpio-grgpio: fix possible sleep-in-atomic-context bugs in grgpio_irq_map/unmap()

Oliver O'Halloran <[email protected]>
powerpc/powernv/iov: Ensure the pdn for VFs always contains a valid PE number

Eugen Hristev <[email protected]>
media: i2c: mt9v032: fix enum mbus codes and frame sizes

Christophe JAILLET <[email protected]>
pxa168fb: Fix the function used to release some memory in an error handling path

Geert Uytterhoeven <[email protected]>
pinctrl: sh-pfc: sh7264: Fix CAN function GPIOs

Vladimir Oltean <[email protected]>
gianfar: Fix TX timestamping with a stacked DSA driver

Dan Carpenter <[email protected]>
brcmfmac: Fix use after free in brcmf_sdio_readframes()

Peter Zijlstra <[email protected]>
cpu/hotplug, stop_machine: Fix stop_machine vs hotplug order

Paul Kocialkowski <[email protected]>
drm/gma500: Fixup fbdev stolen size usage evaluation

Sasha Levin <[email protected]>
Revert "KVM: VMX: Add non-canonical check on writes to RTIT address MSRs"

Allen Pais <[email protected]>
scsi: qla2xxx: fix a potential NULL pointer dereference

David Sterba <[email protected]>
btrfs: print message when tree-log replay starts

zhangyi (F) <[email protected]>
jbd2: do not clear the BH_Mapped flag when forgetting a metadata buffer

zhangyi (F) <[email protected]>
jbd2: move the clearing of b_modified flag to the journal_unmap_buffer()

Mike Jones <[email protected]>
hwmon: (pmbus/ltc2978) Fix PMBus polling of MFR_COMMON definitions.

Kan Liang <[email protected]>
perf/x86/intel: Fix inaccurate period in context switch for auto-reload

Nathan Chancellor <[email protected]>
s390/time: Fix clk type in get_tod_clock

Herbert Xu <[email protected]>
padata: Remove broken queue flushing

Kim Phillips <[email protected]>
perf/x86/amd: Add missing L2 misses event spec to AMD Family 17h's event map

David Sterba <[email protected]>
btrfs: log message when rw remount is attempted with unclean tree-log

Filipe Manana <[email protected]>
Btrfs: fix race between using extent maps and merging them

Theodore Ts'o <[email protected]>
ext4: improve explanation of a mount failure caused by a misconfigured kernel

Jan Kara <[email protected]>
ext4: fix checksum errors with indexed dirs

Andreas Dilger <[email protected]>
ext4: don't assume that mmp_nodename/bdevname have NUL

Arvind Sankar <[email protected]>
ALSA: usb-audio: Apply sample rate quirk for Audioengine D1

Wenwen Wang <[email protected]>
ecryptfs: fix a memory leak bug in ecryptfs_init_messaging()

Wenwen Wang <[email protected]>
ecryptfs: fix a memory leak bug in parse_tag_1_packet()

Takashi Iwai <[email protected]>
ALSA: hda: Use scnprintf() for printing texts for sysfs/procfs

Paolo Bonzini <[email protected]>
KVM: x86: emulate RDPID

Andy Lutomirski <[email protected]>
x86/vdso: Use RDPID in preference to LSL when available

-------------

Diffstat:

 Makefile                                           |    4 +-
 arch/arm/Kconfig                                   |    2 +-
 arch/arm/boot/dts/r8a7779.dtsi                     |    8 +
 arch/arm64/include/asm/alternative.h               |   32 +-
 arch/microblaze/kernel/cpu/cache.c                 |    3 +-
 arch/mips/loongson64/loongson-3/platform.c         |    3 +
 arch/powerpc/kernel/eeh_driver.c                   |    6 -
 arch/powerpc/kernel/pci_dn.c                       |   15 +-
 arch/powerpc/kernel/process.c                      |    2 +
 arch/powerpc/kernel/signal.c                       |   17 +-
 arch/powerpc/kernel/signal_32.c                    |   30 +-
 arch/powerpc/kernel/signal_64.c                    |   29 +-
 arch/powerpc/platforms/powernv/pci-ioda.c          |   19 +-
 arch/powerpc/platforms/powernv/pci.c               |    4 -
 arch/s390/include/asm/page.h                       |    2 +-
 arch/s390/include/asm/timex.h                      |    2 +-
 arch/s390/kernel/mcount.S                          |   15 +-
 arch/sh/include/cpu-sh2a/cpu/sh7269.h              |   11 +-
 arch/sparc/kernel/vmlinux.lds.S                    |    6 +-
 arch/x86/entry/vdso/vdso32-setup.c                 |    1 +
 arch/x86/events/amd/core.c                         |    1 +
 arch/x86/events/intel/ds.c                         |    2 +
 arch/x86/include/asm/cpufeatures.h                 |    1 +
 arch/x86/include/asm/vgtod.h                       |    7 +-
 arch/x86/kernel/cpu/mcheck/mce_amd.c               |   50 +-
 arch/x86/kernel/sysfb_simplefb.c                   |    2 +-
 arch/x86/kvm/cpuid.c                               |    7 +-
 arch/x86/kvm/emulate.c                             |   22 +-
 arch/x86/kvm/irq_comm.c                            |    2 +-
 arch/x86/kvm/lapic.c                               |    4 +-
 arch/x86/kvm/vmx.c                                 |  102 +-
 arch/x86/kvm/vmx/vmx.c                             | 8033 --------------------
 arch/x86/lib/x86-opcode-map.txt                    |    2 +-
 arch/x86/platform/efi/efi.c                        |   13 +-
 drivers/acpi/acpica/dsfield.c                      |    2 +-
 drivers/acpi/acpica/dswload.c                      |   21 +
 drivers/ata/ahci.c                                 |    7 +
 drivers/ata/libata-core.c                          |   21 +
 drivers/base/dd.c                                  |    5 +-
 drivers/base/platform.c                            |   12 +-
 drivers/block/brd.c                                |   22 +-
 drivers/block/floppy.c                             |    7 +-
 drivers/clk/qcom/clk-rcg2.c                        |    3 +
 drivers/devfreq/Kconfig                            |    3 +-
 drivers/devfreq/event/Kconfig                      |    2 +-
 drivers/gpio/gpio-grgpio.c                         |   10 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c       |   19 +-
 drivers/gpu/drm/gma500/framebuffer.c               |    8 +-
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c            |    8 +
 drivers/gpu/drm/nouveau/nouveau_fence.c            |    2 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/channv50.c    |    2 +
 drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c     |   21 +-
 drivers/gpu/drm/radeon/radeon_display.c            |    2 +
 drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c         |    4 +-
 drivers/hwmon/pmbus/ltc2978.c                      |    4 +-
 drivers/ide/cmd64x.c                               |    3 +
 drivers/ide/serverworks.c                          |    6 +
 drivers/infiniband/sw/rxe/rxe_verbs.h              |    2 +-
 drivers/infiniband/ulp/isert/ib_isert.c            |   12 +
 drivers/input/touchscreen/edt-ft5x06.c             |    7 +
 drivers/iommu/arm-smmu-v3.c                        |    3 +-
 drivers/irqchip/irq-gic-v3-its.c                   |    2 +-
 drivers/irqchip/irq-gic-v3.c                       |    9 +-
 drivers/md/bcache/bset.h                           |    3 +-
 drivers/media/i2c/mt9v032.c                        |   10 +-
 drivers/media/platform/sti/bdisp/bdisp-hw.c        |    6 +-
 drivers/net/ethernet/cisco/enic/enic_main.c        |    2 +-
 drivers/net/ethernet/freescale/gianfar.c           |   10 +-
 drivers/net/wan/fsl_ucc_hdlc.c                     |    5 +
 drivers/net/wan/ixp4xx_hss.c                       |    4 +-
 drivers/net/wireless/broadcom/b43legacy/main.c     |    5 +-
 .../wireless/broadcom/brcm80211/brcmfmac/sdio.c    |    1 +
 drivers/net/wireless/intel/ipw2x00/ipw2100.c       |    7 +-
 drivers/net/wireless/intel/ipw2x00/ipw2200.c       |    5 +-
 drivers/net/wireless/intel/iwlegacy/3945-mac.c     |    5 +-
 drivers/net/wireless/intel/iwlegacy/4965-mac.c     |    5 +-
 drivers/net/wireless/intel/iwlegacy/common.c       |    2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c        |    4 +-
 drivers/net/wireless/intersil/hostap/hostap_ap.c   |    2 +-
 .../net/wireless/intersil/orinoco/orinoco_usb.c    |    3 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c         |   10 +-
 drivers/nfc/port100.c                              |    2 +-
 drivers/pci/iov.c                                  |    1 +
 drivers/pinctrl/intel/pinctrl-baytrail.c           |    8 +-
 drivers/pinctrl/sh-pfc/pfc-sh7264.c                |    9 +-
 drivers/pinctrl/sh-pfc/pfc-sh7269.c                |   39 +-
 drivers/pwm/pwm-omap-dmtimer.c                     |    7 +-
 drivers/regulator/rk808-regulator.c                |    2 +-
 drivers/remoteproc/remoteproc_core.c               |    2 +-
 drivers/scsi/aic7xxx/aic7xxx_core.c                |    2 +-
 drivers/scsi/iscsi_tcp.c                           |    4 +
 drivers/scsi/qla2xxx/qla_os.c                      |   19 +-
 drivers/scsi/scsi_transport_iscsi.c                |   26 +-
 drivers/soc/tegra/fuse/tegra-apbmisc.c             |    2 +-
 drivers/staging/android/ashmem.c                   |   28 +
 drivers/staging/greybus/audio_manager.c            |    2 +-
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c     |    4 +-
 drivers/staging/vt6656/dpc.c                       |    2 +-
 drivers/target/iscsi/iscsi_target.c                |   16 +-
 drivers/tty/serial/atmel_serial.c                  |    3 +-
 drivers/tty/serial/imx.c                           |    2 +-
 drivers/tty/synclink_gt.c                          |   18 +-
 drivers/tty/synclinkmp.c                           |   24 +-
 drivers/tty/vt/selection.c                         |    7 +-
 drivers/tty/vt/vt_ioctl.c                          |   75 +-
 drivers/uio/uio_dmem_genirq.c                      |    6 +-
 drivers/usb/core/hub.c                             |    5 -
 drivers/usb/core/quirks.c                          |    3 +
 drivers/usb/gadget/composite.c                     |    8 +-
 drivers/usb/gadget/udc/gr_udc.c                    |   16 +-
 drivers/usb/host/xhci-mem.c                        |   12 +-
 drivers/usb/host/xhci-pci.c                        |    4 +-
 drivers/usb/musb/omap2430.c                        |    2 -
 drivers/usb/storage/uas.c                          |   23 +-
 drivers/video/fbdev/pxa168fb.c                     |    6 +-
 drivers/vme/bridges/vme_fake.c                     |   30 +-
 drivers/xen/preempt.c                              |    4 +-
 fs/btrfs/disk-io.c                                 |    1 +
 fs/btrfs/extent_map.c                              |   11 +
 fs/btrfs/ordered-data.c                            |    7 +-
 fs/btrfs/super.c                                   |    2 +
 fs/cifs/connect.c                                  |    6 +-
 fs/ecryptfs/crypto.c                               |    6 +-
 fs/ecryptfs/keystore.c                             |    2 +-
 fs/ecryptfs/messaging.c                            |    1 +
 fs/ext4/dir.c                                      |   14 +-
 fs/ext4/ext4.h                                     |   14 +-
 fs/ext4/inode.c                                    |   24 +-
 fs/ext4/migrate.c                                  |   27 +-
 fs/ext4/mmp.c                                      |   12 +-
 fs/ext4/namei.c                                    |    8 +
 fs/ext4/super.c                                    |   20 +-
 fs/jbd2/checkpoint.c                               |    2 +-
 fs/jbd2/commit.c                                   |   50 +-
 fs/jbd2/journal.c                                  |   21 +-
 fs/jbd2/transaction.c                              |   10 +-
 fs/ocfs2/journal.h                                 |    8 +-
 fs/orangefs/orangefs-debugfs.c                     |    1 +
 fs/reiserfs/stree.c                                |    3 +-
 fs/reiserfs/super.c                                |    2 +-
 fs/udf/super.c                                     |   22 +-
 include/linux/libata.h                             |    1 +
 include/linux/list_nulls.h                         |    8 +-
 include/linux/rculist_nulls.h                      |    8 +-
 include/media/v4l2-device.h                        |   12 +-
 include/scsi/iscsi_proto.h                         |    1 -
 include/sound/rawmidi.h                            |    6 +-
 ipc/sem.c                                          |    6 +-
 kernel/cpu.c                                       |   13 +-
 kernel/padata.c                                    |   45 +-
 kernel/trace/ftrace.c                              |    5 +-
 kernel/trace/trace_events_trigger.c                |    5 +-
 kernel/trace/trace_stat.c                          |   31 +-
 lib/scatterlist.c                                  |    2 +-
 lib/stackdepot.c                                   |   12 +-
 net/netfilter/xt_bpf.c                             |    3 +
 net/netfilter/xt_hashlimit.c                       |   10 +
 net/sched/cls_flower.c                             |    1 +
 net/sched/cls_matchall.c                           |    1 +
 scripts/kconfig/confdata.c                         |    2 +-
 security/selinux/avc.c                             |    2 +-
 sound/core/seq/seq_clientmgr.c                     |    4 +-
 sound/core/seq/seq_queue.c                         |   29 +-
 sound/core/seq/seq_timer.c                         |   13 +-
 sound/core/seq/seq_timer.h                         |    3 +-
 sound/hda/hdmi_chmap.c                             |    2 +-
 sound/pci/hda/hda_codec.c                          |    2 +-
 sound/pci/hda/hda_eld.c                            |    2 +-
 sound/pci/hda/hda_sysfs.c                          |    4 +-
 sound/pci/hda/patch_conexant.c                     |    1 +
 sound/sh/aica.c                                    |    4 +-
 sound/soc/atmel/Kconfig                            |    2 +
 sound/usb/quirks.c                                 |    1 +
 sound/usb/usx2y/usX2Yhwdep.c                       |    2 +-
 tools/lib/api/fs/fs.c                              |    4 +-
 tools/objtool/arch/x86/lib/x86-opcode-map.txt      |    2 +-
 tools/usb/usbip/src/usbip_network.c                |   40 +-
 tools/usb/usbip/src/usbip_network.h                |   12 +-
 178 files changed, 1158 insertions(+), 8617 deletions(-)
#166 lore raw
Quoted 8 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 4.9.215 release. There are 165 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Sat, 29 Feb 2020 13:21:24 +0000. Anything received after that time might be too late.

Building powerpc:defconfig ... failed
--------------
Error log:
In file included from include/linux/bug.h:4:0,

                 from include/linux/thread_info.h:11,
                 from include/asm-generic/preempt.h:4,
                 from ./arch/powerpc/include/generated/asm/preempt.h:1,
                 from include/linux/preempt.h:59,
                 from include/linux/spinlock.h:50,
                 from include/linux/seqlock.h:35,
                 from include/linux/time.h:5,
                 from include/uapi/linux/timex.h:56,
                 from include/linux/timex.h:56,
                 from include/linux/sched.h:19,
                 from arch/powerpc/kernel/signal_32.c:20:

arch/powerpc/kernel/signal_32.c: In function ‘save_tm_user_regs’:
arch/powerpc/kernel/signal_32.c:521:10: error: ‘tm_suspend_disabled’ undeclared

Also affects v4.14.y.

Guenter

maintainer
#168 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 4.9.215 release. There are 165 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Sat, 29 Feb 2020 13:21:24 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.215-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.

thanks,

greg k-h

All tests are passing for Tegra ...

Test results for stable-v4.9:

    8 builds:	8 pass, 0 fail
    16 boots:	16 pass, 0 fail
    24 tests:	24 pass, 0 fail

Linux version: 4.9.215-rc1-gb8e4943d6bee
Boards tested: tegra124-jetson-tk1, tegra20-ventana,

                tegra210-p2371-2180, tegra30-cardhu-a04

Cheers
Jon

Signature · 1 line
nvpublic
#169 lore raw
In reply to Greg Kroah-Hartman
Quoted 8 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 4.9.215 release. There are 165 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Sat, 29 Feb 2020 13:21:24 +0000. Anything received after that time might be too late.

Build results:

	total: 172 pass: 170 fail: 2

Failed builds:
powerpc:defconfig
powerpc:allmodconfig
Qemu test results:

	total: 375 pass: 361 fail: 14
Failed tests:
	ppc64:mac99:ppc64_book3s_defconfig:smp:nvme:rootfs
	ppc64:pseries:pseries_defconfig:initrd
	ppc64:pseries:pseries_defconfig:scsi:rootfs
	ppc64:pseries:pseries_defconfig:usb:rootfs
	ppc64:pseries:pseries_defconfig:sdhci:mmc:rootfs
	ppc64:pseries:pseries_defconfig:nvme:rootfs
	ppc64:pseries:pseries_defconfig:little:initrd
	ppc64:pseries:pseries_defconfig:little:scsi:rootfs
	ppc64:pseries:pseries_defconfig:little:usb:rootfs
	ppc64:pseries:pseries_defconfig:little:scsi[MEGASAS]:rootfs
	ppc64:pseries:pseries_defconfig:little:scsi[FUSION]:rootfs
	ppc64:pseries:pseries_defconfig:little:sdhci:mmc:rootfs
	ppc64:pseries:pseries_defconfig:little:nvme:rootfs
	ppc64:powernv:powernv_defconfig:initrd

Failures as already reported.

Guenter

#170 lore raw
In reply to Greg Kroah-Hartman
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 4.9.215 release. There are 165 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Sat, 29 Feb 2020 13:21:24 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
        https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.215-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.

thanks,

greg k-h

Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.

Summary
------------------------------------------------------------------------

kernel: 4.9.215-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.9.y
git commit: b8e4943d6bee55c8a2c077fc7639d0b8e8127e1a
git describe: v4.9.214-166-gb8e4943d6bee
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.9-oe/build/v4.9.214-166-gb8e4943d6bee

No regressions (compared to build v4.9.214)

No fixes (compared to build v4.9.214)

Ran 26738 total tests in the following environments and test suites.

Environments
--------------
- dragonboard-410c - arm64
- hi6220-hikey - arm64
- i386
- juno-r2 - arm64
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15 - arm
- x86_64

Test Suites
-----------
* build
* install-android-platform-tools-r2600
* kselftest
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-cpuhotplug-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* perf
* v4l2-compliance
* ltp-cve-tests
* network-basic-tests
* spectre-meltdown-checker-test
* ltp-open-posix-tests
* kvm-unit-tests
* ltp-cap_bounds-64k-page_size-tests
* ltp-cap_bounds-kasan-tests
* ltp-commands-64k-page_size-tests
* ltp-commands-kasan-tests
* ltp-containers-64k-page_size-tests
* ltp-containers-kasan-tests
* ltp-cpuhotplug-64k-page_size-tests
* ltp-cpuhotplug-kasan-tests
* ltp-crypto-64k-page_size-tests
* ltp-crypto-kasan-tests
* ltp-crypto-tests
* ltp-cve-64k-page_size-tests
* ltp-cve-kasan-tests
* ltp-dio-64k-page_size-tests
* ltp-dio-kasan-tests
* ltp-fcntl-locktests-64k-page_size-tests
* ltp-fcntl-locktests-kasan-tests
* ltp-filecaps-64k-page_size-tests
* ltp-filecaps-kasan-tests
* ltp-fs-64k-page_size-tests
* ltp-fs-kasan-tests
* ltp-fs_bind-64k-page_size-tests
* ltp-fs_bind-kasan-tests
* ltp-fs_perms_simple-64k-page_size-tests
* ltp-fs_perms_simple-kasan-tests
* ltp-fsx-64k-page_size-tests
* ltp-fsx-kasan-tests
* ltp-hugetlb-64k-page_size-tests
* ltp-hugetlb-kasan-tests
* ltp-io-64k-page_size-tests
* ltp-io-kasan-tests
* ltp-ipc-64k-page_size-tests
* ltp-ipc-kasan-tests
* ltp-math-64k-page_size-tests
* ltp-math-kasan-tests
* ltp-mm-64k-page_size-tests
* ltp-mm-kasan-tests
* ltp-nptl-64k-page_size-tests
* ltp-nptl-kasan-tests
* ltp-pty-64k-page_size-tests
* ltp-pty-kasan-tests
* ltp-sched-64k-page_size-tests
* ltp-sched-kasan-tests
* ltp-securebits-64k-page_size-tests
* ltp-securebits-kasan-tests
* ltp-syscalls-64k-page_size-tests
* ltp-syscalls-compat-tests
* ltp-syscalls-kasan-tests
* prep-tmp-disk
* ssuite

Signature · 2 lines
Linaro LKFT
https://lkft.linaro.org
#171 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 4.9.215 release. There are 165 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Sat, 29 Feb 2020 13:21:24 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
	https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.215-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.

thanks,

greg k-h

Compiled and booted on my test system. No dmesg regressions.

thanks,
-- Shuah

author maintainer
#167 lore raw
In reply to Guenter Roeck
Quoted 25 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 4.9.215 release. There are 165 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Sat, 29 Feb 2020 13:21:24 +0000. Anything received after that time might be too late.

Building powerpc:defconfig ... failed
--------------
Error log:
In file included from include/linux/bug.h:4:0,

                 from include/linux/thread_info.h:11,
                 from include/asm-generic/preempt.h:4,
                 from ./arch/powerpc/include/generated/asm/preempt.h:1,
                 from include/linux/preempt.h:59,
                 from include/linux/spinlock.h:50,
                 from include/linux/seqlock.h:35,
                 from include/linux/time.h:5,
                 from include/uapi/linux/timex.h:56,
                 from include/linux/timex.h:56,
                 from include/linux/sched.h:19,
                 from arch/powerpc/kernel/signal_32.c:20:
Quoted 4 lines

arch/powerpc/kernel/signal_32.c: In function ‘save_tm_user_regs’:
arch/powerpc/kernel/signal_32.c:521:10: error: ‘tm_suspend_disabled’ undeclared

Also affects v4.14.y.

Thanks for letting me know, I've now dropped 3 powerpc patches from 4.14 and 4.9 and will push out a -rc2 for those trees in a few minutes.

greg k-h

author maintainer
#172 lore raw
In reply to Greg Kroah-Hartman
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 4.9.215 release. There are 165 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Sat, 29 Feb 2020 13:21:24 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

	https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.215-rc1.gz

-rc2 is out to hopefully resolve the powerpc build issues that were found:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.215-rc2.gz

#173 lore raw
Quoted 9 lines · Greg Kroah-Hartman
Quoted 8 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 4.9.215 release. There are 165 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Sat, 29 Feb 2020 13:21:24 +0000. Anything received after that time might be too late.

Quoted 7 lines
Quoted 2 lines

The whole patch series can be found in one patch at:

	https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.215-rc1.gz

-rc2 is out to hopefully resolve the powerpc build issues that were found:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.215-rc2.gz

For v4.9.214-163-g176b68c72aeb:

Build results:

	total: 172 pass: 172 fail: 0
Qemu test results:
	total: 375 pass: 375 fail: 0

Guenter