4.10.3-stable review
Subsystems (4)
Greg Kroah-Hartman
maintainercover 4.10.3-stable review
This is the start of the stable review cycle for the 4.10.3 release. There are 75 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 Wed Mar 15 08:33:49 UTC 2017. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.10.3-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.10.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.10.3-rc1
K. Y. Srinivasan <[email protected]>
drivers: hv: Turn off write permission on the hypercall page
OGAWA Hirofumi <[email protected]>
fat: fix using uninitialized fields of fat_inode/fsinfo_inode
Dmitry Vyukov <[email protected]>
kasan: resched in quarantine_remove_cache()
Tahsin Erdogan <[email protected]>
mm: do not call mem_cgroup_free() from within mem_cgroup_alloc()
Kirill A. Shutemov <[email protected]>
thp: fix another corner case of munlock() vs. THPs
Daniel Borkmann <[email protected]>
x86/tlb: Fix tlb flushing when lguest clears PGE
Dan Williams <[email protected]>
x86, mm: fix gup_pte_range() vs DAX mappings
Arnd Bergmann <[email protected]>
libceph: use BUG() instead of BUG_ON(1)
Hans de Goede <[email protected]>
drm/i915: Fix not finding the VBT when it overlaps with OPREGION_ASLE_EXT
Chris Wilson <[email protected]>
drm/i915: Pass timeout==0 on to i915_gem_object_wait_fence()
Chris Wilson <[email protected]>
drm/i915: Check for timeout completion when waiting for the rq to submitted
Ville Syrjälä <[email protected]>
drm/i915: Avoid spurious WARNs about the wrong pipe in the PPS code
Chris Wilson <[email protected]>
drm/i915: Recreate internal objects with single page segments if dmar fails
Chris Wilson <[email protected]>
drm: Cancel drm_fb_helper_resume_work on unload
Chris Wilson <[email protected]>
drm: Cancel drm_fb_helper_dirty_work on unload
Chris Wilson <[email protected]>
drm/i915/gvt: Disable access to stolen memory as a guest
Dan Carpenter <[email protected]>
drm/atomic: fix an error code in mode_fixup()
Fabio Estevam <[email protected]>
drm/imx: imx-tve: Do not set the regulator voltage
Thomas Hellstrom <[email protected]>
drm/vmwgfx: Work around drm removal of control nodes
Michel Dänzer <[email protected]>
drm/ttm: Make sure BOs being swapped out are cacheable
Tomeu Vizoso <[email protected]>
drm/edid: Add EDID_QUIRK_FORCE_8BPC quirk for Rotel RSX-1058
Alex Deucher <[email protected]>
drm/radeon: handle vfct with multiple vbios images
Y.C. Chen <[email protected]>
drm/ast: Fix AST2400 POST failure without BMC FW or VBIOS
Y.C. Chen <[email protected]>
drm/ast: Call open_key before enable_mmio in POST code
Y.C. Chen <[email protected]>
drm/ast: Fix test for VGA enabled
Russell Currey <[email protected]>
drm/ast: Handle configuration without P2A bridge
Jean Delvare <[email protected]>
Revert "drm/amdgpu: update tile table for oland/hainan"
Alex Deucher <[email protected]>
drm/amdgpu/pm: check for headless before calling compute_clocks
Alex Deucher <[email protected]>
drm/amdgpu: add more cases to DCE11 possible crtc mask setup
Johannes Berg <[email protected]>
mac80211: use driver-indicated transmitter STA only for data frames
Felix Fietkau <[email protected]>
mac80211: don't handle filtered frames within a BA session
Sara Sharon <[email protected]>
mac80211: don't reorder frames with SN smaller than SSN
Matt Chen <[email protected]>
mac80211: flush delayed work when entering suspend
Dan Williams <[email protected]>
nfit, libnvdimm: fix interleave set cookie calculation
Max Filippov <[email protected]>
xtensa: move parse_tag_fdt out of #ifdef CONFIG_BLK_DEV_INITRD
Clemens Gruber <[email protected]>
pwm: pca9685: Fix period change with same duty cycle
Trond Myklebust <[email protected]>
nlm: Ensure callback code also checks that the files match
Gavin Shan <[email protected]>
drivers/pci/hotplug: Fix initial state for empty slot
Gavin Shan <[email protected]>
drivers/pci/hotplug: Handle presence detection change properly
Nicholas Bellinger <[email protected]>
target: Fix NULL dereference during LUN lookup + active I/O shutdown
Gavin Shan <[email protected]>
pci/hotplug/pnv-php: Disable surprise hotplug capability on conflicts
Gavin Shan <[email protected]>
pci/hotplug/pnv-php: Remove WARN_ON() in pnv_php_put_slot()
Jeff Layton <[email protected]>
ceph: remove req from unsafe list when unregistering it
Steven Rostedt (VMware) <[email protected]>
ktest: Fix child exit code processing
Wei Yongjun <[email protected]>
tracing: Fix return value check in trace_benchmark_reg()
Boris Brezillon <[email protected]>
memory/atmel-ebi: Fix ns <-> cycles conversions
Peter Zijlstra <[email protected]>
orangefs: Use RCU for destroy_inode
Filipe Manana <[email protected]>
Btrfs: fix data loss after truncate when using the no-holes feature
Eric W. Biederman <[email protected]>
fs: Better permission checking for submounts
Bart Van Assche <[email protected]>
IB/srp: Fix race conditions related to task management
Bart Van Assche <[email protected]>
IB/srp: Avoid that duplicate responses trigger a kernel bug
Bart Van Assche <[email protected]>
IB/SRP: Avoid using IB_MR_TYPE_SG_GAPS
Leon Romanovsky <[email protected]>
IB/mlx5: Fix out-of-bound access
Erez Shitrit <[email protected]>
IB/IPoIB: Add destination address when re-queue packet
Feras Daoud <[email protected]>
IB/ipoib: Fix deadlock between rmmod and set_mode
Eric W. Biederman <[email protected]>
mnt: Tuck mounts under others instead of creating shadow/side mounts.
Gavin Li <[email protected]>
brcmfmac: fix incorrect event channel deduction
Andrew Donnellan <[email protected]>
cxl: fix nested locking hang during EEH hotplug
Andrew Donnellan <[email protected]>
cxl: Prevent read/write to AFU config space while AFU not configured
Thomas Petazzoni <[email protected]>
net: mvpp2: fix DMA address calculation in mvpp2_txq_inc_put()
Heiko Carstens <[email protected]>
s390: use correct input data address for setup_randomness
Heiko Carstens <[email protected]>
s390: make setup_randomness work
Martin Schwidefsky <[email protected]>
s390/topology: correct allocation of topology information
Martin Schwidefsky <[email protected]>
s390: TASK_SIZE for kernel threads
Peter Oberparleiter <[email protected]>
s390/chsc: Add exception handler for CHSC instruction
Michael Holzheu <[email protected]>
s390/kdump: Use "LINUX" ELF note name instead of "CORE"
Gerald Schaefer <[email protected]>
s390/dcssblk: fix device size calculation in dcssblk_direct_access()
Julian Wiedmann <[email protected]>
s390/qdio: clear DSCI prior to scanning multiple input queues
Vivek Gautam <[email protected]>
phy: qcom-ufs: Fix misplaced jump label
Bjorn Andersson <[email protected]>
phy: qcom-ufs: Don't kfree devres resource
Dmitry Tunin <[email protected]>
Bluetooth: Add another AR3012 04ca:3018 device
Chao Peng <[email protected]>
KVM: VMX: use correct vmcs_read/write for guest segment selector/base
Janosch Frank <[email protected]>
KVM: s390: Disable dirty log retrieval for UCONTROL guests
Ian Abbott <[email protected]>
serial: 8250_pci: Add MKS Tenta SCOM-0800 and SCOM-0801 cards
Alexander Popov <[email protected]>
tty: n_hdlc: get rid of racy n_hdlc.tbuf
-------------
Diffstat:
Makefile | 4 +- arch/s390/include/asm/processor.h | 3 +- arch/s390/kernel/crash_dump.c | 6 +- arch/s390/kernel/setup.c | 8 +- arch/s390/kernel/topology.c | 2 +- arch/s390/kvm/kvm-s390.c | 3 + arch/x86/include/asm/tlbflush.h | 2 +- arch/x86/kvm/vmx.c | 4 +- arch/x86/mm/gup.c | 8 +- arch/xtensa/kernel/setup.c | 4 +- drivers/acpi/nfit/core.c | 16 +- drivers/bluetooth/ath3k.c | 2 + drivers/bluetooth/btusb.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 6 + drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 330 +++++++++------------ drivers/gpu/drm/ast/ast_drv.h | 6 +- drivers/gpu/drm/ast/ast_main.c | 264 ++++++++++------- drivers/gpu/drm/ast/ast_post.c | 55 +++- drivers/gpu/drm/drm_atomic_helper.c | 2 +- drivers/gpu/drm/drm_edid.c | 3 + drivers/gpu/drm/drm_fb_helper.c | 3 + drivers/gpu/drm/i915/i915_gem.c | 4 +- drivers/gpu/drm/i915/i915_gem_internal.c | 37 ++- drivers/gpu/drm/i915/i915_gem_request.c | 7 +- drivers/gpu/drm/i915/i915_gem_stolen.c | 5 + drivers/gpu/drm/i915/intel_dp.c | 6 +- drivers/gpu/drm/i915/intel_opregion.c | 13 +- drivers/gpu/drm/imx/imx-tve.c | 7 +- drivers/gpu/drm/radeon/radeon_bios.c | 66 +++-- drivers/gpu/drm/ttm/ttm_bo.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 11 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 4 +- drivers/hv/hv.c | 2 +- drivers/infiniband/hw/mlx5/srq.c | 11 +- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 12 +- drivers/infiniband/ulp/ipoib/ipoib_main.c | 36 +-- drivers/infiniband/ulp/srp/ib_srp.c | 61 ++-- drivers/infiniband/ulp/srp/ib_srp.h | 1 + drivers/memory/atmel-ebi.c | 27 +- drivers/misc/cxl/cxl.h | 3 + drivers/misc/cxl/main.c | 2 +- drivers/misc/cxl/pci.c | 9 + drivers/misc/cxl/vphb.c | 61 ++-- drivers/net/ethernet/marvell/mvpp2.c | 2 +- .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +- drivers/nvdimm/namespace_devs.c | 18 +- drivers/nvdimm/nd.h | 1 + drivers/nvdimm/region_devs.c | 9 + drivers/pci/hotplug/pnv_php.c | 32 +- drivers/phy/phy-qcom-ufs.c | 11 +- drivers/pwm/pwm-pca9685.c | 11 - drivers/s390/block/dcssblk.c | 2 +- drivers/s390/cio/ioasm.c | 8 +- drivers/s390/cio/qdio_thinint.c | 8 +- drivers/target/target_core_device.c | 10 +- drivers/target/target_core_tpg.c | 3 +- drivers/target/target_core_transport.c | 31 +- drivers/tty/n_hdlc.c | 132 +++++---- drivers/tty/serial/8250/8250_pci.c | 13 + fs/afs/mntpt.c | 2 +- fs/autofs4/waitq.c | 4 +- fs/btrfs/inode.c | 19 +- fs/ceph/mds_client.c | 5 +- fs/cifs/cifs_dfs_ref.c | 7 +- fs/debugfs/inode.c | 8 +- fs/fat/inode.c | 13 +- fs/mount.h | 1 - fs/namei.c | 3 - fs/namespace.c | 127 ++++---- fs/nfs/namespace.c | 2 +- fs/nfs/nfs4namespace.c | 2 +- fs/orangefs/super.c | 9 +- fs/pnode.c | 61 +++- fs/pnode.h | 2 + fs/super.c | 13 +- include/linux/ceph/osdmap.h | 2 +- include/linux/debugfs.h | 3 +- include/linux/libnvdimm.h | 2 + include/linux/lockd/lockd.h | 3 +- include/linux/mount.h | 3 + include/target/target_core_base.h | 1 + include/uapi/linux/fs.h | 1 + kernel/trace/trace.c | 4 +- kernel/trace/trace_benchmark.c | 4 +- mm/kasan/quarantine.c | 9 +- mm/memcontrol.c | 11 +- mm/mlock.c | 9 +- net/mac80211/agg-rx.c | 1 + net/mac80211/pm.c | 1 + net/mac80211/rx.c | 30 +- net/mac80211/sta_info.h | 6 +- net/mac80211/status.c | 3 +- tools/testing/ktest/ktest.pl | 2 +- 94 files changed, 1077 insertions(+), 713 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/75 tty: n_hdlc: get rid of racy n_hdlc.tbuf
4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Popov <[email protected]>
commit 82f2341c94d270421f383641b7cd670e474db56b upstream.
Currently N_HDLC line discipline uses a self-made singly linked list for data buffers and has n_hdlc.tbuf pointer for buffer retransmitting after an error.
The commit be10eb7589337e5defbe214dae038a53dd21add8
("tty: n_hdlc add buffer flushing") introduced racy access to n_hdlc.tbuf. After tx error concurrent flush_tx_queue() and n_hdlc_send_frames() can put one data buffer to tx_free_buf_list twice. That causes double free in n_hdlc_release().
Let's use standard kernel linked list and get rid of n_hdlc.tbuf:
in case of tx error put current data buffer after the head of tx_buf_list.
--- drivers/tty/n_hdlc.c | 132 ++++++++++++++++++++++++++------------------------- 1 file changed, 69 insertions(+), 63 deletions(-)
drivers/tty/n_hdlc.c +69 -63
@@ -114,7 +114,7 @@#define DEFAULT_TX_BUF_COUNT 3struct n_hdlc_buf { -struct n_hdlc_buf *link; +struct list_head list_item;int count;char buf[1 ]; };
@@ -122,8 +122,7 @@ struct n_hdlc_buf {#define N_HDLC_BUF_SIZE (sizeof(struct n_hdlc_buf) + maxframe)struct n_hdlc_buf_list { -struct n_hdlc_buf *head; -struct n_hdlc_buf *tail; +struct list_head list;int count;spinlock_t spinlock; };
@@ -136,7 +135,6 @@ struct n_hdlc_buf_list {* @backup_tty - TTY to use if tty gets closed * @tbusy - reentrancy flag for tx wakeup code * @woke_up - FIXME: describe this field -* @tbuf - currently transmitting tx buffer * @tx_buf_list - list of pending transmit frame buffers * @rx_buf_list - list of received frame buffers * @tx_free_buf_list - list unused transmit frame buffers
@@ -149,7 +147,6 @@ struct n_hdlc {struct tty_struct *backup_tty;int tbusy;int woke_up; -struct n_hdlc_buf *tbuf;struct n_hdlc_buf_list tx_buf_list;struct n_hdlc_buf_list rx_buf_list;struct n_hdlc_buf_list tx_free_buf_list;
@@ -159,6 +156,8 @@ struct n_hdlc {/* * HDLC buffer list manipulation functions */ +static void n_hdlc_buf_return (struct n_hdlc_buf_list *buf_list, +struct n_hdlc_buf *buf);static void n_hdlc_buf_put (struct n_hdlc_buf_list *list,struct n_hdlc_buf *buf);static struct n_hdlc_buf *n_hdlc_buf_get (struct n_hdlc_buf_list *list);
@@ -208,16 +207,9 @@ static void flush_tx_queue(struct tty_st {struct n_hdlc *n_hdlc =tty2n_hdlc (tty);struct n_hdlc_buf *buf; -unsigned long flags;while ((buf =n_hdlc_buf_get (&n_hdlc->tx_buf_list)))n_hdlc_buf_put (&n_hdlc->tx_free_buf_list, buf); -spin_lock_irqsave (&n_hdlc->tx_buf_list.spinlock, flags); -if (n_hdlc->tbuf) { -n_hdlc_buf_put (&n_hdlc->tx_free_buf_list, n_hdlc->tbuf); - n_hdlc->tbuf =NULL ; - } -spin_unlock_irqrestore (&n_hdlc->tx_buf_list.spinlock, flags); }static struct tty_ldisc_ops n_hdlc_ldisc = {
@@ -283,7 +275,6 @@ static void n_hdlc_release(struct n_hdlc }else break ; } -kfree (n_hdlc->tbuf);kfree (n_hdlc); }/* end of n_hdlc_release() */
@@ -402,13 +393,7 @@ static void n_hdlc_send_frames(struct n_ n_hdlc->woke_up =0 ;spin_unlock_irqrestore (&n_hdlc->tx_buf_list.spinlock, flags); -/* get current transmit buffer or get new transmit */ -/* buffer from list of pending transmit buffers */ - - tbuf = n_hdlc->tbuf; -if (!tbuf) - tbuf =n_hdlc_buf_get (&n_hdlc->tx_buf_list); - + tbuf =n_hdlc_buf_get (&n_hdlc->tx_buf_list);while (tbuf) {if (debuglevel >=DEBUG_LEVEL_INFO ) printk("%s(%d)sending frame %p, count=%d\n",
@@ -420,7 +405,7 @@ static void n_hdlc_send_frames(struct n_/* rollback was possible and has been done */ if (actual == -ERESTARTSYS ) { - n_hdlc->tbuf = tbuf; +n_hdlc_buf_return (&n_hdlc->tx_buf_list, tbuf);break ; }/* if transmit error, throw frame away by */
@@ -435,10 +420,7 @@ static void n_hdlc_send_frames(struct n_/* free current transmit buffer */ n_hdlc_buf_put (&n_hdlc->tx_free_buf_list, tbuf); - -/* this tx buffer is done */ - n_hdlc->tbuf =NULL ; - +/* wait up sleeping writers */ wake_up_interruptible (&tty->write_wait);
@@ -448,10 +430,12 @@ static void n_hdlc_send_frames(struct n_if (debuglevel >=DEBUG_LEVEL_INFO )printk ("%s(%d)frame %p pending\n" , __FILE__,__LINE__,tbuf); - -/* buffer not accepted by driver */ -/* set this buffer as pending buffer */ - n_hdlc->tbuf = tbuf; + +/* +* the buffer was not accepted by driver, +* return it back into tx queue +*/ +n_hdlc_buf_return (&n_hdlc->tx_buf_list, tbuf);break ; } }
@@ -749,7 +733,8 @@ static int n_hdlc_tty_ioctl(struct tty_sint error =0 ;int count;unsigned long flags; - +struct n_hdlc_buf *buf =NULL ; +if (debuglevel >=DEBUG_LEVEL_INFO )printk ("%s(%d)n_hdlc_tty_ioctl() called %d\n" , __FILE__,__LINE__,cmd);
@@ -763,8 +748,10 @@ static int n_hdlc_tty_ioctl(struct tty_s/* report count of read data available */ /* in next available frame (if any) */ spin_lock_irqsave (&n_hdlc->rx_buf_list.spinlock,flags); -if (n_hdlc->rx_buf_list.head) - count = n_hdlc->rx_buf_list.head->count; + buf =list_first_entry_or_null (&n_hdlc->rx_buf_list.list, + struct n_hdlc_buf, list_item); +if (buf) + count = buf->count;else count =0 ;spin_unlock_irqrestore (&n_hdlc->rx_buf_list.spinlock,flags);
@@ -776,8 +763,10 @@ static int n_hdlc_tty_ioctl(struct tty_s count =tty_chars_in_buffer (tty);/* add size of next output frame in queue */ spin_lock_irqsave (&n_hdlc->tx_buf_list.spinlock,flags); -if (n_hdlc->tx_buf_list.head) - count += n_hdlc->tx_buf_list.head->count; + buf =list_first_entry_or_null (&n_hdlc->tx_buf_list.list, + struct n_hdlc_buf, list_item); +if (buf) + count += buf->count;spin_unlock_irqrestore (&n_hdlc->tx_buf_list.spinlock,flags); error =put_user (count, (int __user *)arg);break ;
@@ -825,14 +814,14 @@ static unsigned int n_hdlc_tty_poll(strupoll_wait (filp, &tty->write_wait, wait);/* set bits for operations that won't block */ -if (n_hdlc->rx_buf_list.head) +if (!list_empty (&n_hdlc->rx_buf_list.list)) mask |=POLLIN |POLLRDNORM ;/* readable */ if (test_bit (TTY_OTHER_CLOSED , &tty->flags)) mask |=POLLHUP ;if (tty_hung_up_p (filp)) mask |=POLLHUP ;if (!tty_is_writelocked (tty) && - n_hdlc->tx_free_buf_list.head) + !list_empty (&n_hdlc->tx_free_buf_list.list)) mask |=POLLOUT |POLLWRNORM ;/* writable */ }return mask;
@@ -856,7 +845,12 @@ static struct n_hdlc *n_hdlc_alloc(void)spin_lock_init (&n_hdlc->tx_free_buf_list.spinlock);spin_lock_init (&n_hdlc->rx_buf_list.spinlock);spin_lock_init (&n_hdlc->tx_buf_list.spinlock); - + +INIT_LIST_HEAD (&n_hdlc->rx_free_buf_list.list); +INIT_LIST_HEAD (&n_hdlc->tx_free_buf_list.list); +INIT_LIST_HEAD (&n_hdlc->rx_buf_list.list); +INIT_LIST_HEAD (&n_hdlc->tx_buf_list.list); +/* allocate free rx buffer list */ for (i=0 ;i<DEFAULT_RX_BUF_COUNT ;i++) { buf =kmalloc (N_HDLC_BUF_SIZE ,GFP_KERNEL );
@@ -884,53 +878,65 @@ static struct n_hdlc *n_hdlc_alloc(void) }/* end of n_hdlc_alloc() */ /** +* n_hdlc_buf_return - put the HDLC buffer after the head of the specified list +* @buf_list - pointer to the buffer list +* @buf - pointer to the buffer +*/ +static void n_hdlc_buf_return (struct n_hdlc_buf_list *buf_list, +struct n_hdlc_buf *buf) +{ +unsigned long flags; + +spin_lock_irqsave (&buf_list->spinlock, flags); + +list_add (&buf->list_item, &buf_list->list); + buf_list->count++; + +spin_unlock_irqrestore (&buf_list->spinlock, flags); +} + +/** * n_hdlc_buf_put - add specified HDLC buffer to tail of specified list -* @list - pointer to buffer list +* @buf_list - pointer to buffer list * @buf - pointer to buffer */ -static void n_hdlc_buf_put (struct n_hdlc_buf_list *list, +static void n_hdlc_buf_put (struct n_hdlc_buf_list *buf_list,struct n_hdlc_buf *buf) {unsigned long flags; -spin_lock_irqsave (&list->spinlock,flags); - - buf->link=NULL ; -if (list->tail) - list->tail->link = buf; -else - list->head = buf; - list->tail = buf; - (list->count)++; - -spin_unlock_irqrestore (&list->spinlock,flags); - + +spin_lock_irqsave (&buf_list->spinlock, flags); + +list_add_tail (&buf->list_item, &buf_list->list); + buf_list->count++; + +spin_unlock_irqrestore (&buf_list->spinlock, flags); }/* end of n_hdlc_buf_put() */ /** * n_hdlc_buf_get - remove and return an HDLC buffer from list -* @list - pointer to HDLC buffer list +* @buf_list - pointer to HDLC buffer list * * Remove and return an HDLC buffer from the head of the specified HDLC buffer * list. * Returns a pointer to HDLC buffer if available, otherwise %NULL. */ -static struct n_hdlc_buf *n_hdlc_buf_get (struct n_hdlc_buf_list *list) +static struct n_hdlc_buf *n_hdlc_buf_get (struct n_hdlc_buf_list *buf_list) {unsigned long flags;struct n_hdlc_buf *buf; -spin_lock_irqsave (&list->spinlock,flags); - - buf = list->head; + +spin_lock_irqsave (&buf_list->spinlock, flags); + + buf =list_first_entry_or_null (&buf_list->list, + struct n_hdlc_buf, list_item);if (buf) { - list->head = buf->link; - (list->count)--; +list_del (&buf->list_item); + buf_list->count--; } -if (!list->head) - list->tail =NULL ; - -spin_unlock_irqrestore (&list->spinlock,flags); + +spin_unlock_irqrestore (&buf_list->spinlock, flags);return buf; - }/* end of n_hdlc_buf_get() */ static char hdlc_banner[] __initdata =
Greg Kroah-Hartman
maintainerPATCH 2/75 serial: 8250_pci: Add MKS Tenta SCOM-0800 and SCOM-0801 cards
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Abbott <[email protected]>
commit 1c9c858e2ff8ae8024a3d75d2ed080063af43754 upstream.
The MKS Instruments SCOM-0800 and SCOM-0801 cards (originally by Tenta Technologies) are 3U CompactPCI serial cards with 4 and 8 serial ports, respectively. The first 4 ports are implemented by an OX16PCI954 chip, and the second 4 ports are implemented by an OX16C954 chip on a local bus, bridged by the second PCI function of the OX16PCI954. The ports are jumper-selectable as RS-232 and RS-422/485, and the UARTs use a non-standard oscillator frequency of 20 MHz (base_baud = 1250000).
--- drivers/tty/serial/8250/8250_pci.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/tty/serial/8250/8250_pci.c +13 -0
@@ -2723,6 +2723,8 @@ enum pci_board_num_t { pbn_b0_4_1152000_200, pbn_b0_8_1152000_200, + pbn_b0_4_1250000, + pbn_b0_2_1843200, pbn_b0_4_1843200,
@@ -2954,6 +2956,13 @@ static struct pciserial_board pci_boards .uart_offset = 0x200, }, + [pbn_b0_4_1250000] = { + .flags = FL_BASE0, + .num_ports = 4, + .base_baud = 1250000, + .uart_offset = 8, + }, + [pbn_b0_2_1843200] = { .flags = FL_BASE0, .num_ports = 2,
@@ -5589,6 +5598,10 @@ static struct pci_device_id serial_pci_t { PCI_DEVICE(0x1c29, 0x1108), .driver_data = pbn_fintek_8 }, { PCI_DEVICE(0x1c29, 0x1112), .driver_data = pbn_fintek_12 }, + /* MKS Tenta SCOM-080x serial cards */ + { PCI_DEVICE(0x1601, 0x0800), .driver_data = pbn_b0_4_1250000 }, + { PCI_DEVICE(0x1601, 0xa801), .driver_data = pbn_b0_4_1250000 }, +/* * These entries match devices with class COMMUNICATION_SERIAL, * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
Greg Kroah-Hartman
maintainerPATCH 3/75 KVM: s390: Disable dirty log retrieval for UCONTROL guests
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Janosch Frank <[email protected]>
commit e1e8a9624f7ba8ead4f056ff558ed070e86fa747 upstream.
User controlled KVM guests do not support the dirty log, as they have no single gmap that we can check for changes.
As they have no single gmap, kvm->arch.gmap is NULL and all further referencing to it for dirty checking will result in a NULL dereference.
Let's return -EINVAL if a caller tries to sync dirty logs for a UCONTROL guest.
--- arch/s390/kvm/kvm-s390.c | 3 +++ 1 file changed, 3 insertions(+)
arch/s390/kvm/kvm-s390.c +3 -0
@@ -442,6 +442,9 @@ int kvm_vm_ioctl_get_dirty_log(struct kvstruct kvm_memory_slot *memslot;int is_dirty =0 ; +if (kvm_is_ucontrol (kvm)) +return -EINVAL ; +mutex_lock (&kvm->slots_lock); r = -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 4/75 KVM: VMX: use correct vmcs_read/write for guest segment selector/base
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Peng <[email protected]>
commit 96794e4ed4d758272c486e1529e431efb7045265 upstream.
Guest segment selector is 16 bit field and guest segment base is natural width field. Fix two incorrect invocations accordingly.
Without this patch, build fails when aggressive inlining is used with ICC.
--- arch/x86/kvm/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/vmx.c +2 -2
@@ -3962,7 +3962,7 @@ static void fix_rmode_seg(int seg, struc }vmcs_write16 (sf->selector, var.selector); -vmcs_write32 (sf->base, var.base); +vmcs_writel (sf->base, var.base);vmcs_write32 (sf->limit, var.limit);vmcs_write32 (sf->ar_bytes,vmx_segment_access_rights (&var)); }
@@ -8350,7 +8350,7 @@ static void kvm_flush_pml_buffers(structstatic void vmx_dump_sel (char *name,uint32_t sel) {pr_err ("%s sel=0x%04x, attr=0x%05x, limit=0x%08x, base=0x%016lx\n" , - name,vmcs_read32 (sel), + name,vmcs_read16 (sel),vmcs_read32 (sel +GUEST_ES_AR_BYTES -GUEST_ES_SELECTOR ),vmcs_read32 (sel +GUEST_ES_LIMIT -GUEST_ES_SELECTOR ),vmcs_readl (sel +GUEST_ES_BASE -GUEST_ES_SELECTOR ));
Greg Kroah-Hartman
maintainerPATCH 5/75 Bluetooth: Add another AR3012 04ca:3018 device
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Tunin <[email protected]>
commit 441ad62d6c3f131f1dbd7dcdd9cbe3f74dbd8501 upstream.
T: Bus=01 Lev=01 Prnt=01 Port=07 Cnt=04 Dev#= 5 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=04ca ProdID=3018 Rev=00.01 C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
--- drivers/bluetooth/ath3k.c | 2 ++ drivers/bluetooth/btusb.c | 1 + 2 files changed, 3 insertions(+)
drivers/bluetooth/ath3k.c +2 -0
@@ -94,6 +94,7 @@ static const struct usb_device_id ath3k_ { USB_DEVICE(0x04CA, 0x300f) }, { USB_DEVICE(0x04CA, 0x3010) }, { USB_DEVICE(0x04CA, 0x3014) }, + { USB_DEVICE(0x04CA, 0x3018) }, { USB_DEVICE(0x0930, 0x0219) }, { USB_DEVICE(0x0930, 0x021c) }, { USB_DEVICE(0x0930, 0x0220) },
@@ -162,6 +163,7 @@ static const struct usb_device_id ath3k_ { USB_DEVICE(0x04ca, 0x300f), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3010), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3014), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x3018), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x021c), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
drivers/bluetooth/btusb.c +1 -0
@@ -209,6 +209,7 @@ static const struct usb_device_id blackl { USB_DEVICE(0x04ca, 0x300f), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3010), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x3014), .driver_info = BTUSB_ATH3012 }, + { USB_DEVICE(0x04ca, 0x3018), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x021c), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
Greg Kroah-Hartman
maintainerPATCH 6/75 phy: qcom-ufs: Dont kfree devres resource
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Andersson <[email protected]>
commit e7d5e412160c2143de1f818668774b33b3cdab0b upstream.
Upon failing to acquire regulator supplies the qcom-ufs driver calls kfree() on the devm allocated memory used to store the name of the regulator, leading to devres corruption.
Rather than switching to using the appropriate free function the patch acknowledge the fact that "name" is always a constant string and we don't actually need to create a local copy of it, but rather just reference the constant string.
--- drivers/phy/phy-qcom-ufs.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/phy/phy-qcom-ufs.c +1 -8
@@ -217,12 +217,7 @@ static int __ufs_qcom_phy_init_vreg(struchar prop_name[MAX_PROP_NAME ]; - vreg->name =devm_kstrdup (dev, name,GFP_KERNEL ); -if (!vreg->name) { - err = -ENOMEM ; - goto out; - } - + vreg->name = name; vreg->reg =devm_regulator_get (dev, name);if (IS_ERR (vreg->reg)) { err =PTR_ERR (vreg->reg);
@@ -265,8 +260,6 @@ static int __ufs_qcom_phy_init_vreg(stru } out: -if (err) -kfree (vreg->name);return err; }
Greg Kroah-Hartman
maintainerPATCH 7/75 phy: qcom-ufs: Fix misplaced jump label
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vivek Gautam <[email protected]>
commit 0b10f64dbe60cb1b2056f647c052b4278627fe24 upstream.
We want to skip only tx/rx_iface clocks and not ref_clk_src as well. Fix the jump label accordingly.
--- drivers/phy/phy-qcom-ufs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/phy-qcom-ufs.c +1 -1
@@ -189,12 +189,12 @@ int ufs_qcom_phy_init_clks(struct ufs_qcif (err) goto out; +skip_txrx_clk: err =ufs_qcom_phy_clk_get (phy_common->dev,"ref_clk_src" , &phy_common->ref_clk_src);if (err) goto out; -skip_txrx_clk:/* * "ref_clk_parent" is optional hence don't abort init if it's not * found.
Greg Kroah-Hartman
maintainerPATCH 8/75 s390/qdio: clear DSCI prior to scanning multiple input queues
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Wiedmann <[email protected]>
commit 1e4a382fdc0ba8d1a85b758c0811de3a3631085e upstream.
For devices with multiple input queues, tiqdio_call_inq_handlers() iterates over all input queues and clears the device's DSCI during each iteration. If the DSCI is re-armed during one of the later iterations, we therefore do not scan the previous queues again.
The re-arming also raises a new adapter interrupt. But its handler does not trigger a rescan for the device, as the DSCI has already been erroneously cleared.
This can result in queue stalls on devices with multiple input queues.
Fix it by clearing the DSCI just once, prior to scanning the queues.
As the code is moved in front of the loop, we also need to access the DSCI directly (ie irq->dsci) instead of going via each queue's parent pointer to the same irq. This is not a functional change, and a follow-up patch will clean up the other users.
In practice, this bug only affects CQ-enabled HiperSockets devices, ie. devices with sysfs-attribute "hsuid" set. Setting a hsuid is needed for AF_IUCV socket applications that use HiperSockets communication.
--- drivers/s390/cio/qdio_thinint.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/s390/cio/qdio_thinint.c +4 -4
@@ -147,11 +147,11 @@ static inline void tiqdio_call_inq_handlstruct qdio_q *q;int i; -for_each_input_queue (irq, q, i) { -if (!references_shared_dsci (irq) && -has_multiple_inq_on_dsci (irq)) -xchg (q->irq_ptr->dsci,0 ); +if (!references_shared_dsci (irq) && +has_multiple_inq_on_dsci (irq)) +xchg (irq->dsci,0 ); +for_each_input_queue (irq, q, i) {if (q->u.in.queue_start_poll) {/* skip if polling is enabled or already in work */ if (test_and_set_bit(QDIO_QUEUE_IRQS_DISABLED,
Greg Kroah-Hartman
maintainerPATCH 9/75 s390/dcssblk: fix device size calculation in dcssblk_direct_access()
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gerald Schaefer <[email protected]>
commit a63f53e34db8b49675448d03ae324f6c5bc04fe6 upstream.
Since commit dd22f551 "block: Change direct_access calling convention", the device size calculation in dcssblk_direct_access() is off-by-one. This results in bdev_direct_access() always returning -ENXIO because the returned value is not page aligned.
Fix this by adding 1 to the dev_sz calculation.
--- drivers/s390/block/dcssblk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/block/dcssblk.c +1 -1
@@ -892,7 +892,7 @@ dcssblk_direct_access (struct block_devi dev_info = bdev->bd_disk->private_data;if (!dev_info)return -ENODEV ; - dev_sz = dev_info->end - dev_info->start; + dev_sz = dev_info->end - dev_info->start +1 ; offset = secnum *512 ; *kaddr = (void *) dev_info->start + offset; *pfn =__pfn_to_pfn_t (PFN_DOWN (dev_info->start + offset),PFN_DEV );
Greg Kroah-Hartman
maintainerPATCH 10/75 s390/kdump: Use "LINUX" ELF note name instead of "CORE"
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Holzheu <[email protected]>
commit a4a81d8eebdc1d209d034f62a082a5131e4242b5 upstream.
In binutils/libbfd (bfd/elf.c) it is enforced that all s390 specific ELF notes like e.g. NT_S390_PREFIX or NT_S390_CTRS have "LINUX" specified as note name. Otherwise the notes are ignored.
For /proc/vmcore we currently use "CORE" for these notes.
Up to now this has not been a real problem because the dump analysis tool "crash" does not check the note name. But it will break all programs that use libbfd for processing ELF notes.
So fix this and use "LINUX" for all s390 specific notes to comply with libbfd.
--- arch/s390/kernel/crash_dump.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/s390/kernel/crash_dump.c +5 -1
@@ -329,7 +329,11 @@ static void *nt_init_name(void *buf, Elfstatic inline void *nt_init (void *buf,Elf64_Word type,void *desc,int d_len) { -return nt_init_name (buf, type, desc, d_len,KEXEC_CORE_NOTE_NAME ); +const char *note_name ="LINUX" ; + +if (type ==NT_PRPSINFO || type ==NT_PRSTATUS || type ==NT_PRFPREG ) + note_name =KEXEC_CORE_NOTE_NAME ; +return nt_init_name (buf, type, desc, d_len, note_name); }/*
Greg Kroah-Hartman
maintainerPATCH 11/75 s390/chsc: Add exception handler for CHSC instruction
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Oberparleiter <[email protected]>
commit 77759137248f34864a8f7a58bbcebfcf1047504a upstream.
Prevent kernel crashes due to unhandled exceptions raised by the CHSC instruction which may for example be triggered by invalid ioctl data.
--- drivers/s390/cio/ioasm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/s390/cio/ioasm.c +5 -3
@@ -165,13 +165,15 @@ int tpi(struct tpi_info *addr)int chsc (void *chsc_area) {typedef struct {char _[4096 ]; }addr_type ; -int cc; +int cc = -EIO ; asmvolatile (" .insn rre,0xb25f0000,%2,0\n" -" ipm %0\n" +"0: ipm %0\n" " srl %0,28\n" - :"=d" (cc),"=m" (*(addr_type *) chsc_area) +"1:\n" + EX_TABLE(0b, 1b) + : "+d" (cc), "=m" (*(addr_type *) chsc_area) : "d" (chsc_area), "m" (*(addr_type *) chsc_area) : "cc"); trace_s390_cio_chsc(chsc_area, cc);
Greg Kroah-Hartman
maintainerPATCH 12/75 s390: TASK_SIZE for kernel threads
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Schwidefsky <[email protected]>
commit fb94a687d96c570d46332a4a890f1dcb7310e643 upstream.
Return a sensible value if TASK_SIZE if called from a kernel thread.
This gets us around an issue with copy_mount_options that does a magic size calculation "TASK_SIZE - (unsigned long)data" while in a kernel thread and data pointing to kernel space.
--- arch/s390/include/asm/processor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/s390/include/asm/processor.h +2 -1
@@ -89,7 +89,8 @@ extern void execve_tail(void);* User space process size: 2GB for 31 bit, 4TB or 8PT for 64 bit. */ -#define TASK_SIZE_OF (tsk) ((tsk)->mm->context.asce_limit) +#define TASK_SIZE_OF (tsk) ((tsk)->mm ? \ + (tsk)->mm->context.asce_limit : TASK_MAX_SIZE)#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \ (1UL << 30) : (1UL << 41))#define TASK_SIZE TASK_SIZE_OF(current)
Greg Kroah-Hartman
maintainerPATCH 13/75 s390/topology: correct allocation of topology information
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Schwidefsky <[email protected]>
commit 8676caa4fb7fc02b2c76842a0024919d0caa4b8d upstream.
The data stored by the STSI instruction can be up to a page in size but the memblock_virt_alloc allocation for tl_info only specifies 16 bytes. The memory after the short allocation is overwritten every time arch_update_cpu_topology is called.
--- arch/s390/kernel/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/topology.c +1 -1
@@ -466,7 +466,7 @@ void __init topology_init_early(void)set_sched_topology (s390_topology);if (!MACHINE_HAS_TOPOLOGY ) goto out; - tl_info =memblock_virt_alloc (sizeof (*tl_info),PAGE_SIZE ); + tl_info =memblock_virt_alloc (PAGE_SIZE ,PAGE_SIZE ); info = tl_info;store_topology (info);pr_info ("The CPU configuration topology of the machine is:" );
Greg Kroah-Hartman
maintainerPATCH 14/75 s390: make setup_randomness work
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Carstens <[email protected]>
commit da8fd820f389a0e29080b14c61bf5cf1d8ef5ca1 upstream.
Commit bcfcbb6bae64 ("s390: add system information as device randomness") intended to add some virtual machine specific information to the randomness pool.
Unfortunately it uses the page allocator before it is ready to use. In result the page allocator always returns NULL and the setup_randomness function never adds anything to the randomness pool.
To fix this use memblock_alloc and memblock_free instead.
--- arch/s390/kernel/setup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/s390/kernel/setup.c +3 -3
@@ -820,10 +820,10 @@ static void __init setup_randomness(void {struct sysinfo_3_2_2 *vmms; - vmms = (struct sysinfo_3_2_2 *)alloc_page (GFP_KERNEL ); -if (vmms &&stsi (vmms,3 ,2 ,2 ) ==0 && vmms->count) + vmms = (struct sysinfo_3_2_2 *)memblock_alloc (PAGE_SIZE ,PAGE_SIZE ); +if (stsi (vmms,3 ,2 ,2 ) ==0 && vmms->count)add_device_randomness (&vmms, vmms->count); -free_page ((unsigned long ) vmms); +memblock_free ((unsigned long ) vmms,PAGE_SIZE ); }/*
Greg Kroah-Hartman
maintainerPATCH 15/75 s390: use correct input data address for setup_randomness
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Carstens <[email protected]>
commit 4920e3cf77347d7d7373552d4839e8d832321313 upstream.
The current implementation of setup_randomness uses the stack address and therefore the pointer to the SYSIB 3.2.2 block as input data address. Furthermore the length of the input data is the number of virtual-machine description blocks which is typically one.
This means that typically a single zero byte is fed to add_device_randomness.
Fix both of these and use the address of the first virtual machine description block as input data address and also use the correct length.
--- arch/s390/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kernel/setup.c +1 -1
@@ -822,7 +822,7 @@ static void __init setup_randomness(void vmms = (struct sysinfo_3_2_2 *)memblock_alloc (PAGE_SIZE ,PAGE_SIZE );if (stsi (vmms,3 ,2 ,2 ) ==0 && vmms->count) -add_device_randomness (&vmms, vmms->count); +add_device_randomness (&vmms->vm,sizeof (vmms->vm[0 ]) * vmms->count);memblock_free ((unsigned long ) vmms,PAGE_SIZE ); }
Greg Kroah-Hartman
maintainerPATCH 16/75 net: mvpp2: fix DMA address calculation in mvpp2_txq_inc_put()
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Petazzoni <[email protected]>
commit 239a3b663647869330955ec59caac0100ef9b60a upstream.
When TX descriptors are filled in, the buffer DMA address is split between the tx_desc->buf_phys_addr field (high-order bits) and tx_desc->packet_offset field (5 low-order bits).
However, when we re-calculate the DMA address from the TX descriptor in mvpp2_txq_inc_put(), we do not take tx_desc->packet_offset into account. This means that when the DMA address is not aligned on a 32 bytes boundary, we end up calling dma_unmap_single() with a DMA address that was not the one returned by dma_map_single().
This inconsistency is detected by the kernel when DMA_API_DEBUG is enabled. We fix this problem by properly calculating the DMA address in mvpp2_txq_inc_put().
--- drivers/net/ethernet/marvell/mvpp2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvpp2.c +1 -1
@@ -991,7 +991,7 @@ static void mvpp2_txq_inc_put(struct mvp txq_pcpu->buffs + txq_pcpu->txq_put_index; tx_buf->skb = skb; tx_buf->size = tx_desc->data_size; - tx_buf->phys = tx_desc->buf_phys_addr; + tx_buf->phys = tx_desc->buf_phys_addr + tx_desc->packet_offset; txq_pcpu->txq_put_index++;if (txq_pcpu->txq_put_index == txq_pcpu->size) txq_pcpu->txq_put_index =0 ;
Greg Kroah-Hartman
maintainerPATCH 17/75 cxl: Prevent read/write to AFU config space while AFU not configured
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Donnellan <[email protected]>
commit 14a3ae34bfd0bcb1cc12d55b06a8584c11fac6fc upstream.
During EEH recovery, we deconfigure all AFUs whilst leaving the corresponding vPHB and virtual PCI device in place.
If something attempts to interact with the AFU's PCI config space (e.g. running lspci) after the AFU has been deconfigured and before it's reconfigured, cxl_pcie_{read,write}_config() will read invalid values from the deconfigured struct cxl_afu and proceed to Oops when they try to dereference pointers that have been set to NULL during deconfiguration.
Add a rwsem to struct cxl_afu so we can prevent interaction with config space while the AFU is deconfigured.
--- drivers/misc/cxl/cxl.h | 2 + drivers/misc/cxl/main.c | 3 +- drivers/misc/cxl/pci.c | 2 + drivers/misc/cxl/vphb.c | 51 +++++++++++++++++++++++++++--------------------- 4 files changed, 35 insertions(+), 23 deletions(-)
drivers/misc/cxl/cxl.h +2 -0
@@ -418,6 +418,8 @@ struct cxl_afu {struct dentry *debugfs;struct mutex contexts_lock;spinlock_t afu_cntl_lock; +/* Used to block access to AFU config space while deconfigured */ +struct rw_semaphore configured_rwsem;/* AFU error buffer fields and bin attribute for sysfs */ u64 eb_len, eb_offset;
drivers/misc/cxl/main.c +2 -1
@@ -268,7 +268,8 @@ struct cxl_afu *cxl_alloc_afu(struct cxlidr_init (&afu->contexts_idr);mutex_init (&afu->contexts_lock);spin_lock_init (&afu->afu_cntl_lock); - +init_rwsem (&afu->configured_rwsem); +down_write (&afu->configured_rwsem); afu->prefault_mode =CXL_PREFAULT_NONE ; afu->irqs_max = afu->adapter->user_irqs;
drivers/misc/cxl/pci.c +2 -0
@@ -1129,6 +1129,7 @@ static int pci_configure_afu(struct cxl_if ((rc =cxl_native_register_psl_irq (afu))) goto err2; +up_write (&afu->configured_rwsem);return 0 ; err2:
@@ -1141,6 +1142,7 @@ err1:static void pci_deconfigure_afu (struct cxl_afu *afu) { +down_write (&afu->configured_rwsem);cxl_native_release_psl_irq (afu);if (afu->adapter->native->sl_ops->release_serr_irq) afu->adapter->native->sl_ops->release_serr_irq (afu);
drivers/misc/cxl/vphb.c +29 -22
90 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 18/75 cxl: fix nested locking hang during EEH hotplug
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Donnellan <[email protected]>
commit 171ed0fcd8966d82c45376f1434678e7b9d4d9b1 upstream.
Commit 14a3ae34bfd0 ("cxl: Prevent read/write to AFU config space while AFU not configured") introduced a rwsem to fix an invalid memory access that occurred when someone attempts to access the config space of an AFU on a vPHB whilst the AFU is deconfigured, such as during EEH recovery.
It turns out that it's possible to run into a nested locking issue when EEH recovery fails and a full device hotplug is required. cxl_pci_error_detected() deconfigures the AFU, taking a writer lock on configured_rwsem. When EEH recovery fails, the EEH code calls pci_hp_remove_devices() to remove the device, which in turn calls cxl_remove() -> cxl_pci_remove_afu() -> pci_deconfigure_afu(), which tries to grab the writer lock that's already held.
Standard rwsem semantics don't express what we really want to do here and don't allow for nested locking. Fix this by replacing the rwsem with an atomic_t which we can control more finely. Allow the AFU to be locked multiple times so long as there are no readers.
--- drivers/misc/cxl/cxl.h | 5 +++-- drivers/misc/cxl/main.c | 3 +-- drivers/misc/cxl/pci.c | 11 +++++++++-- drivers/misc/cxl/vphb.c | 18 ++++++++++++++---- 4 files changed, 27 insertions(+), 10 deletions(-)
drivers/misc/cxl/cxl.h +3 -2
@@ -418,8 +418,9 @@ struct cxl_afu {struct dentry *debugfs;struct mutex contexts_lock;spinlock_t afu_cntl_lock; -/* Used to block access to AFU config space while deconfigured */ -struct rw_semaphore configured_rwsem; + +/* -1: AFU deconfigured/locked, >= 0: number of readers */ +atomic_t configured_state;/* AFU error buffer fields and bin attribute for sysfs */ u64 eb_len, eb_offset;
drivers/misc/cxl/main.c +1 -2
@@ -268,8 +268,7 @@ struct cxl_afu *cxl_alloc_afu(struct cxlidr_init (&afu->contexts_idr);mutex_init (&afu->contexts_lock);spin_lock_init (&afu->afu_cntl_lock); -init_rwsem (&afu->configured_rwsem); -down_write (&afu->configured_rwsem); +atomic_set (&afu->configured_state,-1 ); afu->prefault_mode =CXL_PREFAULT_NONE ; afu->irqs_max = afu->adapter->user_irqs;
drivers/misc/cxl/pci.c +9 -2
@@ -1129,7 +1129,7 @@ static int pci_configure_afu(struct cxl_if ((rc =cxl_native_register_psl_irq (afu))) goto err2; -up_write (&afu->configured_rwsem); +atomic_set (&afu->configured_state,0 );return 0 ; err2:
@@ -1142,7 +1142,14 @@ err1:static void pci_deconfigure_afu (struct cxl_afu *afu) { -down_write (&afu->configured_rwsem); +/* +* It's okay to deconfigure when AFU is already locked, otherwise wait +* until there are no readers +*/ +if (atomic_read (&afu->configured_state) !=-1 ) { +while (atomic_cmpxchg (&afu->configured_state,0 ,-1 ) !=-1 ) +schedule (); + }cxl_native_release_psl_irq (afu);if (afu->adapter->native->sl_ops->release_serr_irq) afu->adapter->native->sl_ops->release_serr_irq (afu);
drivers/misc/cxl/vphb.c +14 -4
@@ -83,6 +83,16 @@ static inline struct cxl_afu *pci_bus_toreturn phb ? phb->private_data :NULL ; } +static void cxl_afu_configured_put (struct cxl_afu *afu) +{ +atomic_dec_if_positive (&afu->configured_state); +} + +static bool cxl_afu_configured_get (struct cxl_afu *afu) +{ +return atomic_inc_unless_negative (&afu->configured_state); +} +static inline int cxl_pcie_config_info (struct pci_bus *bus,unsigned int devfn,struct cxl_afu *afu,int *_record) {
@@ -107,7 +117,7 @@ static int cxl_pcie_read_config(struct p afu =pci_bus_to_afu (bus);/* Grab a reader lock on afu. */ -if (afu ==NULL || !down_read_trylock (&afu->configured_rwsem)) +if (afu ==NULL || !cxl_afu_configured_get (afu))return PCIBIOS_DEVICE_NOT_FOUND ; rc =cxl_pcie_config_info (bus, devfn, afu, &record);
@@ -132,7 +142,7 @@ static int cxl_pcie_read_config(struct p } out: -up_read (&afu->configured_rwsem); +cxl_afu_configured_put (afu);return rc ?PCIBIOS_DEVICE_NOT_FOUND :PCIBIOS_SUCCESSFUL ; }
@@ -144,7 +154,7 @@ static int cxl_pcie_write_config(struct afu =pci_bus_to_afu (bus);/* Grab a reader lock on afu. */ -if (afu ==NULL || !down_read_trylock (&afu->configured_rwsem)) +if (afu ==NULL || !cxl_afu_configured_get (afu))return PCIBIOS_DEVICE_NOT_FOUND ; rc =cxl_pcie_config_info (bus, devfn, afu, &record);
@@ -166,7 +176,7 @@ static int cxl_pcie_write_config(struct } out: -up_read (&afu->configured_rwsem); +cxl_afu_configured_put (afu);return rc ?PCIBIOS_SET_FAILED :PCIBIOS_SUCCESSFUL ; }
Greg Kroah-Hartman
maintainerPATCH 19/75 brcmfmac: fix incorrect event channel deduction
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gavin Li <[email protected]>
commit 8e290cecdd0178f3d4cf7d463c51dc7e462843b4 upstream.
brcmf_sdio_fromevntchan() was being called on the the data frame rather than the software header, causing some frames to be mischaracterized as on the event channel rather than the data channel.
This fixes a major performance regression (due to dropped packets). With this patch the download speed jumped from 1Mbit/s back up to 40MBit/s due to the sheer amount of packets being incorrectly processed.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +1 -1
@@ -1661,7 +1661,7 @@ static u8 brcmf_sdio_rxglom(struct brcmf pfirst->len, pfirst->next, pfirst->prev);skb_unlink (pfirst, &bus->glom); -if (brcmf_sdio_fromevntchan (pfirst->data)) +if (brcmf_sdio_fromevntchan (&dptr[SDPCM_HWHDR_LEN ]))brcmf_rx_event (bus->sdiodev->dev, pfirst);else brcmf_rx_frame(bus->sdiodev->dev, pfirst,
Greg Kroah-Hartman
maintainerPATCH 20/75 mnt: Tuck mounts under others instead of creating shadow/side mounts.
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric W. Biederman <[email protected]>
commit 1064f874abc0d05eeed8993815f584d847b72486 upstream.
Ever since mount propagation was introduced in cases where a mount in propagated to parent mount mountpoint pair that is already in use the code has placed the new mount behind the old mount in the mount hash table.
This implementation detail is problematic as it allows creating arbitrary length mount hash chains.
Furthermore it invalidates the constraint maintained elsewhere in the mount code that a parent mount and a mountpoint pair will have exactly one mount upon them. Making it hard to deal with and to talk about this special case in the mount code.
Modify mount propagation to notice when there is already a mount at the parent mount and mountpoint where a new mount is propagating to and place that preexisting mount on top of the new mount.
Modify unmount propagation to notice when a mount that is being unmounted has another mount on top of it (and no other children), and to replace the unmounted mount with the mount on top of it.
Move the MNT_UMUONT test from __lookup_mnt_last into __propagate_umount as that is the only call of __lookup_mnt_last where MNT_UMOUNT may be set on any mount visible in the mount hash table.
These modifications allow:
- __lookup_mnt_last to be removed.
- attach_shadows to be renamed __attach_mnt and its shadow handling to be removed.
- commit_tree to be simplified
- copy_tree to be simplified
The result is an easier to understand tree of mounts that does not allow creation of arbitrary length hash chains in the mount hash table.
The result is also a very slight userspace visible difference in semantics. The following two cases now behave identically, where before order mattered:
case 1: (explicit user action)
B is a slave of A
mount something on A/a , it will propagate to B/a and than mount something on B/a
case 2: (tucked mount)
B is a slave of A
mount something on B/a
and than mount something on A/a
Histroically umount A/a would fail in case 1 and succeed in case 2. Now umount A/a succeeds in both configurations.
This very small change in semantics appears if anything to be a bug fix to me and my survey of userspace leads me to believe that no programs will notice or care of this subtle semantic change.
v2: Updated to mnt_change_mountpoint to not call dput or mntput and instead to decrement the counts directly. It is guaranteed that there will be other references when mnt_change_mountpoint is called so this is safe.
v3: Moved put_mountpoint under mount_lock in attach_recursive_mnt
As the locking in fs/namespace.c changed between v2 and v3.
v4: Reworked the logic in propagate_mount_busy and __propagate_umount
that detects when a mount completely covers another mount.
v5: Removed unnecessary tests whose result is alwasy true in
find_topper and attach_recursive_mnt.
v6: Document the user space visible semantic difference.
--- fs/mount.h | 1 fs/namespace.c | 110 +++++++++++++++++++++++++++++++-------------------------- fs/pnode.c | 61 +++++++++++++++++++++++++------ fs/pnode.h | 2 + 4 files changed, 111 insertions(+), 63 deletions(-)
fs/mount.h +0 -1
@@ -89,7 +89,6 @@ static inline int is_mounted(struct vfsm }extern struct mount *__lookup_mnt (struct vfsmount *,struct dentry *); -extern struct mount *__lookup_mnt_last (struct vfsmount *,struct dentry *);extern int __legitimize_mnt (struct vfsmount *,unsigned );extern bool legitimize_mnt (struct vfsmount *,unsigned );
fs/namespace.c +60 -50
182 lines not on this page · raw message
fs/pnode.c +49 -12
106 lines not on this page · raw message
fs/pnode.h +2 -0
@@ -49,6 +49,8 @@ int get_dominating_id(struct mount *mnt,unsigned int mnt_get_count (struct mount *mnt);void mnt_set_mountpoint (struct mount *,struct mountpoint *,struct mount *); +void mnt_change_mountpoint (struct mount *parent,struct mountpoint *mp, +struct mount *mnt);struct mount *copy_tree (struct mount *,struct dentry *,int );bool is_path_reachable (struct mount *,struct dentry *,const struct path *root);
Greg Kroah-Hartman
maintainerPATCH 21/75 IB/ipoib: Fix deadlock between rmmod and set_mode
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Feras Daoud <[email protected]>
commit 0a0007f28304cb9fc87809c86abb80ec71317f20 upstream.
When calling set_mode from sys/fs, the call flow locks the sys/fs lock first and then tries to lock rtnl_lock (when calling ipoib_set_mod). On the other hand, the rmmod call flow takes the rtnl_lock first (when calling unregister_netdev) and then tries to take the sys/fs lock. Deadlock a->b, b->a.
The problem starts when ipoib_set_mod frees it's rtnl_lck and tries to get it after that.
set_mod:
[<ffffffff8104f2bd>] ? check_preempt_curr+0x6d/0x90
[<ffffffff814fee8e>] __mutex_lock_slowpath+0x13e/0x180
[<ffffffff81448655>] ? __rtnl_unlock+0x15/0x20
[<ffffffff814fed2b>] mutex_lock+0x2b/0x50
[<ffffffff81448675>] rtnl_lock+0x15/0x20
[<ffffffffa02ad807>] ipoib_set_mode+0x97/0x160 [ib_ipoib]
[<ffffffffa02b5f5b>] set_mode+0x3b/0x80 [ib_ipoib]
[<ffffffff8134b840>] dev_attr_store+0x20/0x30
[<ffffffff811f0fe5>] sysfs_write_file+0xe5/0x170
[<ffffffff8117b068>] vfs_write+0xb8/0x1a0
[<ffffffff8117ba81>] sys_write+0x51/0x90
[<ffffffff8100b0f2>] system_call_fastpath+0x16/0x1b
rmmod:
[<ffffffff81279ffc>] ? put_dec+0x10c/0x110
[<ffffffff8127a2ee>] ? number+0x2ee/0x320
[<ffffffff814fe6a5>] schedule_timeout+0x215/0x2e0
[<ffffffff8127cc04>] ? vsnprintf+0x484/0x5f0
[<ffffffff8127b550>] ? string+0x40/0x100
[<ffffffff814fe323>] wait_for_common+0x123/0x180
[<ffffffff81060250>] ? default_wake_function+0x0/0x20
[<ffffffff8119661e>] ? ifind_fast+0x5e/0xb0
[<ffffffff814fe43d>] wait_for_completion+0x1d/0x20
[<ffffffff811f2e68>] sysfs_addrm_finish+0x228/0x270
[<ffffffff811f2fb3>] sysfs_remove_dir+0xa3/0xf0
[<ffffffff81273f66>] kobject_del+0x16/0x40
[<ffffffff8134cd14>] device_del+0x184/0x1e0
[<ffffffff8144e59b>] netdev_unregister_kobject+0xab/0xc0
[<ffffffff8143c05e>] rollback_registered+0xae/0x130
[<ffffffff8143c102>] unregister_netdevice+0x22/0x70
[<ffffffff8143c16e>] unregister_netdev+0x1e/0x30
[<ffffffffa02a91b0>] ipoib_remove_one+0xe0/0x120 [ib_ipoib]
[<ffffffffa01ed95f>] ib_unregister_device+0x4f/0x100 [ib_core]
[<ffffffffa021f5e1>] mlx4_ib_remove+0x41/0x180 [mlx4_ib]
[<ffffffffa01ab771>] mlx4_remove_device+0x71/0x90 [mlx4_core]--- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 12 +++++++----- drivers/infiniband/ulp/ipoib/ipoib_main.c | 6 ++---- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_cm.c +7 -5
@@ -1507,12 +1507,14 @@ static ssize_t set_mode(struct device *d ret =ipoib_set_mode (dev, buf); -rtnl_unlock (); +/* The assumption is that the function ipoib_set_mode returned +* with the rtnl held by it, if not the value -EBUSY returned, +* then no need to rtnl_unlock +*/ +if (ret != -EBUSY ) +rtnl_unlock (); -if (!ret) -return count; - -return ret; +return (!ret || ret == -EBUSY ) ? count : ret; } static DEVICE_ATTR(mode, S_IWUSR | S_IRUGO, show_mode, set_mode);
drivers/infiniband/ulp/ipoib/ipoib_main.c +2 -4
@@ -481,8 +481,7 @@ int ipoib_set_mode(struct net_device *de priv->tx_wr.wr.send_flags &= ~IB_SEND_IP_CSUM ;ipoib_flush_paths (dev); -rtnl_lock (); -return 0 ; +return (!rtnl_trylock ()) ? -EBUSY :0 ; }if (!strcmp (buf,"datagram\n" )) {
@@ -491,8 +490,7 @@ int ipoib_set_mode(struct net_device *dedev_set_mtu (dev,min (priv->mcast_mtu, dev->mtu));rtnl_unlock ();ipoib_flush_paths (dev); -rtnl_lock (); -return 0 ; +return (!rtnl_trylock ()) ? -EBUSY :0 ; }return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 22/75 IB/IPoIB: Add destination address when re-queue packet
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erez Shitrit <[email protected]>
commit 2b0841766a898aba84630fb723989a77a9d3b4e6 upstream.
When sending packet to destination that was not resolved yet via path query, the driver keeps the skb and tries to re-send it again when the path is resolved.
But when re-sending via dev_queue_xmit the kernel doesn't call to dev_hard_header, so IPoIB needs to keep 20 bytes in the skb and to put the destination address inside them.
In that way the dev_start_xmit will have the correct destination, and the driver won't take the destination from the skb->data, while nothing exists there, which causes to packet be be dropped.
The test flow is:
1. Run the SM on remote node,
2. Restart the driver.
4. Ping some destination,
3. Observe that first ICMP request will be dropped.
--- drivers/infiniband/ulp/ipoib/ipoib_main.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_main.c +17 -13
@@ -714,6 +714,14 @@ int ipoib_check_sm_sendonly_fullmember_sreturn ret; } +static void push_pseudo_header (struct sk_buff *skb,const char *daddr) +{ +struct ipoib_pseudo_header *phdr; + + phdr = (struct ipoib_pseudo_header *)skb_push (skb,sizeof (*phdr)); +memcpy (phdr->hwaddr, daddr,INFINIBAND_ALEN ); +} +void ipoib_flush_paths (struct net_device *dev) {struct ipoib_dev_priv *priv =netdev_priv (dev);
@@ -938,8 +946,7 @@ static void neigh_add_path(struct sk_buf }if (skb_queue_len (&neigh->queue) <IPOIB_MAX_PATH_REC_QUEUE ) { -/* put pseudoheader back on for next time */ -skb_push (skb,IPOIB_PSEUDO_LEN ); +push_pseudo_header (skb, neigh->daddr);__skb_queue_tail (&neigh->queue, skb); }else { ipoib_warn(priv, "queue length limit %d. Packet drop.\n",
@@ -957,10 +964,12 @@ static void neigh_add_path(struct sk_bufif (!path->query &&path_rec_start (dev, path)) goto err_path; -if (skb_queue_len (&neigh->queue) <IPOIB_MAX_PATH_REC_QUEUE ) +if (skb_queue_len (&neigh->queue) <IPOIB_MAX_PATH_REC_QUEUE ) { +push_pseudo_header (skb, neigh->daddr);__skb_queue_tail (&neigh->queue, skb); -else + }else { goto err_drop; + } }spin_unlock_irqrestore (&priv->lock, flags);
@@ -996,8 +1005,7 @@ static void unicast_arp_send(struct sk_b }if (path) {if (skb_queue_len (&path->queue) <IPOIB_MAX_PATH_REC_QUEUE ) { -/* put pseudoheader back on for next time */ -skb_push (skb,IPOIB_PSEUDO_LEN ); +push_pseudo_header (skb, phdr->hwaddr);__skb_queue_tail (&path->queue, skb); }else { ++dev->stats.tx_dropped;
@@ -1029,8 +1037,7 @@ static void unicast_arp_send(struct sk_breturn ; }else if ((path->query || !path_rec_start (dev, path)) &&skb_queue_len (&path->queue) <IPOIB_MAX_PATH_REC_QUEUE ) { -/* put pseudoheader back on for next time */ -skb_push (skb,IPOIB_PSEUDO_LEN ); +push_pseudo_header (skb, phdr->hwaddr);__skb_queue_tail (&path->queue, skb); }else { ++dev->stats.tx_dropped;
@@ -1111,8 +1118,7 @@ send_using_neigh: }if (skb_queue_len (&neigh->queue) <IPOIB_MAX_PATH_REC_QUEUE ) { -/* put pseudoheader back on for next time */ -skb_push (skb,sizeof (*phdr)); +push_pseudo_header (skb, phdr->hwaddr);spin_lock_irqsave (&priv->lock, flags);__skb_queue_tail (&neigh->queue, skb);spin_unlock_irqrestore (&priv->lock, flags);
@@ -1144,7 +1150,6 @@ static int ipoib_hard_header(struct sk_bunsigned short type, const void *daddr, const void *saddr, unsigned len) { - struct ipoib_pseudo_header *phdr; struct ipoib_header *header; header = (struct ipoib_header *)skb_push (skb,sizeof *header);
@@ -1157,8 +1162,7 @@ static int ipoib_hard_header(struct sk_b* destination address into skb hard header so we can figure out where * to send the packet later. */ - phdr = (struct ipoib_pseudo_header *)skb_push (skb,sizeof (*phdr)); -memcpy (phdr->hwaddr, daddr,INFINIBAND_ALEN ); +push_pseudo_header (skb, daddr);return IPOIB_HARD_LEN ; }
Greg Kroah-Hartman
maintainerPATCH 23/75 IB/mlx5: Fix out-of-bound access
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Romanovsky <[email protected]>
commit 0fd27a88c2e4f548937fd7d93fc6e65c4ad7c278 upstream.
When we initialize buffer to create SRQ in kernel, the number of pages was less than actually used in following mlx5_fill_page_array().
--- drivers/infiniband/hw/mlx5/srq.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/infiniband/hw/mlx5/srq.c +3 -8
@@ -165,8 +165,6 @@ static int create_srq_kernel(struct mlx5int err;int i;struct mlx5_wqe_srq_next_seg *next; -int page_shift; -int npages; err =mlx5_db_alloc (dev->mdev, &srq->db);if (err) {
@@ -179,7 +177,6 @@ static int create_srq_kernel(struct mlx5 err = -ENOMEM ; goto err_db; } - page_shift = srq->buf.page_shift; srq->head =0 ; srq->tail = srq->msrq.max -1 ;
@@ -191,10 +188,8 @@ static int create_srq_kernel(struct mlx5cpu_to_be16 ((i +1 ) & (srq->msrq.max -1 )); } - npages =DIV_ROUND_UP (srq->buf.npages,1 << (page_shift -PAGE_SHIFT )); -mlx5_ib_dbg (dev,"buf_size %d, page_shift %d, npages %d, calc npages %d\n" , - buf_size, page_shift, srq->buf.npages, npages); - in->pas =mlx5_vzalloc (sizeof (*in->pas) * npages); +mlx5_ib_dbg (dev,"srq->buf.page_shift = %d\n" , srq->buf.page_shift); + in->pas =mlx5_vzalloc (sizeof (*in->pas) * srq->buf.npages);if (!in->pas) { err = -ENOMEM ; goto err_buf;
@@ -208,7 +203,7 @@ static int create_srq_kernel(struct mlx5 } srq->wq_sig = !!srq_signature; - in->log_page_size = page_shift -MLX5_ADAPTER_PAGE_SHIFT ; + in->log_page_size = srq->buf.page_shift -MLX5_ADAPTER_PAGE_SHIFT ;if (MLX5_CAP_GEN (dev->mdev, cqe_version) ==MLX5_CQE_VERSION_V1 && in->type ==IB_SRQT_XRC ) in->user_index =MLX5_IB_DEFAULT_UIDX ;
Greg Kroah-Hartman
maintainerPATCH 24/75 IB/SRP: Avoid using IB_MR_TYPE_SG_GAPS
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit d6c58dc40fec35ff6cdb350b53bce0fcf9143709 upstream.
Tests have shown that the following error message is reported when using SG-GAPS registration with an mlx5 adapter:
scsi host1: ib_srp: failed RECV status WR flushed (5) for CQE ffff880bd4270eb0
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 0f007806 2500002a ad9fafd1
scsi host1: ib_srp: reconnect succeeded
mlx5_0:dump_cqe:262:(pid 7369): dump error cqe
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 0f007806 25000032 00105dd0
scsi host1: ib_srp: failed FAST REG status memory management operation error (6) for CQE ffff880b92860138
Hence avoid using SG-GAPS memory registrations. Additionally, always configure the blk_queue_virt_boundary() to avoid to trigger a mapping failure when using adapters that support SG-GAPS (e.g. mlx5).
--- drivers/infiniband/ulp/srp/ib_srp.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/infiniband/ulp/srp/ib_srp.c +3 -9
@@ -371,7 +371,6 @@ static struct srp_fr_pool *srp_create_frstruct srp_fr_desc *d;struct ib_mr *mr;int i, ret = -EINVAL ; -enum ib_mr_type mr_type;if (pool_size <=0 ) goto err;
@@ -385,13 +384,9 @@ static struct srp_fr_pool *srp_create_frspin_lock_init (&pool->lock);INIT_LIST_HEAD (&pool->free_list); -if (device->attrs.device_cap_flags &IB_DEVICE_SG_GAPS_REG ) - mr_type =IB_MR_TYPE_SG_GAPS ; -else - mr_type =IB_MR_TYPE_MEM_REG ; -for (i =0 , d = &pool->desc[0 ]; i < pool->size; i++, d++) { - mr =ib_alloc_mr (pd, mr_type, max_page_list_len); + mr =ib_alloc_mr (pd,IB_MR_TYPE_MEM_REG , + max_page_list_len);if (IS_ERR (mr)) { ret =PTR_ERR (mr);if (ret == -ENOMEM )
@@ -2664,9 +2659,8 @@ static int srp_slave_alloc(struct scsi_dstruct Scsi_Host *shost = sdev->host;struct srp_target_port *target =host_to_target (shost);struct srp_device *srp_dev = target->srp_host->srp_dev; -struct ib_device *ibdev = srp_dev->dev; -if (!(ibdev->attrs.device_cap_flags &IB_DEVICE_SG_GAPS_REG )) +if (true)blk_queue_virt_boundary (sdev->request_queue, ~srp_dev->mr_page_mask);
Greg Kroah-Hartman
maintainerPATCH 25/75 IB/srp: Avoid that duplicate responses trigger a kernel bug
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit 6cb72bc1b40bb2c1750ee7a5ebade93bed49a5fb upstream.
After srp_process_rsp() returns there is a short time during which the scsi_host_find_tag() call will return a pointer to the SCSI command that is being completed. If during that time a duplicate response is received, avoid that the following call stack appears:
BUG: unable to handle kernel NULL pointer dereference at (null) IP: srp_recv_done+0x450/0x6b0 [ib_srp] Oops: 0000 [#1] SMP CPU: 10 PID: 0 Comm: swapper/10 Not tainted 4.10.0-rc7-dbg+ #1 Call Trace: <IRQ> __ib_process_cq+0x4b/0xd0 [ib_core] ib_poll_handler+0x1d/0x70 [ib_core] irq_poll_softirq+0xba/0x120 __do_softirq+0xba/0x4c0 irq_exit+0xbe/0xd0 smp_apic_timer_interrupt+0x38/0x50 apic_timer_interrupt+0x90/0xa0 </IRQ> RIP: srp_recv_done+0x450/0x6b0 [ib_srp] RSP: ffff88046f483e20
--- drivers/infiniband/ulp/srp/ib_srp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/ulp/srp/ib_srp.c +3 -1
@@ -1892,9 +1892,11 @@ static void srp_process_rsp(struct srp_rcomplete (&ch->tsk_mgmt_done); }else { scmnd =scsi_host_find_tag (target->scsi_host, rsp->tag); -if (scmnd) { +if (scmnd && scmnd->host_scribble) { req = (void *)scmnd->host_scribble; scmnd =srp_claim_req (ch, req,NULL , scmnd); + }else { + scmnd =NULL ; }if (!scmnd) { shost_printk(KERN_ERR, target->scsi_host,
Greg Kroah-Hartman
maintainerPATCH 26/75 IB/srp: Fix race conditions related to task management
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
commit 0a6fdbdeb1c25e31763c1fb333fa2723a7d2aba6 upstream.
Avoid that srp_process_rsp() overwrites the status information in ch if the SRP target response timed out and processing of another task management function has already started. Avoid that issuing multiple task management functions concurrently triggers list corruption. This patch prevents that the following stack trace appears in the system log:
WARNING: CPU: 8 PID: 9269 at lib/list_debug.c:52 __list_del_entry_valid+0xbc/0xc0 list_del corruption. prev->next should be ffffc90004bb7b00, but was ffff8804052ecc68 CPU: 8 PID: 9269 Comm: sg_reset Tainted: G W 4.10.0-rc7-dbg+ #3 Call Trace: dump_stack+0x68/0x93 __warn+0xc6/0xe0 warn_slowpath_fmt+0x4a/0x50 __list_del_entry_valid+0xbc/0xc0 wait_for_completion_timeout+0x12e/0x170 srp_send_tsk_mgmt+0x1ef/0x2d0 [ib_srp] srp_reset_device+0x5b/0x110 [ib_srp] scsi_ioctl_reset+0x1c7/0x290 scsi_ioctl+0x12a/0x420 sd_ioctl+0x9d/0x100 blkdev_ioctl+0x51e/0x9f0 block_ioctl+0x38/0x40 do_vfs_ioctl+0x8f/0x700 SyS_ioctl+0x3c/0x70 entry_SYSCALL_64_fastpath+0x18/0xad
--- drivers/infiniband/ulp/srp/ib_srp.c | 45 +++++++++++++++++++++++------------- drivers/infiniband/ulp/srp/ib_srp.h | 1 2 files changed, 30 insertions(+), 16 deletions(-)
drivers/infiniband/ulp/srp/ib_srp.c +29 -16
@@ -1884,12 +1884,17 @@ static void srp_process_rsp(struct srp_rif (unlikely (rsp->tag &SRP_TAG_TSK_MGMT )) {spin_lock_irqsave (&ch->lock, flags); ch->req_lim +=be32_to_cpu (rsp->req_lim_delta); +if (rsp->tag == ch->tsk_mgmt_tag) { + ch->tsk_mgmt_status =-1 ; +if (be32_to_cpu (rsp->resp_data_len) >=4 ) + ch->tsk_mgmt_status = rsp->data[3 ]; +complete (&ch->tsk_mgmt_done); + }else { +shost_printk (KERN_ERR , target->scsi_host, +"Received tsk mgmt response too late for tag %#llx\n" , + rsp->tag); + }spin_unlock_irqrestore (&ch->lock, flags); - - ch->tsk_mgmt_status =-1 ; -if (be32_to_cpu (rsp->resp_data_len) >=4 ) - ch->tsk_mgmt_status = rsp->data[3 ]; -complete (&ch->tsk_mgmt_done); }else { scmnd =scsi_host_find_tag (target->scsi_host, rsp->tag);if (scmnd && scmnd->host_scribble) {
@@ -2528,19 +2533,18 @@ srp_change_queue_depth(struct scsi_devic }static int srp_send_tsk_mgmt (struct srp_rdma_ch *ch,u64 req_tag,u64 lun, -u8 func) +u8 func,u8 *status) {struct srp_target_port *target = ch->target;struct srp_rport *rport = target->rport;struct ib_device *dev = target->srp_host->srp_dev->dev;struct srp_iu *iu;struct srp_tsk_mgmt *tsk_mgmt; +int res;if (!ch->connected || target->qp_in_error)return -1 ; -init_completion (&ch->tsk_mgmt_done); -/* * Lock the rport mutex to avoid that srp_create_ch_ib() is * invoked while a task management function is being sent.
@@ -2563,10 +2567,16 @@ static int srp_send_tsk_mgmt(struct srp_ tsk_mgmt->opcode =SRP_TSK_MGMT ;int_to_scsilun (lun, &tsk_mgmt->lun); - tsk_mgmt->tag = req_tag |SRP_TAG_TSK_MGMT ; tsk_mgmt->tsk_mgmt_func = func; tsk_mgmt->task_tag = req_tag; +spin_lock_irq (&ch->lock); + ch->tsk_mgmt_tag = (ch->tsk_mgmt_tag +1 ) |SRP_TAG_TSK_MGMT ; + tsk_mgmt->tag = ch->tsk_mgmt_tag; +spin_unlock_irq (&ch->lock); + +init_completion (&ch->tsk_mgmt_done); +ib_dma_sync_single_for_device (dev, iu->dma,sizeof *tsk_mgmt,DMA_TO_DEVICE );if (srp_post_send (ch, iu,sizeof (*tsk_mgmt))) {
@@ -2575,13 +2585,15 @@ static int srp_send_tsk_mgmt(struct srp_return -1 ; } + res =wait_for_completion_timeout (&ch->tsk_mgmt_done, +msecs_to_jiffies (SRP_ABORT_TIMEOUT_MS )); +if (res >0 && status) + *status = ch->tsk_mgmt_status;mutex_unlock (&rport->mutex); -if (!wait_for_completion_timeout (&ch->tsk_mgmt_done, -msecs_to_jiffies (SRP_ABORT_TIMEOUT_MS ))) -return -1 ; +WARN_ON_ONCE (res <0 ); -return 0 ; +return res >0 ?0 :-1 ; }static int srp_abort (struct scsi_cmnd *scmnd)
@@ -2607,7 +2619,7 @@ static int srp_abort(struct scsi_cmnd *sshost_printk (KERN_ERR , target->scsi_host,"Sending SRP abort for tag %#x\n" , tag);if (srp_send_tsk_mgmt (ch, tag, scmnd->device->lun, -SRP_TSK_ABORT_TASK ) ==0 ) +SRP_TSK_ABORT_TASK ,NULL ) ==0 ) ret =SUCCESS ;else if (target->rport->state ==SRP_RPORT_LOST ) ret =FAST_IO_FAIL ;
@@ -2625,14 +2637,15 @@ static int srp_reset_device(struct scsi_struct srp_target_port *target =host_to_target (scmnd->device->host);struct srp_rdma_ch *ch;int i; +u8 status;shost_printk (KERN_ERR , target->scsi_host,"SRP reset_device called\n" ); ch = &target->ch[0 ];if (srp_send_tsk_mgmt (ch,SRP_TAG_NO_REQ , scmnd->device->lun, -SRP_TSK_LUN_RESET )) +SRP_TSK_LUN_RESET , &status))return FAILED ; -if (ch->tsk_mgmt_status) +if (status)return FAILED ;for (i =0 ; i < target->ch_count; i++) {
drivers/infiniband/ulp/srp/ib_srp.h +1 -0
@@ -163,6 +163,7 @@ struct srp_rdma_ch {int max_ti_iu_len;int comp_vector; +u64 tsk_mgmt_tag;struct completion tsk_mgmt_done;u8 tsk_mgmt_status;bool connected;
Greg Kroah-Hartman
maintainerPATCH 27/75 fs: Better permission checking for submounts
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric W. Biederman <[email protected]>
commit 93faccbbfa958a9668d3ab4e30f38dd205cee8d8 upstream.
To support unprivileged users mounting filesystems two permission checks have to be performed: a test to see if the user allowed to create a mount in the mount namespace, and a test to see if the user is allowed to access the specified filesystem.
The automount case is special in that mounting the original filesystem grants permission to mount the sub-filesystems, to any user who happens to stumble across the their mountpoint and satisfies the ordinary filesystem permission checks.
Attempting to handle the automount case by using override_creds almost works. It preserves the idea that permission to mount the original filesystem is permission to mount the sub-filesystem. Unfortunately using override_creds messes up the filesystems ordinary permission checks.
Solve this by being explicit that a mount is a submount by introducing vfs_submount, and using it where appropriate.
vfs_submount uses a new mount internal mount flags MS_SUBMOUNT, to let sget and friends know that a mount is a submount so they can take appropriate action.
sget and sget_userns are modified to not perform any permission checks on submounts.
follow_automount is modified to stop using override_creds as that has proven problemantic.
do_mount is modified to always remove the new MS_SUBMOUNT flag so that we know userspace will never by able to specify it.
autofs4 is modified to stop using current_real_cred that was put in there to handle the previous version of submount permission checking.
cifs is modified to pass the mountpoint all of the way down to vfs_submount.
debugfs is modified to pass the mountpoint all of the way down to trace_automount by adding a new parameter. To make this change easier a new typedef debugfs_automount_t is introduced to capture the type of the debugfs automount function.
--- fs/afs/mntpt.c | 2 +- fs/autofs4/waitq.c | 4 ++-- fs/cifs/cifs_dfs_ref.c | 7 ++++--- fs/debugfs/inode.c | 8 ++++---- fs/namei.c | 3 --- fs/namespace.c | 17 ++++++++++++++++- fs/nfs/namespace.c | 2 +- fs/nfs/nfs4namespace.c | 2 +- fs/super.c | 13 ++++++++++--- include/linux/debugfs.h | 3 ++- include/linux/mount.h | 3 +++ include/uapi/linux/fs.h | 1 + kernel/trace/trace.c | 4 ++-- 13 files changed, 47 insertions(+), 22 deletions(-)
fs/afs/mntpt.c +1 -1
@@ -202,7 +202,7 @@ static struct vfsmount *afs_mntpt_do_aut/* try and do the mount */ _debug ("--- attempting mount %s -o %s ---" , devname, options); - mnt =vfs_kern_mount (&afs_fs_type,0 , devname, options); + mnt =vfs_submount (mntpt, &afs_fs_type, devname, options);_debug ("--- mount result %p ---" , mnt);free_page ((unsigned long ) devname);
fs/autofs4/waitq.c +2 -2
@@ -436,8 +436,8 @@ int autofs4_wait(struct autofs_sb_info *memcpy (&wq->name, &qstr,sizeof (struct qstr )); wq->dev =autofs4_get_dev (sbi); wq->ino =autofs4_get_ino (sbi); - wq->uid =current_real_cred ()->uid; - wq->gid =current_real_cred ()->gid; + wq->uid =current_cred ()->uid; + wq->gid =current_cred ()->gid; wq->pid = pid; wq->tgid = tgid; wq->status = -EINTR ;/* Status return if interrupted */
fs/cifs/cifs_dfs_ref.c +4 -3
@@ -245,7 +245,8 @@ compose_mount_options_err:* @fullpath: full path in UNC format * @ref: server's referral */ -static struct vfsmount *cifs_dfs_do_refmount (struct cifs_sb_info *cifs_sb, +static struct vfsmount *cifs_dfs_do_refmount (struct dentry *mntpt, +struct cifs_sb_info *cifs_sb,const char *fullpath,const struct dfs_info3_param *ref) {struct vfsmount *mnt;
@@ -259,7 +260,7 @@ static struct vfsmount *cifs_dfs_do_refmif (IS_ERR (mountdata))return (struct vfsmount *)mountdata; - mnt =vfs_kern_mount (&cifs_fs_type,0 , devname, mountdata); + mnt =vfs_submount (mntpt, &cifs_fs_type, devname, mountdata);kfree (mountdata);kfree (devname);return mnt;
@@ -334,7 +335,7 @@ static struct vfsmount *cifs_dfs_do_auto mnt =ERR_PTR (-EINVAL );break ; } - mnt =cifs_dfs_do_refmount (cifs_sb, + mnt =cifs_dfs_do_refmount (mntpt, cifs_sb, full_path, referrals + i);cifs_dbg (FYI ,"%s: cifs_dfs_do_refmount:%s , mnt:%p\n" , __func__, referrals[i].node_name, mnt);
fs/debugfs/inode.c +4 -4
@@ -187,9 +187,9 @@ static const struct super_operations debstatic struct vfsmount *debugfs_automount (struct path *path) { -struct vfsmount *(*f)(void *); - f = (struct vfsmount *(*)(void *))path->dentry->d_fsdata; -return f (d_inode (path->dentry)->i_private); +debugfs_automount_t f; + f = (debugfs_automount_t )path->dentry->d_fsdata; +return f (path->dentry,d_inode (path->dentry)->i_private); }static const struct dentry_operations debugfs_dops = {
@@ -504,7 +504,7 @@ EXPORT_SYMBOL_GPL(debugfs_create_dir);*/ struct dentry *debugfs_create_automount (const char *name,struct dentry *parent, -struct vfsmount *(*f)(void *), +debugfs_automount_t f,void *data) {struct dentry *dentry =start_creating (name, parent);
fs/namei.c +0 -3
@@ -1100,7 +1100,6 @@ static int follow_automount(struct path bool *need_mntput) {struct vfsmount *mnt; -const struct cred *old_cred;int err;if (!path->dentry->d_op || !path->dentry->d_op->d_automount)
@@ -1129,9 +1128,7 @@ static int follow_automount(struct pathif (nd->total_link_count >=40 )return -ELOOP ; - old_cred =override_creds (&init_cred); mnt = path->dentry->d_op->d_automount (path); -revert_creds (old_cred);if (IS_ERR (mnt)) {/* * The filesystem is allowed to return -EISDIR here to indicate
fs/namespace.c +16 -1
@@ -991,6 +991,21 @@ vfs_kern_mount(struct file_system_type * }EXPORT_SYMBOL_GPL (vfs_kern_mount); +struct vfsmount * +vfs_submount (const struct dentry *mountpoint,struct file_system_type *type, +const char *name,void *data) +{ +/* Until it is worked out how to pass the user namespace +* through from the parent mount to the submount don't support +* unprivileged mounts with submounts. +*/ +if (mountpoint->d_sb->s_user_ns != &init_user_ns) +return ERR_PTR (-EPERM ); + +return vfs_kern_mount (type,MS_SUBMOUNT , name, data); +} +EXPORT_SYMBOL_GPL (vfs_submount); +static struct mount *clone_mnt (struct mount *old,struct dentry *root,int flag) {
@@ -2804,7 +2819,7 @@ long do_mount(const char *dev_name, cons flags &= ~(MS_NOSUID |MS_NOEXEC |MS_NODEV |MS_ACTIVE |MS_BORN |MS_NOATIME |MS_NODIRATIME |MS_RELATIME |MS_KERNMOUNT | -MS_STRICTATIME |MS_NOREMOTELOCK ); +MS_STRICTATIME |MS_NOREMOTELOCK |MS_SUBMOUNT );if (flags &MS_REMOUNT ) retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags,
fs/nfs/namespace.c +1 -1
@@ -226,7 +226,7 @@ static struct vfsmount *nfs_do_clone_mouconst char *devname, struct nfs_clone_mount *mountdata) { - return vfs_kern_mount(&nfs_xdev_fs_type, 0, devname, mountdata); + return vfs_submount(mountdata->dentry, &nfs_xdev_fs_type, devname, mountdata); }/**
fs/nfs/nfs4namespace.c +1 -1
@@ -279,7 +279,7 @@ static struct vfsmount *try_location(str mountdata->hostname, mountdata->mnt_path); - mnt =vfs_kern_mount (&nfs4_referral_fs_type,0 , page, mountdata); + mnt =vfs_submount (mountdata->dentry, &nfs4_referral_fs_type, page, mountdata);if (!IS_ERR (mnt))break ; }
fs/super.c +10 -3
@@ -469,7 +469,7 @@ struct super_block *sget_userns(struct fstruct super_block *old;int err; -if (!(flags &MS_KERNMOUNT ) && +if (!(flags & (MS_KERNMOUNT |MS_SUBMOUNT )) && !(type->fs_flags &FS_USERNS_MOUNT ) && !capable (CAP_SYS_ADMIN ))return ERR_PTR (-EPERM );
@@ -499,7 +499,7 @@ retry: }if (!s) {spin_unlock (&sb_lock); - s =alloc_super (type, flags, user_ns); + s =alloc_super (type, (flags & ~MS_SUBMOUNT ), user_ns);if (!s)return ERR_PTR (-ENOMEM ); goto retry;
@@ -540,8 +540,15 @@ struct super_block *sget(struct file_sys {struct user_namespace *user_ns =current_user_ns (); +/* We don't yet pass the user namespace of the parent +* mount through to here so always use &init_user_ns +* until that changes. +*/ +if (flags &MS_SUBMOUNT ) + user_ns = &init_user_ns; +/* Ensure the requestor has permissions over the target filesystem */ -if (!(flags &MS_KERNMOUNT ) && !ns_capable (user_ns,CAP_SYS_ADMIN )) +if (!(flags & (MS_KERNMOUNT |MS_SUBMOUNT )) && !ns_capable (user_ns,CAP_SYS_ADMIN ))return ERR_PTR (-EPERM );return sget_userns (type, test, set, flags, user_ns, data);
include/linux/debugfs.h +2 -1
@@ -97,9 +97,10 @@ struct dentry *debugfs_create_dir(conststruct dentry *debugfs_create_symlink (const char *name,struct dentry *parent,const char *dest); +typedef struct vfsmount *(*debugfs_automount_t )(struct dentry *,void *);struct dentry *debugfs_create_automount (const char *name,struct dentry *parent, -struct vfsmount *(*f)(void *), +debugfs_automount_t f,void *data);void debugfs_remove (struct dentry *dentry);
include/linux/mount.h +3 -0
@@ -90,6 +90,9 @@ struct file_system_type;extern struct vfsmount *vfs_kern_mount (struct file_system_type *type,int flags,const char *name,void *data); +extern struct vfsmount *vfs_submount (const struct dentry *mountpoint, +struct file_system_type *type, +const char *name,void *data);extern void mnt_set_expiry (struct vfsmount *mnt,struct list_head *expiry_list);extern void mark_mounts_for_expiry (struct list_head *mounts);
include/uapi/linux/fs.h +1 -0
@@ -132,6 +132,7 @@ struct inodes_stat_t {#define MS_LAZYTIME (1<<25)/* Update the on-disk [acm]times lazily */ /* These sb flags are internal to the kernel */ +#define MS_SUBMOUNT (1<<26)#define MS_NOREMOTELOCK (1<<27)#define MS_NOSEC (1<<28)#define MS_BORN (1<<29)
kernel/trace/trace.c +2 -2
@@ -7503,7 +7503,7 @@ init_tracer_tracefs(struct trace_array *ftrace_init_tracefs (tr, d_tracer); } -static struct vfsmount *trace_automount (void *ingore) +static struct vfsmount *trace_automount (struct dentry *mntpt,void *ingore) {struct vfsmount *mnt;struct file_system_type *type;
@@ -7516,7 +7516,7 @@ static struct vfsmount *trace_automount( type =get_fs_type ("tracefs" );if (!type)return NULL ; - mnt =vfs_kern_mount (type,0 ,"tracefs" ,NULL ); + mnt =vfs_submount (mntpt, type,"tracefs" ,NULL );put_filesystem (type);if (IS_ERR (mnt))return NULL ;
Greg Kroah-Hartman
maintainerPATCH 28/75 Btrfs: fix data loss after truncate when using the no-holes feature
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
commit 76b42abbf7488121c4f9f1ea5941123306e25d99 upstream.
If we have a file with an implicit hole (NO_HOLES feature enabled) that has an extent following the hole, delayed writes against regions of the file behind the hole happened before but were not yet flushed and then we truncate the file to a smaller size that lies inside the hole, we end up persisting a wrong disk_i_size value for our inode that leads to data loss after umounting and mounting again the filesystem or after the inode is evicted and loaded again.
This happens because at inode.c:btrfs_truncate_inode_items() we end up setting last_size to the offset of the extent that we deleted and that followed the hole. We then pass that value to btrfs_ordered_update_i_size() which updates the inode's disk_i_size to a value smaller then the offset of the buffered (delayed) writes.
Example reproducer:
$ mkfs.btrfs -f /dev/sdb $ mount /dev/sdb /mnt
$ xfs_io -f -c "pwrite -S 0x01 0K 32K" /mnt/foo $ xfs_io -d -c "pwrite -S 0x02 -b 32K 64K 32K" /mnt/foo $ xfs_io -c "truncate 60K" /mnt/foo --> inode's disk_i_size updated to 0
$ md5sum /mnt/foo 3c5ca3c3ab42f4b04d7e7eb0b0d4d806 /mnt/foo
$ umount /dev/sdb $ mount /dev/sdb /mnt
$ md5sum /mnt/foo d41d8cd98f00b204e9800998ecf8427e /mnt/foo --> Empty file, all data lost!
--- fs/btrfs/inode.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)
fs/btrfs/inode.c +6 -13
@@ -4502,19 +4502,8 @@ search_again:if (found_type > min_type) { del_item =1 ; }else { -if (item_end < new_size) { -/* -* With NO_HOLES mode, for the following mapping -* -* [0-4k][hole][8k-12k] -* -* if truncating isize down to 6k, it ends up -* isize being 8k. -*/ -if (btrfs_fs_incompat (root->fs_info,NO_HOLES )) - last_size = new_size; +if (item_end < new_size)break ; - }if (found_key.offset >= new_size) del_item =1 ;else
@@ -4697,8 +4686,12 @@ out:btrfs_abort_transaction (trans, ret); } error: -if (root->root_key.objectid !=BTRFS_TREE_LOG_OBJECTID ) +if (root->root_key.objectid !=BTRFS_TREE_LOG_OBJECTID ) { +ASSERT (last_size >= new_size); +if (!err && last_size > new_size) + last_size = new_size;btrfs_ordered_update_i_size (inode, last_size,NULL ); + }btrfs_free_path (path);
Greg Kroah-Hartman
maintainerPATCH 29/75 orangefs: Use RCU for destroy_inode
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
commit 0695d7dc1d9f19b82ec2cae24856bddce278cfe6 upstream.
freeing of inodes must be RCU-delayed on all filesystems
--- fs/orangefs/super.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
fs/orangefs/super.c +8 -1
@@ -115,6 +115,13 @@ static struct inode *orangefs_alloc_inodreturn &orangefs_inode->vfs_inode; } +static void orangefs_i_callback (struct rcu_head *head) +{ + struct inode *inode = container_of(head, struct inode, i_rcu); +struct orangefs_inode_s *orangefs_inode =ORANGEFS_I (inode); +kmem_cache_free (orangefs_inode_cache, orangefs_inode); +} +static void orangefs_destroy_inode (struct inode *inode) {struct orangefs_inode_s *orangefs_inode =ORANGEFS_I (inode);
@@ -123,7 +130,7 @@ static void orangefs_destroy_inode(struc"%s: deallocated %p destroying inode %pU\n" , __func__, orangefs_inode, get_khandle_from_ino(inode)); -kmem_cache_free (orangefs_inode_cache, orangefs_inode); +call_rcu (&inode->i_rcu, orangefs_i_callback); }/*
Greg Kroah-Hartman
maintainerPATCH 30/75 memory/atmel-ebi: Fix ns <-> cycles conversions
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Brezillon <[email protected]>
commit ee194289502a6901cc77dc9a893bf2afd351ac5e upstream.
at91sam9_ebi_get_config() is incorrectly converting timings in clock cycles into timings in nanoseconds by multiplying the cycle values by the clk rate instead of the clk period.
at91sam9_ebi_xslate_config() has the same problem for the tdf_ns -> tdf_cycles conversion.
--- drivers/memory/atmel-ebi.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-)
drivers/memory/atmel-ebi.c +14 -13
@@ -93,7 +93,7 @@ static void at91sam9_ebi_get_config(stru struct at91_ebi_dev_config *conf) {struct at91sam9_smc_generic_fields *fields = &ebid->ebi->sam9; -unsigned int clk_rate =clk_get_rate (ebid->ebi->clk); +unsigned int clk_period =NSEC_PER_SEC /clk_get_rate (ebid->ebi->clk);struct at91sam9_ebi_dev_config *config = &conf->sam9;struct at91sam9_smc_timings *timings = &config->timings;unsigned int val;
@@ -102,43 +102,43 @@ static void at91sam9_ebi_get_config(stru config->mode = val & ~AT91_SMC_TDF ; val = (val &AT91_SMC_TDF ) >>16 ; - timings->tdf_ns = clk_rate * val; + timings->tdf_ns = clk_period * val;regmap_fields_read (fields->setup, conf->cs, &val); timings->ncs_rd_setup_ns = (val >>24 ) &0x1f ; timings->ncs_rd_setup_ns += ((val >>29 ) &0x1 ) *128 ; - timings->ncs_rd_setup_ns *= clk_rate; + timings->ncs_rd_setup_ns *= clk_period; timings->nrd_setup_ns = (val >>16 ) &0x1f ; timings->nrd_setup_ns += ((val >>21 ) &0x1 ) *128 ; - timings->nrd_setup_ns *= clk_rate; + timings->nrd_setup_ns *= clk_period; timings->ncs_wr_setup_ns = (val >>8 ) &0x1f ; timings->ncs_wr_setup_ns += ((val >>13 ) &0x1 ) *128 ; - timings->ncs_wr_setup_ns *= clk_rate; + timings->ncs_wr_setup_ns *= clk_period; timings->nwe_setup_ns = val &0x1f ; timings->nwe_setup_ns += ((val >>5 ) &0x1 ) *128 ; - timings->nwe_setup_ns *= clk_rate; + timings->nwe_setup_ns *= clk_period;regmap_fields_read (fields->pulse, conf->cs, &val); timings->ncs_rd_pulse_ns = (val >>24 ) &0x3f ; timings->ncs_rd_pulse_ns += ((val >>30 ) &0x1 ) *256 ; - timings->ncs_rd_pulse_ns *= clk_rate; + timings->ncs_rd_pulse_ns *= clk_period; timings->nrd_pulse_ns = (val >>16 ) &0x3f ; timings->nrd_pulse_ns += ((val >>22 ) &0x1 ) *256 ; - timings->nrd_pulse_ns *= clk_rate; + timings->nrd_pulse_ns *= clk_period; timings->ncs_wr_pulse_ns = (val >>8 ) &0x3f ; timings->ncs_wr_pulse_ns += ((val >>14 ) &0x1 ) *256 ; - timings->ncs_wr_pulse_ns *= clk_rate; + timings->ncs_wr_pulse_ns *= clk_period; timings->nwe_pulse_ns = val &0x3f ; timings->nwe_pulse_ns += ((val >>6 ) &0x1 ) *256 ; - timings->nwe_pulse_ns *= clk_rate; + timings->nwe_pulse_ns *= clk_period;regmap_fields_read (fields->cycle, conf->cs, &val); timings->nrd_cycle_ns = (val >>16 ) &0x7f ; timings->nrd_cycle_ns += ((val >>23 ) &0x3 ) *256 ; - timings->nrd_cycle_ns *= clk_rate; + timings->nrd_cycle_ns *= clk_period; timings->nwe_cycle_ns = val &0x7f ; timings->nwe_cycle_ns += ((val >>7 ) &0x3 ) *256 ; - timings->nwe_cycle_ns *= clk_rate; + timings->nwe_cycle_ns *= clk_period; } static int at91_xlate_timing(struct device_node *np, const char *prop,
@@ -334,6 +334,7 @@ static int at91sam9_ebi_apply_config(str struct at91_ebi_dev_config *conf) {unsigned int clk_rate =clk_get_rate (ebid->ebi->clk); +unsigned int clk_period =NSEC_PER_SEC / clk_rate;struct at91sam9_ebi_dev_config *config = &conf->sam9;struct at91sam9_smc_timings *timings = &config->timings;struct at91sam9_smc_generic_fields *fields = &ebid->ebi->sam9;
@@ -376,7 +377,7 @@ static int at91sam9_ebi_apply_config(str val |=AT91SAM9_SMC_NWECYCLE (coded_val);regmap_fields_write (fields->cycle, conf->cs, val); - val =DIV_ROUND_UP (timings->tdf_ns, clk_rate); + val =DIV_ROUND_UP (timings->tdf_ns, clk_period);if (val >AT91_SMC_TDF_MAX ) val =AT91_SMC_TDF_MAX ; regmap_fields_write(fields->mode, conf->cs,
Greg Kroah-Hartman
maintainerPATCH 31/75 tracing: Fix return value check in trace_benchmark_reg()
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Yongjun <[email protected]>
commit 8f0994bb8cbde5452e58ce0cacdbf6cb58079d01 upstream.
In case of error, the function kthread_run() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().
--- kernel/trace/trace_benchmark.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_benchmark.c +2 -2
@@ -175,9 +175,9 @@ int trace_benchmark_reg(void) bm_event_thread =kthread_run (benchmark_event_kthread,NULL ,"event_benchmark" ); -if (!bm_event_thread) { +if (IS_ERR (bm_event_thread)) {pr_warning ("trace benchmark failed to create kernel thread\n" ); -return -ENOMEM ; +return PTR_ERR (bm_event_thread); }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 32/75 ktest: Fix child exit code processing
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt (VMware) <[email protected]>
commit 32677207dcc5e594254b7fb4fb2352b1755b1d5b upstream.
The child_exit errno needs to be shifted by 8 bits to compare against the return values for the bisect variables.
--- tools/testing/ktest/ktest.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/ktest/ktest.pl +1 -1
@@ -2629,7 +2629,7 @@ sub do_run_test { } waitpid $child_pid, 0; - $child_exit = $?; + $child_exit = $? >> 8; my $end_time = time; $test_time = $end_time - $start_time;
Greg Kroah-Hartman
maintainerPATCH 33/75 ceph: remove req from unsafe list when unregistering it
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <[email protected]>
commit df963ea8a082d31521a120e8e31a29ad8a1dc215 upstream.
There's no reason a request should ever be on a s_unsafe list but not in the request tree.
--- fs/ceph/mds_client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/ceph/mds_client.c +3 -2
@@ -628,6 +628,9 @@ static void __unregister_request(struct {dout ("__unregister_request %p tid %lld\n" , req, req->r_tid); +/* Never leave an unregistered request on an unsafe list! */ +list_del_init (&req->r_unsafe_item); +if (req->r_tid == mdsc->oldest_tid) {struct rb_node *p =rb_next (&req->r_node); mdsc->oldest_tid =0 ;
@@ -1036,7 +1039,6 @@ static void cleanup_session_requests(strwhile (!list_empty (&session->s_unsafe)) { req =list_first_entry (&session->s_unsafe, struct ceph_mds_request, r_unsafe_item); -list_del_init (&req->r_unsafe_item);pr_warn_ratelimited (" dropping unsafe request %llu\n" , req->r_tid);__unregister_request (mdsc, req);
@@ -2437,7 +2439,6 @@ static void handle_reply(struct ceph_mds* useful we could do with a revised return value. */ dout ("got safe reply %llu, mds%d\n" , tid, mds); -list_del_init (&req->r_unsafe_item);/* last unsafe request during umount? */ if (mdsc->stopping && !__get_oldest_req (mdsc))
Greg Kroah-Hartman
maintainerPATCH 34/75 pci/hotplug/pnv-php: Remove WARN_ON() in pnv_php_put_slot()
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gavin Shan <[email protected]>
commit 36c7c9da40c408a71e5e6bfe12e57dcf549a296d upstream.
The WARN_ON() causes unnecessary backtrace when putting the parent slot, which is likely to be NULL.
WARNING: CPU: 2 PID: 1071 at drivers/pci/hotplug/pnv_php.c:85 \
pnv_php_release+0xcc/0x150 [pnv_php]
:
Call Trace:
[c0000003bc007c10] [d00000000ad613c4] pnv_php_release+0x144/0x150 [pnv_php]
[c0000003bc007c40] [c0000000006641d8] pci_hp_deregister+0x238/0x330
[c0000003bc007cd0] [d00000000ad61440] pnv_php_unregister_one+0x70/0xa0 [pnv_php]
[c0000003bc007d10] [d00000000ad614c0] pnv_php_unregister+0x50/0x80 [pnv_php]
[c0000003bc007d40] [d00000000ad61e84] pnv_php_exit+0x50/0xcb4 [pnv_php]
[c0000003bc007d70] [c00000000019499c] SyS_delete_module+0x1fc/0x2a0
[c0000003bc007e30] [c00000000000b184] system_call+0x38/0xe0--- drivers/pci/hotplug/pnv_php.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/hotplug/pnv_php.c +1 -1
@@ -82,7 +82,7 @@ static void pnv_php_free_slot(struct krestatic inline void pnv_php_put_slot (struct pnv_php_slot *php_slot) { -if (WARN_ON (!php_slot)) +if (!php_slot)return ;kref_put (&php_slot->kref, pnv_php_free_slot);
Greg Kroah-Hartman
maintainerPATCH 35/75 pci/hotplug/pnv-php: Disable surprise hotplug capability on conflicts
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gavin Shan <[email protected]>
commit 303529d6ef1293513c2c73c9ab86489eebb37d08 upstream.
The root port or PCIe switch downstream port might have been associated with driver other than pnv-php. The MSI or MSIx might also have been enabled by that driver (e.g. pcieport_drv). Attempt to enable MSI incurs below backtrace:
PowerPC PowerNV PCI Hotplug Driver version: 0.1
------------[ cut here ]------------
WARNING: CPU: 19 PID: 1004 at drivers/pci/msi.c:1071 \
__pci_enable_msi_range+0x84/0x4e0
NIP [c000000000665c34] __pci_enable_msi_range+0x84/0x4e0
LR [c000000000665c24] __pci_enable_msi_range+0x74/0x4e0
Call Trace:
[c000000384d67600] [c000000000665c24] __pci_enable_msi_range+0x74/0x4e0
[c000000384d676e0] [d00000000aa31b04] pnv_php_register+0x564/0x5a0 [pnv_php]
[c000000384d677c0] [d00000000aa31658] pnv_php_register+0xb8/0x5a0 [pnv_php]
[c000000384d678a0] [d00000000aa31658] pnv_php_register+0xb8/0x5a0 [pnv_php]
[c000000384d67980] [d00000000aa31dfc] pnv_php_init+0x60/0x98 [pnv_php]
[c000000384d679f0] [c00000000000cfdc] do_one_initcall+0x6c/0x1d0
[c000000384d67ab0] [c000000000b92354] do_init_module+0x94/0x254
[c000000384d67b40] [c00000000019719c] load_module+0x258c/0x2c60
[c000000384d67d30] [c000000000197bb0] SyS_finit_module+0xf0/0x170
[c000000384d67e30] [c00000000000b184] system_call+0x38/0xe0This fixes the issue by skipping enabling the surprise hotplug capability if the MSI or MSIx on the PCI slot's upstream port has been enabled by other driver.
--- drivers/pci/hotplug/pnv_php.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/pci/hotplug/pnv_php.c +8 -0
@@ -799,6 +799,14 @@ static void pnv_php_enable_irq(struct pnstruct pci_dev *pdev = php_slot->pdev;int irq, ret; +/* +* The MSI/MSIx interrupt might have been occupied by other +* drivers. Don't populate the surprise hotplug capability +* in that case. +*/ +if (pci_dev_msi_enabled (pdev)) +return ; + ret =pci_enable_device (pdev);if (ret) {dev_warn (&pdev->dev,"Error %d enabling device\n" , ret);
Greg Kroah-Hartman
maintainerPATCH 36/75 target: Fix NULL dereference during LUN lookup + active I/O shutdown
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <[email protected]>
commit bd4e2d2907fa23a11d46217064ecf80470ddae10 upstream.
When transport_clear_lun_ref() is shutting down a se_lun via configfs with new I/O in-flight, it's possible to trigger a NULL pointer dereference in transport_lookup_cmd_lun() due to the fact percpu_ref_get() doesn't do any __PERCPU_REF_DEAD checking before incrementing lun->lun_ref.count after lun->lun_ref has switched to atomic_t mode.
This results in a NULL pointer dereference as LUN shutdown code in core_tpg_remove_lun() continues running after the existing ->release() -> core_tpg_lun_ref_release() callback completes, and clears the RCU protected se_lun->lun_se_dev pointer.
During the OOPs, the state of lun->lun_ref in the process which triggered the NULL pointer dereference looks like the following on v4.1.y stable code:
struct se_lun {
lun_link_magic = 4294932337,
lun_status = TRANSPORT_LUN_STATUS_FREE,
.....
lun_se_dev = 0x0,
lun_sep = 0x0,
.....
lun_ref = {
count = {
counter = 1
},
percpu_count_ptr = 3,
release = 0xffffffffa02fa1e0 <core_tpg_lun_ref_release>,
confirm_switch = 0x0,
force_atomic = false,
rcu = {
next = 0xffff88154fa1a5d0,
func = 0xffffffff8137c4c0 <percpu_ref_switch_to_atomic_rcu>
} }
}
To address this bug, use percpu_ref_tryget_live() to ensure once __PERCPU_REF_DEAD is visable on all CPUs and ->lun_ref has switched to atomic_t, all new I/Os will fail to obtain a new lun->lun_ref reference.
Also use an explicit percpu_ref_kill_and_confirm() callback to block on ->lun_ref_comp to allow the first stage and associated RCU grace period to complete, and then block on ->lun_ref_shutdown waiting for the final percpu_ref_put() to drop the last reference via transport_lun_remove_cmd() before continuing with core_tpg_remove_lun() shutdown.
--- drivers/target/target_core_device.c | 10 ++++++++-- drivers/target/target_core_tpg.c | 3 ++- drivers/target/target_core_transport.c | 31 ++++++++++++++++++++++++++++++- include/target/target_core_base.h | 1 + 4 files changed, 41 insertions(+), 4 deletions(-)
drivers/target/target_core_device.c +8 -2
@@ -78,12 +78,16 @@ transport_lookup_cmd_lun(struct se_cmd * &deve->read_bytes); se_lun =rcu_dereference (deve->se_lun); + +if (!percpu_ref_tryget_live (&se_lun->lun_ref)) { + se_lun =NULL ; + goto out_unlock; + } + se_cmd->se_lun =rcu_dereference (deve->se_lun); se_cmd->pr_res_key = deve->pr_res_key; se_cmd->orig_fe_lun = unpacked_lun; se_cmd->se_cmd_flags |=SCF_SE_LUN_CMD ; - -percpu_ref_get (&se_lun->lun_ref); se_cmd->lun_ref_active = true; if ((se_cmd->data_direction == DMA_TO_DEVICE) &&
@@ -97,6 +101,7 @@ transport_lookup_cmd_lun(struct se_cmd * goto ref_dev; } } +out_unlock:rcu_read_unlock ();if (!se_lun) {
@@ -816,6 +821,7 @@ struct se_device *target_alloc_device(st xcopy_lun = &dev->xcopy_lun;rcu_assign_pointer (xcopy_lun->lun_se_dev, dev);init_completion (&xcopy_lun->lun_ref_comp); +init_completion (&xcopy_lun->lun_shutdown_comp);INIT_LIST_HEAD (&xcopy_lun->lun_deve_list);INIT_LIST_HEAD (&xcopy_lun->lun_dev_link);mutex_init (&xcopy_lun->lun_tg_pt_md_mutex);
drivers/target/target_core_tpg.c +2 -1
@@ -445,7 +445,7 @@ static void core_tpg_lun_ref_release(str { struct se_lun *lun = container_of(ref, struct se_lun, lun_ref); -complete (&lun->lun_ref_comp); +complete (&lun->lun_shutdown_comp); } int core_tpg_register(
@@ -571,6 +571,7 @@ struct se_lun *core_tpg_alloc_lun( lun->lun_link_magic =SE_LUN_LINK_MAGIC ;atomic_set (&lun->lun_acl_count,0 );init_completion (&lun->lun_ref_comp); +init_completion (&lun->lun_shutdown_comp);INIT_LIST_HEAD (&lun->lun_deve_list);INIT_LIST_HEAD (&lun->lun_dev_link);atomic_set (&lun->lun_tg_pt_secondary_offline,0 );
drivers/target/target_core_transport.c +30 -1
@@ -2706,10 +2706,39 @@ void target_wait_for_sess_cmds(struct se }EXPORT_SYMBOL (target_wait_for_sess_cmds); +static void target_lun_confirm (struct percpu_ref *ref) +{ + struct se_lun *lun = container_of(ref, struct se_lun, lun_ref); + +complete (&lun->lun_ref_comp); +} +void transport_clear_lun_ref (struct se_lun *lun) { -percpu_ref_kill (&lun->lun_ref); +/* +* Mark the percpu-ref as DEAD, switch to atomic_t mode, drop +* the initial reference and schedule confirm kill to be +* executed after one full RCU grace period has completed. +*/ +percpu_ref_kill_and_confirm (&lun->lun_ref, target_lun_confirm); +/* +* The first completion waits for percpu_ref_switch_to_atomic_rcu() +* to call target_lun_confirm after lun->lun_ref has been marked +* as __PERCPU_REF_DEAD on all CPUs, and switches to atomic_t +* mode so that percpu_ref_tryget_live() lookup of lun->lun_ref +* fails for all new incoming I/O. +*/ wait_for_completion (&lun->lun_ref_comp); +/* +* The second completion waits for percpu_ref_put_many() to +* invoke ->release() after lun->lun_ref has switched to +* atomic_t mode, and lun->lun_ref.count has reached zero. +* +* At this point all target-core lun->lun_ref references have +* been dropped via transport_lun_remove_cmd(), and it's safe +* to proceed with the remaining LUN shutdown. +*/ +wait_for_completion (&lun->lun_shutdown_comp); } static bool
include/target/target_core_base.h +1 -0
@@ -732,6 +732,7 @@ struct se_lun {struct config_group lun_group;struct se_port_stat_grps port_stat_grps;struct completion lun_ref_comp; +struct completion lun_shutdown_comp;struct percpu_ref lun_ref;struct list_head lun_dev_link;struct hlist_node link;
Greg Kroah-Hartman
maintainerPATCH 37/75 drivers/pci/hotplug: Handle presence detection change properly
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gavin Shan <[email protected]>
commit d7d55536c6cd1f80295b6d7483ad0587b148bde4 upstream.
The surprise hotplug is driven by interrupt in PowerNV PCI hotplug driver. In the interrupt handler, pnv_php_interrupt(), we bail when pnv_pci_get_presence_state() returns zero wrongly. It causes the presence change event is always ignored incorrectly.
This fixes the issue by bailing on error (non-zero value) returned from pnv_pci_get_presence_state().
--- drivers/pci/hotplug/pnv_php.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/pci/hotplug/pnv_php.c +5 -1
@@ -713,8 +713,12 @@ static irqreturn_t pnv_php_interrupt(int added = !!(lsts &PCI_EXP_LNKSTA_DLLLA ); }else if (sts &PCI_EXP_SLTSTA_PDC ) { ret =pnv_pci_get_presence_state (php_slot->id, &presence); -if (!ret) +if (ret) { +dev_warn (&pdev->dev,"PCI slot [%s] error %d getting presence (0x%04x), to retry the operation.\n" , + php_slot->name, ret, sts);return IRQ_HANDLED ; + } + added = !!(presence ==OPAL_PCI_SLOT_PRESENT ); }else {return IRQ_NONE ;
Greg Kroah-Hartman
maintainerPATCH 38/75 drivers/pci/hotplug: Fix initial state for empty slot
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gavin Shan <[email protected]>
commit d0c424971f70501ec0a0364117b9934db039c9cc upstream.
In PowerNV PCI hotplug driver, the initial PCI slot's state is set to PNV_PHP_STATE_POPULATED if no PCI devices are connected to the slot. The PCI devices that are hot added to the slot won't be probed and populated because of the check in pnv_php_enable():
/* Check if the slot has been configured */
if (php_slot->state != PNV_PHP_STATE_REGISTERED)
return 0;This fixes the issue by leaving the slot in PNV_PHP_STATE_REGISTERED state initially if nothing is connected to the slot.
--- drivers/pci/hotplug/pnv_php.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/pci/hotplug/pnv_php.c +14 -2
@@ -436,9 +436,21 @@ static int pnv_php_enable(struct pnv_phpif (ret)return ret; -/* Proceed if there have nothing behind the slot */ -if (presence ==OPAL_PCI_SLOT_EMPTY ) +/* +* Proceed if there have nothing behind the slot. However, +* we should leave the slot in registered state at the +* beginning. Otherwise, the PCI devices inserted afterwards +* won't be probed and populated. +*/ +if (presence ==OPAL_PCI_SLOT_EMPTY ) { +if (!php_slot->power_state_check) { + php_slot->power_state_check = true; + +return 0 ; + } + goto scan; + }/* * If the power supply to the slot is off, we can't detect
Greg Kroah-Hartman
maintainerPATCH 39/75 nlm: Ensure callback code also checks that the files match
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
commit 251af29c320d86071664f02c76f0d063a19fefdf upstream.
It is not sufficient to just check that the lock pids match when granting a callback, we also need to ensure that we're granting the callback on the right file.
--- include/linux/lockd/lockd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/lockd/lockd.h +2 -1
@@ -355,7 +355,8 @@ static inline int nlm_privileged_requeststatic inline int nlm_compare_locks (const struct file_lock *fl1,const struct file_lock *fl2) { -return fl1->fl_pid == fl2->fl_pid +return file_inode (fl1->fl_file) ==file_inode (fl2->fl_file) + && fl1->fl_pid == fl2->fl_pid && fl1->fl_owner == fl2->fl_owner && fl1->fl_start == fl2->fl_start && fl1->fl_end == fl2->fl_end
Greg Kroah-Hartman
maintainerPATCH 40/75 pwm: pca9685: Fix period change with same duty cycle
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Gruber <[email protected]>
commit 8d254a340efb12b40c4c1ff25a48a4f48f7bbd6b upstream.
When first implementing support for changing the output frequency, an optimization was added to continue the PWM after changing the prescaler without having to reprogram the ON and OFF registers for the duty cycle, in case the duty cycle stayed the same. This was flawed, because we compared the absolute value of the duty cycle in nanoseconds instead of the ratio to the period.
Fix the problem by removing the shortcut.
--- drivers/pwm/pwm-pca9685.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/pwm/pwm-pca9685.c +0 -11
@@ -65,7 +65,6 @@#define PCA9685_MAXCHAN 0x10#define LED_FULL (1 << 4) -#define MODE1_RESTART (1 << 7)#define MODE1_SLEEP (1 << 4)#define MODE2_INVRT (1 << 4)#define MODE2_OUTDRV (1 << 2)
@@ -117,16 +116,6 @@ static int pca9685_pwm_config(struct pwmudelay (500 ); pca->period_ns = period_ns; - -/* -* If the duty cycle did not change, restart PWM with -* the same duty cycle to period ratio and return. -*/ -if (duty_ns == pca->duty_ns) { -regmap_update_bits (pca->regmap,PCA9685_MODE1 , -MODE1_RESTART ,0x1 ); -return 0 ; - } }else {dev_err (chip->dev,"prescaler not set: period out of bounds!\n" );
Greg Kroah-Hartman
maintainerPATCH 41/75 xtensa: move parse_tag_fdt out of #ifdef CONFIG_BLK_DEV_INITRD
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Filippov <[email protected]>
commit 4ab18701c66552944188dbcd0ce0012729baab84 upstream.
FDT tag parsing is not related to whether BLK_DEV_INITRD is configured or not, move it out of the corresponding #ifdef/#endif block. This fixes passing external FDT to the kernel configured w/o BLK_DEV_INITRD support.
--- arch/xtensa/kernel/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/xtensa/kernel/setup.c +2 -2
@@ -126,6 +126,8 @@ static int __init parse_tag_initrd(const__tagtable (BP_TAG_INITRD , parse_tag_initrd); +#endif /* CONFIG_BLK_DEV_INITRD */ +#ifdef CONFIG_OF static int __init parse_tag_fdt (const bp_tag_t *tag)
@@ -138,8 +140,6 @@ __tagtable(BP_TAG_FDT, parse_tag_fdt);#endif /* CONFIG_OF */ -#endif /* CONFIG_BLK_DEV_INITRD */ -static int __init parse_tag_cmdline (const bp_tag_t * tag) {strlcpy (command_line, (char *)(tag->data),COMMAND_LINE_SIZE );
Greg Kroah-Hartman
maintainerPATCH 42/75 nfit, libnvdimm: fix interleave set cookie calculation
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit 86ef58a4e35e8fa66afb5898cf6dec6a3bb29f67 upstream.
The interleave-set cookie is a sum that sanity checks the composition of an interleave set has not changed from when the namespace was initially created. The checksum is calculated by sorting the DIMMs by their location in the interleave-set. The comparison for the sort must be 64-bit wide, not byte-by-byte as performed by memcmp() in the broken case.
Fix the implementation to accept correct cookie values in addition to the Linux "memcmp" order cookies, but only allow correct cookies to be generated going forward. It does mean that namespaces created by third-party-tooling, or created by newer kernels with this fix, will not validate on older kernels. However, there are a couple mitigating conditions:
1/ platforms with namespace-label capable NVDIMMs are not widely
available.
2/ interleave-sets with a single-dimm are by definition not affected
(nothing to sort). This covers the QEMU-KVM NVDIMM emulation case.
The cookie stored in the namespace label will be fixed by any write the namespace label, the most straightforward way to achieve this is to write to the "alt_name" attribute of a namespace in sysfs.
--- drivers/acpi/nfit/core.c | 16 +++++++++++++++- drivers/nvdimm/namespace_devs.c | 18 ++++++++++++++---- drivers/nvdimm/nd.h | 1 + drivers/nvdimm/region_devs.c | 9 +++++++++ include/linux/libnvdimm.h | 2 ++ 5 files changed, 41 insertions(+), 5 deletions(-)
drivers/acpi/nfit/core.c +15 -1
@@ -1603,7 +1603,7 @@ static size_t sizeof_nfit_set_info(int n + num_mappings *sizeof (struct nfit_set_info_map ); } -static int cmp_map (const void *m0,const void *m1) +static int cmp_map_compat (const void *m0,const void *m1) {const struct nfit_set_info_map *map0 = m0;const struct nfit_set_info_map *map1 = m1;
@@ -1612,6 +1612,14 @@ static int cmp_map(const void *m0, const sizeof(u64)); } +static int cmp_map (const void *m0,const void *m1) +{ +const struct nfit_set_info_map *map0 = m0; +const struct nfit_set_info_map *map1 = m1; + +return map0->region_offset - map1->region_offset; +} +/* Retrieve the nth entry referencing this spa */ static struct acpi_nfit_memory_map *memdev_from_spa (struct acpi_nfit_desc *acpi_desc,u16 range_index,int n)
@@ -1667,6 +1675,12 @@ static int acpi_nfit_init_interleave_setsort (&info->mapping[0 ], nr,sizeof (struct nfit_set_info_map ), cmp_map,NULL ); nd_set->cookie =nd_fletcher64 (info,sizeof_nfit_set_info (nr),0 ); + +/* support namespaces created with the wrong sort order */ +sort (&info->mapping[0 ], nr,sizeof (struct nfit_set_info_map ), + cmp_map_compat,NULL ); + nd_set->altcookie =nd_fletcher64 (info,sizeof_nfit_set_info (nr),0 ); + ndr_desc->nd_set = nd_set;devm_kfree (dev, info);
drivers/nvdimm/namespace_devs.c +14 -4
@@ -1700,6 +1700,7 @@ static int select_pmem_id(struct nd_registruct device *create_namespace_pmem (struct nd_region *nd_region,struct nd_namespace_label *nd_label) { +u64 altcookie =nd_region_interleave_set_altcookie (nd_region);u64 cookie =nd_region_interleave_set_cookie (nd_region);struct nd_label_ent *label_ent;struct nd_namespace_pmem *nspm;
@@ -1718,7 +1719,11 @@ struct device *create_namespace_pmem(strif (__le64_to_cpu (nd_label->isetcookie) != cookie) {dev_dbg (&nd_region->dev,"invalid cookie in label: %pUb\n" , nd_label->uuid); -return ERR_PTR (-EAGAIN ); +if (__le64_to_cpu (nd_label->isetcookie) != altcookie) +return ERR_PTR (-EAGAIN ); + +dev_dbg (&nd_region->dev,"valid altcookie in label: %pUb\n" , + nd_label->uuid); } nspm =kzalloc (sizeof (*nspm),GFP_KERNEL );
@@ -1733,9 +1738,14 @@ struct device *create_namespace_pmem(str res->name =dev_name (&nd_region->dev); res->flags =IORESOURCE_MEM ; -for (i =0 ; i < nd_region->ndr_mappings; i++) -if (!has_uuid_at_pos (nd_region, nd_label->uuid, cookie, i)) -break ; +for (i =0 ; i < nd_region->ndr_mappings; i++) { +if (has_uuid_at_pos (nd_region, nd_label->uuid, cookie, i)) +continue ; +if (has_uuid_at_pos (nd_region, nd_label->uuid, altcookie, i)) +continue ; +break ; + } +if (i < nd_region->ndr_mappings) {struct nvdimm_drvdata *ndd =to_ndd (&nd_region->mapping[i]);
drivers/nvdimm/nd.h +1 -0
@@ -328,6 +328,7 @@ struct nd_region *to_nd_region(struct deint nd_region_to_nstype (struct nd_region *nd_region);int nd_region_register_namespaces (struct nd_region *nd_region,int *err);u64 nd_region_interleave_set_cookie (struct nd_region *nd_region); +u64 nd_region_interleave_set_altcookie (struct nd_region *nd_region);void nvdimm_bus_lock (struct device *dev);void nvdimm_bus_unlock (struct device *dev);bool is_nvdimm_bus_locked (struct device *dev);
drivers/nvdimm/region_devs.c +9 -0
@@ -505,6 +505,15 @@ u64 nd_region_interleave_set_cookie(strureturn 0 ; } +u64 nd_region_interleave_set_altcookie (struct nd_region *nd_region) +{ +struct nd_interleave_set *nd_set = nd_region->nd_set; + +if (nd_set) +return nd_set->altcookie; +return 0 ; +} +void nd_mapping_free_labels (struct nd_mapping *nd_mapping) {struct nd_label_ent *label_ent, *e;
include/linux/libnvdimm.h +2 -0
@@ -70,6 +70,8 @@ struct nd_cmd_desc {struct nd_interleave_set {u64 cookie; +/* compatibility with initial buggy Linux implementation */ +u64 altcookie; };struct nd_mapping_desc {
Greg Kroah-Hartman
maintainerPATCH 43/75 mac80211: flush delayed work when entering suspend
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Chen <[email protected]>
commit a9e9200d8661c1a0be8c39f93deb383dc940de35 upstream.
The issue was found when entering suspend and resume. It triggers a warning in:mac80211/key.c: ieee80211_enable_keys()
...
WARN_ON_ONCE(sdata->crypto_tx_tailroom_needed_cnt ||
sdata->crypto_tx_tailroom_pending_dec);
...
It points out sdata->crypto_tx_tailroom_pending_dec isn't cleaned up successfully in a delayed_work during suspend. Add a flush_delayed_work to fix it.
--- net/mac80211/pm.c | 1 + 1 file changed, 1 insertion(+)
net/mac80211/pm.c +1 -0
@@ -168,6 +168,7 @@ int __ieee80211_suspend(struct ieee80211break ; } +flush_delayed_work (&sdata->dec_tailroom_needed_wk);drv_remove_interface (local, sdata); }
Greg Kroah-Hartman
maintainerPATCH 44/75 mac80211: dont reorder frames with SN smaller than SSN
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sara Sharon <[email protected]>
commit b7540d8f25c8034de7e4163fc23ac457bf057731 upstream.
When RX aggregation starts, transmitter may continue send frames with SN smaller than SSN until the AddBA response is received. However, the reorder buffer is already initialized at this point, which will cause the drop of such frames as duplicates since the head SN of the reorder buffer is set to the SSN, which is bigger.
--- net/mac80211/agg-rx.c | 1 + net/mac80211/rx.c | 14 +++++++++++++- net/mac80211/sta_info.h | 6 ++++-- 3 files changed, 18 insertions(+), 3 deletions(-)
net/mac80211/agg-rx.c +1 -0
@@ -398,6 +398,7 @@ void __ieee80211_start_rx_ba_session(str tid_agg_rx->timeout = timeout; tid_agg_rx->stored_mpdu_num =0 ; tid_agg_rx->auto_seq = auto_seq; + tid_agg_rx->started = false; tid_agg_rx->reorder_buf_filtered =0 ; status =WLAN_STATUS_SUCCESS ;
net/mac80211/rx.c +13 -1
@@ -4,7 +4,7 @@* Copyright 2006-2007 Jiri Benc <[email protected]> * Copyright 2007-2010 Johannes Berg <[email protected]> * Copyright 2013-2014 Intel Mobile Communications GmbH -* Copyright(c) 2015 - 2016 Intel Deutschland GmbH +* Copyright(c) 2015 - 2017 Intel Deutschland GmbH * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as
@@ -1034,6 +1034,18 @@ static bool ieee80211_sta_manage_reorder buf_size = tid_agg_rx->buf_size; head_seq_num = tid_agg_rx->head_seq_num; +/* +* If the current MPDU's SN is smaller than the SSN, it shouldn't +* be reordered. +*/ +if (unlikely (!tid_agg_rx->started)) { +if (ieee80211_sn_less (mpdu_seq_num, head_seq_num)) { + ret = false; + goto out; + } + tid_agg_rx->started = true; + } +/* frame with out of date sequence number */ if (ieee80211_sn_less (mpdu_seq_num, head_seq_num)) {dev_kfree_skb (skb);
net/mac80211/sta_info.h +4 -2
@@ -189,6 +189,7 @@ struct tid_ampdu_tx {* @auto_seq: used for offloaded BA sessions to automatically pick head_seq_and * and ssn. * @removed: this session is removed (but might have been found due to RCU) +* @started: this session has started (head ssn or higher was received) * * This structure's lifetime is managed by RCU, assignments to * the array holding it must hold the aggregation mutex.
@@ -212,8 +213,9 @@ struct tid_ampdu_rx {u16 ssn;u16 buf_size;u16 timeout; -bool auto_seq; -bool removed; + u8 auto_seq:1, + removed:1, + started:1; };/**
Greg Kroah-Hartman
maintainerPATCH 45/75 mac80211: dont handle filtered frames within a BA session
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
commit 890030d3c425f49abaa4acf60e20f288b599f980 upstream.
When running a BA session, the driver (or the hardware) already takes care of retransmitting failed frames, since it has to keep the receiver reorder window in sync.
Adding another layer of retransmit around that does not improve anything. In fact, it can only lead to some strong reordering with huge latency.
--- net/mac80211/status.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/status.c +2 -1
@@ -51,7 +51,8 @@ static void ieee80211_handle_filtered_frstruct ieee80211_hdr *hdr = (void *)skb->data;int ac; -if (info->flags &IEEE80211_TX_CTL_NO_PS_BUFFER ) { +if (info->flags & (IEEE80211_TX_CTL_NO_PS_BUFFER | +IEEE80211_TX_CTL_AMPDU )) {ieee80211_free_txskb (&local->hw, skb);return ; }
Greg Kroah-Hartman
maintainerPATCH 48/75 drm/amdgpu/pm: check for headless before calling compute_clocks
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit c10c8f7c27103bd7ac02d041d9d6e97296d48fc1 upstream.
Don't update display bandwidth on headless asics.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=99387
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2 -1
@@ -1252,7 +1252,8 @@ void amdgpu_pm_compute_clocks(struct amdif (!adev->pm.dpm_enabled)return ; -amdgpu_display_bandwidth_update (adev); +if (adev->mode_info.num_crtc) +amdgpu_display_bandwidth_update (adev);for (i =0 ; i <AMDGPU_MAX_RINGS ; i++) {struct amdgpu_ring *ring = adev->rings[i];
Greg Kroah-Hartman
maintainerPATCH 49/75 Revert "drm/amdgpu: update tile table for oland/hainan"
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean Delvare <[email protected]>
Revert commit f8d9422ef80c ("drm/amdgpu: update tile table for oland/hainan") as it is causing ugly visual artifacts on at least Oland. This is only an optimization so we can live without it.
This fixes kernel bug #194761:
amdgpu driver breaks on Oland (SI)
https://bugzilla.kernel.org/show_bug.cgi?id=194761
---
Note: This is for stable v4.10 branch only. v4.11 and later have a different fix, but it's much larger and more intrusive so not suitable for a stable branch.
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 330 ++++++++++++++-------------------- 1 file changed, 139 insertions(+), 191 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +139 -191
@@ -708,290 +708,238 @@ static void gfx_v6_0_tiling_mode_table_ifor (reg_offset =0 ; reg_offset < num_tile_mode_states; reg_offset++) {switch (reg_offset) {case 0 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_64B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_4 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_4 ) | -NUM_BANKS (ADDR_SURF_16_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_4 ));break ;case 1 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_128B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_4 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_4 ) | -NUM_BANKS (ADDR_SURF_16_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_4 ));break ;case 2 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_256B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_4 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_4 ) | -NUM_BANKS (ADDR_SURF_16_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_4 ));break ;case 3 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) | +TILE_SPLIT (ADDR_SURF_TILE_SPLIT_128B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | -BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_8_BANK ) | -TILE_SPLIT (split_equal_to_row_size)); +BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_4 ) | +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_4 ));break ;case 4 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | -ARRAY_MODE (ARRAY_1D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 )); + gb_tile_moden = (ARRAY_MODE (ARRAY_1D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) | +TILE_SPLIT (ADDR_SURF_TILE_SPLIT_64B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) | +BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | +BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 5 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | -TILE_SPLIT (ADDR_SURF_TILE_SPLIT_512B ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) | +TILE_SPLIT (split_equal_to_row_size) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | -BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_1 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_8_BANK )); +BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 6 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | -TILE_SPLIT (ADDR_SURF_TILE_SPLIT_256B ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) | +TILE_SPLIT (split_equal_to_row_size) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | -BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_8_BANK )); +BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_1 ) | +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 7 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | -TILE_SPLIT (ADDR_SURF_TILE_SPLIT_1KB ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_DEPTH_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) | +TILE_SPLIT (split_equal_to_row_size) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | -BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_4_BANK )); +BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_4 ) | +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_4 ));break ;case 8 : - gb_tile_moden = (ARRAY_MODE (ARRAY_LINEAR_ALIGNED )); + gb_tile_moden = (ARRAY_MODE (ARRAY_LINEAR_ALIGNED ) | +MICRO_TILE_MODE (ADDR_SURF_DISPLAY_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) | +TILE_SPLIT (ADDR_SURF_TILE_SPLIT_64B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) | +BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | +BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 9 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_DISPLAY_MICRO_TILING ) | -ARRAY_MODE (ARRAY_1D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 )); + gb_tile_moden = (ARRAY_MODE (ARRAY_1D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_DISPLAY_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) | +TILE_SPLIT (ADDR_SURF_TILE_SPLIT_64B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) | +BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | +BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 10 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_DISPLAY_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_DISPLAY_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_256B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_4 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_4 ) | -NUM_BANKS (ADDR_SURF_16_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_4 ));break ;case 11 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_DISPLAY_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_DISPLAY_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_256B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ) | -NUM_BANKS (ADDR_SURF_16_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 12 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_DISPLAY_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_DISPLAY_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_512B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_1 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ) | -NUM_BANKS (ADDR_SURF_16_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 13 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_1D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 )); + gb_tile_moden = (ARRAY_MODE (ARRAY_1D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) | +TILE_SPLIT (ADDR_SURF_TILE_SPLIT_64B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) | +BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | +BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 14 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_256B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_4 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ) | -NUM_BANKS (ADDR_SURF_16_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 15 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_256B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ) | -NUM_BANKS (ADDR_SURF_16_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 16 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_512B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_1 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ) | -NUM_BANKS (ADDR_SURF_16_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 17 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | -BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | -BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_1 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ) | -NUM_BANKS (ADDR_SURF_16_BANK ) | -TILE_SPLIT (split_equal_to_row_size)); -break ; -case 18 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_1D_TILED_THICK ) | -PIPE_CONFIG (ADDR_SURF_P2 )); -break ; -case 19 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_XTHICK ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | -BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | -BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_1 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P4_8x16) | +TILE_SPLIT (split_equal_to_row_size) |NUM_BANKS (ADDR_SURF_16_BANK ) | -TILE_SPLIT (split_equal_to_row_size)); -break ; -case 20 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THICK ) | -PIPE_CONFIG (ADDR_SURF_P2 ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_1 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ) | -NUM_BANKS (ADDR_SURF_16_BANK ) | -TILE_SPLIT (split_equal_to_row_size)); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 21 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P8_32x32_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_256B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_2 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_4 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_8_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 22 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P8_32x32_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_256B ) | -BANK_WIDTH (ADDR_SURF_BANK_WIDTH_2 ) | -BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_8_BANK )); +NUM_BANKS (ADDR_SURF_16_BANK ) | +BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | +BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_4 ) | +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_4 ));break ;case 23 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P8_32x32_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_256B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_8_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 24 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P8_32x32_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_512B ) | +NUM_BANKS (ADDR_SURF_16_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_1 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_8_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_2 ));break ;case 25 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | + gb_tile_moden = (ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | +MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | +PIPE_CONFIG (ADDR_SURF_P8_32x32_8x16) |TILE_SPLIT (ADDR_SURF_TILE_SPLIT_1KB ) | -BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | -BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_4_BANK )); -break ; -case 26 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | -TILE_SPLIT (ADDR_SURF_TILE_SPLIT_1KB ) | -BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | -BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_4_BANK )); -break ; -case 27 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | -TILE_SPLIT (ADDR_SURF_TILE_SPLIT_1KB ) | -BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | -BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_4_BANK )); -break ; -case 28 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | -TILE_SPLIT (ADDR_SURF_TILE_SPLIT_1KB ) | -BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | -BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_4_BANK )); -break ; -case 29 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | -TILE_SPLIT (ADDR_SURF_TILE_SPLIT_1KB ) | -BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) | -BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_2 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_4_BANK )); -break ; -case 30 : - gb_tile_moden = (MICRO_TILE_MODE (ADDR_SURF_THIN_MICRO_TILING ) | -ARRAY_MODE (ARRAY_2D_TILED_THIN1 ) | -PIPE_CONFIG (ADDR_SURF_P2 ) | -TILE_SPLIT (ADDR_SURF_TILE_SPLIT_2KB ) | +NUM_BANKS (ADDR_SURF_8_BANK ) |BANK_WIDTH (ADDR_SURF_BANK_WIDTH_1 ) |BANK_HEIGHT (ADDR_SURF_BANK_HEIGHT_1 ) | -MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ) | -NUM_BANKS (ADDR_SURF_4_BANK )); +MACRO_TILE_ASPECT (ADDR_SURF_MACRO_ASPECT_1 ));break ;default : -continue ; + gb_tile_moden =0 ; +break ; } adev->gfx.config.tile_mode_array[reg_offset] = gb_tile_moden;WREG32 (mmGB_TILE_MODE0 + reg_offset, gb_tile_moden);
Greg Kroah-Hartman
maintainerPATCH 50/75 drm/ast: Handle configuration without P2A bridge
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell Currey <[email protected]>
commit 71f677a91046599ece96ebab21df956ce909c456 upstream.
The ast driver configures a window to enable access into BMC memory space in order to read some configuration registers.
If this window is disabled, which it can be from the BMC side, the ast driver can't function.
Closing this window is a necessity for security if a machine's host side and BMC side are controlled by different parties; i.e. a cloud provider offering machines "bare metal".
A recent patch went in to try to check if that window is open but it does so by trying to access the registers in question and testing if the result is 0xffffffff.
This method will trigger a PCIe error when the window is closed which on some systems will be fatal (it will trigger an EEH for example on POWER which will take out the device).
This patch improves this in two ways:
- First, if the firmware has put properties in the device-tree
containing the relevant configuration information, we use these.
- Otherwise, a bit in one of the SCU scratch registers (which
are readable via the VGA register space and writeable by the BMC) will indicate if the BMC has closed the window. This bit has been defined by Y.C Chen from Aspeed.
If the window is closed and the configuration isn't available from the device-tree, some sane defaults are used. Those defaults are hopefully sufficient for standard video modes used on a server.
--- drivers/gpu/drm/ast/ast_drv.h | 6 drivers/gpu/drm/ast/ast_main.c | 264 +++++++++++++++++++++++++---------------- drivers/gpu/drm/ast/ast_post.c | 7 - 3 files changed, 168 insertions(+), 109 deletions(-)
drivers/gpu/drm/ast/ast_drv.h +5 -1
@@ -113,7 +113,11 @@ struct ast_private {struct ttm_bo_kmap_obj cache_kmap;int next_cursor;bool support_wide_screen; -bool DisableP2A; +enum { + ast_use_p2a, + ast_use_dt, + ast_use_defaults + } config_mode;enum ast_tx_chip tx_chip_type;u8 dp501_maxclk;
drivers/gpu/drm/ast/ast_main.c +161 -103
314 lines not on this page · raw message
drivers/gpu/drm/ast/ast_post.c +2 -5
@@ -379,17 +379,14 @@ void ast_post_gpu(struct drm_device *devast_open_key (ast);ast_set_def_ext_reg (dev); -if (ast->DisableP2A == false) - { +if (ast->config_mode == ast_use_p2a) {if (ast->chip ==AST2300 || ast->chip ==AST2400 )ast_init_dram_2300 (dev);else ast_init_dram_reg (dev);ast_init_3rdtx (dev); - } -else - { + }else {if (ast->tx_chip_type !=AST_TX_NONE )ast_set_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xa3 ,0xcf ,0x80 );/* Enable DVO */ }
Greg Kroah-Hartman
maintainerPATCH 51/75 drm/ast: Fix test for VGA enabled
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Y.C. Chen <[email protected]>
commit 905f21a49d388de3e99438235f3301cabf0c0ef4 upstream.
The test to see if VGA was already enabled is doing an unnecessary second test from a register that may or may not have been initialized to a valid value. Remove it.
--- drivers/gpu/drm/ast/ast_post.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/ast/ast_post.c +2 -6
@@ -58,13 +58,9 @@ bool ast_is_vga_enabled(struct drm_devic/* TODO 1180 */ }else { ch =ast_io_read8 (ast,AST_IO_VGA_ENABLE_PORT ); -if (ch) { -ast_open_key (ast); - ch =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xb6 ,0xff ); -return ch &0x04 ; - } +return !!(ch &0x01 ); } -return 0 ; +return false; }static const u8 extreginfo[] = {0x0f ,0x04 ,0x1c ,0xff };
Greg Kroah-Hartman
maintainerPATCH 52/75 drm/ast: Call open_key before enable_mmio in POST code
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Y.C. Chen <[email protected]>
commit 9bb92f51558f2ef5f56c257bdcea0588f31d857e upstream.
open_key enables access the registers used by enable_mmio
--- drivers/gpu/drm/ast/ast_post.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ast/ast_post.c +1 -1
@@ -371,8 +371,8 @@ void ast_post_gpu(struct drm_device *devpci_write_config_dword (ast->dev->pdev,0x04 , reg);ast_enable_vga (dev); -ast_enable_mmio (dev);ast_open_key (ast); +ast_enable_mmio (dev);ast_set_def_ext_reg (dev);if (ast->config_mode == ast_use_p2a) {
Greg Kroah-Hartman
maintainerPATCH 53/75 drm/ast: Fix AST2400 POST failure without BMC FW or VBIOS
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Y.C. Chen <[email protected]>
commit 3856081eede297b617560b85e948cfb00bb395ec upstream.
The current POST code for the AST2300/2400 family doesn't work properly if the chip hasn't been initialized previously by either the BMC own FW or the VBIOS. This fixes it.
--- drivers/gpu/drm/ast/ast_post.c | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-)
drivers/gpu/drm/ast/ast_post.c +35 -3
@@ -1631,12 +1631,44 @@ static void ast_init_dram_2300(struct dr temp |=0x73 ;ast_write32 (ast,0x12008 , temp); + param.dram_freq =396 ; param.dram_type =AST_DDR3 ; + temp =ast_mindwm (ast,0x1e6e2070 );if (temp &0x01000000 ) param.dram_type =AST_DDR2 ; - param.dram_chipid = ast->dram_type; - param.dram_freq = ast->mclk; - param.vram_size = ast->vram_size; +switch (temp &0x18000000 ) { +case 0 : + param.dram_chipid = AST_DRAM_512Mx16; +break ; +default : +case 0x08000000 : + param.dram_chipid = AST_DRAM_1Gx16; +break ; +case 0x10000000 : + param.dram_chipid = AST_DRAM_2Gx16; +break ; +case 0x18000000 : + param.dram_chipid = AST_DRAM_4Gx16; +break ; + } +switch (temp &0x0c ) { +default : +case 0x00 : + param.vram_size =AST_VIDMEM_SIZE_8M ; +break ; + +case 0x04 : + param.vram_size =AST_VIDMEM_SIZE_16M ; +break ; + +case 0x08 : + param.vram_size =AST_VIDMEM_SIZE_32M ; +break ; + +case 0x0c : + param.vram_size =AST_VIDMEM_SIZE_64M ; +break ; + }if (param.dram_type ==AST_DDR3 ) {get_ddr3_info (ast, ¶m);
Greg Kroah-Hartman
maintainerPATCH 54/75 drm/radeon: handle vfct with multiple vbios images
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit a882f5de402ded769af74fbf276132f9c175049c upstream.
The vfct table can contain multiple vbios images if the platform contains multiple GPUs. Noticed by netkas on phoronix forums. This patch fixes those platforms.
--- drivers/gpu/drm/radeon/radeon_bios.c | 68 +++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 31 deletions(-)
drivers/gpu/drm/radeon/radeon_bios.c +37 -31
@@ -596,52 +596,58 @@ static bool radeon_read_disabled_bios(st#ifdef CONFIG_ACPI static bool radeon_acpi_vfct_bios (struct radeon_device *rdev) { -bool ret = false;struct acpi_table_header *hdr;acpi_size tbl_size;UEFI_ACPI_VFCT *vfct; -GOP_VBIOS_CONTENT *vbios; -VFCT_IMAGE_HEADER *vhdr; +unsigned offset;if (!ACPI_SUCCESS (acpi_get_table ("VFCT" ,1 , &hdr)))return false; tbl_size = hdr->length;if (tbl_size <sizeof (UEFI_ACPI_VFCT )) {DRM_ERROR ("ACPI VFCT table present but broken (too short #1)\n" ); - goto out_unmap; +return false; } vfct = (UEFI_ACPI_VFCT *)hdr; -if (vfct->VBIOSImageOffset +sizeof (VFCT_IMAGE_HEADER ) > tbl_size) { -DRM_ERROR ("ACPI VFCT table present but broken (too short #2)\n" ); - goto out_unmap; - } + offset = vfct->VBIOSImageOffset; - vbios = (GOP_VBIOS_CONTENT *)((char *)hdr + vfct->VBIOSImageOffset); - vhdr = &vbios->VbiosHeader; -DRM_INFO ("ACPI VFCT contains a BIOS for %02x:%02x.%d %04x:%04x, size %d\n" , - vhdr->PCIBus, vhdr->PCIDevice, vhdr->PCIFunction, - vhdr->VendorID, vhdr->DeviceID, vhdr->ImageLength); - -if (vhdr->PCIBus != rdev->pdev->bus->number || - vhdr->PCIDevice !=PCI_SLOT (rdev->pdev->devfn) || - vhdr->PCIFunction !=PCI_FUNC (rdev->pdev->devfn) || - vhdr->VendorID != rdev->pdev->vendor || - vhdr->DeviceID != rdev->pdev->device) { -DRM_INFO ("ACPI VFCT table is not for this card\n" ); - goto out_unmap; +while (offset < tbl_size) { +GOP_VBIOS_CONTENT *vbios = (GOP_VBIOS_CONTENT *)((char *)hdr + offset); +VFCT_IMAGE_HEADER *vhdr = &vbios->VbiosHeader; + + offset +=sizeof (VFCT_IMAGE_HEADER ); +if (offset > tbl_size) { +DRM_ERROR ("ACPI VFCT image header truncated\n" ); +return false; + } + + offset += vhdr->ImageLength; +if (offset > tbl_size) { +DRM_ERROR ("ACPI VFCT image truncated\n" ); +return false; + } + +if (vhdr->ImageLength && + vhdr->PCIBus == rdev->pdev->bus->number && + vhdr->PCIDevice ==PCI_SLOT (rdev->pdev->devfn) && + vhdr->PCIFunction ==PCI_FUNC (rdev->pdev->devfn) && + vhdr->VendorID == rdev->pdev->vendor && + vhdr->DeviceID == rdev->pdev->device) { + rdev->bios =kmemdup (&vbios->VbiosContent, + vhdr->ImageLength, +GFP_KERNEL ); + +if (!rdev->bios) { +kfree (rdev->bios); +return false; + } +return true; + } } -if (vfct->VBIOSImageOffset +sizeof (VFCT_IMAGE_HEADER ) + vhdr->ImageLength > tbl_size) { -DRM_ERROR ("ACPI VFCT image truncated\n" ); - goto out_unmap; - } - - rdev->bios =kmemdup (&vbios->VbiosContent, vhdr->ImageLength,GFP_KERNEL ); - ret = !!rdev->bios; - -out_unmap: -return ret; +DRM_ERROR ("ACPI VFCT table present but broken (too short #2)\n" ); +return false; }#else static inline bool radeon_acpi_vfct_bios (struct radeon_device *rdev)
Greg Kroah-Hartman
maintainerPATCH 57/75 drm/vmwgfx: Work around drm removal of control nodes
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Hellstrom <[email protected]>
commit 31788ca803a0c89078f9e604e64286fbd9077926 upstream.
vmware tools has a daemon that gets layout information from the GUI and forwards it to DRM so that the modesetting code can set preferred connector locations and modes. This daemon was using control nodes but since control nodes were just removed, make it possible for the daemon to use render- or primary nodes instead. This is a bit ugly but will allow drm to proceed with removal of the mostly unused control-node code and allow vmware to proceed with fixing up automatic layout settings for gnome-shell/wayland.
We bump minor to inform user-space about the api change.
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 11 ++++++++++- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +10 -1
@@ -199,9 +199,14 @@ static const struct drm_ioctl_desc vmw_iVMW_IOCTL_DEF (VMW_PRESENT_READBACK , vmw_present_readback_ioctl,DRM_MASTER |DRM_AUTH ), +/* +* The permissions of the below ioctl are overridden in +* vmw_generic_ioctl(). We require either +* DRM_MASTER or capable(CAP_SYS_ADMIN). +*/ VMW_IOCTL_DEF (VMW_UPDATE_LAYOUT , vmw_kms_update_layout_ioctl, -DRM_MASTER |DRM_CONTROL_ALLOW ), +DRM_RENDER_ALLOW ),VMW_IOCTL_DEF (VMW_CREATE_SHADER , vmw_shader_define_ioctl, DRM_AUTH | DRM_RENDER_ALLOW),
@@ -1125,6 +1130,10 @@ static long vmw_generic_ioctl(struct filreturn (long )vmw_execbuf_ioctl (dev, arg, file_priv,_IOC_SIZE (cmd)); + }else if (nr ==DRM_COMMAND_BASE +DRM_VMW_UPDATE_LAYOUT ) { +if (!drm_is_current_master (file_priv) && + !capable (CAP_SYS_ADMIN )) +return -EACCES ; }if (unlikely (ioctl->cmd != cmd))
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +2 -2
@@ -41,9 +41,9 @@#include <drm/ttm/ttm_module.h> #include "vmwgfx_fence.h" -#define VMWGFX_DRIVER_DATE "20160210" +#define VMWGFX_DRIVER_DATE "20170221"#define VMWGFX_DRIVER_MAJOR 2 -#define VMWGFX_DRIVER_MINOR 11 +#define VMWGFX_DRIVER_MINOR 12#define VMWGFX_DRIVER_PATCHLEVEL 0#define VMWGFX_FILE_PAGE_OFFSET 0x00100000#define VMWGFX_FIFO_STATIC_SIZE (1024*1024)
Greg Kroah-Hartman
maintainerPATCH 58/75 drm/imx: imx-tve: Do not set the regulator voltage
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Estevam <[email protected]>
commit fc12bccda8b6f5c38139eceec9e369ed78091b2b upstream.
Commit deb65870b5d9d ("drm/imx: imx-tve: check the value returned by regulator_set_voltage()") exposes the following probe issue:
63ff0000.tve supply dac not found, using dummy regulator
imx-drm display-subsystem: failed to bind 63ff0000.tve (ops imx_tve_ops): -22
When the 'dac-supply' is not passed in the device tree a dummy regulator is used and setting its voltage is not allowed.
To fix this issue, do not set the dac-supply voltage inside the driver and let its voltage be specified in the device tree.
Print a warning if the the 'dac-supply' voltage has a value different from 2.75V.
--- drivers/gpu/drm/imx/imx-tve.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/imx/imx-tve.c +4 -3
@@ -98,6 +98,8 @@/* TVE_TST_MODE_REG */ #define TVE_TVDAC_TEST_MODE_MASK (0x7 << 0) +#define IMX_TVE_DAC_VOLTAGE 2750000 +enum {TVE_MODE_TVOUT ,TVE_MODE_VGA ,
@@ -621,9 +623,8 @@ static int imx_tve_bind(struct device *d tve->dac_reg =devm_regulator_get (dev,"dac" );if (!IS_ERR (tve->dac_reg)) { - ret =regulator_set_voltage (tve->dac_reg,2750000 ,2750000 ); -if (ret) -return ret; +if (regulator_get_voltage (tve->dac_reg) !=IMX_TVE_DAC_VOLTAGE ) +dev_warn (dev,"dac voltage is not %d uV\n" ,IMX_TVE_DAC_VOLTAGE ); ret =regulator_enable (tve->dac_reg);if (ret)return ret;
Greg Kroah-Hartman
maintainerPATCH 59/75 drm/atomic: fix an error code in mode_fixup()
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit f9ad86e42d0303eeb8e0d41bb208153022ebd9d2 upstream.
Having "ret" be a bool type works for everything except ret = funcs->atomic_check(). The other functions all return zero on error but ->atomic_check() returns negative error codes. We want to propagate the error code but instead we return 1.
I found this bug with static analysis and I don't know if it affects run time.
--- drivers/gpu/drm/drm_atomic_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_atomic_helper.c +1 -1
@@ -362,7 +362,7 @@ mode_fixup(struct drm_atomic_state *statstruct drm_connector *connector;struct drm_connector_state *conn_state;int i; -bool ret; +int ret;for_each_crtc_in_state (state, crtc, crtc_state, i) { if (!crtc_state->mode_changed &&
Greg Kroah-Hartman
maintainerPATCH 60/75 drm/i915/gvt: Disable access to stolen memory as a guest
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit ddd09373628adcbdc3f7b9098d22328834f8d772 upstream.
Explicitly disable stolen memory when running as a guest in a virtual machine, since the memory is not mediated between clients and reserved entirely for the host. The actual size should be reported as zero, but like every other quirk we want to tell the user what is happening.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99028
--- drivers/gpu/drm/i915/i915_gem_stolen.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/i915_gem_stolen.c +5 -0
@@ -414,6 +414,11 @@ int i915_gem_init_stolen(struct drm_i915mutex_init (&dev_priv->mm.stolen_lock); +if (intel_vgpu_active (dev_priv)) { +DRM_INFO ("iGVT-g active, disabling use of stolen memory\n" ); +return 0 ; + } +#ifdef CONFIG_INTEL_IOMMU if (intel_iommu_gfx_mapped &&INTEL_GEN (dev_priv) <8 ) {DRM_INFO ("DMAR active, disabling use of stolen memory\n" );
Greg Kroah-Hartman
maintainerPATCH 61/75 drm: Cancel drm_fb_helper_dirty_work on unload
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit f21b9a92ca7c29382909eaab9facc2cf46f2cc0b upstream.
We can not allow the worker to run after its fbdev, or even the module, has been removed.
--- drivers/gpu/drm/drm_fb_helper.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_fb_helper.c +2 -0
@@ -856,6 +856,8 @@ void drm_fb_helper_fini(struct drm_fb_heif (!drm_fbdev_emulation)return ; +cancel_work_sync (&fb_helper->dirty_work); +mutex_lock (&kernel_fb_helper_lock);if (!list_empty (&fb_helper->kernel_fb_list)) {list_del (&fb_helper->kernel_fb_list);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Greg Kroah-Hartman
maintainerPATCH 62/75 drm: Cancel drm_fb_helper_resume_work on unload
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit 24f76b2c87ed68f79f9f0705b11ccbefaaa0d390 upstream.
We can not allow the worker to run after its fbdev, or even the module, has been removed.
--- drivers/gpu/drm/drm_fb_helper.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_fb_helper.c +1 -0
@@ -856,6 +856,7 @@ void drm_fb_helper_fini(struct drm_fb_heif (!drm_fbdev_emulation)return ; +cancel_work_sync (&fb_helper->resume_work);cancel_work_sync (&fb_helper->dirty_work);mutex_lock (&kernel_fb_helper_lock);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Greg Kroah-Hartman
maintainerPATCH 63/75 drm/i915: Recreate internal objects with single page segments if dmar fails
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit 2d2cfc12b1270c8451edc7d2dd5f79097b3a17d8 upstream.
If we fail to dma-map the object, the most common cause is lack of space inside the SW-IOTLB due to fragmentation. If we recreate the_sg_table using segments of PAGE_SIZE (and single page allocations), we may succeed in remapping the scatterlist.
First became a significant problem for the mock selftests after commit 5584f1b1d73e ("drm/i915: fix i915 running as dom0 under Xen") increased the max_order.
--- drivers/gpu/drm/i915/i915_gem_internal.c | 37 +++++++++++++++++++------------ 1 file changed, 23 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/i915_gem_internal.c +23 -14
@@ -46,24 +46,12 @@ static struct sg_table * i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj) {struct drm_i915_private *i915 =to_i915 (obj->base.dev); -unsigned int npages = obj->base.size /PAGE_SIZE ;struct sg_table *st;struct scatterlist *sg; +unsigned int npages;int max_order;gfp_t gfp; - st =kmalloc (sizeof (*st),GFP_KERNEL ); -if (!st) -return ERR_PTR (-ENOMEM ); - -if (sg_alloc_table (st, npages,GFP_KERNEL )) { -kfree (st); -return ERR_PTR (-ENOMEM ); - } - - sg = st->sgl; - st->nents =0 ; - max_order =MAX_ORDER ;#ifdef CONFIG_SWIOTLB if (swiotlb_nr_tbl ()) {
@@ -85,6 +73,20 @@ i915_gem_object_get_pages_internal(struc gfp |= __GFP_DMA32; } +create_st: + st =kmalloc (sizeof (*st),GFP_KERNEL ); +if (!st) +return ERR_PTR (-ENOMEM ); + + npages = obj->base.size /PAGE_SIZE ; +if (sg_alloc_table (st, npages,GFP_KERNEL )) { +kfree (st); +return ERR_PTR (-ENOMEM ); + } + + sg = st->sgl; + st->nents =0 ; + do { int order = min(fls(npages) - 1, max_order); struct page *page;
@@ -112,8 +114,15 @@ i915_gem_object_get_pages_internal(struc sg =__sg_next (sg); }while (1 ); -if (i915_gem_gtt_prepare_pages (obj, st)) +if (i915_gem_gtt_prepare_pages (obj, st)) { +/* Failed to dma-map try again with single page sg segments */ +if (get_order (st->sgl->length)) { +internal_free_pages (st); + max_order =0 ; + goto create_st; + } goto err; + }/* Mark the pages as dontneed whilst they are still pinned. As soon * as they are unpinned they are allowed to be reaped by the shrinker,
Greg Kroah-Hartman
maintainerPATCH 65/75 drm/i915: Check for timeout completion when waiting for the rq to submitted
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit 44a027058b24541cc7ec499e6fb91db4b130648a upstream.
We first wait for a request to be submitted to hw and assigned a seqno, before we can wait for the hw to signal completion (otherwise we don't know the hw id we need to wait upon). Whilst waiting for the request to be submitted, we may exceed the user's timeout and need to propagate the error back.
v2: Make ETIME into an error from wait_for_execute for consistent exit handling.
Testcase: igt/gem_wait/basic-await
--- drivers/gpu/drm/i915/i915_gem_request.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_request.c +6 -1
@@ -1011,8 +1011,13 @@ __i915_request_wait_for_execute(struct dbreak ; } +if (!timeout) { + timeout = -ETIME ; +break ; + } + timeout =io_schedule_timeout (timeout); - }while (timeout); + }while (1 );finish_wait (&request->execute.wait, &wait);if (flags &I915_WAIT_LOCKED )
Greg Kroah-Hartman
maintainerPATCH 66/75 drm/i915: Pass timeout==0 on to i915_gem_object_wait_fence()
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit 636deb5b2277cf57bb0f5e00fc9687de9a96061e upstream.
The i915_gem_object_wait_fence() uses an incoming timeout=0 to query whether the current fence is busy or idle, without waiting. This can be used by the wait-ioctl to implement a busy query.
Testcase: igt/gem_wait/basic-busy-write-all
--- drivers/gpu/drm/i915/i915_gem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +2 -2
@@ -440,7 +440,7 @@ i915_gem_object_wait_reservation(struct timeout =i915_gem_object_wait_fence (shared[i], flags, timeout, rps); -if (timeout <=0 ) +if (timeout <0 )break ;dma_fence_put (shared[i]);
@@ -453,7 +453,7 @@ i915_gem_object_wait_reservation(struct excl =reservation_object_get_excl_rcu (resv); } -if (excl && timeout >0 ) +if (excl && timeout >=0 ) timeout =i915_gem_object_wait_fence (excl, flags, timeout, rps);dma_fence_put (excl);
Greg Kroah-Hartman
maintainerPATCH 67/75 drm/i915: Fix not finding the VBT when it overlaps with OPREGION_ASLE_EXT
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 998d75730b40afc218c059d811869abe9676b305 upstream.
If there is no OPREGION_ASLE_EXT then a VBT stored in mailbox #4 may use the ASLE_EXT parts of the opregion. Adjust the vbt_size calculation for a vbt in mailbox #4 for this.
This fixes the driver not finding the VBT on a jumper ezpad mini3 cherrytrail tablet and on a ACER SW5_017 machine.
--- drivers/gpu/drm/i915/intel_opregion.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_opregion.c +12 -1
@@ -982,7 +982,18 @@ int intel_opregion_setup(struct drm_i915 opregion->vbt_size = vbt_size; }else { vbt = base +OPREGION_VBT_OFFSET ; - vbt_size =OPREGION_ASLE_EXT_OFFSET -OPREGION_VBT_OFFSET ; +/* +* The VBT specification says that if the ASLE ext +* mailbox is not used its area is reserved, but +* on some CHT boards the VBT extends into the +* ASLE ext area. Allow this even though it is +* against the spec, so we do not end up rejecting +* the VBT on those boards (and end up not finding the +* LCD panel because of this). +*/ + vbt_size = (mboxes &MBOX_ASLE_EXT ) ? +OPREGION_ASLE_EXT_OFFSET :OPREGION_SIZE ; + vbt_size -=OPREGION_VBT_OFFSET ;if (intel_bios_is_valid_vbt (vbt, vbt_size)) {DRM_DEBUG_KMS ("Found valid VBT in ACPI OpRegion (Mailbox #4)\n" ); opregion->vbt = vbt;
Greg Kroah-Hartman
maintainerPATCH 68/75 libceph: use BUG() instead of BUG_ON(1)
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit d24cdcd3e40a6825135498e11c20c7976b9bf545 upstream.
I ran into this compile warning, which is the result of BUG_ON(1) not always leading to the compiler treating the code path as unreachable:
include/linux/ceph/osdmap.h: In function 'ceph_can_shift_osds':
include/linux/ceph/osdmap.h:62:1: error: control reaches end of non-void function [-Werror=return-type]
Using BUG() here avoids the warning.
--- include/linux/ceph/osdmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/ceph/osdmap.h +1 -1
@@ -57,7 +57,7 @@ static inline bool ceph_can_shift_osds(scase CEPH_POOL_TYPE_EC :return false;default : -BUG_ON (1 ); +BUG (); } }
Greg Kroah-Hartman
maintainerPATCH 69/75 x86, mm: fix gup_pte_range() vs DAX mappings
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <[email protected]>
commit ef947b2529f918d9606533eb9c32b187ed6a5ede upstream.
gup_pte_range() fails to check pte_allows_gup() before translating a DAX pte entry, pte_devmap(), to a page. This allows writes to read-only mappings, and bypasses the DAX cacheline dirty tracking due to missed 'mkwrite' faults. The gup_huge_pmd() path and the gup_huge_pud() path correctly check pte_allows_gup() before checking for _devmap() entries.
--- arch/x86/mm/gup.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
arch/x86/mm/gup.c +6 -2
@@ -120,6 +120,11 @@ static noinline int gup_pte_range(pmd_treturn 0 ; } +if (!pte_allows_gup (pte_val (pte), write)) { +pte_unmap (ptep); +return 0 ; + } +if (pte_devmap (pte)) { pgmap =get_dev_pagemap (pte_pfn (pte), pgmap);if (unlikely (!pgmap)) {
@@ -127,8 +132,7 @@ static noinline int gup_pte_range(pmd_tpte_unmap (ptep);return 0 ; } - }else if (!pte_allows_gup (pte_val (pte), write) || -pte_special (pte)) { + }else if (pte_special (pte)) {pte_unmap (ptep);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 70/75 x86/tlb: Fix tlb flushing when lguest clears PGE
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
commit 2c4ea6e28dbf15ab93632c5c189f3948366b8885 upstream.
Fengguang reported random corruptions from various locations on x86-32 after commits d2852a224050 ("arch: add ARCH_HAS_SET_MEMORY config") and 9d876e79df6a ("bpf: fix unlocking of jited image when module ronx not set") that uses the former. While x86-32 doesn't have a JIT like x86_64, the bpf_prog_lock_ro() and bpf_prog_unlock_ro() got enabled due to ARCH_HAS_SET_MEMORY, whereas Fengguang's test kernel doesn't have module support built in and therefore never had the DEBUG_SET_MODULE_RONX setting enabled.
After investigating the crashes further, it turned out that using set_memory_ro() and set_memory_rw() didn't have the desired effect, for example, setting the pages as read-only on x86-32 would still let probe_kernel_write() succeed without error. This behavior would manifest itself in situations where the vmalloc'ed buffer was accessed prior to set_memory_*() such as in case of bpf_prog_alloc(). In cases where it wasn't, the page attribute changes seemed to have taken effect, leading to the conclusion that a TLB invalidate didn't happen. Moreover, it turned out that this issue reproduced with qemu in "-cpu kvm64" mode, but not for "-cpu host". When the issue occurs, change_page_attr_set_clr() did trigger a TLB flush as expected via __flush_tlb_all() through cpa_flush_range(), though.
There are 3 variants for issuing a TLB flush: invpcid_flush_all() (depends on CPU feature bits X86_FEATURE_INVPCID, X86_FEATURE_PGE), cr4 based flush (depends on X86_FEATURE_PGE), and cr3 based flush. For "-cpu host" case in my setup, the flush used invpcid_flush_all() variant, whereas for "-cpu kvm64", the flush was cr4 based. Switching the kvm64 case to cr3 manually worked fine, and further investigating the cr4 one turned out that X86_CR4_PGE bit was not set in cr4 register, meaning the __native_flush_tlb_global_irq_disabled() wrote cr4 twice with the same value instead of clearing X86_CR4_PGE in the first write to trigger the flush.
It turned out that X86_CR4_PGE was cleared from cr4 during init from lguest_arch_host_init() via adjust_pge(). The X86_FEATURE_PGE bit is also cleared from there due to concerns of using PGE in guest kernel that can lead to hard to trace bugs (see bff672e630a0 ("lguest: documentation V:
Host") in init()). The CPU feature bits are cleared in dynamic boot_cpu_data, but they never propagated to __flush_tlb_all() as it uses static_cpu_has() instead of boot_cpu_has() for testing which variant of TLB flushing to use, meaning they still used the old setting of the host kernel.
Clearing via setup_clear_cpu_cap(X86_FEATURE_PGE) so this would propagate to static_cpu_has() checks is too late at this point as sections have been patched already, so for now, it seems reasonable to switch back to boot_cpu_has(X86_FEATURE_PGE) as it was prior to commit c109bf95992b ("x86/cpufeature: Remove cpu_has_pge"). This lets the TLB flush trigger via cr3 as originally intended, properly makes the new page attributes visible and thus fixes the crashes seen by Fengguang.
--- arch/x86/include/asm/tlbflush.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/tlbflush.h +1 -1
@@ -188,7 +188,7 @@ static inline void __native_flush_tlb_sistatic inline void __flush_tlb_all (void ) { -if (static_cpu_has (X86_FEATURE_PGE )) +if (boot_cpu_has (X86_FEATURE_PGE ))__flush_tlb_global ();else __flush_tlb ();
Greg Kroah-Hartman
maintainerPATCH 71/75 thp: fix another corner case of munlock() vs. THPs
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kirill A. Shutemov <[email protected]>
commit 6ebb4a1b848fe75323135f93e72c78f8780fd268 upstream.
The following test case triggers BUG() in munlock_vma_pages_range():
int main(int argc, char *argv[])
{
int fd;
system("mount -t tmpfs -o huge=always none /mnt");
fd = open("/mnt/test", O_CREAT | O_RDWR);
ftruncate(fd, 4UL << 20);
mmap(NULL, 4UL << 20, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_FIXED | MAP_LOCKED, fd, 0);
mmap(NULL, 4096, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_LOCKED, fd, 0);
munlockall();
return 0;
}The second mmap() create PTE-mapping of the first huge page in file. It makes kernel munlock the page as we never keep PTE-mapped page mlocked.
On munlockall() when we handle vma created by the first mmap(), munlock_vma_page() returns page_mask == 0, as the page is not mlocked anymore. On next iteration follow_page_mask() return tail page, but page_mask is HPAGE_NR_PAGES - 1. It makes us skip to the first tail page of the next huge page and step on VM_BUG_ON_PAGE(PageMlocked(page)).
The fix is not use the page_mask from follow_page_mask() at all. It has no use for us.
--- mm/mlock.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
mm/mlock.c +4 -5
@@ -441,7 +441,7 @@ void munlock_vma_pages_range(struct vm_awhile (start < end) {struct page *page; -unsigned int page_mask; +unsigned int page_mask =0 ;unsigned long page_increm;struct pagevec pvec;struct zone *zone;
@@ -455,8 +455,7 @@ void munlock_vma_pages_range(struct vm_a* suits munlock very well (and if somehow an abnormal page * has sneaked into the range, we won't oops here: great). */ - page =follow_page_mask (vma, start,FOLL_GET |FOLL_DUMP , - &page_mask); + page =follow_page (vma, start,FOLL_GET |FOLL_DUMP );if (page && !IS_ERR (page)) {if (PageTransTail (page)) {
@@ -467,8 +466,8 @@ void munlock_vma_pages_range(struct vm_a/* * Any THP page found by follow_page_mask() may * have gotten split before reaching -* munlock_vma_page(), so we need to recompute -* the page_mask here. +* munlock_vma_page(), so we need to compute +* the page_mask here instead. */ page_mask =munlock_vma_page (page);unlock_page (page);
Greg Kroah-Hartman
maintainerPATCH 72/75 mm: do not call mem_cgroup_free() from within mem_cgroup_alloc()
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tahsin Erdogan <[email protected]>
commit 40e952f9d687928b32db20226f085ae660a7237c upstream.
mem_cgroup_free() indirectly calls wb_domain_exit() which is not prepared to deal with a struct wb_domain object that hasn't executed wb_domain_init(). For instance, the following warning message is printed by lockdep if alloc_percpu() fails in mem_cgroup_alloc():
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 1 PID: 1950 Comm: mkdir Not tainted 4.10.0+ #151 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Call Trace: dump_stack+0x67/0x99 register_lock_class+0x36d/0x540 __lock_acquire+0x7f/0x1a30 lock_acquire+0xcc/0x200 del_timer_sync+0x3c/0xc0 wb_domain_exit+0x14/0x20 mem_cgroup_free+0x14/0x40 mem_cgroup_css_alloc+0x3f9/0x620 cgroup_apply_control_enable+0x190/0x390 cgroup_mkdir+0x290/0x3d0 kernfs_iop_mkdir+0x58/0x80 vfs_mkdir+0x10e/0x1a0 SyS_mkdirat+0xa8/0xd0 SyS_mkdir+0x14/0x20 entry_SYSCALL_64_fastpath+0x18/0xad
Add __mem_cgroup_free() which skips wb_domain_exit(). This is used by both mem_cgroup_free() and mem_cgroup_alloc() clean up.
--- mm/memcontrol.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
mm/memcontrol.c +8 -3
@@ -4132,17 +4132,22 @@ static void free_mem_cgroup_per_node_infkfree (memcg->nodeinfo[node]); } -static void mem_cgroup_free (struct mem_cgroup *memcg) +static void __mem_cgroup_free (struct mem_cgroup *memcg) {int node; -memcg_wb_domain_exit (memcg);for_each_node (node)free_mem_cgroup_per_node_info (memcg, node);free_percpu (memcg->stat);kfree (memcg); } +static void mem_cgroup_free (struct mem_cgroup *memcg) +{ +memcg_wb_domain_exit (memcg); +__mem_cgroup_free (memcg); +} +static struct mem_cgroup *mem_cgroup_alloc (void ) {struct mem_cgroup *memcg;
@@ -4193,7 +4198,7 @@ static struct mem_cgroup *mem_cgroup_all fail:if (memcg->id.id >0 )idr_remove (&mem_cgroup_idr, memcg->id.id); -mem_cgroup_free (memcg); +__mem_cgroup_free (memcg);return NULL ; }
Greg Kroah-Hartman
maintainerPATCH 73/75 kasan: resched in quarantine_remove_cache()
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Vyukov <[email protected]>
commit 68fd814a3391c7e017ae6ace8855788748edd981 upstream.
We see reported stalls/lockups in quarantine_remove_cache() on machines with large amounts of RAM. quarantine_remove_cache() needs to scan whole quarantine in order to take out all objects belonging to the cache. Quarantine is currently 1/32-th of RAM, e.g. on a machine with 256GB of memory that will be 8GB. Moreover quarantine scanning is a walk over uncached linked list, which is slow.
Add cond_resched() after scanning of each non-empty batch of objects. Batches are specifically kept of reasonable size for quarantine_put(). On a machine with 256GB of RAM we should have ~512 non-empty batches, each with 16MB of objects.
--- mm/kasan/quarantine.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
mm/kasan/quarantine.c +8 -1
@@ -282,8 +282,15 @@ void quarantine_remove_cache(struct kmemon_each_cpu (per_cpu_remove_cache, cache,1 );spin_lock_irqsave (&quarantine_lock, flags); -for (i =0 ; i <QUARANTINE_BATCHES ; i++) +for (i =0 ; i <QUARANTINE_BATCHES ; i++) { +if (qlist_empty (&global_quarantine[i])) +continue ;qlist_move_cache (&global_quarantine[i], &to_free, cache); +/* Scanning whole quarantine can take a while. */ +spin_unlock_irqrestore (&quarantine_lock, flags); +cond_resched (); +spin_lock_irqsave (&quarantine_lock, flags); + }spin_unlock_irqrestore (&quarantine_lock, flags);qlist_free_all (&to_free, cache);
Greg Kroah-Hartman
maintainerPATCH 74/75 fat: fix using uninitialized fields of fat_inode/fsinfo_inode
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: OGAWA Hirofumi <[email protected]>
commit c0d0e351285161a515396b7b1ee53ec9ffd97e3c upstream.
Recently fallocate patch was merged and it uses MSDOS_I(inode)->mmu_private at fat_evict_inode(). However, fat_inode/fsinfo_inode that was introduced in past didn't initialize MSDOS_I(inode) properly.
With those combinations, it became the cause of accessing random entry in FAT area.
--- fs/fat/inode.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
fs/fat/inode.c +12 -1
@@ -1359,6 +1359,16 @@ out:return 0 ; } +static void fat_dummy_inode_init (struct inode *inode) +{ +/* Initialize this dummy inode to work as no-op. */ +MSDOS_I (inode)->mmu_private =0 ; +MSDOS_I (inode)->i_start =0 ; +MSDOS_I (inode)->i_logstart =0 ; +MSDOS_I (inode)->i_attrs =0 ; +MSDOS_I (inode)->i_pos =0 ; +} +static int fat_read_root (struct inode *inode) {struct msdos_sb_info *sbi =MSDOS_SB (inode->i_sb);
@@ -1803,12 +1813,13 @@ int fat_fill_super(struct super_block *s fat_inode =new_inode (sb);if (!fat_inode) goto out_fail; -MSDOS_I (fat_inode)->i_pos =0 ; +fat_dummy_inode_init (fat_inode); sbi->fat_inode = fat_inode; fsinfo_inode =new_inode (sb);if (!fsinfo_inode) goto out_fail; +fat_dummy_inode_init (fsinfo_inode); fsinfo_inode->i_ino =MSDOS_FSINFO_INO ; sbi->fsinfo_inode = fsinfo_inode;insert_inode_hash (fsinfo_inode);
Greg Kroah-Hartman
maintainerPATCH 75/75 drivers: hv: Turn off write permission on the hypercall page
In reply to Greg Kroah-Hartman4.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: K. Y. Srinivasan <[email protected]>
commit 372b1e91343e657a7cc5e2e2bcecd5140ac28119 upstream.
The hypercall page only needs to be executable but currently it is setup to be writable as well. Fix the issue.
--- drivers/hv/hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/hv.c +1 -1
@@ -220,7 +220,7 @@ int hv_init(void)/* See if the hypercall page is already set */ rdmsrl (HV_X64_MSR_HYPERCALL , hypercall_msr.as_uint64); - virtaddr =__vmalloc (PAGE_SIZE ,GFP_KERNEL ,PAGE_KERNEL_EXEC ); + virtaddr =__vmalloc (PAGE_SIZE ,GFP_KERNEL ,PAGE_KERNEL_RX );if (!virtaddr) goto cleanup;
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.10.3 release. There are 75 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 Wed Mar 15 08:33:49 UTC 2017. Anything received after that time might be too late.
Build results:
total: 149 pass: 149 fail: 0 Qemu test results: total: 122 pass: 122 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter
Greg Kroah-Hartman
maintainerQuoted 10 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.10.3 release. There are 75 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 Wed Mar 15 08:33:49 UTC 2017. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 149 pass: 149 fail: 0 Qemu test results: total: 122 pass: 122 fail: 0Details are available at http://kerneltests.org/builders.
Thanks for testing all of these and letting me know.
greg k-h
A message that is not in the archive (sent off-list or not yet received): [email protected]
Greg Kroah-Hartman
maintainerQuoted 1 line · kernelci.org bot
stable-rc boot: 530 boots: 5 failed, 516 passed with 9 offline (v4.10.2-76-g43100e143367)
These are ok, right? And 4.9 seems to not be doing many boots, is the build farm just busy?
thanks,
greg k-h
Quoted 4 lines · Greg Kroah-Hartman
Quoted 1 line · kernelci.org bot
stable-rc boot: 530 boots: 5 failed, 516 passed with 9 offline (v4.10.2-76-g43100e143367)
These are ok, right?
Yes, these are ones that have already been reported.
Quoted 1 line
And 4.9 seems to not be doing many boots, is the build farm just busy?
I think the build farm is caught up, but some of the labs seem to be slow to report in.
Kevin