]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Mar 2019 20:10:50 +0000 (21:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Mar 2019 20:10:50 +0000 (21:10 +0100)
added patches:
clk-ingenic-fix-round_rate-misbehaving-with-non-integer-dividers.patch
cpufreq-pxa2xx-remove-incorrect-__init-annotation.patch
cpufreq-tegra124-add-missing-of_node_put.patch
dmaengine-usb-dmac-make-dmac-system-sleep-callbacks-explicit.patch
ext2-fix-underflow-in-ext2_max_size.patch
ext4-fix-crash-during-online-resizing.patch

queue-4.4/clk-ingenic-fix-round_rate-misbehaving-with-non-integer-dividers.patch [new file with mode: 0644]
queue-4.4/cpufreq-pxa2xx-remove-incorrect-__init-annotation.patch [new file with mode: 0644]
queue-4.4/cpufreq-tegra124-add-missing-of_node_put.patch [new file with mode: 0644]
queue-4.4/dmaengine-usb-dmac-make-dmac-system-sleep-callbacks-explicit.patch [new file with mode: 0644]
queue-4.4/ext2-fix-underflow-in-ext2_max_size.patch [new file with mode: 0644]
queue-4.4/ext4-fix-crash-during-online-resizing.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/clk-ingenic-fix-round_rate-misbehaving-with-non-integer-dividers.patch b/queue-4.4/clk-ingenic-fix-round_rate-misbehaving-with-non-integer-dividers.patch
new file mode 100644 (file)
index 0000000..9cf3429
--- /dev/null
@@ -0,0 +1,63 @@
+From bc5d922c93491878c44c9216e9d227c7eeb81d7f Mon Sep 17 00:00:00 2001
+From: Paul Cercueil <paul@crapouillou.net>
+Date: Sun, 27 Jan 2019 23:09:20 -0300
+Subject: clk: ingenic: Fix round_rate misbehaving with non-integer dividers
+
+From: Paul Cercueil <paul@crapouillou.net>
+
+commit bc5d922c93491878c44c9216e9d227c7eeb81d7f upstream.
+
+Take a parent rate of 180 MHz, and a requested rate of 4.285715 MHz.
+This results in a theorical divider of 41.999993 which is then rounded
+up to 42. The .round_rate function would then return (180 MHz / 42) as
+the clock, rounded down, so 4.285714 MHz.
+
+Calling clk_set_rate on 4.285714 MHz would round the rate again, and
+give a theorical divider of 42,0000028, now rounded up to 43, and the
+rate returned would be (180 MHz / 43) which is 4.186046 MHz, aka. not
+what we requested.
+
+Fix this by rounding up the divisions.
+
+Signed-off-by: Paul Cercueil <paul@crapouillou.net>
+Tested-by: Maarten ter Huurne <maarten@treewalker.org>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/clk/ingenic/cgu.c |   10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/clk/ingenic/cgu.c
++++ b/drivers/clk/ingenic/cgu.c
+@@ -355,16 +355,16 @@ ingenic_clk_round_rate(struct clk_hw *hw
+       struct ingenic_clk *ingenic_clk = to_ingenic_clk(hw);
+       struct ingenic_cgu *cgu = ingenic_clk->cgu;
+       const struct ingenic_cgu_clk_info *clk_info;
+-      long rate = *parent_rate;
++      unsigned int div = 1;
+       clk_info = &cgu->clock_info[ingenic_clk->idx];
+       if (clk_info->type & CGU_CLK_DIV)
+-              rate /= ingenic_clk_calc_div(clk_info, *parent_rate, req_rate);
++              div = ingenic_clk_calc_div(clk_info, *parent_rate, req_rate);
+       else if (clk_info->type & CGU_CLK_FIXDIV)
+-              rate /= clk_info->fixdiv.div;
++              div = clk_info->fixdiv.div;
+-      return rate;
++      return DIV_ROUND_UP(*parent_rate, div);
+ }
+ static int
+@@ -384,7 +384,7 @@ ingenic_clk_set_rate(struct clk_hw *hw,
+       if (clk_info->type & CGU_CLK_DIV) {
+               div = ingenic_clk_calc_div(clk_info, parent_rate, req_rate);
+-              rate = parent_rate / div;
++              rate = DIV_ROUND_UP(parent_rate, div);
+               if (rate != req_rate)
+                       return -EINVAL;
diff --git a/queue-4.4/cpufreq-pxa2xx-remove-incorrect-__init-annotation.patch b/queue-4.4/cpufreq-pxa2xx-remove-incorrect-__init-annotation.patch
new file mode 100644 (file)
index 0000000..bdacbaa
--- /dev/null
@@ -0,0 +1,53 @@
+From 9505b98ccddc454008ca7efff90044e3e857c827 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Thu, 7 Mar 2019 11:22:41 +0100
+Subject: cpufreq: pxa2xx: remove incorrect __init annotation
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 9505b98ccddc454008ca7efff90044e3e857c827 upstream.
+
+pxa_cpufreq_init_voltages() is marked __init but usually inlined into
+the non-__init pxa_cpufreq_init() function. When building with clang,
+it can stay as a standalone function in a discarded section, and produce
+this warning:
+
+WARNING: vmlinux.o(.text+0x616a00): Section mismatch in reference from the function pxa_cpufreq_init() to the function .init.text:pxa_cpufreq_init_voltages()
+The function pxa_cpufreq_init() references
+the function __init pxa_cpufreq_init_voltages().
+This is often because pxa_cpufreq_init lacks a __init
+annotation or the annotation of pxa_cpufreq_init_voltages is wrong.
+
+Fixes: 50e77fcd790e ("ARM: pxa: remove __init from cpufreq_driver->init()")
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
+Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
+Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
+Cc: All applicable <stable@vger.kernel.org>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/pxa2xx-cpufreq.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/cpufreq/pxa2xx-cpufreq.c
++++ b/drivers/cpufreq/pxa2xx-cpufreq.c
+@@ -191,7 +191,7 @@ static int pxa_cpufreq_change_voltage(co
+       return ret;
+ }
+-static void __init pxa_cpufreq_init_voltages(void)
++static void pxa_cpufreq_init_voltages(void)
+ {
+       vcc_core = regulator_get(NULL, "vcc_core");
+       if (IS_ERR(vcc_core)) {
+@@ -207,7 +207,7 @@ static int pxa_cpufreq_change_voltage(co
+       return 0;
+ }
+-static void __init pxa_cpufreq_init_voltages(void) { }
++static void pxa_cpufreq_init_voltages(void) { }
+ #endif
+ static void find_freq_tables(struct cpufreq_frequency_table **freq_table,
diff --git a/queue-4.4/cpufreq-tegra124-add-missing-of_node_put.patch b/queue-4.4/cpufreq-tegra124-add-missing-of_node_put.patch
new file mode 100644 (file)
index 0000000..2b3213c
--- /dev/null
@@ -0,0 +1,35 @@
+From 446fae2bb5395f3028d8e3aae1508737e5a72ea1 Mon Sep 17 00:00:00 2001
+From: Yangtao Li <tiny.windzz@gmail.com>
+Date: Mon, 4 Feb 2019 02:48:54 -0500
+Subject: cpufreq: tegra124: add missing of_node_put()
+
+From: Yangtao Li <tiny.windzz@gmail.com>
+
+commit 446fae2bb5395f3028d8e3aae1508737e5a72ea1 upstream.
+
+of_cpu_device_node_get() will increase the refcount of device_node,
+it is necessary to call of_node_put() at the end to release the
+refcount.
+
+Fixes: 9eb15dbbfa1a2 ("cpufreq: Add cpufreq driver for Tegra124")
+Cc: <stable@vger.kernel.org> # 4.4+
+Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
+Acked-by: Thierry Reding <treding@nvidia.com>
+Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/tegra124-cpufreq.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/cpufreq/tegra124-cpufreq.c
++++ b/drivers/cpufreq/tegra124-cpufreq.c
+@@ -141,6 +141,8 @@ static int tegra124_cpufreq_probe(struct
+       platform_set_drvdata(pdev, priv);
++      of_node_put(np);
++
+       return 0;
+ out_switch_to_pllx:
diff --git a/queue-4.4/dmaengine-usb-dmac-make-dmac-system-sleep-callbacks-explicit.patch b/queue-4.4/dmaengine-usb-dmac-make-dmac-system-sleep-callbacks-explicit.patch
new file mode 100644 (file)
index 0000000..9706125
--- /dev/null
@@ -0,0 +1,60 @@
+From d9140a0da4a230a03426d175145989667758aa6a Mon Sep 17 00:00:00 2001
+From: Phuong Nguyen <phuong.nguyen.xw@renesas.com>
+Date: Thu, 17 Jan 2019 17:44:17 +0900
+Subject: dmaengine: usb-dmac: Make DMAC system sleep callbacks explicit
+
+From: Phuong Nguyen <phuong.nguyen.xw@renesas.com>
+
+commit d9140a0da4a230a03426d175145989667758aa6a upstream.
+
+This commit fixes the issue that USB-DMAC hangs silently after system
+resumes on R-Car Gen3 hence renesas_usbhs will not work correctly
+when using USB-DMAC for bulk transfer e.g. ethernet or serial
+gadgets.
+
+The issue can be reproduced by these steps:
+ 1. modprobe g_serial
+ 2. Suspend and resume system.
+ 3. connect a usb cable to host side
+ 4. Transfer data from Host to Target
+ 5. cat /dev/ttyGS0 (Target side)
+ 6. echo "test" > /dev/ttyACM0 (Host side)
+
+The 'cat' will not result anything. However, system still can work
+normally.
+
+Currently, USB-DMAC driver does not have system sleep callbacks hence
+this driver relies on the PM core to force runtime suspend/resume to
+suspend and reinitialize USB-DMAC during system resume. After
+the commit 17218e0092f8 ("PM / genpd: Stop/start devices without
+pm_runtime_force_suspend/resume()"), PM core will not force
+runtime suspend/resume anymore so this issue happens.
+
+To solve this, make system suspend resume explicit by using
+pm_runtime_force_{suspend,resume}() as the system sleep callbacks.
+SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() is used to make sure USB-DMAC
+suspended after and initialized before renesas_usbhs."
+
+Signed-off-by: Phuong Nguyen <phuong.nguyen.xw@renesas.com>
+Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
+Cc: <stable@vger.kernel.org> # v4.16+
+[shimoda: revise the commit log and add Cc tag]
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/dma/sh/usb-dmac.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/dma/sh/usb-dmac.c
++++ b/drivers/dma/sh/usb-dmac.c
+@@ -700,6 +700,8 @@ static int usb_dmac_runtime_resume(struc
+ #endif /* CONFIG_PM */
+ static const struct dev_pm_ops usb_dmac_pm = {
++      SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
++                                    pm_runtime_force_resume)
+       SET_RUNTIME_PM_OPS(usb_dmac_runtime_suspend, usb_dmac_runtime_resume,
+                          NULL)
+ };
diff --git a/queue-4.4/ext2-fix-underflow-in-ext2_max_size.patch b/queue-4.4/ext2-fix-underflow-in-ext2_max_size.patch
new file mode 100644 (file)
index 0000000..f38b447
--- /dev/null
@@ -0,0 +1,98 @@
+From 1c2d14212b15a60300a2d4f6364753e87394c521 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Tue, 29 Jan 2019 17:17:24 +0100
+Subject: ext2: Fix underflow in ext2_max_size()
+
+From: Jan Kara <jack@suse.cz>
+
+commit 1c2d14212b15a60300a2d4f6364753e87394c521 upstream.
+
+When ext2 filesystem is created with 64k block size, ext2_max_size()
+will return value less than 0. Also, we cannot write any file in this fs
+since the sb->maxbytes is less than 0. The core of the problem is that
+the size of block index tree for such large block size is more than
+i_blocks can carry. So fix the computation to count with this
+possibility.
+
+File size limits computed with the new function for the full range of
+possible block sizes look like:
+
+bits file_size
+10     17247252480
+11    275415851008
+12   2196873666560
+13   2197948973056
+14   2198486220800
+15   2198754754560
+16   2198888906752
+
+CC: stable@vger.kernel.org
+Reported-by: yangerkun <yangerkun@huawei.com>
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ext2/super.c |   41 ++++++++++++++++++++++++++---------------
+ 1 file changed, 26 insertions(+), 15 deletions(-)
+
+--- a/fs/ext2/super.c
++++ b/fs/ext2/super.c
+@@ -721,7 +721,8 @@ static loff_t ext2_max_size(int bits)
+ {
+       loff_t res = EXT2_NDIR_BLOCKS;
+       int meta_blocks;
+-      loff_t upper_limit;
++      unsigned int upper_limit;
++      unsigned int ppb = 1 << (bits-2);
+       /* This is calculated to be the largest file size for a
+        * dense, file such that the total number of
+@@ -735,24 +736,34 @@ static loff_t ext2_max_size(int bits)
+       /* total blocks in file system block size */
+       upper_limit >>= (bits - 9);
+-
+-      /* indirect blocks */
+-      meta_blocks = 1;
+-      /* double indirect blocks */
+-      meta_blocks += 1 + (1LL << (bits-2));
+-      /* tripple indirect blocks */
+-      meta_blocks += 1 + (1LL << (bits-2)) + (1LL << (2*(bits-2)));
+-
+-      upper_limit -= meta_blocks;
+-      upper_limit <<= bits;
+-
++      /* Compute how many blocks we can address by block tree */
+       res += 1LL << (bits-2);
+       res += 1LL << (2*(bits-2));
+       res += 1LL << (3*(bits-2));
++      /* Does block tree limit file size? */
++      if (res < upper_limit)
++              goto check_lfs;
++
++      res = upper_limit;
++      /* How many metadata blocks are needed for addressing upper_limit? */
++      upper_limit -= EXT2_NDIR_BLOCKS;
++      /* indirect blocks */
++      meta_blocks = 1;
++      upper_limit -= ppb;
++      /* double indirect blocks */
++      if (upper_limit < ppb * ppb) {
++              meta_blocks += 1 + DIV_ROUND_UP(upper_limit, ppb);
++              res -= meta_blocks;
++              goto check_lfs;
++      }
++      meta_blocks += 1 + ppb;
++      upper_limit -= ppb * ppb;
++      /* tripple indirect blocks for the rest */
++      meta_blocks += 1 + DIV_ROUND_UP(upper_limit, ppb) +
++              DIV_ROUND_UP(upper_limit, ppb*ppb);
++      res -= meta_blocks;
++check_lfs:
+       res <<= bits;
+-      if (res > upper_limit)
+-              res = upper_limit;
+-
+       if (res > MAX_LFS_FILESIZE)
+               res = MAX_LFS_FILESIZE;
diff --git a/queue-4.4/ext4-fix-crash-during-online-resizing.patch b/queue-4.4/ext4-fix-crash-during-online-resizing.patch
new file mode 100644 (file)
index 0000000..25b192b
--- /dev/null
@@ -0,0 +1,48 @@
+From f96c3ac8dfc24b4e38fc4c2eba5fea2107b929d1 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Mon, 11 Feb 2019 13:30:32 -0500
+Subject: ext4: fix crash during online resizing
+
+From: Jan Kara <jack@suse.cz>
+
+commit f96c3ac8dfc24b4e38fc4c2eba5fea2107b929d1 upstream.
+
+When computing maximum size of filesystem possible with given number of
+group descriptor blocks, we forget to include s_first_data_block into
+the number of blocks. Thus for filesystems with non-zero
+s_first_data_block it can happen that computed maximum filesystem size
+is actually lower than current filesystem size which confuses the code
+and eventually leads to a BUG_ON in ext4_alloc_group_tables() hitting on
+flex_gd->count == 0. The problem can be reproduced like:
+
+truncate -s 100g /tmp/image
+mkfs.ext4 -b 1024 -E resize=262144 /tmp/image 32768
+mount -t ext4 -o loop /tmp/image /mnt
+resize2fs /dev/loop0 262145
+resize2fs /dev/loop0 300000
+
+Fix the problem by properly including s_first_data_block into the
+computed number of filesystem blocks.
+
+Fixes: 1c6bd7173d66 "ext4: convert file system to meta_bg if needed..."
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ext4/resize.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/fs/ext4/resize.c
++++ b/fs/ext4/resize.c
+@@ -1928,7 +1928,8 @@ retry:
+                               le16_to_cpu(es->s_reserved_gdt_blocks);
+                       n_group = n_desc_blocks * EXT4_DESC_PER_BLOCK(sb);
+                       n_blocks_count = (ext4_fsblk_t)n_group *
+-                              EXT4_BLOCKS_PER_GROUP(sb);
++                              EXT4_BLOCKS_PER_GROUP(sb) +
++                              le32_to_cpu(es->s_first_data_block);
+                       n_group--; /* set to last group number */
+               }
index f28c2a82d912949bb4b5db6a78b35b6ff1f25639..fdce934023d3ebcb6c6a082282c32cf20e98b599 100644 (file)
@@ -190,3 +190,9 @@ m68k-add-ffreestanding-to-cflags.patch
 btrfs-ensure-that-a-dup-or-raid1-block-group-has-exactly-two-stripes.patch
 btrfs-fix-corruption-reading-shared-and-compressed-extents-after-hole-punching.patch
 crypto-pcbc-remove-bogus-memcpy-s-with-src-dest.patch
+cpufreq-tegra124-add-missing-of_node_put.patch
+cpufreq-pxa2xx-remove-incorrect-__init-annotation.patch
+ext4-fix-crash-during-online-resizing.patch
+ext2-fix-underflow-in-ext2_max_size.patch
+clk-ingenic-fix-round_rate-misbehaving-with-non-integer-dividers.patch
+dmaengine-usb-dmac-make-dmac-system-sleep-callbacks-explicit.patch