From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] edac, altera: Addition of Arria10 EDAC
Date: Fri, 15 May 2015 12:57:56 +0200 [thread overview]
Message-ID: <2896031.Yz7YCP9E71@wuerfel> (raw)
In-Reply-To: <1431553787-27741-4-git-send-email-tthayer@opensource.altera.com>
On Wednesday 13 May 2015 16:49:46 tthayer at opensource.altera.com wrote:
> +static int a10_unmask_irq(struct platform_device *pdev, u32 mask)
> +{
> + void __iomem *sm_base;
> +
> + if (!devm_request_mem_region(&pdev->dev, A10_SYMAN_INTMASK_CLR,
> + sizeof(u32), dev_name(&pdev->dev))) {
> + edac_printk(KERN_ERR, EDAC_MC,
> + "Unable to request mem region\n");
> + return -EBUSY;
> + }
> +
> + sm_base = devm_ioremap(&pdev->dev, A10_SYMAN_INTMASK_CLR,
> + sizeof(u32));
> + if (!sm_base) {
> + edac_printk(KERN_ERR, EDAC_MC,
> + "Unable to ioremap device\n");
> +
> + return -ENOMEM;
> + }
> +
> + iowrite32(mask, sm_base);
> +
> + devm_iounmap(&pdev->dev, sm_base);
> + devm_release_mem_region(&pdev->dev, A10_SYMAN_INTMASK_CLR,
> + sizeof(u32));
> +
> + return 0;
> +}
If you always unmap right away, better use the normal request_mem_region
and ioremap functions rather than their devm counterparts.
>
> + /* Only the Arria10 has separate IRQs */
> + if (irq2 > 0) {
> + /* Arria10 specific initialization */
> + res = a10_init(mc_vbase);
> + if (res < 0)
> + goto err2;
> +
> + res = a10_unmask_irq(pdev, A10_DDR0_IRQ_MASK);
> + if (res < 0)
> + goto err2;
> +
> + res = devm_request_irq(&pdev->dev, irq2,
> + altr_sdram_mc_err_handler,
> + IRQF_SHARED, dev_name(&pdev->dev), mci);
> + if (res < 0) {
> + edac_mc_printk(mci, KERN_ERR,
> + "Unable to request irq %d\n", irq2);
> + res = -ENODEV;
> + goto err2;
> + }
> + irqflags = IRQF_SHARED;
> + }
> +
>
Should the unmask be done after the request?
Arnd
next prev parent reply other threads:[~2015-05-15 10:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 21:49 [PATCH 0/4] Add Altera Arria10 EDAC Support tthayer at opensource.altera.com
2015-05-13 21:49 ` [PATCH 1/4] edac, altera: Generalize driver to use DT Memory size tthayer at opensource.altera.com
2015-05-14 3:25 ` Dinh Nguyen
2015-05-15 11:00 ` Arnd Bergmann
2015-05-13 21:49 ` [PATCH 2/4] edac, altera: Refactor EDAC for Altera CycloneV SoC tthayer at opensource.altera.com
2015-05-14 20:13 ` Dinh Nguyen
2015-05-13 21:49 ` [PATCH 3/4] edac, altera: Addition of Arria10 EDAC tthayer at opensource.altera.com
2015-05-14 20:20 ` Dinh Nguyen
2015-05-14 20:38 ` Thor Thayer
2015-05-15 10:57 ` Arnd Bergmann [this message]
2015-05-13 21:49 ` [PATCH 4/4] dts, altera: Arria10 SDRAM EDAC DTS additions tthayer at opensource.altera.com
2015-05-15 10:55 ` Arnd Bergmann
2015-05-15 21:01 ` Thor Thayer
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=2896031.Yz7YCP9E71@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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