1. 27 Feb, 2010 21 commits
    • Manuel Lauss's avatar
      MIPS: Alchemy: Remove USB_DEV_REQ_INT prioritization hack · 5047201b
      Manuel Lauss authored
      The Alchemy hardware provides a method to prioritize interrupts
      on a controller by assigning them to a differenct core request line.
      Assign usb device request interrupt to IC0 Request 0 (which has
      highest priority in the core and the dispatcher) and others to
      Request 1.  The explicit check for usb device request occurrence
      should be obsolete now.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      5047201b
    • Manuel Lauss's avatar
      MIPS: Alchemy: XXS1500 PCMCIA driver rewrite · 0273b4ef
      Manuel Lauss authored
      Rewritten XXS1500 PCMCIA socket driver, standalone (doesn't depend on
      au1000_generic.c) and added carddetect IRQ support.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Cc: Florian Fainelli <florian@openwrt.org>
      Cc: Linux-PCMCIA <linux-pcmcia@lists.infradead.org>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      0273b4ef
    • Manuel Lauss's avatar
      MIPS: Alchemy: devboards: wire up new PCMCIA driver. · 27dd65ac
      Manuel Lauss authored
      Register the PCMCIA driver on all boards supported by it,
      get rid of now-unused pcmcia macros in the board headers
      (and subsequently empty pb1100/pb1500 ones).
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      27dd65ac
    • Manuel Lauss's avatar
      MIPS: PCMCIA: new socket driver for Au1000 demoboards. · 66213b3c
      Manuel Lauss authored
      New PCMCIA socket driver for all Db/Pb1xxx boards (except Pb1000),
      which replaces au1000_db1x00.c and (most of) au1000_pb1x00.c.
      Notable improvements:
              - supports Db1000, DB/PB1100/1500/1550/1200.
              - support for carddetect and statuschange IRQs.
              - pcmcia socket mem/io/attr areas and irqs passed through
                platform resource information.
              - doesn't freeze system during card insertion/ejection like
                the one it replaces.
              - boardtype is automatically detected using BCSR ID register.
      
      Run-tested on the DB1200.
      
      Cc: Linux-PCMCIA <linux-pcmcia@lists.infradead.org>
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      66213b3c
    • Manuel Lauss's avatar
      MIPS: Alchemy: remove board_init_irq() function. · 7e50b2b7
      Manuel Lauss authored
      remove board_init_irq():  On all in-kernel boards it is sufficient to
      initialize board interrupts in an arch_initcall by using the default
      linux irq functions.
      
      Some small irqmap.c files have been folded into board_setup files.
      
      Run-tested on DB1200; compile-tested on all other affected boards.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      7e50b2b7
    • Manuel Lauss's avatar
      MIPS: Alchemy: devboards: factor out PB1200 IRQ cascade code. · 95a43796
      Manuel Lauss authored
      Move the PB1200 IRQ cascade code out to the BCSR support code:
      upcoming DB1300 support can use it too.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      95a43796
    • Manuel Lauss's avatar
      MIPS: Alchemy: devboard register abstraction · 9bdcf336
      Manuel Lauss authored
      All Alchemy development boards have external CPLDs with a few registers
      in them.  They all share an identical register layout with only a few
      minor differences (except the PB1000) in bit functions and base
      addresses.
      
      This patch
      - adds a primitive facility to initialize and use these external
        registers,
      - replaces all occurrences of bcsr->xxx accesses with calls to the new
        functions (the pb1200 cascade irq handling code is special).
      - collects BCSR register information scattered throughout the board
        headers in a central place.
      Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      9bdcf336
    • Ralf Baechle's avatar
      MIPS: Fix build error for uncompressed non-plain vmlinux kernels · ebc89718
      Ralf Baechle authored
      Seen on rm200_defconfig for example:
      
        CC      arch/mips/boot/compressed/decompress.o
      /home/ralf/src/linux/upstream-linus/arch/mips/boot/compressed/decompress.c: In function ‘decompress_kernel’:
      /home/ralf/src/linux/upstream-linus/arch/mips/boot/compressed/decompress.c:116: error: implicit declaration of function ‘decompress’
      make[3]: *** [arch/mips/boot/compressed/decompress.o] Error 1
      make[2]: *** [vmlinuz.ecoff] Error 2
      make[1]: *** [sub-make] Error 2
      make: *** [all] Error 2
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      ebc89718
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6 · 06a79b82
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
        PM / Hibernate: Fix preallocating of memory
        PM / Hibernate: Remove swsusp.c finally
        PM / Hibernate: Remove trailing space in message
        PM: Allow SCSI devices to suspend/resume asynchronously
        PM: Allow USB devices to suspend/resume asynchronously
        USB: implement non-tree resume ordering constraints for PCI host controllers
        PM: Allow PCI devices to suspend/resume asynchronously
        PM / Hibernate: Swap, remove useless check from swsusp_read()
        PM / Hibernate: Really deprecate deprecated user ioctls
        PM: Allow device drivers to use dpm_wait()
        PM: Start asynchronous resume threads upfront
        PM: Add facility for advanced testing of async suspend/resume
        PM: Add a switch for disabling/enabling asynchronous suspend/resume
        PM: Asynchronous suspend and resume of devices
        PM: Add parent information to timing messages
        PM: Document device power attributes in sysfs
        PM / Runtime: Add sysfs switch for disabling device run-time PM
      06a79b82
    • Christian Kujau's avatar
      Remove EXPERIMENTAL from NFS_FSCACHE · 4912002f
      Christian Kujau authored
      There's currently an open Ubuntu bug[0], with the intent to compile NFS_FSCACHE
      (and possibly AFS_FSCACHE, 9P_FSCACHE) into the standard Ubuntu kernel.
      However, since *_FSCACHE still depends on EXPERIMENTAL, this won't happen.
      
      As Arjan van de Ven pointed out[1], the EXPERIMENTAL flag doesn't mean that
      much any more, I propose the following patch to fs/nfs/Kconfig.  I'd do the
      same for fs/9p/Kconfig and fs/afs/Kconfig, but as I did not test 9p or AFS, I
      feel it would not be appropriate for me to remove the flag.
      
      [0] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/440522/comments/5
      [1] http://lkml.org/lkml/2010/1/23/145Signed-off-by: default avatarChristian Kujau <lists@nerdbynature.de>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4912002f
    • Linus Torvalds's avatar
      Merge branch 'for_linus' of... · 98723153
      Linus Torvalds authored
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86
      
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86:
        toshiba_acpi: Add full hotkey support
        hp-wmi: Add support for tablet rotation key
        dell-laptop: Add another Dell laptop to the DMI whitelist
        classmate-laptop: use a single MODULE_DEVICE_TABLE to get correct aliases
        dell-laptop: Pay attention to which devices the hardware switch controls
        dell-laptop: Use buffer with 32-bit physical address
        dell-laptop: Blacklist machines not supporting dell-laptop
        dell-laptop: Block software state changes when rfkill hard blocked
        dell-laptop: Fix small memory leak
        dell-laptop: Fix platform device unregistration
        dell-laptop: Update rfkill state on kill switch
        compal-laptop: Replace sysfs support with rfkill support
        compal-laptop: Add support for known Compal made Dell laptops
        MAINTAINERS: update drivers/platform/x86 information
      98723153
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm · 4cbd5518
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
        dlm: use bastmode in debugfs output
        dlm: Send lockspace name with uevents
        dlm: send reply before bast
        dlm: fix ordering of bast and cast
      4cbd5518
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs · b305956a
      Linus Torvalds authored
      * 'for-linus' of git://oss.sgi.com/xfs/xfs: (52 commits)
        fs/xfs: Correct NULL test
        xfs: optimize log flushing in xfs_fsync
        xfs: only clear the suid bit once in xfs_write
        xfs: kill xfs_bawrite
        xfs: log changed inodes instead of writing them synchronously
        xfs: remove invalid barrier optimization from xfs_fsync
        xfs: kill the unused XFS_QMOPT_* flush flags V2
        xfs: Use delay write promotion for dquot flushing
        xfs: Sort delayed write buffers before dispatch
        xfs: Don't issue buffer IO direct from AIL push V2
        xfs: Use delayed write for inodes rather than async V2
        xfs: Make inode reclaim states explicit
        xfs: more reserved blocks fixups
        xfs: turn off sign warnings
        xfs: don't hold onto reserved blocks on remount,ro
        xfs: quota limit statvfs available blocks
        xfs: replace KM_LARGE with explicit vmalloc use
        xfs: cleanup up xfs_log_force calling conventions
        xfs: kill XLOG_VEC_SET_TYPE
        xfs: remove duplicate buffer flags
        ...
      b305956a
    • Linus Torvalds's avatar
      Merge branch 'ibft-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft-2.6 · 41630959
      Linus Torvalds authored
      * 'ibft-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft-2.6:
        ibft: Update MAINTAINERS file.
        drivers/firmware/iscsi_ibft.c: remove NIPQUAD_FMT, use %pI4
      41630959
    • Linus Torvalds's avatar
      Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 · 2b8c70b2
      Linus Torvalds authored
      * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (362 commits)
        V4L-DVB: cx88-dvb: remove extra attribution for core
        V4L/DVB: v4l: soc_camera: fix bound checking of mbus_fmt[] index
        V4L/DVB: Add support for SMT7020 to cx88
        V4L/DVB: radio-si470x: Use UTF-8 encoding on a comment
        V4L/DVB: MAINTAINERS: Telegent tlg2300 section fix
        V4L/DVB: gspca_stv06xx: Add support for camera button
        V4L/DVB: gspca_ov519: add support for the button on ov511 based cams
        V4L/DVB: gspca_ov519: Add support for the button on ov518 based cams
        V4L/DVB: gspca_ov519: add support for the button on ov519 based cams
        V4L/DVB: gspca_main: Fix a compile error when CONFIG_INPUT is not set
        V4L/DVB: gspca_main: some input error handling fixes
        V4L/DVB: gspca_main: Allow use of input device creation code for non int. inputs
        V4L/DVB: gspca_pac7302: much improved exposure control
        V4L/DVB: gspca_sonixb: Make sonixb driver handle pas106 and pas202 cameras
        V4L/DVB: gspca_sonixb: pas106: fixup bright ctrl and add gain and exposure ctrls
        V4L/DVB: Documentation: gspca.txt: update known mr97310a cams
        V4L/DVB: gspca_mr97310a: add support for the Sakar 1638x CyberPix
        V4L/DVB: gscpa_sonixb: limit ov7630 max framerate at 640x480
        V4L/DVB: gspca_sonixb: pas202: fixup brightness ctrl and add gain and exposure ctrls
        V4L/DVB: gscpa_sonixb: Differentiate between sensors with a coarse and fine expo ctrl
        ...
      2b8c70b2
    • Ang Way Chuang's avatar
      dvb-core: Fix DoS bug in ULE decapsulation code that can be triggered by an invalid Payload Pointer · 29e1fa35
      Ang Way Chuang authored
      ULE (Unidirectional Lightweight Encapsulation RFC 4326) decapsulation
      has a bug that causes endless loop when Payload Pointer of MPEG2-TS
      frame is 182 or 183.  Anyone who sends malicious MPEG2-TS frame will
      cause the receiver of ULE SNDU to go into endless loop.
      
      This patch was generated and tested against linux-2.6.32.9 and should
      apply cleanly to linux-2.6.33 as well because there was only one typo
      fix to dvb_net.c since v2.6.32.
      
      This bug was brought to you by modern day Santa Claus who decided to
      shower the satellite dish at Keio University with heavy snow causing
      huge burst of errors.  We, receiver end, received Santa Claus's gift in
      the form of kernel bug.
      
      Care has been taken not to introduce more bug by fixing this bug, but
      please scrutinize the code for I always produces buggy code.
      Signed-off-by: default avatarAng Way Chuang <wcang79@gmail.com>
      Acked-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      29e1fa35
    • Linus Torvalds's avatar
      Merge branch 'kmemcheck-for-linus' of... · 2594a57a
      Linus Torvalds authored
      Merge branch 'kmemcheck-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6
      
      * 'kmemcheck-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
        kmemcheck: Test the full object in kmemcheck_is_obj_initialized()
      2594a57a
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/xfs-vipt · f24407d2
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/xfs-vipt:
        xfs: fix xfs to work with Virtually Indexed architectures
        sh: add mm API for DMA to vmalloc/vmap areas
        arm: add mm API for DMA to vmalloc/vmap areas
        parisc: add mm API for DMA to vmalloc/vmap areas
        mm: add coherence API for DMA to vmalloc/vmap areas
      f24407d2
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 · 65445174
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (158 commits)
        [SCSI] Fix printing of failed 32-byte commands
        [SCSI] Fix printing of variable length commands
        [SCSI] libsrp: fix bug in ADDITIONAL CDB LENGTH interpretation
        [SCSI] scsi_dh_alua: Add IBM Power Virtual SCSI ALUA device to dev list
        [SCSI] scsi_dh_alua: add netapp to dev list
        [SCSI] qla2xxx: Update version number to 8.03.02-k1.
        [SCSI] qla2xxx: EEH: Restore PCI saved state during pci slot reset.
        [SCSI] qla2xxx: Add firmware ETS burst support.
        [SCSI] qla2xxx: Correct loop-resync issues during SNS scans.
        [SCSI] qla2xxx: Correct use-after-free issue in terminate_rport_io callback.
        [SCSI] qla2xxx: Correct EH bus-reset handling.
        [SCSI] qla2xxx: Proper clean-up of BSG requests when request times out.
        [SCSI] qla2xxx: Initialize payload receive length in failure path of vendor commands
        [SCSI] fix duplicate removal on error path in scsi_sysfs_add_sdev
        [SCSI] fix refcounting bug in scsi_get_host_dev
        [SCSI] fix memory leak in scsi_report_lun_scan
        [SCSI] lpfc: correct PPC build failure
        [SCSI] raid_class: add raid1e
        [SCSI] mpt2sas: Do not call sas_is_tlr_enabled for RAID volumes.
        [SCSI] zfcp: Introduce header file for qdio structs and inline functions
        ...
      65445174
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 · 64d497f5
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (187 commits)
        sh: remove dead LED code for migo-r and ms7724se
        sh: ecovec build fix for CONFIG_I2C=n
        sh: ecovec r-standby support
        sh: ms7724se r-standby support
        sh: SH-Mobile R-standby register save/restore
        clocksource: Fix up a registration/IRQ race in the sh drivers.
        sh: ms7724: modify scan_timing for KEYSC
        sh: ms7724: Add sh_sir support
        sh: mach-ecovec24: Add sh_sir support
        sh: wire up SET/GET_UNALIGN_CTL.
        sh: allow alignment fault mode to be configured at kernel boot.
        sh: sh7724: Update FSI/SPU2 clock
        sh: always enable sh7724 vpu_clk and set to 166MHz on Ecovec
        sh: add sh7724 kick callback to clk_div4_table
        sh: introduce struct clk_div4_table
        sh: clock-cpg div4 set_rate() shift fix
        sh: Turn on speculative return for SH7785 and SH7786
        sh: Merge legacy and dynamic PMB modes.
        sh: Use uncached I/O helpers in PMB setup.
        sh: Provide uncached I/O helpers.
        ...
      64d497f5
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 37d40084
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (31 commits)
        crypto: aes_generic - Fix checkpatch errors
        crypto: fcrypt - Fix checkpatch errors
        crypto: ecb - Fix checkpatch errors
        crypto: des_generic - Fix checkpatch errors
        crypto: deflate - Fix checkpatch errors
        crypto: crypto_null - Fix checkpatch errors
        crypto: cipher - Fix checkpatch errors
        crypto: crc32 - Fix checkpatch errors
        crypto: compress - Fix checkpatch errors
        crypto: cast6 - Fix checkpatch errors
        crypto: cast5 - Fix checkpatch errors
        crypto: camellia - Fix checkpatch errors
        crypto: authenc - Fix checkpatch errors
        crypto: api - Fix checkpatch errors
        crypto: anubis - Fix checkpatch errors
        crypto: algapi - Fix checkpatch errors
        crypto: blowfish - Fix checkpatch errors
        crypto: aead - Fix checkpatch errors
        crypto: ablkcipher - Fix checkpatch errors
        crypto: pcrypt - call the complete function on error
        ...
      37d40084
  2. 26 Feb, 2010 19 commits
    • Konrad Rzeszutek Wilk's avatar
      ibft: Update MAINTAINERS file. · c4d1409b
      Konrad Rzeszutek Wilk authored
      Provide the right e-mail and names for me and Peter.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad@kernel.org>
      c4d1409b
    • Joe Perches's avatar
      drivers/firmware/iscsi_ibft.c: remove NIPQUAD_FMT, use %pI4 · 00e7825b
      Joe Perches authored
      Convert netmask to __be32 and format it with %pI4
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarKonrad Rzeszutek <ketuzsezr@darnok.org>
      Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
      Cc: Peter Jones <pjones@redhat.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      00e7825b
    • Alex Elder's avatar
      Merge branch 'linux-2.6.33' · 398007f8
      Alex Elder authored
      398007f8
    • Rafael J. Wysocki's avatar
      PM / Hibernate: Fix preallocating of memory · a9c9b442
      Rafael J. Wysocki authored
      The hibernate memory preallocation code allocates memory to push some
      user space data out of physical RAM, so that the hibernation image is
      not too large.  It allocates more memory than necessary for creating
      the image, so it has to release some pages to make room for
      allocations made while suspending devices and disabling nonboot CPUs,
      or the system will hang due to the lack of free pages to allocate
      from.  Unfortunately, the function used for freeing these pages,
      free_unnecessary_pages(), contains a bug that prevents it from doing
      the job on all systems without highmem.
      
      Fix this problem, which is a regression from the 2.6.30 kernel, by
      using the right condition for the termination of the loop in
      free_unnecessary_pages().
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Reported-and-tested-by: default avatarAlan Jenkins <sourcejedi.lkml@googlemail.com>
      Cc: stable@kernel.org
      a9c9b442
    • Jiri Slaby's avatar
      PM / Hibernate: Remove swsusp.c finally · f8bb0db8
      Jiri Slaby authored
      Its contents and entry in Makefile were already removed in
      8e60c6a1
      (Shift remaining code from swsusp.c to hibernate.c)
      but somehow it remained in-place (rjw: which most likely was my
      mistake).
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Acked-by: default avatarNigel Cunningham <nigel@tuxonice.net>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      f8bb0db8
    • Frans Pop's avatar
      PM / Hibernate: Remove trailing space in message · 07c3bb57
      Frans Pop authored
      Remove a trailing space from a message in swsusp_save().
      Signed-off-by: default avatarFrans Pop <elendil@planet.nl>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      07c3bb57
    • Rafael J. Wysocki's avatar
      PM: Allow SCSI devices to suspend/resume asynchronously · 4cb077d9
      Rafael J. Wysocki authored
      Set power.async_suspend for all SCSI devices, targets and hosts, so
      that they can be suspended and resumed in parallel with the main
      suspend/resume thread and possibly with other devices they don't
      depend on in a known way (i.e. devices which are not their parents or
      children).
      
      The power.async_suspend flag is also set for devices that don't have
      suspend or resume callbacks, because otherwise they would make the
      main suspend/resume thread wait for their "asynchronous" children
      (during suspend) or parents (during resume), effectively negating the
      possible gains from executing these devices' suspend and resume
      callbacks asynchronously.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      4cb077d9
    • Rafael J. Wysocki's avatar
      PM: Allow USB devices to suspend/resume asynchronously · 927bc916
      Rafael J. Wysocki authored
      Set power.async_suspend for USB devices, endpoints and interfaces,
      allowing them to be suspended and resumed asynchronously during
      system sleep transitions.
      
      The power.async_suspend flag is also set for devices that don't have
      suspend or resume callbacks, because otherwise they would make the
      main suspend/resume thread wait for their "asynchronous" children
      (during suspend) or parents (during resume), effectively negating the
      possible gains from executing these devices' suspend and resume
      callbacks asynchronously.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      927bc916
    • Alan Stern's avatar
      USB: implement non-tree resume ordering constraints for PCI host controllers · 6d19c009
      Alan Stern authored
      This patch (as1331) adds non-tree ordering constraints needed for
      proper resume of PCI USB host controllers from hibernation.  The main
      issue is that non-high-speed devices must not be resumed before the
      high-speed root hub, because it is the ehci_bus_resume() routine which
      takes care of handing the device connection over to the companion
      controller.  If the device resume is attempted before the handover
      then the device won't be found and it will be treated as though it had
      disconnected.
      
      The patch adds a new field to the usb_bus structure; for each
      full/low-speed bus this field will contain a pointer to the companion
      high-speed bus (if one exists).  It is used during normal device
      resume; if the hs_companion pointer isn't NULL then we wait for the
      root-hub device on the hs_companion bus.
      
      A secondary issue is that an EHCI controlller shouldn't be resumed
      before any of its companions.  On some machines I have observed
      handovers failing if the companion controller is reinitialized after
      the handover.  Thus, the EHCI resume routine must wait for the
      companion controllers to be resumed.
      
      The patch also fixes a small bug in usb_hcd_pci_probe(); an error path
      jumps to the wrong label, causing a memory leak.
      
      [rjw: Fixed compilation for CONFIG_PM_SLEEP unset.]
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      6d19c009
    • Rafael J. Wysocki's avatar
      PM: Allow PCI devices to suspend/resume asynchronously · a1e4d72c
      Rafael J. Wysocki authored
      Set power.async_suspend for all PCI devices and PCIe port services,
      so that they can be suspended and resumed in parallel with other
      devices they don't depend on in a known way (i.e. devices which are
      not their parents or children).
      
      This only affects the "regular" suspend and resume stages, which
      means in particular that the restoration of the PCI devices' standard
      configuration registers during resume will still be carried out
      synchronously (at the "early" resume stage).
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      a1e4d72c
    • Jiri Slaby's avatar
      PM / Hibernate: Swap, remove useless check from swsusp_read() · 09c09bc6
      Jiri Slaby authored
      It will never reach here if the sws_resume_bdev is erratic.
      swsusp_read() is called only from software_resume(), but after
      swsusp_check() which would catch the error state.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      09c09bc6
    • Jiri Slaby's avatar
      PM / Hibernate: Really deprecate deprecated user ioctls · b694e52e
      Jiri Slaby authored
      They were deprecated and removed from exported headers more than 2
      years ago. Inform users about their removal in the future now.
      
      (Switch cases needed to be reorderded for an easy fall through.)
      
      And add an entry to feature-removal-schedule.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      b694e52e
    • Rafael J. Wysocki's avatar
      PM: Allow device drivers to use dpm_wait() · f8824cee
      Rafael J. Wysocki authored
      There are some dependencies between devices (in particular, between
      EHCI USB controllers and their OHCI/UHCI siblings) which are not
      reflected by the structure of the device tree.  With synchronous
      suspend and resume these dependencies are taken into accout
      automatically, because the devices in question are always registered
      in the right order, but to meet these constraints with asynchronous
      suspend and resume the drivers of these devices will need to use
      dpm_wait() in their suspend/resume routines, so introduce a helper
      function allowing them to do that.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      f8824cee
    • Rafael J. Wysocki's avatar
      PM: Start asynchronous resume threads upfront · 97df8c12
      Rafael J. Wysocki authored
      It has been shown by testing that total device resume time can be
      reduced significantly (by as much as 50% or more) if the async
      threads executing some devices' resume routines are all started
      before the main resume thread starts to handle the "synchronous"
      devices.
      
      This is a consequence of the fact that the slowest devices tend to be
      located at the end of dpm_list, so their resume routines are started
      very late.  Consequently, they have to wait for all the preceding
      "synchronous" devices before their resume routines can be started
      by the main resume thread, even if they are "asynchronous".  By
      starting their async threads upfront we effectively move those
      devices towards the beginning of dpm_list, without breaking their
      ordering with respect to their parents and children.  As a result,
      their resume routines are started much earlier and we are able to
      save much more device resume time this way.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      97df8c12
    • Rafael J. Wysocki's avatar
      PM: Add facility for advanced testing of async suspend/resume · 5a2eb858
      Rafael J. Wysocki authored
      Add configuration switch CONFIG_PM_ADVANCED_DEBUG for compiling in
      extra PM debugging/testing code allowing one to access some
      PM-related attributes of devices from the user space via sysfs.
      
      If CONFIG_PM_ADVANCED_DEBUG is set, add sysfs attribute power/async
      for every device allowing the user space to access the device's
      power.async_suspend flag and modify it, if desired.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      5a2eb858
    • Rafael J. Wysocki's avatar
      PM: Add a switch for disabling/enabling asynchronous suspend/resume · 0e06b4a8
      Rafael J. Wysocki authored
      Add sysfs attribute /sys/power/pm_async allowing the user space to
      disable/enable asynchronous suspend/resume of devices.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      0e06b4a8
    • Rafael J. Wysocki's avatar
      PM: Asynchronous suspend and resume of devices · 5af84b82
      Rafael J. Wysocki authored
      Theoretically, the total time of system sleep transitions (suspend
      to RAM, hibernation) can be reduced by running suspend and resume
      callbacks of device drivers in parallel with each other.  However,
      there are dependencies between devices such that we're not allowed
      to suspend the parent of a device before suspending the device
      itself.  Analogously, we're not allowed to resume a device before
      resuming its parent.
      
      The most straightforward way to take these dependencies into accout
      is to start the async threads used for suspending and resuming
      devices at the core level, so that async_schedule() is called for
      each suspend and resume callback supposed to be executed
      asynchronously.
      
      For this purpose, introduce a new device flag, power.async_suspend,
      used to mark the devices whose suspend and resume callbacks are to be
      executed asynchronously (ie. in parallel with the main suspend/resume
      thread and possibly in parallel with each other) and helper function
      device_enable_async_suspend() allowing one to set power.async_suspend
      for given device (power.async_suspend is unset by default for all
      devices).  For each device with the power.async_suspend flag set the
      PM core will use async_schedule() to execute its suspend and resume
      callbacks.
      
      The async threads started for different devices as a result of
      calling async_schedule() are synchronized with each other and with
      the main suspend/resume thread with the help of completions, in the
      following way:
      (1) There is a completion, power.completion, for each device object.
      (2) Each device's completion is reset before calling async_schedule()
          for the device or, in the case of devices with the
          power.async_suspend flags unset, before executing the device's
          suspend and resume callbacks.
      (3) During suspend, right before running the bus type, device type
          and device class suspend callbacks for the device, the PM core
          waits for the completions of all the device's children to be
          completed.
      (4) During resume, right before running the bus type, device type and
          device class resume callbacks for the device, the PM core waits
          for the completion of the device's parent to be completed.
      (5) The PM core completes power.completion for each device right
          after the bus type, device type and device class suspend (or
          resume) callbacks executed for the device have returned.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      5af84b82
    • Rafael J. Wysocki's avatar
      PM: Add parent information to timing messages · 8cc6b39f
      Rafael J. Wysocki authored
      Add parent information to the messages printed by the suspend/resume
      core when initcall_debug is set.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      8cc6b39f
    • Rafael J. Wysocki's avatar
      PM: Document device power attributes in sysfs · 971cb7fb
      Rafael J. Wysocki authored
      There are sysfs attributes in /sys/devices/.../power/ that haven't
      been documented yet in Documentation/ABI/.  Document them as
      appropriate.
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      971cb7fb