linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: vaibhav.hiremath@linaro.org (Vaibhav Hiremath)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH-v2 4/7] mmc: sdhci-pxav3: Add pinctl setting according to bus clock
Date: Tue, 8 Sep 2015 17:47:40 +0530	[thread overview]
Message-ID: <55EED1E4.9030904@linaro.org> (raw)
In-Reply-To: <20150908180451.4c8bd26c@xhacker>



On Tuesday 08 September 2015 03:34 PM, Jisheng Zhang wrote:
> On Tue, 8 Sep 2015 15:32:34 +0530
> Vaibhav Hiremath <vaibhav.hiremath@linaro.org> wrote:
>
>>
>>
>> On Tuesday 08 September 2015 03:22 PM, Jisheng Zhang wrote:
>>> On Tue, 8 Sep 2015 15:04:41 +0530
>>> Vaibhav Hiremath <vaibhav.hiremath@linaro.org> wrote:
>>>

<snip>

>>>>>>     static const struct sdhci_ops pxav3_sdhci_ops = {
>>>>>> @@ -586,6 +619,16 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
>>>>>>     		}
>>>>>>     	}
>>>>>>
>>>>>> +	pxa->pinctrl = devm_pinctrl_get(dev);
>>>>>
>>>>> could we ignore this for those SDHCI hosts that don't need it?
>>>>>
>>>>
>>>> Again, no need to introduce flags here. This is standard call and
>>>> handled properly. So for the platforms not using this, it really should
>>>> not matter.
>>>> Also, lookup is getting executed only when pinctrl is populated.
>>>>
>>>> So I do not see any need here.
>>>>
>>>>>> +	if (!IS_ERR(pxa->pinctrl)) {
>>>>>> +		pxa->pins_default = pinctrl_lookup_state(pxa->pinctrl, "default");
>>>>>> +		if (IS_ERR(pxa->pins_default))
>>>>>> +			dev_err(dev, "could not get default pinstate\n");
>>>>>
>>>>> Why those SDHCI hosts that don't need pinctl setting should got this error?
>>>>>
>>>>
>>>> It won't.
>>>
>>> It does. On Marvell Berlin SoCs, I got
>>>
>>> [    1.070000] sdhci-pxav3 f7ab0800.sdhci: could not get default pinstate
>>> [    1.080000] sdhci-pxav3 f7ab0800.sdhci: could not get fast pinstate
>>>
>>>
>>>
>>>>
>>>> If Host does not need pinctrl, the execution would never reach this
>>>> point.
>>>> The if condition check would handle it, isn't it?
>>>>
>>>> 	pxa->pinctrl = devm_pinctrl_get(dev);
>>>
>>> It seems this function always succeed...
>>>
>>
>> Not always.
>> I would succeed only if you have pinctrl defined in DT for this device.
>
> Yes, that's what I thought, but I got
>
> [    1.070000] sdhci-pxav3 f7ab0800.sdhci: could not get default pinstate
> [    1.080000] sdhci-pxav3 f7ab0800.sdhci: could not get fast pinstate
>
> there's no pinctrl for f7ab0800.sdhci. Am I missing somthing?
>
> Thanks,
> Jisheng
>
>>
>> And if you have pinctrl defined, isn't it is expected to have "default"
>> pin state to be always present?
>> And if answer is yes here, then it is fair to be prompting error for it.
>>
>>>   From another side, we may have default pin in dts, for example: pin muxed between
>>> emmc and nandflash. But we don't have fast pinstate, so we at least need the
>>> flag to fast pinstate. Otherwise, in such platforms, we could get something like
>>>
>>
>> That is exactly the reason behind keeping it as dev_info.
>>
>>> [    1.000000] sdhci-pxav3 f7ab0000.sdhci: get default pinstate
>>> [    1.000000] sdhci-pxav3 f7ab0000.sdhci: could not get fast pinstate
>>>
>>>

I did some invastigation here on the execution flow,
and you know what, you are right here.

It seems, devm_pinctrl_get() always returns valid pinctrl pointer, even
though the DT property is not populated.

The return value from I did some invastigation () should have been 
treated differently, but it is not. Instead it creates the
"struct pinctrl" and return back to the driver.

I am looping Linus Walleji here, probably he can comment/confirm on
this.


Thanks,
Vaibhav


>> Thanks,
>> Vaibhav
>

  reply	other threads:[~2015-09-08 12:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-07 11:18 [PATCH-v2 0/7] mmc: sdhci-pxav3: Enable support for PXA1928 SDCHI controller Vaibhav Hiremath
2015-09-07 11:18 ` [PATCH-v2 1/7] mmc: sdhci-pxav3: Enable pxa1928 device support Vaibhav Hiremath
2015-09-07 11:18 ` [PATCH-v2 2/7] mmc: sdhci-pxav3: binding: Add pxa1928 compatible support Vaibhav Hiremath
2015-09-08 23:49   ` Rob Herring
2015-09-09 11:04     ` Vaibhav Hiremath
2015-09-07 11:18 ` [PATCH-v2 3/7] mmc: sdhci-pxav3: Add platform specific set_clock ops Vaibhav Hiremath
2015-09-07 11:18 ` [PATCH-v2 4/7] mmc: sdhci-pxav3: Add pinctl setting according to bus clock Vaibhav Hiremath
2015-09-08  6:52   ` Jisheng Zhang
2015-09-08  9:34     ` Vaibhav Hiremath
2015-09-08  9:52       ` Jisheng Zhang
2015-09-08 10:02         ` Vaibhav Hiremath
2015-09-08 10:04           ` Jisheng Zhang
2015-09-08 12:17             ` Vaibhav Hiremath [this message]
2015-09-08  6:54   ` Jisheng Zhang
2015-09-08  9:54     ` Vaibhav Hiremath
2015-09-08 14:42   ` Linus Walleij
2015-09-08 15:07     ` Vaibhav Hiremath
2015-09-09  8:39       ` Linus Walleij
2015-09-07 11:18 ` [PATCH-v2 5/7] mmc: sdhci-pxav3: Fix HS200 mode support Vaibhav Hiremath
2015-09-08  6:53   ` Jisheng Zhang
2015-09-08  9:35     ` Vaibhav Hiremath
2015-09-07 11:18 ` [PATCH-v2 6/7] mmc: sdhci: add new quirk for setting BUS_POWER & BUS_VLT fields Vaibhav Hiremath
2015-09-07 11:18 ` [PATCH-v2 7/7] mmc: sdhci: enable SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON for pxa1928 Vaibhav Hiremath

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=55EED1E4.9030904@linaro.org \
    --to=vaibhav.hiremath@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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).