* [PATCH 1/2] bus: brcmstb_gisb: register the fault code hook
@ 2014-09-19 19:44 ` Florian Fainelli
0 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2014-09-19 19:44 UTC (permalink / raw)
To: linux-kernel; +Cc: arnd, computersforpeace, 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 with an arch_initcall.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/bus/brcmstb_gisb.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c
index f2cd6a2d40b4..daae4f77f34a 100644
--- a/drivers/bus/brcmstb_gisb.c
+++ b/drivers/bus/brcmstb_gisb.c
@@ -48,6 +48,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);
@@ -160,11 +161,13 @@ static int brcmstb_bus_error_handler(unsigned long addr, unsigned int fsr,
return ret;
}
-void __init brcmstb_hook_fault_code(void)
+static int __init brcmstb_hook_fault_code(void)
{
hook_fault_code(22, brcmstb_bus_error_handler, SIGBUS, 0,
"imprecise external abort");
+ return 0;
}
+arch_initcall(brcmstb_hook_fault_code)
static irqreturn_t brcmstb_gisb_timeout_handler(int irq, void *dev_id)
{
--
1.9.1
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH 1/2] bus: brcmstb_gisb: register the fault code hook
2014-09-19 19:44 ` Florian Fainelli
@ 2014-09-19 19:45 ` Florian Fainelli
-1 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2014-09-19 19:45 UTC (permalink / raw)
To: linux-arm-kernel
On 09/19/2014 12:44 PM, Florian Fainelli wrote:
> 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 with an arch_initcall.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/bus/brcmstb_gisb.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c
> index f2cd6a2d40b4..daae4f77f34a 100644
> --- a/drivers/bus/brcmstb_gisb.c
> +++ b/drivers/bus/brcmstb_gisb.c
> @@ -48,6 +48,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;
Meh, this change is unrelated, I will resubmit a v2 shortly, sorry for
the noise.
> };
>
> static LIST_HEAD(brcmstb_gisb_arb_device_list);
> @@ -160,11 +161,13 @@ static int brcmstb_bus_error_handler(unsigned long addr, unsigned int fsr,
> return ret;
> }
>
> -void __init brcmstb_hook_fault_code(void)
> +static int __init brcmstb_hook_fault_code(void)
> {
> hook_fault_code(22, brcmstb_bus_error_handler, SIGBUS, 0,
> "imprecise external abort");
> + return 0;
> }
> +arch_initcall(brcmstb_hook_fault_code)
>
> static irqreturn_t brcmstb_gisb_timeout_handler(int irq, void *dev_id)
> {
>
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 1/2] bus: brcmstb_gisb: register the fault code hook
@ 2014-09-19 19:45 ` Florian Fainelli
0 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2014-09-19 19:45 UTC (permalink / raw)
To: linux-kernel; +Cc: arnd, computersforpeace, linux-arm-kernel
On 09/19/2014 12:44 PM, Florian Fainelli wrote:
> 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 with an arch_initcall.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/bus/brcmstb_gisb.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c
> index f2cd6a2d40b4..daae4f77f34a 100644
> --- a/drivers/bus/brcmstb_gisb.c
> +++ b/drivers/bus/brcmstb_gisb.c
> @@ -48,6 +48,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;
Meh, this change is unrelated, I will resubmit a v2 shortly, sorry for
the noise.
> };
>
> static LIST_HEAD(brcmstb_gisb_arb_device_list);
> @@ -160,11 +161,13 @@ static int brcmstb_bus_error_handler(unsigned long addr, unsigned int fsr,
> return ret;
> }
>
> -void __init brcmstb_hook_fault_code(void)
> +static int __init brcmstb_hook_fault_code(void)
> {
> hook_fault_code(22, brcmstb_bus_error_handler, SIGBUS, 0,
> "imprecise external abort");
> + return 0;
> }
> +arch_initcall(brcmstb_hook_fault_code)
>
> static irqreturn_t brcmstb_gisb_timeout_handler(int irq, void *dev_id)
> {
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/2] bus: brcmstb_gisb: register the fault code hook
2014-09-19 19:44 ` Florian Fainelli
@ 2014-09-20 13:19 ` Thomas Petazzoni
-1 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2014-09-20 13:19 UTC (permalink / raw)
To: linux-arm-kernel
Dear Florian Fainelli,
On Fri, 19 Sep 2014 12:44:39 -0700, Florian Fainelli wrote:
> -void __init brcmstb_hook_fault_code(void)
> +static int __init brcmstb_hook_fault_code(void)
> {
> hook_fault_code(22, brcmstb_bus_error_handler, SIGBUS, 0,
> "imprecise external abort");
> + return 0;
> }
> +arch_initcall(brcmstb_hook_fault_code)
I don't have the entire context, but if your platform is part of
multi-platform, it means that regardless of which platform is actually
booting your system, you will register your fault hook. Is this the
intended behavior?
Generally speaking, in a multiplatform context, many arch_initcall()
should have a conditional to check whether we're really on a platform
where the initcall is needed.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 1/2] bus: brcmstb_gisb: register the fault code hook
@ 2014-09-20 13:19 ` Thomas Petazzoni
0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2014-09-20 13:19 UTC (permalink / raw)
To: Florian Fainelli; +Cc: linux-kernel, computersforpeace, linux-arm-kernel, arnd
Dear Florian Fainelli,
On Fri, 19 Sep 2014 12:44:39 -0700, Florian Fainelli wrote:
> -void __init brcmstb_hook_fault_code(void)
> +static int __init brcmstb_hook_fault_code(void)
> {
> hook_fault_code(22, brcmstb_bus_error_handler, SIGBUS, 0,
> "imprecise external abort");
> + return 0;
> }
> +arch_initcall(brcmstb_hook_fault_code)
I don't have the entire context, but if your platform is part of
multi-platform, it means that regardless of which platform is actually
booting your system, you will register your fault hook. Is this the
intended behavior?
Generally speaking, in a multiplatform context, many arch_initcall()
should have a conditional to check whether we're really on a platform
where the initcall is needed.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 1/2] bus: brcmstb_gisb: register the fault code hook
2014-09-20 13:19 ` Thomas Petazzoni
@ 2014-09-21 23:10 ` Brian Norris
-1 siblings, 0 replies; 14+ messages in thread
From: Brian Norris @ 2014-09-21 23:10 UTC (permalink / raw)
To: linux-arm-kernel
Hi Thomas,
On Sat, Sep 20, 2014 at 03:19:50PM +0200, Thomas Petazzoni wrote:
> On Fri, 19 Sep 2014 12:44:39 -0700, Florian Fainelli wrote:
>
> > -void __init brcmstb_hook_fault_code(void)
> > +static int __init brcmstb_hook_fault_code(void)
> > {
> > hook_fault_code(22, brcmstb_bus_error_handler, SIGBUS, 0,
> > "imprecise external abort");
> > + return 0;
> > }
> > +arch_initcall(brcmstb_hook_fault_code)
>
> I don't have the entire context, but if your platform is part of
> multi-platform, it means that regardless of which platform is actually
> booting your system, you will register your fault hook. Is this the
> intended behavior?
>
> Generally speaking, in a multiplatform context, many arch_initcall()
> should have a conditional to check whether we're really on a platform
> where the initcall is needed.
Florian already sent v2, about which I already made a similar comment:
https://lkml.org/lkml/2014/9/19/516
I believe Florian plans to move this into the platform device probe
function instead.
Brian
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH 1/2] bus: brcmstb_gisb: register the fault code hook
@ 2014-09-21 23:10 ` Brian Norris
0 siblings, 0 replies; 14+ messages in thread
From: Brian Norris @ 2014-09-21 23:10 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Florian Fainelli, linux-kernel, linux-arm-kernel, arnd
Hi Thomas,
On Sat, Sep 20, 2014 at 03:19:50PM +0200, Thomas Petazzoni wrote:
> On Fri, 19 Sep 2014 12:44:39 -0700, Florian Fainelli wrote:
>
> > -void __init brcmstb_hook_fault_code(void)
> > +static int __init brcmstb_hook_fault_code(void)
> > {
> > hook_fault_code(22, brcmstb_bus_error_handler, SIGBUS, 0,
> > "imprecise external abort");
> > + return 0;
> > }
> > +arch_initcall(brcmstb_hook_fault_code)
>
> I don't have the entire context, but if your platform is part of
> multi-platform, it means that regardless of which platform is actually
> booting your system, you will register your fault hook. Is this the
> intended behavior?
>
> Generally speaking, in a multiplatform context, many arch_initcall()
> should have a conditional to check whether we're really on a platform
> where the initcall is needed.
Florian already sent v2, about which I already made a similar comment:
https://lkml.org/lkml/2014/9/19/516
I believe Florian plans to move this into the platform device probe
function instead.
Brian
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 1/2] bus: brcmstb_gisb: register the fault code hook
2014-09-21 23:10 ` Brian Norris
@ 2014-09-22 6:57 ` Thomas Petazzoni
-1 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2014-09-22 6:57 UTC (permalink / raw)
To: linux-arm-kernel
Brian,
On Sun, 21 Sep 2014 16:10:10 -0700, Brian Norris wrote:
> > I don't have the entire context, but if your platform is part of
> > multi-platform, it means that regardless of which platform is actually
> > booting your system, you will register your fault hook. Is this the
> > intended behavior?
> >
> > Generally speaking, in a multiplatform context, many arch_initcall()
> > should have a conditional to check whether we're really on a platform
> > where the initcall is needed.
>
> Florian already sent v2, about which I already made a similar comment:
>
> https://lkml.org/lkml/2014/9/19/516
Yes, sorry. I saw your review after I sent my e-mail :)
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/2] bus: brcmstb_gisb: register the fault code hook
@ 2014-09-22 6:57 ` Thomas Petazzoni
0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2014-09-22 6:57 UTC (permalink / raw)
To: Brian Norris; +Cc: Florian Fainelli, linux-kernel, linux-arm-kernel, arnd
Brian,
On Sun, 21 Sep 2014 16:10:10 -0700, Brian Norris wrote:
> > I don't have the entire context, but if your platform is part of
> > multi-platform, it means that regardless of which platform is actually
> > booting your system, you will register your fault hook. Is this the
> > intended behavior?
> >
> > Generally speaking, in a multiplatform context, many arch_initcall()
> > should have a conditional to check whether we're really on a platform
> > where the initcall is needed.
>
> Florian already sent v2, about which I already made a similar comment:
>
> https://lkml.org/lkml/2014/9/19/516
Yes, sorry. I saw your review after I sent my e-mail :)
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread