sfrench/cifs-2.6.git
16 years agoIPoIB: Convert to NAPI
Roland Dreier [Mon, 7 May 2007 04:05:32 +0000 (21:05 -0700)]
IPoIB: Convert to NAPI

Convert the IP-over-InfiniBand network device driver over to using
NAPI to handle completions for the main CQ.  This covers all receives
as well as datagram mode sends; send completions for connected mode
connections are still handled from interrupt context.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB: Return "maybe missed event" hint from ib_req_notify_cq()
Roland Dreier [Mon, 7 May 2007 04:02:48 +0000 (21:02 -0700)]
IB: Return "maybe missed event" hint from ib_req_notify_cq()

The semantics defined by the InfiniBand specification say that
completion events are only generated when a completions is added to a
completion queue (CQ) after completion notification is requested.  In
other words, this means that the following race is possible:

while (CQ is not empty)
ib_poll_cq(CQ);
// new completion is added after while loop is exited
ib_req_notify_cq(CQ);
// no event is generated for the existing completion

To close this race, the IB spec recommends doing another poll of the
CQ after requesting notification.

However, it is not always possible to arrange code this way (for
example, we have found that NAPI for IPoIB cannot poll after
requesting notification).  Also, some hardware (eg Mellanox HCAs)
actually will generate an event for completions added before the call
to ib_req_notify_cq() -- which is allowed by the spec, since there's
no way for any upper-layer consumer to know exactly when a completion
was really added -- so the extra poll of the CQ is just a waste.

Motivated by this, we add a new flag "IB_CQ_REPORT_MISSED_EVENTS" for
ib_req_notify_cq() so that it can return a hint about whether the a
completion may have been added before the request for notification.
The return value of ib_req_notify_cq() is extended so:

 < 0 means an error occurred while requesting notification
== 0 means notification was requested successfully, and if
IB_CQ_REPORT_MISSED_EVENTS was passed in, then no
events were missed and it is safe to wait for another
event.
 > 0 is only returned if IB_CQ_REPORT_MISSED_EVENTS was
passed in.  It means that the consumer must poll the
CQ again to make sure it is empty to avoid the race
described above.

We add a flag to enable this behavior rather than turning it on
unconditionally, because checking for missed events may incur
significant overhead for some low-level drivers, and consumers that
don't care about the results of this test shouldn't be forced to pay
for the test.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB: Add CQ comp_vector support
Michael S. Tsirkin [Thu, 3 May 2007 10:48:47 +0000 (13:48 +0300)]
IB: Add CQ comp_vector support

Add a num_comp_vectors member to struct ib_device and extend
ib_create_cq() to pass in a comp_vector parameter -- this parallels
the userspace libibverbs API.  Update all hardware drivers to set
num_comp_vectors to 1 and have all ULPs pass 0 for the comp_vector
value.  Pass the value of num_comp_vectors to userspace rather than
hard-coding a value of 1.

We want multiple CQ event vector support (via MSI-X or similar for
adapters that can generate multiple interrupts), but it's not clear
how many vectors we want, or how we want to deal with policy issues
such as how to decide which vector to use or how to set up interrupt
affinity.  This patch is useful for experimenting, since no core
changes will be necessary when updating a driver to support multiple
vectors, and we know that we want to make at least these changes
anyway.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix a race condition when generating ACKs
Ralph Campbell [Thu, 3 May 2007 19:43:03 +0000 (12:43 -0700)]
IB/ipath: Fix a race condition when generating ACKs

Fix a problem where simple ACKs can be sent ahead of RDMA read
responses thus implicitly NAKing the RDMA read.

Signed-off-by: Ralph Campbell <ralph.cambpell@qlogic.com>
Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix two more spin lock problems
Ralph Campbell [Thu, 3 May 2007 19:40:51 +0000 (12:40 -0700)]
IB/ipath: Fix two more spin lock problems

Fix a missing unlock in ipath_rc_rcv_resp() and remove an extra unlock
from ipath_rc_rcv_error().

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/fmr_pool: Add prefix to all printks
Roland Dreier [Mon, 7 May 2007 04:18:11 +0000 (21:18 -0700)]
IB/fmr_pool: Add prefix to all printks

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/srp: Set proc_name
Roland Dreier [Mon, 7 May 2007 04:18:11 +0000 (21:18 -0700)]
IB/srp: Set proc_name

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/srp: Add orig_dgid sysfs attribute to scsi_host
Ishai Rabinovitz [Mon, 7 May 2007 04:18:11 +0000 (21:18 -0700)]
IB/srp: Add orig_dgid sysfs attribute to scsi_host

Add an orig_dgid attribute in sysfs for SRP scsi_hosts, so that
userspace can tell what the original dgid value written to the
add_target file was, even if the connection is redirected to a
different port while connecting.

Signed-off-by: Ishai Rabinovitz <ishai@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIPoIB/cm: Don't crash if remote side uses one QP for both directions
Michael S. Tsirkin [Wed, 2 May 2007 12:31:12 +0000 (15:31 +0300)]
IPoIB/cm: Don't crash if remote side uses one QP for both directions

The IPoIB CM spec allows the use of a single connection in both
active->passive and passive->active directions.  The current Linux
code uses one connection for both directions, but if another node only
uses one connection for both directions, we oops when we try to look
up the passive connection.  Fix by checking that qp_context is
non-NULL before dereferencing it.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
16 years agoRDMA/cxgb3: Support for new abort logic
Steve Wise [Thu, 26 Apr 2007 20:21:20 +0000 (15:21 -0500)]
RDMA/cxgb3: Support for new abort logic

The HW now posts 2 ABORT_RPL and/or PEER_ABORT_REQ messages.  We need
to handle them by silenty dropping the 1st but mark that we're ready
for the final message.  This plugs some close races between the uP and
HW.  Also update the minimum required firmware version.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/cxgb3: Initialize cpu_idx field in cpl_close_listserv_req message
Steve Wise [Thu, 26 Apr 2007 20:21:15 +0000 (15:21 -0500)]
RDMA/cxgb3: Initialize cpu_idx field in cpl_close_listserv_req message

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/cxgb3: Fail qp creation if the requested max_inline is too large
Steve Wise [Thu, 26 Apr 2007 20:21:09 +0000 (15:21 -0500)]
RDMA/cxgb3: Fail qp creation if the requested max_inline is too large

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/cxgb3: Fix TERM codes
Steve Wise [Thu, 26 Apr 2007 20:21:02 +0000 (15:21 -0500)]
RDMA/cxgb3: Fix TERM codes

Fix TERMINATE layer, type, and ecode values based on
conformance testing.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIPoIB/cm: Fix error handling in ipoib_cm_dev_open()
Michael S. Tsirkin [Tue, 1 May 2007 00:30:28 +0000 (17:30 -0700)]
IPoIB/cm: Fix error handling in ipoib_cm_dev_open()

If skb allocation fails when we start the device, we call
ipoib_cm_dev_stop() even though ipoib_cm_dev_open() did not run to
completion, so we pass an invalid pointer to ib_destroy_cm_id and get
an oops.

Fix by clearing cm.id on error, and testing it in cm_dev_stop().
This fixes <https://bugs.openfabrics.org/show_bug.cgi?id=561>

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Don't corrupt pending mmap list when unmapped objects are freed
Robert Walsh [Sat, 28 Apr 2007 04:07:23 +0000 (21:07 -0700)]
IB/ipath: Don't corrupt pending mmap list when unmapped objects are freed

Fix the pending mmap code so it doesn't corrupt the list of pending
mmaps and crash the machine when pending mmaps are destroyed without
first being mapped.  Also, remove an unused variable, and use standard
kernel lists instead of our own homebrewed linked list implementation
to keep the pending mmap list.

Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mthca: Work around kernel QP starvation
Michael S. Tsirkin [Thu, 12 Apr 2007 15:10:25 +0000 (18:10 +0300)]
IB/mthca: Work around kernel QP starvation

With mthca, RC QPs can starve each other and even UD QPs on the same
hardware schedule queue.  As a result, userspace MPI can starve
e.g. IPoIB traffic, with netdev watchdog warnings getting printed out,
and TCP connections getting stuck or failing.

Reduce the chance of this happening by using three separate hardware
schedule queues: one for userspace RC QPs, one for kernel RC QPs, and
one for all other QPs.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Don't put QP in timeout queue if waiting to send
Ralph Campbell [Fri, 27 Apr 2007 18:08:40 +0000 (11:08 -0700)]
IB/ipath: Don't put QP in timeout queue if waiting to send

This fixes a problem which causes too many RC timeouts and
retransmits.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Don't call spin_lock_irq() from interrupt context
Ralph Campbell [Fri, 27 Apr 2007 18:11:11 +0000 (11:11 -0700)]
IB/ipath: Don't call spin_lock_irq() from interrupt context

This patch fixes the problem reported by Bernd Schubert <bs@q-leap.de>
with kernel debug options enabled:

    BUG: at kernel/lockdep.c:1860 trace_hardirqs_on()

This was caused by using spin_lock_irq()/spin_unlock_irq() from
interrupt context.  Fix all the places that might be called from
interrupts to use spin_lock_irqsave()/spin_unlock_irqrestore().

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Sat, 28 Apr 2007 00:49:50 +0000 (17:49 -0700)]
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  sis900: Allocate rx replacement buffer before rx operation
  usb-net/pegasus: simplify carrier detection

16 years agosis900: Allocate rx replacement buffer before rx operation
Neil Horman [Thu, 26 Apr 2007 17:47:36 +0000 (13:47 -0400)]
sis900: Allocate rx replacement buffer before rx operation

Just found a hole in my last patch.  It was reported to me that shortly after we
integrated this patch.  The report was of an oops that took place inside of
netif_rx when using the sis900 driver.  Looking at my origional patch I noted
that there was a spot between the new skb_alloc and the refill_rx_ring label
where skb got reassigned to the pointer currently held in the rx_ring for the
purposes of receiveing the frame.  The result of this is however that the buffer
that gets passed to netif_rx (if it is called), then gets placed right back into
the rx_ring.  So if you receive frames fast enough the skb being processed by
the network stack can get corrupted.  The reporter is testing out the fix I've
written for this below (I'm not near my hardware at the moment to test myself),
but I wanted to post it for review ASAP.  I'll post test results when I hear
them, but I think this is a pretty straightforward fix.  It just uses a separate
pointer to do the rx operation, so that we don't improperly reassign the pointer
that we use to refill the rx ring.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agousb-net/pegasus: simplify carrier detection
Dan Williams [Thu, 26 Apr 2007 01:30:29 +0000 (21:30 -0400)]
usb-net/pegasus: simplify carrier detection

Simplify pegasus carrier detection; rely only on the periodic MII
polling.  Reverts pieces of c43c49bd61fdb9bb085ddafcaadb17d06f95ec43.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Fri, 27 Apr 2007 23:21:02 +0000 (16:21 -0700)]
Merge /pub/scm/linux/kernel/git/davem/sparc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SCSI] esp_scsi.c: Fix compilation.

16 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Fri, 27 Apr 2007 23:20:37 +0000 (16:20 -0700)]
Merge /pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NET]: Fix networking compilation errors
  [AF_RXRPC/AFS]: Arch-specific fixes.
  [AFS]: Fix VLocation record update wakeup
  [NET]: Revert sk_buff walker cleanups.

16 years agoMerge git://git.infradead.org/mtd-2.6
Linus Torvalds [Fri, 27 Apr 2007 22:34:57 +0000 (15:34 -0700)]
Merge git://git.infradead.org/mtd-2.6

* git://git.infradead.org/mtd-2.6: (46 commits)
  [MTD] [MAPS] drivers/mtd/maps/ck804xrom.c: convert pci_module_init()
  [MTD] [NAND] CM-x270 MTD driver
  [MTD] [NAND] Wrong calculation of page number in nand_block_bad()
  [MTD] [MAPS] fix plat-ram printk format
  [JFFS2] Fix compr_rubin.c build after include file elimination.
  [JFFS2] Handle inodes with only a single metadata node with non-zero isize
  [JFFS2] Tidy up licensing/copyright boilerplate.
  [MTD] [OneNAND] Exit loop only when column start with 0
  [MTD] [OneNAND] Fix access the past of the real oobfree array
  [MTD] [OneNAND] Update Samsung OneNAND official URL
  [JFFS2] Better fix for all-zero node headers
  [JFFS2] Improve read_inode memory usage, v2.
  [JFFS2] Improve failure mode if inode checking leaves unchecked space.
  [JFFS2] Fix cross-endian build.
  [MTD] Finish conversion mtd_blkdevs to use the kthread API
  [JFFS2] Obsolete dirent nodes immediately on unlink, where possible.
  Use menuconfig objects: MTD
  [MTD] mtd_blkdevs: Convert to use the kthread API
  [MTD] Fix fwh_lock locking
  [JFFS2] Speed up mount for directly-mapped NOR flash
  ...

16 years ago[MTD] [MAPS] drivers/mtd/maps/ck804xrom.c: convert pci_module_init()
Adrian Bunk [Thu, 26 Apr 2007 23:48:01 +0000 (01:48 +0200)]
[MTD] [MAPS] drivers/mtd/maps/ck804xrom.c: convert pci_module_init()

This patch converts the pci_module_init() usage to pci_register_driver().

It's currently #if 0'ed, but still not a bad idea to change it.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
16 years ago[NET]: Fix networking compilation errors
David Howells [Fri, 27 Apr 2007 22:31:24 +0000 (15:31 -0700)]
[NET]: Fix networking compilation errors

Fix miscellaneous networking compilation errors.

 (*) Export ktime_add_ns() for modules.

 (*) wext_proc_init() should have an ANSI declaration.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[AF_RXRPC/AFS]: Arch-specific fixes.
David Howells [Fri, 27 Apr 2007 22:28:45 +0000 (15:28 -0700)]
[AF_RXRPC/AFS]: Arch-specific fixes.

Fixes for various arch compilation problems:

 (*) Missing module exports.

 (*) Variable name collision when rxkad and af_rxrpc both built in
     (rxrpc_debug).

 (*) Large constant representation problem (AFS_UUID_TO_UNIX_TIME).

 (*) Configuration dependencies.

 (*) printk() format warnings.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[AFS]: Fix VLocation record update wakeup
David Howells [Fri, 27 Apr 2007 22:26:30 +0000 (15:26 -0700)]
[AFS]: Fix VLocation record update wakeup

Fix the wakeup transitions after a VLocation record update completes
one way or another.  This builds on Dave Miller's partial fix.

Also move wakeups outside the spinlocked sections.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: Revert sk_buff walker cleanups.
David S. Miller [Fri, 27 Apr 2007 22:21:23 +0000 (15:21 -0700)]
[NET]: Revert sk_buff walker cleanups.

This reverts eefa3906283a2b60a6d02a2cda593a7d7d7946c5

The simplification made in that change works with the assumption that
the 'offset' parameter to these functions is always positive or zero,
which is not true.  It can be and often is negative in order to access
SKB header values in front of skb->data.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SCSI] esp_scsi.c: Fix compilation.
Alexey Dobriyan [Fri, 27 Apr 2007 22:19:27 +0000 (15:19 -0700)]
[SCSI] esp_scsi.c: Fix compilation.

irqreturn.h for irqreturn_t and dma_addr_t being u128 warnings ;-)

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[MTD] [NAND] CM-x270 MTD driver
Mike Rapoport [Sun, 22 Apr 2007 05:53:21 +0000 (08:53 +0300)]
[MTD] [NAND] CM-x270 MTD driver

This patch provides MTD support for NAND flash devices on CM-x270 modules.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
16 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
Linus Torvalds [Fri, 27 Apr 2007 21:19:17 +0000 (14:19 -0700)]
Merge /pub/scm/linux/kernel/git/gregkh/usb-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (78 commits)
  USB: update MAINAINERS and CREDITS for Freescale USB driver
  USB: update gadget files for fsl_usb2_udc driver
  USB: add Freescale high-speed USB SOC device controller driver
  USB: quirk for broken suspend of IT8152F/G
  USB: iowarrior.c: timeouts too small in usb_control_msg calls
  USB: dell device id for option.c
  USB: Remove Huawei unusual_devs entry
  USB: CP2101 New Device IDs
  USB: add picdem device to ldusb
  usbfs micro optimitation
  USB: remove ancient/broken CRIS hcd
  usb ethernet gadget, workaround network stack API glitch
  USB: add "busnum" attribute for USB devices
  USB: cxacru: ADSL state management
  usbatm: Detect usb device shutdown and ignore failed urbs
  USB: Remove duplicate define of OHCI_QUIRK_ZFMICRO
  USB: BandRich BandLuxe HSDPA Data Card Driver
  USB gadget rndis: fix struct rndis_packet_msg_type unaligned bug
  USB Elan FTDI: check for driver registration status
  USB: sierra: add more checks on shutdown
  ...

16 years agoMerge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Fri, 27 Apr 2007 21:18:45 +0000 (14:18 -0700)]
Merge branch 'master' of ssh:///linux/kernel/git/mchehab/v4l-dvb

* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (184 commits)
  V4L/DVB (5563): Radio-maestro.c Replace radio_ioctl to use video_ioctl2
  V4L/DVB (5562): Radio-gemtek-pci.c Replace gemtek_pci_ioctl to use video_ioctl2
  V4L/DVB (5560): Ivtv: fix incorrect bitwise-and for command flags.
  V4L/DVB (5558): Opera: use 7-bit i2c addresses
  V4L/DVB (5557): Cafe_ccic: check return value of pci_enable_device
  V4L/DVB (5556): Radio-gemtek.c Replace gemtek_ioctl to use video_ioctl2
  V4L/DVB (5555): Radio-aimslab.c Replace rt_ioctl to use video_ioctl2
  V4L/DVB (5554): Fix: vidioc_g_parm were not zeroing the memory
  V4L/DVB (5553): Replace typhoon_do_ioctl to use video_ioctl2
  V4L/DVB (5552): Plan-b: Switch to refcounting PCI API
  V4L/DVB (5551): Plan-b: header change
  V4L/DVB (5550): Radio-sf16fmi.c Replace fmi_do_ioctl to use video_ioctl2
  V4L/DVB (5549): Radio-sf16fmr2.c Replace fmr2_do_ioctl to use video_ioctl2
  V4L/DVB (5548): Fix v4l2 buffer to the length
  V4L/DVB (5547): Add ENUM_FRAMESIZES and ENUM_FRAMEINTERVALS ioctls
  V4L/DVB (5546): Radio-terratec.c Replace tt_do_ioctl to use video_ioctl2
  V4L/DVB (5545): Saa7146: Release capture buffers on device close
  V4L/DVB (5544): Budget-av: Make inversion setting configurable, add KNC ONE V1.0 card
  V4L/DVB (5543): Tda10023: Add support for frontend TDA10023
  V4L/DVB (5542): Budget-av: Remove polarity switching of the clock for DVB-C
  ...

16 years agoUSB: update MAINAINERS and CREDITS for Freescale USB driver
Li Yang [Mon, 23 Apr 2007 17:38:18 +0000 (10:38 -0700)]
USB: update MAINAINERS and CREDITS for Freescale USB driver

Add MAINAINERS and CREDITS entry for Freescale Highspeed USB device
driver.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: update gadget files for fsl_usb2_udc driver
Li Yang [Mon, 23 Apr 2007 17:37:36 +0000 (10:37 -0700)]
USB: update gadget files for fsl_usb2_udc driver

Update gadget_chip.c, ether.c for newly added Freescale Highspeed USB
device driver.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add Freescale high-speed USB SOC device controller driver
Li Yang [Mon, 23 Apr 2007 17:54:25 +0000 (10:54 -0700)]
USB: add Freescale high-speed USB SOC device controller driver

Freescale high-speed USB SOC can be found on some Freescale processors
among different architectures.  It supports both host and device functions.
This driver adds its device support for Linux USB Gadget layer.
It is tested on MPC8349 and MPC8313, but should work on other platforms
with minor tweaks.  The driver passed USBCV 1.3 compliance tests.  Note
that this driver doesn't yet include OTG support.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Jiang Bo <tanya.jiang@freescale.com>
Signed-off-by: Bruce Schmid <duck@freescale.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: quirk for broken suspend of IT8152F/G
Raphael Assenat [Tue, 17 Apr 2007 20:09:18 +0000 (13:09 -0700)]
USB: quirk for broken suspend of IT8152F/G

Here's a patch which adds my device to the list.

This patch enables the broken suspend quirk for the PCI OHCI controller
present in the IT8152F/G RISC-to-PCI Companion Chip.

Signed-off-by: Raphael Assenat <raph@8d.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: iowarrior.c: timeouts too small in usb_control_msg calls
Eberhard Fahle [Thu, 5 Apr 2007 09:13:21 +0000 (11:13 +0200)]
USB: iowarrior.c: timeouts too small in usb_control_msg calls

The driver uses usb_control_msg() for exchanging data with the device.
When the driver lived freeley _outside_ the kernel tree (pre 2.6.21) the
timeouts for these calls where set to 5*HZ for reading, 1HZ for writing.
(These timeouts seemed to work fine for all users of the driver, at
least nobody complained in the last 2 years.

The current code (2.6.21-rc5) removed the 'HZ' from the timeouts and
left the driver with 5 jiffies for reading and 1 jiffy for writing. My
new machine is fast, but not that fast.

The patch also removes a useless debug statement, which was left over
from testing a broken firmware version

From: Eberhard Fahle <e.fahle@wayoda.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: dell device id for option.c
Hans Engelen [Thu, 12 Apr 2007 12:40:26 +0000 (14:40 +0200)]
USB: dell device id for option.c

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Remove Huawei unusual_devs entry
Phil Dibowitz [Mon, 16 Apr 2007 06:42:40 +0000 (23:42 -0700)]
USB: Remove Huawei unusual_devs entry

Per the Rui Santos and the hardware manufacturers, this actually inhibits
useful parts of the hardware. The correct way to use this hardware is with the
software at http://www.kanoistika.sk/bobovsky/archiv/umts/ and the manufacturers
are also planning on including Linux drivers/material in future revisions.

CC: Rui Santos <rsantos@grupopie.com>
CC: <johann.wilhelm@student.tugraz.at>
CC: <zihan@huawei.com>
CC: <wanganyu1983@huawei.com>
CC: <dingjianjian@huawei.com>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: CP2101 New Device IDs
Craig Shelley [Fri, 20 Apr 2007 13:37:17 +0000 (14:37 +0100)]
USB: CP2101 New Device IDs

Two new device IDs for CP2101 driver.

Signed-off-by: Craig Shelley <craig@microtron.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add picdem device to ldusb
Joey Goncalves [Fri, 20 Apr 2007 18:05:54 +0000 (11:05 -0700)]
USB: add picdem device to ldusb

Hi Greg:

I have found that  /drivers/usb/misc/ldusb.c  works with the "PICDEM Full
Speed USB"
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en021940

Signed-off-by: Joey S Goncalves <jgoncalves@peragrin.com>
Cc: Michael Hund <MHund@LD-Didactic.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbfs micro optimitation
Oliver Neukum [Fri, 20 Apr 2007 18:50:48 +0000 (20:50 +0200)]
usbfs micro optimitation

the memory barrier is needed only with smp.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: remove ancient/broken CRIS hcd
David Brownell [Sun, 22 Apr 2007 18:05:52 +0000 (11:05 -0700)]
USB: remove ancient/broken CRIS hcd

Remove the old crisv10 HCD ... it can't have built for some time,
doesn't even have a Kconfig entry, was the last driver not to have
been converted to the "hcd" framework, and considering the usbcore
changes since its last patch was merged, has just got to buggy as
all get-out.

I'm told Axis has a new driver, and will be submitting it soon.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousb ethernet gadget, workaround network stack API glitch
Erik Hovland [Mon, 23 Apr 2007 17:50:15 +0000 (10:50 -0700)]
usb ethernet gadget, workaround network stack API glitch

Another workaround for the glitch in the network layer, whereby one call
ignores the (otherwise kernel-wide) convention that free() calls should
not oops when passed nulls.  This code already handles that API glitch in
most other paths.

From: Erik Hovland <erik@hovland.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add "busnum" attribute for USB devices
Alan Stern [Wed, 25 Apr 2007 19:15:43 +0000 (15:15 -0400)]
USB: add "busnum" attribute for USB devices

This patch (as903) adds a "busnum" sysfs attribute for USB devices.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: cxacru: ADSL state management
Simon Arlott [Thu, 26 Apr 2007 07:38:05 +0000 (00:38 -0700)]
USB: cxacru: ADSL state management

The device has commands to start/stop the ADSL function, so this adds a
sysfs attribute to allow it to be started/stopped/restarted.  It also stops
polling the device for status when the ADSL function is disabled.

There are no problems with sending multiple start or stop commands, even
with a fast loop of them the device still works.  There is no need to
protect the restart process from further user actions while it's waiting
for 1.5s.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: Duncan Sands <duncan.sands@math.u-psud.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbatm: Detect usb device shutdown and ignore failed urbs
Simon Arlott [Thu, 26 Apr 2007 07:38:04 +0000 (00:38 -0700)]
usbatm: Detect usb device shutdown and ignore failed urbs

Detect usb device shutdown and ignore failed urbs.  This happens when the
driver is unloaded or the device is unplugged.

I'm not sure what other urb statuses should be ignored, and the warning
message doesn't need to be shown when the module is unloaded or the device
is removed.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: Duncan Sands <duncan.sands@math.u-psud.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Remove duplicate define of OHCI_QUIRK_ZFMICRO
S.Caglar Onur [Thu, 26 Apr 2007 07:38:03 +0000 (00:38 -0700)]
USB: Remove duplicate define of OHCI_QUIRK_ZFMICRO

Remove duplicate define of OHCI_QUIRK_ZFMICRO from ftdi-elan.c, its already
defined in drivers/ush/host/ohci.c

Signed-off-by: "S.Caglar Onur" <caglar@pardus.org.tr>
Cc: <tony.olech@elandigitalsystems.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: BandRich BandLuxe HSDPA Data Card Driver
Leon Leong [Thu, 26 Apr 2007 07:38:02 +0000 (00:38 -0700)]
USB: BandRich BandLuxe HSDPA Data Card Driver

Add the detection for the BandRich BandLuxe C100/C100S/C120 HSDPA Data
Card.  With the vendor and product IDs are set properly, the data card can
be detected and works fine.

Signed-off-by: Leon Leong <upleong@bandrich.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB gadget rndis: fix struct rndis_packet_msg_type unaligned bug
Wu, Bryan [Thu, 26 Apr 2007 07:38:01 +0000 (00:38 -0700)]
USB gadget rndis: fix struct rndis_packet_msg_type unaligned bug

skb_push function may return a pointer which is not aligned as required
by struct rndis_packet_msg_type. Using attribute trick to fix this bug.

Signed-off-by: Roy Huang <roy.huang@analog.com>
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB Elan FTDI: check for driver registration status
Cyrill Gorcunov [Thu, 26 Apr 2007 07:38:00 +0000 (00:38 -0700)]
USB Elan FTDI: check for driver registration status

Add checking of driver registration status and release allocated resources
if it failed.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: "Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: sierra: add more checks on shutdown
Greg Kroah-Hartman [Thu, 26 Apr 2007 07:12:01 +0000 (00:12 -0700)]
USB: sierra: add more checks on shutdown

This should help with any potential NULL pointer usages as reported by a
few users.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add an ohci board-specific quirk
David Brownell [Tue, 17 Apr 2007 20:06:29 +0000 (13:06 -0700)]
USB: add an ohci board-specific quirk

Use the new ohci-pci quirk infrastructure to address the problem it was
created to address: a quirk specific to the Portege 4000, in buzilla as

http://bugzilla.kernel.org/show_bug.cgi?id=6723

Also fix a misuse of "__devinit" for the quirk functions.  It must not
be used without first ensuring that the references from the quirk tables
are gone, and that the function using those quirk tables is also gone.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: usbnet reports minidriver name through ethtool
David Brownell [Tue, 17 Apr 2007 23:10:10 +0000 (16:10 -0700)]
USB: usbnet reports minidriver name through ethtool

Update "usbnet" so that ethtool reports the name of the minidriver in use
(e.g. asix, cdc_ether, dm9601, rndis_host) instead of "usbnet".  This is a
better match to how other network drivers work, resolving a minor open issue.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: rndis_host, various cleanups
David Brownell [Wed, 18 Apr 2007 00:53:20 +0000 (17:53 -0700)]
USB: rndis_host, various cleanups

Cleanups to the rndis_host code, and a tweak that helps talking to
PXA hardware.  Mostly from Ole André Vadla RavnÃ¥s <oleavr@gmail.com>

  - Prevent SET_INTERFACE requests, they give PXA hardware bad indigestion
  - For paranoia, null a pointer after freeing its data
  - Wrap up ActiveSync oddities for RNDIS_QUERY in one routine
  - Use that wrapper when getting the Ethernet address
  - Whitespace fixes

Plus add a comment noting the open issues about some RNDIS clients still
needing TBD kinds of browbeating to accept non-jumbogram packets.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: <linux/usb/ch9.h> minor doc update
David Brownell [Wed, 18 Apr 2007 00:51:38 +0000 (17:51 -0700)]
USB: <linux/usb/ch9.h> minor doc update

Minor doc update to <linux/usb/ch9.h> ... say where USB_DT_CS_* came
from and update the definitions to match how they're derived there.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix signed jiffies issue in autosuspend logic
Alan Stern [Wed, 11 Apr 2007 16:06:16 +0000 (12:06 -0400)]
USB: fix signed jiffies issue in autosuspend logic

This patch (as897) changes the autosuspend timer code to use the
standard types and macros in dealing with jiffies values.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbmon: bus zero
Pete Zaitcev [Wed, 11 Apr 2007 20:47:26 +0000 (13:47 -0700)]
usbmon: bus zero

Add the "bus zero" feature to the usbmon. If a user process specifies bus
with number zero, it receives events from all buses. This is useful when
we wish to see initial enumeration when a bus is created, typically after
a modprobe. Until now, an application had to loop until a new bus could
be open, then start capturing on it. This procedure was cumbersome and
could lose initial events. Also, often it's too bothersome to find exactly
to which bus a specific device is attached.

Paolo Albeni provided the original concept implementation. I added the
handling of "bus->monitored" flag and generally fixed it up.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Allow transfer_buffer with transfer_dma
Tony Lindgren [Sun, 1 Apr 2007 01:15:43 +0000 (18:15 -0700)]
USB: Allow transfer_buffer with transfer_dma

Some host controller drivers may need a PIO fallback when a DMA channel
is temporarily unavailable.  This patch provides an address that such
drivers can use for PIO in those cases, and nulls that field out when
no such address is available (highmem) which should help usbmon.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: cleanup ofd adutux
Oliver Neukum [Mon, 2 Apr 2007 13:16:36 +0000 (15:16 +0200)]
USB: cleanup ofd adutux

this driver does
- ignore errors during open
- submit a running urb
- use down_interruptible not handling signals
- GFP_KERNEL with a spinlock held

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add "last_busy" field for use in autosuspend
Alan Stern [Tue, 27 Mar 2007 17:33:59 +0000 (13:33 -0400)]
USB: add "last_busy" field for use in autosuspend

This patch (as877) adds a "last_busy" field to struct usb_device, for
use by the autosuspend framework.  Now if an autosuspend call comes at
a time when the device isn't busy but hasn't yet been idle for long
enough, the timer can be set to exactly the desired value.  And we
will be ready to handle things like HID drivers, which can't maintain
a useful usage count and must rely on the time-of-last-use to decide
when to autosuspend.

The patch also makes some related minor improvements:

Move the calls to the autosuspend condition-checking routine
into usb_suspend_both(), which is the only place where it
really matters.

If the autosuspend timer is already running, don't stop
and restart it.

Replace immediate returns with gotos so that the optional
debugging ouput won't be bypassed.

If autoresume is disabled but the device is already awake,
don't return an error for an autoresume call.

Don't try to autoresume a device if it isn't suspended.
(Yes, this undercuts the previous change -- so sue me.)

Don't duplicate existing code in the autosuspend work routine.

Fix the kerneldoc in usb_autopm_put_interface(): If an
autoresume call fails, the usage counter is left unchanged.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: whiteheat: Convert to generic boolean
Richard Knutsson [Tue, 27 Mar 2007 06:00:28 +0000 (22:00 -0800)]
USB: whiteheat: Convert to generic boolean

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Acked-by: Stuart MacDonald <stuartm@connecttech.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix omninet write vs. close race
Oliver Neukum [Tue, 27 Mar 2007 14:02:34 +0000 (16:02 +0200)]
USB: fix omninet write vs. close race

omninet kills all URBs in close. However write() returns as soon as
the URB has been submitted. Killing the last URB means a race that
can lose that date written in the last call to write().
As a fix this is moved to shutdown().

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix error handling for mct_u232
Oliver Neukum [Thu, 29 Mar 2007 08:45:17 +0000 (10:45 +0200)]
USB: fix error handling for mct_u232

we report errors to the caller. THis patch adds error handling to the driver.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix error handling in kl5kusb
Oliver Neukum [Thu, 29 Mar 2007 09:23:54 +0000 (11:23 +0200)]
USB: fix error handling in kl5kusb

- report errors
- cleanup in error case
- use of endianness macros

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix catc error handling
Oliver Neukum [Fri, 30 Mar 2007 11:11:00 +0000 (13:11 +0200)]
USB: fix catc error handling

this driver ignores errors while starting the transmit queue. It will
never be reported stopped as the completion handler won't run
and it will never be started again as it will be considered started.
This patch adds error handling.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: cypress_cy7c63: race disconnect/sysfs read-write leading to following NULL pointer
Oliver Neukum [Fri, 30 Mar 2007 08:52:16 +0000 (10:52 +0200)]
USB: cypress_cy7c63: race disconnect/sysfs read-write leading to following NULL pointer

this driver sets intfdata to NULL while it still can be read and happily followed.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix ark3116 memory leak
Oliver Neukum [Mon, 26 Mar 2007 16:12:44 +0000 (18:12 +0200)]
USB: fix ark3116 memory leak

this driver has a memory leak in an error case.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ftdi_sio: Add USB ID of ADSTech USBX-707
Jelle Foks [Mon, 26 Mar 2007 01:08:35 +0000 (21:08 -0400)]
USB: ftdi_sio: Add USB ID of ADSTech USBX-707

This patch adds the USB ID of the ADS Tech USBX-707 USB IR blaster (that
comes with the ADS Tech PTV-305 grabber card), which has a ftdi232bm
inside hooked up to a pic.

With this it should be fairly straightforward to make at least lirc
receiving work with this device. I will submit a patch to lirc for that
as soon as I have one ready, I'm getting data with minicom with this
patch, but need to figure out some more details such as best/correct
baudrate.

Signed-off-by: Jelle Foks <jelle@foks.8m.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix race in ftdio_write
Oliver Neukum [Fri, 23 Mar 2007 13:30:16 +0000 (14:30 +0100)]
USB: fix race in ftdio_write

this has the same race as the visor driver. The counter must be incremented
under the lock it is checked under.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix race in visor_write
Oliver Neukum [Fri, 23 Mar 2007 10:58:03 +0000 (11:58 +0100)]
USB: fix race in visor_write

this fixes a small race in visor_write.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: aircable cleanup
Oliver Neukum [Mon, 26 Mar 2007 14:55:16 +0000 (16:55 +0200)]
USB: aircable cleanup

- proper endianness macros
- scheduling in interrupt in error case

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Naranjo Manuel Francisco <naranjo.manuel@gmail.com>
16 years agoUSB: make usbdevices export their device nodes instead of using a separate class
Kay Sievers [Tue, 13 Mar 2007 14:59:31 +0000 (15:59 +0100)]
USB: make usbdevices export their device nodes instead of using a separate class

o The "real" usb-devices export now a device node which can
  populate /dev/bus/usb.

o The usb_device class is optional now and can be disabled in the
  kernel config. Major/minor of the "real" devices and class devices
  are the same.

o The environment of the usb-device event contains DEVNUM and BUSNUM to
  help udev and get rid of the ugly udev rule we need for the class
  devices.

o The usb-devices and usb-interfaces share the same bus, so I used
  the new "struct device_type" to let these devices identify
  themselves. This also removes the current logic of using a magic
  platform-pointer.
  The name of the device_type is also added to the environment
  which makes it easier to distinguish the different kinds of devices
  on the same subsystem.

  It looks like this:
    add@/devices/pci0000:00/0000:00:1d.1/usb2/2-1
    ACTION=add
    DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb2/2-1
    SUBSYSTEM=usb
    SEQNUM=1533
    MAJOR=189
    MINOR=131
    DEVTYPE=usb_device
    PRODUCT=46d/c03e/2000
    TYPE=0/0/0
    BUSNUM=002
    DEVNUM=004

This udev rule works as a replacement for usb_device class devices:
  SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
    NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"

Updated patch, which needs the device_type patches in Greg's tree.

I also got a bugzilla assigned for this. :)
  https://bugzilla.novell.com/show_bug.cgi?id=250659

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: gadget-storage needs BLOCK
Randy Dunlap [Wed, 21 Mar 2007 20:57:51 +0000 (13:57 -0700)]
USB: gadget-storage needs BLOCK

With CONFIG_BLOCK=n, this build error happens:
WARNING: "bdev_read_only" [drivers/usb/gadget/g_file_storage.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: add power/level sysfs attribute
Alan Stern [Tue, 20 Mar 2007 18:59:39 +0000 (14:59 -0400)]
USB: add power/level sysfs attribute

This patch (as874) adds another piece to the user-visible part of the
USB autosuspend interface.  The new power/level sysfs attribute allows
users to force the device on (with autosuspend off), force the device
to sleep (with autoresume off), or return to normal automatic operation.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: ati_remote2: Add channel support
Peter Stokes [Sat, 17 Mar 2007 14:14:12 +0000 (16:14 +0200)]
USB: ati_remote2: Add channel support

Add logical channel support for ATI Remote Wonder II

The ATI Remote Wonder II can be configured with one of 16 unique logical
channels. Allowing up to 16 remotes to be used independently within
range of each other. This change adds functionality to configure the
receiver and filter the input data to respond or exclude remotes
configured with different logical channels.

Signed-off-by: Peter Stokes <linux@dadeos.freeserve.co.uk>
Acked-by: Ville Syrjala <syrjala@sci.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: sierra close race
Oliver Neukum [Tue, 20 Mar 2007 12:54:05 +0000 (13:54 +0100)]
USB: sierra close race

the sierra driver does not directly use usb_kill_urb(). It uses a wrapper.
This wrapper means that callbacks which are running are not killed during
close, resubmitting and illicitly pushing data into the tty layer.
The whole purpose of usb_kill_urb() is subverted. The wrapper must be removed.
The same problem as the option driver.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: option close race
Oliver Neukum [Tue, 20 Mar 2007 12:41:21 +0000 (13:41 +0100)]
USB: option close race

the option driver does not directly use usb_kill_urb(). It uses a wrapper.
This wrapper means that callbacks which are running are not killed during
close, resubmitting and illicitly pushing data into the tty layer.
The whole purpose of usb_kill_urb() is subverted. The wrapper must be removed.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: omninet memory leak in error case
Oliver Neukum [Tue, 20 Mar 2007 12:15:05 +0000 (13:15 +0100)]
USB: omninet memory leak in error case

memory allocated must be freed in the error case.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUHCI: Add some WARN_ON()s
Alan Stern [Mon, 19 Mar 2007 19:33:11 +0000 (15:33 -0400)]
UHCI: Add some WARN_ON()s

This patch (as872) adds some WARN_ON()s to various error checks which
are never supposed to fail.  Unsettlingly, one of them has shown up in
a user's log!  Maybe making the warning more visible and having the
call-stack information available will help pinpoint the source of the
problem.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix endianness in mos7720
Oliver Neukum [Mon, 19 Mar 2007 12:58:29 +0000 (13:58 +0100)]
USB: fix endianness in mos7720

there's code unclean w.r.t. endianness in the mos7720 driver.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: gtco.c: fix a use-before-check
Adrian Bunk [Mon, 19 Mar 2007 09:26:32 +0000 (10:26 +0100)]
USB: gtco.c: fix a use-before-check

NULL checks should be before the first dereference.

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: iowarrior.c: fix NULL dereference
Oliver Neukum [Mon, 19 Mar 2007 10:39:13 +0000 (11:39 +0100)]
USB: iowarrior.c: fix NULL dereference

Am Montag, 19. 2007 10:25 schrieb Adrian Bunk:
> The Coverity checker spotted the following NULL dereference:

And this fixes an oops upon allocation failures.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: dm9601: fix sparse NULL warnings
Randy Dunlap [Sat, 17 Mar 2007 01:33:13 +0000 (18:33 -0700)]
USB: dm9601: fix sparse NULL warnings

Fix sparse NULL warnings:

drivers/usb/net/dm9601.c:88:23: warning: Using plain integer as NULL pointer
drivers/usb/net/dm9601.c:174:22: warning: Using plain integer as NULL pointer

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: io_edgeport: Convert to generic boolean
Richard Knutsson [Sat, 17 Mar 2007 00:35:53 +0000 (01:35 +0100)]
USB: io_edgeport: Convert to generic boolean

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: overhaul of mos7840 driver
Oliver Neukum [Fri, 16 Mar 2007 19:28:28 +0000 (20:28 +0100)]
USB: overhaul of mos7840 driver

This fixes:

- breaking DMA rules about buffers
- usage of _global_ variables to save a single device's attributes
- racy access to urb->status
- smp monotonity issue with statistics
- use of one buffer for many simultaneous URBs
- error handling introduced
- several instances of following NULL pointers
- use after free
- unnecessary GFP_ATOMIC
- GFP_KERNEL in interrupt
- various cleanups
- write room granularity issue that bit cdc-acm
- race in shutdown

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: io_edgeport race condition in counters
Oliver Neukum [Thu, 15 Mar 2007 14:27:17 +0000 (15:27 +0100)]
USB: io_edgeport race condition in counters

io_edgeport is using a global variable without locking.
This is _the_ classical race condition. This patch switches to atomic_t.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoEHCI: add delay to bus_resume before accessing ports
Alan Stern [Thu, 15 Mar 2007 19:54:30 +0000 (15:54 -0400)]
EHCI: add delay to bus_resume before accessing ports

This patch (as870) adds a delay to ehci-hcd's bus_resume routine.
Apparently there are controllers and/or BIOSes out there which need
such a delay to get the ports back into their correct state.  This
fixes Bugzilla #8190.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: Allow autosuspend delay to equal 0
Alan Stern [Tue, 13 Mar 2007 20:39:15 +0000 (16:39 -0400)]
USB: Allow autosuspend delay to equal 0

This patch (as867) adds an entry for the new power/autosuspend
attribute in Documentation/ABI/testing, and it changes the behavior of
the delay value.  Now a delay of 0 means to autosuspend as soon as
possible, and negative values will prevent autosuspend.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: separate autosuspend from external suspend
Alan Stern [Tue, 13 Mar 2007 20:37:30 +0000 (16:37 -0400)]
USB: separate autosuspend from external suspend

This patch (as866) adds new entry points for external USB device
suspend and resume requests, as opposed to internally-generated
autosuspend or autoresume.  It also changes the existing
remote-wakeup code paths to use the new routines, since remote wakeup
is not the same as autoresume.

As part of the change, it turns out to be necessary to do remote
wakeup of root hubs from a workqueue.  We had been using khubd, but it
does autoresume rather than an external resume.  Using the
ksuspend_usb_wq workqueue for this purpose seemed a logical choice.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: help text for mos 7720 driver
Oliver Neukum [Wed, 14 Mar 2007 14:23:56 +0000 (15:23 +0100)]
USB: help text for mos 7720 driver

this driver's help text incorrectly claims to support only single port
devices.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agomos7720 update
Oliver Neukum [Wed, 14 Mar 2007 14:22:25 +0000 (15:22 +0100)]
mos7720 update

this driver has an interesting way of handling ENOMEM: complain and ignore.
If you decide to live with allocation failures, you must

1. guard against URBs without corresponding buffers
2. complete allocation failures
3. always test entries for NULL before you follow the pointers

This patch does so.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoehci-fsl: change SI_CTRL, PRI_CTRL register offsets according to errata
Christian Engelmayer [Mon, 12 Mar 2007 08:08:36 +0000 (09:08 +0100)]
ehci-fsl: change SI_CTRL, PRI_CTRL register offsets according to errata

Correct the offsets of the SI_CTRL, PRI_CTRL registers according to
the Reference Manual errata sheet in order to prevent unwanted
settings regarding burst transactions and priority states.

Signed-off-by: Christian Engelmayer <Christian.Engelmayer@frequentis.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: fix race in HCD removal
Alan Stern [Tue, 13 Mar 2007 15:10:52 +0000 (11:10 -0400)]
USB: fix race in HCD removal

This patch (as865) fixes a race in the HCD removal code discovered by
Milan Plzik.  Arrival of an interrupt after the root hub was
unregistered could cause the root-hub status timer to start up, even
after it was supposed to have been shut down.  The problem is fixed by
moving the del_timer_sync() call to after the HCD's stop() method, at
which time IRQ generation should be disabled.

Cc: Milan Plzik <milan.plzik@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: MAINTAINERS: cxacru
Simon Arlott [Tue, 6 Mar 2007 10:47:46 +0000 (02:47 -0800)]
USB: MAINTAINERS: cxacru

I've acquired a second device for testing and plan to make some changes in
the near future to export all the device stats to sysfs (based on my
proposed patch to add them to the proc file ~2007-01-30).

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Acked-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: cxacru: export detailed device info through sysfs
Simon Arlott [Tue, 6 Mar 2007 10:47:45 +0000 (02:47 -0800)]
USB: cxacru: export detailed device info through sysfs

When the device is polled for status there is a lot of useful status
information available that is ignored.  This patch stores the device info
array when the status is polled and adds sysfs files to the usb device to
allow userspace to query it.  Since the device updates its status
internally once a second the poll time is changed to this, and
round_jiffies_relative is used to avoid waking the cpu unnecessarily.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: Duncan Sands <duncan.sands@free.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbatm: create sysfs link "device" from atm class device to usb interface
Simon Arlott [Tue, 6 Mar 2007 10:47:43 +0000 (02:47 -0800)]
usbatm: create sysfs link "device" from atm class device to usb interface

There is currently no path from the ATM device in /sys to the USB device's
interface that the driver is using; this patch creates a "device" symlink.  It
is then possible to get to the cxacru ADSL statistics
(http://lkml.org/lkml/2007/2/23/328):

/sys/class/atm/cxacru0/device $ ls *_rate *_margin *_attenuation
downstream_attenuation  downstream_snr_margin  upstream_rate
downstream_rate         upstream_attenuation   upstream_snr_margin

If this link is not appropriate I'd have to create device files in
/sys/class/atm/cxacru0 instead - which seems less appropriate since the ADSL
statistics are for the USB device not ATM (which is running over the ADSL).

[akpm@linux-foundation.org: cleanups]
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: Duncan Sands <duncan.sands@math.u-psud.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: unnecessary GFP_ATOMIC in mos7720 driver
Oliver Neukum [Tue, 6 Mar 2007 15:21:22 +0000 (16:21 +0100)]
USB: unnecessary GFP_ATOMIC in mos7720 driver

GFP_KERNEL will do.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agousbcore: move usb_autosuspend_work
Alan Stern [Fri, 9 Mar 2007 20:41:13 +0000 (15:41 -0500)]
usbcore: move usb_autosuspend_work

This patch (as864) moves the work routine for USB autosuspend from one
source file to another.  This permits the removal of one whole global
symbol (!) and should smooth the way for more changes in the future.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>