All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Andreas Fenkart <afenkart@gmail.com>
Cc: Chris Ball <cjb@laptop.org>, Tony Lindgren <tony@atomide.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Felipe Balbi <balbi@ti.com>, Venkatraman S <svenkatr@ti.com>,
	Balaji T K <balajitk@ti.com>,
	zonque@gmail.com, devicetree-discuss@lists.ozlabs.org,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org,
	linux-omap@vger.kernel.org
Subject: Re: [PATCH v3 3/4] mmc: omap_hsmmc: Remux pins to support SDIO interrupt on AM335x
Date: Fri, 18 Oct 2013 17:20:53 +1100	[thread overview]
Message-ID: <20131018172053.70cf2c2b@notabene.brown> (raw)
In-Reply-To: <1380971830-21492-4-git-send-email-afenkart@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3555 bytes --]

On Sat,  5 Oct 2013 13:17:09 +0200 Andreas Fenkart <afenkart@gmail.com> wrote:

> The am335x can't detect pending cirq in PM runtime suspend.
> This patch reconfigures dat1 as a GPIO before going to suspend.
> SDIO interrupts are detected with the GPIO, while in runtime
> suspend, standard detection of the module block otherwise.
> 
> Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
> 
> diff --git a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
> index 1136e6b..146f3ad 100644
> --- a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
> @@ -21,8 +21,11 @@ ti,non-removable: non-removable slot (like eMMC)
>  ti,needs-special-reset: Requires a special softreset sequence
>  ti,needs-special-hs-handling: HSMMC IP needs special setting for handling High Speed
>  ti,quirk-swakup-missing: SOC missing the swakeup line, will not detect
> -SDIO irq while in suspend. Fallback to polling. Affected chips are
> -am335x,
> +SDIO irq while in suspend. The workaround is to reconfigure the dat1 line as a
> +GPIO upon suspend. Beyond this option and the GPIO config, you also need to set
> +named pinctrl states "default", "active" and "idle ", see example below.  The
> +MMC driver will then then toggle between default and idle during the runtime
> +Affected chips are am335x,
>  
>                              ------
>                              | PRCM |
> @@ -49,3 +52,24 @@ Example:
>  		vmmc-supply = <&vmmc>; /* phandle to regulator node */
>  		ti,non-removable;
>  	};
> +
> +[am335x with with gpio for sdio irq]
> +
> +	mmc1_cirq_pin: pinmux_cirq_pin {
> +		pinctrl-single,pins = <
> +			0x0f8 0x3f	/* MMC0_DAT1 as GPIO2_28 */
> +		>;
> +	};
> +
> +	mmc1: mmc@48060000 {
> +		ti,non-removable;
> +		bus-width = <4>;
> +		vmmc-supply = <&ldo2_reg>;
> +		vmmc_aux-supply = <&vmmc>;
> +	        ti,quirk-swakeup-missing;
> +		pinctrl-names = "default", "active", "idle";
> +		pinctrl-0 = <&mmc1_pins>;
> +		pinctrl-1 = <&mmc1_pins>;
> +		pinctrl-2 = <&mmc1_cirq_pin>;
> +		ti,cirq-gpio = <&gpio3 28 0>;
> +	};


hi,
 I've been trying to get SD irq to work on my  OMAP3 DM3730.
I seems to need the magic to catch interrupts while FCLK is off, as
the only way I can get it to work at the moment is to keep FCLK on.

I discovered your patch and tried it out, but it doesn't seem to work for me.

I have a Libertas WIFI chip attached to the second mmc (which is sometimes
called mmc1, and sometimes mmc2 - very confusing!).
I added:
	mmc2_cirq_pin: pinmux_cirq_pin {
		pinctrl-single,pins = <
			0x012e (PIN_INPUT_PULLUP | MUX_MODE4)	/* MMC2_DAT1 as GPIO5_5 */
		>;
	};

and

&mmc2 {
	ti,quirk-swakeup-missing;
	pinctrl-names = "default", "active", "idle";
	pinctrl-0 = <&mmc2_pins>;
	pinctrl-1 = <&mmc2_pins>;
	pinctrl-2 = <&mmc2_cirq_pin>;
	ti,cirq-gpio = <&gpio5 5 0>; /* GPIO133 = 128+5 */
};

to my dts file but it doesn't make any apparent difference.

Any idea what I might be doing wrong?
(the base kernel I am applying patches to is from 8th Oct,
 commit 0e7a3ed04f0cd4311096d691888f88569310ee6c)

BTW,
 - with the default polling, I get about 1Mb/sec with iperf
 - with sd-irq enabled and FCLK kept on the whole time, I get 4Mb/sec
 - with sd-irq enable, FCLK kept on, and the 5ms polling also
   running, I get over 5Mb/sec!
Still much less than the 40Mb/sec that I would like to get...

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: neilb@suse.de (NeilBrown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/4] mmc: omap_hsmmc: Remux pins to support SDIO interrupt on AM335x
Date: Fri, 18 Oct 2013 17:20:53 +1100	[thread overview]
Message-ID: <20131018172053.70cf2c2b@notabene.brown> (raw)
In-Reply-To: <1380971830-21492-4-git-send-email-afenkart@gmail.com>

On Sat,  5 Oct 2013 13:17:09 +0200 Andreas Fenkart <afenkart@gmail.com> wrote:

> The am335x can't detect pending cirq in PM runtime suspend.
> This patch reconfigures dat1 as a GPIO before going to suspend.
> SDIO interrupts are detected with the GPIO, while in runtime
> suspend, standard detection of the module block otherwise.
> 
> Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
> 
> diff --git a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
> index 1136e6b..146f3ad 100644
> --- a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
> @@ -21,8 +21,11 @@ ti,non-removable: non-removable slot (like eMMC)
>  ti,needs-special-reset: Requires a special softreset sequence
>  ti,needs-special-hs-handling: HSMMC IP needs special setting for handling High Speed
>  ti,quirk-swakup-missing: SOC missing the swakeup line, will not detect
> -SDIO irq while in suspend. Fallback to polling. Affected chips are
> -am335x,
> +SDIO irq while in suspend. The workaround is to reconfigure the dat1 line as a
> +GPIO upon suspend. Beyond this option and the GPIO config, you also need to set
> +named pinctrl states "default", "active" and "idle ", see example below.  The
> +MMC driver will then then toggle between default and idle during the runtime
> +Affected chips are am335x,
>  
>                              ------
>                              | PRCM |
> @@ -49,3 +52,24 @@ Example:
>  		vmmc-supply = <&vmmc>; /* phandle to regulator node */
>  		ti,non-removable;
>  	};
> +
> +[am335x with with gpio for sdio irq]
> +
> +	mmc1_cirq_pin: pinmux_cirq_pin {
> +		pinctrl-single,pins = <
> +			0x0f8 0x3f	/* MMC0_DAT1 as GPIO2_28 */
> +		>;
> +	};
> +
> +	mmc1: mmc at 48060000 {
> +		ti,non-removable;
> +		bus-width = <4>;
> +		vmmc-supply = <&ldo2_reg>;
> +		vmmc_aux-supply = <&vmmc>;
> +	        ti,quirk-swakeup-missing;
> +		pinctrl-names = "default", "active", "idle";
> +		pinctrl-0 = <&mmc1_pins>;
> +		pinctrl-1 = <&mmc1_pins>;
> +		pinctrl-2 = <&mmc1_cirq_pin>;
> +		ti,cirq-gpio = <&gpio3 28 0>;
> +	};


hi,
 I've been trying to get SD irq to work on my  OMAP3 DM3730.
I seems to need the magic to catch interrupts while FCLK is off, as
the only way I can get it to work at the moment is to keep FCLK on.

I discovered your patch and tried it out, but it doesn't seem to work for me.

I have a Libertas WIFI chip attached to the second mmc (which is sometimes
called mmc1, and sometimes mmc2 - very confusing!).
I added:
	mmc2_cirq_pin: pinmux_cirq_pin {
		pinctrl-single,pins = <
			0x012e (PIN_INPUT_PULLUP | MUX_MODE4)	/* MMC2_DAT1 as GPIO5_5 */
		>;
	};

and

&mmc2 {
	ti,quirk-swakeup-missing;
	pinctrl-names = "default", "active", "idle";
	pinctrl-0 = <&mmc2_pins>;
	pinctrl-1 = <&mmc2_pins>;
	pinctrl-2 = <&mmc2_cirq_pin>;
	ti,cirq-gpio = <&gpio5 5 0>; /* GPIO133 = 128+5 */
};

to my dts file but it doesn't make any apparent difference.

Any idea what I might be doing wrong?
(the base kernel I am applying patches to is from 8th Oct,
 commit 0e7a3ed04f0cd4311096d691888f88569310ee6c)

BTW,
 - with the default polling, I get about 1Mb/sec with iperf
 - with sd-irq enabled and FCLK kept on the whole time, I get 4Mb/sec
 - with sd-irq enable, FCLK kept on, and the 5ms polling also
   running, I get over 5Mb/sec!
Still much less than the 40Mb/sec that I would like to get...

Thanks,
NeilBrown
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131018/ea287e9d/attachment.sig>

  parent reply	other threads:[~2013-10-18  6:20 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-05 11:17 [PATCH v3 0/4] mmc: omap_hsmmc: SDIO irq Andreas Fenkart
2013-10-05 11:17 ` Andreas Fenkart
2013-10-05 11:17 ` [PATCH v3 1/4] mmc: omap_hsmmc: Fix context save and restore for DT Andreas Fenkart
2013-10-05 11:17   ` Andreas Fenkart
2013-10-05 11:17 ` [PATCH v3 2/4] mmc: omap_hsmmc: Enable SDIO IRQ Andreas Fenkart
2013-10-05 11:17   ` Andreas Fenkart
2013-10-08 16:11   ` Felipe Balbi
2013-10-08 16:11     ` Felipe Balbi
2013-10-08 16:11     ` Felipe Balbi
2013-10-29 15:06     ` Andreas Fenkart
2013-10-29 15:06       ` Andreas Fenkart
2013-10-29 17:22       ` Felipe Balbi
2013-10-29 17:22         ` Felipe Balbi
2013-10-29 17:22         ` Felipe Balbi
2013-10-29 17:16   ` Kumar Gala
2013-10-29 17:16     ` Kumar Gala
2013-10-05 11:17 ` [PATCH v3 3/4] mmc: omap_hsmmc: Remux pins to support SDIO interrupt on AM335x Andreas Fenkart
2013-10-05 11:17   ` Andreas Fenkart
2013-10-15 16:34   ` Balaji T K
2013-10-15 16:34     ` Balaji T K
2013-10-15 16:34     ` Balaji T K
2013-10-18  6:20   ` NeilBrown [this message]
2013-10-18  6:20     ` NeilBrown
2013-10-18  7:29     ` Balaji T K
2013-10-18  7:29       ` Balaji T K
2013-10-18  7:29       ` Balaji T K
2013-10-18  7:45       ` NeilBrown
2013-10-18  7:45         ` NeilBrown
2013-10-18  7:45         ` NeilBrown
2013-10-18 10:12     ` Javier Martinez Canillas
2013-10-18 10:12       ` Javier Martinez Canillas
2013-10-18 23:14       ` NeilBrown
2013-10-18 23:14         ` NeilBrown
2013-10-19  1:02         ` Javier Martinez Canillas
2013-10-19  1:02           ` Javier Martinez Canillas
     [not found] ` <1380971830-21492-1-git-send-email-afenkart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-10-05 11:17   ` [PATCH v3 4/4] mmc: omap_hsmmc: debugfs entries for SDIO IRQ detection and GPIO remuxing Andreas Fenkart
2013-10-05 11:17     ` Andreas Fenkart
2013-10-05 11:17     ` Andreas Fenkart

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=20131018172053.70cf2c2b@notabene.brown \
    --to=neilb@suse.de \
    --cc=afenkart@gmail.com \
    --cc=balajitk@ti.com \
    --cc=balbi@ti.com \
    --cc=cjb@laptop.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=svenkatr@ti.com \
    --cc=tony@atomide.com \
    --cc=zonque@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.