lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 15 May 2015 12:57:56 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	linux-arm-kernel@...ts.infradead.org
Cc:	tthayer@...nsource.altera.com, bp@...en8.de,
	dougthompson@...ssion.com, m.chehab@...sung.com,
	robh+dt@...nel.org, pawel.moll@....com, mark.rutland@....com,
	ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
	linux@....linux.org.uk, dinguyen@...nsource.altera.com,
	grant.likely@...aro.org, devicetree@...r.kernel.org,
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
	tthayer.linux@...il.com, linux-edac@...r.kernel.org
Subject: Re: [PATCH 3/4] edac, altera: Addition of Arria10 EDAC

On Wednesday 13 May 2015 16:49:46 tthayer@...nsource.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ