From: Kamal Dasu <kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Cyrille Pitchen
<cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
Cc: linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
MTD Maling List
<linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
Florian Fainelli
<f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Jayachandran C
<jchandra-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
bcm-kernel-feedback-list"
<bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH v1 4/5] mtd: m25p80: Check if the spi flash device has pm support
Date: Mon, 6 Feb 2017 14:35:46 -0500 [thread overview]
Message-ID: <CAC=U0a3V9fPnee6yYPw6CarFiKnwFw1aA-tm=+K4RQSm_bgVSg@mail.gmail.com> (raw)
In-Reply-To: <9108d13d-0f06-172f-5e8d-91ff80fdd510-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
On Mon, Feb 6, 2017 at 6:01 AM, Cyrille Pitchen
<cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org> wrote:
> Hi Kamal,
>
> Le 04/02/2017 à 00:31, Kamal Dasu a écrit :
>> Call the spi_nor_rescan() only if the controller driver needs this
>> support. This way SoCs that need this feature can use it.
>>
>> Signed-off-by: Kamal Dasu <kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>> drivers/mtd/devices/m25p80.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
>> index 4528e33..ffdec60 100644
>> --- a/drivers/mtd/devices/m25p80.c
>> +++ b/drivers/mtd/devices/m25p80.c
>> @@ -328,8 +328,13 @@ static int m25p_suspend(struct device *dev)
>> static int m25p_resume(struct device *dev)
>> {
>> struct m25p *flash = dev_get_drvdata(dev);
>> + struct spi_device *spi = flash->spi;
>> + int ret = 0;
>> +
>> + if (spi_flash_pm_supported(spi))
>> + ret = spi_nor_pm_rescan(&flash->spi_nor, NULL);
>>
>
> Why don't you squash patch 2 into this one? Patch 2 suggests that
> spi_nor_pm_rescan() could safely be called in any case but now this patch
> suggests that calling that function is not so safe.
>
> I see two cases:
>
> 1/ either calling spi_nor_pm_rescan() is safe in any case, then patches 3,
> 4 and 5 are needless.
>
I agree it should be safe to call resume after implementing your
suggestions for patch 1 itself.
> 2/ or calling spi_nor_pm_rescan() has unwanted side effects in some cases,
> then patch 2 should be squashed into this patch: patch 2 will never be
> taken alone in the spi-nor tree if it may introduce bugs or regressions.
>
> If something has to be done in the SPI sub-system, I guess it should be
> done first: for sure applying patches 3 and 5 would not create any issue.
> Then patches 2 and 4 squashed into a single patch may be safely applied after.
>
> However, patches 3 and 5 still need to be discussed first.
>
I agree that these are not needed.
> Best regards,
>
> Cyrille
>
>> - return spi_nor_pm_rescan(&flash->spi-nor, NULL);
>> + return ret;
>> }
>> #endif
>> static SIMPLE_DEV_PM_OPS(m25p_pm_ops, m25p_suspend, m25p_resume);
>>
>
Thanks
Kamal
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-02-06 19:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-03 23:31 [PATCH v1 0/5] Added support for spi-nor device pm in m25p80 Kamal Dasu
[not found] ` <1486164676-12912-1-git-send-email-kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-03 23:31 ` [PATCH v1 1/5] mtd: spi-nor: Added way to rescan spi-nor device Kamal Dasu
[not found] ` <1486164676-12912-2-git-send-email-kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-06 11:46 ` Cyrille Pitchen
[not found] ` <05a60f60-f404-7761-4079-c6e7d1d08aed-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2017-02-06 20:32 ` Kamal Dasu
2017-02-03 23:31 ` [PATCH v1 2/5] mtd: m25p80: Added pm ops support Kamal Dasu
2017-02-03 23:31 ` [PATCH v1 3/5] spi: Added way to check for pm support for flash devices Kamal Dasu
[not found] ` <1486164676-12912-4-git-send-email-kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-04 11:25 ` Mark Brown
[not found] ` <20170204112555.p77votp5m7klygbe-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-02-04 20:47 ` Kamal Dasu
[not found] ` <CAC=U0a0o21taio6jYzTCx1ix85aFNtikXHs=O99OW1pChbG4TA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-06 10:44 ` Cyrille Pitchen
[not found] ` <11cfd6da-c537-eca9-5c50-7789d5b672dd-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2017-02-06 16:46 ` Mark Brown
[not found] ` <20170206164634.awi4oe5e4o4w2kmj-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-02-06 19:32 ` Kamal Dasu
2017-02-03 23:31 ` [PATCH v1 4/5] mtd: m25p80: Check if the spi flash device has pm support Kamal Dasu
[not found] ` <1486164676-12912-5-git-send-email-kdasu.kdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-06 11:01 ` Cyrille Pitchen
[not found] ` <9108d13d-0f06-172f-5e8d-91ff80fdd510-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2017-02-06 19:35 ` Kamal Dasu [this message]
2017-02-03 23:31 ` [PATCH v1 5/5] spi: bcm-qspi: Implement the master flash_pm_supported() call 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=U0a3V9fPnee6yYPw6CarFiKnwFw1aA-tm=+K4RQSm_bgVSg@mail.gmail.com' \
--to=kdasu.kdev-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
--cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marex-ynQEQJNshbs@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).