All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Nazarewicz <mnazarewicz@google.com>
To: Alan Stern <stern@rowland.harvard.edu>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Yang Rui Rui" <ruirui.r.yang@tieto.com>,
	"Dave Young" <hidave.darkstar@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCHv3 0/4] Figuring out speed refactorisation
Date: Sat, 20 Aug 2011 00:32:58 +0200	[thread overview]
Message-ID: <cover.1313791722.git.mina86@mina86.com> (raw)
In-Reply-To: <fb37566fc5a85ea4e8711221253e5db98d919251.1313594405.git.mina86@mina86.com>

From: Michal Nazarewicz <mina86@mina86.com>

Michal Nazarewicz (4):
  usb: Provide usb_device_speed_name() function

    Just a little helper.

  usb: gadget: replace "is_dualspeed" with "max_speed"

    This replaces "is_dualspeed" with "max_speed" so that one
    can encode in the field whether given UDC is super speed
    as well.

    Without this change, we would have to add a "is_superspeed"
    field since after removal of USB_GADGET_SUPERSPEED Kconfig
    option current implementation of gadget_is_superspeed()
    won't work.

  usb: gadget: rename usb_gadget_driver::speed to max_speed

    I don't have strong feelings about this patch, but the current
    name of the usb_gadget_driver::speed field may lead to some
    confusion.

    Changing it to "max_speed" should be apparent that it describes
    the maximum speed the gadget driver supports.

    This comes in pair with usb_gadget::max_speed and
    usb_composite_driver::max_speed.

  usb: gadget: get rid of USB_GADGET_{DUAL,SUPER}SPEED

    Removes the USB_GADGET_DUALSPEED and USB_GADGET_SUPERSPEED Kconfig
    options.  In most cases, they were checked just for optimisation
    (ie. if UDC was not dual speed, gadget drivers could skip some of
    the logic) so in the end this change was just about deleting
    #ifdefs.



Making those changes has exposed problems with some UDC drivers,
namely:

$ g grep -A3 'max_speed.*[=!]=.*USB_SPEED_HIGH'
drivers/usb/gadget/amd5536udc.c:                        || driver->max_speed != USB_SPEED_HIGH)
drivers/usb/gadget/amd5536udc.c-                return -EINVAL;
drivers/usb/gadget/amd5536udc.c-        if (!dev)
drivers/usb/gadget/amd5536udc.c-                return -ENODEV;
--
drivers/usb/gadget/m66592-udc.c:                        || driver->max_speed != USB_SPEED_HIGH
drivers/usb/gadget/m66592-udc.c-                        || !bind
drivers/usb/gadget/m66592-udc.c-                        || !driver->setup)
drivers/usb/gadget/m66592-udc.c-                return -EINVAL;
--
drivers/usb/gadget/net2272.c:       driver->max_speed != USB_SPEED_HIGH)
drivers/usb/gadget/net2272.c-           return -EINVAL;
drivers/usb/gadget/net2272.c-   if (!dev)
drivers/usb/gadget/net2272.c-           return -ENODEV;
--
drivers/usb/gadget/net2280.c:                   || driver->max_speed != USB_SPEED_HIGH
drivers/usb/gadget/net2280.c-                   || !bind || !driver->setup)
drivers/usb/gadget/net2280.c-           return -EINVAL;
drivers/usb/gadget/net2280.c-   if (!dev)
--
drivers/usb/gadget/r8a66597-udc.c:                      || driver->max_speed != USB_SPEED_HIGH
drivers/usb/gadget/r8a66597-udc.c-                      || !bind
drivers/usb/gadget/r8a66597-udc.c-                      || !driver->setup)
drivers/usb/gadget/r8a66597-udc.c-              return -EINVAL;

All those drivers require usb_gadget_driver::max_speed to be set to
USB_SPEED_HIGH.  This basically means that gmidi (which sets it to
USB_SPEED_FULL), g_ether and g_zero (which set it to USB_SPEED_SUPER)
won't work with those UDCs:

$ g grep -e '\.max_speed.*=.*USB_SPEED_SUPER' -e '\.max_speed.*=.*USB_SPEED_FULL'
dummy_hcd.c:    dum->gadget.max_speed = USB_SPEED_SUPER;;
ether.c:        .max_speed      = USB_SPEED_SUPER,
gmidi.c:        .max_speed      = USB_SPEED_FULL,
goku_udc.c:     dev->gadget.max_speed = USB_SPEED_FULL;
omap_udc.c:     udc->gadget.max_speed = USB_SPEED_FULL;
zero.c: .max_speed      = USB_SPEED_SUPER,

So as far as I can tell, UDC drivers for those need to be fixed (but
that's probably scope for another patchset).  Or am I missing
something?


Like before, this has been compile-tested only.

 drivers/usb/Makefile                   |    3 ++
 drivers/usb/common.c                   |   24 +++++++++++++++++
 drivers/usb/gadget/Kconfig             |   30 ----------------------
 drivers/usb/gadget/amd5536udc.c        |    4 +-
 drivers/usb/gadget/atmel_usba_udc.c    |    2 +-
 drivers/usb/gadget/ci13xxx_udc.c       |    9 ++++--
 drivers/usb/gadget/composite.c         |    9 +------
 drivers/usb/gadget/dbgp.c              |    2 +-
 drivers/usb/gadget/dummy_hcd.c         |   15 +++++------
 drivers/usb/gadget/epautoconf.c        |    6 ++--
 drivers/usb/gadget/file_storage.c      |    6 +---
 drivers/usb/gadget/fsl_udc_core.c      |    2 +-
 drivers/usb/gadget/fusb300_udc.c       |    2 +-
 drivers/usb/gadget/gmidi.c             |    2 +-
 drivers/usb/gadget/goku_udc.c          |    3 +-
 drivers/usb/gadget/inode.c             |   14 +---------
 drivers/usb/gadget/langwell_udc.c      |    2 +-
 drivers/usb/gadget/m66592-udc.c        |    4 +-
 drivers/usb/gadget/mv_udc_core.c       |    2 +-
 drivers/usb/gadget/net2272.c           |    4 +-
 drivers/usb/gadget/net2280.c           |    4 +-
 drivers/usb/gadget/omap_udc.c          |    1 +
 drivers/usb/gadget/pch_udc.c           |    4 +-
 drivers/usb/gadget/printer.c           |   43 +++++--------------------------
 drivers/usb/gadget/r8a66597-udc.c      |    4 +-
 drivers/usb/gadget/s3c-hsotg.c         |    2 +-
 drivers/usb/gadget/s3c-hsudc.c         |    2 +-
 drivers/usb/gadget/u_ether.c           |    7 -----
 drivers/usb/gadget/udc-core.c          |   41 +++++++++++++++---------------
 drivers/usb/musb/musb_gadget.c         |    2 +-
 drivers/usb/renesas_usbhs/mod_gadget.c |    2 +-
 include/linux/usb/ch9.h                |    8 ++++++
 include/linux/usb/gadget.h             |   29 +++++----------------
 33 files changed, 115 insertions(+), 179 deletions(-)
 create mode 100644 drivers/usb/common.c

-- 
1.7.3.1


  parent reply	other threads:[~2011-08-19 22:33 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4E4B9D9C.2010607@linutronix.de>
2011-08-17 13:03 ` [PATCH] usb: gadget: get rid of USB_GADGET_DUALSPEED and USB_GADGET_SUPERSPEED Michal Nazarewicz
2011-08-17 14:20   ` Alan Stern
2011-08-17 14:27     ` Michal Nazarewicz
2011-08-17 14:47       ` Alan Stern
2011-08-17 15:07         ` Michal Nazarewicz
2011-08-17 16:25           ` Alan Stern
2011-08-17 14:36   ` Sergei Shtylyov
2011-08-17 14:45     ` Michal Nazarewicz
2011-08-17 15:33 ` [PATCHv2] " Michal Nazarewicz
2011-08-17 21:09   ` Alan Stern
2011-08-18 13:19     ` Michal Nazarewicz
2011-08-18 14:59       ` Alan Stern
2011-08-18 17:05         ` Michal Nazarewicz
2011-08-18 17:27           ` Alan Stern
2011-08-18 20:13             ` Michal Nazarewicz
2011-08-18 20:30               ` Alan Stern
2011-08-18 20:44                 ` Michal Nazarewicz
2011-08-19 10:53                 ` Michal Nazarewicz
2011-08-19 11:13                   ` Sebastian Andrzej Siewior
2011-08-19 12:14                     ` Michal Nazarewicz
2011-08-19 14:29                       ` Alan Stern
2011-08-19 14:38                         ` Michal Nazarewicz
2011-08-19 14:57                           ` Alan Stern
2011-08-19  2:02           ` Yang Rui Rui
2011-08-19 12:17             ` Michal Nazarewicz
2011-08-18  3:01   ` Yang Rui Rui
2011-08-18 11:57     ` Michal Nazarewicz
2011-08-18 13:24       ` Dave Young
2011-08-18 13:41         ` Michal Nazarewicz
2011-08-19 22:32   ` Michal Nazarewicz [this message]
2011-08-19 22:32     ` [PATCHv3 1/4] usb: Provide usb_device_speed_name() function Michal Nazarewicz
2011-08-19 23:15       ` Felipe Balbi
2011-08-22 14:53         ` Michal Nazarewicz
2011-08-19 22:33     ` [PATCHv3 2/4] usb: gadget: replace "is_dualspeed" with "max_speed" Michal Nazarewicz
2011-08-19 23:28       ` Felipe Balbi
2011-08-23 13:48         ` Michal Nazarewicz
2011-08-23 13:58           ` Felipe Balbi
2011-08-23 14:15             ` Michal Nazarewicz
2011-08-23 14:37               ` Alan Stern
2011-08-23 14:58                 ` Felipe Balbi
2011-08-23 15:07                   ` Michal Nazarewicz
2011-08-23 15:11                     ` Felipe Balbi
2011-08-23 15:26                       ` Michal Nazarewicz
2011-08-23 17:19                         ` Felipe Balbi
2011-08-23 18:44                           ` Michal Nazarewicz
2011-08-23 15:43                   ` Alan Stern
2011-08-23 17:21                     ` Felipe Balbi
2011-08-23 18:00                       ` Alan Stern
2011-08-23 19:05                         ` Michal Nazarewicz
2011-08-23 20:49                           ` Alan Stern
2011-08-24  8:56                             ` Felipe Balbi
2011-08-24 13:10                             ` Michal Nazarewicz
2011-08-24 14:31                               ` Alan Stern
2011-08-24 14:53                                 ` Michal Nazarewicz
2011-08-24 15:15                                   ` Alan Stern
2011-08-24 15:25                                     ` Michal Nazarewicz
2011-08-24 23:04                                       ` Felipe Balbi
2011-08-25 12:46                                         ` Michal Nazarewicz
2011-08-25 12:53                                           ` Felipe Balbi
2011-08-24 22:57                                 ` Felipe Balbi
2011-08-23 15:05               ` Felipe Balbi
2011-08-23 15:30                 ` Michal Nazarewicz
2011-08-19 22:33     ` [PATCHv3 3/4] usb: gadget: rename usb_gadget_driver::speed to max_speed Michal Nazarewicz
2011-08-19 23:31       ` Felipe Balbi
2011-08-20  2:34         ` Alan Stern
2011-08-22 10:42           ` Felipe Balbi
2011-08-19 22:33     ` [PATCHv3 4/4] usb: gadget: get rid of USB_GADGET_{DUAL,SUPER}SPEED Michal Nazarewicz
2011-08-20 13:41       ` Alan Stern
2011-08-22 14:51         ` Michal Nazarewicz
2011-08-22 15:03           ` Alan Stern

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=cover.1313791722.git.mina86@mina86.com \
    --to=mnazarewicz@google.com \
    --cc=balbi@ti.com \
    --cc=bigeasy@linutronix.de \
    --cc=hidave.darkstar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ruirui.r.yang@tieto.com \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.