All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kamal Dasu <kdasu.kdev@gmail.com>
To: Marek Vasut <marex@denx.de>
Cc: Michal Suchanek <hramrach@gmail.com>,
	Cyrille Pitchen <cyrille.pitchen@atmel.com>,
	Mark Brown <broonie@kernel.org>,
	bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	MTD Maling List <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH, 1/2] mtd: m25p80: Let m25p80_read() fallback to spi transfer
Date: Mon, 23 Jan 2017 18:41:03 -0500	[thread overview]
Message-ID: <CAC=U0a1ESxC__PBOjW5L6AE3W5ebs8tMf1T1P1cuDzgFzWdxbA@mail.gmail.com> (raw)
In-Reply-To: <06d8264e-5ddb-aa76-a83e-4c2c3af42f08@denx.de>

"ret can never be > 0 , it is only 0 or negative "

I can fix this.

>>> This looks really fragile and special-casing EINVAL here doesn't scale.
>>> But still, if your controller driver is buggy, fix the driver, do not
>>> pollute core code with workarounds. If you do support this sort of
>>> accelerated read and it fails, it means something is seriously wrong.
>>> If you need to invoke regular SPI reads to complete under some obscure
>>> circumstances, do it from the driver, not here.
>>
>> I guess the other half of m25p80_read can be factored out and used as
>> fallback from either m25p80_read or the controller driver.
>
> I think I see what you mean, but care to show an RFC patch ?
>
> --

Its not the controller driver, but he hardware limitation with older
controller version. I have tried to see how I can do this better,
however when spi_flash_read() is called  cannot handle it within my
driver without returning from the function. I went over this with Mark
previously and this current solution seemed reasonable. Any other
solution outside of the generic driver would replicate a lot of code
unnecessarily.

> Best regards,
> Marek Vasut


Thanks
Kamal

  reply	other threads:[~2017-01-23 23:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20 21:50 [PATCH, 1/2] mtd: m25p80: Let m25p80_read() fallback to spi transfer Kamal Dasu
2017-01-20 21:50 ` [PATCH, 2/2] spi: bcm-qspi: Fix return code from bcm_qspi_flash_read() Kamal Dasu
2017-01-20 22:40   ` Marek Vasut
2017-01-20 22:38 ` [PATCH, 1/2] mtd: m25p80: Let m25p80_read() fallback to spi transfer Marek Vasut
2017-01-20 23:53   ` Michal Suchanek
2017-01-21  0:15     ` Marek Vasut
2017-01-23 23:41       ` Kamal Dasu [this message]
2017-01-25  2:08         ` Marek Vasut
2017-01-25  6:29           ` Michal Suchanek
2017-01-25 10:20             ` Marek Vasut
2017-01-25 11:10             ` Cyrille Pitchen
2017-01-25 16:28           ` Kamal Dasu
2017-01-25 16:39             ` Marek Vasut
2017-01-25 17:10               ` Kamal Dasu
2017-01-25 20:17                 ` Marek Vasut
2017-01-29 11:16             ` R, Vignesh
2017-01-30 17:11               ` Kamal Dasu

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='CAC=U0a1ESxC__PBOjW5L6AE3W5ebs8tMf1T1P1cuDzgFzWdxbA@mail.gmail.com' \
    --to=kdasu.kdev@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=broonie@kernel.org \
    --cc=cyrille.pitchen@atmel.com \
    --cc=f.fainelli@gmail.com \
    --cc=hramrach@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marex@denx.de \
    /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.