Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: computersforpeace@gmail.com (Brian Norris)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/9] mtd: nand: stm_nand_bch: adding BBT header
Date: Sun, 5 Oct 2014 22:07:31 -0700	[thread overview]
Message-ID: <20141006050731.GG3248@norris-Latitude-E6410> (raw)
In-Reply-To: <1409143344-22458-8-git-send-email-lee.jones@linaro.org>

Hi Lee,

On Wed, Aug 27, 2014 at 01:42:22PM +0100, Lee Jones wrote:
> This header will be used firstly by the BCH main driver, then the
> Bad Block Table (BBT) code which will be added immediately after.
> Doing it this way provides the cleanest method of keeping the
> patch-set bisectable.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  include/linux/mtd/stm_nand_bbt.h | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>  create mode 100644 include/linux/mtd/stm_nand_bbt.h
> 
> diff --git a/include/linux/mtd/stm_nand_bbt.h b/include/linux/mtd/stm_nand_bbt.h
> new file mode 100644
> index 0000000..bcb33b2
> --- /dev/null
> +++ b/include/linux/mtd/stm_nand_bbt.h
> @@ -0,0 +1,17 @@
> +#include <linux/mtd/stm_nand.h>
> +
> +/* BCH ECC sizes */
> +static int bch_ecc_sizes[] = {
> +	[BCH_18BIT_ECC] = 32,
> +	[BCH_30BIT_ECC] = 54,
> +	[BCH_NO_ECC] = 0,
> +};
> +
> +#if defined(CONFIG_MTD_NAND_STM_BCH_BBT)
> +extern void nandi_dump_bad_blocks(struct nandi_controller *nandi);
> +extern int bch_scan_bbt(struct mtd_info *mtd);
> +extern int bch_block_isbad(struct mtd_info *mtd, loff_t offs, int getchip);
> +extern int bch_block_markbad(struct mtd_info *mtd, loff_t offs);
> +#else
> +inline void nandi_dump_bad_blocks(struct nandi_controller *nandi) {}

This line induces the following failure when everything is built as a
module:

  drivers/mtd/nand/stm_nand_bbt.c:579:6: error: redefinition of 'nandi_dump_bad_blocks'
  include/linux/mtd/stm_nand_bbt.h:16:84: note: previous definition of 'nandi_dump_bad_blocks' was here

This highlights the fact that:
(1) This should be 'static inline', not just 'inline'
(2) Your code is not modularized properly. You can't build
    stm_nand_bbt.o and stm_nand_bch.o as kernel modules properly, since
    #if defined() isn't true when CONFIG_MTD_NAND_STM_BCH_BBT=m
(3) You're building 3 separate modules for your STM NAND code, where 2
    might suffice (one for NAND support and one for BBT).

Ezequiel has been running through some of the same build problems with
the OMAP NAND + ELM (ECC) driver recently. You might check the recent
MTD archives for this. Or you might just restrict your driver to being
built-in (non-module) if you can't fix this for now.

> +#endif

Brian

  reply	other threads:[~2014-10-06  5:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 12:42 [PATCH v3 0/9] mtd: nand: Support for new DT NAND driver Lee Jones
2014-08-27 12:42 ` [PATCH 1/9] ARM: multi-v7: Enable ST BCH NAND Lee Jones
2014-08-27 12:42 ` [PATCH 2/9] ARM: sti: Add two new clock definitions for use with ST's NAND controllers Lee Jones
2014-08-27 12:42 ` [PATCH 3/9] ARM: sti: Add BCH (NAND Flash) Controller support for STiH41x (Orly) SoCs Lee Jones
2014-08-27 12:42 ` [PATCH 4/9] ARM: sti: Enable BCH NAND for STiH416 B2020-RevE Lee Jones
2014-08-27 12:42 ` [PATCH 5/9] mtd: nand: stm_nand_bch: provide Device Tree documentation Lee Jones
2014-10-06  5:06   ` Brian Norris
2014-08-27 12:42 ` [PATCH 6/9] mtd: nand: stm_nand_bch: add shared register defines for ST's NAND Controller drivers Lee Jones
2014-08-27 12:42 ` [PATCH 7/9] mtd: nand: stm_nand_bch: adding BBT header Lee Jones
2014-10-06  5:07   ` Brian Norris [this message]
2014-08-27 12:42 ` [PATCH 8/9] mtd: nand: stm_nand_bch: add support for ST's BCH NAND controller Lee Jones
2014-10-06  6:21   ` Brian Norris
2014-10-09 14:39     ` Lee Jones
2014-10-15 23:02       ` Brian Norris
2014-11-05 12:01         ` Lee Jones
2014-10-06  6:40   ` Brian Norris
2014-10-08 10:50     ` Lee Jones
2014-08-27 12:42 ` [PATCH 9/9] mtd: nand: stm_nand_bch: provide ST's implementation of Back Block Table Lee Jones
2014-10-06  6:25   ` Brian Norris

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=20141006050731.GG3248@norris-Latitude-E6410 \
    --to=computersforpeace@gmail.com \
    --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