Skip to contentSkip to conversation

ASoC: txx9: add back the hack for a too small resource_size_t

PATCH Applied Christoph Hellwig 3 participants 3 messages Apr 21, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: txx9: add back the hack for a too small resource_size_t

Looks like I misread the Kconfig magic and this driver can be compiled into 32-bit kernels. Add back the hack to extent the range of the resource_size_t, and include the header with the txx9-specific ioremap magic for that.

Fixes acfaaf52ebfd ("ASoC: txx9: don't work around too small resource_size_t")
---
 sound/soc/txx9/txx9aclc-ac97.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
sound/soc/txx9/txx9aclc-ac97.c +5 -2
index 7402448bdb09..d9e348444bd0 100644
@@ -14,6 +14,7 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/gfp.h>
+#include <asm/mach-tx39xx/ioremap.h> /* for TXX9_DIRECTMAP_BASE */
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/soc.h>
@@ -175,8 +176,6 @@ static int txx9aclc_ac97_dev_probe(struct platform_device *pdev)
 	int err;
 	int irq;
 
-	BUILD_BUG_ON(sizeof(drvdata->physbase) > sizeof(r->start));
-
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
 		return irq;
@@ -192,6 +191,10 @@ static int txx9aclc_ac97_dev_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, drvdata);
 	drvdata->physbase = r->start;
+	if (sizeof(drvdata->physbase) > sizeof(r->start) &&
+	    r->start >= TXX9_DIRECTMAP_BASE &&
+	    r->start < TXX9_DIRECTMAP_BASE + 0x400000)
+		drvdata->physbase |= 0xf00000000ull;
 	err = devm_request_irq(&pdev->dev, irq, txx9aclc_ac97_irq,
 			       0, dev_name(&pdev->dev), drvdata);
 	if (err < 0)
Signature · 1 line
2.26.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Christoph Hellwig

Looks like I misread the Kconfig magic and this driver can be compiled into 32-bit kernels. Add back the hack to extent the range of the resource_size_t, and include the header with the txx9-specific ioremap magic for that.

maintainer Applied
#2 lore raw
In reply to Christoph Hellwig
Quoted 10 lines · Christoph Hellwig

Looks like I misread the Kconfig magic and this driver can be compiled into 32-bit kernels. Add back the hack to extent the range of the resource_size_t, and include the header with the txx9-specific ioremap magic for that.

Fixes acfaaf52ebfd ("ASoC: txx9: don't work around too small resource_size_t")
---
 sound/soc/txx9/txx9aclc-ac97.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

applied to mips-next.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]