All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] bus: brcmstb_gisb: misc fixes
@ 2014-09-22 18:02 ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2014-09-22 18:02 UTC (permalink / raw
  To: linux-kernel
  Cc: arnd, computersforpeace, thomas.petazzoni, linux-arm-kernel,
	Florian Fainelli

Hi Arnd,

This patch set contains two small fixes for the Broadcom GISB bus
arbiter code. First patch makes sure we do register a fault code for
ARM platforms, second patch is a fix when the code is used on a PM
capable system.

Florian Fainelli (2):
  bus: brcmstb_gisb: register the fault code hook
  bus: brcmstb_gisb: save and restore GISB timeout

 drivers/bus/brcmstb_gisb.c | 45 +++++++++++++++++++++++++++++++++++++++------
 1 file changed, 39 insertions(+), 6 deletions(-)

-- 
1.9.1


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

* [PATCH v3 0/2] bus: brcmstb_gisb: misc fixes
@ 2014-09-22 18:02 ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2014-09-22 18:02 UTC (permalink / raw
  To: linux-arm-kernel

Hi Arnd,

This patch set contains two small fixes for the Broadcom GISB bus
arbiter code. First patch makes sure we do register a fault code for
ARM platforms, second patch is a fix when the code is used on a PM
capable system.

Florian Fainelli (2):
  bus: brcmstb_gisb: register the fault code hook
  bus: brcmstb_gisb: save and restore GISB timeout

 drivers/bus/brcmstb_gisb.c | 45 +++++++++++++++++++++++++++++++++++++++------
 1 file changed, 39 insertions(+), 6 deletions(-)

-- 
1.9.1

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

* [PATCH v3 1/2] bus: brcmstb_gisb: register the fault code hook
  2014-09-22 18:02 ` Florian Fainelli
@ 2014-09-22 18:02   ` Florian Fainelli
  -1 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2014-09-22 18:02 UTC (permalink / raw
  To: linux-kernel
  Cc: arnd, computersforpeace, thomas.petazzoni, linux-arm-kernel,
	Florian Fainelli

Commit 44127b771d9c31 ("bus: add Broadcom GISB bus arbiter timeout/error
handler") added everything that is required to register an ARM fault
handler for imprecise external aborts, except that there is nothing
calling this currently.

We do not need to export that specific function and have to update
arch/arm/mach-bcm/brcmstb.c to call it, simply, register the fault
handler during the probe() function of the driver.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v3:
- moved hook_fault_code as part of the probe function

Changes in v2:
- removed the accidental hunk that added saved_timeout since it does
  not belong in this patch

 drivers/bus/brcmstb_gisb.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c
index f2cd6a2d40b4..41b09418f515 100644
--- a/drivers/bus/brcmstb_gisb.c
+++ b/drivers/bus/brcmstb_gisb.c
@@ -160,12 +160,6 @@ static int brcmstb_bus_error_handler(unsigned long addr, unsigned int fsr,
 	return ret;
 }
 
-void __init brcmstb_hook_fault_code(void)
-{
-	hook_fault_code(22, brcmstb_bus_error_handler, SIGBUS, 0,
-			"imprecise external abort");
-}
-
 static irqreturn_t brcmstb_gisb_timeout_handler(int irq, void *dev_id)
 {
 	brcmstb_gisb_arb_decode_addr(dev_id, "timeout");
@@ -261,6 +255,9 @@ static int brcmstb_gisb_arb_probe(struct platform_device *pdev)
 
 	list_add_tail(&gdev->next, &brcmstb_gisb_arb_device_list);
 
+	hook_fault_code(22, brcmstb_bus_error_handler, SIGBUS, 0,
+			"imprecise external abort");
+
 	dev_info(&pdev->dev, "registered mem: %p, irqs: %d, %d\n",
 			gdev->base, timeout_irq, tea_irq);
 
-- 
1.9.1


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

* [PATCH v3 1/2] bus: brcmstb_gisb: register the fault code hook
@ 2014-09-22 18:02   ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2014-09-22 18:02 UTC (permalink / raw
  To: linux-arm-kernel

Commit 44127b771d9c31 ("bus: add Broadcom GISB bus arbiter timeout/error
handler") added everything that is required to register an ARM fault
handler for imprecise external aborts, except that there is nothing
calling this currently.

We do not need to export that specific function and have to update
arch/arm/mach-bcm/brcmstb.c to call it, simply, register the fault
handler during the probe() function of the driver.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v3:
- moved hook_fault_code as part of the probe function

Changes in v2:
- removed the accidental hunk that added saved_timeout since it does
  not belong in this patch

 drivers/bus/brcmstb_gisb.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c
index f2cd6a2d40b4..41b09418f515 100644
--- a/drivers/bus/brcmstb_gisb.c
+++ b/drivers/bus/brcmstb_gisb.c
@@ -160,12 +160,6 @@ static int brcmstb_bus_error_handler(unsigned long addr, unsigned int fsr,
 	return ret;
 }
 
-void __init brcmstb_hook_fault_code(void)
-{
-	hook_fault_code(22, brcmstb_bus_error_handler, SIGBUS, 0,
-			"imprecise external abort");
-}
-
 static irqreturn_t brcmstb_gisb_timeout_handler(int irq, void *dev_id)
 {
 	brcmstb_gisb_arb_decode_addr(dev_id, "timeout");
@@ -261,6 +255,9 @@ static int brcmstb_gisb_arb_probe(struct platform_device *pdev)
 
 	list_add_tail(&gdev->next, &brcmstb_gisb_arb_device_list);
 
+	hook_fault_code(22, brcmstb_bus_error_handler, SIGBUS, 0,
+			"imprecise external abort");
+
 	dev_info(&pdev->dev, "registered mem: %p, irqs: %d, %d\n",
 			gdev->base, timeout_irq, tea_irq);
 
-- 
1.9.1

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

* [PATCH v3 2/2] bus: brcmstb_gisb: save and restore GISB timeout
  2014-09-22 18:02 ` Florian Fainelli
@ 2014-09-22 18:02   ` Florian Fainelli
  -1 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2014-09-22 18:02 UTC (permalink / raw
  To: linux-kernel
  Cc: arnd, computersforpeace, thomas.petazzoni, linux-arm-kernel,
	Florian Fainelli

When the system enters S3, we will lose the GISB timeout value we have
configured, make sure that we do save this timeout value, and restore
this timeout value prior to re-enabling interrupts such that the GISB
timeout interrupt will fire with the expected timeout.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v2:
- took the hunk that adds the saved_timeout here instead of in patch 1

 drivers/bus/brcmstb_gisb.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c
index 41b09418f515..e7ccd21a45c9 100644
--- a/drivers/bus/brcmstb_gisb.c
+++ b/drivers/bus/brcmstb_gisb.c
@@ -23,6 +23,7 @@
 #include <linux/list.h>
 #include <linux/of.h>
 #include <linux/bitops.h>
+#include <linux/pm.h>
 
 #include <asm/bug.h>
 #include <asm/signal.h>
@@ -48,6 +49,7 @@ struct brcmstb_gisb_arb_device {
 	struct list_head next;
 	u32 valid_mask;
 	const char *master_names[sizeof(u32) * BITS_PER_BYTE];
+	u32 saved_timeout;
 };
 
 static LIST_HEAD(brcmstb_gisb_arb_device_list);
@@ -264,6 +266,39 @@ static int brcmstb_gisb_arb_probe(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int brcmstb_gisb_arb_suspend(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev);
+
+	gdev->saved_timeout = ioread32(gdev->base + ARB_TIMER);
+
+	return 0;
+}
+
+/* Make sure we provide the same timeout value that was configured before, and
+ * do this before the GISB timeout interrupt handler has any chance to run.
+ */
+static int brcmstb_gisb_arb_resume_noirq(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev);
+
+	iowrite32(gdev->saved_timeout, gdev->base + ARB_TIMER);
+
+	return 0;
+}
+#else
+#define brcmstb_gisb_arb_suspend       NULL
+#define brcmstb_gisb_arb_resume_noirq  NULL
+#endif
+
+static const struct dev_pm_ops brcmstb_gisb_arb_pm_ops = {
+	.suspend	= brcmstb_gisb_arb_suspend,
+	.resume_noirq	= brcmstb_gisb_arb_resume_noirq,
+};
+
 static const struct of_device_id brcmstb_gisb_arb_of_match[] = {
 	{ .compatible = "brcm,gisb-arb" },
 	{ },
@@ -275,6 +310,7 @@ static struct platform_driver brcmstb_gisb_arb_driver = {
 		.name	= "brcm-gisb-arb",
 		.owner	= THIS_MODULE,
 		.of_match_table = brcmstb_gisb_arb_of_match,
+		.pm	= &brcmstb_gisb_arb_pm_ops,
 	},
 };
 
-- 
1.9.1


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

* [PATCH v3 2/2] bus: brcmstb_gisb: save and restore GISB timeout
@ 2014-09-22 18:02   ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2014-09-22 18:02 UTC (permalink / raw
  To: linux-arm-kernel

When the system enters S3, we will lose the GISB timeout value we have
configured, make sure that we do save this timeout value, and restore
this timeout value prior to re-enabling interrupts such that the GISB
timeout interrupt will fire with the expected timeout.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v2:
- took the hunk that adds the saved_timeout here instead of in patch 1

 drivers/bus/brcmstb_gisb.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c
index 41b09418f515..e7ccd21a45c9 100644
--- a/drivers/bus/brcmstb_gisb.c
+++ b/drivers/bus/brcmstb_gisb.c
@@ -23,6 +23,7 @@
 #include <linux/list.h>
 #include <linux/of.h>
 #include <linux/bitops.h>
+#include <linux/pm.h>
 
 #include <asm/bug.h>
 #include <asm/signal.h>
@@ -48,6 +49,7 @@ struct brcmstb_gisb_arb_device {
 	struct list_head next;
 	u32 valid_mask;
 	const char *master_names[sizeof(u32) * BITS_PER_BYTE];
+	u32 saved_timeout;
 };
 
 static LIST_HEAD(brcmstb_gisb_arb_device_list);
@@ -264,6 +266,39 @@ static int brcmstb_gisb_arb_probe(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int brcmstb_gisb_arb_suspend(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev);
+
+	gdev->saved_timeout = ioread32(gdev->base + ARB_TIMER);
+
+	return 0;
+}
+
+/* Make sure we provide the same timeout value that was configured before, and
+ * do this before the GISB timeout interrupt handler has any chance to run.
+ */
+static int brcmstb_gisb_arb_resume_noirq(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct brcmstb_gisb_arb_device *gdev = platform_get_drvdata(pdev);
+
+	iowrite32(gdev->saved_timeout, gdev->base + ARB_TIMER);
+
+	return 0;
+}
+#else
+#define brcmstb_gisb_arb_suspend       NULL
+#define brcmstb_gisb_arb_resume_noirq  NULL
+#endif
+
+static const struct dev_pm_ops brcmstb_gisb_arb_pm_ops = {
+	.suspend	= brcmstb_gisb_arb_suspend,
+	.resume_noirq	= brcmstb_gisb_arb_resume_noirq,
+};
+
 static const struct of_device_id brcmstb_gisb_arb_of_match[] = {
 	{ .compatible = "brcm,gisb-arb" },
 	{ },
@@ -275,6 +310,7 @@ static struct platform_driver brcmstb_gisb_arb_driver = {
 		.name	= "brcm-gisb-arb",
 		.owner	= THIS_MODULE,
 		.of_match_table = brcmstb_gisb_arb_of_match,
+		.pm	= &brcmstb_gisb_arb_pm_ops,
 	},
 };
 
-- 
1.9.1

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

* Re: [PATCH v3 0/2] bus: brcmstb_gisb: misc fixes
  2014-09-22 18:02 ` Florian Fainelli
@ 2014-10-10 19:25   ` Florian Fainelli
  -1 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2014-10-10 19:25 UTC (permalink / raw
  To: linux-kernel; +Cc: arnd, computersforpeace, thomas.petazzoni, linux-arm-kernel

Arnd,

On 09/22/2014 11:02 AM, Florian Fainelli wrote:
> Hi Arnd,
> 
> This patch set contains two small fixes for the Broadcom GISB bus
> arbiter code. First patch makes sure we do register a fault code for
> ARM platforms, second patch is a fix when the code is used on a PM
> capable system.

Once the merge window re-opens in about a week from now, how do you want
me to submit those patches? Do you want them as part of a brcmstb pull
request, or something else?

Thank you!

> 
> Florian Fainelli (2):
>   bus: brcmstb_gisb: register the fault code hook
>   bus: brcmstb_gisb: save and restore GISB timeout
> 
>  drivers/bus/brcmstb_gisb.c | 45 +++++++++++++++++++++++++++++++++++++++------
>  1 file changed, 39 insertions(+), 6 deletions(-)
> 


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

* [PATCH v3 0/2] bus: brcmstb_gisb: misc fixes
@ 2014-10-10 19:25   ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2014-10-10 19:25 UTC (permalink / raw
  To: linux-arm-kernel

Arnd,

On 09/22/2014 11:02 AM, Florian Fainelli wrote:
> Hi Arnd,
> 
> This patch set contains two small fixes for the Broadcom GISB bus
> arbiter code. First patch makes sure we do register a fault code for
> ARM platforms, second patch is a fix when the code is used on a PM
> capable system.

Once the merge window re-opens in about a week from now, how do you want
me to submit those patches? Do you want them as part of a brcmstb pull
request, or something else?

Thank you!

> 
> Florian Fainelli (2):
>   bus: brcmstb_gisb: register the fault code hook
>   bus: brcmstb_gisb: save and restore GISB timeout
> 
>  drivers/bus/brcmstb_gisb.c | 45 +++++++++++++++++++++++++++++++++++++++------
>  1 file changed, 39 insertions(+), 6 deletions(-)
> 

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

* Re: [PATCH v3 0/2] bus: brcmstb_gisb: misc fixes
  2014-10-10 19:25   ` Florian Fainelli
@ 2014-10-10 21:10     ` Arnd Bergmann
  -1 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2014-10-10 21:10 UTC (permalink / raw
  To: linux-arm-kernel
  Cc: Florian Fainelli, linux-kernel, thomas.petazzoni,
	computersforpeace

On Friday 10 October 2014 12:25:17 Florian Fainelli wrote:
> 
> On 09/22/2014 11:02 AM, Florian Fainelli wrote:
> > Hi Arnd,
> > 
> > This patch set contains two small fixes for the Broadcom GISB bus
> > arbiter code. First patch makes sure we do register a fault code for
> > ARM platforms, second patch is a fix when the code is used on a PM
> > capable system.
> 
> Once the merge window re-opens in about a week from now, how do you want
> me to submit those patches? Do you want them as part of a brcmstb pull
> request, or something else?

At least one of us is confused. The merge window is currently open,
and I have send all outstanding pull requests for 3.18. If you have
bug fixes that are required for 3.18, we should merge them now and
send them as soon as possible.

If this is stuff that can wait for 3.19, please send a pull
request after the the end of the ELC/LPC conferences next week
so we can queue it up in next/fixes-non-critical.

	Arnd

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

* [PATCH v3 0/2] bus: brcmstb_gisb: misc fixes
@ 2014-10-10 21:10     ` Arnd Bergmann
  0 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2014-10-10 21:10 UTC (permalink / raw
  To: linux-arm-kernel

On Friday 10 October 2014 12:25:17 Florian Fainelli wrote:
> 
> On 09/22/2014 11:02 AM, Florian Fainelli wrote:
> > Hi Arnd,
> > 
> > This patch set contains two small fixes for the Broadcom GISB bus
> > arbiter code. First patch makes sure we do register a fault code for
> > ARM platforms, second patch is a fix when the code is used on a PM
> > capable system.
> 
> Once the merge window re-opens in about a week from now, how do you want
> me to submit those patches? Do you want them as part of a brcmstb pull
> request, or something else?

At least one of us is confused. The merge window is currently open,
and I have send all outstanding pull requests for 3.18. If you have
bug fixes that are required for 3.18, we should merge them now and
send them as soon as possible.

If this is stuff that can wait for 3.19, please send a pull
request after the the end of the ELC/LPC conferences next week
so we can queue it up in next/fixes-non-critical.

	Arnd

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

* Re: [PATCH v3 0/2] bus: brcmstb_gisb: misc fixes
  2014-10-10 21:10     ` Arnd Bergmann
@ 2014-10-10 21:55       ` Florian Fainelli
  -1 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2014-10-10 21:55 UTC (permalink / raw
  To: Arnd Bergmann, linux-arm-kernel
  Cc: linux-kernel, thomas.petazzoni, computersforpeace

On 10/10/2014 02:10 PM, Arnd Bergmann wrote:
> On Friday 10 October 2014 12:25:17 Florian Fainelli wrote:
>>
>> On 09/22/2014 11:02 AM, Florian Fainelli wrote:
>>> Hi Arnd,
>>>
>>> This patch set contains two small fixes for the Broadcom GISB bus
>>> arbiter code. First patch makes sure we do register a fault code for
>>> ARM platforms, second patch is a fix when the code is used on a PM
>>> capable system.
>>
>> Once the merge window re-opens in about a week from now, how do you want
>> me to submit those patches? Do you want them as part of a brcmstb pull
>> request, or something else?
> 
> At least one of us is confused. The merge window is currently open,
> and I have send all outstanding pull requests for 3.18. If you have
> bug fixes that are required for 3.18, we should merge them now and
> send them as soon as possible.

I'm the one confusing the terms here, I meant to write: "when you start
queuing patches again".

> 
> If this is stuff that can wait for 3.19, please send a pull
> request after the the end of the ELC/LPC conferences next week
> so we can queue it up in next/fixes-non-critical.

That can wait for 3.19, thanks!
--
Florian


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

* [PATCH v3 0/2] bus: brcmstb_gisb: misc fixes
@ 2014-10-10 21:55       ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2014-10-10 21:55 UTC (permalink / raw
  To: linux-arm-kernel

On 10/10/2014 02:10 PM, Arnd Bergmann wrote:
> On Friday 10 October 2014 12:25:17 Florian Fainelli wrote:
>>
>> On 09/22/2014 11:02 AM, Florian Fainelli wrote:
>>> Hi Arnd,
>>>
>>> This patch set contains two small fixes for the Broadcom GISB bus
>>> arbiter code. First patch makes sure we do register a fault code for
>>> ARM platforms, second patch is a fix when the code is used on a PM
>>> capable system.
>>
>> Once the merge window re-opens in about a week from now, how do you want
>> me to submit those patches? Do you want them as part of a brcmstb pull
>> request, or something else?
> 
> At least one of us is confused. The merge window is currently open,
> and I have send all outstanding pull requests for 3.18. If you have
> bug fixes that are required for 3.18, we should merge them now and
> send them as soon as possible.

I'm the one confusing the terms here, I meant to write: "when you start
queuing patches again".

> 
> If this is stuff that can wait for 3.19, please send a pull
> request after the the end of the ELC/LPC conferences next week
> so we can queue it up in next/fixes-non-critical.

That can wait for 3.19, thanks!
--
Florian

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

end of thread, other threads:[~2014-10-10 21:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-22 18:02 [PATCH v3 0/2] bus: brcmstb_gisb: misc fixes Florian Fainelli
2014-09-22 18:02 ` Florian Fainelli
2014-09-22 18:02 ` [PATCH v3 1/2] bus: brcmstb_gisb: register the fault code hook Florian Fainelli
2014-09-22 18:02   ` Florian Fainelli
2014-09-22 18:02 ` [PATCH v3 2/2] bus: brcmstb_gisb: save and restore GISB timeout Florian Fainelli
2014-09-22 18:02   ` Florian Fainelli
2014-10-10 19:25 ` [PATCH v3 0/2] bus: brcmstb_gisb: misc fixes Florian Fainelli
2014-10-10 19:25   ` Florian Fainelli
2014-10-10 21:10   ` Arnd Bergmann
2014-10-10 21:10     ` Arnd Bergmann
2014-10-10 21:55     ` Florian Fainelli
2014-10-10 21:55       ` Florian Fainelli

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.