From: Greg Kroah-Hartman Date: Mon, 9 Jan 2017 15:23:58 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v4.4.42~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=30eda15510d090ccc93ad87cf00639e27fb1577a;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: cred-userns-define-current_user_ns-as-a-function.patch cx23885-dvb-move-initialization-of-a8293_pdata.patch net-ti-cpmac-fix-compiler-warning-due-to-type-confusion.patch net-vxge-avoid-unused-function-warnings.patch powerpc-pci-rpadlpar-fix-device-reference-leaks.patch staging-comedi-dt282x-tidy-up-register-bit-defines.patch --- diff --git a/queue-4.4/cred-userns-define-current_user_ns-as-a-function.patch b/queue-4.4/cred-userns-define-current_user_ns-as-a-function.patch new file mode 100644 index 00000000000..bf05c53040d --- /dev/null +++ b/queue-4.4/cred-userns-define-current_user_ns-as-a-function.patch @@ -0,0 +1,67 @@ +From 0335695dfa4df01edff5bb102b9a82a0668ee51e Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Tue, 22 Mar 2016 14:27:11 -0700 +Subject: cred/userns: define current_user_ns() as a function + +From: Arnd Bergmann + +commit 0335695dfa4df01edff5bb102b9a82a0668ee51e upstream. + +The current_user_ns() macro currently returns &init_user_ns when user +namespaces are disabled, and that causes several warnings when building +with gcc-6.0 in code that compares the result of the macro to +&init_user_ns itself: + + fs/xfs/xfs_ioctl.c: In function 'xfs_ioctl_setattr_check_projid': + fs/xfs/xfs_ioctl.c:1249:22: error: self-comparison always evaluates to true [-Werror=tautological-compare] + if (current_user_ns() == &init_user_ns) + +This is a legitimate warning in principle, but here it isn't really +helpful, so I'm reprasing the definition in a way that shuts up the +warning. Apparently gcc only warns when comparing identical literals, +but it can figure out that the result of an inline function can be +identical to a constant expression in order to optimize a condition yet +not warn about the fact that the condition is known at compile time. +This is exactly what we want here, and it looks reasonable because we +generally prefer inline functions over macros anyway. + +Signed-off-by: Arnd Bergmann +Acked-by: Serge Hallyn +Cc: David Howells +Cc: Yaowei Bai +Cc: James Morris +Cc: "Paul E. McKenney" +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/capability.h | 2 -- + include/linux/cred.h | 5 ++++- + 2 files changed, 4 insertions(+), 3 deletions(-) + +--- a/include/linux/capability.h ++++ b/include/linux/capability.h +@@ -40,8 +40,6 @@ struct inode; + struct dentry; + struct user_namespace; + +-struct user_namespace *current_user_ns(void); +- + extern const kernel_cap_t __cap_empty_set; + extern const kernel_cap_t __cap_init_eff_set; + +--- a/include/linux/cred.h ++++ b/include/linux/cred.h +@@ -377,7 +377,10 @@ extern struct user_namespace init_user_n + #ifdef CONFIG_USER_NS + #define current_user_ns() (current_cred_xxx(user_ns)) + #else +-#define current_user_ns() (&init_user_ns) ++static inline struct user_namespace *current_user_ns(void) ++{ ++ return &init_user_ns; ++} + #endif + + diff --git a/queue-4.4/cx23885-dvb-move-initialization-of-a8293_pdata.patch b/queue-4.4/cx23885-dvb-move-initialization-of-a8293_pdata.patch new file mode 100644 index 00000000000..bc48c37d928 --- /dev/null +++ b/queue-4.4/cx23885-dvb-move-initialization-of-a8293_pdata.patch @@ -0,0 +1,64 @@ +From f0b0faff78c2c2e8efe843de55405a1f0470b8c4 Mon Sep 17 00:00:00 2001 +From: Mauro Carvalho Chehab +Date: Fri, 18 Dec 2015 14:22:21 -0200 +Subject: [media] cx23885-dvb: move initialization of a8293_pdata + +From: Mauro Carvalho Chehab + +commit f0b0faff78c2c2e8efe843de55405a1f0470b8c4 upstream. + +Smatch complains about where the au8293_data is placed: + +drivers/media/pci/cx23885/cx23885-dvb.c:2174 dvb_register() info: 'a8293_pdata' is not actually initialized (unreached code). + +It is not actually expected to have such initialization at + +switch { + foo = bar; + + case: +... +} + +Not really sure how gcc does that, but this is something that I would +expect that different compilers would do different things. + +David Howells checked with the compiler people: it's not really expected to +initialise as expected. + +So, move the initialization outside the switch(), making smatch to +shut up one warning. + +Acked-by: David Howells +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/pci/cx23885/cx23885-dvb.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/media/pci/cx23885/cx23885-dvb.c ++++ b/drivers/media/pci/cx23885/cx23885-dvb.c +@@ -2168,11 +2168,12 @@ static int dvb_register(struct cx23885_t + } + port->i2c_client_tuner = client_tuner; + break; +- case CX23885_BOARD_HAUPPAUGE_HVR5525: +- switch (port->nr) { ++ case CX23885_BOARD_HAUPPAUGE_HVR5525: { + struct m88rs6000t_config m88rs6000t_config; + struct a8293_platform_data a8293_pdata = {}; + ++ switch (port->nr) { ++ + /* port b - satellite */ + case 1: + /* attach frontend */ +@@ -2267,6 +2268,7 @@ static int dvb_register(struct cx23885_t + break; + } + break; ++ } + default: + printk(KERN_INFO "%s: The frontend of your DVB/ATSC card " + " isn't supported yet\n", diff --git a/queue-4.4/net-ti-cpmac-fix-compiler-warning-due-to-type-confusion.patch b/queue-4.4/net-ti-cpmac-fix-compiler-warning-due-to-type-confusion.patch new file mode 100644 index 00000000000..e6811f0aaac --- /dev/null +++ b/queue-4.4/net-ti-cpmac-fix-compiler-warning-due-to-type-confusion.patch @@ -0,0 +1,62 @@ +From 2f5281ba2a8feaf6f0aee93356f350855bb530fc Mon Sep 17 00:00:00 2001 +From: Paul Burton +Date: Fri, 2 Sep 2016 15:22:48 +0100 +Subject: net: ti: cpmac: Fix compiler warning due to type confusion + +From: Paul Burton + +commit 2f5281ba2a8feaf6f0aee93356f350855bb530fc upstream. + +cpmac_start_xmit() used the max() macro on skb->len (an unsigned int) +and ETH_ZLEN (a signed int literal). This led to the following compiler +warning: + + In file included from include/linux/list.h:8:0, + from include/linux/module.h:9, + from drivers/net/ethernet/ti/cpmac.c:19: + drivers/net/ethernet/ti/cpmac.c: In function 'cpmac_start_xmit': + include/linux/kernel.h:748:17: warning: comparison of distinct pointer + types lacks a cast + (void) (&_max1 == &_max2); \ + ^ + drivers/net/ethernet/ti/cpmac.c:560:8: note: in expansion of macro 'max' + len = max(skb->len, ETH_ZLEN); + ^ + +On top of this, it assigned the result of the max() macro to a signed +integer whilst all further uses of it result in it being cast to varying +widths of unsigned integer. + +Fix this up by using max_t to ensure the comparison is performed as +unsigned integers, and for consistency change the type of the len +variable to unsigned int. + +Signed-off-by: Paul Burton +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/ti/cpmac.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/ti/cpmac.c ++++ b/drivers/net/ethernet/ti/cpmac.c +@@ -549,7 +549,8 @@ fatal_error: + + static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev) + { +- int queue, len; ++ int queue; ++ unsigned int len; + struct cpmac_desc *desc; + struct cpmac_priv *priv = netdev_priv(dev); + +@@ -559,7 +560,7 @@ static int cpmac_start_xmit(struct sk_bu + if (unlikely(skb_padto(skb, ETH_ZLEN))) + return NETDEV_TX_OK; + +- len = max(skb->len, ETH_ZLEN); ++ len = max_t(unsigned int, skb->len, ETH_ZLEN); + queue = skb_get_queue_mapping(skb); + netif_stop_subqueue(dev, queue); + diff --git a/queue-4.4/net-vxge-avoid-unused-function-warnings.patch b/queue-4.4/net-vxge-avoid-unused-function-warnings.patch new file mode 100644 index 00000000000..70831f47053 --- /dev/null +++ b/queue-4.4/net-vxge-avoid-unused-function-warnings.patch @@ -0,0 +1,112 @@ +From 57e7c8cef224af166b8ec932b5e383641418c005 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 29 Jan 2016 12:39:13 +0100 +Subject: net: vxge: avoid unused function warnings + +From: Arnd Bergmann + +commit 57e7c8cef224af166b8ec932b5e383641418c005 upstream. + +When CONFIG_PCI_MSI is disabled, we get warnings about unused functions +in the vxge driver: + +drivers/net/ethernet/neterion/vxge/vxge-main.c:2121:13: warning: 'adaptive_coalesce_tx_interrupts' defined but not used [-Wunused-function] +drivers/net/ethernet/neterion/vxge/vxge-main.c:2149:13: warning: 'adaptive_coalesce_rx_interrupts' defined but not used [-Wunused-function] + +We could add another #ifdef here, but it's nicer to avoid those warnings +for good by converting the existing #ifdef to if(IS_ENABLED()), which has +the same effect but provides better compile-time coverage in general, +and lets the compiler understand better when the function is intentionally +unused. + +Signed-off-by: Arnd Bergmann +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/neterion/vxge/vxge-main.c | 31 +++++++++---------------- + 1 file changed, 12 insertions(+), 19 deletions(-) + +--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c ++++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c +@@ -2223,8 +2223,6 @@ static irqreturn_t vxge_isr_napi(int irq + return IRQ_NONE; + } + +-#ifdef CONFIG_PCI_MSI +- + static irqreturn_t vxge_tx_msix_handle(int irq, void *dev_id) + { + struct vxge_fifo *fifo = (struct vxge_fifo *)dev_id; +@@ -2442,16 +2440,13 @@ static void vxge_rem_msix_isr(struct vxg + if (vdev->config.intr_type == MSI_X) + pci_disable_msix(vdev->pdev); + } +-#endif + + static void vxge_rem_isr(struct vxgedev *vdev) + { +-#ifdef CONFIG_PCI_MSI +- if (vdev->config.intr_type == MSI_X) { ++ if (IS_ENABLED(CONFIG_PCI_MSI) && ++ vdev->config.intr_type == MSI_X) { + vxge_rem_msix_isr(vdev); +- } else +-#endif +- if (vdev->config.intr_type == INTA) { ++ } else if (vdev->config.intr_type == INTA) { + synchronize_irq(vdev->pdev->irq); + free_irq(vdev->pdev->irq, vdev); + } +@@ -2460,11 +2455,10 @@ static void vxge_rem_isr(struct vxgedev + static int vxge_add_isr(struct vxgedev *vdev) + { + int ret = 0; +-#ifdef CONFIG_PCI_MSI + int vp_idx = 0, intr_idx = 0, intr_cnt = 0, msix_idx = 0, irq_req = 0; + int pci_fun = PCI_FUNC(vdev->pdev->devfn); + +- if (vdev->config.intr_type == MSI_X) ++ if (IS_ENABLED(CONFIG_PCI_MSI) && vdev->config.intr_type == MSI_X) + ret = vxge_enable_msix(vdev); + + if (ret) { +@@ -2475,7 +2469,7 @@ static int vxge_add_isr(struct vxgedev * + vdev->config.intr_type = INTA; + } + +- if (vdev->config.intr_type == MSI_X) { ++ if (IS_ENABLED(CONFIG_PCI_MSI) && vdev->config.intr_type == MSI_X) { + for (intr_idx = 0; + intr_idx < (vdev->no_of_vpath * + VXGE_HW_VPATH_MSIX_ACTIVE); intr_idx++) { +@@ -2576,9 +2570,8 @@ static int vxge_add_isr(struct vxgedev * + vdev->vxge_entries[intr_cnt].in_use = 1; + vdev->vxge_entries[intr_cnt].arg = &vdev->vpaths[0]; + } +-INTA_MODE: +-#endif + ++INTA_MODE: + if (vdev->config.intr_type == INTA) { + snprintf(vdev->desc[0], VXGE_INTR_STRLEN, + "%s:vxge:INTA", vdev->ndev->name); +@@ -3889,12 +3882,12 @@ static void vxge_device_config_init(stru + if (max_mac_vpath > VXGE_MAX_MAC_ADDR_COUNT) + max_mac_vpath = VXGE_MAX_MAC_ADDR_COUNT; + +-#ifndef CONFIG_PCI_MSI +- vxge_debug_init(VXGE_ERR, +- "%s: This Kernel does not support " +- "MSI-X. Defaulting to INTA", VXGE_DRIVER_NAME); +- *intr_type = INTA; +-#endif ++ if (!IS_ENABLED(CONFIG_PCI_MSI)) { ++ vxge_debug_init(VXGE_ERR, ++ "%s: This Kernel does not support " ++ "MSI-X. Defaulting to INTA", VXGE_DRIVER_NAME); ++ *intr_type = INTA; ++ } + + /* Configure whether MSI-X or IRQL. */ + switch (*intr_type) { diff --git a/queue-4.4/powerpc-pci-rpadlpar-fix-device-reference-leaks.patch b/queue-4.4/powerpc-pci-rpadlpar-fix-device-reference-leaks.patch new file mode 100644 index 00000000000..dd57898ef0e --- /dev/null +++ b/queue-4.4/powerpc-pci-rpadlpar-fix-device-reference-leaks.patch @@ -0,0 +1,48 @@ +From 99e5cde5eae78bef95bfe7c16ccda87fb070149b Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Tue, 1 Nov 2016 16:26:03 +0100 +Subject: powerpc/pci/rpadlpar: Fix device reference leaks + +From: Johan Hovold + +commit 99e5cde5eae78bef95bfe7c16ccda87fb070149b upstream. + +Make sure to drop any device reference taken by vio_find_node() when +adding and removing virtual I/O slots. + +Fixes: 5eeb8c63a38f ("[PATCH] PCI Hotplug: rpaphp: Move VIO registration") +Signed-off-by: Johan Hovold +Signed-off-by: Michael Ellerman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pci/hotplug/rpadlpar_core.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/pci/hotplug/rpadlpar_core.c ++++ b/drivers/pci/hotplug/rpadlpar_core.c +@@ -258,8 +258,13 @@ static int dlpar_add_phb(char *drc_name, + + static int dlpar_add_vio_slot(char *drc_name, struct device_node *dn) + { +- if (vio_find_node(dn)) ++ struct vio_dev *vio_dev; ++ ++ vio_dev = vio_find_node(dn); ++ if (vio_dev) { ++ put_device(&vio_dev->dev); + return -EINVAL; ++ } + + if (!vio_register_device_node(dn)) { + printk(KERN_ERR +@@ -335,6 +340,9 @@ static int dlpar_remove_vio_slot(char *d + return -EINVAL; + + vio_unregister_device(vio_dev); ++ ++ put_device(&vio_dev->dev); ++ + return 0; + } + diff --git a/queue-4.4/series b/queue-4.4/series index 7c7ef4a443d..ff09a7d6257 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -91,3 +91,9 @@ crypto-arm64-sha1-ce-fix-for-big-endian.patch crypto-arm64-aes-xts-ce-fix-for-big-endian.patch crypto-arm64-aes-ce-fix-for-big-endian.patch md-md_recovery_needed-is-set-for-mddev-recovery.patch +powerpc-pci-rpadlpar-fix-device-reference-leaks.patch +staging-comedi-dt282x-tidy-up-register-bit-defines.patch +cred-userns-define-current_user_ns-as-a-function.patch +net-ti-cpmac-fix-compiler-warning-due-to-type-confusion.patch +net-vxge-avoid-unused-function-warnings.patch +cx23885-dvb-move-initialization-of-a8293_pdata.patch diff --git a/queue-4.4/staging-comedi-dt282x-tidy-up-register-bit-defines.patch b/queue-4.4/staging-comedi-dt282x-tidy-up-register-bit-defines.patch new file mode 100644 index 00000000000..7b2a518af78 --- /dev/null +++ b/queue-4.4/staging-comedi-dt282x-tidy-up-register-bit-defines.patch @@ -0,0 +1,119 @@ +From f6b1160eb27f990cc1c48b67a5f83cb63115284e Mon Sep 17 00:00:00 2001 +From: H Hartley Sweeten +Date: Thu, 17 Mar 2016 10:10:40 -0700 +Subject: staging: comedi: dt282x: tidy up register bit defines + +From: H Hartley Sweeten + +commit f6b1160eb27f990cc1c48b67a5f83cb63115284e upstream. + +Arnd Bergmann pointed out that gcc-6 warns about passing negative signed +integer into swab16() due to the macro expansion of 'outw'. + +It appears that the register map constants are causing the warnings. +Actually, it might just be the (1 << 15) ones... + +Convert all the constants as suggested by checkpatch.pl: +CHECK: Prefer using the BIT macro + +The BIT() macro will make all the constants explicitly 'unsigned', which +helps to avoid the warning. + +Fix the, unsused, DT2821_CHANCSR_PRESLA() macro. The "Present List +Address" (PRESLA) bits in the CHANCSR register are read only. This +define was meant to extract the bits from the read value. + +Signed-off-by: H Hartley Sweeten +Reported-by: Arnd Bergmann +Reviewed-by: Ian Abbott +Tested-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/comedi/drivers/dt282x.c | 65 ++++++++++++++++---------------- + 1 file changed, 33 insertions(+), 32 deletions(-) + +--- a/drivers/staging/comedi/drivers/dt282x.c ++++ b/drivers/staging/comedi/drivers/dt282x.c +@@ -69,48 +69,49 @@ + * Register map + */ + #define DT2821_ADCSR_REG 0x00 +-#define DT2821_ADCSR_ADERR (1 << 15) +-#define DT2821_ADCSR_ADCLK (1 << 9) +-#define DT2821_ADCSR_MUXBUSY (1 << 8) +-#define DT2821_ADCSR_ADDONE (1 << 7) +-#define DT2821_ADCSR_IADDONE (1 << 6) ++#define DT2821_ADCSR_ADERR BIT(15) ++#define DT2821_ADCSR_ADCLK BIT(9) ++#define DT2821_ADCSR_MUXBUSY BIT(8) ++#define DT2821_ADCSR_ADDONE BIT(7) ++#define DT2821_ADCSR_IADDONE BIT(6) + #define DT2821_ADCSR_GS(x) (((x) & 0x3) << 4) + #define DT2821_ADCSR_CHAN(x) (((x) & 0xf) << 0) + #define DT2821_CHANCSR_REG 0x02 +-#define DT2821_CHANCSR_LLE (1 << 15) +-#define DT2821_CHANCSR_PRESLA(x) (((x) & 0xf) >> 8) ++#define DT2821_CHANCSR_LLE BIT(15) ++#define DT2821_CHANCSR_TO_PRESLA(x) (((x) >> 8) & 0xf) + #define DT2821_CHANCSR_NUMB(x) ((((x) - 1) & 0xf) << 0) + #define DT2821_ADDAT_REG 0x04 + #define DT2821_DACSR_REG 0x06 +-#define DT2821_DACSR_DAERR (1 << 15) ++#define DT2821_DACSR_DAERR BIT(15) + #define DT2821_DACSR_YSEL(x) ((x) << 9) +-#define DT2821_DACSR_SSEL (1 << 8) +-#define DT2821_DACSR_DACRDY (1 << 7) +-#define DT2821_DACSR_IDARDY (1 << 6) +-#define DT2821_DACSR_DACLK (1 << 5) +-#define DT2821_DACSR_HBOE (1 << 1) +-#define DT2821_DACSR_LBOE (1 << 0) ++#define DT2821_DACSR_SSEL BIT(8) ++#define DT2821_DACSR_DACRDY BIT(7) ++#define DT2821_DACSR_IDARDY BIT(6) ++#define DT2821_DACSR_DACLK BIT(5) ++#define DT2821_DACSR_HBOE BIT(1) ++#define DT2821_DACSR_LBOE BIT(0) + #define DT2821_DADAT_REG 0x08 + #define DT2821_DIODAT_REG 0x0a + #define DT2821_SUPCSR_REG 0x0c +-#define DT2821_SUPCSR_DMAD (1 << 15) +-#define DT2821_SUPCSR_ERRINTEN (1 << 14) +-#define DT2821_SUPCSR_CLRDMADNE (1 << 13) +-#define DT2821_SUPCSR_DDMA (1 << 12) +-#define DT2821_SUPCSR_DS_PIO (0 << 10) +-#define DT2821_SUPCSR_DS_AD_CLK (1 << 10) +-#define DT2821_SUPCSR_DS_DA_CLK (2 << 10) +-#define DT2821_SUPCSR_DS_AD_TRIG (3 << 10) +-#define DT2821_SUPCSR_BUFFB (1 << 9) +-#define DT2821_SUPCSR_SCDN (1 << 8) +-#define DT2821_SUPCSR_DACON (1 << 7) +-#define DT2821_SUPCSR_ADCINIT (1 << 6) +-#define DT2821_SUPCSR_DACINIT (1 << 5) +-#define DT2821_SUPCSR_PRLD (1 << 4) +-#define DT2821_SUPCSR_STRIG (1 << 3) +-#define DT2821_SUPCSR_XTRIG (1 << 2) +-#define DT2821_SUPCSR_XCLK (1 << 1) +-#define DT2821_SUPCSR_BDINIT (1 << 0) ++#define DT2821_SUPCSR_DMAD BIT(15) ++#define DT2821_SUPCSR_ERRINTEN BIT(14) ++#define DT2821_SUPCSR_CLRDMADNE BIT(13) ++#define DT2821_SUPCSR_DDMA BIT(12) ++#define DT2821_SUPCSR_DS(x) (((x) & 0x3) << 10) ++#define DT2821_SUPCSR_DS_PIO DT2821_SUPCSR_DS(0) ++#define DT2821_SUPCSR_DS_AD_CLK DT2821_SUPCSR_DS(1) ++#define DT2821_SUPCSR_DS_DA_CLK DT2821_SUPCSR_DS(2) ++#define DT2821_SUPCSR_DS_AD_TRIG DT2821_SUPCSR_DS(3) ++#define DT2821_SUPCSR_BUFFB BIT(9) ++#define DT2821_SUPCSR_SCDN BIT(8) ++#define DT2821_SUPCSR_DACON BIT(7) ++#define DT2821_SUPCSR_ADCINIT BIT(6) ++#define DT2821_SUPCSR_DACINIT BIT(5) ++#define DT2821_SUPCSR_PRLD BIT(4) ++#define DT2821_SUPCSR_STRIG BIT(3) ++#define DT2821_SUPCSR_XTRIG BIT(2) ++#define DT2821_SUPCSR_XCLK BIT(1) ++#define DT2821_SUPCSR_BDINIT BIT(0) + #define DT2821_TMRCTR_REG 0x0e + + static const struct comedi_lrange range_dt282x_ai_lo_bipolar = {