public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] sunxi: musb: Do not fully reset the controler from sunxi_musb_disable
Date: Sun, 14 Jun 2015 19:21:47 +0200	[thread overview]
Message-ID: <557DB82B.4000805@redhat.com> (raw)
In-Reply-To: <1434282404.29215.8.camel@hellion.org.uk>

Hi,

On 06/14/2015 01:46 PM, Ian Campbell wrote:
> On Sun, 2015-06-14 at 12:40 +0200, Hans de Goede wrote:
>> Fully resetting the controller is a too big hammer, and the musb_core will
>> then afterwards fail to communicate with any endpoints other then 0 as
>> too much state was cleared.
>>
>> Instead report vbus low for 200ms which will effectively end the current
>> session without needing to do a full reset.
>>
>> This fixes usb mass-storage devices no longer working after a "usb reset"
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> Acked-by: Ian Campbell <ijc@hellion.org.uk>
>
> One question (which turned into two) (both more for the musb maint than
> you):
>
>> +/* musb_core does not call enable / disable in a balanced manner <sigh> */
>> +static bool enabled = false;
>
> Is this sufficient, or should we be reference counting? Or should the
> core be fixed?

The u-boot musb-new code is a copy of the kernel code, and both are of,
ah, interesting quality. One problem is that the core calls
musb_platform_disable as part of musb_init_controller and thus before
musb_platform_enable is ever called.

Ideally the core would not do this, but in u-boot it is used on 4
different SoCs and in the kernel even more, and chances are that that
call was added to put the hw in a clean state on some SoC...

Basically my approach for these kind of problems in the musb core so
far has been to work around them were possible, so as to not cause
any regressions on other SoCs.

Regards,

Hans

  reply	other threads:[~2015-06-14 17:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-14 10:40 [U-Boot] [PATCH 0/2] sunxi: musb: Fix "usb reset" handling Hans de Goede
2015-06-14 10:40 ` [U-Boot] [PATCH 1/2] sunxi: musb: Do not fully reset the controler from sunxi_musb_disable Hans de Goede
2015-06-14 11:46   ` Ian Campbell
2015-06-14 17:21     ` Hans de Goede [this message]
2015-06-14 10:40 ` [U-Boot] [PATCH 2/2] sunxi: musb: Remove unused sunxi_musb_exit method Hans de Goede
2015-06-14 11:47   ` Ian Campbell
2015-06-15 19:21 ` [U-Boot] [PATCH 0/2] sunxi: musb: Fix "usb reset" handling Paul Kocialkowski
2015-06-17 13:39   ` Hans de Goede
2015-06-19  9:11     ` Paul Kocialkowski
2015-06-19 12:35 ` Marek Vasut
2015-06-19 13:07   ` Hans de Goede
2015-06-19 13:08     ` Marek Vasut
2015-06-26 10:20 ` Maxime Ripard
2015-06-26 11:01   ` Hans de Goede
2015-06-28 20:42     ` Maxime Ripard
2015-06-26 11:02   ` Hans de Goede
2015-06-26 11:11     ` Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=557DB82B.4000805@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox