1. 07 1月, 2012 1 次提交
  2. 07 11月, 2011 1 次提交
  3. 01 11月, 2011 1 次提交
  4. 26 7月, 2011 1 次提交
    • W
      pnpacpi: register disabled resources · 29df8d8f
      Witold Szczeponik 提交于
      When parsing PnP ACPI resource structures, it may happen that some of
      the resources are disabled (in which case "the size" of the resource
      equals zero).
      
      The current solution is to skip these resources completely - with the
      unfortunate side effect that they are not registered despite the fact
      that they exist, after all.  (The downside of this approach is that
      these resources cannot be used as templates for setting the actual
      device's resources because they are missing from the template.) The
      kernel's APM implementation does not suffer from this problem and
      registers all resources regardless of "their size".
      
      This patch fixes a problem with (at least) the vintage IBM ThinkPad 600E
      (and most likely also with the 600, 600X, and 770X which have a very
      similar layout) where some of its PnP devices support options where
      either an IRQ, a DMA, or an IO port is disabled.  Without this patch,
      the devices can not be configured using the
      "/sys/bus/pnp/devices/*/resources" interface.
      
      The manipulation of these resources is important because the 600E has
      very demanding requirements.  For instance, the number of IRQs is not
      sufficient to support all devices of the 600E.  Fortunately, some of the
      devices, like the sound card's MPU-401 UART, can be configured to not
      use any IRQ, hence freeing an IRQ for a device that requires one.
      (Still, the device's "ResourceTemplate" requires an IRQ resource
      descriptor which cannot be created if the resource has not been
      registered in the first place.)
      
      As an example, the dependent sets of the 600E's CSC0103 device (the
      MPU-401 UART) are listed, with the patch applied, as:
      
        Dependent: 00 - Priority preferred
          port 0x300-0x330, align 0xf, size 0x4, 16-bit address decoding
          irq <none> High-Edge
        Dependent: 01 - Priority acceptable
          port 0x300-0x330, align 0xf, size 0x4, 16-bit address decoding
          irq 5,7,2/9,10,11,15 High-Edge
      
      (The same result is obtained when PNPBIOS is used instead of PnP ACPI.)
      Without the patch, the IRQ resource in the preferred option is not
      listed at all:
      
        Dependent: 00 - Priority preferred
          port 0x300-0x330, align 0xf, size 0x4, 16-bit address decoding
        Dependent: 01 - Priority acceptable
          port 0x300-0x330, align 0xf, size 0x4, 16-bit address decoding
          irq 5,7,2/9,10,11,15 High-Edge
      
      And in fact, the 600E's DSDT lists the disabled IRQ as an option, as can
      be seen from the following excerpt from the DSDT:
      
      	Name (_PRS, ResourceTemplate ()
      	{
              StartDependentFn (0x00, 0x00)
              {
                  IO (Decode16, 0x0300, 0x0330, 0x10, 0x04)
                  IRQNoFlags () {}
              }
              StartDependentFn (0x01, 0x00)
              {
                  IO (Decode16, 0x0300, 0x0330, 0x10, 0x04)
                  IRQNoFlags () {5,7,9,10,11,15}
              }
              EndDependentFn ()
      	})
      
      With this patch applied, a user space program - or maybe even the kernel
      - can allocate all devices' resources optimally.  For the 600E, this
      means to find optimal resources for (at least) the serial port, the
      parallel port, the infrared port, the MWAVE modem, the sound card, and
      the MPU-401 UART.
      
      The patch applies the idea to register disabled resources to all types
      of resources, not just to IRQs, DMAs, and IO ports.  At the same time,
      it mimics the behavior of the "pnp_assign_xxx" functions from
      "drivers/pnp/manager.c" where resources with "no size" are considered
      disabled.
      
      No regressions were observed on hardware that does not require this
      patch.
      
      The patch is applied against 2.6.39.
      
      NB: The kernel's current PnP interface does not allow for disabling individual
      resources using the "/sys/bus/pnp/devices/$device/resources" file.  Assuming
      this could be done, a device could be configured to use a disabled resource
      using a simple series of calls:
      
        echo disable > /sys/bus/pnp/devices/$device/resources
        echo clear > /sys/bus/pnp/devices/$device/resources
        echo set irq disabled > /sys/bus/pnp/devices/$device/resources
        echo fill > /sys/bus/pnp/devices/$device/resources
        echo activate > /sys/bus/pnp/devices/$device/resources
      
      This patch addresses only the parsing of PnP ACPI devices.
      
      ChangeLog (v1 -> v2):
       - extend patch description
       - fix typo in patch itself
      Signed-off-by: NWitold Szczeponik <Witold.Szczeponik@gmx.net>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Adam Belay <abelay@mit.edu>
      Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
      Cc: Matthew Garrett <mjg@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      29df8d8f
  5. 10 6月, 2011 1 次提交
  6. 31 3月, 2011 1 次提交
  7. 23 3月, 2011 1 次提交
    • D
      pnp: only assign IORESOURCE_DMA if CONFIG_ISA_DMA_API is enabled · 586f83e2
      David Rientjes 提交于
      IORESOURCE_DMA cannot be assigned without utilizing the interface
      provided by CONFIG_ISA_DMA_API, specifically request_dma() and
      free_dma().  Thus, there's a strict dependency on the config option and
      limits IORESOURCE_DMA only to architectures that support ISA-style DMA.
      
      ia64 is not one of those architectures, so pnp_check_dma() no longer
      needs to be special-cased for that architecture.
      
      pnp_assign_resources() will now return -EINVAL if IORESOURCE_DMA is
      attempted on such a kernel.
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      586f83e2
  8. 12 1月, 2011 1 次提交
    • R
      PNP / ACPI: Use DEVICE_ACPI_HANDLE() for device ACPI handle access · cc8e7a35
      Rafael J. Wysocki 提交于
      The PNP ACPI driver squirrels the ACPI handles of PNP devices' ACPI
      companions, but this isn't correct, because those handles should be
      accessed using the DEVICE_ACPI_HANDLE() macro operating on struct
      device objects.
      
      Using DEVICE_ACPI_HANDLE() in the PNP ACPI driver instead of the
      driver's own copies of the ACPI handles allows us to avoid a problem
      with docking stations where a machine docked before suspend to RAM
      and undocked while suspended crashes during the subsequent resume (in
      that case the ACPI companion of the PNP device in question doesn't
      exist any more while the device is being resumed).  It also allows us
      to avoid the problem where suspend to RAM fails when the machine was
      undocked while suspended before (again, the ACPI companion of the PNP
      device is not present any more while it is being suspended).
      
      This change doesn't fix all of the the PNP ACPI driver's problems
      with PNP devices in docking stations (generally speaking, the driver
      has no idea that devices can come and go and doesn't even attempt to
      handle such events), but at least it makes suspend work for the
      users of docking stations who don't use the PNP devices located in
      there.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=15100Reported-and-tested-by: NToralf Förster <toralf.foerster@gmx.de>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      cc8e7a35
  9. 11 12月, 2010 1 次提交
  10. 18 11月, 2010 1 次提交
  11. 27 10月, 2010 2 次提交
  12. 18 10月, 2010 1 次提交
  13. 02 10月, 2010 1 次提交
  14. 01 10月, 2010 2 次提交
  15. 26 9月, 2010 1 次提交
    • A
      isapnp: BKL removal · 6117d213
      Arnd Bergmann 提交于
      Remove BKL use from isapnp_proc_bus_lseek(), like was done for
      proc_bus_pci_lseek() a long time ago and recently for Zorro
      by Geert Uytterhoeven.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      6117d213
  16. 19 7月, 2010 1 次提交
  17. 06 5月, 2010 1 次提交
  18. 29 4月, 2010 1 次提交
  19. 04 4月, 2010 1 次提交
  20. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  21. 15 3月, 2010 2 次提交
  22. 16 12月, 2009 3 次提交
    • A
      pnpbios: convert to seq_file · 5116fa2b
      Alexey Dobriyan 提交于
      Convert code away from ->read_proc/->write_proc interfaces.  Switch to
      proc_create()/proc_create_data() which make addition of proc entries
      reliable wrt NULL ->proc_fops, NULL ->data and so on.
      
      Problem with ->read_proc et al is described here commit
      786d7e16 "Fix rmmod/read/write races in
      /proc entries"
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Cc: Adam Belay <abelay@mit.edu>
      Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5116fa2b
    • B
      PNP: add interface to retrieve ACPI device from a PNPACPI device · 9065ce45
      Bjorn Helgaas 提交于
      Add pnp_acpi_device(pnp_dev), which takes a PNP device and returns the
      associated ACPI device (or NULL, if the device is not a PNPACPI device).
      
      This allows us to write a PNP driver that can manage both traditional
      PNPBIOS and ACPI devices, treating ACPI-only functionality as an optional
      extension.
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      9065ce45
    • A
      tree-wide: convert open calls to remove spaces to skip_spaces() lib function · e7d2860b
      André Goddard Rosa 提交于
      Makes use of skip_spaces() defined in lib/string.c for removing leading
      spaces from strings all over the tree.
      
      It decreases lib.a code size by 47 bytes and reuses the function tree-wide:
         text    data     bss     dec     hex filename
        64688     584     592   65864   10148 (TOTALS-BEFORE)
        64641     584     592   65817   10119 (TOTALS-AFTER)
      
      Also, while at it, if we see (*str && isspace(*str)), we can be sure to
      remove the first condition (*str) as the second one (isspace(*str)) also
      evaluates to 0 whenever *str == 0, making it redundant. In other words,
      "a char equals zero is never a space".
      
      Julia Lawall tried the semantic patch (http://coccinelle.lip6.fr) below,
      and found occurrences of this pattern on 3 more files:
          drivers/leds/led-class.c
          drivers/leds/ledtrig-timer.c
          drivers/video/output.c
      
      @@
      expression str;
      @@
      
      ( // ignore skip_spaces cases
      while (*str &&  isspace(*str)) { \(str++;\|++str;\) }
      |
      - *str &&
      isspace(*str)
      )
      Signed-off-by: NAndré Goddard Rosa <andre.goddard@gmail.com>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
      Cc: David Howells <dhowells@redhat.com>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: Samuel Ortiz <samuel@sortiz.org>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Takashi Iwai <tiwai@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e7d2860b
  23. 11 12月, 2009 1 次提交
  24. 04 12月, 2009 1 次提交
  25. 05 11月, 2009 2 次提交
  26. 26 9月, 2009 3 次提交
  27. 22 9月, 2009 1 次提交
  28. 27 8月, 2009 1 次提交
    • B
      ACPICA: Major update for acpi_get_object_info external interface · 15b8dd53
      Bob Moore 提交于
      Completed a major update for the acpi_get_object_info external interface.
      Changes include:
       - Support for variable, unlimited length HID, UID, and CID strings
       - Support Processor objects the same as Devices (HID,UID,CID,ADR,STA, etc.)
       - Call the _SxW power methods on behalf of a device object
       - Determine if a device is a PCI root bridge
       - Change the ACPI_BUFFER parameter to ACPI_DEVICE_INFO.
      These changes will require an update to all callers of this interface.
      See the ACPICA Programmer Reference for details.
      
      Also, update all invocations of acpi_get_object_info interface
      Signed-off-by: NBob Moore <robert.moore@intel.com>
      Signed-off-by: NLin Ming <ming.m.lin@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      15b8dd53
  29. 10 8月, 2009 1 次提交
  30. 08 8月, 2009 1 次提交
  31. 20 7月, 2009 1 次提交
  32. 05 6月, 2009 1 次提交