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]
Message-ID: <20080607191815.3dc24360@siona.local>
Date:	Sat, 7 Jun 2008 19:18:15 +0200
From:	Haavard Skinnemoen <haavard.skinnemoen@...el.com>
To:	"Andrew Victor" <avictor.za@...il.com>
Cc:	linux-mtd@...ts.infradead.org, kernel@...32linux.org,
	"Nicolas Ferre" <nicolas.ferre@...el.com>,
	"Patrice VILCHEZ" <patrice.vilchez@...el.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/8] atmel_nand: Clean up and fix probe() error path

On Sat, 7 Jun 2008 18:08:07 +0200
"Andrew Victor" <avictor.za@...il.com> wrote:

> hi Haavard,
> 
> > This fixes several bugs in the atmel_nand_probe() error path, including
> > at least one memory leak.
> 
> There is an issue with the current at91_nand driver here.

Hmm, right.

> The driver currently ioremap()'s the ECC controller's registers, but
> on the AT91 the ECC controller is part of the System Peripherals and
> so it is already mapped at startup.
> I don't think it can/should be remapped twice.

I don't see why that's really a problem -- it may get a different
virtual address and possibly waste a TLB entry, but it should work.

> The AT91 patch (on maxim.org.za) current does:
>     regs = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>          ....
>     host->ecc = (void __force __iomem *) (AT91_VA_BASE_SYS - AT91_BASE_SYS);
>     host->ecc += regs->start;
> instead of the ioremap().  But this is not portable to the AVR32.

How about sticking a "void __iomem *ecc_regs" field in struct
atmel_nand_data and allow platforms to specify a pre-mapped pointer?
Then the driver can do

	if (host->board->ecc_regs)
		host->ecc = host->board->ecc_regs;
	else if (regs)
		host->ecc = ioremap(regs->start, regs->end - regs->start + 1);

	if (hard_ecc && !host->ecc)
		printk("Hardware ECC not available\n");

Right? I think we use a similar trick in the atmel_serial driver too.

Haavard
--
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