[Gta04-owner] [PATCH 04/11] ARM: dts: omap3-gta04: add support for sdio interrupts.

NeilBrown neilb at suse.de
Tue Jan 6 19:41:23 CET 2015


On Mon, 5 Jan 2015 22:26:59 +0100 Belisko Marek <marek.belisko at gmail.com>
wrote:

> Hi Neil,
> 
> On Mon, Jan 5, 2015 at 8:59 PM, NeilBrown <neilb at suse.de> wrote:
> > From: NeilBrown <neil at brown.name>
> >
> > We need to arrange for the DAT1 line to become GPIO
> > when the mmc host is asleep, so interrupts can wake
> > the device.
> >
> > Signed-off-by: NeilBrown <neil at brown.name>
> > ---
> >  arch/arm/boot/dts/omap3-gta04.dtsi |   25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi
> > index 8cfc54c44f83..803be76746e0 100644
> > --- a/arch/arm/boot/dts/omap3-gta04.dtsi
> > +++ b/arch/arm/boot/dts/omap3-gta04.dtsi
> > @@ -134,6 +134,26 @@
> >                 >;
> >         };
> >
> > +       mmc2_pins: pinmux_mmc2_pins {
> > +               pinctrl-single,pins = <
> > +                       OMAP3_CORE1_IOPAD(0x2158, PIN_INPUT_PULLUP | MUX_MODE0)         /* sdmmc2_clk */
> > +                       OMAP3_CORE1_IOPAD(0x215a, PIN_INPUT_PULLUP | MUX_MODE0)         /* sdmmc2_cmd */
> > +                       OMAP3_CORE1_IOPAD(0x215c, PIN_INPUT_PULLUP | MUX_MODE0)         /* sdmmc2_dat0 */
> > +                       OMAP3_CORE1_IOPAD(0x215e, PIN_INPUT_PULLUP | MUX_MODE0)         /* sdmmc2_dat1 */
> > +                       OMAP3_CORE1_IOPAD(0x2160, PIN_INPUT_PULLUP | MUX_MODE0)         /* sdmmc2_dat2 */
> > +                       OMAP3_CORE1_IOPAD(0x2162, PIN_INPUT_PULLUP | MUX_MODE0)         /* sdmmc2_dat3 */
> > +                       OMAP3_CORE1_IOPAD(0x2164, PIN_INPUT_PULLUP | MUX_MODE1)         /* sdmmc2_dir_dat0 */
> > +                       OMAP3_CORE1_IOPAD(0x2166, PIN_INPUT_PULLUP | MUX_MODE1)         /* sdmmc2_dir_dat1 */
> > +                       OMAP3_CORE1_IOPAD(0x2168, PIN_INPUT_PULLUP | MUX_MODE1)         /* sdmmc2_cmd */
> > +                       OMAP3_CORE1_IOPAD(0x216a, PIN_INPUT_PULLUP | MUX_MODE1)         /* sdmmc2_clkin */
> > +               >;
> > +       };
> blank line should be here

Added.

> > +       mmc2_cirq_pin: pinmux_cirq_pin {
> > +               pinctrl-single,pins = <
> > +                       OMAP3_CORE1_IOPAD(0x215e, PIN_INPUT_PULLUP | MUX_MODE4)         /* sdmmc2_dat1 as GPIO_133 GPIO5,5 */
> ^^^^ this part of comment isn't necessary

OK.

> > +               >;
> > +       };
> > +
> >         dss_dpi_pins: pinmux_dss_dpi_pins {
> >                 pinctrl-single,pins = <
> >                         OMAP3_CORE1_IOPAD(0x20d4, PIN_OUTPUT | MUX_MODE0)   /* dss_pclk.dss_pclk */
> > @@ -321,6 +341,11 @@
> >         bus-width = <4>;
> >         ti,non-removable;
> >         cap-power-off-card;
> > +       interrupts-extended = <&intc 86 &gpio5 5 0>; /* GPIO_133 */
> > +       pinctrl-names = "default", "active", "idle";
> states names are invalid. should be : "default", "idle", "sleep"
> (definitions in include/linux/pinctrl/pinctrl-state.h)

True, yet
   Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt

mentions "active"... can't find it anywhere else though.

omap_hsmm.c just uses pinctrl_pm_select_default_state() and 
pinctrl_pm_select_idle_state(), so "default" and "idle" is all we need.
I've removed "active".

I think I copied it from
  https://lkml.org/lkml/2013/10/5/38
or similar.

Thanks.

> > +       pinctrl-0 = <&mmc2_pins>;
> > +       pinctrl-1 = <&mmc2_pins>;
> > +       pinctrl-2 = <&mmc2_cirq_pin>;
> >  };
> >
> >  &mmc3 {
> >
> >
> Did you try to test it? (something like put system to sleep and wake
> it by WOW packet?)

This isn't really about WOW - I've never tried WOW and have reason to doubt
very much that it works at the moment.

This is about getting reasonable throughput.  Without this configuration the
sdio driver polls the wifi card for status changes and I get under 1Mb/sec.
With this configuration the SDIO card can interrupt the driver when things
happen (xmit buffer empty, packets received etc) and I get several Mb/sec.

The pinctrl changes are needed so the MMC driver can still receive an
interrupt when runtime power management puts the MMC interface to sleep.  It
isn't really related to suspend.

The driver does seem to miss interrupts occasionally even with the pinctrl
settings, so I have a little patch to keep it polling as well, just in case.

So while I think the patch is correct as it stands, it may be exposing a bug
that is somewhere else.  If you like we can leave it off the list going to
mainline until that bug is properly understood.

> 
> Thanks,
> 
> marek
> 


Thanks,
NeilBrown
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20150107/16720e51/attachment.asc>


More information about the Gta04-owner mailing list