From: Hans de Goede <hdegoede@redhat.com>
To: Michal Suchanek <hramrach@gmail.com>,
Boris Brezillon <boris.brezillon@free-electrons.com>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
MTD Maling List <linux-mtd@lists.infradead.org>,
linux-sunxi <linux-sunxi@googlegroups.com>
Subject: Re: [PATCH v2] mtd: nand: print full chip ID
Date: Thu, 30 Jul 2015 14:15:25 +0200 [thread overview]
Message-ID: <55BA155D.6000205@redhat.com> (raw)
In-Reply-To: <7db2069b03cd249eed3d76a74bd1bfc83f2290be.1438255877.git.hramrach@gmail.com>
Hi,
On 30-07-15 13:52, Michal Suchanek wrote:
> Full chip ID is printed so user has data to paste from syslog in case
> of chip misidentification.
>
> Signed-off-by: Michal Suchanek <hramrach@gmail.com>
>
> ---
> v2:
>
> - remove superfluous hunk
> - join printed lines
> ---
> drivers/mtd/nand/nand_base.c | 22 ++++++++++++++++++----
> 1 file changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index ceb68ca..7c10e06 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -3631,6 +3631,22 @@ static bool find_full_id_nand(struct mtd_info *mtd, struct nand_chip *chip,
> }
>
> /*
> + * Print full detail of chip ID read from chip.
> + */
> +static void nand_print_chip_info(int maf_id, int dev_id, u8 id_data[8])
> +{
> + u8 delim[8] = { [0 ... 7] = ',' };
> +
> + /* Kernel inserts newline after every other printk so format in one go. */
> + delim[7] = ' ';
> + delim[nand_id_len(id_data, 8) - 1] = ';';
> + pr_info("device found, Manufacturer ID: 0x%02x, Chip ID: 0x%02x, ID data: 0x%02x%c 0x%02x%c 0x%02x%c 0x%02x%c 0x%02x%c 0x%02x%c 0x%02x%c 0x%02x%c\n",
> + maf_id, dev_id,
> + id_data[0], delim[0], id_data[1], delim[1], id_data[2], delim[2], id_data[3], delim[3],
> + id_data[4], delim[4], id_data[5], delim[5], id_data[6], delim[6], id_data[7], delim[7]);
These lines are longer then 80 chars, that is allowed only for lines ending with "...",
Which is why the version of this patch I submitted upstream had:
+ id_data[0], delim[0], id_data[1], delim[1],
+ id_data[2], delim[2], id_data[3], delim[3],
+ id_data[4], delim[4], id_data[5], delim[5],
+ id_data[6], delim[6], id_data[7], delim[7]);
Other then that this version looks good to me, and I agree that having this
info as non pr_debug is quite useful so that if (variants of) boards show up
with a nand with an unknown nand id, but one which the auto-detect code
does handle, we will still know and we can add an entry to the id table
for the nand to enable extra features (higher speed, special read retry
logic). This is quite likely to happen with e.g. the popular mk802 hdmi
tv sticks which have a single dts file for all of them, but come with
different nand chips based on the exact production run.
Regards,
Hans
> +}
> +
> +/*
> * Get the flash and manufacturer id and lookup if the type is supported.
> */
> static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
> @@ -3743,8 +3759,7 @@ ident_done:
> * Check, if buswidth is correct. Hardware drivers should set
> * chip correct!
> */
> - pr_info("device found, Manufacturer ID: 0x%02x, Chip ID: 0x%02x\n",
> - *maf_id, *dev_id);
> + nand_print_chip_info(*maf_id, *dev_id, id_data);
> pr_info("%s %s\n", nand_manuf_ids[maf_idx].name, mtd->name);
> pr_warn("bus width %d instead %d bit\n",
> (chip->options & NAND_BUSWIDTH_16) ? 16 : 8,
> @@ -3775,8 +3790,7 @@ ident_done:
> if (mtd->writesize > 512 && chip->cmdfunc == nand_command)
> chip->cmdfunc = nand_command_lp;
>
> - pr_info("device found, Manufacturer ID: 0x%02x, Chip ID: 0x%02x\n",
> - *maf_id, *dev_id);
> + nand_print_chip_info(*maf_id, *dev_id, id_data);
>
> if (chip->onfi_version)
> pr_info("%s %s\n", nand_manuf_ids[maf_idx].name,
>
next prev parent reply other threads:[~2015-07-30 12:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-29 17:53 [PATCH 1/4] mtd: nand: Fix NAND_* options to use unique values Hans de Goede
2015-07-29 17:53 ` [PATCH 2/4] mtd: nand: nand_decode_ext_id(): Fill in ecc strength and size for Samsung Hans de Goede
2015-07-30 7:29 ` Boris Brezillon
2015-07-30 12:19 ` [linux-sunxi] " Hans de Goede
2015-07-29 17:53 ` [PATCH 3/4] mtd: nand: nand_get_flash_type: Print detected ECC strength and size Hans de Goede
2015-07-30 7:23 ` Boris Brezillon
2015-07-30 12:16 ` [linux-sunxi] " Hans de Goede
2015-07-29 17:53 ` [PATCH 4/4] mtd: nand: print full chip ID Hans de Goede
2015-07-29 23:37 ` [linux-sunxi] " Julian Calaby
2015-07-30 4:19 ` Michal Suchanek
2015-07-30 7:17 ` Boris Brezillon
2015-07-30 10:37 ` Michal Suchanek
2015-07-30 11:52 ` [PATCH v2] " Michal Suchanek
2015-07-30 12:15 ` Hans de Goede [this message]
2015-07-29 18:13 ` [PATCH 1/4] mtd: nand: Fix NAND_* options to use unique values 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=55BA155D.6000205@redhat.com \
--to=hdegoede@redhat.com \
--cc=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=hramrach@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-sunxi@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.