diff mbox

[v9,07/16] mmc: sdhci-msm: Add get_min_clock() and get_max_clock() callback

Message ID 1479710246-26676-8-git-send-email-riteshh@codeaurora.org (mailing list archive)
State New, archived
Headers show

Commit Message

Ritesh Harjani Nov. 21, 2016, 6:37 a.m. UTC
This add get_min_clock() and get_max_clock() callback
for sdhci-msm. sdhci-msm min/max clocks may be different
hence implement these callbacks.

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/host/sdhci-msm.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Andy Gross April 26, 2017, 9:44 p.m. UTC | #1
On Mon, Nov 21, 2016 at 12:07:17PM +0530, Ritesh Harjani wrote:
> This add get_min_clock() and get_max_clock() callback
> for sdhci-msm. sdhci-msm min/max clocks may be different
> hence implement these callbacks.
> 
> Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
> Acked-by: Adrian Hunter <adrian.hunter@intel.com>

This patch needs to be picked up for stable as 4.9 is currently broken w.r.t.
MMC on Qualcomm platforms.

Fixes: d84be51d1c1d ("mmc: sdhci-msm: Enable few quirks")

Regards,

Andy Gross
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Georgi Djakov April 27, 2017, 7:58 a.m. UTC | #2
On 04/27/2017 12:44 AM, Andy Gross wrote:
> On Mon, Nov 21, 2016 at 12:07:17PM +0530, Ritesh Harjani wrote:
>> This add get_min_clock() and get_max_clock() callback
>> for sdhci-msm. sdhci-msm min/max clocks may be different
>> hence implement these callbacks.
>>
>> Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
>> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
>> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> 
> This patch needs to be picked up for stable as 4.9 is currently broken w.r.t.
> MMC on Qualcomm platforms.
> 
> Fixes: d84be51d1c1d ("mmc: sdhci-msm: Enable few quirks")

Agree! Applying this patch (80031bdeb764) in stable fixes the
broken mmc. Otherwise the following error is seen since v4.9.22:

mmc0: Hardware doesn't specify base clock frequency.

Thanks,
Georgi
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson April 27, 2017, 9:03 a.m. UTC | #3
+Greg
-trimmed cc

On 26 April 2017 at 23:44, Andy Gross <andy.gross@linaro.org> wrote:
> On Mon, Nov 21, 2016 at 12:07:17PM +0530, Ritesh Harjani wrote:
>> This add get_min_clock() and get_max_clock() callback
>> for sdhci-msm. sdhci-msm min/max clocks may be different
>> hence implement these callbacks.
>>
>> Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
>> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
>> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
>
> This patch needs to be picked up for stable as 4.9 is currently broken w.r.t.
> MMC on Qualcomm platforms.
>
> Fixes: d84be51d1c1d ("mmc: sdhci-msm: Enable few quirks")
>
> Regards,
>
> Andy Gross

I did a quick investigation around this.

So for some reason Greg decided to pick up the original commit,
a0e3142869d2 ("mmc: sdhci-msm: Enable few quirks"), for 4.9 stable
[1], even if that patch wasn't sent or tagged for stable.
It was a mistake, as simple as that - and I should also have spotted
it when Greg posted his stable-review series, sorry.

For clarification, the original commit a0e3142869d2 ("mmc: sdhci-msm:
Enable few quirks"), is present in 4.10 together with $subject patch.
So the regression is present only in 4.9 stable.

Greg, can you pick up @subject patch for stable according to Andy's
suggestion or you want some of us to re-post it to stable?

Kind regards
Uffe

[1]
https://www.spinics.net/lists/stable/msg167259.html
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg Kroah-Hartman April 27, 2017, 9:52 a.m. UTC | #4
On Thu, Apr 27, 2017 at 11:03:08AM +0200, Ulf Hansson wrote:
> +Greg
> -trimmed cc
> 
> On 26 April 2017 at 23:44, Andy Gross <andy.gross@linaro.org> wrote:
> > On Mon, Nov 21, 2016 at 12:07:17PM +0530, Ritesh Harjani wrote:
> >> This add get_min_clock() and get_max_clock() callback
> >> for sdhci-msm. sdhci-msm min/max clocks may be different
> >> hence implement these callbacks.
> >>
> >> Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
> >> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
> >> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> >
> > This patch needs to be picked up for stable as 4.9 is currently broken w.r.t.
> > MMC on Qualcomm platforms.
> >
> > Fixes: d84be51d1c1d ("mmc: sdhci-msm: Enable few quirks")
> >
> > Regards,
> >
> > Andy Gross
> 
> I did a quick investigation around this.
> 
> So for some reason Greg decided to pick up the original commit,
> a0e3142869d2 ("mmc: sdhci-msm: Enable few quirks"), for 4.9 stable
> [1], even if that patch wasn't sent or tagged for stable.
> It was a mistake, as simple as that - and I should also have spotted
> it when Greg posted his stable-review series, sorry.
> 
> For clarification, the original commit a0e3142869d2 ("mmc: sdhci-msm:
> Enable few quirks"), is present in 4.10 together with $subject patch.
> So the regression is present only in 4.9 stable.
> 
> Greg, can you pick up @subject patch for stable according to Andy's
> suggestion or you want some of us to re-post it to stable?

Sorry about this.  What git commit should I take for this from Linus's
tree for the 4.9-stable tree?  Or if there isn't one, I'll be glad to
just revert this.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Georgi Djakov April 27, 2017, 10:29 a.m. UTC | #5
On 04/27/2017 12:52 PM, Greg Kroah-Hartman wrote:
> On Thu, Apr 27, 2017 at 11:03:08AM +0200, Ulf Hansson wrote:
>> +Greg
>> -trimmed cc
>>
>> On 26 April 2017 at 23:44, Andy Gross <andy.gross@linaro.org> wrote:
>>> On Mon, Nov 21, 2016 at 12:07:17PM +0530, Ritesh Harjani wrote:
>>>> This add get_min_clock() and get_max_clock() callback
>>>> for sdhci-msm. sdhci-msm min/max clocks may be different
>>>> hence implement these callbacks.
>>>>
>>>> Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
>>>> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
>>>> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
>>>
>>> This patch needs to be picked up for stable as 4.9 is currently broken w.r.t.
>>> MMC on Qualcomm platforms.
>>>
>>> Fixes: d84be51d1c1d ("mmc: sdhci-msm: Enable few quirks")
>>>
>>> Regards,
>>>
>>> Andy Gross
>>
>> I did a quick investigation around this.
>>
>> So for some reason Greg decided to pick up the original commit,
>> a0e3142869d2 ("mmc: sdhci-msm: Enable few quirks"), for 4.9 stable
>> [1], even if that patch wasn't sent or tagged for stable.
>> It was a mistake, as simple as that - and I should also have spotted
>> it when Greg posted his stable-review series, sorry.
>>
>> For clarification, the original commit a0e3142869d2 ("mmc: sdhci-msm:
>> Enable few quirks"), is present in 4.10 together with $subject patch.
>> So the regression is present only in 4.9 stable.
>>
>> Greg, can you pick up @subject patch for stable according to Andy's
>> suggestion or you want some of us to re-post it to stable?
> 
> Sorry about this.  What git commit should I take for this from Linus's
> tree for the 4.9-stable tree?  Or if there isn't one, I'll be glad to
> just revert this.
> 

Thanks Greg and Ulf,

A revert of d84be51d1c1d ("mmc: sdhci-msm: Enable few quirks") would be
the best solution.

The other option is to pick 80031bdeb764 ("mmc: sdhci-msm: Add
get_min_clock() and get_max_clock() callback").

BR,
Georgi
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg Kroah-Hartman April 27, 2017, 11:44 a.m. UTC | #6
On Thu, Apr 27, 2017 at 01:29:22PM +0300, Georgi Djakov wrote:
> On 04/27/2017 12:52 PM, Greg Kroah-Hartman wrote:
> > On Thu, Apr 27, 2017 at 11:03:08AM +0200, Ulf Hansson wrote:
> >> +Greg
> >> -trimmed cc
> >>
> >> On 26 April 2017 at 23:44, Andy Gross <andy.gross@linaro.org> wrote:
> >>> On Mon, Nov 21, 2016 at 12:07:17PM +0530, Ritesh Harjani wrote:
> >>>> This add get_min_clock() and get_max_clock() callback
> >>>> for sdhci-msm. sdhci-msm min/max clocks may be different
> >>>> hence implement these callbacks.
> >>>>
> >>>> Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
> >>>> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
> >>>> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> >>>
> >>> This patch needs to be picked up for stable as 4.9 is currently broken w.r.t.
> >>> MMC on Qualcomm platforms.
> >>>
> >>> Fixes: d84be51d1c1d ("mmc: sdhci-msm: Enable few quirks")
> >>>
> >>> Regards,
> >>>
> >>> Andy Gross
> >>
> >> I did a quick investigation around this.
> >>
> >> So for some reason Greg decided to pick up the original commit,
> >> a0e3142869d2 ("mmc: sdhci-msm: Enable few quirks"), for 4.9 stable
> >> [1], even if that patch wasn't sent or tagged for stable.
> >> It was a mistake, as simple as that - and I should also have spotted
> >> it when Greg posted his stable-review series, sorry.
> >>
> >> For clarification, the original commit a0e3142869d2 ("mmc: sdhci-msm:
> >> Enable few quirks"), is present in 4.10 together with $subject patch.
> >> So the regression is present only in 4.9 stable.
> >>
> >> Greg, can you pick up @subject patch for stable according to Andy's
> >> suggestion or you want some of us to re-post it to stable?
> > 
> > Sorry about this.  What git commit should I take for this from Linus's
> > tree for the 4.9-stable tree?  Or if there isn't one, I'll be glad to
> > just revert this.
> > 
> 
> Thanks Greg and Ulf,
> 
> A revert of d84be51d1c1d ("mmc: sdhci-msm: Enable few quirks") would be
> the best solution.
> 
> The other option is to pick 80031bdeb764 ("mmc: sdhci-msm: Add
> get_min_clock() and get_max_clock() callback").

I've reverted it now, thanks.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ritesh Harjani April 27, 2017, 3:34 p.m. UTC | #7
On 4/27/2017 5:14 PM, Greg Kroah-Hartman wrote:
> On Thu, Apr 27, 2017 at 01:29:22PM +0300, Georgi Djakov wrote:
>> On 04/27/2017 12:52 PM, Greg Kroah-Hartman wrote:
>>> On Thu, Apr 27, 2017 at 11:03:08AM +0200, Ulf Hansson wrote:
>>>> +Greg
>>>> -trimmed cc
>>>>
>>>> On 26 April 2017 at 23:44, Andy Gross <andy.gross@linaro.org> wrote:
>>>>> On Mon, Nov 21, 2016 at 12:07:17PM +0530, Ritesh Harjani wrote:
>>>>>> This add get_min_clock() and get_max_clock() callback
>>>>>> for sdhci-msm. sdhci-msm min/max clocks may be different
>>>>>> hence implement these callbacks.
>>>>>>
>>>>>> Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
>>>>>> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
>>>>>> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
>>>>>
>>>>> This patch needs to be picked up for stable as 4.9 is currently broken w.r.t.
>>>>> MMC on Qualcomm platforms.
>>>>>
>>>>> Fixes: d84be51d1c1d ("mmc: sdhci-msm: Enable few quirks")
>>>>>
>>>>> Regards,
>>>>>
>>>>> Andy Gross
>>>>
>>>> I did a quick investigation around this.
>>>>
>>>> So for some reason Greg decided to pick up the original commit,
>>>> a0e3142869d2 ("mmc: sdhci-msm: Enable few quirks"), for 4.9 stable
>>>> [1], even if that patch wasn't sent or tagged for stable.
>>>> It was a mistake, as simple as that - and I should also have spotted
>>>> it when Greg posted his stable-review series, sorry.
>>>>
>>>> For clarification, the original commit a0e3142869d2 ("mmc: sdhci-msm:
>>>> Enable few quirks"), is present in 4.10 together with $subject patch.
>>>> So the regression is present only in 4.9 stable.
>>>>
>>>> Greg, can you pick up @subject patch for stable according to Andy's
>>>> suggestion or you want some of us to re-post it to stable?
>>>
>>> Sorry about this.  What git commit should I take for this from Linus's
>>> tree for the 4.9-stable tree?  Or if there isn't one, I'll be glad to
>>> just revert this.
>>>
>>
>> Thanks Greg and Ulf,
>>
>> A revert of d84be51d1c1d ("mmc: sdhci-msm: Enable few quirks") would be
>> the best solution.
>>
>> The other option is to pick 80031bdeb764 ("mmc: sdhci-msm: Add
>> get_min_clock() and get_max_clock() callback").
> 
> I've reverted it now, thanks.
Thanks Ulf, Greg and all.

Regards
Ritesh


> 
> greg k-h
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andy Gross April 27, 2017, 8:11 p.m. UTC | #8
On Thu, Apr 27, 2017 at 01:44:41PM +0200, Greg Kroah-Hartman wrote:
> I've reverted it now, thanks.

Thanks Greg!

Regards,

Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index fc093b8..aaeaf47 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -68,6 +68,8 @@ 
 
 #define CORE_VENDOR_SPEC_CAPABILITIES0	0x11c
 
+#define SDHCI_MSM_MIN_CLOCK	400000
+
 #define CDR_SELEXT_SHIFT	20
 #define CDR_SELEXT_MASK		(0xf << CDR_SELEXT_SHIFT)
 #define CMUX_SHIFT_PHASE_SHIFT	24
@@ -556,6 +558,19 @@  static irqreturn_t sdhci_msm_pwr_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
+static unsigned int sdhci_msm_get_max_clock(struct sdhci_host *host)
+{
+	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+	struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host);
+
+	return clk_round_rate(msm_host->clk, ULONG_MAX);
+}
+
+static unsigned int sdhci_msm_get_min_clock(struct sdhci_host *host)
+{
+	return SDHCI_MSM_MIN_CLOCK;
+}
+
 static const struct of_device_id sdhci_msm_dt_match[] = {
 	{ .compatible = "qcom,sdhci-msm-v4" },
 	{},
@@ -567,6 +582,8 @@  static irqreturn_t sdhci_msm_pwr_irq(int irq, void *data)
 	.platform_execute_tuning = sdhci_msm_execute_tuning,
 	.reset = sdhci_reset,
 	.set_clock = sdhci_set_clock,
+	.get_min_clock = sdhci_msm_get_min_clock,
+	.get_max_clock = sdhci_msm_get_max_clock,
 	.set_bus_width = sdhci_set_bus_width,
 	.set_uhs_signaling = sdhci_msm_set_uhs_signaling,
 	.voltage_switch = sdhci_msm_voltage_switch,