public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
To: "Andrew Victor" <avictor.za@gmail.com>
Cc: Patrice VILCHEZ <patrice.vilchez@atmel.com>,
	kernel@avr32linux.org, linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: Re: [PATCH 4/8] atmel_nand: Clean up and fix probe() error path
Date: Sat, 7 Jun 2008 19:18:15 +0200	[thread overview]
Message-ID: <20080607191815.3dc24360@siona.local> (raw)
In-Reply-To: <cd73a99e0806070908n5c9b6be4ned0386905555a1b7@mail.gmail.com>

On Sat, 7 Jun 2008 18:08:07 +0200
"Andrew Victor" <avictor.za@gmail.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

  reply	other threads:[~2008-06-07 17:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06 16:04 [PATCH 0/8] Make at91_nand usable on AVR32 Haavard Skinnemoen
2008-06-06 16:04 ` [PATCH 1/8] at91_nand: Convert to generic GPIO API Haavard Skinnemoen
2008-06-06 16:04   ` [PATCH 2/8] rename at91_nand -> atmel_nand: file names and Kconfig Haavard Skinnemoen
2008-06-06 16:04     ` [PATCH 3/8] rename at91_nand -> atmel_nand: internal symbols Haavard Skinnemoen
2008-06-06 16:04       ` [PATCH 4/8] atmel_nand: Clean up and fix probe() error path Haavard Skinnemoen
2008-06-06 16:04         ` [PATCH 5/8] avr32: move hsmc_init() to core_initcall Haavard Skinnemoen
2008-06-06 16:04           ` [PATCH 6/8] avr32: atmel_nand platform code for AT32AP700x Haavard Skinnemoen
2008-06-06 16:04             ` [PATCH 7/8] atmel_nand: make available on AVR32 Haavard Skinnemoen
2008-06-06 16:04               ` [PATCH 8/8] avr32: Add support for ATSTK1006 Haavard Skinnemoen
2008-06-07 16:08               ` [PATCH 7/8] atmel_nand: make available on AVR32 Andrew Victor
2008-06-07 16:08         ` [PATCH 4/8] atmel_nand: Clean up and fix probe() error path Andrew Victor
2008-06-07 17:18           ` Haavard Skinnemoen [this message]
2008-06-09  7:04             ` Richard Genoud
2008-06-09 20:17               ` Andrew Victor
2008-06-07 15:59       ` [PATCH 3/8] rename at91_nand -> atmel_nand: internal symbols Andrew Victor
2008-06-07 15:55     ` [PATCH 2/8] rename at91_nand -> atmel_nand: file names and Kconfig Andrew Victor
2008-06-07 15:41   ` [PATCH 1/8] at91_nand: Convert to generic GPIO API Andrew Victor

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=20080607191815.3dc24360@siona.local \
    --to=haavard.skinnemoen@atmel.com \
    --cc=avictor.za@gmail.com \
    --cc=kernel@avr32linux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=patrice.vilchez@atmel.com \
    /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