1. 11 8月, 2010 40 次提交
    • R
      param: remove unnecessary writable charp · dca41306
      Rusty Russell 提交于
      sysfs-writable charp arguments need to be locked against modification
      (since the old ones may be kfreed underneath us).  String arguments
      are much simpler, so use them for small strings (eg. IFNAMSIZ).
      
      lkdtm only uses the parameters at module initialization time, so there's
      not much point making them writable.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Tested-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: M. Mohan Kumar <mohan@in.ibm.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Cc: Jeff Mahoney <jeffm@suse.com>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: devel@driverdev.osuosl.org
      dca41306
    • R
      param: add kerneldoc to moduleparam.h · 546970bc
      Rusty Russell 提交于
      Also reorders the macros with the most common ones at the top.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Tested-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
      546970bc
    • R
      param: locking for kernel parameters · 907b29eb
      Rusty Russell 提交于
      There may be cases (most obviously, sysfs-writable charp parameters) where
      a module needs to prevent sysfs access to parameters.
      
      Rather than express this in terms of a big lock, the functions are
      expressed in terms of what they protect against.  This is clearer, esp.
      if the implementation changes to a module-level or even param-level lock.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Tested-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
      907b29eb
    • R
      param: make param sections const. · 914dcaa8
      Rusty Russell 提交于
      Since this section can be read-only (they're in .rodata), they should
      always have been const.  Minor flow-through various functions.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Tested-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
      914dcaa8
    • R
      param: use free hook for charp (fix leak of charp parameters) · a1054322
      Rusty Russell 提交于
      Instead of using a "I kmalloced this" flag, we keep track of the kmalloced
      strings and use that list to check if we need to kfree (in practice, the
      list is very short).
      
      This means that kparams can be const again, and plugs a leak.  This
      is important for drivers/usb/gadget/nokia.c which gets modprobe/rmmod'ed
      frequently on the N9000.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Cc: Artem Bityutskiy <dedekind1@gmail.com>
      Tested-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
      a1054322
    • R
      param: add a free hook to kernel_param_ops. · e6df34a4
      Rusty Russell 提交于
      This allows us to generalize the KPARAM_KMALLOCED flag, by calling a function
      on every parameter when a module is unloaded.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Tested-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
      e6df34a4
    • R
      param: silence .init.text references from param ops · 6a841528
      Rusty Russell 提交于
      Ideally, we'd check that it was only the "set" function which was __init,
      and that the permissions were r/o.  But that's a little hard.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Acked-by: NSam Ravnborg <sam@ravnborg.org>
      Tested-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
      6a841528
    • S
      Add param ops struct for hvc_iucv driver. · 549a8a03
      Sachin Sant 提交于
      Today's next 20091117 build failed on s390 with
      
      drivers/char/hvc_iucv.c:1331: error: 'param_ops_vmidfilter' undeclared here (not in a function)
      make[2]: *** [drivers/char/hvc_iucv.o] Error 1
      
      Most probably caused by commit 684a6d340b8a5767db4670031b0f39455346018a
      (param:param_ops) which introduced a param_ops structure.
      
      The following compile tested patch adds a param_ops structure for hvc_iucv.
      Signed-off-by: NSachin Sant <sachinp@in.ibm.com>
      Acked-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Tested-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      549a8a03
    • S
      nfs: update for module_param_named API change · 8e4e15d4
      Stephen Rothwell 提交于
      After merging the rr tree, today's linux-next build (powerpc
      ppc64_defconfig) failed like this:
      
      net/sunrpc/auth.c:74: error: 'param_ops_hashtbl_sz' undeclared here (not in a function)
      
      Caused by commit 0685652df0929cec7d78efa85127f6eb34962132
      ("param:param_ops") interacting with commit
      f8f853ab19fcc415b6eadd273373edc424916212 ("SUNRPC: Make the credential
      cache hashtable size configurable") from the nfs tree.
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      8e4e15d4
    • S
      AppArmor: update for module_param_named API change · 101d6c82
      Stephen Rothwell 提交于
      Fixes these build errors:
      security/apparmor/lsm.c:701: error: 'param_ops_aabool' undeclared here (not in a function)
      security/apparmor/lsm.c:721: error: 'param_ops_aalockpolicy' undeclared here (not in a function)
      security/apparmor/lsm.c:729: error: 'param_ops_aauint' undeclared here (not in a function)
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      101d6c82
    • R
      param: use ops in struct kernel_param, rather than get and set fns directly · 9bbb9e5a
      Rusty Russell 提交于
      This is more kernel-ish, saves some space, and also allows us to
      expand the ops without breaking all the callers who are happy for the
      new members to be NULL.
      
      The few places which defined their own param types are changed to the
      new scheme (more which crept in recently fixed in following patches).
      
      Since we're touching them anyway, we change get() and set() to take a
      const struct kernel_param (which they really are).  This causes some
      harmless warnings until we fix them (in following patches).
      
      To reduce churn, module_param_call creates the ops struct so the callers
      don't have to change (and casts the functions to reduce warnings).
      The modern version which takes an ops struct is called module_param_cb.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Tested-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Ville Syrjala <syrjala@sci.fi>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Alessandro Rubini <rubini@ipvvis.unipv.it>
      Cc: Michal Januszewski <spock@gentoo.org>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-input@vger.kernel.org
      Cc: linux-fbdev-devel@lists.sourceforge.net
      Cc: linux-nfs@vger.kernel.org
      Cc: netdev@vger.kernel.org
      9bbb9e5a
    • R
      param: move the EXPORT_SYMBOL to after the definitions. · a14fe249
      Rusty Russell 提交于
      This is modern style, and good to do before we start changing things.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Reviewed-by: NTakashi Iwai <tiwai@suse.de>
      Tested-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
      a14fe249
    • R
      params: don't hand NULL values to param.set callbacks. · 2e9fb995
      Rusty Russell 提交于
      An audit by Dongdong Deng revealed that most driver-author-written param
      calls don't handle val == NULL (which happens when parameters are specified
      with no =, eg "foo" instead of "foo=1").
      
      The only real case to use this is boolean, so handle it specially for that
      case and remove a source of bugs for everyone else.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Dongdong Deng <dongdong.deng@windriver.com>
      Cc: Américo Wang <xiyou.wangcong@gmail.com>
      2e9fb995
    • R
      documentation: fix erroneous email address. · d2800800
      Rusty Russell 提交于
      Hey, at least it has both l's.
      Reported-by: NMarin Mitov <mitov@issp.bas.bg>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      d2800800
    • L
      Merge branch 'for-linus' of git://neil.brown.name/md · 3d30701b
      Linus Torvalds 提交于
      * 'for-linus' of git://neil.brown.name/md: (24 commits)
        md: clean up do_md_stop
        md: fix another deadlock with removing sysfs attributes.
        md: move revalidate_disk() back outside open_mutex
        md/raid10: fix deadlock with unaligned read during resync
        md/bitmap:  separate out loading a bitmap from initialising the structures.
        md/bitmap: prepare for storing write-intent-bitmap via dm-dirty-log.
        md/bitmap: optimise scanning of empty bitmaps.
        md/bitmap: clean up plugging calls.
        md/bitmap: reduce dependence on sysfs.
        md/bitmap: white space clean up and similar.
        md/raid5: export raid5 unplugging interface.
        md/plug: optionally use plugger to unplug an array during resync/recovery.
        md/raid5: add simple plugging infrastructure.
        md/raid5: export is_congested test
        raid5: Don't set read-ahead when there is no queue
        md: add support for raising dm events.
        md: export various start/stop interfaces
        md: split out md_rdev_init
        md: be more careful setting MD_CHANGE_CLEAN
        md/raid5: ensure we create a unique name for kmem_cache when mddev has no gendisk
        ...
      3d30701b
    • L
      x86: fix up system call numbering nit · 8cbd84f2
      Linus Torvalds 提交于
      As pointed out by Jiri Slaby: when I resolved the the 32-bit x85 system
      call entry tables for prlimit (due to the conflict with fanotify), I
      forgot to add the numbering in comments that we do for every fifth entry.
      Reported-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8cbd84f2
    • G
    • R
      i2c.h: fix kernel-doc warnings · 72d2e9f9
      Randy Dunlap 提交于
      Fix kernel-doc warnings in linux/i2c.h:
      
        Warning(include/linux/i2c.h:176): No description found for parameter 'alert'
        Warning(include/linux/i2c.h:259): No description found for parameter 'of_node'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      72d2e9f9
    • R
      kernel/timer.c: fix kernel-doc function parameter warning · 0caa6210
      Randy Dunlap 提交于
      Fix kernel-doc warning, add @timer description:
      
        Warning(kernel/timer.c:335): No description found for parameter 'timer'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0caa6210
    • R
      docbook: fixup media support files for htmldocs also · 0f7436a5
      Randy Dunlap 提交于
      'make htmldocs' produces errors due to missing a supporting media
      file, so add 'xmldoclinks' to the htmldocs dependencies so that the
      needed supporting file will be present.
      
        Documentation/DocBook/media.xml:4: warning: failed to load external entity "Documentation/DocBook/media-entities.tmpl"
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Acked-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0f7436a5
    • R
      docbook: fix fatal error from libata · 3d2be54b
      Randy Dunlap 提交于
      'make htmldocs' has a fatal error when processing libata.xml, as seen
      below.  The string "Example patterns:" (or any string with "example.*:"
      in it AFAIK) causes some part of the doc generation tool chain to try to
      produce an <informalexample> block without a beginning <para>, but
      there is an ending </para> generated, which throws things out of kilter.
      
      I don't even know where (what program) this is happening in.
      I searched in docproc and xmlto and in some XML stylesheets without
      finding anything.  If anyone can give me pointers about this, please do.
      Until this is fixed, let's just spell "Example" as "Sample"
      and match up the double quotation marks while there.
      
        Documentation/DocBook/libata.xml:6575: parser error : Opening and ending tag mismatch: programlisting line 6573 and para
           </para><para>
                  ^
        Documentation/DocBook/libata.xml:6580: parser error : Opening and ending tag mismatch: para line 6575 and programlisting
        </programlisting></informalexample>
                         ^
        unable to parse Documentation/DocBook/libata.xml
        make[2]: *** [Documentation/DocBook/libata.html] Error 1
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3d2be54b
    • D
      jfs: don't allow os2 xattr namespace overlap with others · aca0fa34
      Dave Kleikamp 提交于
      It's currently possible to bypass xattr namespace access rules by
      prefixing valid xattr names with "os2.", since the os2 namespace stores
      extended attributes in a legacy format with no prefix.
      
      This patch adds checking to deny access to any valid namespace prefix
      following "os2.".
      Signed-off-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Reported-by: NSergey Vlasov <vsu@altlinux.ru>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      aca0fa34
    • L
      Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block · 2f9e825d
      Linus Torvalds 提交于
      * 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block: (149 commits)
        block: make sure that REQ_* types are seen even with CONFIG_BLOCK=n
        xen-blkfront: fix missing out label
        blkdev: fix blkdev_issue_zeroout return value
        block: update request stacking methods to support discards
        block: fix missing export of blk_types.h
        writeback: fix bad _bh spinlock nesting
        drbd: revert "delay probes", feature is being re-implemented differently
        drbd: Initialize all members of sync_conf to their defaults [Bugz 315]
        drbd: Disable delay probes for the upcomming release
        writeback: cleanup bdi_register
        writeback: add new tracepoints
        writeback: remove unnecessary init_timer call
        writeback: optimize periodic bdi thread wakeups
        writeback: prevent unnecessary bdi threads wakeups
        writeback: move bdi threads exiting logic to the forker thread
        writeback: restructure bdi forker loop a little
        writeback: move last_active to bdi
        writeback: do not remove bdi from bdi_list
        writeback: simplify bdi code a little
        writeback: do not lose wake-ups in bdi threads
        ...
      
      Fixed up pretty trivial conflicts in drivers/block/virtio_blk.c and
      drivers/scsi/scsi_error.c as per Jens.
      2f9e825d
    • L
      Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 · 7ae0dea9
      Linus Torvalds 提交于
      * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (94 commits)
        V4L/DVB: tvp7002: fix write to H-PLL Feedback Divider LSB register
        V4L/DVB: dvb: siano: free spinlock before schedule()
        V4L/DVB: media: video: pvrusb2: remove custom hex_to_bin()
        V4L/DVB: drivers: usbvideo: remove custom implementation of hex_to_bin()
        V4L/DVB: Report supported QAM modes on bt8xx
        V4L/DVB: media: ir-keytable: null dereference in debug code
        V4L/DVB: ivtv: convert to the new control framework
        V4L/DVB: ivtv: convert gpio subdev to new control framework
        V4L/DVB: wm8739: convert to the new control framework
        V4L/DVB: cs53l32a: convert to new control framework
        V4L/DVB: wm8775: convert to the new control framework
        V4L/DVB: cx2341x: convert to the control framework
        V4L/DVB: cx25840: convert to the new control framework
        V4L/DVB: cx25840/ivtv: replace ugly priv control with s_config
        V4L/DVB: saa717x: convert to the new control framework
        V4L/DVB: msp3400: convert to the new control framework
        V4L/DVB: saa7115: convert to the new control framework
        V4L/DVB: v4l2: hook up the new control framework into the core framework
        V4L/DVB: Documentation: add v4l2-controls.txt documenting the new controls API
        V4L/DVB: v4l2-ctrls: Whitespace cleanups
        ...
      7ae0dea9
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog · 6c74700f
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
        watchdog: hpwdt: formatting of pointers in printk()
        watchdog: Adding support for ARM Primecell SP805 Watchdog
        watchdog: f71808e_wdt: new watchdog driver for Fintek F71808E and F71882FG
        watchdog: sch311x_wdt.c: set parent before registeriing the misc device in probe() function
        watchdog: wdt_pci.c: move ids to pci_ids.h
        watchdog: s3c2410_wdt - Fix removing of platform device
      6c74700f
    • L
      3e756163
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 04f2b976
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: xpad - add USB-ID for PL-3601 Xbox 360 pad
        Input: cy8ctmg100_ts - signedness bug
        Input: elantech - report position also with 3 fingers
        Input: elantech - discard the first 2 positions on some firmwares
        Input: adxl34x - do not mark device as disabled on startup
        Input: gpio_keys - add hooks to enable/disable device
        Input: evdev - rearrange ioctl handling
        Input: dynamically allocate ABS information
        Input: switch to input_abs_*() access functions
        Input: add static inline accessors for ABS properties
      04f2b976
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 · 9895850b
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (148 commits)
        USB: serial: fix stalled writes
        USB: remove fake "address-of" expressions
        USB: fix thread-unsafe anchor utiliy routines
        USB: usbtest: support test device with only one iso-in or iso-out endpoint
        USB: usbtest: avoid to free coherent buffer in atomic context
        USB: xhci: Set DMA mask for host.
        USB: xhci: Don't flush doorbell writes.
        USB: xhci: Reduce reads and writes of interrupter registers.
        USB: xhci: Make xhci_set_hc_event_deq() static.
        USB: xhci: Minimize HW event ring dequeue pointer writes.
        USB: xhci: Make xhci_handle_event() static.
        USB: xhci: Remove unnecessary reads of IRQ_PENDING register.
        USB: xhci: Performance - move xhci_work() into xhci_irq()
        USB: xhci: Performance - move interrupt handlers into xhci-ring.c
        USB: xhci: Performance - move functions that find ep ring.
        USB:: fix linux/usb.h kernel-doc warnings
        USB: add USB serial ssu100 driver
        USB: usb-storage: implement autosuspend
        USB: ehci: fix remove of ehci debugfs dir
        USB: Add USB 2.0 to ssb ohci driver
        ...
      9895850b
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 · fc385c31
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (68 commits)
        U6715 16550A serial driver support
        Char: nozomi, set tty->driver_data appropriately
        Char: nozomi, fix tty->count counting
        serial: max3107: Fix gpiolib support
        hsu: call PCI pm hooks in suspend/resume function
        hsu: some code cleanup
        hsu: add a periodic timer to check dma rx channel
        hsu: driver for Medfield High Speed UART device
        mxser: remove unnesesary NULL check
        serial: add support for OX16PCI958 card
        serial: 68328serial.c: remove dead (ALMA_ANS | DRAGONIXVZ | M68EZ328ADS)
        timbuart: use __devinit and __devexit macros for probe and remove
        serial: MMIO32 support for 8250_early.c
        serial: mcf: don't take spinlocks in already protected functions
        serial: general fixes in the serial_rs485 structure
        serial: fix missing bit coverage of ASYNC_FLAGS
        serial: "altera_uart: simplify altera_uart_console_putc()" checkpatch fixes
        serial: crisv10: formatting of pointers in printk()
        vt: Fix warning: statement with no effect due to vt_kern.h
        tty_io: remove casts from void*
        ...
      fc385c31
    • J
      USB: serial: fix stalled writes · b58af406
      Johan Hovold 提交于
      As David VomLehn points out, it was possible to receive an interrupt
      before clearing the free-urb flag which could lead to the urb being
      incorrectly marked as busy.
      
      For the same reason, move tx_bytes accounting so that it will never be
      negative.
      
      Note that the free-flags set and clear operations do not need any
      additional locking as they are manipulated while USB_SERIAL_WRITE_BUSY
      is set.
      Reported-by: NDavid VomLehn <dvomlehn@cisco.com>
      Tested-by: NDavid VomLehn <dvomlehn@cisco.com>
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b58af406
    • A
      USB: remove fake "address-of" expressions · b409214c
      Alan Stern 提交于
      Fake "address-of" expressions that evaluate to NULL generally confuse
      readers and can provoke compiler warnings.  This patch (as1412)
      removes three such fake expressions, using "#ifdef"s in their place.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b409214c
    • C
      USB: fix thread-unsafe anchor utiliy routines · b3e67044
      Christian Lamparter 提交于
      This patch fixes a race condition in two utility routines
      related to the removal/unlinking of urbs from an anchor.
      
      If two threads are concurrently accessing the same anchor,
      both could end up with the same urb - thinking they are
      the exclusive owner.
      
      Alan Stern pointed out a related issue in
      usb_unlink_anchored_urbs:
      
      "The URB isn't removed from the anchor until it completes
       (as a by-product of completion, in fact), which might not
       be for quite some time after the unlink call returns.
       In the meantime, the subroutine will keep trying to unlink
       it, over and over again."
      
      Cc: stable <stable@kernel.org>
      Cc: Oliver Neukum <oneukum@suse.de>
      Cc: Greg Kroah-Hartman <greg@kroah.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NChristian Lamparter <chunkeey@googlemail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      b3e67044
    • M
      USB: usbtest: support test device with only one iso-in or iso-out endpoint · 951fd8ee
      Ming Lei 提交于
      It is very common that one altsetting may include only one iso-in or iso-out
      single endpoint, especially for high bandwidth endpoint, so support it.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      951fd8ee
    • M
      USB: usbtest: avoid to free coherent buffer in atomic context · e10e1bec
      Ming Lei 提交于
      This patch fixes the warning below:
      [30753.755998] ------------[ cut here ]------------
      [30753.755998] WARNING: at /home/tom/git/linux-2.6/linux-2.6-next/arch/x86/include/asm/dma-mapping.h:155 hcd_buffer_free+0xb1/0xd4 [usbcore]()
      [30753.755998] Hardware name: 6475EK2
      [30753.755998] Modules linked in: uvcvideo ehci_hcd usbtest cdc_ether usbnet vfat fat usb_storage nfsd lockd nfs_acl auth_rpcgss exportfs mii tun videodev v4l1_compat v4l2_compat_ioctl32 fuse bridge stp llc sunrpc ipv6 cpufreq_ondemand acpi_cpufreq freq_table mperf kvm_intel kvm arc4 ecb ath5k usbhid mac80211 snd_hda_codec_conexant ch341 usbserial ath cfg80211 thinkpad_acpi snd_hda_intel pcspkr wmi hwmon yenta_socket iTCO_wdt iTCO_vendor_support i2c_i801 e1000e snd_hda_codec snd_hwdep snd_pcm snd_timer snd soundcore snd_page_alloc pata_acpi uhci_hcd ohci_hcd usbcore i915 drm_kms_helper drm i2c_algo_bit i2c_core video output [last unloaded: uvcvideo]
      [30753.755998] Pid: 0, comm: swapper Tainted: G        W   2.6.35-rc6-gkh-wl+ #49
      [30753.755998] Call Trace:
      [30753.755998]  <IRQ>  [<ffffffff8104478a>] warn_slowpath_common+0x80/0x98
      [30753.755998]  [<ffffffff810447b7>] warn_slowpath_null+0x15/0x17
      [30753.755998]  [<ffffffffa00ce02d>] hcd_buffer_free+0xb1/0xd4 [usbcore]
      [30753.755998]  [<ffffffffa00c1345>] usb_free_coherent+0x1c/0x1e [usbcore]
      [30753.755998]  [<ffffffffa00b13e4>] simple_free_urb+0x23/0x2f [usbtest]
      [30753.755998]  [<ffffffffa00b210b>] iso_callback+0xbb/0x10f [usbtest]
      [30753.755998]  [<ffffffffa00c7390>] usb_hcd_giveback_urb+0x8c/0xc0 [usbcore]
      [30753.755998]  [<ffffffffa0449b35>] ehci_urb_done+0x84/0x95 [ehci_hcd]
      [30753.755998]  [<ffffffffa044b5a5>] ehci_work+0x41a/0x7dd [ehci_hcd]
      [30753.755998]  [<ffffffffa044e298>] ehci_irq+0x33b/0x370 [ehci_hcd]
      [30753.755998]  [<ffffffff8100fb05>] ? sched_clock+0x9/0xd
      [30753.755998]  [<ffffffff8105e641>] ? sched_clock_local+0x1c/0x82
      [30753.755998]  [<ffffffff8105e76a>] ? sched_clock_cpu+0xc3/0xce
      [30753.755998]  [<ffffffff81067c7e>] ? trace_hardirqs_off+0xd/0xf
      [30753.755998]  [<ffffffff8105e7b8>] ? cpu_clock+0x43/0x5e
      [30753.755998]  [<ffffffffa00c6999>] usb_hcd_irq+0x45/0xa1 [usbcore]
      [30753.755998]  [<ffffffff81092e02>] handle_IRQ_event+0x20/0xa5
      [30753.755998]  [<ffffffff81094cea>] handle_fasteoi_irq+0x92/0xd2
      [30753.755998]  [<ffffffff8100c0ed>] handle_irq+0x1f/0x2a
      [30753.755998]  [<ffffffff8100b75d>] do_IRQ+0x57/0xbe
      [30753.755998]  [<ffffffff8136a693>] ret_from_intr+0x0/0x16
      [30753.755998]  <EOI>  [<ffffffff81223baa>] ? acpi_idle_enter_bm+0x231/0x269
      [30753.755998]  [<ffffffff81223ba3>] ? acpi_idle_enter_bm+0x22a/0x269
      [30753.755998]  [<ffffffff812c4b6b>] cpuidle_idle_call+0x99/0xce
      [30753.755998]  [<ffffffff81008dd5>] cpu_idle+0x61/0xaa
      [30753.755998]  [<ffffffff8136374b>] start_secondary+0x1c2/0x1c6
      [30753.755998] ---[ end trace 904cfaf7ab4cb1a2 ]---
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e10e1bec
    • S
      USB: xhci: Set DMA mask for host. · 006d5820
      Sarah Sharp 提交于
      Tell the USB core that we can do DMA directly (instead of needing it to
      memory-map the buffers for PIO).  If the xHCI host supports 64-bit addresses,
      set the DMA mask accordingly.  Otherwise indicate the host can handle 32-bit DMA
      addresses.
      
      This improves performance because the USB core doesn't have to spend time
      remapping buffers in high memory into the 32-bit address range.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      006d5820
    • S
      USB: xhci: Don't flush doorbell writes. · ed3f2453
      Sarah Sharp 提交于
      To tell the host controller that there are transfers on the endpoint
      rings, we need to ring the endpoint doorbell.  This is a PCI MMIO write,
      which can be delayed until another register read is queued.
      
      The previous code would flush the doorbell write by reading the doorbell
      register after the write.  This may take time, and it's not necessary to
      force the host controller to know about the transfers right away.  Don't
      flush the doorbell register writes.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ed3f2453
    • S
      USB: xhci: Reduce reads and writes of interrupter registers. · c21599a3
      Sarah Sharp 提交于
      The interrupter register set includes a register that says whether interrupts
      are pending for each event ring (the IP bit).  Each MSI-X vector will get its
      own interrupter set with separate IP bits.  The status register includes an
      "Event Interrupt (EINT)" bit that is set when an IP bit is set in any of the
      interrupters.
      
      When PCI interrupts are used, the EINT bit exactly mirrors the IP bit in the
      single interrupter set, and it is a waste of time to check both registers when
      trying to figure out if the xHC interrupted or another device on the shared IRQ
      line interrupted.  Only check the IP bit to reduce register reads.
      
      The IP bit is automatically cleared by the xHC when MSI or MSI-X is enabled.  It
      doesn't make sense to read that register to check for shared interrupts (since
      MSI and MSI-X aren't shared).  It also doesn't make sense to write to that
      register to clear the IP bit, since it is cleared by the hardware.
      
      We can tell whether MSI or MSI-X is enabled by looking at the irq number in
      hcd->irq.  If it's -1, we know MSI or MSI-X is enabled.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c21599a3
    • S
      USB: xhci: Make xhci_set_hc_event_deq() static. · 257d585a
      Sarah Sharp 提交于
      Now that the event handler functions no longer use xhci_set_hc_event_deq()
      to update the event ring dequeue pointer, that function is not used by
      anything in xhci-ring.c.  Move that function into xhci-mem.c and make it
      static.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      257d585a
    • S
      USB: xhci: Minimize HW event ring dequeue pointer writes. · c06d68b8
      Sarah Sharp 提交于
      The xHCI specification suggests that writing the hardware event ring dequeue
      pointer register too often can be an expensive operation for the xHCI hardware
      to manage.  It suggests minimizing the number of writes to that register.
      
      Originally, the driver wrote the event ring dequeue pointer after each
      event was processed.  Depending on how the event ring moderation register
      is set up and how fast the transfers are completing, there may be several
      events processed for each interrupt.  This patch makes the hardware event
      ring dequeue pointer be written only once per interrupt.
      
      Make the transfer event handler and port status event handler only write
      the software event ring dequeue pointer.  Move the updating of the
      hardware event ring dequeue pointer into the interrupt function.  Move the
      contents of xhci_set_hc_event_deq() into the interrupt handler.  The
      interrupt handler must clear the event handler busy flag, so it might as
      well also write the dequeue pointer to the same register.  This eliminates
      two 32-bit PCI reads and two 32-bit PCI writes.
      Reported-by: NAndiry Xu <andiry.xu@amd.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c06d68b8
    • S
      USB: xhci: Make xhci_handle_event() static. · d6d98a4d
      Sarah Sharp 提交于
      xhci_handle_event() is now only called from within xhci-ring.c, so make it
      static.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d6d98a4d