From: Greg Kroah-Hartman Date: Thu, 27 Apr 2017 14:28:45 +0000 (+0200) Subject: 3.18-stable patches X-Git-Tag: v4.4.65~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c67f608e9e370c4475c34f7461b450e6ebeb7f23;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: aic94xx-skip-reading-user-settings-if-flash-is-not-found.patch arm-8296-1-cache-l2x0-clean-up-aurora-cache-handling.patch brcmfmac-avoid-gcc-5.1-warning.patch btrfs-fix-state-private-cast-on-32-bit-machines.patch gfs2-avoid-uninitialized-variable-warning.patch hostap-avoid-uninitialized-variable-use-in-hfa384x_get_rid.patch kconfig-tinyconfig-provide-whole-choice-blocks-to-avoid-warnings.patch mips-msp71xx-remove-odd-locking-in-pci-config-space-access-code.patch mips-ralink-cosmetic-change-to-prom_init.patch misc-ioc4-simplify-wave-period-measurement-in-clock_calibrate.patch mmc-sunxi-avoid-invalid-pointer-calculation.patch net-tulip-turn-compile-time-warning-into-dev_warn.patch net-vxge-avoid-unused-function-warnings.patch tty-nozomi-avoid-a-harmless-gcc-warning.patch --- diff --git a/queue-3.18/aic94xx-skip-reading-user-settings-if-flash-is-not-found.patch b/queue-3.18/aic94xx-skip-reading-user-settings-if-flash-is-not-found.patch new file mode 100644 index 00000000000..4a6433c8537 --- /dev/null +++ b/queue-3.18/aic94xx-skip-reading-user-settings-if-flash-is-not-found.patch @@ -0,0 +1,52 @@ +From 36dd5acd196574d41de3e81d8264df475bbb7123 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Mon, 6 Jul 2015 13:07:58 +0200 +Subject: aic94xx: Skip reading user settings if flash is not found + +From: Hannes Reinecke + +commit 36dd5acd196574d41de3e81d8264df475bbb7123 upstream. + +If no user settings are found it's pointless trying to +read them from flash. So skip that step. +This also fixes a compilation warning about uninitialized variables in +aic94xx. + +Signed-off-by: Hannes Reinecke +Reviewed-by: Christoph Hellwig +Signed-off-by: James Bottomley +Cc: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/aic94xx/aic94xx_sds.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/aic94xx/aic94xx_sds.c ++++ b/drivers/scsi/aic94xx/aic94xx_sds.c +@@ -983,7 +983,7 @@ static int asd_process_ctrl_a_user(struc + { + int err, i; + u32 offs, size; +- struct asd_ll_el *el; ++ struct asd_ll_el *el = NULL; + struct asd_ctrla_phy_settings *ps; + struct asd_ctrla_phy_settings dflt_ps; + +@@ -1004,6 +1004,7 @@ static int asd_process_ctrl_a_user(struc + + size = sizeof(struct asd_ctrla_phy_settings); + ps = &dflt_ps; ++ goto out_process; + } + + if (size == 0) +@@ -1028,7 +1029,7 @@ static int asd_process_ctrl_a_user(struc + ASD_DPRINTK("couldn't find ctrla phy settings struct\n"); + goto out2; + } +- ++out_process: + err = asd_process_ctrla_phy_settings(asd_ha, ps); + if (err) { + ASD_DPRINTK("couldn't process ctrla phy settings\n"); diff --git a/queue-3.18/arm-8296-1-cache-l2x0-clean-up-aurora-cache-handling.patch b/queue-3.18/arm-8296-1-cache-l2x0-clean-up-aurora-cache-handling.patch new file mode 100644 index 00000000000..eb4663d5a44 --- /dev/null +++ b/queue-3.18/arm-8296-1-cache-l2x0-clean-up-aurora-cache-handling.patch @@ -0,0 +1,189 @@ +From 20e783e39e55c2615fb61d1b3d139ee9edcf6772 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Wed, 28 Jan 2015 17:54:38 +0100 +Subject: ARM: 8296/1: cache-l2x0: clean up aurora cache handling + +From: Arnd Bergmann + +commit 20e783e39e55c2615fb61d1b3d139ee9edcf6772 upstream. + +The aurora cache controller is the only remaining user of a couple +of functions in this file and are completely unused when that is +disabled, leading to build warnings: + +arch/arm/mm/cache-l2x0.c:167:13: warning: 'l2x0_cache_sync' defined but not used [-Wunused-function] +arch/arm/mm/cache-l2x0.c:184:13: warning: 'l2x0_flush_all' defined but not used [-Wunused-function] +arch/arm/mm/cache-l2x0.c:194:13: warning: 'l2x0_disable' defined but not used [-Wunused-function] + +With the knowledge that the code is now aurora-specific, we can +simplify it noticeably: + +- The pl310 errata workarounds are not needed on aurora and can be removed +- As confirmed by Thomas Petazzoni from the data sheet, the cache_wait() + macro is never needed. +- No need to hold the lock across atomic cache sync +- We can load the l2x0_base into a local variable across operations + +There should be no functional change in this patch, but readability +and the generated object code improves, along with avoiding the +warnings. + + (on Armada 370 RD and Armada XP GP, boot tested, plus a little bit of + DMA traffic by reading data from a SD card) + +Acked-by: Thomas Petazzoni +Tested-by: Thomas Petazzoni +Signed-off-by: Arnd Bergmann +Signed-off-by: Russell King +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mm/cache-l2x0.c | 111 ++++++++++++++++------------------------------- + 1 file changed, 38 insertions(+), 73 deletions(-) + +--- a/arch/arm/mm/cache-l2x0.c ++++ b/arch/arm/mm/cache-l2x0.c +@@ -136,73 +136,6 @@ static void l2c_disable(void) + dsb(st); + } + +-#ifdef CONFIG_CACHE_PL310 +-static inline void cache_wait(void __iomem *reg, unsigned long mask) +-{ +- /* cache operations by line are atomic on PL310 */ +-} +-#else +-#define cache_wait l2c_wait_mask +-#endif +- +-static inline void cache_sync(void) +-{ +- void __iomem *base = l2x0_base; +- +- writel_relaxed(0, base + sync_reg_offset); +- cache_wait(base + L2X0_CACHE_SYNC, 1); +-} +- +-#if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915) +-static inline void debug_writel(unsigned long val) +-{ +- l2c_set_debug(l2x0_base, val); +-} +-#else +-/* Optimised out for non-errata case */ +-static inline void debug_writel(unsigned long val) +-{ +-} +-#endif +- +-static void l2x0_cache_sync(void) +-{ +- unsigned long flags; +- +- raw_spin_lock_irqsave(&l2x0_lock, flags); +- cache_sync(); +- raw_spin_unlock_irqrestore(&l2x0_lock, flags); +-} +- +-static void __l2x0_flush_all(void) +-{ +- debug_writel(0x03); +- __l2c_op_way(l2x0_base + L2X0_CLEAN_INV_WAY); +- cache_sync(); +- debug_writel(0x00); +-} +- +-static void l2x0_flush_all(void) +-{ +- unsigned long flags; +- +- /* clean all ways */ +- raw_spin_lock_irqsave(&l2x0_lock, flags); +- __l2x0_flush_all(); +- raw_spin_unlock_irqrestore(&l2x0_lock, flags); +-} +- +-static void l2x0_disable(void) +-{ +- unsigned long flags; +- +- raw_spin_lock_irqsave(&l2x0_lock, flags); +- __l2x0_flush_all(); +- l2c_write_sec(0, l2x0_base, L2X0_CTRL); +- dsb(st); +- raw_spin_unlock_irqrestore(&l2x0_lock, flags); +-} +- + static void l2c_save(void __iomem *base) + { + l2x0_saved_regs.aux_ctrl = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); +@@ -1257,14 +1190,15 @@ static unsigned long calc_range_end(unsi + static void aurora_pa_range(unsigned long start, unsigned long end, + unsigned long offset) + { ++ void __iomem *base = l2x0_base; + unsigned long flags; + + raw_spin_lock_irqsave(&l2x0_lock, flags); +- writel_relaxed(start, l2x0_base + AURORA_RANGE_BASE_ADDR_REG); +- writel_relaxed(end, l2x0_base + offset); ++ writel_relaxed(start, base + AURORA_RANGE_BASE_ADDR_REG); ++ writel_relaxed(end, base + offset); + raw_spin_unlock_irqrestore(&l2x0_lock, flags); + +- cache_sync(); ++ writel_relaxed(0, base + AURORA_SYNC_REG); + } + + static void aurora_inv_range(unsigned long start, unsigned long end) +@@ -1324,6 +1258,37 @@ static void aurora_flush_range(unsigned + } + } + ++static void aurora_flush_all(void) ++{ ++ void __iomem *base = l2x0_base; ++ unsigned long flags; ++ ++ /* clean all ways */ ++ raw_spin_lock_irqsave(&l2x0_lock, flags); ++ __l2c_op_way(base + L2X0_CLEAN_INV_WAY); ++ raw_spin_unlock_irqrestore(&l2x0_lock, flags); ++ ++ writel_relaxed(0, base + AURORA_SYNC_REG); ++} ++ ++static void aurora_cache_sync(void) ++{ ++ writel_relaxed(0, l2x0_base + AURORA_SYNC_REG); ++} ++ ++static void aurora_disable(void) ++{ ++ void __iomem *base = l2x0_base; ++ unsigned long flags; ++ ++ raw_spin_lock_irqsave(&l2x0_lock, flags); ++ __l2c_op_way(base + L2X0_CLEAN_INV_WAY); ++ writel_relaxed(0, base + AURORA_SYNC_REG); ++ l2c_write_sec(0, base, L2X0_CTRL); ++ dsb(st); ++ raw_spin_unlock_irqrestore(&l2x0_lock, flags); ++} ++ + static void aurora_save(void __iomem *base) + { + l2x0_saved_regs.ctrl = readl_relaxed(base + L2X0_CTRL); +@@ -1398,9 +1363,9 @@ static const struct l2c_init_data of_aur + .inv_range = aurora_inv_range, + .clean_range = aurora_clean_range, + .flush_range = aurora_flush_range, +- .flush_all = l2x0_flush_all, +- .disable = l2x0_disable, +- .sync = l2x0_cache_sync, ++ .flush_all = aurora_flush_all, ++ .disable = aurora_disable, ++ .sync = aurora_cache_sync, + .resume = aurora_resume, + }, + }; diff --git a/queue-3.18/brcmfmac-avoid-gcc-5.1-warning.patch b/queue-3.18/brcmfmac-avoid-gcc-5.1-warning.patch new file mode 100644 index 00000000000..8661b181741 --- /dev/null +++ b/queue-3.18/brcmfmac-avoid-gcc-5.1-warning.patch @@ -0,0 +1,39 @@ +From 22f44150aad7a1d6b074ab6cf59abee61c7187c6 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Tue, 12 May 2015 23:54:25 +0200 +Subject: brcmfmac: avoid gcc-5.1 warning + +From: Arnd Bergmann + +commit 22f44150aad7a1d6b074ab6cf59abee61c7187c6 upstream. + +gcc-5.0 gained a new warning in the fwsignal portion of the brcmfmac +driver: + +drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c: In function 'brcmf_fws_txs_process': +drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:1478:8: warning: 'skb' may be used uninitialized in this function [-Wmaybe-uninitialized] + +This is a false positive, and marking the brcmf_fws_hanger_poppkt function +as 'static inline' makes the warning go away. I have checked the object +file output and while a little code gets moved around, the size of +the binary remains identical. + +Signed-off-by: Arnd Bergmann +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +@@ -635,7 +635,7 @@ static int brcmf_fws_hanger_pushpkt(stru + return 0; + } + +-static int brcmf_fws_hanger_poppkt(struct brcmf_fws_hanger *h, ++static inline int brcmf_fws_hanger_poppkt(struct brcmf_fws_hanger *h, + u32 slot_id, struct sk_buff **pktout, + bool remove_item) + { diff --git a/queue-3.18/btrfs-fix-state-private-cast-on-32-bit-machines.patch b/queue-3.18/btrfs-fix-state-private-cast-on-32-bit-machines.patch new file mode 100644 index 00000000000..940a17b3e80 --- /dev/null +++ b/queue-3.18/btrfs-fix-state-private-cast-on-32-bit-machines.patch @@ -0,0 +1,45 @@ +From 6e1103a6e9b19dbdc348077d04a546b626911fc5 Mon Sep 17 00:00:00 2001 +From: Satoru Takeuchi +Date: Thu, 25 Dec 2014 18:21:41 +0900 +Subject: btrfs: fix state->private cast on 32 bit machines +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Satoru Takeuchi + +commit 6e1103a6e9b19dbdc348077d04a546b626911fc5 upstream. + +Suppress the following warning displayed on building 32bit (i686) kernel. + +=============================================================================== +... + CC [M] fs/btrfs/extent_io.o +fs/btrfs/extent_io.c: In function ‘btrfs_free_io_failure_record’: +fs/btrfs/extent_io.c:2193:13: warning: cast to pointer from integer of +different size [-Wint-to-pointer-cast] + failrec = (struct io_failure_record *)state->private; +... +=============================================================================== + +Signed-off-by: Satoru Takeuchi +Reported-by: Chris Murphy +Signed-off-by: Chris Mason +Cc: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + fs/btrfs/extent_io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/btrfs/extent_io.c ++++ b/fs/btrfs/extent_io.c +@@ -2163,7 +2163,7 @@ void btrfs_free_io_failure_record(struct + + next = next_state(state); + +- failrec = (struct io_failure_record *)state->private; ++ failrec = (struct io_failure_record *)(unsigned long)state->private; + free_extent_state(state); + kfree(failrec); + diff --git a/queue-3.18/gfs2-avoid-uninitialized-variable-warning.patch b/queue-3.18/gfs2-avoid-uninitialized-variable-warning.patch new file mode 100644 index 00000000000..76c5864b866 --- /dev/null +++ b/queue-3.18/gfs2-avoid-uninitialized-variable-warning.patch @@ -0,0 +1,51 @@ +From 67893f12e5374bbcaaffbc6e570acbc2714ea884 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Tue, 26 Jan 2016 13:08:10 -0500 +Subject: gfs2: avoid uninitialized variable warning + +From: Arnd Bergmann + +commit 67893f12e5374bbcaaffbc6e570acbc2714ea884 upstream. + +We get a bogus warning about a potential uninitialized variable +use in gfs2, because the compiler does not figure out that we +never use the leaf number if get_leaf_nr() returns an error: + +fs/gfs2/dir.c: In function 'get_first_leaf': +fs/gfs2/dir.c:802:9: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized] +fs/gfs2/dir.c: In function 'dir_split_leaf': +fs/gfs2/dir.c:1021:8: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized] + +Changing the 'if (!error)' to 'if (!IS_ERR_VALUE(error))' is +sufficient to let gcc understand that this is exactly the same +condition as in IS_ERR() so it can optimize the code path enough +to understand it. + +Signed-off-by: Arnd Bergmann +Signed-off-by: Bob Peterson +Signed-off-by: Greg Kroah-Hartman + +--- + fs/gfs2/dir.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/fs/gfs2/dir.c ++++ b/fs/gfs2/dir.c +@@ -764,7 +764,7 @@ static int get_first_leaf(struct gfs2_in + int error; + + error = get_leaf_nr(dip, index, &leaf_no); +- if (!error) ++ if (!IS_ERR_VALUE(error)) + error = get_leaf(dip, leaf_no, bh_out); + + return error; +@@ -980,7 +980,7 @@ static int dir_split_leaf(struct inode * + + index = name->hash >> (32 - dip->i_depth); + error = get_leaf_nr(dip, index, &leaf_no); +- if (error) ++ if (IS_ERR_VALUE(error)) + return error; + + /* Get the old leaf block */ diff --git a/queue-3.18/hostap-avoid-uninitialized-variable-use-in-hfa384x_get_rid.patch b/queue-3.18/hostap-avoid-uninitialized-variable-use-in-hfa384x_get_rid.patch new file mode 100644 index 00000000000..650270fa34c --- /dev/null +++ b/queue-3.18/hostap-avoid-uninitialized-variable-use-in-hfa384x_get_rid.patch @@ -0,0 +1,69 @@ +From 48dc5fb3ba53b20418de8514700f63d88c5de3a3 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 28 Jan 2016 22:58:28 +0100 +Subject: hostap: avoid uninitialized variable use in hfa384x_get_rid + +From: Arnd Bergmann + +commit 48dc5fb3ba53b20418de8514700f63d88c5de3a3 upstream. + +The driver reads a value from hfa384x_from_bap(), which may fail, +and then assigns the value to a local variable. gcc detects that +in in the failure case, the 'rlen' variable now contains +uninitialized data: + +In file included from ../drivers/net/wireless/intersil/hostap/hostap_pci.c:220:0: +drivers/net/wireless/intersil/hostap/hostap_hw.c: In function 'hfa384x_get_rid': +drivers/net/wireless/intersil/hostap/hostap_hw.c:842:5: warning: 'rec' may be used uninitialized in this function [-Wmaybe-uninitialized] + if (le16_to_cpu(rec.len) == 0) { + +This restructures the function as suggested by Russell King, to +make it more readable and get more reliable error handling, by +handling each failure mode using a goto. + +Signed-off-by: Arnd Bergmann +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/hostap/hostap_hw.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/hostap/hostap_hw.c ++++ b/drivers/net/wireless/hostap/hostap_hw.c +@@ -836,25 +836,30 @@ static int hfa384x_get_rid(struct net_de + spin_lock_bh(&local->baplock); + + res = hfa384x_setup_bap(dev, BAP0, rid, 0); +- if (!res) +- res = hfa384x_from_bap(dev, BAP0, &rec, sizeof(rec)); ++ if (res) ++ goto unlock; ++ ++ res = hfa384x_from_bap(dev, BAP0, &rec, sizeof(rec)); ++ if (res) ++ goto unlock; + + if (le16_to_cpu(rec.len) == 0) { + /* RID not available */ + res = -ENODATA; ++ goto unlock; + } + + rlen = (le16_to_cpu(rec.len) - 1) * 2; +- if (!res && exact_len && rlen != len) { ++ if (exact_len && rlen != len) { + printk(KERN_DEBUG "%s: hfa384x_get_rid - RID len mismatch: " + "rid=0x%04x, len=%d (expected %d)\n", + dev->name, rid, rlen, len); + res = -ENODATA; + } + +- if (!res) +- res = hfa384x_from_bap(dev, BAP0, buf, len); ++ res = hfa384x_from_bap(dev, BAP0, buf, len); + ++unlock: + spin_unlock_bh(&local->baplock); + mutex_unlock(&local->rid_bap_mtx); + diff --git a/queue-3.18/kconfig-tinyconfig-provide-whole-choice-blocks-to-avoid-warnings.patch b/queue-3.18/kconfig-tinyconfig-provide-whole-choice-blocks-to-avoid-warnings.patch new file mode 100644 index 00000000000..b8063c16ea6 --- /dev/null +++ b/queue-3.18/kconfig-tinyconfig-provide-whole-choice-blocks-to-avoid-warnings.patch @@ -0,0 +1,71 @@ +From 236dec051078a8691950f56949612b4b74107e48 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 1 Sep 2016 16:14:47 -0700 +Subject: kconfig: tinyconfig: provide whole choice blocks to avoid warnings + +From: Arnd Bergmann + +commit 236dec051078a8691950f56949612b4b74107e48 upstream. + +Using "make tinyconfig" produces a couple of annoying warnings that show +up for build test machines all the time: + + .config:966:warning: override: NOHIGHMEM changes choice state + .config:965:warning: override: SLOB changes choice state + .config:963:warning: override: KERNEL_XZ changes choice state + .config:962:warning: override: CC_OPTIMIZE_FOR_SIZE changes choice state + .config:933:warning: override: SLOB changes choice state + .config:930:warning: override: CC_OPTIMIZE_FOR_SIZE changes choice state + .config:870:warning: override: SLOB changes choice state + .config:868:warning: override: KERNEL_XZ changes choice state + .config:867:warning: override: CC_OPTIMIZE_FOR_SIZE changes choice state + +I've made a previous attempt at fixing them and we discussed a number of +alternatives. + +I tried changing the Makefile to use "merge_config.sh -n +$(fragment-list)" but couldn't get that to work properly. + +This is yet another approach, based on the observation that we do want +to see a warning for conflicting 'choice' options, and that we can +simply make them non-conflicting by listing all other options as +disabled. This is a trivial patch that we can apply independent of +plans for other changes. + +Link: http://lkml.kernel.org/r/20160829214952.1334674-2-arnd@arndb.de +Link: https://storage.kernelci.org/mainline/v4.7-rc6/x86-tinyconfig/build.log +https://patchwork.kernel.org/patch/9212749/ +Signed-off-by: Arnd Bergmann +Reviewed-by: Josh Triplett +Reviewed-by: Masahiro Yamada +Acked-by: Ingo Molnar +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/configs/tiny.config | 2 ++ + kernel/configs/tiny.config | 8 ++++++++ + 2 files changed, 10 insertions(+) + +--- a/arch/x86/configs/tiny.config ++++ b/arch/x86/configs/tiny.config +@@ -1 +1,3 @@ + CONFIG_NOHIGHMEM=y ++# CONFIG_HIGHMEM4G is not set ++# CONFIG_HIGHMEM64G is not set +--- a/kernel/configs/tiny.config ++++ b/kernel/configs/tiny.config +@@ -1,4 +1,12 @@ ++# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set + CONFIG_CC_OPTIMIZE_FOR_SIZE=y ++# CONFIG_KERNEL_GZIP is not set ++# CONFIG_KERNEL_BZIP2 is not set ++# CONFIG_KERNEL_LZMA is not set + CONFIG_KERNEL_XZ=y ++# CONFIG_KERNEL_LZO is not set ++# CONFIG_KERNEL_LZ4 is not set + CONFIG_OPTIMIZE_INLINING=y ++# CONFIG_SLAB is not set ++# CONFIG_SLUB is not set + CONFIG_SLOB=y diff --git a/queue-3.18/mips-msp71xx-remove-odd-locking-in-pci-config-space-access-code.patch b/queue-3.18/mips-msp71xx-remove-odd-locking-in-pci-config-space-access-code.patch new file mode 100644 index 00000000000..280364da7f4 --- /dev/null +++ b/queue-3.18/mips-msp71xx-remove-odd-locking-in-pci-config-space-access-code.patch @@ -0,0 +1,73 @@ +From c4a305374bbf36414515d2ae00d588c67051e67d Mon Sep 17 00:00:00 2001 +From: Sergey Ryazanov +Date: Sat, 30 Aug 2014 06:06:25 +0400 +Subject: MIPS: MSP71xx: remove odd locking in PCI config space access code + +From: Sergey Ryazanov + +commit c4a305374bbf36414515d2ae00d588c67051e67d upstream. + +Caller (generic PCI code) already do proper locking so no need to add +another one here. + +Signed-off-by: Sergey Ryazanov +Cc: Linux MIPS +Patchwork: https://patchwork.linux-mips.org/patch/7601/ +Signed-off-by: Ralf Baechle +Cc: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/pci/ops-pmcmsp.c | 12 ------------ + 1 file changed, 12 deletions(-) + +--- a/arch/mips/pci/ops-pmcmsp.c ++++ b/arch/mips/pci/ops-pmcmsp.c +@@ -193,8 +193,6 @@ static void pci_proc_init(void) + } + #endif /* CONFIG_PROC_FS && PCI_COUNTERS */ + +-static DEFINE_SPINLOCK(bpci_lock); +- + /***************************************************************************** + * + * STRUCT: pci_io_resource +@@ -368,7 +366,6 @@ int msp_pcibios_config_access(unsigned c + struct msp_pci_regs *preg = (void *)PCI_BASE_REG; + unsigned char bus_num = bus->number; + unsigned char dev_fn = (unsigned char)devfn; +- unsigned long flags; + unsigned long intr; + unsigned long value; + static char pciirqflag; +@@ -401,10 +398,7 @@ int msp_pcibios_config_access(unsigned c + } + + #if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL) +- local_irq_save(flags); + vpe_status = dvpe(); +-#else +- spin_lock_irqsave(&bpci_lock, flags); + #endif + + /* +@@ -457,9 +451,6 @@ int msp_pcibios_config_access(unsigned c + + #if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL) + evpe(vpe_status); +- local_irq_restore(flags); +-#else +- spin_unlock_irqrestore(&bpci_lock, flags); + #endif + + return -1; +@@ -467,9 +458,6 @@ int msp_pcibios_config_access(unsigned c + + #if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL) + evpe(vpe_status); +- local_irq_restore(flags); +-#else +- spin_unlock_irqrestore(&bpci_lock, flags); + #endif + + return PCIBIOS_SUCCESSFUL; diff --git a/queue-3.18/mips-ralink-cosmetic-change-to-prom_init.patch b/queue-3.18/mips-ralink-cosmetic-change-to-prom_init.patch new file mode 100644 index 00000000000..dfa5cf6f82d --- /dev/null +++ b/queue-3.18/mips-ralink-cosmetic-change-to-prom_init.patch @@ -0,0 +1,54 @@ +From 9c48568b3692f1a56cbf1935e4eea835e6b185b1 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 20 Dec 2016 19:12:46 +0100 +Subject: MIPS: ralink: Cosmetic change to prom_init(). + +From: John Crispin + +commit 9c48568b3692f1a56cbf1935e4eea835e6b185b1 upstream. + +Over the years the code has been changed various times leading to +argc/argv being defined in a different function to where we actually +use the variables. Clean this up by moving them to prom_init_cmdline(). + +Signed-off-by: John Crispin +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/14902/ +Signed-off-by: Ralf Baechle +Cc: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/ralink/prom.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/arch/mips/ralink/prom.c ++++ b/arch/mips/ralink/prom.c +@@ -24,8 +24,10 @@ const char *get_system_type(void) + return soc_info.sys_type; + } + +-static __init void prom_init_cmdline(int argc, char **argv) ++static __init void prom_init_cmdline(void) + { ++ int argc; ++ char **argv; + int i; + + pr_debug("prom: fw_arg0=%08x fw_arg1=%08x fw_arg2=%08x fw_arg3=%08x\n", +@@ -54,14 +56,11 @@ static __init void prom_init_cmdline(int + + void __init prom_init(void) + { +- int argc; +- char **argv; +- + prom_soc_init(&soc_info); + + pr_info("SoC Type: %s\n", get_system_type()); + +- prom_init_cmdline(argc, argv); ++ prom_init_cmdline(); + } + + void __init prom_free_prom_memory(void) diff --git a/queue-3.18/misc-ioc4-simplify-wave-period-measurement-in-clock_calibrate.patch b/queue-3.18/misc-ioc4-simplify-wave-period-measurement-in-clock_calibrate.patch new file mode 100644 index 00000000000..47c82f3937f --- /dev/null +++ b/queue-3.18/misc-ioc4-simplify-wave-period-measurement-in-clock_calibrate.patch @@ -0,0 +1,83 @@ +From 769105aa740dc0428f2585ec99c457d30aaab364 Mon Sep 17 00:00:00 2001 +From: Richard Leitner +Date: Mon, 8 Dec 2014 16:28:10 +0100 +Subject: misc: ioc4: simplify wave period measurement in clock_calibrate +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Richard Leitner + +commit 769105aa740dc0428f2585ec99c457d30aaab364 upstream. + +The loop for measuring the square wave periods over some cycles is +refactored to be more easily readable. This includes avoiding a +"by-hand-implemented" for loop with a "real" one and adding some +comments. + +Furthermore the following compiler warning is avoided by this patch: +drivers/misc/ioc4.c: In function ‘ioc4_probe’: +drivers/misc/ioc4.c:194:16: warning: ‘start’ may be used uninitialized +in this function [-Wmaybe-uninitialized] + period = (end - start) / + ^ +drivers/misc/ioc4.c:148:11: note: ‘start’ was declared here + uint64_t start, end, period; + ^ + +Signed-off-by: Richard Leitner +Acked-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/misc/ioc4.c | 31 ++++++++++++++++--------------- + 1 file changed, 16 insertions(+), 15 deletions(-) + +--- a/drivers/misc/ioc4.c ++++ b/drivers/misc/ioc4.c +@@ -144,9 +144,9 @@ ioc4_clock_calibrate(struct ioc4_driver_ + { + union ioc4_int_out int_out; + union ioc4_gpcr gpcr; +- unsigned int state, last_state = 1; ++ unsigned int state, last_state; + uint64_t start, end, period; +- unsigned int count = 0; ++ unsigned int count; + + /* Enable output */ + gpcr.raw = 0; +@@ -167,19 +167,20 @@ ioc4_clock_calibrate(struct ioc4_driver_ + mmiowb(); + + /* Check square wave period averaged over some number of cycles */ +- do { +- int_out.raw = readl(&idd->idd_misc_regs->int_out.raw); +- state = int_out.fields.int_out; +- if (!last_state && state) { +- count++; +- if (count == IOC4_CALIBRATE_END) { +- end = ktime_get_ns(); +- break; +- } else if (count == IOC4_CALIBRATE_DISCARD) +- start = ktime_get_ns(); +- } +- last_state = state; +- } while (1); ++ start = ktime_get_ns(); ++ state = 1; /* make sure the first read isn't a rising edge */ ++ for (count = 0; count <= IOC4_CALIBRATE_END; count++) { ++ do { /* wait for a rising edge */ ++ last_state = state; ++ int_out.raw = readl(&idd->idd_misc_regs->int_out.raw); ++ state = int_out.fields.int_out; ++ } while (last_state || !state); ++ ++ /* discard the first few cycles */ ++ if (count == IOC4_CALIBRATE_DISCARD) ++ start = ktime_get_ns(); ++ } ++ end = ktime_get_ns(); + + /* Calculation rearranged to preserve intermediate precision. + * Logically: diff --git a/queue-3.18/mmc-sunxi-avoid-invalid-pointer-calculation.patch b/queue-3.18/mmc-sunxi-avoid-invalid-pointer-calculation.patch new file mode 100644 index 00000000000..d47e35080fd --- /dev/null +++ b/queue-3.18/mmc-sunxi-avoid-invalid-pointer-calculation.patch @@ -0,0 +1,55 @@ +From d34712d2e3db9b241d0484a6e3839c6b7ef9df78 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Tue, 24 Feb 2015 10:47:27 +0100 +Subject: mmc: sunxi: avoid invalid pointer calculation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Arnd Bergmann + +commit d34712d2e3db9b241d0484a6e3839c6b7ef9df78 upstream. + +The sunxi mmc driver tries to calculate a dma address by using pointer +arithmetic, which causes a warning when dma_addr_t is wider than a pointer: + +drivers/mmc/host/sunxi-mmc.c: In function 'sunxi_mmc_init_idma_des': +drivers/mmc/host/sunxi-mmc.c:296:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] + struct sunxi_idma_des *pdes_pa = (struct sunxi_idma_des *)host->sg_dma; + ^ + +To avoid this warning and to simplify the logic, this changes +the code to avoid the cast and calculate the correct address +manually. The behavior should be unchanged. + +Signed-off-by: Arnd Bergmann +Acked-by: David Lanzendörfer +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mmc/host/sunxi-mmc.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/mmc/host/sunxi-mmc.c ++++ b/drivers/mmc/host/sunxi-mmc.c +@@ -294,7 +294,7 @@ static void sunxi_mmc_init_idma_des(stru + struct mmc_data *data) + { + struct sunxi_idma_des *pdes = (struct sunxi_idma_des *)host->sg_cpu; +- struct sunxi_idma_des *pdes_pa = (struct sunxi_idma_des *)host->sg_dma; ++ dma_addr_t next_desc = host->sg_dma; + int i, max_len = (1 << host->idma_des_size_bits); + + for (i = 0; i < data->sg_len; i++) { +@@ -306,8 +306,9 @@ static void sunxi_mmc_init_idma_des(stru + else + pdes[i].buf_size = data->sg[i].length; + ++ next_desc += sizeof(struct sunxi_idma_des); + pdes[i].buf_addr_ptr1 = sg_dma_address(&data->sg[i]); +- pdes[i].buf_addr_ptr2 = (u32)&pdes_pa[i + 1]; ++ pdes[i].buf_addr_ptr2 = (u32)next_desc; + } + + pdes[0].config |= SDXC_IDMAC_DES0_FD; diff --git a/queue-3.18/net-tulip-turn-compile-time-warning-into-dev_warn.patch b/queue-3.18/net-tulip-turn-compile-time-warning-into-dev_warn.patch new file mode 100644 index 00000000000..c1a635d4d7d --- /dev/null +++ b/queue-3.18/net-tulip-turn-compile-time-warning-into-dev_warn.patch @@ -0,0 +1,74 @@ +From de92718883ddbcd11b738d36ffcf57617b97fa12 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 19 Nov 2015 11:42:26 +0100 +Subject: net: tulip: turn compile-time warning into dev_warn() + +From: Arnd Bergmann + +commit de92718883ddbcd11b738d36ffcf57617b97fa12 upstream. + +The tulip driver causes annoying build-time warnings for allmodconfig +builds for all recent architectures: + +dec/tulip/winbond-840.c:910:2: warning: #warning Processor architecture undefined +dec/tulip/tulip_core.c:101:2: warning: #warning Processor architecture undefined! + +This is the last remaining warning for arm64, and I'd like to get rid of +it. We don't really know the cache line size, architecturally it would +be at least 16 bytes, but all implementations I found have 64 or 128 +bytes. Configuring tulip for 32-byte lines as we do on ARM32 seems to +be the safe but slow default, and nobody who cares about performance these +days would use a tulip chip anyway, so we can just use that. + +To save the next person the job of trying to find out what this is for +and picking a default for their architecture just to kill off the warning, +I'm now removing the preprocessor #warning and turning it into a pr_warn +or dev_warn that prints the equivalent information when the driver gets +loaded. + +Signed-off-by: Arnd Bergmann +Acked-by: Grant Grundler +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/dec/tulip/tulip_core.c | 9 +++++++-- + drivers/net/ethernet/dec/tulip/winbond-840.c | 2 +- + 2 files changed, 8 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/dec/tulip/tulip_core.c ++++ b/drivers/net/ethernet/dec/tulip/tulip_core.c +@@ -98,8 +98,7 @@ static int csr0 = 0x01A00000 | 0x4800; + #elif defined(__mips__) + static int csr0 = 0x00200000 | 0x4000; + #else +-#warning Processor architecture undefined! +-static int csr0 = 0x00A00000 | 0x4800; ++static int csr0; + #endif + + /* Operational parameters that usually are not changed. */ +@@ -1982,6 +1981,12 @@ static int __init tulip_init (void) + pr_info("%s", version); + #endif + ++ if (!csr0) { ++ pr_warn("tulip: unknown CPU architecture, using default csr0\n"); ++ /* default to 8 longword cache line alignment */ ++ csr0 = 0x00A00000 | 0x4800; ++ } ++ + /* copy module parms into globals */ + tulip_rx_copybreak = rx_copybreak; + tulip_max_interrupt_work = max_interrupt_work; +--- a/drivers/net/ethernet/dec/tulip/winbond-840.c ++++ b/drivers/net/ethernet/dec/tulip/winbond-840.c +@@ -907,7 +907,7 @@ static void init_registers(struct net_de + #elif defined(CONFIG_SPARC) || defined (CONFIG_PARISC) + i |= 0x4800; + #else +-#warning Processor architecture undefined ++ dev_warn(&dev->dev, "unknown CPU architecture, using default csr0 setting\n"); + i |= 0x4800; + #endif + iowrite32(i, ioaddr + PCIBusCfg); diff --git a/queue-3.18/net-vxge-avoid-unused-function-warnings.patch b/queue-3.18/net-vxge-avoid-unused-function-warnings.patch new file mode 100644 index 00000000000..70831f47053 --- /dev/null +++ b/queue-3.18/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-3.18/series b/queue-3.18/series index a06c23e2641..2ad838370f6 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -27,3 +27,17 @@ net-ti-cpmac-fix-compiler-warning-due-to-type-confusion.patch mips-asm-compiler-add-new-macros-to-set-isa-and-arch-asm-annotations.patch nfsd-work-around-a-gcc-5.1-warning.patch fix-signed-unsigned-pointer-warning.patch +brcmfmac-avoid-gcc-5.1-warning.patch +tty-nozomi-avoid-a-harmless-gcc-warning.patch +net-vxge-avoid-unused-function-warnings.patch +misc-ioc4-simplify-wave-period-measurement-in-clock_calibrate.patch +hostap-avoid-uninitialized-variable-use-in-hfa384x_get_rid.patch +mips-msp71xx-remove-odd-locking-in-pci-config-space-access-code.patch +net-tulip-turn-compile-time-warning-into-dev_warn.patch +mmc-sunxi-avoid-invalid-pointer-calculation.patch +gfs2-avoid-uninitialized-variable-warning.patch +btrfs-fix-state-private-cast-on-32-bit-machines.patch +arm-8296-1-cache-l2x0-clean-up-aurora-cache-handling.patch +aic94xx-skip-reading-user-settings-if-flash-is-not-found.patch +mips-ralink-cosmetic-change-to-prom_init.patch +kconfig-tinyconfig-provide-whole-choice-blocks-to-avoid-warnings.patch diff --git a/queue-3.18/tty-nozomi-avoid-a-harmless-gcc-warning.patch b/queue-3.18/tty-nozomi-avoid-a-harmless-gcc-warning.patch new file mode 100644 index 00000000000..4df0ddc4555 --- /dev/null +++ b/queue-3.18/tty-nozomi-avoid-a-harmless-gcc-warning.patch @@ -0,0 +1,56 @@ +From a4f642a8a3c2838ad09fe8313d45db46600e1478 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 25 Jan 2016 22:54:56 +0100 +Subject: tty: nozomi: avoid a harmless gcc warning + +From: Arnd Bergmann + +commit a4f642a8a3c2838ad09fe8313d45db46600e1478 upstream. + +The nozomi wireless data driver has its own helper function to +transfer data from a FIFO, doing an extra byte swap on big-endian +architectures, presumably to bring the data back into byte-serial +order after readw() or readl() perform their implicit byteswap. + +This helper function is used in the receive_data() function to +first read the length into a 32-bit variable, which causes +a compile-time warning: + +drivers/tty/nozomi.c: In function 'receive_data': +drivers/tty/nozomi.c:857:9: warning: 'size' may be used uninitialized in this function [-Wmaybe-uninitialized] + +The problem is that gcc is unsure whether the data was actually +read or not. We know that it is at this point, so we can replace +it with a single readl() to shut up that warning. + +I am leaving the byteswap in there, to preserve the existing +behavior, even though this seems fishy: Reading the length of +the data into a cpu-endian variable should normally not use +a second byteswap on big-endian systems, unless the hardware +is aware of the CPU endianess. + +There appears to be a lot more confusion about endianess in this +driver, so it probably has not worked on big-endian systems in +a long time, if ever, and I have no way to test it. It's well +possible that this driver has not been used by anyone in a while, +the last patch that looks like it was tested on the hardware is +from 2008. + +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/nozomi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/tty/nozomi.c ++++ b/drivers/tty/nozomi.c +@@ -823,7 +823,7 @@ static int receive_data(enum port_type i + struct tty_struct *tty = tty_port_tty_get(&port->port); + int i, ret; + +- read_mem32((u32 *) &size, addr, 4); ++ size = __le32_to_cpu(readl(addr)); + /* DBG1( "%d bytes port: %d", size, index); */ + + if (tty && test_bit(TTY_THROTTLED, &tty->flags)) {