Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1418640 > unrolled thread

Re: Nokia N900: musb is in wrong state after boot

Started byBin Liu <b-liu@ti.com>
First post2016-06-09 23:00 +0200
Last post2016-06-10 19:50 +0200
Articles 9 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Nokia N900: musb is in wrong state after boot Bin Liu <b-liu@ti.com> - 2016-06-09 23:00 +0200
    Re: Nokia N900: musb is in wrong state after boot joerg Reisenweber <joerg@openmoko.org> - 2016-06-09 23:30 +0200
      Re: Nokia N900: musb is in wrong state after boot Bin Liu <b-liu@ti.com> - 2016-06-10 17:10 +0200
        Re: Nokia N900: musb is in wrong state after boot joerg Reisenweber <joerg@openmoko.org> - 2016-06-10 17:30 +0200
          Re: Nokia N900: musb is in wrong state after boot Bin Liu <b-liu@ti.com> - 2016-06-10 18:10 +0200
            Re: Nokia N900: musb is in wrong state after boot joerg Reisenweber <joerg@openmoko.org> - 2016-06-10 18:20 +0200
              Re: Nokia N900: musb is in wrong state after boot Nishanth Menon <nm@ti.com> - 2016-06-10 19:10 +0200
                Re: Nokia N900: musb is in wrong state after boot joerg Reisenweber <joerg@openmoko.org> - 2016-06-10 19:30 +0200
              Re: Nokia N900: musb is in wrong state after boot Bin Liu <b-liu@ti.com> - 2016-06-10 19:50 +0200

#1418640 — Re: Nokia N900: musb is in wrong state after boot

FromBin Liu <b-liu@ti.com>
Date2016-06-09 23:00 +0200
SubjectRe: Nokia N900: musb is in wrong state after boot
Message-ID<rIfdv-360-15@gated-at.bofh.it>
Hi,

On Sun, May 29, 2016 at 12:38:24PM +0200, Pali Rohár wrote:
> > Hello, attached patch for musb debugfs adds option to force both 
> > hostmode with speed. It is just example, I tested only compilation.
> > 
> > Something like that will be needed for usb host mode on Nokia N900.
> > 
> > -- 
> > Pali Rohár
> > pali.rohar@gmail.com
> 
> > From fd67b58e3538c0732750ecad915cde736da099dc Mon Sep 17 00:00:00 2001
> > From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali.rohar@gmail.com>
> > Date: Sat, 9 Jan 2016 16:57:59 +0100
> > Subject: [PATCH] musb: debugfs: Add support in testmode for forcing host mode
> >  together with speed
> > 
> > ---
> >  drivers/usb/musb/musb_debugfs.c |   44 +++++++++++++++++++++++++--------------
> >  1 file changed, 28 insertions(+), 16 deletions(-)
> > 
> > diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c
> > index 9b22d94..62c13a2 100644
> > --- a/drivers/usb/musb/musb_debugfs.c
> > +++ b/drivers/usb/musb/musb_debugfs.c
> > @@ -147,28 +147,34 @@ static int musb_test_mode_show(struct seq_file *s, void *unused)
> >  
> >  	test = musb_readb(musb->mregs, MUSB_TESTMODE);
> >  
> > -	if (test & MUSB_TEST_FORCE_HOST)
> > +	if (test & (MUSB_TEST_FORCE_HOST | MUSB_TEST_FORCE_FS))
> > +		seq_printf(s, "force host full-speed\n");
> > +
> > +	else if (test & (MUSB_TEST_FORCE_HOST | MUSB_TEST_FORCE_HS))
> > +		seq_printf(s, "force host high-speed\n");
> > +
> > +	else if (test & MUSB_TEST_FORCE_HOST)
> >  		seq_printf(s, "force host\n");
> >  
> > -	if (test & MUSB_TEST_FIFO_ACCESS)
> > +	else if (test & MUSB_TEST_FIFO_ACCESS)
> >  		seq_printf(s, "fifo access\n");
> >  
> > -	if (test & MUSB_TEST_FORCE_FS)
> > +	else if (test & MUSB_TEST_FORCE_FS)
> >  		seq_printf(s, "force full-speed\n");
> >  
> > -	if (test & MUSB_TEST_FORCE_HS)
> > +	else if (test & MUSB_TEST_FORCE_HS)
> >  		seq_printf(s, "force high-speed\n");
> >  
> > -	if (test & MUSB_TEST_PACKET)
> > +	else if (test & MUSB_TEST_PACKET)
> >  		seq_printf(s, "test packet\n");
> >  
> > -	if (test & MUSB_TEST_K)
> > +	else if (test & MUSB_TEST_K)
> >  		seq_printf(s, "test K\n");
> >  
> > -	if (test & MUSB_TEST_J)
> > +	else if (test & MUSB_TEST_J)
> >  		seq_printf(s, "test J\n");
> >  
> > -	if (test & MUSB_TEST_SE0_NAK)
> > +	else if (test & MUSB_TEST_SE0_NAK)
> >  		seq_printf(s, "test SE0 NAK\n");
> >  
> >  	return 0;
> > @@ -206,30 +212,36 @@ static ssize_t musb_test_mode_write(struct file *file,
> >  	if (copy_from_user(buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
> >  		return -EFAULT;
> >  
> > -	if (strstarts(buf, "force host"))
> > +	if (strstarts(buf, "force host full-speed"))
> > +		test = MUSB_TEST_FORCE_HOST | MUSB_TEST_FORCE_FS;
> > +
> > +	else if (strstarts(buf, "force host high-speed"))
> > +		test = MUSB_TEST_FORCE_HOST | MUSB_TEST_FORCE_HS;
> > +
> > +	else if (strstarts(buf, "force host"))
> >  		test = MUSB_TEST_FORCE_HOST;
> >  
> > -	if (strstarts(buf, "fifo access"))
> > +	else if (strstarts(buf, "fifo access"))
> >  		test = MUSB_TEST_FIFO_ACCESS;
> >  
> > -	if (strstarts(buf, "force full-speed"))
> > +	else if (strstarts(buf, "force full-speed"))
> >  		test = MUSB_TEST_FORCE_FS;
> >  
> > -	if (strstarts(buf, "force high-speed"))
> > +	else if (strstarts(buf, "force high-speed"))
> >  		test = MUSB_TEST_FORCE_HS;
> >  
> > -	if (strstarts(buf, "test packet")) {
> > +	else if (strstarts(buf, "test packet")) {
> >  		test = MUSB_TEST_PACKET;
> >  		musb_load_testpacket(musb);
> >  	}
> >  
> > -	if (strstarts(buf, "test K"))
> > +	else if (strstarts(buf, "test K"))
> >  		test = MUSB_TEST_K;
> >  
> > -	if (strstarts(buf, "test J"))
> > +	else if (strstarts(buf, "test J"))
> >  		test = MUSB_TEST_J;
> >  
> > -	if (strstarts(buf, "test SE0 NAK"))
> > +	else if (strstarts(buf, "test SE0 NAK"))
> >  		test = MUSB_TEST_SE0_NAK;
> >  
> >  	musb_writeb(musb->mregs, MUSB_TESTMODE, test);
> > -- 
> > 1.7.9.5
> > 
> 
> Tony, what do you think about that patch?

Based on the musb ug, force_host bit is allowed to be set along with
force_hs or force_fs bit. So please resend this patch with subject
changed to the following, and I will take it. The current suject makes
is sound like a new feature rather than a bugfix.

"usb: musb: debugfs: allow forcing host mode together with speed in testmode"

But I am not sure how this will fix n900 host mode problem, since
testmode is not used in normal operation.

Regards,
-Bin.

[toc] | [next] | [standalone]


#1418731

Fromjoerg Reisenweber <joerg@openmoko.org>
Date2016-06-09 23:30 +0200
Message-ID<rIfGz-3yC-71@gated-at.bofh.it>
In reply to#1418640

[Multipart message — attachments visible in raw view] — view raw

On Thu 09 June 2016 15:58:56 Bin Liu wrote:
> But I am not sure how this will fix n900 host mode problem, since
> testmode is not used in normal operation.

Please see http://talk.maemo.org/showthread.php?p=685367 and 
http://maemo.org/packages/view/hostmode-gui/ which indeed is _no_ normal 
hostmode but an implementation of a workaround that exploits the force host 
test mode (among others)

/jOERG
-- 
()  ascii ribbon campaign
/\  
against html e-mail - against proprietary attachments
http://www.georgedillon.com/web/html_email_is_evil.shtml          
http://www.nonhtmlmail.org/campaign.html
http://www.georgedillon.com/web/html_email_is_evil_still.shtml    
http://www.gerstbach.at/2004/ascii/ (German)

[toc] | [prev] | [next] | [standalone]


#1419504

FromBin Liu <b-liu@ti.com>
Date2016-06-10 17:10 +0200
Message-ID<rIwel-6ae-1@gated-at.bofh.it>
In reply to#1418731
Hi,

On Thu, Jun 09, 2016 at 11:25:57PM +0200, joerg Reisenweber wrote:
> On Thu 09 June 2016 15:58:56 Bin Liu wrote:
> > But I am not sure how this will fix n900 host mode problem, since
> > testmode is not used in normal operation.
> 
> Please see http://talk.maemo.org/showthread.php?p=685367 and 
> http://maemo.org/packages/view/hostmode-gui/ which indeed is _no_ normal 
> hostmode but an implementation of a workaround that exploits the force host 
> test mode (among others)

What I meant was that it is okay for hobby, but you don't want to
something that the IP vender does not support in real products.

Regards,
-Bin.

[toc] | [prev] | [next] | [standalone]


#1419521

Fromjoerg Reisenweber <joerg@openmoko.org>
Date2016-06-10 17:30 +0200
Message-ID<rIwxH-6gP-15@gated-at.bofh.it>
In reply to#1419504
On Fri 10 June 2016 10:08:08 Bin Liu wrote:
> Hi,
> 
> On Thu, Jun 09, 2016 at 11:25:57PM +0200, joerg Reisenweber wrote:
> > On Thu 09 June 2016 15:58:56 Bin Liu wrote:
> > > But I am not sure how this will fix n900 host mode problem, since
> > > testmode is not used in normal operation.
> > 
> > Please see http://talk.maemo.org/showthread.php?p=685367 and
> > http://maemo.org/packages/view/hostmode-gui/ which indeed is _no_ normal
> > hostmode but an implementation of a workaround that exploits the force
> > host
> > test mode (among others)
> 
> What I meant was that it is okay for hobby, but you don't want to
> something that the IP vender does not support in real products.


You lost me. 
> > > But I am not sure how this will fix n900 host mode problem
http://maemo.org/packages/view/hostmode-gui/ and the associated kernel patches 
for FORCE_HOSTMODE _is_ how we 'fix' the N900 hostmode problem (see 
https://www.youtube.com/watch?v=fkCDyUO0sKQ for a proof)

/j
-- 
()  ascii ribbon campaign
/\  
against html e-mail - against proprietary attachments
http://www.georgedillon.com/web/html_email_is_evil.shtml          
http://www.nonhtmlmail.org/campaign.html
http://www.georgedillon.com/web/html_email_is_evil_still.shtml    
http://www.gerstbach.at/2004/ascii/ (German)

[toc] | [prev] | [next] | [standalone]


#1419553

FromBin Liu <b-liu@ti.com>
Date2016-06-10 18:10 +0200
Message-ID<rIxaq-6KH-17@gated-at.bofh.it>
In reply to#1419521
Hi,

On Fri, Jun 10, 2016 at 05:23:11PM +0200, joerg Reisenweber wrote:
> On Fri 10 June 2016 10:08:08 Bin Liu wrote:
> > Hi,
> > 
> > On Thu, Jun 09, 2016 at 11:25:57PM +0200, joerg Reisenweber wrote:
> > > On Thu 09 June 2016 15:58:56 Bin Liu wrote:
> > > > But I am not sure how this will fix n900 host mode problem, since
> > > > testmode is not used in normal operation.
> > > 
> > > Please see http://talk.maemo.org/showthread.php?p=685367 and
> > > http://maemo.org/packages/view/hostmode-gui/ which indeed is _no_ normal
> > > hostmode but an implementation of a workaround that exploits the force
> > > host
> > > test mode (among others)
> > 
> > What I meant was that it is okay for hobby, but you don't want to
> > something that the IP vender does not support in real products.
> 
> 
> You lost me.

Sorry.

The musb ug says the testmde is not used in normal operation, so my
opinion is force_host should not be used for hacking n900 host mode if
this is for real product development or support.

Regards,
-Bin.

[toc] | [prev] | [next] | [standalone]


#1419558

Fromjoerg Reisenweber <joerg@openmoko.org>
Date2016-06-10 18:20 +0200
Message-ID<rIxk5-6Qd-15@gated-at.bofh.it>
In reply to#1419553
On Fri 10 June 2016 10:59:40 Bin Liu wrote:
> The musb ug says the testmde is not used in normal operation, so my
> opinion is force_host should not be used for hacking n900 host mode if
> this is for real product development or support.

You're aware N900 OS aka maemo is a) FOSS, and b) EOL at least from Nokia's 
POV? So there's neither "product development" nor any _'official'_ support 
involved.
And c) we (community) already _did_ use it since it was the only chance to 
make hostmode sort of work for N900, it's not like we could redesign N900 
hardware to support regular hostmode, we need to work with what RL gave us. 
It evades me why you discourage resp reject this established solution. 
Just Nokia not supporting hostmode evidently doesn't mean we can't get 
anything done, and I don't see why we should refrain from doing so.

/j
-- 
()  ascii ribbon campaign
/\  
against html e-mail - against proprietary attachments
http://www.georgedillon.com/web/html_email_is_evil.shtml          
http://www.nonhtmlmail.org/campaign.html
http://www.georgedillon.com/web/html_email_is_evil_still.shtml    
http://www.gerstbach.at/2004/ascii/ (German)

[toc] | [prev] | [next] | [standalone]


#1419602

FromNishanth Menon <nm@ti.com>
Date2016-06-10 19:10 +0200
Message-ID<rIy6u-7n5-7@gated-at.bofh.it>
In reply to#1419558
On 06/10/2016 11:15 AM, joerg Reisenweber wrote:

Sorry for butting in...

> On Fri 10 June 2016 10:59:40 Bin Liu wrote:
>> The musb ug says the testmde is not used in normal operation, so my
>> opinion is force_host should not be used for hacking n900 host mode if
>> this is for real product development or support.
> 
> You're aware N900 OS aka maemo is a) FOSS, and b) EOL at least from Nokia's 
> POV? So there's neither "product development" nor any _'official'_ support 
> involved.
> And c) we (community) already _did_ use it since it was the only chance to 
> make hostmode sort of work for N900, it's not like we could redesign N900 
> hardware to support regular hostmode, we need to work with what RL gave us. 
> It evades me why you discourage resp reject this established solution. 
> Just Nokia not supporting hostmode evidently doesn't mean we can't get 
> anything done, and I don't see why we should refrain from doing so.

I think there was some unfortunately choice of words used in the
thread. It is TI intention to support community effort and we are very
appreciative of the work and effort done by the N900 community. Please
do not misunderstand that we dont care for FOSS community, in fact, we
are part of the FOSS community as well and a significant investment is
done to ensure that "upstream first" approach is taken to benefit
everyone.

Hopefully with that out of the way, on this specific topic, based on a
quick chat with Bin, I think Bin meant to indicate that as per Mentor
vendor documentation, the option is a test mode meant for silicon
validation purposes - typically many vendor hardware blocks have these
"test mode" bits and options meant to help silicon validation
software, unfortunately these modes do not tend to be well tested and
the typical "official disclaimer" is "Not for 'production device
usage' and 'user might be on  his/her own' " - That does not mean it
cannot work, but it may not always be working OR can have reliability
issues/open up unknown silicon issues that has not been well covered
by SoC and/or IP vendor. In this case specifically, I think Bin's
experience of having had tried to get this working in AM335x and had
failed makes him a little more skeptical.

I think Bin has accepted this patch, but anyways, it is always good to
highlight potential risk. I assume Bin can elaborate more as needed.

Post Note: We all do appreciate all the creative ways folks do use TI
SoCs, it is important we try and continue do that to leverage every
single transistor that the SoC has, but we should also just keep a
watch for any potential risks we might have to face with these options
we exploit.

-- 
Regards,
Nishanth Menon

[toc] | [prev] | [next] | [standalone]


#1419610

Fromjoerg Reisenweber <joerg@openmoko.org>
Date2016-06-10 19:30 +0200
Message-ID<rIypP-7tF-9@gated-at.bofh.it>
In reply to#1419602
On Fri 10 June 2016 12:04:43 Nishanth Menon wrote:
> I think there was some unfortunately choice of words used in the
> thread. It is TI intention to support community effort
[...]
> software, unfortunately these modes do not tend to be well tested and
> the typical "official disclaimer" is "Not for 'production device
> usage' and 'user might be on  his/her own' " 

Understood, agreed and appreciated, many thanks! :-)
I didn't mean to suggest this as the recommended way to implement hostmode on 
arbitrary devices, we just had to find a way to fix a hw-flaw in N900 platform. 
Odds are this N900 specific H-E-N botch won't work on any other platform ever.

Best Regards
jOERG
-- 
()  ascii ribbon campaign
/\  
against html e-mail - against proprietary attachments
http://www.georgedillon.com/web/html_email_is_evil.shtml          
http://www.nonhtmlmail.org/campaign.html
http://www.georgedillon.com/web/html_email_is_evil_still.shtml    
http://www.gerstbach.at/2004/ascii/ (German)

[toc] | [prev] | [next] | [standalone]


#1419625

FromBin Liu <b-liu@ti.com>
Date2016-06-10 19:50 +0200
Message-ID<rIyJc-7Ck-17@gated-at.bofh.it>
In reply to#1419558
Hi,

On Fri, Jun 10, 2016 at 06:15:26PM +0200, joerg Reisenweber wrote:
> On Fri 10 June 2016 10:59:40 Bin Liu wrote:
> > The musb ug says the testmde is not used in normal operation, so my
> > opinion is force_host should not be used for hacking n900 host mode if
> > this is for real product development or support.
> 
> You're aware N900 OS aka maemo is a) FOSS, and b) EOL at least from Nokia's 
> POV? So there's neither "product development" nor any _'official'_ support 
> involved.
> And c) we (community) already _did_ use it since it was the only chance to 
> make hostmode sort of work for N900, it's not like we could redesign N900 
> hardware to support regular hostmode, we need to work with what RL gave us. 

Well, misunderstanding does happening as Nishanth warned me offline :(

> It evades me why you discourage resp reject this established solution. 

Not sure how you concluded I reject this. Instead I am taking patches.
The only thing I did was warning that if you use force_host testmode in
normal operation in your 'products', you would get liability problem.

> Just Nokia not supporting hostmode evidently doesn't mean we can't get 
> anything done, and I don't see why we should refrain from doing so.

Regards,
-Bin.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web