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] USB and unbinding
Date: Mon, 20 Jul 2015 17:31:35 +0200	[thread overview]
Message-ID: <55AD1457.3040703@redhat.com> (raw)
In-Reply-To: <CAPnjgZ1vMXA0Lyqgvk7xqZf3BvTPUJO7tr27sE2dfXa5zL+VVg@mail.gmail.com>

Hi,

On 20-07-15 04:23, Simon Glass wrote:
> Hi Hans,
>
> I've been thinking about the USB unbinding code. I know that I agreed
> to go with it, but in retrospect I think that was a mistake.
>
> I believe we should separate out the unbinding and make it an option,
> so that it is not required in order to use USB. In effect this makes
> one of driver model's design goals (the option to drop unused code)
> useless since USB is a common interface.
>
> If I recall the only problem the lack of unbinding caused was that the
> keyboard driver broke. I suspect it broke in a way that can be fixed.
> In fact I recently converted usb_ether to driver model and I'm willing
> to do the keyboard side also.
>
> I'd like the USB code to function with or without the unbinding (i.e.
> it uses it if there). What do you think?

I strongly believe that unbinding is the proper thing todo for usb since
it is a hotplug bus.

IMHO the way the usb_find_emul_child() function was used before to re-use
udevice-s after e.g. a "usb reset" was an ugly hack which just happened to
work, but it in no way reflects reality.

More importantly we need unbind support to properly stop usb controllers when
booting the OS, so that they are not DMA-ing to/from their scratch-ram area
in DRAM when the main OS boots, so not having unbind support combined with
USB really is a no no.

This is why I suggested to simply select the unbind Kconfig when USB is
selected in Kconfig.

The actual unbind core code is not that big, so I believe that the best
solution is to always build the core if either DM_DEVICE_REMOVE *or*
DM_USB is selected, and non USB drivers can leave out their unbind
code if DM_DEVICE_REMOVE is not set, that should still give us most of
the size savings without needing to do ugly hacks for USB.

Regards,

Hans

  reply	other threads:[~2015-07-20 15:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20  2:23 [U-Boot] USB and unbinding Simon Glass
2015-07-20 15:31 ` Hans de Goede [this message]
2015-07-20 15:49   ` Simon Glass
2015-07-21 19:52     ` Hans de Goede
2015-07-22  3:48       ` Simon Glass
2015-07-22  9:09         ` Hans de Goede

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=55AD1457.3040703@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