1. 15 5月, 2013 3 次提交
  2. 08 5月, 2013 3 次提交
    • K
      aio: use cancellation list lazily · 0460fef2
      Kent Overstreet 提交于
      Cancelling kiocbs requires adding them to a per kioctx linked list,
      which is one of the few things we need to take the kioctx lock for in
      the fast path.  But most kiocbs can't be cancelled - so if we just do
      this lazily, we can avoid quite a bit of locking overhead.
      
      While we're at it, instead of using a flag bit switch to using ki_cancel
      itself to indicate that a kiocb has been cancelled/completed.  This lets
      us get rid of ki_flags entirely.
      
      [akpm@linux-foundation.org: remove buggy BUG()]
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Reviewed-by: N"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0460fef2
    • K
      aio: move private stuff out of aio.h · 4e179bca
      Kent Overstreet 提交于
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Acked-by: NJeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4e179bca
    • Z
      gadget: remove only user of aio retry · a80bf61e
      Zach Brown 提交于
      This removes the only in-tree user of aio retry.  This will let us
      remove the retry code from the aio core.
      
      Removing retry is relatively easy as the USB gadget wasn't using it to
      retry IOs at all.  It always fully submitted the IO in the context of
      the initial io_submit() call.  It only used the AIO retry facility to
      get the submitter's mm context for copying the result of a read back to
      user space.  This is easy to implement with use_mm() and a work struct,
      much like kvm does with async_pf_execute() for get_user_pages().
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NZach Brown <zab@redhat.com>
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Acked-by: NJeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a80bf61e
  3. 05 5月, 2013 1 次提交
  4. 30 4月, 2013 2 次提交
  5. 26 4月, 2013 2 次提交
    • A
      USB: OMAP: ISP1301 needs USB_PHY · c3c683ea
      Arnd Bergmann 提交于
      The Kconfig entry for USB_OMAP unconditionally selects USB_ISP1301,
      which is now only visible when USB_PHY is also enabled.
      
      This adds an appropriate dependency and enables USB_PHY in the omap1
      defconfig, avoiding these build warnings:
      
      warning: (USB_OHCI_HCD && USB_OMAP) selects ISP1301_OMAP which has unmet direct dependencies (USB_SUPPORT && USB_PHY && I2C && ARCH_OMAP_OTG)
      
      Also fix a Makefile typo while we're at it.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Felipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c3c683ea
    • A
      USB: lpc32xx: ISP1301 needs USB_PHY · 64e98a79
      Arnd Bergmann 提交于
      The Kconfig entry for USB_LPC32XX unconditionally selects USB_ISP1301,
      which is now only visible when USB_PHY is also enabled.
      
      This adds an appropriate dependency and enables USB_PHY in the msm
      defconfig, avoiding these build errors:
      
      warning: (USB_LPC32XX) selects USB_ISP1301 which has unmet direct dependencies (USB_SUPPORT && USB_PHY && (USB || USB_GADGET) && I2C)
      drivers/built-in.o: In function `usb_hcd_nxp_probe':
      drivers/usb/host/ohci-nxp.c:224: undefined reference to `isp1301_get_client'
      drivers/built-in.o: In function `lpc32xx_udc_probe':
      drivers/usb/gadget/lpc32xx_udc.c:3071: undefined reference to `isp1301_get_client'
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Roland Stigge <stigge@antcom.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      64e98a79
  6. 23 4月, 2013 5 次提交
  7. 10 4月, 2013 2 次提交
  8. 09 4月, 2013 1 次提交
  9. 04 4月, 2013 1 次提交
    • F
      usb: gadget: nokia: include f_ecm.c · 9b192de6
      Felipe Balbi 提交于
      recent changes to gadget framework have
      exposed a flaw in nokia.c where it uses
      f_ecm.c but it wasn't including it like
      other gadget drivers.
      
      This is a temporary patch until all other
      function drivers are converted to new API
      where each function driver becomes a module
      and binding is done through configfs.
      
      Solves a linking error when building g_nokia.ko
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      9b192de6
  10. 03 4月, 2013 13 次提交
    • A
      usb: gadget: f_obex: add configfs support · ecfd3f7b
      Andrzej Pietrasiewicz 提交于
      f_obex learns about our new configfs-based interface,
      which will allow gadgets to be bound to controllers
      through userland.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      ecfd3f7b
    • A
      usb: gadget: serial: convert to new interface of f_obex · d1412794
      Andrzej Pietrasiewicz 提交于
      f_obex is now a self-contained module. We need to teach
      serial.c about it.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      d1412794
    • A
      usb: gadget: f_obex: convert to new function interface with backward compatibility · 1d8fc251
      Andrzej Pietrasiewicz 提交于
      Converting f_obex to the new function interface requires converting
      the f_obex's function code and its users.
      
      This patch converts the f_obex.c to the new function interface.
      The file is now compiled into a separate usb_f_obex.ko module.
      
      The old function interface is provided by means of preprocessor
      conditional directives. After all users are converted, the old interface
      can be removed.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      1d8fc251
    • A
      usb: gadget: f_serial: add configfs support · 0b6a1e6f
      Andrzej Pietrasiewicz 提交于
      this patch implements the new configfs based interface
      on f_serial function driver.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      0b6a1e6f
    • A
      usb: gadget: f_serial: remove compatibility layer · 9786b456
      Andrzej Pietrasiewicz 提交于
      There are no old function interface users left, so the old interface
      can be removed.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      9786b456
    • A
    • A
      usb: gadget: f_serial: convert to new function interface with backward compatibility · 60540ea2
      Andrzej Pietrasiewicz 提交于
      Converting f_serial to the new function interface requires converting
      the f_serial's function code and its users.
      
      This patch converts the f_serial.c to the new function interface.
      
      The file is now compiled into a separate usb_f_serial.ko module.
      The old function interface is provided by means of preprocessor
      conditional directives. After all users are converted, the old interface
      can be removed.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      60540ea2
    • A
      usb: gadget: nokia: remove unused include · 81f886cb
      Andrzej Pietrasiewicz 提交于
      f_serial.c isn't necessary in nokia.c, we can
      safely remove it.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      81f886cb
    • A
      usb: gadget: use consistent naming scheme for usb function modules · 4f47a1be
      Andrzej Pietrasiewicz 提交于
      In order to convert to configfs the USB functions need to be converted
      to the new interface from Sebastian, which also requires turning them
      into separate modules. Some of these modules will consist of just
      one object file, e.g. f_ncm.o. But some of the modules will eventually
      consist of more than one object file, e.g. for mass storage there
      will be f_mass_storage.o and storage_common.o. The resulting module
      cannot be called f_mass_storage.ko due to cyclic dependency. This patch
      introduces a naming scheme for the said resulting modules:
      
      usb_f_xxxxxx.ko
      
      e.g. usb_f_mass_storage.ko, usb_f_ss_lb.ko, usb_f_rndis.ko etc.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      4f47a1be
    • S
      usb: gadget: the start of the configfs interface · 88af8bbe
      Sebastian Andrzej Siewior 提交于
      |# modprobe dummy_hcd num=2
      |# modprobe libcomposite
      
      |# lsmod
      |Module                  Size  Used by
      |libcomposite           31648  0
      |dummy_hcd              19871  0
      
      |# mkdir /sys/kernel/config/usb_gadget/oha
      |# cd /sys/kernel/config/usb_gadget/oha
      |# mkdir configs/def.1
      |# mkdir configs/def.2
      |# mkdir functions/acm.ttyS1
      |# mkdir strings/0x1
      |mkdir: cannot create directory `strings/0x1': Invalid argument
      |# mkdir strings/0x409
      |# mkdir strings/1033
      |mkdir: cannot create directory `strings/1033': File exists
      |# mkdir strings/1032
      |# mkdir configs/def.1/strings/0x409
      |# mkdir configs/def.2/strings/0x409
      
      |#find . -ls
      |   975    0 drwxr-xr-x   5 root     root            0 Dec 23 17:40 .
      |   978    0 drwxr-xr-x   4 root     root            0 Dec 23 17:43 ./strings
      |  4100    0 drwxr-xr-x   2 root     root            0 Dec 23 17:43 ./strings/1032
      |   995    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./strings/1032/serialnumber
      |   996    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./strings/1032/product
      |   997    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./strings/1032/manufacturer
      |  2002    0 drwxr-xr-x   2 root     root            0 Dec 23 17:41 ./strings/0x409
      |   998    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./strings/0x409/serialnumber
      |   999    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./strings/0x409/product
      |  1000    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./strings/0x409/manufacturer
      |   977    0 drwxr-xr-x   4 root     root            0 Dec 23 17:41 ./configs
      |  4081    0 drwxr-xr-x   3 root     root            0 Dec 23 17:41 ./configs/def.2
      |  4082    0 drwxr-xr-x   3 root     root            0 Dec 23 17:42 ./configs/def.2/strings
      |  2016    0 drwxr-xr-x   2 root     root            0 Dec 23 17:42 ./configs/def.2/strings/0x409
      |  1001    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./configs/def.2/strings/0x409/configuration
      |  1002    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./configs/def.2/bmAttributes
      |  1003    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./configs/def.2/MaxPower
      |   979    0 drwxr-xr-x   3 root     root            0 Dec 23 17:42 ./configs/def.1
      |   980    0 drwxr-xr-x   3 root     root            0 Dec 23 17:42 ./configs/def.1/strings
      |  5122    0 drwxr-xr-x   2 root     root            0 Dec 23 17:42 ./configs/def.1/strings/0x409
      |  1004    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./configs/def.1/strings/0x409/configuration
      |  1005    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./configs/def.1/bmAttributes
      |  1006    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./configs/def.1/MaxPower
      |   976    0 drwxr-xr-x   3 root     root            0 Dec 23 17:41 ./functions
      |   981    0 drwxr-xr-x   2 root     root            0 Dec 23 17:41 ./functions/acm.ttyS1
      |  1007    0 -r--r--r--   1 root     root         4096 Dec 23 17:43 ./functions/acm.ttyS1/port_num
      |  1008    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./UDC
      |  1009    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./bcdUSB
      |  1010    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./bcdDevice
      |  1011    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./idProduct
      |  1012    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./idVendor
      |  1013    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./bMaxPacketSize0
      |  1014    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./bDeviceProtocol
      |  1015    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./bDeviceSubClass
      |  1016    0 -rw-r--r--   1 root     root         4096 Dec 23 17:43 ./bDeviceClass
      
      |# cat functions/acm.ttyS1/port_num
      |0
      |# ls -lah /dev/ttyGS*
      |crw-rw---T 1 root dialout 252, 0 Dec 23 17:41 /dev/ttyGS0
      |
      |# echo 0x1234 > idProduct
      |# echo 0xabcd > idVendor
      |# echo 1122 > strings/0x409/serialnumber
      |# echo "The manufacturer" > strings/0x409/manufacturer
      |# echo 1 > strings/1032/manufacturer
      |# echo 1sa > strings/1032/product
      |# echo tada > strings/1032/serialnumber
      |echo "Primary configuration" > configs/def.1/strings/0x409/configuration
      |# echo "Secondary configuration" > configs/def.2/strings/0x409/configuration
      |# ln -s functions/acm.ttyS1 configs/def.1/
      |# ln -s functions/acm.ttyS1 configs/def.2/
      |find configs/def.1/ -ls
      |   979    0 drwxr-xr-x   3 root     root            0 Dec 23 17:49 configs/def.1/
      |  6264    0 lrwxrwxrwx   1 root     root            0 Dec 23 17:48 configs/def.1/acm.ttyS1 -> ../../../../usb_gadget/oha/functions/acm.ttyS1
      |   980    0 drwxr-xr-x   3 root     root            0 Dec 23 17:42 configs/def.1/strings
      |  5122    0 drwxr-xr-x   2 root     root            0 Dec 23 17:49 configs/def.1/strings/0x409
      |  6284    0 -rw-r--r--   1 root     root         4096 Dec 23 17:47 configs/def.1/strings/0x409/configuration
      |  6285    0 -rw-r--r--   1 root     root         4096 Dec 23 17:49 configs/def.1/bmAttributes
      |  6286    0 -rw-r--r--   1 root     root         4096 Dec 23 17:49 configs/def.1/MaxPower
      |
      |echo 120 > configs/def.1/MaxPower
      |
      |# ls -lh /sys/class/udc/
      |total 0
      |lrwxrwxrwx 1 root root 0 Dec 23 17:50 dummy_udc.0 -> ../../devices/platform/dummy_udc.0/udc/dummy_udc.0
      |lrwxrwxrwx 1 root root 0 Dec 23 17:50 dummy_udc.1 -> ../../devices/platform/dummy_udc.1/udc/dummy_udc.1
      |# echo dummy_udc.0 > UDC
      |# lsusb
      |Bus 001 Device 002: ID abcd:1234 Unknown
      |
      |lsusb -d abcd:1234 -v
      |Device Descriptor:
      …
      |  idVendor           0xabcd Unknown
      |  idProduct          0x1234
      |  bcdDevice            3.06
      |  iManufacturer           1 The manufacturer
      |  iProduct                2
      |  iSerial                 3 1122
      |  bNumConfigurations      2
      …
      |echo "" > UDC
      
      v5…v6
      - wired up strings with usb_gstrings_attach()
      - add UDC attribe. Write "udc-name" will bind the gadget. Write an empty
        string (it should contain \n since 0 bytes write get optimzed away)
        will unbind the UDC from the gadget. The name of available UDCs can be
        obtained from /sys/class/udc/
      
      v4…v5
      - string rework. This will add a strings folder incl. language code like
          strings/409/manufacturer
        as suggested by Alan.
      - rebased ontop reworked functions.c which has usb_function_instance
        which is used prior after "mkdir acm.instance" and can be directly
        used for configuration via configfs.
      
      v3…v4
       - moved functions from the root folde down to the gadget as suggested
         by Michał
       - configs have now their own configs folder as suggested by Michał.
         The folder is still name.bConfigurationValue where name becomes the
         sConfiguration. Is this usefull should we just stilc
         configs/bConfigurationValue/ ?
       - added configfs support to the ACM function. The port_num attribute is
         exported by f_acm. An argument has been added to the USB alloc
         function to distinguish between "old" (use facm_configure() to
         configure and configfs interface (expose a config_node).
         The port_num is currently a dumb counter. It will
         require some function re-work to make it work.
      
      scheduled for v5:
      - sym linking function into config.
      
      v2…v3
      - replaced one ifndef by ifdef as suggested by Micahał
      - strstr()/strchr() function_make as suggested by Micahł
      - replace [iSerialNumber|iProduct|iManufacturer] with
        [sSerialNumber|sProduct|sManufacturer] as suggested by Alan
      - added creation of config descriptors
      
      v1…v2
      - moved gadgets from configfs' root directory into /udcs/ within our
        "usb_gadget" folder. Requested by Andrzej & Michał
      - use a dot as a delimiter between function's name and its instance's name
        as suggested by Michał
      - renamed all config_item_type, configfs_group_operations, make_group,
        drop_item as suggested by suggested by Andrzej to remain consisten
        within this file and within other configfs users
      - Since configfs.c and functions.c are now part of the udc-core module,
        the module itself is now called udc. Also added a tiny ifdef around
        init code becuase udc-core is subsys init and this is too early for
        configfs in the built-in case. In the module case, we can only have
        one init function.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      88af8bbe
    • S
      usb: gadget: push tty port allocation from gadget into f_acm · c4ed4ac1
      Sebastian Andrzej Siewior 提交于
      It possible to allocate the tty port number within the "instance"
      structure of the function and there is no need to expose this
      information within the gadget and therefore it is removed here.
      This patch converts only f_acm and all its users. The other gadgets will
      follow once the function is converted to the function interface.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      c4ed4ac1
    • S
      usb: gadget: move the global the_dev variable to their users · d6a01439
      Sebastian Andrzej Siewior 提交于
      the u_ether.c file has a global variable named the_dev which keeps a
      pointer to the network device after it has been created via
      gether_setup_name(). It is only used internally by u_ether. This patches
      moves the variable to its users and passes it via the port.ioport where
      it is saved later anyway.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      d6a01439
    • S
      usb: gadget: nokia: use function framework for ACM · 15761826
      Sebastian Andrzej Siewior 提交于
      This patch converts the acm_ms gadget to make use of the function
      framework to request the ACM function.
      
      The "old" include interface for acm is now removed since nokia was the
      last user of it (for ACM).
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      15761826
  11. 02 4月, 2013 7 次提交