Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1490435 > unrolled thread
| Started by | Zach Brown <zach.brown@ni.com> |
|---|---|
| First post | 2016-09-23 22:30 +0200 |
| Last post | 2016-10-06 10:10 +0200 |
| Articles | 9 — 7 participants |
Back to article view | Back to linux.kernel
[RFC 0/2] Add device tree property and quirk for supporting sdhci Zach Brown <zach.brown@ni.com> - 2016-09-23 22:30 +0200
[RFC 1/2] sdhci: Add device tree property sd-broken-highspeed Zach Brown <zach.brown@ni.com> - 2016-09-23 22:30 +0200
Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed Rob Herring <robh@kernel.org> - 2016-10-03 19:40 +0200
Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed Ulf Hansson <ulf.hansson@linaro.org> - 2016-10-05 20:50 +0200
Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed Rob Herring <robh+dt@kernel.org> - 2016-10-05 22:10 +0200
Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed Julia Cartwright <julia@ni.com> - 2016-10-05 23:30 +0200
Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed Shawn Lin <shawn.lin@rock-chips.com> - 2016-10-06 03:40 +0200
Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed Adrian Hunter <adrian.hunter@intel.com> - 2016-10-06 08:20 +0200
Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed Ulf Hansson <ulf.hansson@linaro.org> - 2016-10-06 10:10 +0200
| From | Zach Brown <zach.brown@ni.com> |
|---|---|
| Date | 2016-09-23 22:30 +0200 |
| Subject | [RFC 0/2] Add device tree property and quirk for supporting sdhci |
| Message-ID | <skFgC-8uY-3@gated-at.bofh.it> |
Some board configurations can not support sd highspeed mode due to the distance
between the card slot and the controller. The card and controller report that
they are capable of highspeed however, so we need a mechanism for specifying
that the setup is incapable of supporting highspeed mode.
The first patch adds documentation about a new devicetree property
sd-broken-highspeed.
The second patch keeps the sd controller and card from going into highspeed
mode when the property is set.
Chen Yee Chew (1):
sdhci: Prevent SD from doing high-speed timing when
sd-broken-highspeed property is set
Zach Brown (1):
sdhci: Add device tree property sd-broken-highspeed
Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++
arch/arm/boot/dts/ni-77D5.dts | 1 -
drivers/mmc/host/sdhci-pltfm.c | 3 +++
drivers/mmc/host/sdhci.c | 3 ++-
drivers/mmc/host/sdhci.h | 2 ++
5 files changed, 9 insertions(+), 2 deletions(-)
--
2.7.4
[toc] | [next] | [standalone]
| From | Zach Brown <zach.brown@ni.com> |
|---|---|
| Date | 2016-09-23 22:30 +0200 |
| Subject | [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed |
| Message-ID | <skFgC-8uY-11@gated-at.bofh.it> |
| In reply to | #1490435 |
Certain board configurations can make highspeed malfunction due to timing issues. In these cases a way is needed to force the controller and card into standard speed even if they otherwise appear to be capable of highspeed. The sd-broken-highspeed property will let the sdhci driver know that highspeed will not work. Signed-off-by: Zach Brown <zach.brown@ni.com> --- Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt index 8a37782..59332ea 100644 --- a/Documentation/devicetree/bindings/mmc/mmc.txt +++ b/Documentation/devicetree/bindings/mmc/mmc.txt @@ -52,6 +52,8 @@ Optional properties: - no-sdio: controller is limited to send sdio cmd during initialization - no-sd: controller is limited to send sd cmd during initialization - no-mmc: controller is limited to send mmc cmd during initialization +- sd-broken-highspeed: Highspeed is broken, even if the controller and card + themselves claim they support highspeed. *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line polarity properties, we have to fix the meaning of the "normal" and "inverted" -- 2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2016-10-03 19:40 +0200 |
| Subject | Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed |
| Message-ID | <sofnA-7VQ-7@gated-at.bofh.it> |
| In reply to | #1490437 |
On Fri, Sep 23, 2016 at 03:01:08PM -0500, Zach Brown wrote: > Certain board configurations can make highspeed malfunction due to > timing issues. In these cases a way is needed to force the controller > and card into standard speed even if they otherwise appear to be capable > of highspeed. > > The sd-broken-highspeed property will let the sdhci driver know that > highspeed will not work. > > Signed-off-by: Zach Brown <zach.brown@ni.com> > --- > Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++ > 1 file changed, 2 insertions(+) Acked-by: Rob Herring <robh@kernel.org>
[toc] | [prev] | [next] | [standalone]
| From | Ulf Hansson <ulf.hansson@linaro.org> |
|---|---|
| Date | 2016-10-05 20:50 +0200 |
| Subject | Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed |
| Message-ID | <soZqp-5hM-7@gated-at.bofh.it> |
| In reply to | #1490437 |
On 23 September 2016 at 22:01, Zach Brown <zach.brown@ni.com> wrote: > Certain board configurations can make highspeed malfunction due to > timing issues. In these cases a way is needed to force the controller > and card into standard speed even if they otherwise appear to be capable > of highspeed. > > The sd-broken-highspeed property will let the sdhci driver know that > highspeed will not work. > > Signed-off-by: Zach Brown <zach.brown@ni.com> > --- > Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt > index 8a37782..59332ea 100644 > --- a/Documentation/devicetree/bindings/mmc/mmc.txt > +++ b/Documentation/devicetree/bindings/mmc/mmc.txt > @@ -52,6 +52,8 @@ Optional properties: > - no-sdio: controller is limited to send sdio cmd during initialization > - no-sd: controller is limited to send sd cmd during initialization > - no-mmc: controller is limited to send mmc cmd during initialization > +- sd-broken-highspeed: Highspeed is broken, even if the controller and card > + themselves claim they support highspeed. Regarding a broken card, that is managed via the card quirks and not in DT. If this is about a controller limitation, we already have the option to describe what it supports, so we don't need an option to tell what it *not* supports. For example "cap-sd-highspeed" tells whether the controller supports SD high-speed, please use that instead. > > *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line > polarity properties, we have to fix the meaning of the "normal" and "inverted" > -- > 2.7.4 > Kind regards Uffe
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh+dt@kernel.org> |
|---|---|
| Date | 2016-10-05 22:10 +0200 |
| Subject | Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed |
| Message-ID | <sp0FP-6Ex-21@gated-at.bofh.it> |
| In reply to | #1495995 |
On Wed, Oct 5, 2016 at 1:33 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote: > On 23 September 2016 at 22:01, Zach Brown <zach.brown@ni.com> wrote: >> Certain board configurations can make highspeed malfunction due to >> timing issues. In these cases a way is needed to force the controller >> and card into standard speed even if they otherwise appear to be capable >> of highspeed. >> >> The sd-broken-highspeed property will let the sdhci driver know that >> highspeed will not work. >> >> Signed-off-by: Zach Brown <zach.brown@ni.com> >> --- >> Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt >> index 8a37782..59332ea 100644 >> --- a/Documentation/devicetree/bindings/mmc/mmc.txt >> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt >> @@ -52,6 +52,8 @@ Optional properties: >> - no-sdio: controller is limited to send sdio cmd during initialization >> - no-sd: controller is limited to send sd cmd during initialization >> - no-mmc: controller is limited to send mmc cmd during initialization >> +- sd-broken-highspeed: Highspeed is broken, even if the controller and card >> + themselves claim they support highspeed. > > Regarding a broken card, that is managed via the card quirks and not in DT. > > If this is about a controller limitation, we already have the option > to describe what it supports, so we don't need an option to tell what > it *not* supports. > > For example "cap-sd-highspeed" tells whether the controller supports > SD high-speed, please use that instead. If a controller has a capability register and it lies (perhaps the board has limitations that the SoC does not), then you may need to disable a feature. Rob
[toc] | [prev] | [next] | [standalone]
| From | Julia Cartwright <julia@ni.com> |
|---|---|
| Date | 2016-10-05 23:30 +0200 |
| Subject | Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed |
| Message-ID | <sp1Vf-7vk-3@gated-at.bofh.it> |
| In reply to | #1496029 |
On Wed, Oct 05, 2016 at 03:03:44PM -0500, Rob Herring wrote: > On Wed, Oct 5, 2016 at 1:33 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote: > > On 23 September 2016 at 22:01, Zach Brown <zach.brown@ni.com> wrote: > >> Certain board configurations can make highspeed malfunction due to > >> timing issues. In these cases a way is needed to force the controller > >> and card into standard speed even if they otherwise appear to be capable > >> of highspeed. > >> > >> The sd-broken-highspeed property will let the sdhci driver know that > >> highspeed will not work. > >> > >> Signed-off-by: Zach Brown <zach.brown@ni.com> > >> --- > >> Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++ > >> 1 file changed, 2 insertions(+) > >> > >> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt > >> index 8a37782..59332ea 100644 > >> --- a/Documentation/devicetree/bindings/mmc/mmc.txt > >> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt > >> @@ -52,6 +52,8 @@ Optional properties: > >> - no-sdio: controller is limited to send sdio cmd during initialization > >> - no-sd: controller is limited to send sd cmd during initialization > >> - no-mmc: controller is limited to send mmc cmd during initialization > >> +- sd-broken-highspeed: Highspeed is broken, even if the controller and card > >> + themselves claim they support highspeed. > > > > Regarding a broken card, that is managed via the card quirks and not in DT. > > > > If this is about a controller limitation, we already have the option > > to describe what it supports, so we don't need an option to tell what > > it *not* supports. > > > > For example "cap-sd-highspeed" tells whether the controller supports > > SD high-speed, please use that instead. > > If a controller has a capability register and it lies (perhaps the > board has limitations that the SoC does not), then you may need to > disable a feature. That's precisely the case here. This is a board-level problem, not a card or controller problem. As Zach mentioned in the cover letter, the trace length between controller and card on some of our boards is too long to meet high-speed timings, even though both card and controller advertise it. Thanks, Julia
[toc] | [prev] | [next] | [standalone]
| From | Shawn Lin <shawn.lin@rock-chips.com> |
|---|---|
| Date | 2016-10-06 03:40 +0200 |
| Subject | Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed |
| Message-ID | <sp5Pc-1zX-7@gated-at.bofh.it> |
| In reply to | #1496064 |
On 2016/10/6 5:22, Julia Cartwright wrote: > On Wed, Oct 05, 2016 at 03:03:44PM -0500, Rob Herring wrote: >> On Wed, Oct 5, 2016 at 1:33 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote: >>> On 23 September 2016 at 22:01, Zach Brown <zach.brown@ni.com> wrote: >>>> Certain board configurations can make highspeed malfunction due to >>>> timing issues. In these cases a way is needed to force the controller >>>> and card into standard speed even if they otherwise appear to be capable >>>> of highspeed. >>>> >>>> The sd-broken-highspeed property will let the sdhci driver know that >>>> highspeed will not work. >>>> >>>> Signed-off-by: Zach Brown <zach.brown@ni.com> >>>> --- >>>> Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++ >>>> 1 file changed, 2 insertions(+) >>>> >>>> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt >>>> index 8a37782..59332ea 100644 >>>> --- a/Documentation/devicetree/bindings/mmc/mmc.txt >>>> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt >>>> @@ -52,6 +52,8 @@ Optional properties: >>>> - no-sdio: controller is limited to send sdio cmd during initialization >>>> - no-sd: controller is limited to send sd cmd during initialization >>>> - no-mmc: controller is limited to send mmc cmd during initialization >>>> +- sd-broken-highspeed: Highspeed is broken, even if the controller and card >>>> + themselves claim they support highspeed. >>> >>> Regarding a broken card, that is managed via the card quirks and not in DT. >>> >>> If this is about a controller limitation, we already have the option >>> to describe what it supports, so we don't need an option to tell what >>> it *not* supports. >>> >>> For example "cap-sd-highspeed" tells whether the controller supports >>> SD high-speed, please use that instead. >> >> If a controller has a capability register and it lies (perhaps the >> board has limitations that the SoC does not), then you may need to >> disable a feature. > > That's precisely the case here. This is a board-level problem, not a > card or controller problem. As Zach mentioned in the cover letter, the > trace length between controller and card on some of our boards is too > long to meet high-speed timings, even though both card and controller > advertise it. IIRC, I saw the same problem while using sdhci to bring up a industrial board for vehicle. The trace length is so long that I have to limit the max-frequency to make it works properly when running at hishspeed. So could you try to limit the max-frequency in your DT to see if it could work for you? I guess it should work as once reducing the frequency, the timing per cycle will be large enough to meet the spec. At least that helped me solve my problem. For further consideration, I deployed a mechanism called "tuning for non UHS or non-hs200/400" for my donwstream tree at that time. The basic concept is to ask devices to send ext_csd(or send status for SD case) *repeatedly*. Some hosts, i.e. sdhci-of-arasan or dw_mmc-rockchip, can manually set rx delay via some clock unit registers to capture the working sample window and select the middle point of the longest good phase region. The same for retune. But it is a little complicated, and could only be applicable to the hosts who could adjust the rx delay manually when claiming the caps of MMC_CAPS_CAN_TUNING_FOR_HS, whatever the name is... I don't know if it is worth to add this, and I don't know if it's a legit way. Anyway, I just share my thought(experience) for you and linux-mmc to think more about how to deal with the case you meet rather than sacrificing the performence by removing highspeed or reducing frequency.. > > Thanks, > Julia > -- > 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 > -- Best Regards Shawn Lin
[toc] | [prev] | [next] | [standalone]
| From | Adrian Hunter <adrian.hunter@intel.com> |
|---|---|
| Date | 2016-10-06 08:20 +0200 |
| Subject | Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed |
| Message-ID | <spac9-4HW-3@gated-at.bofh.it> |
| In reply to | #1496134 |
On 06/10/16 04:34, Shawn Lin wrote: > On 2016/10/6 5:22, Julia Cartwright wrote: >> On Wed, Oct 05, 2016 at 03:03:44PM -0500, Rob Herring wrote: >>> On Wed, Oct 5, 2016 at 1:33 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote: >>>> On 23 September 2016 at 22:01, Zach Brown <zach.brown@ni.com> wrote: >>>>> Certain board configurations can make highspeed malfunction due to >>>>> timing issues. In these cases a way is needed to force the controller >>>>> and card into standard speed even if they otherwise appear to be capable >>>>> of highspeed. >>>>> >>>>> The sd-broken-highspeed property will let the sdhci driver know that >>>>> highspeed will not work. >>>>> >>>>> Signed-off-by: Zach Brown <zach.brown@ni.com> >>>>> --- >>>>> Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++ >>>>> 1 file changed, 2 insertions(+) >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt >>>>> b/Documentation/devicetree/bindings/mmc/mmc.txt >>>>> index 8a37782..59332ea 100644 >>>>> --- a/Documentation/devicetree/bindings/mmc/mmc.txt >>>>> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt >>>>> @@ -52,6 +52,8 @@ Optional properties: >>>>> - no-sdio: controller is limited to send sdio cmd during initialization >>>>> - no-sd: controller is limited to send sd cmd during initialization >>>>> - no-mmc: controller is limited to send mmc cmd during initialization >>>>> +- sd-broken-highspeed: Highspeed is broken, even if the controller and >>>>> card >>>>> + themselves claim they support highspeed. >>>> >>>> Regarding a broken card, that is managed via the card quirks and not in DT. >>>> >>>> If this is about a controller limitation, we already have the option >>>> to describe what it supports, so we don't need an option to tell what >>>> it *not* supports. >>>> >>>> For example "cap-sd-highspeed" tells whether the controller supports >>>> SD high-speed, please use that instead. >>> >>> If a controller has a capability register and it lies (perhaps the >>> board has limitations that the SoC does not), then you may need to >>> disable a feature. >> >> That's precisely the case here. This is a board-level problem, not a >> card or controller problem. As Zach mentioned in the cover letter, the >> trace length between controller and card on some of our boards is too >> long to meet high-speed timings, even though both card and controller >> advertise it. > > IIRC, I saw the same problem while using sdhci to bring up a > industrial board for vehicle. The trace length is so long that > I have to limit the max-frequency to make it works properly when > running at hishspeed. > > So could you try to limit the max-frequency in your DT to see > if it could work for you? I guess it should work as once reducing > the frequency, the timing per cycle will be large enough to meet > the spec. At least that helped me solve my problem. > > For further consideration, I deployed a mechanism called "tuning for > non UHS or non-hs200/400" for my donwstream tree at that time. The basic > concept is to ask devices to send ext_csd(or send status for SD case) > *repeatedly*. Some hosts, i.e. sdhci-of-arasan or dw_mmc-rockchip, can > manually set rx delay via some clock unit registers to capture the > working sample window and select the middle point of the longest good > phase region. The same for retune. But it is a little complicated, and > could only be applicable to the hosts who could adjust the rx delay > manually when claiming the caps of MMC_CAPS_CAN_TUNING_FOR_HS, whatever > the name is... > > I don't know if it is worth to add this, and I don't know if it's > a legit way. Anyway, I just share my thought(experience) for you and > linux-mmc to think more about how to deal with the case you meet rather > than sacrificing the performence by removing highspeed or reducing > frequency.. > As Shawn points out, using max-frequency is a possibility. Did you consider that? There are 2 high speed caps: cap-sd-highspeed cap-mmc-highspeed Yet patch in 2, the effect of sd-broken-highspeed is to suppress highspeed for both SD and MMC. Should it then be called just broken-highspeed?
[toc] | [prev] | [next] | [standalone]
| From | Ulf Hansson <ulf.hansson@linaro.org> |
|---|---|
| Date | 2016-10-06 10:10 +0200 |
| Subject | Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed |
| Message-ID | <spbUB-5Qv-7@gated-at.bofh.it> |
| In reply to | #1496029 |
On 5 October 2016 at 22:03, Rob Herring <robh+dt@kernel.org> wrote: > On Wed, Oct 5, 2016 at 1:33 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote: >> On 23 September 2016 at 22:01, Zach Brown <zach.brown@ni.com> wrote: >>> Certain board configurations can make highspeed malfunction due to >>> timing issues. In these cases a way is needed to force the controller >>> and card into standard speed even if they otherwise appear to be capable >>> of highspeed. >>> >>> The sd-broken-highspeed property will let the sdhci driver know that >>> highspeed will not work. >>> >>> Signed-off-by: Zach Brown <zach.brown@ni.com> >>> --- >>> Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++ >>> 1 file changed, 2 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt >>> index 8a37782..59332ea 100644 >>> --- a/Documentation/devicetree/bindings/mmc/mmc.txt >>> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt >>> @@ -52,6 +52,8 @@ Optional properties: >>> - no-sdio: controller is limited to send sdio cmd during initialization >>> - no-sd: controller is limited to send sd cmd during initialization >>> - no-mmc: controller is limited to send mmc cmd during initialization >>> +- sd-broken-highspeed: Highspeed is broken, even if the controller and card >>> + themselves claim they support highspeed. >> >> Regarding a broken card, that is managed via the card quirks and not in DT. >> >> If this is about a controller limitation, we already have the option >> to describe what it supports, so we don't need an option to tell what >> it *not* supports. >> >> For example "cap-sd-highspeed" tells whether the controller supports >> SD high-speed, please use that instead. > > If a controller has a capability register and it lies (perhaps the > board has limitations that the SoC does not), then you may need to > disable a feature. I understand, although the SDHCI capabilities register is broken for most SDHCI variants. In principle, we would more or less have to add a *-broken binding for each bit in that register. I don't like that! Maybe a better option is to add a "sdhci-cap-broken" or perhaps "sdhci-cap-speed-modes-broken", which tells the driver to not rely on the capabilities register and instead find out what *is* supported by looking at the other mmc generic DT bindings. What do you think of that? Kind regards Uffe
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web