All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
To: Peng Fan <peng.fan@nxp.com>, "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: "u-boot@lists.denx.de" <u-boot@lists.denx.de>,
	"jh80.chung@samsung.com" <jh80.chung@samsung.com>,
	"trini@konsulko.com" <trini@konsulko.com>,
	"marex@denx.de" <marex@denx.de>,
	"tien.fong.chee@altera.com" <tien.fong.chee@altera.com>,
	"balsundar.ponnusamy@altera.com" <balsundar.ponnusamy@altera.com>
Subject: Re: [PATCH 1/8] mmc: sdhci-cadence: Add reset control support
Date: Thu, 27 Nov 2025 15:22:36 +0530	[thread overview]
Message-ID: <bdbcf8b7-1a1d-43ae-848e-e4d009b1067b@altera.com> (raw)
In-Reply-To: <PAXPR04MB8459B3E517FE7375521DC49E88DFA@PAXPR04MB8459.eurprd04.prod.outlook.com>



On 11/27/2025 3:18 PM, Peng Fan wrote:
>> Subject: Re: [PATCH 1/8] mmc: sdhci-cadence: Add reset control
>> support
>>
>> Thanks for the suggestion, Peng.
>>
>> On 11/26/2025 7:47 AM, Peng Fan wrote:
>>> On Thu, Nov 20, 2025 at 08:29:11PM +0530, Tanmay Kathpalia
>> wrote:
>>>> Thanks for your comment, Peng.
>>>>
>>>> On 11/18/2025 10:39 AM, Peng Fan wrote:
>>>>> On Mon, Nov 10, 2025 at 09:37:30AM -0800, Tanmay Kathpalia
>> wrote:
>>>>>> Add reset control functionality to the SDHCI Cadence driver to
>>>>>> properly handle hardware reset sequences during probe. This
>> ensures
>>>>>> the controller is in a known state before initialization.
>>>>>>
>>>>>> Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
>>>>>> Reviewed-by: Balsundar Ponnusamy
>> <balsundar.ponnusamy@altera.com>
>>>>>> ---
>>>>>> drivers/mmc/sdhci-cadence.c | 8 ++++++++
>>>>>> 1 file changed, 8 insertions(+)
>>>>>>
>>>>> ....
>>>>>>
>>>>>> @@ -225,6 +227,12 @@ static int sdhci_cdns_probe(struct
>> udevice *dev)
>>>>>> 	if (!plat->hrs_addr)
>>>>>> 		return -ENOMEM;
>>>>>>
>>>>>> +	ret = reset_get_bulk(dev, &reset_bulk);
>>>>>
>>>>> Should this be optional? Some in tree platforms may not have the
>>>>> reset supported.
>>>>>
>>>>
>>>> Yes, you're right-some in-tree platforms may not have reset support.
>>>> In those cases, the code will print a warning message ("Can't get
>>>> reset") and continue the probe process.
>>>> If you prefer, I can remove the warning and let the function fail
>>>> silently instead, or is there any other way you would suggest to
>> make this optional?
>>>
>>> devm_reset_bulk_get_optional() may help.
>>>
>>> Regards
>>> Peng
>>>
>>
>> I looked into devm_reset_bulk_get_optional(), and I see that it
>> dynamically allocates the struct reset_ctl_bulk and adds it to the
>> device resources list if CONFIG_DEVRES is enabled. However, if
>> CONFIG_DEVRES is not enabled, we need to manually free the memory
>> using
>> reset_release_bulk() in the driver's remove function. This means we
>> would need to store a pointer to struct reset_ctl_bulk in the driver's
>> private data, which would require additional changes to the sdhci-
>> cadence driver (since it currently uses the generic struct sdhci_host
>> with .priv_auto = sizeof(struct sdhci_host)).
>>
>> Let me know if you’re okay with this approach, as it would require
>> other changes in the driver, or if you have any further
>> recommendations.
>> Alternatively, I can simplify the implementation as shown below:
>>
>> ret = reset_get_bulk(dev, &reset_bulk);
>> if (!ret)
>> 	reset_deassert_bulk(&reset_bulk);
> 
> For better, an optional API is preferred, since non-devres API
> is not there, I am fine with your above changes.
> 
> Regards
> Peng.
> 

I will make the changes and push the V2 series.

Regards,
Tanmay

>>
>> Please let me know your preference.
>>
>> Regards,
>> Tanmay
>>
>>>>
>>>>> Regards
>>>>> Peng
>>>>
>>>>
> 


  reply	other threads:[~2025-11-27  9:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10 17:37 [PATCH 0/8] mmc: sdhci-cadence: Improvements and fixes for Cadence SDHCI driver Tanmay Kathpalia
2025-11-10 17:37 ` [PATCH 1/8] mmc: sdhci-cadence: Add reset control support Tanmay Kathpalia
2025-11-18  5:09   ` Peng Fan
2025-11-20 14:59     ` Tanmay Kathpalia
2025-11-26  2:17       ` Peng Fan
2025-11-27  8:29         ` Tanmay Kathpalia
2025-11-27  9:48           ` Peng Fan
2025-11-27  9:52             ` Tanmay Kathpalia [this message]
2025-11-10 17:37 ` [PATCH 2/8] mmc: sdhci-cadence: Use max-frequency property from device tree Tanmay Kathpalia
2025-11-18  6:13   ` Peng Fan
2025-11-20 14:31     ` Tanmay Kathpalia
2025-11-10 17:37 ` [PATCH 3/8] mmc: sdhci-cadence: Set controller and PHY speed modes for SD and eMMC cards Tanmay Kathpalia
2025-11-10 17:37 ` [PATCH 4/8] mmc: sdhci: Add SDHCI_SPEC_400, _410, and _420 version defines Tanmay Kathpalia
2025-11-10 17:37 ` [PATCH 5/8] mmc: sdhci-cadence: Use hardware version field for Cadence SDHCI controller Tanmay Kathpalia
2025-11-10 17:37 ` [PATCH 6/8] mmc: sdhci-cadence: Enable software tuning for both SD and eMMC interfaces Tanmay Kathpalia
2025-11-10 17:37 ` [PATCH 7/8] mmc: sdhci-cadence6: socfpga: Fix DT property naming convention Tanmay Kathpalia
2025-11-18  6:22   ` Peng Fan
2025-11-20 14:42     ` Tanmay Kathpalia
2025-11-10 17:37 ` [PATCH 8/8] mmc: sdhci-cadence6: Add DLL master control and improve tuning reliability Tanmay Kathpalia
2025-11-18  6:24   ` Peng Fan
2025-11-20 14:50     ` Tanmay Kathpalia

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=bdbcf8b7-1a1d-43ae-848e-e4d009b1067b@altera.com \
    --to=tanmay.kathpalia@altera.com \
    --cc=balsundar.ponnusamy@altera.com \
    --cc=jh80.chung@samsung.com \
    --cc=marex@denx.de \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=tien.fong.chee@altera.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.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.