[Letux-kernel] omap_hsmmc + gta04 + sdio irq + runtime_suspend + 4 bit = trouble

Andreas Kemnade andreas at kemnade.info
Wed Sep 26 23:12:10 CEST 2018

Hi Tony,

coming back to this nasty thing. First thank you for your ideas.
The general situation on gta04a4 (on a5 there is a newer
wifi chip) is the following:
On mainline we have around 200mA of additional current consumption
if wlan is enabled and connected without data transfer.
We get 100KByte/s data transfers downstream.
With the dirty letux patch (enabling SDIO_IRQ and adding a pair of
pm_runtime_get_sync()/put() in omap_hsmmc_enable_sdio_irq()),
the values are 30mA and > 1000KByte/s.
The wifi chip (with libertas driver) just behaves better with low
latency sdio irq.

Usually there are sdio irqs every 100ms, so with the default runtime
autosuspend value we have a perfect setup for testing all kind
of sdio irq race conditions. Maybe this 100ms thing can be improved,
maybe not. But
that is another topic.
It is clear that disabling wifi if not in use is quite a good idea.
Just that for the background. 

On Fri, 7 Sep 2018 10:08:50 -0700
Tony Lindgren <tony at atomide.com> wrote:

> * Andreas Kemnade <andreas at kemnade.info> [180907 16:52]:
> > sdio irq + wakeirq via remapped dat1 as gpio + 4 bit -(=reverted)
> > generic_wakeirq_patch = does not work  
> And here's where I suspect that in deeper SoC idle states
> with floating lines confuse the SDIO card :)
Why only here? Well if there appears a problem by
*reverting* a patch, then there is a nice and simple solution. ;-)

Well, confusion could make the card release dat1 in a bad moment
so that the irq will be lost. The SDIO simplified spec is
missing some sections about 4bit and irq. So it is a good point.

> Maybe try adding pinctrl "idle" state that puts the rest
> of the SDIO pins to safe mode (7) and see if that helps?

Probably a good idea even for the better working setups I tested.
Will try that. I have tried several things but not mode 7. Just to make
sure that you correctly understand what I was doing. "wakeirq via
remapped dat1 as gpio" means a separate idle pinctl state with dat1 as
mode 4.


Now to the real interesting problem behavior
if wifi is power off:
> I guess it's possible that you now have the SoC entering
> off mode during idle and have a glitch on the power
> GPIO as omap3-evm has.
There should be really no glitch:
wlan reset-gpio is behind an i2c to io chip.
Power is behind twl4030. Both are turned off. So everythng on
the wlan side of the level shifter should be logical low.
With the result that we would have a logical low on the dat1.
I exported the gpio and checked the level. It was low.

If I understand the code correctly the wakeirq stuff is enabled
regardless whether sdio irqs are wanted or not.
Before using the generic wakeirq framework, the wakeirq stuff was
disabled when there are sdio irqs disabled.
So we either need a third pinctl state for that
no-sdio-irq situation or (or maybe and) disable the wakeirq stuff then.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20180926/e370bc2b/attachment.asc>

More information about the Letux-kernel mailing list