Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: Marek Vasut <marex@denx.de>,
	Stephen Warren <swarren@wwwdotorg.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec,spi-nor"
Date: Thu, 21 May 2015 01:15:26 -0700	[thread overview]
Message-ID: <20150521081526.GG11112@norris-Latitude-E6410> (raw)
In-Reply-To: <CACna6rz6O2XRt0OBmf9stLvM1xh4v4aKTD=MR2EbCKFPV1SOpA@mail.gmail.com>

On Thu, May 21, 2015 at 10:01:05AM +0200, Rafał Miłecki wrote:
> On 21 May 2015 at 09:25, Brian Norris <computersforpeace@gmail.com> wrote:
> > (trim CC a bit, as this is no longer a DT binding question)
> >
> > On Thu, May 21, 2015 at 09:12:25AM +0200, Rafał Miłecki wrote:
> >> On 20 May 2015 at 23:35, Brian Norris <computersforpeace@gmail.com> wrote:
> >> > On Tue, May 19, 2015 at 09:27:50AM +0200, Rafał Miłecki wrote:
> >> >> On 19 May 2015 at 03:34, Brian Norris <computersforpeace@gmail.com> wrote:
> >> >> > So how about the following patch? It seems like we'll need to be able to
> >> >> > ignore useless 'modalias' values in cases like this:
> >> >> >
> >> >> >         // modalias = "shinynewdevice"
> >> >> >         compatible = "myvendor,shinynewdevice", "jedec,spi-nor";
> >> >> >
> >> >> > and also if somebody leaves off the entire shinynewdevice string:
> >> >> >
> >> >> >         // modalias = "spi-nor"
> >> >> >         compatible = "jedec,spi-nor";
> >> >> >
> >> >> > So we rework the spi-nor library to not reject "bad" names, and just
> >> >> > fall back to autodetection, and we add the .of_match_table to properly
> >> >> > catch all "jedec,spi-nor".
> >> >>
> >> >> That's nice but what about platforms using platform data instead of
> >> >> DT? I would like to use some kind of "spi-nor" (with some prefix
> >> >> *maybe*) for them too.
> >> >
> >> > For platform devices, you might as well just use the name of the driver,
> >> > which is 'm25p80'. Isn't that how most platform devices are matched with
> >> > drivers?
> >>
> >> Yes and I think it's ugly because it keeps causing the warning about
> >> read flash model not matching specified one (m25p80).
> >
> > Sure, I agree.
> >
> >> Are you
> >> seriously not going to allow platform stuff *clearly* request flash
> >> model detection (JEDEC RDID OP)? Just because they don't use DT?
> >
> > No, this isn't about "allowing" anything. It's just that my primary
> > concern was to get the DT binding straightened out properly. Linus'
> > current tree now has the proper binding, but the m25p80.c code doesn't
> > quite bind properly. It will work if "jedec,spi-nor" is the first
> > entry in the compatible property (and so it becomes the 'modalias', but
> > not second, third, etc. So my patch fixes that properly.
> >
> > Now, the secondary concern is that you want platform devices to specify
> > something generic, and that doesn't yield a "found X, expected Y"
> > message. I'm perfectly fine with fixing that too, if you have a patch
> > for it. What do you propose?
> 
> Maybe I wasn't clear enough. I was going to start using struct
> flash_platform_data with
> .type = "spi-nor",
> but your proposed patch removes support for such name.

Ah, OK. So that's the part I was overlooking.

> While I like matching DT *clearly* against the whole "jedec,spi-nor"
> string (really, I'm all for it), I'm confused what I should use for
> platform stuff now. I don't have any proposal as my initial plan was
> exactly to use this "spi-nor".
> I guess I don't want to re-add support for "spi-nor" (as you just
> proposed to remove it),

I wasn't really trying to remove "spi-nor", that was mostly a side
effect.

> so I think I have to bounce the question: what
> alternative do you propose?

I think your comments suggest that I shouldn't be removing "spi-nor"
from m25p_ids[] nor from this block:

	if (data && data->type)
		flash_name = data->type;
	else if (!strcmp(spi->modalias, "spi-nor"))
		flash_name = NULL; /* auto-detect */
	else
		flash_name = spi->modalias;

So it stays in both m25p_ids[] and .of_match_table.

I suppose that can work. It then allows people to do weird stuff like:

	compatible = "idontknowwhatimdoing,spi-nor";

in their device tree. But other than that, there's not much downside I don't
think.

Brian

  reply	other threads:[~2015-05-21  8:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 17:32 [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec, spi-nor" Brian Norris
2015-05-14 17:46 ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec,spi-nor" Stephen Warren
2015-05-14 20:26   ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec, spi-nor" Geert Uytterhoeven
2015-05-15 20:02     ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec,spi-nor" Brian Norris
2015-05-15 20:52       ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec, spi-nor" Rafał Miłecki
2015-05-18 14:42       ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec,spi-nor" Stephen Warren
2015-05-15 10:17 ` Mark Rutland
2015-05-15 19:55 ` Brian Norris
2015-05-18 10:45   ` Mark Rutland
2015-05-18 18:34     ` Brian Norris
2015-05-18 18:51       ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec, spi-nor" Geert Uytterhoeven
2015-05-19  1:34         ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec,spi-nor" Brian Norris
2015-05-19  7:27           ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec, spi-nor" Rafał Miłecki
2015-05-20 21:35             ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec,spi-nor" Brian Norris
2015-05-21  7:12               ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec, spi-nor" Rafał Miłecki
2015-05-21  7:25                 ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec,spi-nor" Brian Norris
2015-05-21  8:01                   ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec, spi-nor" Rafał Miłecki
2015-05-21  8:15                     ` Brian Norris [this message]
2015-05-21  8:25                       ` Rafał Miłecki
2015-05-21  8:39                         ` Geert Uytterhoeven
2015-05-21  8:50                           ` Rafał Miłecki
2015-05-21  8:58                             ` Geert Uytterhoeven
2015-05-21  9:31                               ` Rafał Miłecki
2015-05-21  9:39                                 ` Geert Uytterhoeven
2015-05-21  9:47                                   ` Rafał Miłecki
2015-05-21  9:57                                   ` Rafał Miłecki
2015-07-21 16:57           ` [PATCH] Documentation: dt: mtd: replace "nor-jedec" binding with "jedec,spi-nor" 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=20150521081526.GG11112@norris-Latitude-E6410 \
    --to=computersforpeace@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=swarren@wwwdotorg.org \
    --cc=zajec5@gmail.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