Skip to contentSkip to conversation

mfd: intel-lpss: fix a bug and clean up

PATCH Applied Andy Shevchenko 3 participants 8 messages Sep 14, 2015 – Sep 20, 2015

Subsystems (2)
lore
Share & tools
lore

Andy Shevchenko

author reviewer
#0 lore raw

cover mfd: intel-lpss: fix a bug and clean up

There are two small patches to fix a bug which was found next day after driver was merged and one clean up to allow 64-bit writes with generic helpers.

Lee, please apply them for v4.3-rc2.

Andy Shevchenko (2):
mfd: intel-lpss: fix build error when !CONFIG_PM_SLEEP
mfd: intel-lpss: use writeq() helper

 drivers/mfd/intel-lpss.c | 12 ++++--------
 drivers/mfd/intel-lpss.h |  2 ++
 2 files changed, 6 insertions(+), 8 deletions(-)
Signature · 1 line
2.5.1
author reviewer
#1 lore raw

PATCH 1/2 mfd: intel-lpss: fix build error when !CONFIG_PM_SLEEP

Jim Davis reported the compilation error with a random configuration which apparently has CONFIG_PM=y and CONFIG_PM_SLEEP=n. With that conditions we have missed definition of INTEL_LPSS_SLEEP_PM_OPS macro. Add it here.

---
 drivers/mfd/intel-lpss.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/mfd/intel-lpss.h +2 -0
index f28cb28a..2c7f8d7 100644
@@ -42,6 +42,8 @@ int intel_lpss_resume(struct device *dev);
 	.thaw = intel_lpss_resume,		\
 	.poweroff = intel_lpss_suspend,		\
 	.restore = intel_lpss_resume,
+#else
+#define INTEL_LPSS_SLEEP_PM_OPS
 #endif
 
 #define INTEL_LPSS_RUNTIME_PM_OPS		\
Signature · 1 line
2.5.1
#2 lore raw

Re: [PATCH v1 1/2] mfd: intel-lpss: fix build error when !CONFIG_PM_SLEEP

Quoted 9 lines · Andy Shevchenko

Jim Davis reported the compilation error with a random configuration which apparently has CONFIG_PM=y and CONFIG_PM_SLEEP=n. With that conditions we have missed definition of INTEL_LPSS_SLEEP_PM_OPS macro. Add it here.

---
 drivers/mfd/intel-lpss.h | 2 ++
 1 file changed, 2 insertions(+)

Applied for -fixes.

Quoted 13 lines
drivers/mfd/intel-lpss.h +2 -0
index f28cb28a..2c7f8d7 100644
@@ -42,6 +42,8 @@ int intel_lpss_resume(struct device *dev);
 	.thaw = intel_lpss_resume,		\
 	.poweroff = intel_lpss_suspend,		\
 	.restore = intel_lpss_resume,
+#else
+#define INTEL_LPSS_SLEEP_PM_OPS
 #endif
 
 #define INTEL_LPSS_RUNTIME_PM_OPS		\
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author reviewer
#3 lore raw

PATCH 2/2 mfd: intel-lpss: use writeq() helper

In reply to Andy Shevchenko

There are already helper functions to do 64-bit I/O on 32-bit machines, thus we don't need to reinvent the wheel. In our case we can't use readq() / writeq() even on 64-bit kernel since there is a hardware limitation (OCP bus is a 32-bit bus).

---
 drivers/mfd/intel-lpss.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/mfd/intel-lpss.c +4 -8
index fdf4d5c..001a7d7 100644
@@ -26,6 +26,8 @@
 #include <linux/pm_runtime.h>
 #include <linux/seq_file.h>
 
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
+
 #include "intel-lpss.h"
 
 #define LPSS_DEV_OFFSET		0x000
@@ -52,8 +54,7 @@
 #define LPSS_PRIV_SSP_REG		0x20
 #define LPSS_PRIV_SSP_REG_DIS_DMA_FIN	BIT(0)
 
-#define LPSS_PRIV_REMAP_ADDR_LO		0x40
-#define LPSS_PRIV_REMAP_ADDR_HI		0x44
+#define LPSS_PRIV_REMAP_ADDR		0x40
 
 #define LPSS_PRIV_CAPS			0xfc
 #define LPSS_PRIV_CAPS_NO_IDMA		BIT(8)
@@ -250,12 +251,7 @@ static void intel_lpss_set_remap_addr(const struct intel_lpss *lpss)
 {
 	resource_size_t addr = lpss->info->mem->start;
 
-	writel(addr, lpss->priv + LPSS_PRIV_REMAP_ADDR_LO);
-#if BITS_PER_LONG > 32
-	writel(addr >> 32, lpss->priv + LPSS_PRIV_REMAP_ADDR_HI);
-#else
-	writel(0, lpss->priv + LPSS_PRIV_REMAP_ADDR_HI);
-#endif
+	lo_hi_writeq(addr, lpss->priv + LPSS_PRIV_REMAP_ADDR);
 }
 
 static void intel_lpss_deassert_reset(const struct intel_lpss *lpss)
Signature · 1 line
2.5.1
Applied
#4 lore raw

Re: [PATCH v1 2/2] mfd: intel-lpss: use writeq() helper

Quoted 9 lines · Andy Shevchenko

There are already helper functions to do 64-bit I/O on 32-bit machines, thus we don't need to reinvent the wheel. In our case we can't use readq() / writeq() even on 64-bit kernel since there is a hardware limitation (OCP bus is a 32-bit bus).

---
 drivers/mfd/intel-lpss.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Applied, thanks.

Quoted 37 lines
drivers/mfd/intel-lpss.c +4 -8
index fdf4d5c..001a7d7 100644
@@ -26,6 +26,8 @@
 #include <linux/pm_runtime.h>
 #include <linux/seq_file.h>
 
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
+
 #include "intel-lpss.h"
 
 #define LPSS_DEV_OFFSET		0x000
@@ -52,8 +54,7 @@
 #define LPSS_PRIV_SSP_REG		0x20
 #define LPSS_PRIV_SSP_REG_DIS_DMA_FIN	BIT(0)
 
-#define LPSS_PRIV_REMAP_ADDR_LO		0x40
-#define LPSS_PRIV_REMAP_ADDR_HI		0x44
+#define LPSS_PRIV_REMAP_ADDR		0x40
 
 #define LPSS_PRIV_CAPS			0xfc
 #define LPSS_PRIV_CAPS_NO_IDMA		BIT(8)
@@ -250,12 +251,7 @@ static void intel_lpss_set_remap_addr(const struct intel_lpss *lpss)
 {
 	resource_size_t addr = lpss->info->mem->start;
 
-	writel(addr, lpss->priv + LPSS_PRIV_REMAP_ADDR_LO);
-#if BITS_PER_LONG > 32
-	writel(addr >> 32, lpss->priv + LPSS_PRIV_REMAP_ADDR_HI);
-#else
-	writel(0, lpss->priv + LPSS_PRIV_REMAP_ADDR_HI);
-#endif
+	lo_hi_writeq(addr, lpss->priv + LPSS_PRIV_REMAP_ADDR);
 }
 
 static void intel_lpss_deassert_reset(const struct intel_lpss *lpss)
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Reviewed-by on the v1 series
#5 lore raw
In reply to Andy Shevchenko
Quoted 5 lines · Andy Shevchenko

There are two small patches to fix a bug which was found next day after driver was merged and one clean up to allow 64-bit writes with generic helpers.

Lee, please apply them for v4.3-rc2.

Quoted 7 lines

Andy Shevchenko (2):
mfd: intel-lpss: fix build error when !CONFIG_PM_SLEEP
mfd: intel-lpss: use writeq() helper

 drivers/mfd/intel-lpss.c | 12 ++++--------
 drivers/mfd/intel-lpss.h |  2 ++
 2 files changed, 6 insertions(+), 8 deletions(-)

For both,

author reviewer
#6 lore raw
In reply to Andy Shevchenko
Quoted 6 lines · Andy Shevchenko

There are two small patches to fix a bug which was found next day after driver
was merged and one clean up to allow 64-bit writes with generic helpers.

Lee, please apply them for v4.3-rc2.

Gentle ping for this series. It would be really nice to have it in v4.3 -rc2.

Quoted 9 lines

Andy Shevchenko (2):
mfd: intel-lpss: fix build error when !CONFIG_PM_SLEEP
mfd: intel-lpss: use writeq() helper

 drivers/mfd/intel-lpss.c | 12 ++++--------
 drivers/mfd/intel-lpss.h |  2 ++
 2 files changed, 6 insertions(+), 8 deletions(-)
Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#7 lore raw
Quoted 10 lines · Andy Shevchenko
Quoted 6 lines · Andy Shevchenko

There are two small patches to fix a bug which was found next day after driver
was merged and one clean up to allow 64-bit writes with generic helpers.

Lee, please apply them for v4.3-rc2.

Gentle ping for this series. It would be really nice to have it in v4.3 -rc2.

I plan to start reviewing again tomorrow (on the plane), as I have a few loose ends to tie up before travelling.

Quoted 9 lines
Quoted 8 lines

Andy Shevchenko (2):
mfd: intel-lpss: fix build error when !CONFIG_PM_SLEEP
mfd: intel-lpss: use writeq() helper

 drivers/mfd/intel-lpss.c | 12 ++++--------
 drivers/mfd/intel-lpss.h |  2 ++
 2 files changed, 6 insertions(+), 8 deletions(-)
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog