linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>
To: Xiaolei Li <xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Cc: richard-/L3Ra7n9ekc@public.gmane.org,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH v2 4/4] mtd: rawnand: mtk: Add new nfc capability maximize_fdm_ecc
Date: Fri, 20 Apr 2018 22:23:50 +0200	[thread overview]
Message-ID: <20180420222350.620e4db7@bbrezillon> (raw)
In-Reply-To: <1523864464-41059-5-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>

On Mon, 16 Apr 2018 15:41:04 +0800
Xiaolei Li <xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> wrote:

> For some MTK NAND chips, BootROM will access more than one byte
> ECC protected FDM data, but now we fix ECC protected FDM byte as 1.
> This will make some chips be failed to boot up.
> 
> This patch adds one new nfc capability maximize_fdm_ecc to maximize ECC
> protected FDM bytes if it is true.
> 
> Signed-off-by: Xiaolei Li <xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/mtd/nand/raw/mtk_nand.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>  mode change 100644 => 100755 drivers/mtd/nand/raw/mtk_nand.c
> 
> diff --git a/drivers/mtd/nand/raw/mtk_nand.c b/drivers/mtd/nand/raw/mtk_nand.c
> old mode 100644
> new mode 100755
> index 03a4df2..7025132
> --- a/drivers/mtd/nand/raw/mtk_nand.c
> +++ b/drivers/mtd/nand/raw/mtk_nand.c
> @@ -111,6 +111,7 @@ struct mtk_nfc_caps {
>  	u8 pageformat_spare_shift;
>  	u8 nfi_clk_div;
>  	u8 max_sector;
> +	bool maximize_fdm_ecc;
>  };
>  
>  struct mtk_nfc_bad_mark_ctl {
> @@ -1151,8 +1152,8 @@ static void mtk_nfc_set_fdm(struct mtk_nfc_fdm *fdm, struct mtd_info *mtd)
>  	if (fdm->reg_size > NFI_FDM_MAX_SIZE)
>  		fdm->reg_size = NFI_FDM_MAX_SIZE;
>  
> -	/* bad block mark storage */
> -	fdm->ecc_size = 1;
> +	/* Reserve at least one byte for bad mark */
> +	fdm->ecc_size = nfc->caps->maximize_fdm_ecc ? fdm->reg_size : 1;
>  }
>  
>  static void mtk_nfc_set_bad_mark_ctl(struct mtk_nfc_bad_mark_ctl *bm_ctl,
> @@ -1413,6 +1414,7 @@ static int mtk_nfc_nand_chips_init(struct device *dev, struct mtk_nfc *nfc)
>  	.pageformat_spare_shift = 4,
>  	.nfi_clk_div = 1,
>  	.max_sector = 16,
> +	.maximize_fdm_ecc = false,
>  };
>  
>  static const struct mtk_nfc_caps mtk_nfc_caps_mt2712 = {
> @@ -1423,6 +1425,7 @@ static int mtk_nfc_nand_chips_init(struct device *dev, struct mtk_nfc *nfc)
>  	.pageformat_spare_shift = 16,
>  	.nfi_clk_div = 2,
>  	.max_sector = 16,
> +	.maximize_fdm_ecc = false,
>  };
>  
>  static const struct mtk_nfc_caps mtk_nfc_caps_mt7622 = {
> @@ -1433,6 +1436,7 @@ static int mtk_nfc_nand_chips_init(struct device *dev, struct mtk_nfc *nfc)
>  	.pageformat_spare_shift = 4,
>  	.nfi_clk_div = 1,
>  	.max_sector = 8,
> +	.maximize_fdm_ecc = false,
>  };

So, you introduce a new flag, but all existing SoCs are setting it to
false. Can you please send a patch series containing all the
modifications, or at least point to a branch containing all the changes
you intend to push so that we know why the changes are required?
Your first version of this patchset was better in this regard.

>  
>  static const struct of_device_id mtk_nfc_id_table[] = {

  parent reply	other threads:[~2018-04-20 20:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-16  7:41 [PATCH v2 0/4] Improve MTK NAND driver Xiaolei Li
     [not found] ` <1523864464-41059-1-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-16  7:41   ` [PATCH v2 1/4] dt-bindings: mtd: mtk-nand: Update properties description Xiaolei Li
     [not found]     ` <1523864464-41059-2-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-20 20:15       ` Boris Brezillon
2018-04-23  1:43         ` xiaolei li
2018-04-16  7:41   ` [PATCH v2 2/4] MAINTAINERS: Add entry for Mediatek NAND controller driver Xiaolei Li
     [not found]     ` <1523864464-41059-3-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-20 20:24       ` Boris Brezillon
2018-04-22 17:28         ` Boris Brezillon
2018-04-23  1:44         ` xiaolei li
2018-04-16  7:41   ` [PATCH v2 3/4] mtd: rawnand: mtk: Replace max_sector_size with sector size array Xiaolei Li
     [not found]     ` <1523864464-41059-4-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-20 20:18       ` Boris Brezillon
2018-04-23  1:49         ` xiaolei li
2018-04-16  7:41   ` [PATCH v2 4/4] mtd: rawnand: mtk: Add new nfc capability maximize_fdm_ecc Xiaolei Li
     [not found]     ` <1523864464-41059-5-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-20 20:23       ` Boris Brezillon [this message]
2018-04-23  2:04         ` xiaolei li

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=20180420222350.620e4db7@bbrezillon \
    --to=boris.brezillon-ldxbnhwyfcjbdgjk7y7tuq@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=richard-/L3Ra7n9ekc@public.gmane.org \
    --cc=srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).