All of lore.kernel.org
 help / color / mirror / Atom feed
* [stable] Miscellaneous fixes for 4.9/4.10
@ 2017-04-18  1:57 Ben Hutchings
  2017-04-19 11:58 ` Greg Kroah-Hartman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ben Hutchings @ 2017-04-18  1:57 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: stable


[-- Attachment #1.1: Type: text/plain, Size: 1178 bytes --]

These are in 4.10, but still needed in 4.9:

05ac5aa18abd ext4: fix inode checksum calculation problem if i_extra_size is small
13583c3d3224 mm: memcontrol: use special workqueue for creating per-memcg caches
7dfee6827780 drm/nouveau/disp/mcp7x: disable dptmds workaround

These are in 4.10 and needed in 4.9.  The issue also exists in older
branches, but they would need further work to backport:

ef77b515243b nbd: use loff_t for blocksize and nbd_set_size args
e88f72cb9f54 nbd: fix 64-bit division

The first of those needed minor adjustment, so I've attached a
backported patch.

These are in 4.11, and needed in at least 4.9 and 4.10:

ebf79091bf85 ASoC: Intel: select DW_DMAC_CORE since it's mandatory
98d610c3739a platform/x86: acer-wmi: setup accelerometer when machine has appropriate notify event
cc272163ea55 x86/xen: Fix APIC id mismatch warning on Intel
5fa408698750 rtc: tegra: Implement clock handling
c3a696b6e8f8 ACPI / EC: Use busy polling mode when GPE is not enabled

The rtc fix needed minor adjustment for 4.9, so I've attached a
backported patch.

Ben.

-- 
Ben Hutchings
The world is coming to an end.	Please log off.


[-- Attachment #1.2: 0001-nbd-use-loff_t-for-blocksize-and-nbd_set_size-args.patch --]
[-- Type: text/x-patch, Size: 2169 bytes --]

From f090f501a91a2ecdf4ad8e462353e17035661e6e Mon Sep 17 00:00:00 2001
From: Josef Bacik <jbacik@fb.com>
Date: Fri, 2 Dec 2016 16:19:12 -0500
Subject: [PATCH] nbd: use loff_t for blocksize and nbd_set_size args

commit ef77b515243b3499d62cf446eda6ca7e0a0b079c upstream.

If we have large devices (say like the 40t drive I was trying to test with) we
will end up overflowing the int arguments to nbd_set_size and not get the right
size for our device.  Fix this by using loff_t everywhere so I don't have to
think about this again.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
[bwh: Backported to 4.9: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/block/nbd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 7a1048755914..095b4589c2d5 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -54,7 +54,7 @@ struct nbd_device {
 
 	struct mutex tx_lock;
 	struct gendisk *disk;
-	int blksize;
+	loff_t blksize;
 	loff_t bytesize;
 
 	/* protects initialization and shutdown of the socket */
@@ -126,7 +126,7 @@ static void nbd_size_update(struct nbd_device *nbd, struct block_device *bdev)
 }
 
 static int nbd_size_set(struct nbd_device *nbd, struct block_device *bdev,
-			int blocksize, int nr_blocks)
+			loff_t blocksize, loff_t nr_blocks)
 {
 	int ret;
 
@@ -135,7 +135,7 @@ static int nbd_size_set(struct nbd_device *nbd, struct block_device *bdev,
 		return ret;
 
 	nbd->blksize = blocksize;
-	nbd->bytesize = (loff_t)blocksize * (loff_t)nr_blocks;
+	nbd->bytesize = blocksize * nr_blocks;
 
 	nbd_size_update(nbd, bdev);
 
@@ -817,7 +817,7 @@ static int nbd_dev_dbg_init(struct nbd_device *nbd)
 	debugfs_create_file("tasks", 0444, dir, nbd, &nbd_dbg_tasks_ops);
 	debugfs_create_u64("size_bytes", 0444, dir, &nbd->bytesize);
 	debugfs_create_u32("timeout", 0444, dir, &nbd->tag_set.timeout);
-	debugfs_create_u32("blocksize", 0444, dir, &nbd->blksize);
+	debugfs_create_u64("blocksize", 0444, dir, &nbd->blksize);
 	debugfs_create_file("flags", 0444, dir, nbd, &nbd_dbg_flags_ops);
 
 	return 0;

[-- Attachment #1.3: 0001-rtc-tegra-Implement-clock-handling.patch --]
[-- Type: text/x-patch, Size: 4252 bytes --]

From 28b0cc43a684dd043094ddc34c68c08cba5198e2 Mon Sep 17 00:00:00 2001
From: Thierry Reding <treding@nvidia.com>
Date: Thu, 12 Jan 2017 17:07:43 +0100
Subject: [PATCH] rtc: tegra: Implement clock handling

commit 5fa4086987506b2ab8c92f8f99f2295db9918856 upstream.

Accessing the registers of the RTC block on Tegra requires the module
clock to be enabled. This only works because the RTC module clock will
be enabled by default during early boot. However, because the clock is
unused, the CCF will disable it at late_init time. This causes the RTC
to become unusable afterwards. This can easily be reproduced by trying
to use the RTC:

	$ hwclock --rtc /dev/rtc1

This will hang the system. I ran into this by following up on a report
by Martin Michlmayr that reboot wasn't working on Tegra210 systems. It
turns out that the rtc-tegra driver's ->shutdown() implementation will
hang the CPU, because of the disabled clock, before the system can be
rebooted.

What confused me for a while is that the same driver is used on prior
Tegra generations where the hang can not be observed. However, as Peter
De Schrijver pointed out, this is because on 32-bit Tegra chips the RTC
clock is enabled by the tegra20_timer.c clocksource driver, which uses
the RTC to provide a persistent clock. This code is never enabled on
64-bit Tegra because the persistent clock infrastructure does not exist
on 64-bit ARM.

The proper fix for this is to add proper clock handling to the RTC
driver in order to ensure that the clock is enabled when the driver
requires it. All device trees contain the clock already, therefore
no additional changes are required.

Reported-by: Martin Michlmayr <tbm@cyrius.com>
Acked-By Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
[bwh: Backported to 4.9: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/rtc/rtc-tegra.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index 3853ba963bb5..19e03d0b956b 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -18,6 +18,7 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 #include <linux/kernel.h>
+#include <linux/clk.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -59,6 +60,7 @@ struct tegra_rtc_info {
 	struct platform_device	*pdev;
 	struct rtc_device	*rtc_dev;
 	void __iomem		*rtc_base; /* NULL if not initialized. */
+	struct clk		*clk;
 	int			tegra_rtc_irq; /* alarm and periodic irq */
 	spinlock_t		tegra_rtc_lock;
 };
@@ -326,6 +328,14 @@ static int __init tegra_rtc_probe(struct platform_device *pdev)
 	if (info->tegra_rtc_irq <= 0)
 		return -EBUSY;
 
+	info->clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(info->clk))
+		return PTR_ERR(info->clk);
+
+	ret = clk_prepare_enable(info->clk);
+	if (ret < 0)
+		return ret;
+
 	/* set context info. */
 	info->pdev = pdev;
 	spin_lock_init(&info->tegra_rtc_lock);
@@ -346,7 +356,7 @@ static int __init tegra_rtc_probe(struct platform_device *pdev)
 		ret = PTR_ERR(info->rtc_dev);
 		dev_err(&pdev->dev, "Unable to register device (err=%d).\n",
 			ret);
-		return ret;
+		goto disable_clk;
 	}
 
 	ret = devm_request_irq(&pdev->dev, info->tegra_rtc_irq,
@@ -356,12 +366,25 @@ static int __init tegra_rtc_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev,
 			"Unable to request interrupt for device (err=%d).\n",
 			ret);
-		return ret;
+		goto disable_clk;
 	}
 
 	dev_notice(&pdev->dev, "Tegra internal Real Time Clock\n");
 
 	return 0;
+
+disable_clk:
+	clk_disable_unprepare(info->clk);
+	return ret;
+}
+
+static int tegra_rtc_remove(struct platform_device *pdev)
+{
+	struct tegra_rtc_info *info = platform_get_drvdata(pdev);
+
+	clk_disable_unprepare(info->clk);
+
+	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -413,6 +436,7 @@ static void tegra_rtc_shutdown(struct platform_device *pdev)
 
 MODULE_ALIAS("platform:tegra_rtc");
 static struct platform_driver tegra_rtc_driver = {
+	.remove		= tegra_rtc_remove,
 	.shutdown	= tegra_rtc_shutdown,
 	.driver		= {
 		.name	= "tegra_rtc",

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [stable] Miscellaneous fixes for 4.9/4.10
  2017-04-18  1:57 [stable] Miscellaneous fixes for 4.9/4.10 Ben Hutchings
@ 2017-04-19 11:58 ` Greg Kroah-Hartman
  2017-04-19 12:01 ` Greg Kroah-Hartman
  2017-04-19 12:05 ` Greg Kroah-Hartman
  2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-19 11:58 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable

On Tue, Apr 18, 2017 at 02:57:59AM +0100, Ben Hutchings wrote:
> These are in 4.10, but still needed in 4.9:
> 
> 05ac5aa18abd ext4: fix inode checksum calculation problem if i_extra_size is small

Also seems to be needed in 4.4, thanks.

> 13583c3d3224�mm: memcontrol: use special workqueue for creating per-memcg caches
> 7dfee6827780 drm/nouveau/disp/mcp7x: disable dptmds workaround

All 3 now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [stable] Miscellaneous fixes for 4.9/4.10
  2017-04-18  1:57 [stable] Miscellaneous fixes for 4.9/4.10 Ben Hutchings
  2017-04-19 11:58 ` Greg Kroah-Hartman
@ 2017-04-19 12:01 ` Greg Kroah-Hartman
  2017-04-19 12:05 ` Greg Kroah-Hartman
  2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-19 12:01 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable

On Tue, Apr 18, 2017 at 02:57:59AM +0100, Ben Hutchings wrote:
> These are in 4.10 and needed in 4.9.  The issue also exists in older
> branches, but they would need further work to backport:
> 
> ef77b515243b nbd: use loff_t for blocksize and nbd_set_size args
> e88f72cb9f54 nbd: fix 64-bit division
> 
> The first of those needed minor adjustment, so I've attached a
> backported patch.

Thanks for the backport, both now applied.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [stable] Miscellaneous fixes for 4.9/4.10
  2017-04-18  1:57 [stable] Miscellaneous fixes for 4.9/4.10 Ben Hutchings
  2017-04-19 11:58 ` Greg Kroah-Hartman
  2017-04-19 12:01 ` Greg Kroah-Hartman
@ 2017-04-19 12:05 ` Greg Kroah-Hartman
  2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-19 12:05 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: stable

On Tue, Apr 18, 2017 at 02:57:59AM +0100, Ben Hutchings wrote:
> These are in 4.11, and needed in at least 4.9 and 4.10:
> 
> ebf79091bf85 ASoC: Intel: select DW_DMAC_CORE since it's mandatory
> 98d610c3739a platform/x86: acer-wmi: setup accelerometer when machine has�appropriate notify event
> cc272163ea55 x86/xen: Fix APIC id mismatch warning on Intel
> 5fa408698750 rtc: tegra: Implement clock handling
> c3a696b6e8f8 ACPI / EC: Use busy polling mode when GPE is not enabled
> 
> The rtc fix needed minor adjustment for 4.9, so I've attached a
> backported patch.

The rtc fix was needed on 4.10 as well :)

All now queued up, thanks for the list and the backports.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-19 12:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-18  1:57 [stable] Miscellaneous fixes for 4.9/4.10 Ben Hutchings
2017-04-19 11:58 ` Greg Kroah-Hartman
2017-04-19 12:01 ` Greg Kroah-Hartman
2017-04-19 12:05 ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.