linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mason <slash.tmp@free.fr>
To: Brian Norris <computersforpeace@gmail.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Sebastian Frias <sf84@laposte.net>
Subject: Re: RFC on large number of hacks in mtd core files
Date: Sat, 23 Jan 2016 11:53:22 +0100	[thread overview]
Message-ID: <56A35BA2.3040906@free.fr> (raw)
In-Reply-To: <20160123031635.GB90611@google.com>

Hello Brian,

On 23/01/2016 04:16, Brian Norris wrote:

> On Fri, Jan 22, 2016 at 04:34:58PM +0100, Mason wrote:
> 
>> Hello everyone,
>>
>> As I've mentioned in a previous thread, I'm supposed to port a NAND
>> controller driver from 3.4 to 4.4. But this is complicated by the
>> fact that several core files have been modified along the way.
>>
>> Here's the full picture:
>>
>> $ git diff --stat v3.4.39 custom-3.4 drivers/mtd
>>  drivers/mtd/Kconfig                 |   15 +-
>>  drivers/mtd/chips/cfi_cmdset_0002.c |  129 ++-
>>  drivers/mtd/devices/Kconfig         |    6 +
>>  drivers/mtd/devices/Makefile        |    3 +-
>>  drivers/mtd/devices/m25p80.c        |  100 +-
>>  drivers/mtd/devices/spiflash.c      | 2131 +++++++++++++++++++++++++++++++++++
>>  drivers/mtd/maps/Kconfig            |   11 +-
>>  drivers/mtd/maps/physmap.c          |  202 +++-
>>  drivers/mtd/mtdchar.c               |   54 +
>>  drivers/mtd/mtdcore.c               |   63 +-
>>  drivers/mtd/mtdpart.c               |    9 +
>>  drivers/mtd/nand/Kconfig            |   46 +-
>>  drivers/mtd/nand/Makefile           |   11 +-
>>  drivers/mtd/nand/monza_nand.c       |  614 ++++++++++
>>  drivers/mtd/nand/nand_base.c        | 1226 +++++++++++++++++++-
>>  drivers/mtd/nand/nand_bch_ecc.c     |  311 +++++
>>  drivers/mtd/nand/nand_bch_ecc.h     |   11 +
>>  drivers/mtd/nand/nand_ids.c         |  253 ++++-
>>  drivers/mtd/nand/nandsim.c          |    2 +-
>>  drivers/mtd/nand/smp8xxx_nand.c     | 2009 +++++++++++++++++++++++++++++++++
>>  drivers/mtd/ubi/misc.c              |    7 +
>>  21 files changed, 7164 insertions(+), 49 deletions(-)
> 
> ^^ This doesn't make sense. You've changed over 7000 lines, but your
> entire email is less than 3000 lines. From that alone, I can see you
> haven't given us the whole diff...

Sorry for the confusion. My intention was to provide a
"complete picture" in the diff stat, then trim "useless"
stuff from the actual diff, which is still huge :-(

> And just looking at the diff stat, you might want to clear up a few
> things:
> 
> (1) Are you really just talking about supporting a *NAND* driver? If so,
> then you probably don't need your new drivers/mtd/devices/spiflash.c.
> You also probably don't need to touch most things outside of
> drivers/mtd/nand/, like drivers/mtd/chips/cfi_cmdset_0002.c,
> drivers/mtd/maps/physmap.c, drivers/mtd/devices/m25p80.c, etc.

You're right, I should have been clearer.

I am trying to port the smp8xxx_nand.c driver to 4.4 in such
a way that porting to future kernels won't be such a pain.

This means examining changes to "core" files and either
- deleting unnecessary changes
- merging them back into smp8xxx_nand.c
- submitting them upstream

You seem to be saying that none of the changes outside of
drivers/mtd/nand are required for a NAND controller driver?
That would be great news for me.

Bear in mind that the essence of the driver is "quick and dirty".
So it wouldn't surprise me to find required code outside of
drivers/mtd/nand :-(


I see that m25p80.c is in mtd/devices.
This has nothing to do with the NAND controller drivers?

I thought it was a type of NAND chip, and any NAND controller
might be connected to one such chip.

> (2) How many NAND drivers do you actually have? I see two "new" NAND
> drivers: drivers/mtd/nand/smp8xxx_nand.c and
> drivers/mtd/nand/monza_nand.c.

Please ignore:
monza_nand.c  nand_bch_ecc.*  spiflash.c

>> Here's the actual diff, with non-core changes omitted.
> 
> Ah, I see why the diffstat vs diff discrepancy.
> 
> Others may feel more inclined to humor you, but by omitting the drivers
> themselves, it's hard to really get the whole picture.

I understand.

I'll spend a few hours to clean up the diffs and keep only
what I think is relevant. (Risk being that I delete the
wrong stuff, since I can't test the driver.)

Regards.

  reply	other threads:[~2016-01-23 10:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22 15:34 RFC on large number of hacks in mtd core files Mason
2016-01-23  3:16 ` Brian Norris
2016-01-23 10:53   ` Mason [this message]
2016-01-25 17:34     ` Mason
2016-01-28 18:05       ` Geert Uytterhoeven
2016-01-28 21:05         ` Mason
2016-01-29  7:50           ` Geert Uytterhoeven
2016-01-29 16:27       ` Boris Brezillon
2016-01-29 18:14         ` Brian Norris
2016-01-30 11:37           ` Boris Brezillon
2016-01-29 23:25         ` Mason
2016-01-30 11:22           ` Boris Brezillon

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=56A35BA2.3040906@free.fr \
    --to=slash.tmp@free.fr \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=sf84@laposte.net \
    /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).