* Help wanted with USB and OMAP3 off_mode
@ 2013-01-08 22:29 NeilBrown
2013-01-09 10:00 ` Igor Grinberg
2013-01-16 10:00 ` Roger Quadros
0 siblings, 2 replies; 21+ messages in thread
From: NeilBrown @ 2013-01-08 22:29 UTC (permalink / raw)
To: linux-omap
[-- Attachment #1: Type: text/plain, Size: 2217 bytes --]
Hi,
I'm trying to get off_mode working reliably on my gta04 mobile phone.
My current stumbling block is USB. The "Option" GSM module is attached via
USB (there is a separate transceiver chip attached to port 1 which is placed
in OMAP_EHCI_PORT_MODE_PHY).
After a suspend/resume cycle with off_mode enabled the GSM module disappears.
i.e. 'lsusb' doesn't see it any more and the various ttyHSxx devices don't
exist.
Without off mode, the modem always appears after resume.
I discovered that the registers set by:
drivers/mfd/omap-usb-host.c
are not maintained across as suspend/resume so I added the following patch
(which I can make a formal submission of if it looks right to others), but
that didn't help (or didn't help enough).
If I
echo 1 > /sys/kernel/debug/pm_debug/usbhost_pwrdm/suspend
thus keeping just the USBHOST power domain out of off_mode, the GSM module
doesn't disappear. So it seems that some context in the usbhost domain is
not being save and restored.
This is as far as I can get. Can someone suggest where I should look to find
out what is not being saved/restored properly, and how to go about saving and
restoring?
Thanks in advance,
NeilBrown
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 23cec57..522405e 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -100,6 +100,10 @@ struct usbhs_hcd_omap {
void __iomem *uhh_base;
+ struct {
+ unsigned hostconfig;
+ } context;
+
struct usbhs_omap_platform_data platdata;
u32 usbhs_rev;
@@ -300,6 +304,10 @@ static int usbhs_runtime_resume(struct device *dev)
clk_enable(omap->utmi_p1_fck);
clk_enable(omap->utmi_p2_fck);
+ usbhs_write(omap->uhh_base,
+ OMAP_UHH_HOSTCONFIG,
+ omap->context.hostconfig);
+
spin_unlock_irqrestore(&omap->lock, flags);
return 0;
@@ -319,6 +327,8 @@ static int usbhs_runtime_suspend(struct device *dev)
}
spin_lock_irqsave(&omap->lock, flags);
+ omap->context.hostconfig = usbhs_read(omap->uhh_base,
+ OMAP_UHH_HOSTCONFIG);
if (is_ehci_tll_mode(pdata->port_mode[0]))
clk_disable(omap->usbhost_p1_fck);
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-08 22:29 Help wanted with USB and OMAP3 off_mode NeilBrown
@ 2013-01-09 10:00 ` Igor Grinberg
2013-01-09 10:19 ` NeilBrown
2013-01-16 10:00 ` Roger Quadros
1 sibling, 1 reply; 21+ messages in thread
From: Igor Grinberg @ 2013-01-09 10:00 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-omap
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Neil,
On 01/09/13 00:29, NeilBrown wrote:
>
> Hi,
> I'm trying to get off_mode working reliably on my gta04 mobile phone.
>
> My current stumbling block is USB. The "Option" GSM module is attached via
> USB (there is a separate transceiver chip attached to port 1 which is placed
> in OMAP_EHCI_PORT_MODE_PHY).
Which PHY is this (vendor/model)?
>
> After a suspend/resume cycle with off_mode enabled the GSM module disappears.
> i.e. 'lsusb' doesn't see it any more and the various ttyHSxx devices don't
> exist.
> Without off mode, the modem always appears after resume.
>
> I discovered that the registers set by:
>
> drivers/mfd/omap-usb-host.c
>
> are not maintained across as suspend/resume so I added the following patch
> (which I can make a formal submission of if it looks right to others), but
> that didn't help (or didn't help enough).
>
> If I
>
> echo 1 > /sys/kernel/debug/pm_debug/usbhost_pwrdm/suspend
>
> thus keeping just the USBHOST power domain out of off_mode, the GSM module
> doesn't disappear. So it seems that some context in the usbhost domain is
> not being save and restored.
>
> This is as far as I can get. Can someone suggest where I should look to find
> out what is not being saved/restored properly, and how to go about saving and
> restoring?
>
> Thanks in advance,
> NeilBrown
>
>
>
> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
> index 23cec57..522405e 100644
> --- a/drivers/mfd/omap-usb-host.c
> +++ b/drivers/mfd/omap-usb-host.c
> @@ -100,6 +100,10 @@ struct usbhs_hcd_omap {
>
> void __iomem *uhh_base;
>
> + struct {
> + unsigned hostconfig;
> + } context;
> +
> struct usbhs_omap_platform_data platdata;
>
> u32 usbhs_rev;
> @@ -300,6 +304,10 @@ static int usbhs_runtime_resume(struct device *dev)
> clk_enable(omap->utmi_p1_fck);
> clk_enable(omap->utmi_p2_fck);
>
> + usbhs_write(omap->uhh_base,
> + OMAP_UHH_HOSTCONFIG,
> + omap->context.hostconfig);
> +
> spin_unlock_irqrestore(&omap->lock, flags);
>
> return 0;
> @@ -319,6 +327,8 @@ static int usbhs_runtime_suspend(struct device *dev)
> }
>
> spin_lock_irqsave(&omap->lock, flags);
> + omap->context.hostconfig = usbhs_read(omap->uhh_base,
> + OMAP_UHH_HOSTCONFIG);
>
> if (is_ehci_tll_mode(pdata->port_mode[0]))
> clk_disable(omap->usbhost_p1_fck);
- --
Regards,
Igor.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJQ7T+kAAoJEBDE8YO64Efaj8YQAI5nOE9vvf8wxbu5IXTxaMxn
6B+g2m/zkMlyVNL5hTrwkPkP4CTBwvsGCZYkZT5JS3KM+R+TuyIX07+eM59Ie0Po
u1CCn2XKZY2CP53b3nAtgk9Phxwruf5fDjEu9QiQapdUpbiTWmIn8W3CVye241O2
wXBKAXszX1bD81NFNY+Jm5Us5uGHNTtNtqe78Rng7BTvmaaNgE61PurFclgn0xQb
IO5E7eyq7TG1u/IBhge2jlZGx2BbLcVsrQI3WyuE2L6F+MRgAKBDD7K8uHTfxPyM
eXAk/u5tbA21t1mTIXk19N4c0YVgeFW2kKQOPShKywy9J6k3tE5LE4yUjooo4ZeS
TlIf7HFcp15N3FfX90FOYsQOXILnoNL6a8SOK3gU+iVxZU/4VohKOXBlMjuZ7o10
5FnglPaHjsEaa1DgB/FcnYh3OO33mODJsckUhi5GiIlrbm70JspfWShZfln1k8FS
SwClmyb6FCiqBOcRJ2uS1KTwObzYV9WeuPGCTXC5d4UBB57eRcGcX/NvSftV57mX
jcSEle93kgZx1EiG53Vwd29oV9nU6SJECF7Q8CqulDEQVr76E7Xh8Z1CrsD+BhKe
XuFa3zdtMg1SZO/ctcTIPPpElCVPF1FChX2lY9fCIdK2luHNrOs4GyrozCGXQcXO
ZMFiiStsjr021CGqQUFw
=yIA2
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-09 10:00 ` Igor Grinberg
@ 2013-01-09 10:19 ` NeilBrown
2013-01-09 10:24 ` Michael Trimarchi
0 siblings, 1 reply; 21+ messages in thread
From: NeilBrown @ 2013-01-09 10:19 UTC (permalink / raw)
To: Igor Grinberg; +Cc: linux-omap
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Neil,
>
> On 01/09/13 00:29, NeilBrown wrote:
> >
> > Hi,
> > I'm trying to get off_mode working reliably on my gta04 mobile phone.
> >
> > My current stumbling block is USB. The "Option" GSM module is attached via
> > USB (there is a separate transceiver chip attached to port 1 which is placed
> > in OMAP_EHCI_PORT_MODE_PHY).
>
> Which PHY is this (vendor/model)?
Hi Igor,
it is the SMSC USB3322
http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
BTW I subsequently discovered that keeping USBHOST out off off_mode only
sometimes avoid the problem, not always. So there are probably multiple
issues :-(
NeilBrown
>
> >
> > After a suspend/resume cycle with off_mode enabled the GSM module disappears.
> > i.e. 'lsusb' doesn't see it any more and the various ttyHSxx devices don't
> > exist.
> > Without off mode, the modem always appears after resume.
> >
> > I discovered that the registers set by:
> >
> > drivers/mfd/omap-usb-host.c
> >
> > are not maintained across as suspend/resume so I added the following patch
> > (which I can make a formal submission of if it looks right to others), but
> > that didn't help (or didn't help enough).
> >
> > If I
> >
> > echo 1 > /sys/kernel/debug/pm_debug/usbhost_pwrdm/suspend
> >
> > thus keeping just the USBHOST power domain out of off_mode, the GSM module
> > doesn't disappear. So it seems that some context in the usbhost domain is
> > not being save and restored.
> >
> > This is as far as I can get. Can someone suggest where I should look to find
> > out what is not being saved/restored properly, and how to go about saving and
> > restoring?
> >
> > Thanks in advance,
> > NeilBrown
> >
> >
> >
> > diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
> > index 23cec57..522405e 100644
> > --- a/drivers/mfd/omap-usb-host.c
> > +++ b/drivers/mfd/omap-usb-host.c
> > @@ -100,6 +100,10 @@ struct usbhs_hcd_omap {
> >
> > void __iomem *uhh_base;
> >
> > + struct {
> > + unsigned hostconfig;
> > + } context;
> > +
> > struct usbhs_omap_platform_data platdata;
> >
> > u32 usbhs_rev;
> > @@ -300,6 +304,10 @@ static int usbhs_runtime_resume(struct device *dev)
> > clk_enable(omap->utmi_p1_fck);
> > clk_enable(omap->utmi_p2_fck);
> >
> > + usbhs_write(omap->uhh_base,
> > + OMAP_UHH_HOSTCONFIG,
> > + omap->context.hostconfig);
> > +
> > spin_unlock_irqrestore(&omap->lock, flags);
> >
> > return 0;
> > @@ -319,6 +327,8 @@ static int usbhs_runtime_suspend(struct device *dev)
> > }
> >
> > spin_lock_irqsave(&omap->lock, flags);
> > + omap->context.hostconfig = usbhs_read(omap->uhh_base,
> > + OMAP_UHH_HOSTCONFIG);
> >
> > if (is_ehci_tll_mode(pdata->port_mode[0]))
> > clk_disable(omap->usbhost_p1_fck);
>
> - --
> Regards,
> Igor.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.17 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQIcBAEBAgAGBQJQ7T+kAAoJEBDE8YO64Efaj8YQAI5nOE9vvf8wxbu5IXTxaMxn
> 6B+g2m/zkMlyVNL5hTrwkPkP4CTBwvsGCZYkZT5JS3KM+R+TuyIX07+eM59Ie0Po
> u1CCn2XKZY2CP53b3nAtgk9Phxwruf5fDjEu9QiQapdUpbiTWmIn8W3CVye241O2
> wXBKAXszX1bD81NFNY+Jm5Us5uGHNTtNtqe78Rng7BTvmaaNgE61PurFclgn0xQb
> IO5E7eyq7TG1u/IBhge2jlZGx2BbLcVsrQI3WyuE2L6F+MRgAKBDD7K8uHTfxPyM
> eXAk/u5tbA21t1mTIXk19N4c0YVgeFW2kKQOPShKywy9J6k3tE5LE4yUjooo4ZeS
> TlIf7HFcp15N3FfX90FOYsQOXILnoNL6a8SOK3gU+iVxZU/4VohKOXBlMjuZ7o10
> 5FnglPaHjsEaa1DgB/FcnYh3OO33mODJsckUhi5GiIlrbm70JspfWShZfln1k8FS
> SwClmyb6FCiqBOcRJ2uS1KTwObzYV9WeuPGCTXC5d4UBB57eRcGcX/NvSftV57mX
> jcSEle93kgZx1EiG53Vwd29oV9nU6SJECF7Q8CqulDEQVr76E7Xh8Z1CrsD+BhKe
> XuFa3zdtMg1SZO/ctcTIPPpElCVPF1FChX2lY9fCIdK2luHNrOs4GyrozCGXQcXO
> ZMFiiStsjr021CGqQUFw
> =yIA2
> -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQIVAwUBUO1EMznsnt1WYoG5AQJ9Gg//Qwx5P/VjOi+9TDXIGr10OqldLEQKG4zv
Dbwhw5l9DR85JIuF+m5xVXUe9IWJZ0UCasi61LtkRJVGW8U7Lv0O2mmXcYHoQ9zt
diph8SVM9ZTh4SAaz2iiHeJ1Sqz0WkiZ47Kv1C0Q/n9MyFqKKG7Nxg5UAyAj39x4
pa8vsBGcPmwn5U/dUPQBxs3QKdp9aI3i2I6Q6vObRLYLJSvxAeXkGYfrmMy/NoZz
RNhkLhVTajPCYTBcPw+zH06Pv8VF+i/UwFggnVl+uW+6LrIpKbaLa7CMntXmrSgz
fi7y1LLiQuE7qK26IizLu/XIapb0tPGy28AebYwSbjFTaqHPNmlLAzyfww3lBteI
PS76DulKiR4YX58v0KGKITcYLKK3mUliOETcWylot2eTyqbP9m0Y3nX57AEDi0+N
FBBuoG4EKUQaLf5CnjF6ViMttUfvcfwL+Vrn+4VaYndS9S9w5IXTii5b1OcuhJaZ
aGS+Tm/Mwa1uNQWBjujc/DdvwKZRrRilHTBH4w/rHRwxNTqKAxWmq72162efpxdR
JxkHrPTEZZZwLewPXmTbD1+h50284apAw+D2PERFiB+Fh4ZVzsLIcBcUIZ3OT4L1
AlrqYC0wAS2RgjhvmveR360i8DS1SXMMafonrLhrwRu7oe1uzltKmnNX21Sp76vB
gM5LIokwosA=
=8VnD
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-09 10:19 ` NeilBrown
@ 2013-01-09 10:24 ` Michael Trimarchi
2013-01-09 11:34 ` NeilBrown
0 siblings, 1 reply; 21+ messages in thread
From: Michael Trimarchi @ 2013-01-09 10:24 UTC (permalink / raw)
To: NeilBrown; +Cc: Igor Grinberg, linux-omap
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=windows-1252, Size: 3579 bytes --]
Hi Neil
On 01/09/2013 11:19 AM, NeilBrown wrote:
> On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>
>> Hi Neil,
>
>> On 01/09/13 00:29, NeilBrown wrote:
>>>
>>> Hi,
>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
>>>
>>> My current stumbling block is USB. The "Option" GSM module is attached via
>>> USB (there is a separate transceiver chip attached to port 1 which is placed
>>> in OMAP_EHCI_PORT_MODE_PHY).
>
>> Which PHY is this (vendor/model)?
>
> Hi Igor,
> it is the SMSC USB3322
>
> http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
>
>
> BTW I subsequently discovered that keeping USBHOST out off off_mode only
> sometimes avoid the problem, not always. So there are probably multiple
> issues :-(
Are you sure that you don't have glitch on power, reset pin during suspend?
Michael
>
> NeilBrown
>
>
>
>
>>>
>>> After a suspend/resume cycle with off_mode enabled the GSM module disappears.
>>> i.e. 'lsusb' doesn't see it any more and the various ttyHSxx devices don't
>>> exist.
>>> Without off mode, the modem always appears after resume.
>>>
>>> I discovered that the registers set by:
>>>
>>> drivers/mfd/omap-usb-host.c
>>>
>>> are not maintained across as suspend/resume so I added the following patch
>>> (which I can make a formal submission of if it looks right to others), but
>>> that didn't help (or didn't help enough).
>>>
>>> If I
>>>
>>> echo 1 > /sys/kernel/debug/pm_debug/usbhost_pwrdm/suspend
>>>
>>> thus keeping just the USBHOST power domain out of off_mode, the GSM module
>>> doesn't disappear. So it seems that some context in the usbhost domain is
>>> not being save and restored.
>>>
>>> This is as far as I can get. Can someone suggest where I should look to find
>>> out what is not being saved/restored properly, and how to go about saving and
>>> restoring?
>>>
>>> Thanks in advance,
>>> NeilBrown
>>>
>>>
>>>
>>> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
>>> index 23cec57..522405e 100644
>>> --- a/drivers/mfd/omap-usb-host.c
>>> +++ b/drivers/mfd/omap-usb-host.c
>>> @@ -100,6 +100,10 @@ struct usbhs_hcd_omap {
>>>
>>> void __iomem *uhh_base;
>>>
>>> + struct {
>>> + unsigned hostconfig;
>>> + } context;
>>> +
>>> struct usbhs_omap_platform_data platdata;
>>>
>>> u32 usbhs_rev;
>>> @@ -300,6 +304,10 @@ static int usbhs_runtime_resume(struct device *dev)
>>> clk_enable(omap->utmi_p1_fck);
>>> clk_enable(omap->utmi_p2_fck);
>>>
>>> + usbhs_write(omap->uhh_base,
>>> + OMAP_UHH_HOSTCONFIG,
>>> + omap->context.hostconfig);
>>> +
>>> spin_unlock_irqrestore(&omap->lock, flags);
>>>
>>> return 0;
>>> @@ -319,6 +327,8 @@ static int usbhs_runtime_suspend(struct device *dev)
>>> }
>>>
>>> spin_lock_irqsave(&omap->lock, flags);
>>> + omap->context.hostconfig = usbhs_read(omap->uhh_base,
>>> + OMAP_UHH_HOSTCONFIG);
>>>
>>> if (is_ehci_tll_mode(pdata->port_mode[0]))
>>> clk_disable(omap->usbhost_p1_fck);
>
>> - --
>> Regards,
>> Igor.
>>
> N§²æìr¸yúèØb²X¬¶Ç§vØ^)Þº{.nÇ+·¥{±¢f©{ayº\x1dÊÚë,j\a¢f£¢·hàz¹\x1e®w¥¢¸\f¢·¦j:+v¨wèjØm¶ÿ¾\a«êçzZ+ùÝ¢j"ú!tml=
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-09 10:24 ` Michael Trimarchi
@ 2013-01-09 11:34 ` NeilBrown
2013-01-09 11:42 ` Michael Trimarchi
2013-01-09 12:08 ` Michael Trimarchi
0 siblings, 2 replies; 21+ messages in thread
From: NeilBrown @ 2013-01-09 11:34 UTC (permalink / raw)
To: Michael Trimarchi; +Cc: Igor Grinberg, linux-omap
[-- Attachment #1: Type: text/plain, Size: 1901 bytes --]
On Wed, 09 Jan 2013 11:24:09 +0100 Michael Trimarchi
<michael@amarulasolutions.com> wrote:
> Hi Neil
>
> On 01/09/2013 11:19 AM, NeilBrown wrote:
> > On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
> > wrote:
> >
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >
> >> Hi Neil,
> >
> >> On 01/09/13 00:29, NeilBrown wrote:
> >>>
> >>> Hi,
> >>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
> >>>
> >>> My current stumbling block is USB. The "Option" GSM module is attached via
> >>> USB (there is a separate transceiver chip attached to port 1 which is placed
> >>> in OMAP_EHCI_PORT_MODE_PHY).
> >
> >> Which PHY is this (vendor/model)?
> >
> > Hi Igor,
> > it is the SMSC USB3322
> >
> > http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
> >
> >
> > BTW I subsequently discovered that keeping USBHOST out off off_mode only
> > sometimes avoid the problem, not always. So there are probably multiple
> > issues :-(
>
> Are you sure that you don't have glitch on power, reset pin during suspend?
>
No, I don't really have the equipment to measure such things.
But is it likely? Would enabling off_mode make it more likely?
Can you suggest some way I could test the hypothesis?
The power pin is connected to a 3v3 regulator which certainly should stay on
the whole time and other things which depend on it keep working.
The reset line is connected to GPIO174 which is configured:
# cat /sys/kernel/debug/omap_mux/mcspi1_cs0
name: mcspi1_cs0.gpio_174 (0x480021ce/0x19e = 0x011c), b ac2, t NA
mode: OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE4
signals: mcspi1_cs0 | sdmmc2_dat7 | NA | NA | gpio_174 | NA | NA | safe_mode
The "PIN_INPUT" seems a bit odd, so I changed it to OMAP_PIN_OUTPUT but that
didn't appear to make any difference.
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-09 11:34 ` NeilBrown
@ 2013-01-09 11:42 ` Michael Trimarchi
2013-01-16 7:28 ` NeilBrown
2013-01-09 12:08 ` Michael Trimarchi
1 sibling, 1 reply; 21+ messages in thread
From: Michael Trimarchi @ 2013-01-09 11:42 UTC (permalink / raw)
To: NeilBrown; +Cc: Igor Grinberg, linux-omap
On 01/09/2013 12:34 PM, NeilBrown wrote:
> On Wed, 09 Jan 2013 11:24:09 +0100 Michael Trimarchi
> <michael@amarulasolutions.com> wrote:
>
>> Hi Neil
>>
>> On 01/09/2013 11:19 AM, NeilBrown wrote:
>>> On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
>>> wrote:
>>>
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA1
>>>
>>>> Hi Neil,
>>>
>>>> On 01/09/13 00:29, NeilBrown wrote:
>>>>>
>>>>> Hi,
>>>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
>>>>>
>>>>> My current stumbling block is USB. The "Option" GSM module is attached via
>>>>> USB (there is a separate transceiver chip attached to port 1 which is placed
>>>>> in OMAP_EHCI_PORT_MODE_PHY).
>>>
>>>> Which PHY is this (vendor/model)?
>>>
>>> Hi Igor,
>>> it is the SMSC USB3322
>>>
>>> http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
>>>
>>>
>>> BTW I subsequently discovered that keeping USBHOST out off off_mode only
>>> sometimes avoid the problem, not always. So there are probably multiple
>>> issues :-(
>>
>> Are you sure that you don't have glitch on power, reset pin during suspend?
>>
>
> No, I don't really have the equipment to measure such things.
> But is it likely? Would enabling off_mode make it more likely?
> Can you suggest some way I could test the hypothesis?
>
> The power pin is connected to a 3v3 regulator which certainly should stay on
> the whole time and other things which depend on it keep working.
>
> The reset line is connected to GPIO174 which is configured:
>
> # cat /sys/kernel/debug/omap_mux/mcspi1_cs0
> name: mcspi1_cs0.gpio_174 (0x480021ce/0x19e = 0x011c), b ac2, t NA
> mode: OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE4
> signals: mcspi1_cs0 | sdmmc2_dat7 | NA | NA | gpio_174 | NA | NA | safe_mode
>
> The "PIN_INPUT" seems a bit odd, so I changed it to OMAP_PIN_OUTPUT but that
> didn't appear to make any difference.
>
Can you try to add this OMAP_PIN_OFF_OUTPUT_HIGH or LOW? It's suppose to be the off_mode status of the pin.
Is it correct?
Michael
> Thanks,
> NeilBrown
>
--
| Michael Nazzareno Trimarchi Amarula Solutions BV |
| COO - Founder Cruquiuskade 47 |
| +31(0)851119172 Amsterdam 1018 AM NL |
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-09 11:34 ` NeilBrown
2013-01-09 11:42 ` Michael Trimarchi
@ 2013-01-09 12:08 ` Michael Trimarchi
2013-01-09 12:54 ` Igor Grinberg
1 sibling, 1 reply; 21+ messages in thread
From: Michael Trimarchi @ 2013-01-09 12:08 UTC (permalink / raw)
To: NeilBrown; +Cc: Igor Grinberg, linux-omap
Hi Neil
I forget to answer to your questions
On 01/09/2013 12:34 PM, NeilBrown wrote:
> On Wed, 09 Jan 2013 11:24:09 +0100 Michael Trimarchi
> <michael@amarulasolutions.com> wrote:
>
>> Hi Neil
>>
>> On 01/09/2013 11:19 AM, NeilBrown wrote:
>>> On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
>>> wrote:
>>>
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA1
>>>
>>>> Hi Neil,
>>>
>>>> On 01/09/13 00:29, NeilBrown wrote:
>>>>>
>>>>> Hi,
>>>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
>>>>>
>>>>> My current stumbling block is USB. The "Option" GSM module is attached via
>>>>> USB (there is a separate transceiver chip attached to port 1 which is placed
>>>>> in OMAP_EHCI_PORT_MODE_PHY).
>>>
>>>> Which PHY is this (vendor/model)?
>>>
>>> Hi Igor,
>>> it is the SMSC USB3322
>>>
>>> http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
>>>
>>>
>>> BTW I subsequently discovered that keeping USBHOST out off off_mode only
>>> sometimes avoid the problem, not always. So there are probably multiple
>>> issues :-(
>>
>> Are you sure that you don't have glitch on power, reset pin during suspend?
>>
>
> No, I don't really have the equipment to measure such things.
> But is it likely? Would enabling off_mode make it more likely?
I don't know the reason of the off_mode problem :(
> Can you suggest some way I could test the hypothesis?
I had the same problem on a rugged mobile phone, so it is just experience
Check the modem power and reset gpio too, but if you don't need to unblock it
with the pin after resume we know that modem is not the problem
Michael
>
> The power pin is connected to a 3v3 regulator which certainly should stay on
> the whole time and other things which depend on it keep working.
>
> The reset line is connected to GPIO174 which is configured:
>
> # cat /sys/kernel/debug/omap_mux/mcspi1_cs0
> name: mcspi1_cs0.gpio_174 (0x480021ce/0x19e = 0x011c), b ac2, t NA
> mode: OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE4
> signals: mcspi1_cs0 | sdmmc2_dat7 | NA | NA | gpio_174 | NA | NA | safe_mode
>
> The "PIN_INPUT" seems a bit odd, so I changed it to OMAP_PIN_OUTPUT but that
> didn't appear to make any difference.
>
> Thanks,
> NeilBrown
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-09 12:08 ` Michael Trimarchi
@ 2013-01-09 12:54 ` Igor Grinberg
2013-01-16 7:26 ` NeilBrown
0 siblings, 1 reply; 21+ messages in thread
From: Igor Grinberg @ 2013-01-09 12:54 UTC (permalink / raw)
To: Michael Trimarchi; +Cc: NeilBrown, linux-omap
On 01/09/13 14:08, Michael Trimarchi wrote:
> Hi Neil
>
> I forget to answer to your questions
>
> On 01/09/2013 12:34 PM, NeilBrown wrote:
>> On Wed, 09 Jan 2013 11:24:09 +0100 Michael Trimarchi
>> <michael@amarulasolutions.com> wrote:
>>
>>> Hi Neil
>>>
>>> On 01/09/2013 11:19 AM, NeilBrown wrote:
>>>> On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
>>>> wrote:
>>>>
>>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>>> Hash: SHA1
>>>>
>>>>> Hi Neil,
>>>>
>>>>> On 01/09/13 00:29, NeilBrown wrote:
>>>>>>
>>>>>> Hi,
>>>>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
>>>>>>
>>>>>> My current stumbling block is USB. The "Option" GSM module is attached via
>>>>>> USB (there is a separate transceiver chip attached to port 1 which is placed
>>>>>> in OMAP_EHCI_PORT_MODE_PHY).
>>>>
>>>>> Which PHY is this (vendor/model)?
>>>>
>>>> Hi Igor,
>>>> it is the SMSC USB3322
>>>>
>>>> http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
>>>>
>>>>
>>>> BTW I subsequently discovered that keeping USBHOST out off off_mode only
>>>> sometimes avoid the problem, not always. So there are probably multiple
>>>> issues :-(
We have the same PHY and it has some issues with the OMAP USB code.
First issue we experience is that if we reset the PHY more then once
w/o power cycling it, the PHY dies until next power cycle.
So, we stop providing the reset GPIO to the usb code and do the reset
in the board code.
>>>
>>> Are you sure that you don't have glitch on power, reset pin during suspend?
>>>
>>
>> No, I don't really have the equipment to measure such things.
>> But is it likely? Would enabling off_mode make it more likely?
>
> I don't know the reason of the off_mode problem :(
We have the equipment to check this and no - this is not the case.
>
>> Can you suggest some way I could test the hypothesis?
>
> I had the same problem on a rugged mobile phone, so it is just experience
> Check the modem power and reset gpio too, but if you don't need to unblock it
> with the pin after resume we know that modem is not the problem
I don't think modem is the problem...
We have plain USB connector ports that are dead after the resume from off-mode.
The good news are that we have the off-mode working on v3.6.1,
including the USB, but we had to do some horrible ugly hacking for this.
--
Regards,
Igor.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-09 12:54 ` Igor Grinberg
@ 2013-01-16 7:26 ` NeilBrown
2013-01-16 9:28 ` Igor Grinberg
0 siblings, 1 reply; 21+ messages in thread
From: NeilBrown @ 2013-01-16 7:26 UTC (permalink / raw)
To: Igor Grinberg; +Cc: Michael Trimarchi, linux-omap
[-- Attachment #1: Type: text/plain, Size: 3071 bytes --]
On Wed, 09 Jan 2013 14:54:00 +0200 Igor Grinberg <grinberg@compulab.co.il>
wrote:
> On 01/09/13 14:08, Michael Trimarchi wrote:
> > Hi Neil
> >
> > I forget to answer to your questions
> >
> > On 01/09/2013 12:34 PM, NeilBrown wrote:
> >> On Wed, 09 Jan 2013 11:24:09 +0100 Michael Trimarchi
> >> <michael@amarulasolutions.com> wrote:
> >>
> >>> Hi Neil
> >>>
> >>> On 01/09/2013 11:19 AM, NeilBrown wrote:
> >>>> On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
> >>>> wrote:
> >>>>
> >>>>> -----BEGIN PGP SIGNED MESSAGE-----
> >>>>> Hash: SHA1
> >>>>
> >>>>> Hi Neil,
> >>>>
> >>>>> On 01/09/13 00:29, NeilBrown wrote:
> >>>>>>
> >>>>>> Hi,
> >>>>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
> >>>>>>
> >>>>>> My current stumbling block is USB. The "Option" GSM module is attached via
> >>>>>> USB (there is a separate transceiver chip attached to port 1 which is placed
> >>>>>> in OMAP_EHCI_PORT_MODE_PHY).
> >>>>
> >>>>> Which PHY is this (vendor/model)?
> >>>>
> >>>> Hi Igor,
> >>>> it is the SMSC USB3322
> >>>>
> >>>> http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
> >>>>
> >>>>
> >>>> BTW I subsequently discovered that keeping USBHOST out off off_mode only
> >>>> sometimes avoid the problem, not always. So there are probably multiple
> >>>> issues :-(
>
> We have the same PHY and it has some issues with the OMAP USB code.
> First issue we experience is that if we reset the PHY more then once
> w/o power cycling it, the PHY dies until next power cycle.
> So, we stop providing the reset GPIO to the usb code and do the reset
> in the board code.
I've tried various change w.r.t the resetting and I cannot fault it.
Resetting or not resetting neither causes a problem while the USB is
otherwise working, not fixed the USB while it is otherwise failing.
So I don't think this is my problem - thanks.
>
> >>>
> >>> Are you sure that you don't have glitch on power, reset pin during suspend?
> >>>
> >>
> >> No, I don't really have the equipment to measure such things.
> >> But is it likely? Would enabling off_mode make it more likely?
> >
> > I don't know the reason of the off_mode problem :(
>
> We have the equipment to check this and no - this is not the case.
>
> >
> >> Can you suggest some way I could test the hypothesis?
> >
> > I had the same problem on a rugged mobile phone, so it is just experience
> > Check the modem power and reset gpio too, but if you don't need to unblock it
> > with the pin after resume we know that modem is not the problem
>
> I don't think modem is the problem...
> We have plain USB connector ports that are dead after the resume from off-mode.
>
> The good news are that we have the off-mode working on v3.6.1,
> including the USB, but we had to do some horrible ugly hacking for this.
>
I assume this means "some patches on top of 3.6.1" ??
Care to share your code? Even horribly ugly hacks can be educational.
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-09 11:42 ` Michael Trimarchi
@ 2013-01-16 7:28 ` NeilBrown
0 siblings, 0 replies; 21+ messages in thread
From: NeilBrown @ 2013-01-16 7:28 UTC (permalink / raw)
To: Michael Trimarchi; +Cc: Igor Grinberg, linux-omap
[-- Attachment #1: Type: text/plain, Size: 2616 bytes --]
On Wed, 09 Jan 2013 12:42:43 +0100 Michael Trimarchi
<michael@amarulasolutions.com> wrote:
> On 01/09/2013 12:34 PM, NeilBrown wrote:
> > On Wed, 09 Jan 2013 11:24:09 +0100 Michael Trimarchi
> > <michael@amarulasolutions.com> wrote:
> >
> >> Hi Neil
> >>
> >> On 01/09/2013 11:19 AM, NeilBrown wrote:
> >>> On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
> >>> wrote:
> >>>
> >>>> -----BEGIN PGP SIGNED MESSAGE-----
> >>>> Hash: SHA1
> >>>
> >>>> Hi Neil,
> >>>
> >>>> On 01/09/13 00:29, NeilBrown wrote:
> >>>>>
> >>>>> Hi,
> >>>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
> >>>>>
> >>>>> My current stumbling block is USB. The "Option" GSM module is attached via
> >>>>> USB (there is a separate transceiver chip attached to port 1 which is placed
> >>>>> in OMAP_EHCI_PORT_MODE_PHY).
> >>>
> >>>> Which PHY is this (vendor/model)?
> >>>
> >>> Hi Igor,
> >>> it is the SMSC USB3322
> >>>
> >>> http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
> >>>
> >>>
> >>> BTW I subsequently discovered that keeping USBHOST out off off_mode only
> >>> sometimes avoid the problem, not always. So there are probably multiple
> >>> issues :-(
> >>
> >> Are you sure that you don't have glitch on power, reset pin during suspend?
> >>
> >
> > No, I don't really have the equipment to measure such things.
> > But is it likely? Would enabling off_mode make it more likely?
> > Can you suggest some way I could test the hypothesis?
> >
> > The power pin is connected to a 3v3 regulator which certainly should stay on
> > the whole time and other things which depend on it keep working.
> >
> > The reset line is connected to GPIO174 which is configured:
> >
> > # cat /sys/kernel/debug/omap_mux/mcspi1_cs0
> > name: mcspi1_cs0.gpio_174 (0x480021ce/0x19e = 0x011c), b ac2, t NA
> > mode: OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE4
> > signals: mcspi1_cs0 | sdmmc2_dat7 | NA | NA | gpio_174 | NA | NA | safe_mode
> >
> > The "PIN_INPUT" seems a bit odd, so I changed it to OMAP_PIN_OUTPUT but that
> > didn't appear to make any difference.
> >
>
> Can you try to add this OMAP_PIN_OFF_OUTPUT_HIGH or LOW? It's suppose to be the off_mode status of the pin.
> Is it correct?
>
You only set OMAP_PIN_OFF_OUTPUT_HIGH etc if you want the status in
offmode to be different to what is was before off mode.
In the normal case without any of these bits set, the current value is
latched when output in entered and it remains like that that until you
leave off_mode.
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-16 7:26 ` NeilBrown
@ 2013-01-16 9:28 ` Igor Grinberg
2013-01-16 10:19 ` NeilBrown
0 siblings, 1 reply; 21+ messages in thread
From: Igor Grinberg @ 2013-01-16 9:28 UTC (permalink / raw)
To: NeilBrown; +Cc: Michael Trimarchi, linux-omap
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 01/16/13 09:26, NeilBrown wrote:
> On Wed, 09 Jan 2013 14:54:00 +0200 Igor Grinberg <grinberg@compulab.co.il>
> wrote:
>
>> On 01/09/13 14:08, Michael Trimarchi wrote:
>>> Hi Neil
>>>
>>> I forget to answer to your questions
>>>
>>> On 01/09/2013 12:34 PM, NeilBrown wrote:
>>>> On Wed, 09 Jan 2013 11:24:09 +0100 Michael Trimarchi
>>>> <michael@amarulasolutions.com> wrote:
>>>>
>>>>> Hi Neil
>>>>>
>>>>> On 01/09/2013 11:19 AM, NeilBrown wrote:
>>>>>> On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
>>>>>> wrote:
>>>>>>
>>>>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>>>>> Hash: SHA1
>>>>>>
>>>>>>> Hi Neil,
>>>>>>
>>>>>>> On 01/09/13 00:29, NeilBrown wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
>>>>>>>>
>>>>>>>> My current stumbling block is USB. The "Option" GSM module is attached via
>>>>>>>> USB (there is a separate transceiver chip attached to port 1 which is placed
>>>>>>>> in OMAP_EHCI_PORT_MODE_PHY).
>>>>>>
>>>>>>> Which PHY is this (vendor/model)?
>>>>>>
>>>>>> Hi Igor,
>>>>>> it is the SMSC USB3322
>>>>>>
>>>>>> http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
>>>>>>
>>>>>>
>>>>>> BTW I subsequently discovered that keeping USBHOST out off off_mode only
>>>>>> sometimes avoid the problem, not always. So there are probably multiple
>>>>>> issues :-(
>>
>> We have the same PHY and it has some issues with the OMAP USB code.
>> First issue we experience is that if we reset the PHY more then once
>> w/o power cycling it, the PHY dies until next power cycle.
>> So, we stop providing the reset GPIO to the usb code and do the reset
>> in the board code.
>
> I've tried various change w.r.t the resetting and I cannot fault it.
> Resetting or not resetting neither causes a problem while the USB is
> otherwise working, not fixed the USB while it is otherwise failing.
> So I don't think this is my problem - thanks.
>
>>
>>>>>
>>>>> Are you sure that you don't have glitch on power, reset pin during suspend?
>>>>>
>>>>
>>>> No, I don't really have the equipment to measure such things.
>>>> But is it likely? Would enabling off_mode make it more likely?
>>>
>>> I don't know the reason of the off_mode problem :(
>>
>> We have the equipment to check this and no - this is not the case.
>>
>>>
>>>> Can you suggest some way I could test the hypothesis?
>>>
>>> I had the same problem on a rugged mobile phone, so it is just experience
>>> Check the modem power and reset gpio too, but if you don't need to unblock it
>>> with the pin after resume we know that modem is not the problem
>>
>> I don't think modem is the problem...
>> We have plain USB connector ports that are dead after the resume from off-mode.
>>
>> The good news are that we have the off-mode working on v3.6.1,
>> including the USB, but we had to do some horrible ugly hacking for this.
>>
>
> I assume this means "some patches on top of 3.6.1" ??
> Care to share your code? Even horribly ugly hacks can be educational.
We are not ready to share these patches (this will happen eventually
after some work is finished), but I can explain what they do...
We split the ehci_run function to separate the debugfs and sysfs stuff from
other initializations, so we can run the new version without the debugfs and
sysfs stuff multiple times.
Then we implement the suspend/resume ehci callbacks:
on suspend, assert phy reset,
on resume, deassert phy reset, write EHCI_INSNREG04_DISABLE_UNSUSPEND to
EHCI_INSNREG04, and call the new ehci_run() function.
That does the job for USB host to resume from off mode.
- --
Regards,
Igor.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJQ9nKiAAoJEBDE8YO64Efa7U4QAKFXRyyNR5Q7jjwVG6UwITWq
6kJyNXJKQTqn6GLEV7xJmT4SZAtxq+dRDl/XE9dcXFK3RTebttXxyVz1X0vXZQud
h6QLenH8jHczNubfn6CTLI38PKprl1F2zpZtjKpHfNmD5cLWzJ1EIoTH19ENsJ4v
zV3KI3RgiFuq02vxOULtp9gP/x0WZSHwBEGm/ToqqsEaX7wAJc2BDFOSS8NpSGbb
VLPFA1doMrFOYkL+oMS2IVudM0wEYCBGhGxMi/Y++RY1omlonhEGCoVxaxzGoHrk
H/ZpxFheIGBKwo+VX1eSgW9oQZyzbPZttyEWXXNCRh/6oejXCBSS3zkKrWrctmVD
ONu1gzoaC9p/c1n2GDioIfxC41dPKdjCETMbTi9rR5shc12ZmwtrgUOU80mpzWj3
6fY+TRW4x8qYbsFL89T6TWGpDz7JrBdtdJiBD/TPtJW05ikn9DTL5/GNVjeeoRk0
5DJ06pHh+rQFKThEvoDdLAH3PZdtDVSdXnAg+gF4D7/BMZ14TLHmW2l471I95S2I
eKxZxIwFa2IscTbGKhTlrdPF4UShEvLuFgO6NCb1ea1FT7m3ih8rwA5ObI4676DG
Y5kokqi9dpzMB/6T/SDk/gySTg9WUDXFlhS6x/b89f1xC71GzGTJkkqqH4u6KfX8
GcqI3wEFlqpG4FM39XAw
=nynZ
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-08 22:29 Help wanted with USB and OMAP3 off_mode NeilBrown
2013-01-09 10:00 ` Igor Grinberg
@ 2013-01-16 10:00 ` Roger Quadros
2013-01-16 10:27 ` NeilBrown
1 sibling, 1 reply; 21+ messages in thread
From: Roger Quadros @ 2013-01-16 10:00 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-omap
On 01/09/2013 12:29 AM, NeilBrown wrote:
>
> Hi,
> I'm trying to get off_mode working reliably on my gta04 mobile phone.
>
> My current stumbling block is USB. The "Option" GSM module is attached via
> USB (there is a separate transceiver chip attached to port 1 which is placed
> in OMAP_EHCI_PORT_MODE_PHY).
>
> After a suspend/resume cycle with off_mode enabled the GSM module disappears.
> i.e. 'lsusb' doesn't see it any more and the various ttyHSxx devices don't
> exist.
> Without off mode, the modem always appears after resume.
>
> I discovered that the registers set by:
>
> drivers/mfd/omap-usb-host.c
>
> are not maintained across as suspend/resume so I added the following patch
> (which I can make a formal submission of if it looks right to others), but
> that didn't help (or didn't help enough).
>
> If I
>
> echo 1 > /sys/kernel/debug/pm_debug/usbhost_pwrdm/suspend
>
> thus keeping just the USBHOST power domain out of off_mode, the GSM module
> doesn't disappear. So it seems that some context in the usbhost domain is
> not being save and restored.
>
> This is as far as I can get. Can someone suggest where I should look to find
> out what is not being saved/restored properly, and how to go about saving and
> restoring?
You need to ensure that USBHOST/TLL context is saved as per the Save and
Restore sequence see section "USBHOST/USBTLL Save-and-Restore
Management" in the OMAP Technical Reference Manual.
The basic idea there is that software does the context saving into SAR
RAM before entering OFF mode and hardware automatically restores the
context after coming out of OFF mode.
But that alone is not enough for USB host to work. We need to make sure
we have covered all the erratas. There are a number of them which are
not covered yet in mainline.
USB remote wakeup is another challenge with OMAP USB host (while in OFF
mode). The usual workaround here is to use a GPIO as a wakeup line from
the modem.
regards,
-roger
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-16 9:28 ` Igor Grinberg
@ 2013-01-16 10:19 ` NeilBrown
2013-01-16 11:11 ` Igor Grinberg
0 siblings, 1 reply; 21+ messages in thread
From: NeilBrown @ 2013-01-16 10:19 UTC (permalink / raw)
To: Igor Grinberg; +Cc: Michael Trimarchi, linux-omap
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wed, 16 Jan 2013 11:28:02 +0200 Igor Grinberg <grinberg@compulab.co.il>
wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 01/16/13 09:26, NeilBrown wrote:
> > On Wed, 09 Jan 2013 14:54:00 +0200 Igor Grinberg <grinberg@compulab.co.il>
> > wrote:
> >
> >> On 01/09/13 14:08, Michael Trimarchi wrote:
> >>> Hi Neil
> >>>
> >>> I forget to answer to your questions
> >>>
> >>> On 01/09/2013 12:34 PM, NeilBrown wrote:
> >>>> On Wed, 09 Jan 2013 11:24:09 +0100 Michael Trimarchi
> >>>> <michael@amarulasolutions.com> wrote:
> >>>>
> >>>>> Hi Neil
> >>>>>
> >>>>> On 01/09/2013 11:19 AM, NeilBrown wrote:
> >>>>>> On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
> >>>>>> wrote:
> >>>>>>
> >>>>>>> -----BEGIN PGP SIGNED MESSAGE-----
> >>>>>>> Hash: SHA1
> >>>>>>
> >>>>>>> Hi Neil,
> >>>>>>
> >>>>>>> On 01/09/13 00:29, NeilBrown wrote:
> >>>>>>>>
> >>>>>>>> Hi,
> >>>>>>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
> >>>>>>>>
> >>>>>>>> My current stumbling block is USB. The "Option" GSM module is attached via
> >>>>>>>> USB (there is a separate transceiver chip attached to port 1 which is placed
> >>>>>>>> in OMAP_EHCI_PORT_MODE_PHY).
> >>>>>>
> >>>>>>> Which PHY is this (vendor/model)?
> >>>>>>
> >>>>>> Hi Igor,
> >>>>>> it is the SMSC USB3322
> >>>>>>
> >>>>>> http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
> >>>>>>
> >>>>>>
> >>>>>> BTW I subsequently discovered that keeping USBHOST out off off_mode only
> >>>>>> sometimes avoid the problem, not always. So there are probably multiple
> >>>>>> issues :-(
> >>
> >> We have the same PHY and it has some issues with the OMAP USB code.
> >> First issue we experience is that if we reset the PHY more then once
> >> w/o power cycling it, the PHY dies until next power cycle.
> >> So, we stop providing the reset GPIO to the usb code and do the reset
> >> in the board code.
> >
> > I've tried various change w.r.t the resetting and I cannot fault it.
> > Resetting or not resetting neither causes a problem while the USB is
> > otherwise working, not fixed the USB while it is otherwise failing.
> > So I don't think this is my problem - thanks.
> >
> >>
> >>>>>
> >>>>> Are you sure that you don't have glitch on power, reset pin during suspend?
> >>>>>
> >>>>
> >>>> No, I don't really have the equipment to measure such things.
> >>>> But is it likely? Would enabling off_mode make it more likely?
> >>>
> >>> I don't know the reason of the off_mode problem :(
> >>
> >> We have the equipment to check this and no - this is not the case.
> >>
> >>>
> >>>> Can you suggest some way I could test the hypothesis?
> >>>
> >>> I had the same problem on a rugged mobile phone, so it is just experience
> >>> Check the modem power and reset gpio too, but if you don't need to unblock it
> >>> with the pin after resume we know that modem is not the problem
> >>
> >> I don't think modem is the problem...
> >> We have plain USB connector ports that are dead after the resume from off-mode.
> >>
> >> The good news are that we have the off-mode working on v3.6.1,
> >> including the USB, but we had to do some horrible ugly hacking for this.
> >>
> >
> > I assume this means "some patches on top of 3.6.1" ??
> > Care to share your code? Even horribly ugly hacks can be educational.
>
> We are not ready to share these patches (this will happen eventually
> after some work is finished), but I can explain what they do...
>
> We split the ehci_run function to separate the debugfs and sysfs stuff from
> other initializations, so we can run the new version without the debugfs and
> sysfs stuff multiple times.
>
> Then we implement the suspend/resume ehci callbacks:
> on suspend, assert phy reset,
> on resume, deassert phy reset, write EHCI_INSNREG04_DISABLE_UNSUSPEND to
> EHCI_INSNREG04, and call the new ehci_run() function.
>
> That does the job for USB host to resume from off mode.
Interesting thanks. That makes a certain amount of sense.
However I tried compiling ehci-hcd as a module and unload/reloading it which
should have a similar net effect to what you did, but it didn't make any
difference - device disappears on resume.
I also tried restoring the correct value to EHCI_INSNREG04 and
EHCI_INSNREG05_ULPI which are the only registers written by
ehci-omap.c, and that didn't help either.
The only thing I've found that works is keeping 'core' out of off-mode.
BTW I discovered that arch/arm/mach-omap2/powerdomains3xxx_data.c
comments out the setting of
.flags = PWRDM_HAS_HDWR_SAR,
for the usbhost powerdomain - that is why I had to leave it in retention.
If I uncomment that setting, the it is safe for USBHOST to go to off-mode,
just not for CORE.
I'll keep exploring.
NeilBrown
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQIVAwUBUPZ+rznsnt1WYoG5AQLYug//T+J3L11fwVq8JHfiPJVfbEfrAdx96+Id
OD+qpwWUarWfpxcgthuRmkrxxUSXxI8sBr0Y0wKWRw4biFxtzcY3qk5xnlUMCfFx
BuqrevVZ6bQZ3JDORv1OfeRwZXOheW0ocJ50s1aV8QTTZvrTKo0TNv7G2uLYIssK
vafA1WOTQPWAxMd7gx8qjpbT/HPi2kYaLlEJ1/kXYeylGboncUyus42j1q1qnGqy
xN6031rpwba4CXtXysx830/uPrnr3LPCh15HUUpxHsYB8rey+60F0ClbT72ZqajJ
w1Cy1GR+UDAM7DP3wt1z87H6/IHRXpJLVodUQ5LIZezbWYF1CbAcyJoSyrjZhefe
yQnGrFaxHS9oNwaZpDOccxGCPOt8uY5DBRMtEpQKt+3LR0lFJzeICMpfENyMg+3a
mU+fzVfGs0puyg/Imcds5yrpmjtGDzuF0yIZ2pIW8pcWjJwbYVzaw9TfzYSSALv1
VaJp7DItUw9JreBtyb7W4P3KvLjH1GAHjPSFBU4iWhXF6JmQnG6ntDeH+eKNpO2F
0BcaxhP8Ll1kWif+cf0gIVBMBTjbBaWYkD8zPpXAnEI+FHNdxT5knbohMDPVjR1A
W5rYHvzpa04N/DQSVJVq7zBbAs0QkYGLtC03b9ebk7Y9z7HS/KdzZafqW0Gr50j7
DqBKnGA/0GE=
=srfM
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-16 10:00 ` Roger Quadros
@ 2013-01-16 10:27 ` NeilBrown
2013-01-16 10:57 ` Roger Quadros
0 siblings, 1 reply; 21+ messages in thread
From: NeilBrown @ 2013-01-16 10:27 UTC (permalink / raw)
To: Roger Quadros; +Cc: linux-omap
[-- Attachment #1: Type: text/plain, Size: 3569 bytes --]
On Wed, 16 Jan 2013 12:00:48 +0200 Roger Quadros <rogerq@ti.com> wrote:
> On 01/09/2013 12:29 AM, NeilBrown wrote:
> >
> > Hi,
> > I'm trying to get off_mode working reliably on my gta04 mobile phone.
> >
> > My current stumbling block is USB. The "Option" GSM module is attached via
> > USB (there is a separate transceiver chip attached to port 1 which is placed
> > in OMAP_EHCI_PORT_MODE_PHY).
> >
> > After a suspend/resume cycle with off_mode enabled the GSM module disappears.
> > i.e. 'lsusb' doesn't see it any more and the various ttyHSxx devices don't
> > exist.
> > Without off mode, the modem always appears after resume.
> >
> > I discovered that the registers set by:
> >
> > drivers/mfd/omap-usb-host.c
> >
> > are not maintained across as suspend/resume so I added the following patch
> > (which I can make a formal submission of if it looks right to others), but
> > that didn't help (or didn't help enough).
> >
> > If I
> >
> > echo 1 > /sys/kernel/debug/pm_debug/usbhost_pwrdm/suspend
> >
> > thus keeping just the USBHOST power domain out of off_mode, the GSM module
> > doesn't disappear. So it seems that some context in the usbhost domain is
> > not being save and restored.
> >
> > This is as far as I can get. Can someone suggest where I should look to find
> > out what is not being saved/restored properly, and how to go about saving and
> > restoring?
>
> You need to ensure that USBHOST/TLL context is saved as per the Save and
> Restore sequence see section "USBHOST/USBTLL Save-and-Restore
> Management" in the OMAP Technical Reference Manual.
>
> The basic idea there is that software does the context saving into SAR
> RAM before entering OFF mode and hardware automatically restores the
> context after coming out of OFF mode.
Is it? The way I read the doco, the hardware both saves to SAR RAM, and
restores from SAR RAM.
Section 22.2.4.1.6 Save and Restore
of my copy of the TRM says:
> The save-and-restore (SAR) mechanism can extract the hardware context of the high-speed USB host
> controller (after all USB activity has been suspended) before switching off (=save), save it to an external
> always-on memory, and reinject it later after the module has been switched on again and reset (=restore)
> seamlessly for the USB. Part of that context is composed of the register fields described in the current
> chapter. The rest of the context is composed of the "buried" flip-flops and memories (not accessible by
> software) like finite state-machine (FSM) states, buffer contents, and miscellaneous random logic bits.
which strongly suggests that it is all handled by hardware. Of course there
are other registers that aren't covered by the SAR - we need to identify
those and make sure they are saved and restored. I've found a few registers
that aren't being restored, but restoring them hasn't made a visible
difference yet.
Am I missing something?
>
> But that alone is not enough for USB host to work. We need to make sure
> we have covered all the erratas. There are a number of them which are
> not covered yet in mainline.
Is there a list somewhere?
>
> USB remote wakeup is another challenge with OMAP USB host (while in OFF
> mode). The usual workaround here is to use a GPIO as a wakeup line from
> the modem.
Yes, this is not a problem for my device. There is a GPIO line which signals
and incoming SMS or Call and it successfully wakes the device.
>
> regards,
> -roger
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-16 10:27 ` NeilBrown
@ 2013-01-16 10:57 ` Roger Quadros
2013-01-17 11:01 ` NeilBrown
0 siblings, 1 reply; 21+ messages in thread
From: Roger Quadros @ 2013-01-16 10:57 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-omap
On 01/16/2013 12:27 PM, NeilBrown wrote:
> On Wed, 16 Jan 2013 12:00:48 +0200 Roger Quadros <rogerq@ti.com> wrote:
>
>> On 01/09/2013 12:29 AM, NeilBrown wrote:
>>>
>>> Hi,
>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
>>>
>>> My current stumbling block is USB. The "Option" GSM module is attached via
>>> USB (there is a separate transceiver chip attached to port 1 which is placed
>>> in OMAP_EHCI_PORT_MODE_PHY).
>>>
>>> After a suspend/resume cycle with off_mode enabled the GSM module disappears.
>>> i.e. 'lsusb' doesn't see it any more and the various ttyHSxx devices don't
>>> exist.
>>> Without off mode, the modem always appears after resume.
>>>
>>> I discovered that the registers set by:
>>>
>>> drivers/mfd/omap-usb-host.c
>>>
>>> are not maintained across as suspend/resume so I added the following patch
>>> (which I can make a formal submission of if it looks right to others), but
>>> that didn't help (or didn't help enough).
>>>
>>> If I
>>>
>>> echo 1 > /sys/kernel/debug/pm_debug/usbhost_pwrdm/suspend
>>>
>>> thus keeping just the USBHOST power domain out of off_mode, the GSM module
>>> doesn't disappear. So it seems that some context in the usbhost domain is
>>> not being save and restored.
>>>
>>> This is as far as I can get. Can someone suggest where I should look to find
>>> out what is not being saved/restored properly, and how to go about saving and
>>> restoring?
>>
>> You need to ensure that USBHOST/TLL context is saved as per the Save and
>> Restore sequence see section "USBHOST/USBTLL Save-and-Restore
>> Management" in the OMAP Technical Reference Manual.
>>
>> The basic idea there is that software does the context saving into SAR
>> RAM before entering OFF mode and hardware automatically restores the
>> context after coming out of OFF mode.
>
> Is it? The way I read the doco, the hardware both saves to SAR RAM, and
> restores from SAR RAM.
> Section 22.2.4.1.6 Save and Restore
> of my copy of the TRM says:
>
>> The save-and-restore (SAR) mechanism can extract the hardware context of the high-speed USB host
>> controller (after all USB activity has been suspended) before switching off (=save), save it to an external
>> always-on memory, and reinject it later after the module has been switched on again and reset (=restore)
>> seamlessly for the USB. Part of that context is composed of the register fields described in the current
>> chapter. The rest of the context is composed of the "buried" flip-flops and memories (not accessible by
>> software) like finite state-machine (FSM) states, buffer contents, and miscellaneous random logic bits.
>
> which strongly suggests that it is all handled by hardware. Of course there
> are other registers that aren't covered by the SAR - we need to identify
> those and make sure they are saved and restored. I've found a few registers
> that aren't being restored, but restoring them hasn't made a visible
> difference yet.
Yes, you are right. I mixed it up with OMAP4 behaviour, sorry.
But still, software needs to ensure that the USBHOST and CORE power
domain's SAVEANDRESTORE bit are set to ensure that SAR works.
see section "3.5.4.6 USBHOST/USBTLL Save-and-Restore Management"
This seems to be done by the powerdomain code based on the
PWRDM_HAS_HDWR_SAR flag. However, this flag is disabled for USBHOST
powerdomain with the following comment.
> Both USBHOST and USBTLL support a save-and-restore mechanism. When the device enters into off
> mode (that is, all power domains, except the WKUP power domain, are off), the user may want to save
> the USBHOST context and restore it when exiting off mode. The save-and-restore mechanism for the HS
> USB Host is enabled by setting the PRCM.PM_PWSTCTRL_USBHOST[4] SAVEANDRESTORE bit; for
> the USBTLL, it is configured by the PRCM.PM_PWSTCTRL_CORE[4] SAVEANDRESTORE bit. The save
> mechanism is initiated as the power domain transitions from active to off state (or to OSWR state for the
> USBTLL), whereas the restore mechanism is initiated as the power domain transitions from off to active
> power state.
Can you try with the flag enabled?
>
> Am I missing something?
>
>>
>> But that alone is not enough for USB host to work. We need to make sure
>> we have covered all the erratas. There are a number of them which are
>> not covered yet in mainline.
>
> Is there a list somewhere?
>
They should be mentioned in the Silicon Errata.
http://www.ti.com/product/omap3530
regards,
-roger
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-16 10:19 ` NeilBrown
@ 2013-01-16 11:11 ` Igor Grinberg
2013-01-17 0:22 ` NeilBrown
0 siblings, 1 reply; 21+ messages in thread
From: Igor Grinberg @ 2013-01-16 11:11 UTC (permalink / raw)
To: NeilBrown; +Cc: Michael Trimarchi, linux-omap
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 01/16/13 12:19, NeilBrown wrote:
> On Wed, 16 Jan 2013 11:28:02 +0200 Igor Grinberg <grinberg@compulab.co.il>
> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>
>> On 01/16/13 09:26, NeilBrown wrote:
>>> On Wed, 09 Jan 2013 14:54:00 +0200 Igor Grinberg <grinberg@compulab.co.il>
>>> wrote:
>>>
>>>> On 01/09/13 14:08, Michael Trimarchi wrote:
>>>>> Hi Neil
>>>>>
>>>>> I forget to answer to your questions
>>>>>
>>>>> On 01/09/2013 12:34 PM, NeilBrown wrote:
>>>>>> On Wed, 09 Jan 2013 11:24:09 +0100 Michael Trimarchi
>>>>>> <michael@amarulasolutions.com> wrote:
>>>>>>
>>>>>>> Hi Neil
>>>>>>>
>>>>>>> On 01/09/2013 11:19 AM, NeilBrown wrote:
>>>>>>>> On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>>>>>>> Hash: SHA1
>>>>>>>>
>>>>>>>>> Hi Neil,
>>>>>>>>
>>>>>>>>> On 01/09/13 00:29, NeilBrown wrote:
>>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
>>>>>>>>>>
>>>>>>>>>> My current stumbling block is USB. The "Option" GSM module is attached via
>>>>>>>>>> USB (there is a separate transceiver chip attached to port 1 which is placed
>>>>>>>>>> in OMAP_EHCI_PORT_MODE_PHY).
>>>>>>>>
>>>>>>>>> Which PHY is this (vendor/model)?
>>>>>>>>
>>>>>>>> Hi Igor,
>>>>>>>> it is the SMSC USB3322
>>>>>>>>
>>>>>>>> http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
>>>>>>>>
>>>>>>>>
>>>>>>>> BTW I subsequently discovered that keeping USBHOST out off off_mode only
>>>>>>>> sometimes avoid the problem, not always. So there are probably multiple
>>>>>>>> issues :-(
>>>>
>>>> We have the same PHY and it has some issues with the OMAP USB code.
>>>> First issue we experience is that if we reset the PHY more then once
>>>> w/o power cycling it, the PHY dies until next power cycle.
>>>> So, we stop providing the reset GPIO to the usb code and do the reset
>>>> in the board code.
>>>
>>> I've tried various change w.r.t the resetting and I cannot fault it.
>>> Resetting or not resetting neither causes a problem while the USB is
>>> otherwise working, not fixed the USB while it is otherwise failing.
>>> So I don't think this is my problem - thanks.
>>>
>>>>
>>>>>>>
>>>>>>> Are you sure that you don't have glitch on power, reset pin during suspend?
>>>>>>>
>>>>>>
>>>>>> No, I don't really have the equipment to measure such things.
>>>>>> But is it likely? Would enabling off_mode make it more likely?
>>>>>
>>>>> I don't know the reason of the off_mode problem :(
>>>>
>>>> We have the equipment to check this and no - this is not the case.
>>>>
>>>>>
>>>>>> Can you suggest some way I could test the hypothesis?
>>>>>
>>>>> I had the same problem on a rugged mobile phone, so it is just experience
>>>>> Check the modem power and reset gpio too, but if you don't need to unblock it
>>>>> with the pin after resume we know that modem is not the problem
>>>>
>>>> I don't think modem is the problem...
>>>> We have plain USB connector ports that are dead after the resume from off-mode.
>>>>
>>>> The good news are that we have the off-mode working on v3.6.1,
>>>> including the USB, but we had to do some horrible ugly hacking for this.
>>>>
>>>
>>> I assume this means "some patches on top of 3.6.1" ??
>>> Care to share your code? Even horribly ugly hacks can be educational.
>
>> We are not ready to share these patches (this will happen eventually
>> after some work is finished), but I can explain what they do...
>
>> We split the ehci_run function to separate the debugfs and sysfs stuff from
>> other initializations, so we can run the new version without the debugfs and
>> sysfs stuff multiple times.
>
>> Then we implement the suspend/resume ehci callbacks:
>> on suspend, assert phy reset,
>> on resume, deassert phy reset, write EHCI_INSNREG04_DISABLE_UNSUSPEND to
>> EHCI_INSNREG04, and call the new ehci_run() function.
>
>> That does the job for USB host to resume from off mode.
>
> Interesting thanks. That makes a certain amount of sense.
>
> However I tried compiling ehci-hcd as a module and unload/reloading it which
> should have a similar net effect to what you did, but it didn't make any
> difference - device disappears on resume.
Yes it does for cm-t3730, in fact, that is what we have started from...
>
> I also tried restoring the correct value to EHCI_INSNREG04 and
> EHCI_INSNREG05_ULPI which are the only registers written by
> ehci-omap.c, and that didn't help either.
>
> The only thing I've found that works is keeping 'core' out of off-mode.
Ah, one more thing, we ensure that phy is completely powered off through
the TPS power scripts, otherwise, it does not work...
>
> BTW I discovered that arch/arm/mach-omap2/powerdomains3xxx_data.c
> comments out the setting of
> .flags = PWRDM_HAS_HDWR_SAR,
> for the usbhost powerdomain - that is why I had to leave it in retention.
> If I uncomment that setting, the it is safe for USBHOST to go to off-mode,
> just not for CORE.
>
> I'll keep exploring.
>
> NeilBrown
> N?§²æìr¸?yúè?Øb²X¬¶Ç§vØ^?)Þº{.nÇ+?·¥?{±¢f©?{ayº\x1dÊ?Ú?ë,j\a¢f£¢·h??àz¹\x1e®w¥¢¸\f¢·¦j:+v?¨?wèjØm¶?ÿ¾\a«?êçzZ+?ù???Ý¢j"?ú!tml=
- --
Regards,
Igor.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJQ9oreAAoJEBDE8YO64EfaRasP/iUDBXhmPQtVm7ESB1DPopMc
b5dUWY1mwQGfNhdcPqApyPk5MPzHTAFfNiLTxJURUqN562gMl1+SR4Mr9cOX6ju4
ahlxyciOlb2KzsCTAUC9PPJVQSR2UbAPMZIA84B4pt6GOYF0OVHzFDickFhAg7Nu
dvnpMyE1gNTCISAi28lp6pLY5POcyo4HAeZaapPrl3G1GbivplKH+AqJLLeVoJzA
InebBUBe1lCDZ31RyY8uiTjjr8Qc+JDzSLybKkuijULwXualJDaJjRxvfG9cfoju
3v+/HvVdAJzqTN9cdQBJJ3VLAhpLZJHKvSlQ3K8IYLHaG5K4QJsrf6WZldRIPaAe
Ztv5EdKK3l2e4nbTP3oJmU56R2XREcKltw8e1XWNkpnN6sKn6sx8iuVPCeFlb/SA
snA1i9gkvQWRnKeW7At2Jiv3C3Xn9L+1fulYzTjk/mX+P4sKhigllV73naAeGnZZ
GOa7F1FeCq0L8d2CV36FWwXOvOqdyrkgCabA2GQrOHlIOjnOqhymc/pybGGly1Ph
arGUSdcFdl1rxcuzIYcBKgV8eF5E+wjnLMVubO/Bj9nrpbxVAeyAyF0qNY1RWmBx
oY5JJah2EM/AyPBKCSEY3PBugwAFLPV9uL69Bw0rJbxfT1uWBHVoby3Q5/dpWAJv
bt+zpdKaK5n3KYHqbPci
=qbkL
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-16 11:11 ` Igor Grinberg
@ 2013-01-17 0:22 ` NeilBrown
2013-01-17 9:24 ` NeilBrown
0 siblings, 1 reply; 21+ messages in thread
From: NeilBrown @ 2013-01-17 0:22 UTC (permalink / raw)
To: Igor Grinberg; +Cc: Michael Trimarchi, linux-omap
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wed, 16 Jan 2013 13:11:26 +0200 Igor Grinberg <grinberg@compulab.co.il>
wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 01/16/13 12:19, NeilBrown wrote:
> > On Wed, 16 Jan 2013 11:28:02 +0200 Igor Grinberg <grinberg@compulab.co.il>
> > wrote:
> >
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >
> >> On 01/16/13 09:26, NeilBrown wrote:
> >>> On Wed, 09 Jan 2013 14:54:00 +0200 Igor Grinberg <grinberg@compulab.co.il>
> >>> wrote:
> >>>
> >>>> On 01/09/13 14:08, Michael Trimarchi wrote:
> >>>>> Hi Neil
> >>>>>
> >>>>> I forget to answer to your questions
> >>>>>
> >>>>> On 01/09/2013 12:34 PM, NeilBrown wrote:
> >>>>>> On Wed, 09 Jan 2013 11:24:09 +0100 Michael Trimarchi
> >>>>>> <michael@amarulasolutions.com> wrote:
> >>>>>>
> >>>>>>> Hi Neil
> >>>>>>>
> >>>>>>> On 01/09/2013 11:19 AM, NeilBrown wrote:
> >>>>>>>> On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
> >>>>>>>> wrote:
> >>>>>>>>
> >>>>>>>>> -----BEGIN PGP SIGNED MESSAGE-----
> >>>>>>>>> Hash: SHA1
> >>>>>>>>
> >>>>>>>>> Hi Neil,
> >>>>>>>>
> >>>>>>>>> On 01/09/13 00:29, NeilBrown wrote:
> >>>>>>>>>>
> >>>>>>>>>> Hi,
> >>>>>>>>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
> >>>>>>>>>>
> >>>>>>>>>> My current stumbling block is USB. The "Option" GSM module is attached via
> >>>>>>>>>> USB (there is a separate transceiver chip attached to port 1 which is placed
> >>>>>>>>>> in OMAP_EHCI_PORT_MODE_PHY).
> >>>>>>>>
> >>>>>>>>> Which PHY is this (vendor/model)?
> >>>>>>>>
> >>>>>>>> Hi Igor,
> >>>>>>>> it is the SMSC USB3322
> >>>>>>>>
> >>>>>>>> http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> BTW I subsequently discovered that keeping USBHOST out off off_mode only
> >>>>>>>> sometimes avoid the problem, not always. So there are probably multiple
> >>>>>>>> issues :-(
> >>>>
> >>>> We have the same PHY and it has some issues with the OMAP USB code.
> >>>> First issue we experience is that if we reset the PHY more then once
> >>>> w/o power cycling it, the PHY dies until next power cycle.
> >>>> So, we stop providing the reset GPIO to the usb code and do the reset
> >>>> in the board code.
> >>>
> >>> I've tried various change w.r.t the resetting and I cannot fault it.
> >>> Resetting or not resetting neither causes a problem while the USB is
> >>> otherwise working, not fixed the USB while it is otherwise failing.
> >>> So I don't think this is my problem - thanks.
> >>>
> >>>>
> >>>>>>>
> >>>>>>> Are you sure that you don't have glitch on power, reset pin during suspend?
> >>>>>>>
> >>>>>>
> >>>>>> No, I don't really have the equipment to measure such things.
> >>>>>> But is it likely? Would enabling off_mode make it more likely?
> >>>>>
> >>>>> I don't know the reason of the off_mode problem :(
> >>>>
> >>>> We have the equipment to check this and no - this is not the case.
> >>>>
> >>>>>
> >>>>>> Can you suggest some way I could test the hypothesis?
> >>>>>
> >>>>> I had the same problem on a rugged mobile phone, so it is just experience
> >>>>> Check the modem power and reset gpio too, but if you don't need to unblock it
> >>>>> with the pin after resume we know that modem is not the problem
> >>>>
> >>>> I don't think modem is the problem...
> >>>> We have plain USB connector ports that are dead after the resume from off-mode.
> >>>>
> >>>> The good news are that we have the off-mode working on v3.6.1,
> >>>> including the USB, but we had to do some horrible ugly hacking for this.
> >>>>
> >>>
> >>> I assume this means "some patches on top of 3.6.1" ??
> >>> Care to share your code? Even horribly ugly hacks can be educational.
> >
> >> We are not ready to share these patches (this will happen eventually
> >> after some work is finished), but I can explain what they do...
> >
> >> We split the ehci_run function to separate the debugfs and sysfs stuff from
> >> other initializations, so we can run the new version without the debugfs and
> >> sysfs stuff multiple times.
> >
> >> Then we implement the suspend/resume ehci callbacks:
> >> on suspend, assert phy reset,
> >> on resume, deassert phy reset, write EHCI_INSNREG04_DISABLE_UNSUSPEND to
> >> EHCI_INSNREG04, and call the new ehci_run() function.
> >
> >> That does the job for USB host to resume from off mode.
> >
> > Interesting thanks. That makes a certain amount of sense.
> >
> > However I tried compiling ehci-hcd as a module and unload/reloading it which
> > should have a similar net effect to what you did, but it didn't make any
> > difference - device disappears on resume.
>
> Yes it does for cm-t3730, in fact, that is what we have started from...
>
> >
> > I also tried restoring the correct value to EHCI_INSNREG04 and
> > EHCI_INSNREG05_ULPI which are the only registers written by
> > ehci-omap.c, and that didn't help either.
> >
> > The only thing I've found that works is keeping 'core' out of off-mode.
>
> Ah, one more thing, we ensure that phy is completely powered off through
> the TPS power scripts, otherwise, it does not work...
>
Ahhh.... that does make a difference.
I turned off the 5V5 rail which powered the phy (and a few other things) and
now the usb-attached modem appears after resume. Very interesting.
I hadn't been doing this as I had been advised that the hardware wouldn't
like it. There are a few devices (including the USB PHY) which are supplied
by both a 1V8 rail and the 5V5 rail. Some of them are out-of-spec if the 1V8
is supplied, but the 5V5 isn't.
The 1V8 must remain on during suspend as it keep the RAM powered, so the 5V5
must as well. Awkward.
It is not entirely satisfactory for other reasons. It seems that with
off_mode fully working, we drop to off mode when CPUIDLE puts things to
sleep, and that removes the 5V5 too, which is bad. This disconnects the USB.
My current console log shows:
[ 2453.837402] usb 1-2: new high-speed USB device number 10 using ehci-omap
[ 2454.006256] usb 1-2: New USB device found, idVendor=0af0, idProduct=8800
[ 2454.015686] usb 1-2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[ 2454.025512] usb 1-2: Product: Globetrotter HSUPA Modem
[ 2454.031005] usb 1-2: Manufacturer: Option N.V.
[ 2455.355804] usb 1-2: USB disconnect, device number 10
[ 2459.829589] usb 1-2: new high-speed USB device number 11 using ehci-omap
[ 2459.997894] usb 1-2: New USB device found, idVendor=0af0, idProduct=8800
[ 2460.007385] usb 1-2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[ 2460.017242] usb 1-2: Product: Globetrotter HSUPA Modem
[ 2460.022644] usb 1-2: Manufacturer: Option N.V.
[ 2469.496490] usb 1-2: USB disconnect, device number 11
[ 2472.845245] usb 1-2: new high-speed USB device number 12 using ehci-omap
[ 2473.013946] usb 1-2: New USB device found, idVendor=0af0, idProduct=8800
[ 2473.023376] usb 1-2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[ 2473.033264] usb 1-2: Product: Globetrotter HSUPA Modem
[ 2473.038757] usb 1-2: Manufacturer: Option N.V.
[ 2474.528289] usb 1-2: USB disconnect, device number 12
[ 2478.829589] usb 1-2: new high-speed USB device number 13 using ehci-omap
[ 2478.998748] usb 1-2: New USB device found, idVendor=0af0, idProduct=8800
[ 2479.008209] usb 1-2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[ 2479.018005] usb 1-2: Product: Globetrotter HSUPA Modem
[ 2479.023498] usb 1-2: Manufacturer: Option N.V.
[ 2480.374694] usb 1-2: USB disconnect, device number 13
i.e. the modem disconnecting and reconnecting. every few seconds. The modem
eventually got upset and has entered a state where I cannot communicate with
it.
So - interesting and useful, but I don't have a complete solution yet.
Also, while this gets the internal USB working (to some extent) the external
usb (USB-OTG using the musb driver) is still broken. When CORE is only
allowed into retention mode, it works fine. When CORE goes to off-mode, I
lose the USB port. So that'll be another problem to solve.
Thanks again,
NeilBrown
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQIVAwUBUPdEXznsnt1WYoG5AQJ5qg/8DrSirSXfIT0U/IqyQyimdRS6w11JjuUa
xQnSl7be6Tr0buNM/xZ1ZfQ6fs47aOOnFYjAVLUjHUqVxXhUjDZLo5KxI0yoYi35
gzoGWTB4AS8Bx/V7dOHxBtOO0t/vUyxiTiAWhG7AFZZc6CM/Z4UzQvD4uyY+bQNj
2YmF112lMULtpfW5m56vsqxyf9sQn+Cr+1snnOx416wF2Vq5lNaZhVhqX+Oqz9o2
TvtSS2p3hntAQPBPl0VZ4DZAdiquSkq8LZTKKca0u85MHwHx1v4HvG5S9NqDkDfo
hIaQdaku5Xe7SgLoUrIb4a2ppWe8OwjcrB6MSDugzP0Y0gt/kq5uoe75/TVJ23Kw
ijjo/LwQNvT1G8ruHBg0evawX5Ttn4prfh1FQeyJkDWewXtVaonb7AV4E+RUc2qw
obhZ4rxor+sGy7Qj18RBMsWv+8n4/QPKw1RkUYrkSITDof3OYI3UcnFfT9hKVwhe
Uz2vFX/rBj3uVn+5uSR3flMtwgpey9RAAb5tMzqDtPPi+R8v6gUxOZkvBjje6hQc
YLcULiFxdPiFNTiWs7BkTO7nRxS5DIE5mtG/LmWoa73abAN2JjIfVIPwRwlS7xdB
on0MwUNIQmNL58seYS2JA2UavDP/Y/Lcnjos0b/BqxjXWrHTEdP6WSkq2k48+40M
5D3wKCNXC8w=
=m9M+
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-17 0:22 ` NeilBrown
@ 2013-01-17 9:24 ` NeilBrown
0 siblings, 0 replies; 21+ messages in thread
From: NeilBrown @ 2013-01-17 9:24 UTC (permalink / raw)
To: NeilBrown; +Cc: Igor Grinberg, Michael Trimarchi, linux-omap
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, 17 Jan 2013 11:22:55 +1100 NeilBrown <neilb@suse.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wed, 16 Jan 2013 13:11:26 +0200 Igor Grinberg <grinberg@compulab.co.il>
> wrote:
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On 01/16/13 12:19, NeilBrown wrote:
> > > On Wed, 16 Jan 2013 11:28:02 +0200 Igor Grinberg <grinberg@compulab.co.il>
> > > wrote:
> > >
> > >> -----BEGIN PGP SIGNED MESSAGE-----
> > >> Hash: SHA1
> > >
> > >> On 01/16/13 09:26, NeilBrown wrote:
> > >>> On Wed, 09 Jan 2013 14:54:00 +0200 Igor Grinberg <grinberg@compulab.co.il>
> > >>> wrote:
> > >>>
> > >>>> On 01/09/13 14:08, Michael Trimarchi wrote:
> > >>>>> Hi Neil
> > >>>>>
> > >>>>> I forget to answer to your questions
> > >>>>>
> > >>>>> On 01/09/2013 12:34 PM, NeilBrown wrote:
> > >>>>>> On Wed, 09 Jan 2013 11:24:09 +0100 Michael Trimarchi
> > >>>>>> <michael@amarulasolutions.com> wrote:
> > >>>>>>
> > >>>>>>> Hi Neil
> > >>>>>>>
> > >>>>>>> On 01/09/2013 11:19 AM, NeilBrown wrote:
> > >>>>>>>> On Wed, 09 Jan 2013 12:00:05 +0200 Igor Grinberg <grinberg@compulab.co.il>
> > >>>>>>>> wrote:
> > >>>>>>>>
> > >>>>>>>>> -----BEGIN PGP SIGNED MESSAGE-----
> > >>>>>>>>> Hash: SHA1
> > >>>>>>>>
> > >>>>>>>>> Hi Neil,
> > >>>>>>>>
> > >>>>>>>>> On 01/09/13 00:29, NeilBrown wrote:
> > >>>>>>>>>>
> > >>>>>>>>>> Hi,
> > >>>>>>>>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
> > >>>>>>>>>>
> > >>>>>>>>>> My current stumbling block is USB. The "Option" GSM module is attached via
> > >>>>>>>>>> USB (there is a separate transceiver chip attached to port 1 which is placed
> > >>>>>>>>>> in OMAP_EHCI_PORT_MODE_PHY).
> > >>>>>>>>
> > >>>>>>>>> Which PHY is this (vendor/model)?
> > >>>>>>>>
> > >>>>>>>> Hi Igor,
> > >>>>>>>> it is the SMSC USB3322
> > >>>>>>>>
> > >>>>>>>> http://www.smsc.com/media/Downloads_Public/Data_Sheets/3320.pdf
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>> BTW I subsequently discovered that keeping USBHOST out off off_mode only
> > >>>>>>>> sometimes avoid the problem, not always. So there are probably multiple
> > >>>>>>>> issues :-(
> > >>>>
> > >>>> We have the same PHY and it has some issues with the OMAP USB code.
> > >>>> First issue we experience is that if we reset the PHY more then once
> > >>>> w/o power cycling it, the PHY dies until next power cycle.
> > >>>> So, we stop providing the reset GPIO to the usb code and do the reset
> > >>>> in the board code.
> > >>>
> > >>> I've tried various change w.r.t the resetting and I cannot fault it.
> > >>> Resetting or not resetting neither causes a problem while the USB is
> > >>> otherwise working, not fixed the USB while it is otherwise failing.
> > >>> So I don't think this is my problem - thanks.
> > >>>
> > >>>>
> > >>>>>>>
> > >>>>>>> Are you sure that you don't have glitch on power, reset pin during suspend?
> > >>>>>>>
> > >>>>>>
> > >>>>>> No, I don't really have the equipment to measure such things.
> > >>>>>> But is it likely? Would enabling off_mode make it more likely?
> > >>>>>
> > >>>>> I don't know the reason of the off_mode problem :(
> > >>>>
> > >>>> We have the equipment to check this and no - this is not the case.
> > >>>>
> > >>>>>
> > >>>>>> Can you suggest some way I could test the hypothesis?
> > >>>>>
> > >>>>> I had the same problem on a rugged mobile phone, so it is just experience
> > >>>>> Check the modem power and reset gpio too, but if you don't need to unblock it
> > >>>>> with the pin after resume we know that modem is not the problem
> > >>>>
> > >>>> I don't think modem is the problem...
> > >>>> We have plain USB connector ports that are dead after the resume from off-mode.
> > >>>>
> > >>>> The good news are that we have the off-mode working on v3.6.1,
> > >>>> including the USB, but we had to do some horrible ugly hacking for this.
> > >>>>
> > >>>
> > >>> I assume this means "some patches on top of 3.6.1" ??
> > >>> Care to share your code? Even horribly ugly hacks can be educational.
> > >
> > >> We are not ready to share these patches (this will happen eventually
> > >> after some work is finished), but I can explain what they do...
> > >
> > >> We split the ehci_run function to separate the debugfs and sysfs stuff from
> > >> other initializations, so we can run the new version without the debugfs and
> > >> sysfs stuff multiple times.
> > >
> > >> Then we implement the suspend/resume ehci callbacks:
> > >> on suspend, assert phy reset,
> > >> on resume, deassert phy reset, write EHCI_INSNREG04_DISABLE_UNSUSPEND to
> > >> EHCI_INSNREG04, and call the new ehci_run() function.
> > >
> > >> That does the job for USB host to resume from off mode.
> > >
> > > Interesting thanks. That makes a certain amount of sense.
> > >
> > > However I tried compiling ehci-hcd as a module and unload/reloading it which
> > > should have a similar net effect to what you did, but it didn't make any
> > > difference - device disappears on resume.
> >
> > Yes it does for cm-t3730, in fact, that is what we have started from...
> >
> > >
> > > I also tried restoring the correct value to EHCI_INSNREG04 and
> > > EHCI_INSNREG05_ULPI which are the only registers written by
> > > ehci-omap.c, and that didn't help either.
> > >
> > > The only thing I've found that works is keeping 'core' out of off-mode.
> >
> > Ah, one more thing, we ensure that phy is completely powered off through
> > the TPS power scripts, otherwise, it does not work...
> >
>
> Ahhh.... that does make a difference.
>
> I turned off the 5V5 rail which powered the phy (and a few other things) and
> now the usb-attached modem appears after resume. Very interesting.
>
> I hadn't been doing this as I had been advised that the hardware wouldn't
> like it. There are a few devices (including the USB PHY) which are supplied
> by both a 1V8 rail and the 5V5 rail. Some of them are out-of-spec if the 1V8
> is supplied, but the 5V5 isn't.
> The 1V8 must remain on during suspend as it keep the RAM powered, so the 5V5
> must as well. Awkward.
>
>
> It is not entirely satisfactory for other reasons. It seems that with
> off_mode fully working, we drop to off mode when CPUIDLE puts things to
> sleep, and that removes the 5V5 too, which is bad. This disconnects the USB.
> My current console log shows:
>
>
> [ 2453.837402] usb 1-2: new high-speed USB device number 10 using ehci-omap
> [ 2454.006256] usb 1-2: New USB device found, idVendor=0af0, idProduct=8800
> [ 2454.015686] usb 1-2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
> [ 2454.025512] usb 1-2: Product: Globetrotter HSUPA Modem
> [ 2454.031005] usb 1-2: Manufacturer: Option N.V.
> [ 2455.355804] usb 1-2: USB disconnect, device number 10
> [ 2459.829589] usb 1-2: new high-speed USB device number 11 using ehci-omap
> [ 2459.997894] usb 1-2: New USB device found, idVendor=0af0, idProduct=8800
> [ 2460.007385] usb 1-2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
> [ 2460.017242] usb 1-2: Product: Globetrotter HSUPA Modem
> [ 2460.022644] usb 1-2: Manufacturer: Option N.V.
> [ 2469.496490] usb 1-2: USB disconnect, device number 11
> [ 2472.845245] usb 1-2: new high-speed USB device number 12 using ehci-omap
> [ 2473.013946] usb 1-2: New USB device found, idVendor=0af0, idProduct=8800
> [ 2473.023376] usb 1-2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
> [ 2473.033264] usb 1-2: Product: Globetrotter HSUPA Modem
> [ 2473.038757] usb 1-2: Manufacturer: Option N.V.
> [ 2474.528289] usb 1-2: USB disconnect, device number 12
> [ 2478.829589] usb 1-2: new high-speed USB device number 13 using ehci-omap
> [ 2478.998748] usb 1-2: New USB device found, idVendor=0af0, idProduct=8800
> [ 2479.008209] usb 1-2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
> [ 2479.018005] usb 1-2: Product: Globetrotter HSUPA Modem
> [ 2479.023498] usb 1-2: Manufacturer: Option N.V.
> [ 2480.374694] usb 1-2: USB disconnect, device number 13
>
> i.e. the modem disconnecting and reconnecting. every few seconds. The modem
> eventually got upset and has entered a state where I cannot communicate with
> it.
>
> So - interesting and useful, but I don't have a complete solution yet.
>
>
> Also, while this gets the internal USB working (to some extent) the external
> usb (USB-OTG using the musb driver) is still broken. When CORE is only
> allowed into retention mode, it works fine. When CORE goes to off-mode, I
> lose the USB port. So that'll be another problem to solve.
Actually, forget all that. My testing methodology was flawed and I wasn't
really seeing what I thought I was seeing.
I'll try to find time to be more careful and if I find something interesting,
I'll let you know.
NeilBrown
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQIVAwUBUPfDZTnsnt1WYoG5AQJ66w/6Ai4Gw4qQRcSWjK+trZ+1LjobLxjzSmOf
OXygPengsCbkAvHyEGPVilsz3C/INQm4DEo6xxqeva8aMU5LjCJFXgwdVCI/mi60
/FShjWVcLWzuakemEbBdXHLC4zrBTbYUb0yFwdqDlBhjSpBtyOqPCqfWNc3oTLs5
p2K8cUsCctKQfQCQW7LWOtgoyC1sRXQY1hTSCkdiXIruv5Kmb038CHUNhpdBbhkC
YrG8YE/Xjh7rEJPsrskPpemXgWS80gTQ0R0FPjQ9NNS85USvmAx20ei7DpoGZub1
8QIyGlULq9fXrA4wzlF5+dGgPsNkxjwRRd9MxFoogO0VUMdOocr6hnoS6QCn9AcI
VNNJvaBu8bOkyoWU65d46RL+NPYiYMb/6NzPdiLqSYbAeI050+DH589t/yZUeei8
vranN0haOGHbURoi3sw2A4EFID22uSyCdUtyIYAWLpxu0f3Cao3UddzGJFli63wk
LnG9a6T6iReeRf3fJwobiIQeEOQTjWTYQknaQscWBzzdFt3Wp72s5uTOhonvES0o
60HpCFHEqfQeK1KG7ueMlFUOggUfO81y0Yow3GZ7SG1QKaiJdt7SnqKJpb4T+IDX
BIatatH/s66jLCHWB205t/3/Xf7O83YaqEeLnyY8U4n91vspntW5J2gFltapTymj
jzJQI7m9+9c=
=ebni
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-16 10:57 ` Roger Quadros
@ 2013-01-17 11:01 ` NeilBrown
2013-01-17 11:29 ` Roger Quadros
0 siblings, 1 reply; 21+ messages in thread
From: NeilBrown @ 2013-01-17 11:01 UTC (permalink / raw)
To: Roger Quadros; +Cc: linux-omap
[-- Attachment #1: Type: text/plain, Size: 6371 bytes --]
On Wed, 16 Jan 2013 12:57:08 +0200 Roger Quadros <rogerq@ti.com> wrote:
> On 01/16/2013 12:27 PM, NeilBrown wrote:
> > On Wed, 16 Jan 2013 12:00:48 +0200 Roger Quadros <rogerq@ti.com> wrote:
> >
> >> On 01/09/2013 12:29 AM, NeilBrown wrote:
> >>>
> >>> Hi,
> >>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
> >>>
> >>> My current stumbling block is USB. The "Option" GSM module is attached via
> >>> USB (there is a separate transceiver chip attached to port 1 which is placed
> >>> in OMAP_EHCI_PORT_MODE_PHY).
> >>>
> >>> After a suspend/resume cycle with off_mode enabled the GSM module disappears.
> >>> i.e. 'lsusb' doesn't see it any more and the various ttyHSxx devices don't
> >>> exist.
> >>> Without off mode, the modem always appears after resume.
> >>>
> >>> I discovered that the registers set by:
> >>>
> >>> drivers/mfd/omap-usb-host.c
> >>>
> >>> are not maintained across as suspend/resume so I added the following patch
> >>> (which I can make a formal submission of if it looks right to others), but
> >>> that didn't help (or didn't help enough).
> >>>
> >>> If I
> >>>
> >>> echo 1 > /sys/kernel/debug/pm_debug/usbhost_pwrdm/suspend
> >>>
> >>> thus keeping just the USBHOST power domain out of off_mode, the GSM module
> >>> doesn't disappear. So it seems that some context in the usbhost domain is
> >>> not being save and restored.
> >>>
> >>> This is as far as I can get. Can someone suggest where I should look to find
> >>> out what is not being saved/restored properly, and how to go about saving and
> >>> restoring?
> >>
> >> You need to ensure that USBHOST/TLL context is saved as per the Save and
> >> Restore sequence see section "USBHOST/USBTLL Save-and-Restore
> >> Management" in the OMAP Technical Reference Manual.
> >>
> >> The basic idea there is that software does the context saving into SAR
> >> RAM before entering OFF mode and hardware automatically restores the
> >> context after coming out of OFF mode.
> >
> > Is it? The way I read the doco, the hardware both saves to SAR RAM, and
> > restores from SAR RAM.
> > Section 22.2.4.1.6 Save and Restore
> > of my copy of the TRM says:
> >
> >> The save-and-restore (SAR) mechanism can extract the hardware context of the high-speed USB host
> >> controller (after all USB activity has been suspended) before switching off (=save), save it to an external
> >> always-on memory, and reinject it later after the module has been switched on again and reset (=restore)
> >> seamlessly for the USB. Part of that context is composed of the register fields described in the current
> >> chapter. The rest of the context is composed of the "buried" flip-flops and memories (not accessible by
> >> software) like finite state-machine (FSM) states, buffer contents, and miscellaneous random logic bits.
> >
> > which strongly suggests that it is all handled by hardware. Of course there
> > are other registers that aren't covered by the SAR - we need to identify
> > those and make sure they are saved and restored. I've found a few registers
> > that aren't being restored, but restoring them hasn't made a visible
> > difference yet.
>
> Yes, you are right. I mixed it up with OMAP4 behaviour, sorry.
> But still, software needs to ensure that the USBHOST and CORE power
> domain's SAVEANDRESTORE bit are set to ensure that SAR works.
>
> see section "3.5.4.6 USBHOST/USBTLL Save-and-Restore Management"
>
> This seems to be done by the powerdomain code based on the
> PWRDM_HAS_HDWR_SAR flag. However, this flag is disabled for USBHOST
> powerdomain with the following comment.
>
> > Both USBHOST and USBTLL support a save-and-restore mechanism. When the device enters into off
> > mode (that is, all power domains, except the WKUP power domain, are off), the user may want to save
> > the USBHOST context and restore it when exiting off mode. The save-and-restore mechanism for the HS
> > USB Host is enabled by setting the PRCM.PM_PWSTCTRL_USBHOST[4] SAVEANDRESTORE bit; for
> > the USBTLL, it is configured by the PRCM.PM_PWSTCTRL_CORE[4] SAVEANDRESTORE bit. The save
> > mechanism is initiated as the power domain transitions from active to off state (or to OSWR state for the
> > USBTLL), whereas the restore mechanism is initiated as the power domain transitions from off to active
> > power state.
>
> Can you try with the flag enabled?
If I keep CORE and USBHOST out of off-mode (by writing to the relevant
'suspend' files in /sys/kernel/debug/pm-debug) then it all works.
If I set this flag, then I can allow USBHOST to enter off-mode as long as I
keep CORE in retention or better.
If I let CORE and USBHOST go to off-mode and don't have the flag set, then I
can resume from suspend, but the usb modem has disappeared.
If I let CORE and USBHOST go to off-mode and DO have the flag set, then I
cannot even resume from suspend.... sometimes.
I hate those "sometimes"s!
If I remove the battery (with no other power source present) and re-insert
it, and let the phone boot up to stable state and then enter suspend, I
cannot resume from suspend. (I tried setting "no_console_suspend" to see if
anything was happening - but that keeps CORE awake).
If I do the same but before it suspends I:
echo 1 > /sys/kernel/debug/pm_debug/core_pwrdm/suspend
then let is suspend and resume, the resume works. Then I:
echo 0 > /sys/kernel/debug/pm_debug/core_pwrdm/suspend
to allow full sleep mode and now suspend, and again resume works.
And it continues to work.
And the USB modem remains visible - it doesn't disconnect at all.
So.... something very odd is happening somewhere.
Maybe the USBHOST powerdomain isn't really going to off-mode again after the
first time like the comment in powerdomains3xxx_data.c says:
/*
* REVISIT: Enabling usb host save and restore mechanism seems to
* leave the usb host domain permanently in ACTIVE mode after
* changing the usb host power domain state from OFF to active once.
* Disabling for now.
*/
However the /sys/kernel/debug/pm_debug/count file shows the "OFF" count for
usbhost_pwrdm increments on each suspend, and that seems to be based on info
read out of the the OMAP3 itself....
All very odd.
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-17 11:01 ` NeilBrown
@ 2013-01-17 11:29 ` Roger Quadros
2013-01-17 21:08 ` NeilBrown
0 siblings, 1 reply; 21+ messages in thread
From: Roger Quadros @ 2013-01-17 11:29 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-omap
On 01/17/2013 01:01 PM, NeilBrown wrote:
> On Wed, 16 Jan 2013 12:57:08 +0200 Roger Quadros <rogerq@ti.com> wrote:
>
>> On 01/16/2013 12:27 PM, NeilBrown wrote:
>>> On Wed, 16 Jan 2013 12:00:48 +0200 Roger Quadros <rogerq@ti.com> wrote:
>>>
>>>> On 01/09/2013 12:29 AM, NeilBrown wrote:
>>>>>
>>>>> Hi,
>>>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
>>>>>
>>>>> My current stumbling block is USB. The "Option" GSM module is attached via
>>>>> USB (there is a separate transceiver chip attached to port 1 which is placed
>>>>> in OMAP_EHCI_PORT_MODE_PHY).
>>>>>
>>>>> After a suspend/resume cycle with off_mode enabled the GSM module disappears.
>>>>> i.e. 'lsusb' doesn't see it any more and the various ttyHSxx devices don't
>>>>> exist.
>>>>> Without off mode, the modem always appears after resume.
>>>>>
>>>>> I discovered that the registers set by:
>>>>>
>>>>> drivers/mfd/omap-usb-host.c
>>>>>
>>>>> are not maintained across as suspend/resume so I added the following patch
>>>>> (which I can make a formal submission of if it looks right to others), but
>>>>> that didn't help (or didn't help enough).
>>>>>
>>>>> If I
>>>>>
>>>>> echo 1 > /sys/kernel/debug/pm_debug/usbhost_pwrdm/suspend
>>>>>
>>>>> thus keeping just the USBHOST power domain out of off_mode, the GSM module
>>>>> doesn't disappear. So it seems that some context in the usbhost domain is
>>>>> not being save and restored.
>>>>>
>>>>> This is as far as I can get. Can someone suggest where I should look to find
>>>>> out what is not being saved/restored properly, and how to go about saving and
>>>>> restoring?
>>>>
>>>> You need to ensure that USBHOST/TLL context is saved as per the Save and
>>>> Restore sequence see section "USBHOST/USBTLL Save-and-Restore
>>>> Management" in the OMAP Technical Reference Manual.
>>>>
>>>> The basic idea there is that software does the context saving into SAR
>>>> RAM before entering OFF mode and hardware automatically restores the
>>>> context after coming out of OFF mode.
>>>
>>> Is it? The way I read the doco, the hardware both saves to SAR RAM, and
>>> restores from SAR RAM.
>>> Section 22.2.4.1.6 Save and Restore
>>> of my copy of the TRM says:
>>>
>>>> The save-and-restore (SAR) mechanism can extract the hardware context of the high-speed USB host
>>>> controller (after all USB activity has been suspended) before switching off (=save), save it to an external
>>>> always-on memory, and reinject it later after the module has been switched on again and reset (=restore)
>>>> seamlessly for the USB. Part of that context is composed of the register fields described in the current
>>>> chapter. The rest of the context is composed of the "buried" flip-flops and memories (not accessible by
>>>> software) like finite state-machine (FSM) states, buffer contents, and miscellaneous random logic bits.
>>>
>>> which strongly suggests that it is all handled by hardware. Of course there
>>> are other registers that aren't covered by the SAR - we need to identify
>>> those and make sure they are saved and restored. I've found a few registers
>>> that aren't being restored, but restoring them hasn't made a visible
>>> difference yet.
>>
>> Yes, you are right. I mixed it up with OMAP4 behaviour, sorry.
>> But still, software needs to ensure that the USBHOST and CORE power
>> domain's SAVEANDRESTORE bit are set to ensure that SAR works.
>>
>> see section "3.5.4.6 USBHOST/USBTLL Save-and-Restore Management"
>>
>> This seems to be done by the powerdomain code based on the
>> PWRDM_HAS_HDWR_SAR flag. However, this flag is disabled for USBHOST
>> powerdomain with the following comment.
>>
>>> Both USBHOST and USBTLL support a save-and-restore mechanism. When the device enters into off
>>> mode (that is, all power domains, except the WKUP power domain, are off), the user may want to save
>>> the USBHOST context and restore it when exiting off mode. The save-and-restore mechanism for the HS
>>> USB Host is enabled by setting the PRCM.PM_PWSTCTRL_USBHOST[4] SAVEANDRESTORE bit; for
>>> the USBTLL, it is configured by the PRCM.PM_PWSTCTRL_CORE[4] SAVEANDRESTORE bit. The save
>>> mechanism is initiated as the power domain transitions from active to off state (or to OSWR state for the
>>> USBTLL), whereas the restore mechanism is initiated as the power domain transitions from off to active
>>> power state.
>>
>> Can you try with the flag enabled?
>
> If I keep CORE and USBHOST out of off-mode (by writing to the relevant
> 'suspend' files in /sys/kernel/debug/pm-debug) then it all works.
>
> If I set this flag, then I can allow USBHOST to enter off-mode as long as I
> keep CORE in retention or better.
>
> If I let CORE and USBHOST go to off-mode and don't have the flag set, then I
> can resume from suspend, but the usb modem has disappeared.
>
> If I let CORE and USBHOST go to off-mode and DO have the flag set, then I
> cannot even resume from suspend.... sometimes.
>
It looks like the problem creeps in when the OMAP device hits OFF. i.e.
CORE is allowed to go OFF.
> I hate those "sometimes"s!
>
> If I remove the battery (with no other power source present) and re-insert
> it, and let the phone boot up to stable state and then enter suspend, I
> cannot resume from suspend. (I tried setting "no_console_suspend" to see if
> anything was happening - but that keeps CORE awake).
>
> If I do the same but before it suspends I:
>
> echo 1 > /sys/kernel/debug/pm_debug/core_pwrdm/suspend
>
> then let is suspend and resume, the resume works. Then I:
>
> echo 0 > /sys/kernel/debug/pm_debug/core_pwrdm/suspend
>
> to allow full sleep mode and now suspend, and again resume works.
> And it continues to work.
> And the USB modem remains visible - it doesn't disconnect at all.
>
So does repeated suspend/resume work after this? Or is it only the first
suspend/resume.
> So.... something very odd is happening somewhere.
> Maybe the USBHOST powerdomain isn't really going to off-mode again after the
> first time like the comment in powerdomains3xxx_data.c says:
>
> /*
> * REVISIT: Enabling usb host save and restore mechanism seems to
> * leave the usb host domain permanently in ACTIVE mode after
> * changing the usb host power domain state from OFF to active once.
> * Disabling for now.
> */
>
> However the /sys/kernel/debug/pm_debug/count file shows the "OFF" count for
> usbhost_pwrdm increments on each suspend, and that seems to be based on info
> read out of the the OMAP3 itself....
>
> All very odd.
I need to give this a try. I can try it out on OMAP3 beagle board.
What OMAP3 are you on, and which kernel are you using for your tests?
cheers,
-roger
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Help wanted with USB and OMAP3 off_mode
2013-01-17 11:29 ` Roger Quadros
@ 2013-01-17 21:08 ` NeilBrown
0 siblings, 0 replies; 21+ messages in thread
From: NeilBrown @ 2013-01-17 21:08 UTC (permalink / raw)
To: Roger Quadros; +Cc: linux-omap
[-- Attachment #1: Type: text/plain, Size: 8159 bytes --]
On Thu, 17 Jan 2013 13:29:07 +0200 Roger Quadros <rogerq@ti.com> wrote:
> On 01/17/2013 01:01 PM, NeilBrown wrote:
> > On Wed, 16 Jan 2013 12:57:08 +0200 Roger Quadros <rogerq@ti.com> wrote:
> >
> >> On 01/16/2013 12:27 PM, NeilBrown wrote:
> >>> On Wed, 16 Jan 2013 12:00:48 +0200 Roger Quadros <rogerq@ti.com> wrote:
> >>>
> >>>> On 01/09/2013 12:29 AM, NeilBrown wrote:
> >>>>>
> >>>>> Hi,
> >>>>> I'm trying to get off_mode working reliably on my gta04 mobile phone.
> >>>>>
> >>>>> My current stumbling block is USB. The "Option" GSM module is attached via
> >>>>> USB (there is a separate transceiver chip attached to port 1 which is placed
> >>>>> in OMAP_EHCI_PORT_MODE_PHY).
> >>>>>
> >>>>> After a suspend/resume cycle with off_mode enabled the GSM module disappears.
> >>>>> i.e. 'lsusb' doesn't see it any more and the various ttyHSxx devices don't
> >>>>> exist.
> >>>>> Without off mode, the modem always appears after resume.
> >>>>>
> >>>>> I discovered that the registers set by:
> >>>>>
> >>>>> drivers/mfd/omap-usb-host.c
> >>>>>
> >>>>> are not maintained across as suspend/resume so I added the following patch
> >>>>> (which I can make a formal submission of if it looks right to others), but
> >>>>> that didn't help (or didn't help enough).
> >>>>>
> >>>>> If I
> >>>>>
> >>>>> echo 1 > /sys/kernel/debug/pm_debug/usbhost_pwrdm/suspend
> >>>>>
> >>>>> thus keeping just the USBHOST power domain out of off_mode, the GSM module
> >>>>> doesn't disappear. So it seems that some context in the usbhost domain is
> >>>>> not being save and restored.
> >>>>>
> >>>>> This is as far as I can get. Can someone suggest where I should look to find
> >>>>> out what is not being saved/restored properly, and how to go about saving and
> >>>>> restoring?
> >>>>
> >>>> You need to ensure that USBHOST/TLL context is saved as per the Save and
> >>>> Restore sequence see section "USBHOST/USBTLL Save-and-Restore
> >>>> Management" in the OMAP Technical Reference Manual.
> >>>>
> >>>> The basic idea there is that software does the context saving into SAR
> >>>> RAM before entering OFF mode and hardware automatically restores the
> >>>> context after coming out of OFF mode.
> >>>
> >>> Is it? The way I read the doco, the hardware both saves to SAR RAM, and
> >>> restores from SAR RAM.
> >>> Section 22.2.4.1.6 Save and Restore
> >>> of my copy of the TRM says:
> >>>
> >>>> The save-and-restore (SAR) mechanism can extract the hardware context of the high-speed USB host
> >>>> controller (after all USB activity has been suspended) before switching off (=save), save it to an external
> >>>> always-on memory, and reinject it later after the module has been switched on again and reset (=restore)
> >>>> seamlessly for the USB. Part of that context is composed of the register fields described in the current
> >>>> chapter. The rest of the context is composed of the "buried" flip-flops and memories (not accessible by
> >>>> software) like finite state-machine (FSM) states, buffer contents, and miscellaneous random logic bits.
> >>>
> >>> which strongly suggests that it is all handled by hardware. Of course there
> >>> are other registers that aren't covered by the SAR - we need to identify
> >>> those and make sure they are saved and restored. I've found a few registers
> >>> that aren't being restored, but restoring them hasn't made a visible
> >>> difference yet.
> >>
> >> Yes, you are right. I mixed it up with OMAP4 behaviour, sorry.
> >> But still, software needs to ensure that the USBHOST and CORE power
> >> domain's SAVEANDRESTORE bit are set to ensure that SAR works.
> >>
> >> see section "3.5.4.6 USBHOST/USBTLL Save-and-Restore Management"
> >>
> >> This seems to be done by the powerdomain code based on the
> >> PWRDM_HAS_HDWR_SAR flag. However, this flag is disabled for USBHOST
> >> powerdomain with the following comment.
> >>
> >>> Both USBHOST and USBTLL support a save-and-restore mechanism. When the device enters into off
> >>> mode (that is, all power domains, except the WKUP power domain, are off), the user may want to save
> >>> the USBHOST context and restore it when exiting off mode. The save-and-restore mechanism for the HS
> >>> USB Host is enabled by setting the PRCM.PM_PWSTCTRL_USBHOST[4] SAVEANDRESTORE bit; for
> >>> the USBTLL, it is configured by the PRCM.PM_PWSTCTRL_CORE[4] SAVEANDRESTORE bit. The save
> >>> mechanism is initiated as the power domain transitions from active to off state (or to OSWR state for the
> >>> USBTLL), whereas the restore mechanism is initiated as the power domain transitions from off to active
> >>> power state.
> >>
> >> Can you try with the flag enabled?
> >
> > If I keep CORE and USBHOST out of off-mode (by writing to the relevant
> > 'suspend' files in /sys/kernel/debug/pm-debug) then it all works.
> >
> > If I set this flag, then I can allow USBHOST to enter off-mode as long as I
> > keep CORE in retention or better.
> >
> > If I let CORE and USBHOST go to off-mode and don't have the flag set, then I
> > can resume from suspend, but the usb modem has disappeared.
> >
> > If I let CORE and USBHOST go to off-mode and DO have the flag set, then I
> > cannot even resume from suspend.... sometimes.
> >
>
> It looks like the problem creeps in when the OMAP device hits OFF. i.e.
> CORE is allowed to go OFF.
>
> > I hate those "sometimes"s!
> >
> > If I remove the battery (with no other power source present) and re-insert
> > it, and let the phone boot up to stable state and then enter suspend, I
> > cannot resume from suspend. (I tried setting "no_console_suspend" to see if
> > anything was happening - but that keeps CORE awake).
> >
> > If I do the same but before it suspends I:
> >
> > echo 1 > /sys/kernel/debug/pm_debug/core_pwrdm/suspend
> >
> > then let is suspend and resume, the resume works. Then I:
> >
> > echo 0 > /sys/kernel/debug/pm_debug/core_pwrdm/suspend
> >
> > to allow full sleep mode and now suspend, and again resume works.
> > And it continues to work.
> > And the USB modem remains visible - it doesn't disconnect at all.
> >
>
> So does repeated suspend/resume work after this? Or is it only the first
> suspend/resume.
suspend/resume continues to work until a power-down.
Even after a soft reboot (which goes back to ILO and u-boot, but doesn't
remove power), suspend/resume continue to work.
It is only after a power-off that I need one suspend cycle with CORE in
retention before things work.
>
> > So.... something very odd is happening somewhere.
> > Maybe the USBHOST powerdomain isn't really going to off-mode again after the
> > first time like the comment in powerdomains3xxx_data.c says:
> >
> > /*
> > * REVISIT: Enabling usb host save and restore mechanism seems to
> > * leave the usb host domain permanently in ACTIVE mode after
> > * changing the usb host power domain state from OFF to active once.
> > * Disabling for now.
> > */
> >
> > However the /sys/kernel/debug/pm_debug/count file shows the "OFF" count for
> > usbhost_pwrdm increments on each suspend, and that seems to be based on info
> > read out of the the OMAP3 itself....
> >
> > All very odd.
>
> I need to give this a try. I can try it out on OMAP3 beagle board.
>
> What OMAP3 are you on, and which kernel are you using for your tests?
I believe it is a DM3730
# cat /proc/cpuinfo
Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 311.92
Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc08
CPU revision : 2
Hardware : GTA04
Revision : 0020
Serial : 0000000000000000
Kernel is the 'mainline' branch of git://neil.brown.name/gta04 (commit
388c9f46f9d566bd7f7dd6acb45c113c59c11417)
This is 3.7 plus a bunch of fixes and additions to make it all mostly work on
this board (Panel driver, audio glue, sdio wifi fixes, sensor drivers, bug
fixes, etc etc etc).
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2013-01-17 21:08 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-08 22:29 Help wanted with USB and OMAP3 off_mode NeilBrown
2013-01-09 10:00 ` Igor Grinberg
2013-01-09 10:19 ` NeilBrown
2013-01-09 10:24 ` Michael Trimarchi
2013-01-09 11:34 ` NeilBrown
2013-01-09 11:42 ` Michael Trimarchi
2013-01-16 7:28 ` NeilBrown
2013-01-09 12:08 ` Michael Trimarchi
2013-01-09 12:54 ` Igor Grinberg
2013-01-16 7:26 ` NeilBrown
2013-01-16 9:28 ` Igor Grinberg
2013-01-16 10:19 ` NeilBrown
2013-01-16 11:11 ` Igor Grinberg
2013-01-17 0:22 ` NeilBrown
2013-01-17 9:24 ` NeilBrown
2013-01-16 10:00 ` Roger Quadros
2013-01-16 10:27 ` NeilBrown
2013-01-16 10:57 ` Roger Quadros
2013-01-17 11:01 ` NeilBrown
2013-01-17 11:29 ` Roger Quadros
2013-01-17 21:08 ` NeilBrown
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).