From: Arnd Bergmann <arnd@arndb.de>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-kernel@vger.kernel.org, marc.ceeeee@gmail.com,
computersforpeace@gmail.com, gregory.0xf0@gmail.com,
Randy Dunlap <rdunlap@infradead.org>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
Grant Likely <grant.likely@linaro.org>,
Shawn Guo <shawn.guo@linaro.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Nicolas Pitre <nicolas.pitre@linaro.org>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Alexander Shiyan <shc_work@mail.ru>,
Huang Shijie <b32955@freescale.com>,
"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
"open list:OPEN FIRMWARE AND..." <devicetree@vger.kernel.org>
Subject: Re: [PATCH 1/3] bus: add Broadcom GISB arbiter bus timeout/error handler
Date: Wed, 14 May 2014 21:33:51 +0200 [thread overview]
Message-ID: <8057197.5nM8JDA8pQ@wuerfel> (raw)
In-Reply-To: <1400094649-11193-2-git-send-email-f.fainelli@gmail.com>
On Wednesday 14 May 2014 12:10:46 Florian Fainelli wrote:
> This patch adds support for the Broadcom GISB arbiter bus timeout/error
> handler. GISB is a proprietary bus used by Broadcom Set Top Box
> System-on-a-chip devices (BCM7xxx) which allows multiple masters and
> clients to be interfaced with each other.
>
> The bus arbiter offers support for generating two interrupts towards the
> host CPU, thus allowing us to "catch" clock gated masters, or masters
> being volontarily blocked for powersaving purposes, or do general system
> troubleshooting.
>
> We also register a hook with the ARM fault exception handling to allow
> printing a more informative message than "imprecise external abort at
> 0x00000000" for instance.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Looks pretty good to me.
> +static int brcmstb_gisb_arb_decode_addr(struct brcmstb_gisb_arb_device *gdev,
> + const char *reason)
> +{
> + u32 cap_status;
> + unsigned long arb_addr;
> + u32 master;
> + const char *m_name;
> + char m_fmt[11];
> +
> + cap_status = ioread32(gdev->base + ARB_ERR_CAP_STATUS);
> +
> + /* Invalid captured address, bail out */
> + if (!(cap_status & ARB_ERR_CAP_STATUS_VALID))
> + return 1;
> +
> + /* Read the address and master */
> + arb_addr = ioread32(gdev->base + ARB_ERR_CAP_ADDR) & 0xffffffff;
> +#ifdef CONFIG_PHYS_ADDR_T_64BIT
> + arb_addr |= (u64)ioread32(gdev->base + ARB_ERR_CAP_HI_ADDR) << 32;
> +#endif
Can you use 'if (IS_ENABLED(CONFIG_PHYS_ADDR_T_64BIT))' here, or does that
cause a warning?
> +static int brcmstb_bus_error_handler(unsigned long addr, unsigned int fsr,
> + struct pt_regs *regs)
> +{
> + int ret = 0;
> + struct brcmstb_gisb_arb_device *gdev;
> +
> + /* iterate over each GISB arb registered handlers */
> + list_for_each_entry(gdev, &brcmstb_gisb_arb_device_list, next)
> + ret |= brcmstb_gisb_arb_decode_addr(gdev, "bus error");
> + /*
> + * If it was an imprecise abort, then we need to correct the
> + * return address to be _after_ the instruction.
> + */
> + if (fsr & (1 << 10))
> + regs->ARM_pc += 4;
> +
> + return ret;
> +}
This will cause the normal abort handler to trigger if the GISB
arbiter doesn't know what happened, right?
Arnd
next prev parent reply other threads:[~2014-05-14 19:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-14 19:10 [PATCH 0/3] bus: add Broadcom GISB bus arbiter timeout/error handler Florian Fainelli
2014-05-14 19:10 ` [PATCH 1/3] bus: add Broadcom GISB arbiter bus " Florian Fainelli
2014-05-14 19:33 ` Arnd Bergmann [this message]
2014-05-14 19:46 ` Florian Fainelli
2014-05-14 19:50 ` Arnd Bergmann
[not found] ` <1400094649-11193-1-git-send-email-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-05-14 19:10 ` [PATCH 1/3] bus: add Broadcom GISB bus arbiter " Florian Fainelli
2014-05-14 19:24 ` Randy Dunlap
[not found] ` <5373C2EB.8020806-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2014-05-14 19:26 ` Florian Fainelli
2014-05-14 19:10 ` [PATCH 2/3] Documentation: devicetree: add Broadcom GISB arbiter bindings Florian Fainelli
2014-05-14 19:10 ` [PATCH 3/3] Documentation: sysfs: add Broadcom GISB arbiter sysfs properties Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8057197.5nM8JDA8pQ@wuerfel \
--to=arnd@arndb.de \
--cc=b32955@freescale.com \
--cc=computersforpeace@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=galak@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=gregory.0xf0@gmail.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=marc.ceeeee@gmail.com \
--cc=mark.rutland@arm.com \
--cc=nicolas.pitre@linaro.org \
--cc=pawel.moll@arm.com \
--cc=rdunlap@infradead.org \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawn.guo@linaro.org \
--cc=shc_work@mail.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox