public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Cc: dlemoal@kernel.org, richardcochran@gmail.com,
	piyush.mehta@xilinx.com, axboe@kernel.dk, michal.simek@amd.com,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
	git@amd.com, Piyush Mehta <piyush.mehta@amd.com>
Subject: Re: [PATCH 2/2] ata: ahci_ceva: add missing enable regulator API for Xilinx GT PHY support
Date: Mon, 22 Jan 2024 14:28:32 +0100	[thread overview]
Message-ID: <Za5tgFKxylHR91KF@x1-carbon> (raw)
In-Reply-To: <1705604904-471889-3-git-send-email-radhey.shyam.pandey@amd.com>

Hello Radhey,

On Fri, Jan 19, 2024 at 12:38:24AM +0530, Radhey Shyam Pandey wrote:
> From: Piyush Mehta <piyush.mehta@amd.com>
> 
> The regulators API are disabled and enabled, during suspend and resume,
> respectively. The following warning notice shows up on the initial suspend
> because the enable regulators API is unaddressed in the probe:

Please be a bit more specific in your commit message.

e.g. during system suspend, ahci_platform_suspend() calls
ahci_platform_disable_resources() which calls
ahci_platform_disable_regulators() which calls
regulator_disable() for all regulators found in the controller.


> 
> regulator-dummy: Underflow of regulator enable count
> 
> Added the ahci_platform_enable_regulators API in probe to maintain the
> regulator enabled and disabled ref count.

s/Added/Add/

"Describe your changes in imperative mood, e.g. "make xyzzy do frotz" instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy to do frotz", as if you are giving orders to the codebase to change its behaviour."

see:
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes


> 
> Fixes: 9a9d3abe24bb ("ata: ahci: ceva: Update the driver to support xilinx GT phy")
> Signed-off-by: Piyush Mehta <piyush.mehta@amd.com>
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
> ---
>  drivers/ata/ahci_ceva.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
> index bfc513f1d0b3..1c56f0cabb11 100644
> --- a/drivers/ata/ahci_ceva.c
> +++ b/drivers/ata/ahci_ceva.c
> @@ -219,9 +219,14 @@ static int ceva_ahci_probe(struct platform_device *pdev)
>  		if (rc)
>  			return rc;
>  	} else {
> -		rc = ahci_platform_enable_clks(hpriv);
> +		rc = ahci_platform_enable_regulators(hpriv);
>  		if (rc)
>  			return rc;
> +
> +		rc = ahci_platform_enable_clks(hpriv);
> +		if (rc)
> +			goto disable_regulator;
> +

Like I wrote in patch 1/2, I would prefer if you could somehow get
ahci_platform_enable_resources() to work for your platform, so that you
don't need to copy paste all of ahci_platform_enable_resources() to
your driver.

If it does not work to simply add a reset_control_assert() + usleep(),
considering that this function is essentially a copy paste of
ahci_platform_enable_resources(), I would still prefer the addition of
a new flag, and keep the extra logic needed in libahci_platform.c, so that
the code is kept in the same place, rather than to copy paste the whole
function to your driver.


Kind regards,
Niklas

>  		/* Assert the controller reset */
>  		reset_control_assert(cevapriv->rst);
>  
> @@ -340,6 +345,9 @@ static int ceva_ahci_probe(struct platform_device *pdev)
>  disable_clks:
>  	ahci_platform_disable_clks(hpriv);
>  
> +disable_regulator:
> +	ahci_platform_disable_regulators(hpriv);
> +
>  	return rc;
>  }
>  
> -- 
> 2.34.1
> 

      parent reply	other threads:[~2024-01-22 13:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 19:08 [PATCH 0/2] ata: ahci_ceva: fix xilinx GT PHY support Radhey Shyam Pandey
2024-01-18 19:08 ` [PATCH 1/2] ata: ahci_ceva: fix error handling for Xilinx " Radhey Shyam Pandey
2024-01-22  7:39   ` Dan Carpenter
2024-01-22 10:28   ` Damien Le Moal
2024-01-22 13:02   ` Niklas Cassel
2024-02-07 18:28     ` Pandey, Radhey Shyam
2024-02-07 20:42       ` Niklas Cassel
2024-01-18 19:08 ` [PATCH 2/2] ata: ahci_ceva: add missing enable regulator API " Radhey Shyam Pandey
2024-01-22 10:29   ` Damien Le Moal
2024-01-22 13:28   ` Niklas Cassel [this message]

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=Za5tgFKxylHR91KF@x1-carbon \
    --to=cassel@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=git@amd.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=piyush.mehta@amd.com \
    --cc=piyush.mehta@xilinx.com \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=richardcochran@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