The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Artem Shimko <a.shimko.dev@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: <Jisheng.Zhang@synaptics.com>, <hehuan1@eswincomputing.com>,
	<yifeng.zhao@rock-chips.com>, Ulf Hansson <ulfh@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	<linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mmc: sdhci-of-dwcmshc: add reset control support in suspend/resume
Date: Tue, 5 May 2026 14:27:55 +0300	[thread overview]
Message-ID: <53c62677-2185-4cac-aba8-09363d0ce9c8@intel.com> (raw)
In-Reply-To: <CAOPX747KM+Ct8Edj__ng4GMeLvjnyaBG1T2h54LSr=SFgQcuqQ@mail.gmail.com>

On 17/04/2026 13:45, Artem Shimko wrote:
> Hi Andy,
> 
> Thank you for your review!
> 
> On Wed, Apr 15, 2026 at 5:52 PM Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
>> No need to repeat the commit message in the comments. It does not add any value.
> 
> Got it =)
> 
>> This is serious behaviour change (might not be, one needs to understand what it
>> does in comparison to no reset (and in accordance with datasheet).
>>
>> Do you have any HW to test?
> 
> I made these changes so that our MMC controller (dwc) can handle the
> reset signal not only during the initialization function, but also
> during suspend and resume.
> Since the reset control was previously stored in vendor-specific
> private structures (rk35xx_priv and eic7700_priv), it was inaccessible
> from the common PM code.
> To make suspend/resume work for our platform, I had to move the reset
> pointer to the generic dwcmshc_priv structure, which required updating
> the Rockchip and EIC7700 variants accordingly.
> 
> 
> 
>> The driver seems can be refactored a lot (with no functional changes) by:
>> - replacing *sleep() with fsleep() API
>> - dropping unneeded checks like above, clk_disable_unprepare() is error
>> pointer-aware IIRC (or it can be made so it is either NULL or valid one)
>> - using 'return dev_err_probe()'
>>
>> This is just a side note in case you are interested.
> 
> Yes, sure, thank you!
> 
>> No need to add an extra blank line.
> okay =)
> 
> 
> Instead of moving the reset control directly into the common path,
> perhaps a cleaner solution would be to introduce a set of platform PM
> ops (e.g., suspend/resume callbacks in the variant data).
> These ops could be checked for NULL in the common
> dwcmshc_suspend/resume functions. For platforms that don't implement
> them, the behavior remains exactly as it was before (no reset
> assertion),
> ensuring zero risk of regression for Rockchip and EIC7700. Our
> platform would then simply implement these ops to handle the custom
> reset sequence.
> 
> What do you think about it?

Only dwcmshc_rk35xx_init() and sdhci_eic7700_reset_init() assign
dwc_priv->reset, so I am confused about what devices you intend
this patch for.

You definitely need to limit the change to devices that you know
for certain it will work.

> --
> Regards,
> Artem


       reply	other threads:[~2026-05-05 11:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260415123411.437450-1-a.shimko.dev@gmail.com>
     [not found] ` <ad-mCsvOWWgqt-rc@ashevche-desk.local>
     [not found]   ` <CAOPX747KM+Ct8Edj__ng4GMeLvjnyaBG1T2h54LSr=SFgQcuqQ@mail.gmail.com>
2026-05-05 11:27     ` Adrian Hunter [this message]
2026-05-05 12:12       ` [PATCH] mmc: sdhci-of-dwcmshc: add reset control support in suspend/resume Artem Shimko
2026-05-05 12:36         ` Adrian Hunter
2026-05-05 12:49           ` Artem Shimko

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=53c62677-2185-4cac-aba8-09363d0ce9c8@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=Jisheng.Zhang@synaptics.com \
    --cc=a.shimko.dev@gmail.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=hehuan1@eswincomputing.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=ulfh@kernel.org \
    --cc=yifeng.zhao@rock-chips.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