bus: brcmstb_gisb: misc fixes
v3 cover bus: brcmstb_gisb: misc fixes
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(-)
Signature · 1 line
1.9.1
PATCH v3 1/2 bus: brcmstb_gisb: register the fault code hook
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.
---
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(-)
drivers/bus/brcmstb_gisb.c +3 -6
@@ -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);
Signature · 1 line
1.9.1
PATCH v3 2/2 bus: brcmstb_gisb: save and restore GISB timeout
In reply to Florian FainelliWhen 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.
---
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(+)
drivers/bus/brcmstb_gisb.c +36 -0
@@ -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, }, };
Signature · 1 line
1.9.1
Arnd,
Quoted 6 lines · 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.
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!
Quoted 8 lines
Florian Fainelli (2):
bus:brcmstb_gisb: register the fault code hook
bus:brcmstb_gisb: save and restore GISB timeoutdrivers/bus/brcmstb_gisb.c | 45 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-)
Quoted 4 lines · On Friday 10 October 2014 12:25:17 Florian Fainelli wrote:
Quoted 2 lines · Florian Fainelli
Hi Arnd,
Quoted 8 lines
Quoted 4 lines
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
Quoted 10 lines · Arnd Bergmann
Quoted 9 lines · On Friday 10 October 2014 12:25:17 Florian Fainelli wrote:
Quoted 6 lines · 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.
Quoted 8 lines
Quoted 3 lines
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".
Quoted 4 lines
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