From: Greg Kroah-Hartman Date: Fri, 31 Jul 2015 17:48:10 +0000 (-0700) Subject: 4.1-stable patches X-Git-Tag: v4.1.4~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9dc561b95cb5475252f0cf435662f44fa48e50ac;p=thirdparty%2Fkernel%2Fstable-queue.git 4.1-stable patches added patches: clk-fix-json-output-in-debugfs.patch clk-qcom-use-parent-rate-when-set-rate-to-pixel-rcg-clock.patch clk-ti-dra7-atl-clock-fix-possible-err_ptr-dereference.patch gpiolib-add-missing-dummies-for-the-unified-device-properties-interface.patch nfs-fix-size-of-nfsacl-setacl-operations.patch of-return-numa_no_node-from-fallback-of_node_to_nid.patch ovl-lookup-whiteouts-outside-iterate_dir.patch pnfs-fix-a-memory-leak-when-attempted-pnfs-fails.patch pnfs-flexfiles-fix-the-reset-of-struct-pgio_header-when-resending.patch watchdog-omap-assert-the-counter-being-stopped-before-reprogramming.patch --- diff --git a/queue-4.1/clk-fix-json-output-in-debugfs.patch b/queue-4.1/clk-fix-json-output-in-debugfs.patch new file mode 100644 index 00000000000..957d0101fe2 --- /dev/null +++ b/queue-4.1/clk-fix-json-output-in-debugfs.patch @@ -0,0 +1,42 @@ +From 7cb81136d2efe0f5ed9d965857f4756a15e6c338 Mon Sep 17 00:00:00 2001 +From: Stefan Wahren +Date: Wed, 29 Apr 2015 16:36:43 +0000 +Subject: clk: Fix JSON output in debugfs + +From: Stefan Wahren + +commit 7cb81136d2efe0f5ed9d965857f4756a15e6c338 upstream. + +key/value pairs in a JSON object must be separated by a comma. +After adding the properties "accuracy" and "phase" the JSON output +of /sys/kernel/debug/clk/clk_dump is invalid. + +So add the missing commas to fix it. + +Fixes: 5279fc402ae5 ("clk: add clk accuracy retrieval support") +Signed-off-by: Stefan Wahren +[sboyd@codeaurora.org: Added comment in function] +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/clk.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/clk/clk.c ++++ b/drivers/clk/clk.c +@@ -230,11 +230,12 @@ static void clk_dump_one(struct seq_file + if (!c) + return; + ++ /* This should be JSON format, i.e. elements separated with a comma */ + seq_printf(s, "\"%s\": { ", c->name); + seq_printf(s, "\"enable_count\": %d,", c->enable_count); + seq_printf(s, "\"prepare_count\": %d,", c->prepare_count); +- seq_printf(s, "\"rate\": %lu", clk_core_get_rate(c)); +- seq_printf(s, "\"accuracy\": %lu", clk_core_get_accuracy(c)); ++ seq_printf(s, "\"rate\": %lu,", clk_core_get_rate(c)); ++ seq_printf(s, "\"accuracy\": %lu,", clk_core_get_accuracy(c)); + seq_printf(s, "\"phase\": %d", clk_core_get_phase(c)); + } + diff --git a/queue-4.1/clk-qcom-use-parent-rate-when-set-rate-to-pixel-rcg-clock.patch b/queue-4.1/clk-qcom-use-parent-rate-when-set-rate-to-pixel-rcg-clock.patch new file mode 100644 index 00000000000..d50f30930e7 --- /dev/null +++ b/queue-4.1/clk-qcom-use-parent-rate-when-set-rate-to-pixel-rcg-clock.patch @@ -0,0 +1,49 @@ +From 6d451367bfa16fc103604bacd258f534c65d1540 Mon Sep 17 00:00:00 2001 +From: Hai Li +Date: Thu, 25 Jun 2015 18:35:33 -0400 +Subject: clk: qcom: Use parent rate when set rate to pixel RCG clock + +From: Hai Li + +commit 6d451367bfa16fc103604bacd258f534c65d1540 upstream. + +Since the parent rate has been recalculated, pixel RCG clock +should rely on it to find the correct M/N values during set_rate, +instead of calling __clk_round_rate() to its parent again. + +Signed-off-by: Hai Li +Tested-by: Archit Taneja +Fixes: 99cbd064b059 ("clk: qcom: Support display RCG clocks") +[sboyd@codeaurora.org: Silenced unused parent variable warning] +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/qcom/clk-rcg2.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +--- a/drivers/clk/qcom/clk-rcg2.c ++++ b/drivers/clk/qcom/clk-rcg2.c +@@ -530,19 +530,16 @@ static int clk_pixel_set_rate(struct clk + struct clk_rcg2 *rcg = to_clk_rcg2(hw); + struct freq_tbl f = *rcg->freq_tbl; + const struct frac_entry *frac = frac_table_pixel; +- unsigned long request, src_rate; ++ unsigned long request; + int delta = 100000; + u32 mask = BIT(rcg->hid_width) - 1; + u32 hid_div; +- int index = qcom_find_src_index(hw, rcg->parent_map, f.src); +- struct clk *parent = clk_get_parent_by_index(hw->clk, index); + + for (; frac->num; frac++) { + request = (rate * frac->den) / frac->num; + +- src_rate = __clk_round_rate(parent, request); +- if ((src_rate < (request - delta)) || +- (src_rate > (request + delta))) ++ if ((parent_rate < (request - delta)) || ++ (parent_rate > (request + delta))) + continue; + + regmap_read(rcg->clkr.regmap, rcg->cmd_rcgr + CFG_REG, diff --git a/queue-4.1/clk-ti-dra7-atl-clock-fix-possible-err_ptr-dereference.patch b/queue-4.1/clk-ti-dra7-atl-clock-fix-possible-err_ptr-dereference.patch new file mode 100644 index 00000000000..3266d64b24c --- /dev/null +++ b/queue-4.1/clk-ti-dra7-atl-clock-fix-possible-err_ptr-dereference.patch @@ -0,0 +1,38 @@ +From e0cdcda508f110b7ec190dc7c5eb2869ba73a535 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Wed, 13 May 2015 15:54:40 +0900 +Subject: clk: ti: dra7-atl-clock: Fix possible ERR_PTR dereference + +From: Krzysztof Kozlowski + +commit e0cdcda508f110b7ec190dc7c5eb2869ba73a535 upstream. + +of_clk_get_from_provider() returns ERR_PTR on failure. The +dra7-atl-clock driver was not checking its return value and +immediately used it in __clk_get_hw(). __clk_get_hw() +dereferences supplied clock, if it is not NULL, so in that case +it would dereference an ERR_PTR. + +Fixes: 9ac33b0ce81f ("CLK: TI: Driver for DRA7 ATL (Audio Tracking Logic)") +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/ti/clk-dra7-atl.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/clk/ti/clk-dra7-atl.c ++++ b/drivers/clk/ti/clk-dra7-atl.c +@@ -252,6 +252,11 @@ static int of_dra7_atl_clk_probe(struct + } + + clk = of_clk_get_from_provider(&clkspec); ++ if (IS_ERR(clk)) { ++ pr_err("%s: failed to get atl clock %d from provider\n", ++ __func__, i); ++ return PTR_ERR(clk); ++ } + + cdesc = to_atl_desc(__clk_get_hw(clk)); + cdesc->cinfo = cinfo; diff --git a/queue-4.1/gpiolib-add-missing-dummies-for-the-unified-device-properties-interface.patch b/queue-4.1/gpiolib-add-missing-dummies-for-the-unified-device-properties-interface.patch new file mode 100644 index 00000000000..a6bb65029bc --- /dev/null +++ b/queue-4.1/gpiolib-add-missing-dummies-for-the-unified-device-properties-interface.patch @@ -0,0 +1,56 @@ +From 496e7ce2a46562938edcb74f65b26068ee8895f6 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Thu, 7 May 2015 01:08:08 -0700 +Subject: gpiolib: Add missing dummies for the unified device properties interface +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Geert Uytterhoeven + +commit 496e7ce2a46562938edcb74f65b26068ee8895f6 upstream. + +If GPIOLIB=n: + + drivers/leds/leds-gpio.c: In function ‘gpio_leds_create’: + drivers/leds/leds-gpio.c:187: error: implicit declaration of function ‘devm_get_gpiod_from_child’ + drivers/leds/leds-gpio.c:187: warning: assignment makes pointer from integer without a cast + +Add dummies for fwnode_get_named_gpiod() and devm_get_gpiod_from_child() +for the !GPIOLIB case to fix this. + +Signed-off-by: Geert Uytterhoeven +Fixes: 40b7318319281b1b ("gpio: Support for unified device properties interface") +Acked-by: Alexandre Courbot +Acked-by: Linus Walleij +Signed-off-by: Bryan Wu +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/gpio/consumer.h | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/include/linux/gpio/consumer.h ++++ b/include/linux/gpio/consumer.h +@@ -406,6 +406,21 @@ static inline int desc_to_gpio(const str + return -EINVAL; + } + ++/* Child properties interface */ ++struct fwnode_handle; ++ ++static inline struct gpio_desc *fwnode_get_named_gpiod( ++ struct fwnode_handle *fwnode, const char *propname) ++{ ++ return ERR_PTR(-ENOSYS); ++} ++ ++static inline struct gpio_desc *devm_get_gpiod_from_child( ++ struct device *dev, const char *con_id, struct fwnode_handle *child) ++{ ++ return ERR_PTR(-ENOSYS); ++} ++ + #endif /* CONFIG_GPIOLIB */ + + /* diff --git a/queue-4.1/nfs-fix-size-of-nfsacl-setacl-operations.patch b/queue-4.1/nfs-fix-size-of-nfsacl-setacl-operations.patch new file mode 100644 index 00000000000..2261ee9cfdf --- /dev/null +++ b/queue-4.1/nfs-fix-size-of-nfsacl-setacl-operations.patch @@ -0,0 +1,33 @@ +From d683cc49daf7c5afca8cd9654aaa1bf63cdf2ad9 Mon Sep 17 00:00:00 2001 +From: Chuck Lever +Date: Tue, 26 May 2015 11:53:52 -0400 +Subject: NFS: Fix size of NFSACL SETACL operations + +From: Chuck Lever + +commit d683cc49daf7c5afca8cd9654aaa1bf63cdf2ad9 upstream. + +When encoding the NFSACL SETACL operation, reserve just the estimated +size of the ACL rather than a fixed maximum. This eliminates needless +zero padding on the wire that the server ignores. + +Fixes: ee5dc7732bd5 ('NFS: Fix "kernel BUG at fs/nfs/nfs3xdr.c:1338!"') +Signed-off-by: Chuck Lever +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/nfs3xdr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/nfs/nfs3xdr.c ++++ b/fs/nfs/nfs3xdr.c +@@ -1342,7 +1342,7 @@ static void nfs3_xdr_enc_setacl3args(str + if (args->npages != 0) + xdr_write_pages(xdr, args->pages, 0, args->len); + else +- xdr_reserve_space(xdr, NFS_ACL_INLINE_BUFSIZE); ++ xdr_reserve_space(xdr, args->len); + + error = nfsacl_encode(xdr->buf, base, args->inode, + (args->mask & NFS_ACL) ? diff --git a/queue-4.1/of-return-numa_no_node-from-fallback-of_node_to_nid.patch b/queue-4.1/of-return-numa_no_node-from-fallback-of_node_to_nid.patch new file mode 100644 index 00000000000..d5e0f76b841 --- /dev/null +++ b/queue-4.1/of-return-numa_no_node-from-fallback-of_node_to_nid.patch @@ -0,0 +1,47 @@ +From c8fff7bc5bba6bd59cad40441c189c4efe7190f6 Mon Sep 17 00:00:00 2001 +From: Konstantin Khlebnikov +Date: Wed, 8 Apr 2015 19:59:20 +0300 +Subject: of: return NUMA_NO_NODE from fallback of_node_to_nid() + +From: Konstantin Khlebnikov + +commit c8fff7bc5bba6bd59cad40441c189c4efe7190f6 upstream. + +Node 0 might be offline as well as any other numa node, +in this case kernel cannot handle memory allocation and crashes. + +Signed-off-by: Konstantin Khlebnikov +Fixes: 0c3f061c195c ("of: implement of_node_to_nid as a weak function") +Signed-off-by: Grant Likely +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/of/base.c | 2 +- + include/linux/of.h | 5 ++++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/of/base.c ++++ b/drivers/of/base.c +@@ -89,7 +89,7 @@ EXPORT_SYMBOL(of_n_size_cells); + #ifdef CONFIG_NUMA + int __weak of_node_to_nid(struct device_node *np) + { +- return numa_node_id(); ++ return NUMA_NO_NODE; + } + #endif + +--- a/include/linux/of.h ++++ b/include/linux/of.h +@@ -673,7 +673,10 @@ static inline void of_property_clear_fla + #if defined(CONFIG_OF) && defined(CONFIG_NUMA) + extern int of_node_to_nid(struct device_node *np); + #else +-static inline int of_node_to_nid(struct device_node *device) { return 0; } ++static inline int of_node_to_nid(struct device_node *device) ++{ ++ return NUMA_NO_NODE; ++} + #endif + + static inline struct device_node *of_find_matching_node( diff --git a/queue-4.1/ovl-lookup-whiteouts-outside-iterate_dir.patch b/queue-4.1/ovl-lookup-whiteouts-outside-iterate_dir.patch new file mode 100644 index 00000000000..5ed93cc1e3b --- /dev/null +++ b/queue-4.1/ovl-lookup-whiteouts-outside-iterate_dir.patch @@ -0,0 +1,167 @@ +From cdb672795876d7bc1870aed9a2d7cb59f43d1d96 Mon Sep 17 00:00:00 2001 +From: Miklos Szeredi +Date: Mon, 22 Jun 2015 13:53:48 +0200 +Subject: ovl: lookup whiteouts outside iterate_dir() + +From: Miklos Szeredi + +commit cdb672795876d7bc1870aed9a2d7cb59f43d1d96 upstream. + +If jffs2 can deadlock on overlayfs readdir because it takes the same lock +on ->iterate() as in ->lookup(). + +Fix by moving whiteout checking outside iterate_dir(). Optimized by +collecting potential whiteouts (DT_CHR) in a temporary list and if +non-empty iterating throug these and checking for a 0/0 chardev. + +Signed-off-by: Miklos Szeredi +Fixes: 49c21e1cacd7 ("ovl: check whiteout while reading directory") +Reported-by: Roman Yeryomin +Signed-off-by: Greg Kroah-Hartman + +--- + fs/overlayfs/readdir.c | 77 +++++++++++++++++++++++++++++++------------------ + 1 file changed, 49 insertions(+), 28 deletions(-) + +--- a/fs/overlayfs/readdir.c ++++ b/fs/overlayfs/readdir.c +@@ -23,6 +23,7 @@ struct ovl_cache_entry { + u64 ino; + struct list_head l_node; + struct rb_node node; ++ struct ovl_cache_entry *next_maybe_whiteout; + bool is_whiteout; + char name[]; + }; +@@ -39,7 +40,7 @@ struct ovl_readdir_data { + struct rb_root root; + struct list_head *list; + struct list_head middle; +- struct dentry *dir; ++ struct ovl_cache_entry *first_maybe_whiteout; + int count; + int err; + }; +@@ -79,7 +80,7 @@ static struct ovl_cache_entry *ovl_cache + return NULL; + } + +-static struct ovl_cache_entry *ovl_cache_entry_new(struct dentry *dir, ++static struct ovl_cache_entry *ovl_cache_entry_new(struct ovl_readdir_data *rdd, + const char *name, int len, + u64 ino, unsigned int d_type) + { +@@ -98,29 +99,8 @@ static struct ovl_cache_entry *ovl_cache + p->is_whiteout = false; + + if (d_type == DT_CHR) { +- struct dentry *dentry; +- const struct cred *old_cred; +- struct cred *override_cred; +- +- override_cred = prepare_creds(); +- if (!override_cred) { +- kfree(p); +- return NULL; +- } +- +- /* +- * CAP_DAC_OVERRIDE for lookup +- */ +- cap_raise(override_cred->cap_effective, CAP_DAC_OVERRIDE); +- old_cred = override_creds(override_cred); +- +- dentry = lookup_one_len(name, dir, len); +- if (!IS_ERR(dentry)) { +- p->is_whiteout = ovl_is_whiteout(dentry); +- dput(dentry); +- } +- revert_creds(old_cred); +- put_cred(override_cred); ++ p->next_maybe_whiteout = rdd->first_maybe_whiteout; ++ rdd->first_maybe_whiteout = p; + } + return p; + } +@@ -148,7 +128,7 @@ static int ovl_cache_entry_add_rb(struct + return 0; + } + +- p = ovl_cache_entry_new(rdd->dir, name, len, ino, d_type); ++ p = ovl_cache_entry_new(rdd, name, len, ino, d_type); + if (p == NULL) + return -ENOMEM; + +@@ -169,7 +149,7 @@ static int ovl_fill_lower(struct ovl_rea + if (p) { + list_move_tail(&p->l_node, &rdd->middle); + } else { +- p = ovl_cache_entry_new(rdd->dir, name, namelen, ino, d_type); ++ p = ovl_cache_entry_new(rdd, name, namelen, ino, d_type); + if (p == NULL) + rdd->err = -ENOMEM; + else +@@ -219,6 +199,43 @@ static int ovl_fill_merge(struct dir_con + return ovl_fill_lower(rdd, name, namelen, offset, ino, d_type); + } + ++static int ovl_check_whiteouts(struct dentry *dir, struct ovl_readdir_data *rdd) ++{ ++ int err; ++ struct ovl_cache_entry *p; ++ struct dentry *dentry; ++ const struct cred *old_cred; ++ struct cred *override_cred; ++ ++ override_cred = prepare_creds(); ++ if (!override_cred) ++ return -ENOMEM; ++ ++ /* ++ * CAP_DAC_OVERRIDE for lookup ++ */ ++ cap_raise(override_cred->cap_effective, CAP_DAC_OVERRIDE); ++ old_cred = override_creds(override_cred); ++ ++ err = mutex_lock_killable(&dir->d_inode->i_mutex); ++ if (!err) { ++ while (rdd->first_maybe_whiteout) { ++ p = rdd->first_maybe_whiteout; ++ rdd->first_maybe_whiteout = p->next_maybe_whiteout; ++ dentry = lookup_one_len(p->name, dir, p->len); ++ if (!IS_ERR(dentry)) { ++ p->is_whiteout = ovl_is_whiteout(dentry); ++ dput(dentry); ++ } ++ } ++ mutex_unlock(&dir->d_inode->i_mutex); ++ } ++ revert_creds(old_cred); ++ put_cred(override_cred); ++ ++ return err; ++} ++ + static inline int ovl_dir_read(struct path *realpath, + struct ovl_readdir_data *rdd) + { +@@ -229,7 +246,7 @@ static inline int ovl_dir_read(struct pa + if (IS_ERR(realfile)) + return PTR_ERR(realfile); + +- rdd->dir = realpath->dentry; ++ rdd->first_maybe_whiteout = NULL; + rdd->ctx.pos = 0; + do { + rdd->count = 0; +@@ -238,6 +255,10 @@ static inline int ovl_dir_read(struct pa + if (err >= 0) + err = rdd->err; + } while (!err && rdd->count); ++ ++ if (!err && rdd->first_maybe_whiteout) ++ err = ovl_check_whiteouts(realpath->dentry, rdd); ++ + fput(realfile); + + return err; diff --git a/queue-4.1/pnfs-fix-a-memory-leak-when-attempted-pnfs-fails.patch b/queue-4.1/pnfs-fix-a-memory-leak-when-attempted-pnfs-fails.patch new file mode 100644 index 00000000000..4ff308e9d8f --- /dev/null +++ b/queue-4.1/pnfs-fix-a-memory-leak-when-attempted-pnfs-fails.patch @@ -0,0 +1,43 @@ +From 1ca018d28d96d07788474abf66a5f3e9594841f5 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Wed, 17 Jun 2015 19:41:51 -0400 +Subject: pNFS: Fix a memory leak when attempted pnfs fails + +From: Trond Myklebust + +commit 1ca018d28d96d07788474abf66a5f3e9594841f5 upstream. + +pnfs_do_write() expects the call to pnfs_write_through_mds() to free the +pgio header and to release the layout segment before exiting. The problem +is that nfs_pgio_data_destroy() doesn't actually do this; it only frees +the memory allocated by nfs_generic_pgio(). + +Ditto for pnfs_do_read()... + +Fix in both cases is to add a call to hdr->release(hdr). + +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/pnfs.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/nfs/pnfs.c ++++ b/fs/nfs/pnfs.c +@@ -1865,6 +1865,7 @@ pnfs_write_through_mds(struct nfs_pageio + mirror->pg_recoalesce = 1; + } + nfs_pgio_data_destroy(hdr); ++ hdr->release(hdr); + } + + static enum pnfs_try_status +@@ -1979,6 +1980,7 @@ pnfs_read_through_mds(struct nfs_pageio_ + mirror->pg_recoalesce = 1; + } + nfs_pgio_data_destroy(hdr); ++ hdr->release(hdr); + } + + /* diff --git a/queue-4.1/pnfs-flexfiles-fix-the-reset-of-struct-pgio_header-when-resending.patch b/queue-4.1/pnfs-flexfiles-fix-the-reset-of-struct-pgio_header-when-resending.patch new file mode 100644 index 00000000000..77843c25c2e --- /dev/null +++ b/queue-4.1/pnfs-flexfiles-fix-the-reset-of-struct-pgio_header-when-resending.patch @@ -0,0 +1,30 @@ +From d620876990f02788d5a663075df007ffb91bdfad Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Fri, 26 Jun 2015 15:37:58 -0400 +Subject: pNFS/flexfiles: Fix the reset of struct pgio_header when resending + +From: Trond Myklebust + +commit d620876990f02788d5a663075df007ffb91bdfad upstream. + +hdr->good_bytes needs to be set to the length of the request, not +zero. + +Signed-off-by: Trond Myklebust +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/flexfilelayout/flexfilelayout.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/nfs/flexfilelayout/flexfilelayout.c ++++ b/fs/nfs/flexfilelayout/flexfilelayout.c +@@ -631,7 +631,7 @@ static void ff_layout_reset_write(struct + nfs_direct_set_resched_writes(hdr->dreq); + /* fake unstable write to let common nfs resend pages */ + hdr->verf.committed = NFS_UNSTABLE; +- hdr->good_bytes = 0; ++ hdr->good_bytes = hdr->args.count; + } + return; + } diff --git a/queue-4.1/series b/queue-4.1/series index cfb133b3fc2..b48d51816a3 100644 --- a/queue-4.1/series +++ b/queue-4.1/series @@ -232,3 +232,13 @@ ideapad_laptop-lenovo-g50-30-fix-rfkill-reports-wireless-blocked.patch ideapad-fix-software-rfkill-setting.patch of-address-use-atomic-allocation-in-pci_register_io_range.patch dell-laptop-fix-allocating-freeing-smi-buffer-page.patch +ovl-lookup-whiteouts-outside-iterate_dir.patch +of-return-numa_no_node-from-fallback-of_node_to_nid.patch +watchdog-omap-assert-the-counter-being-stopped-before-reprogramming.patch +gpiolib-add-missing-dummies-for-the-unified-device-properties-interface.patch +clk-fix-json-output-in-debugfs.patch +clk-ti-dra7-atl-clock-fix-possible-err_ptr-dereference.patch +clk-qcom-use-parent-rate-when-set-rate-to-pixel-rcg-clock.patch +pnfs-fix-a-memory-leak-when-attempted-pnfs-fails.patch +pnfs-flexfiles-fix-the-reset-of-struct-pgio_header-when-resending.patch +nfs-fix-size-of-nfsacl-setacl-operations.patch diff --git a/queue-4.1/watchdog-omap-assert-the-counter-being-stopped-before-reprogramming.patch b/queue-4.1/watchdog-omap-assert-the-counter-being-stopped-before-reprogramming.patch new file mode 100644 index 00000000000..a55d45f893d --- /dev/null +++ b/queue-4.1/watchdog-omap-assert-the-counter-being-stopped-before-reprogramming.patch @@ -0,0 +1,61 @@ +From 530c11d432727c697629ad5f9d00ee8e2864d453 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= +Date: Wed, 29 Apr 2015 20:38:46 +0200 +Subject: watchdog: omap: assert the counter being stopped before reprogramming +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= + +commit 530c11d432727c697629ad5f9d00ee8e2864d453 upstream. + +The omap watchdog has the annoying behaviour that writes to most +registers don't have any effect when the watchdog is already running. +Quoting the AM335x reference manual: + + To modify the timer counter value (the WDT_WCRR register), + prescaler ratio (the WDT_WCLR[4:2] PTV bit field), delay + configuration value (the WDT_WDLY[31:0] DLY_VALUE bit field), or + the load value (the WDT_WLDR[31:0] TIMER_LOAD bit field), the + watchdog timer must be disabled by using the start/stop sequence + (the WDT_WSPR register). + +Currently the timer is stopped in the .probe callback but still there +are possibilities that yield to a situation where omap_wdt_start is +entered with the timer running (e.g. when /dev/watchdog is closed +without stopping and then reopened). In such a case programming the +timeout silently fails! + +To circumvent this stop the timer before reprogramming. + +Assuming one of the first things the watchdog user does is setting the +timeout explicitly nothing too bad should happen because this explicit +setting works fine. + +Fixes: 7768a13c252a ("[PATCH] OMAP: Add Watchdog driver support") +Signed-off-by: Uwe Kleine-König +Reviewed-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/watchdog/omap_wdt.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/watchdog/omap_wdt.c ++++ b/drivers/watchdog/omap_wdt.c +@@ -132,6 +132,13 @@ static int omap_wdt_start(struct watchdo + + pm_runtime_get_sync(wdev->dev); + ++ /* ++ * Make sure the watchdog is disabled. This is unfortunately required ++ * because writing to various registers with the watchdog running has no ++ * effect. ++ */ ++ omap_wdt_disable(wdev); ++ + /* initialize prescaler */ + while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x01) + cpu_relax();