linux-2.6
16 years agopowerpc/ps3: Update ps3_defconfig
Geoff Levand [Wed, 16 Jul 2008 21:22:26 +0000 (07:22 +1000)] 
powerpc/ps3: Update ps3_defconfig

Update ps3_defconfig.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/ps3: Add a sub-match id to ps3_system_bus
Masakazu Mokuno [Wed, 16 Jul 2008 21:22:19 +0000 (07:22 +1000)] 
powerpc/ps3: Add a sub-match id to ps3_system_bus

Add sub match id for ps3 system bus so that two different system bus
devices can be connected to a shared device.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: Add a 6xx defconfig
Kumar Gala [Wed, 16 Jul 2008 13:43:06 +0000 (23:43 +1000)] 
powerpc: Add a 6xx defconfig

This is a defconfig from Dave Jones and should be similar (if not
identical) to the fedora ppc32 defconfig.  The intent is to cover all
cache coherent 6xx based chips and platforms as reasonable.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/dma: Use the struct dma_attrs in iommu code
Mark Nelson [Tue, 15 Jul 2008 19:51:47 +0000 (05:51 +1000)] 
powerpc/dma: Use the struct dma_attrs in iommu code

Update iommu_alloc() to take the struct dma_attrs and pass them on to
tce_build(). This change propagates down to the tce_build functions of
all the platforms.

Signed-off-by: Mark Nelson <markn@au1.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/cell: Add support for power button of future IBM cell blades
Christian Krafft [Tue, 15 Jul 2008 19:51:45 +0000 (05:51 +1000)] 
powerpc/cell: Add support for power button of future IBM cell blades

This patch adds support for the power button on future IBM cell blades.
It actually doesn't shut down the machine. Instead it exposes an
input device /dev/input/event0 to userspace which sends KEY_POWER
if power button has been pressed.
haldaemon actually recognizes the button, so a plattform independent acpid
replacement should handle it correctly.

Signed-off-by: Christian Krafft <krafft@de.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/cell: Cleanup sysreset_hack for IBM cell blades
Christian Krafft [Tue, 15 Jul 2008 19:51:44 +0000 (05:51 +1000)] 
powerpc/cell: Cleanup sysreset_hack for IBM cell blades

This patch adds a config option for the sysreset_hack used for
IBM Cell blades. The code is moves from pervasive.c into ras.c and
gets it's own init method.

Signed-off-by: Christian Krafft <krafft@de.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/cell/cpufreq: Add spu aware cpufreq governor
Christian Krafft [Tue, 15 Jul 2008 19:51:43 +0000 (05:51 +1000)] 
powerpc/cell/cpufreq: Add spu aware cpufreq governor

This patch adds a cpufreq governor that takes the number of running spus
into account. It's very similar to the ondemand governor, but not as complex.
Instead of hacking spu load into the ondemand governor it might be easier to
have cpufreq accepting multiple governors per cpu in future.
Don't know if this is the right way, but it would keep the governors simple.

Signed-off-by: Christian Krafft <krafft@de.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/axonram: Enable partitioning of the Axons DDR2 DIMMs
Maxim Shchetynin [Tue, 15 Jul 2008 19:51:42 +0000 (05:51 +1000)] 
powerpc/axonram: Enable partitioning of the Axons DDR2 DIMMs

DDR2 memory DIMMs on the Axon could be accessed only as one partition
when using file system drivers which are using the direct_access() method.
This patch enables for such file system drivers to access Axon's DDR2 memory
even if it is splitted in several partitions.

Signed-off-by: Maxim Shchetynin <maxim@de.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc/axonram: Use only one block device major number
Maxim Shchetynin [Tue, 15 Jul 2008 19:51:41 +0000 (05:51 +1000)] 
powerpc/axonram: Use only one block device major number

Axonram module registers one block device for each DDR2 DIMM found
on a system. This means that each DDR2 DIMM becomes its own block device
major number. This patch lets axonram module to register the only one
block device for all DDR2 DIMMs which also spares kernel resources.

Signed-off-by: Maxim Shchetynin <maxim@de.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agoof_gpio: Should use new <linux/gpio.h> header
Wolfgang Grandegger [Fri, 30 May 2008 12:51:33 +0000 (22:51 +1000)] 
of_gpio: Should use new <linux/gpio.h> header

Since commit 7560fa60fcdcdb0da662f6a9fad9064b554ef46c (gpio: <linux/gpio.h>
and "no GPIO support here" stubs) drivers can use GPIOs if they're available,
but don't require them.

This patch actually enables this feature.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
16 years agopowerpc: fix ALSA options in Freescale 85xx and 86xx defconfigs
Timur Tabi [Tue, 24 Jun 2008 22:35:02 +0000 (17:35 -0500)] 
powerpc: fix ALSA options in Freescale 85xx and 86xx defconfigs

The defconfigs for Freescale 85xx and 86xx SOCs had bad choices for some
audio related options.  In particular, OSS emulation should be enabled,
and the old ALSA API should be disabled.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoRevert "powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET"
Kumar Gala [Wed, 16 Jul 2008 22:59:03 +0000 (17:59 -0500)] 
Revert "powerpc/ep8248e: Fix compile problem if !CONFIG_FS_ENET"

This reverts commit e3621ee633810be1079d0fa65ac2c904f53b73fa.

This was not the proper fix.  As Scott Wood said CONFIG_FS_ENET has nothing
to do with the issue.  The proper fix is to select PHYLIB for this board.

16 years agopowerpc/ep8248e: Unconditionally select PHYLIB for mdio_bitbang
Kumar Gala [Wed, 16 Jul 2008 22:47:54 +0000 (17:47 -0500)] 
powerpc/ep8248e: Unconditionally select PHYLIB for mdio_bitbang

Its possible to build the phylib as a module, however this breaks the
board code because alloc_mdio_bitbang and mdiobus_register are not
available if we build as a module.  These are needed by the board code
since it implements the low level mdio bitbang ops.

So we unconditionally select PHYLIB to ensure its built into the kernel
if we are building in EP8248E support.

Long term we should look at moving the mdio_ops into its own file so it
can be built as a module.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/fsl: Minor TLBSYNC cleanup for FSL Book-E
Kumar Gala [Fri, 11 Jul 2008 19:31:35 +0000 (14:31 -0500)] 
powerpc/fsl: Minor TLBSYNC cleanup for FSL Book-E

Use the TLBSYNC macro defined in ppc_asm.h rather than our own ifdefs.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: rework FSL Book-E PTE access and TLB miss
Kumar Gala [Wed, 9 Jul 2008 15:03:28 +0000 (10:03 -0500)] 
powerpc: rework FSL Book-E PTE access and TLB miss

This converts the FSL Book-E PTE access and TLB miss handling to match
with the recent changes to 44x that introduce support for non-atomic PTE
operations in pgtable-ppc32.h and removes write back to the PTE from
the TLB miss handlers. In addition, the DSI interrupt code no longer
tries to fixup write permission, this is left to generic code, and
_PAGE_HWWRITE is gone.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Remove Kconfig PPC_CPM_NEW_BINDING
Kumar Gala [Thu, 12 Jun 2008 13:33:12 +0000 (08:33 -0500)] 
powerpc: Remove Kconfig PPC_CPM_NEW_BINDING

With arch/ppc gone and all in kernel users of CONFIG_PPC_CPM_NEW_BINDING
fixed up we dont have need for the Kconfig option anymore.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agofs_enet: Remove !CONFIG_PPC_CPM_NEW_BINDING code
Kumar Gala [Thu, 12 Jun 2008 13:32:13 +0000 (08:32 -0500)] 
fs_enet: Remove !CONFIG_PPC_CPM_NEW_BINDING code

Now that arch/ppc is gone we always define CONFIG_PPC_CPM_NEW_BINDING so
we can remove all the code associated with !CONFIG_PPC_CPM_NEW_BINDING.

Also fixed some asm/of_platform.h to linux/of_platform.h (and of_device.h)

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoAdd fsl,magic-packet to, and clean up, the gianfar binding.
Scott Wood [Fri, 11 Jul 2008 23:04:43 +0000 (18:04 -0500)] 
Add fsl,magic-packet to, and clean up, the gianfar binding.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agogianfar: Add magic packet and suspend/resume support.
Scott Wood [Fri, 11 Jul 2008 23:04:45 +0000 (18:04 -0500)] 
gianfar: Add magic packet and suspend/resume support.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Fix a bunch of sparse warnings in the qe_lib
Andy Fleming [Wed, 7 May 2008 18:19:44 +0000 (13:19 -0500)] 
powerpc: Fix a bunch of sparse warnings in the qe_lib

Mostly having to do with not marking things __iomem.  And some failure
to use appropriate accessors to read MMIO regs.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Add support for multiple gfar mdio interfaces
Andy Fleming [Fri, 2 May 2008 18:03:50 +0000 (13:03 -0500)] 
powerpc: Add support for multiple gfar mdio interfaces

The old code assumed there was only one, but the 8572 actually has 3.

Also, our usual id, 0xe0024520, gets resolved to -1 somewhere, and this was
preventing the multiple buses from having different ids.  So we only keep
the low 20 bits, which have the interesting info, anyway.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/86xx: mpc8610_hpcd - add support for ULI RTC
Anton Vorontsov [Wed, 11 Jun 2008 23:04:37 +0000 (03:04 +0400)] 
powerpc/86xx: mpc8610_hpcd - add support for ULI RTC

The ULI "Super South Bridge" contains ISA bridge to the legacy
devices, such as Super IO mouse/keyboard/floppy disk controllers,
parallel port, i8259 interrupt controller and so on.

i8259 is disabled on the MPC8610HPCD, and other peripherals are not
traced out. So we use only RTC.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/85xx/86xx: some refactoring for fsl_uli1575 code
Anton Vorontsov [Wed, 11 Jun 2008 23:04:17 +0000 (03:04 +0400)] 
powerpc/85xx/86xx: some refactoring for fsl_uli1575 code

- Get rid of uses_fsl_uli_m1575, it does not scale for all cases.
  Instead, let's explicitly use machine_is() for each fixup.
- Factor out MPC8610HPCD quirks to fsl_uli1575, and protect them with
  machine_is(). One step closer to multiplatform kernels.
- Actually use fsl_uli1575 on MPC8610HPCD, so RTC quirk will be applied.
- RTC quirk applies to all boards though, so no machine_is() checks.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/fsl_uli1575: fix RTC quirk to work on MPC8572DS and MPC8610HPCD
Anton Vorontsov [Wed, 11 Jun 2008 23:04:02 +0000 (03:04 +0400)] 
powerpc/fsl_uli1575: fix RTC quirk to work on MPC8572DS and MPC8610HPCD

This patch fixes RTC on MPC8572DS boards: dummy read helps only when
reading at the end of the bridge's memory (i.e. outside of behind the
bridge devices' assigned regions).

With this change the quirk also makes RTC work on MPC8610HPCD, so it's
unlikely that this will break MPC8641HPCN or MPC8544DS boards.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Add documentation for CPM GPIO banks
Jochen Friedrich [Sat, 5 Jul 2008 11:29:28 +0000 (13:29 +0200)] 
powerpc: Add documentation for CPM GPIO banks

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: add FHCI USB, FSL MCU, FSL UPM and GPIO LEDs bindings
Anton Vorontsov [Fri, 4 Jul 2008 16:53:28 +0000 (20:53 +0400)] 
powerpc: add FHCI USB, FSL MCU, FSL UPM and GPIO LEDs bindings

This patch adds few bindings for the new drivers to be submitted through
the appropriate maintainers.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/fsl_soc: gianfar: don't probe disabled devices
Anton Vorontsov [Tue, 8 Jul 2008 17:36:40 +0000 (21:36 +0400)] 
powerpc/fsl_soc: gianfar: don't probe disabled devices

Freescale ships MPC8315E-RDB boards in two variants:

1. With TSEC1 ethernet support and USB UTMI PHY;
2. Without TSEC1 support, but with USB ULPI PHY in addition.

For the second case U-Boot will add status = "disabled"; property
into the TSEC1 node, so Linux should not try to probe it.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/83xx: fix ULPI setup for MPC8315 processors
Anton Vorontsov [Tue, 8 Jul 2008 17:36:32 +0000 (21:36 +0400)] 
powerpc/83xx: fix ULPI setup for MPC8315 processors

We must not use MPC831X_SICR[HL]_* definitions for the MPC8315 processors,
because SICR USB bits locations are not compatible with MPC8313.

This patch fixes ULPI workability on MPC8315E-RDB boards.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Move mpc83xx_add_bridge to fsl_pci.c
John Rigby [Thu, 26 Jun 2008 17:07:57 +0000 (11:07 -0600)] 
powerpc: Move mpc83xx_add_bridge to fsl_pci.c

This allows other platforms with the same pci block like MPC5121 to use it.

Signed-off-by: John Rigby <jrigby@freescale.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: pci config cleanup
John Rigby [Thu, 26 Jun 2008 17:07:56 +0000 (11:07 -0600)] 
powerpc: pci config cleanup

Choosing PCI or not at config time is allowed on some
platforms via an if expression in arch/powerpc/Kconfig.
To add a new platform with PCI support selectable at
config time, you must change the if expression.  This
patch makes this easier by changing:
    bool "PCI support" if <long expression>
to
    bool "PCI support" if PPC_PCI_CHOICE
and adding select PPC_PCI_CHOICE to all the config nodes that
were previously in the PCI if expression.

Platforms with unconditional PCI support continue to
just select PCI in their config nodes.

Signed-off-by: John Rigby <jrigby@freescale.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/mpc7448: add alias list to DTS, clean out old chosen node
Paul Gortmaker [Thu, 10 Jul 2008 20:21:35 +0000 (16:21 -0400)] 
powerpc/mpc7448: add alias list to DTS, clean out old chosen node

The mpc7448hpc2 board doesn't have an alias block like
most of the other modern eval boards have.  We need this
block in order to have u-boot be able to make use of the
CONFIG_OF_STDOUT_VIA_ALIAS (vs. having a hard coded node)
in the future.

Also remove the old, redundant chosen node.  Of all the modern
Freescale eval boards (incl. 83xx, 85xx, 86xx) this is the only
one which still has it.  Its presence also breaks with some older
versions of u-boot, like 1.3.1 -- which try and insert a
second chosen node.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/mpc8313erdb: Add power management to the device tree.
Scott Wood [Fri, 11 Jul 2008 22:55:25 +0000 (17:55 -0500)] 
powerpc/mpc8313erdb: Add power management to the device tree.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc/mpc83xx: Power Management support
Scott Wood [Tue, 9 Oct 2007 17:37:13 +0000 (12:37 -0500)] 
powerpc/mpc83xx: Power Management support

Basic PM support for 83xx.  Standby is implemented as sleep.
Suspend-to-RAM is implemented as "deep sleep" (with the processor
turned off) on 831x.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Update example SOC node in booting-without-of.txt.
Scott Wood [Wed, 25 Jun 2008 17:07:39 +0000 (12:07 -0500)] 
powerpc: Update example SOC node in booting-without-of.txt.

Convert to DTS version 1, eliminate some obsolete practices, and
correct some errors (compared to the actual 8540 device tree).

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Document Freescale power management nodes, and the sleep property.
Scott Wood [Fri, 11 Jul 2008 22:31:15 +0000 (17:31 -0500)] 
powerpc: Document Freescale power management nodes, and the sleep property.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
Linus Torvalds [Wed, 16 Jul 2008 22:11:07 +0000 (15:11 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/drzeus/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc: (68 commits)
  sdio_uart: Fix SDIO break control to now return success or an error
  mmc: host driver for Ricoh Bay1Controllers
  sdio: sdio_io.c Fix sparse warnings
  sdio: fix the use of hard coded timeout value.
  mmc: OLPC: update vdd/powerup quirk comment
  mmc: fix spares errors of sdhci.c
  mmc: remove multiwrite capability
  wbsd: fix bad dma_addr_t conversion
  atmel-mci: Driver for Atmel on-chip MMC controllers
  mmc: fix sdio_io sparse errors
  mmc: wbsd.c fix shadowing of 'dma' variable
  MMC: S3C24XX: Refuse incorrectly aligned transfers
  MMC: S3C24XX: Add maintainer entry
  MMC: S3C24XX: Update error debugging.
  MMC: S3C24XX: Add media presence test to request handling.
  MMC: S3C24XX: Fix use of msecs where jiffies are needed
  MMC: S3C24XX: Add MODULE_ALIAS() entries for the platform devices
  MMC: S3C24XX: Fix s3c2410_dma_request() return code check.
  MMC: S3C24XX: Allow card-detect on non-IRQ capable pin
  MMC: S3C24XX: Ensure host->mrq->data is valid
  ...

Manually fixed up bogus executable bits on drivers/mmc/core/sdio_io.c
and include/linux/mmc/sdio_func.h when merging.

16 years agoMerge branch 'for_linus' of git://git.infradead.org/~dedekind/ubifs-2.6
Linus Torvalds [Wed, 16 Jul 2008 22:02:57 +0000 (15:02 -0700)] 
Merge branch 'for_linus' of git://git.infradead.org/~dedekind/ubifs-2.6

* 'for_linus' of git://git.infradead.org/~dedekind/ubifs-2.6:
  UBIFS: include to compilation
  UBIFS: add new flash file system
  UBIFS: add brief documentation
  MAINTAINERS: add UBIFS section
  do_mounts: allow UBI root device name
  VFS: export sync_sb_inodes
  VFS: move inode_lock into sync_sb_inodes

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Wed, 16 Jul 2008 21:53:54 +0000 (14:53 -0700)] 
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (76 commits)
  IDE: Report errors during drive reset back to user space
  Update documentation of HDIO_DRIVE_RESET ioctl
  IDE: Remove unused code
  IDE: Fix HDIO_DRIVE_RESET handling
  hd.c: remove the #include <linux/mc146818rtc.h>
  update the BLK_DEV_HD help text
  move ide/legacy/hd.c to drivers/block/
  ide/legacy/hd.c: use late_initcall()
  remove BLK_DEV_HD_ONLY
  ide: endian annotations in ide-floppy.c
  ide-floppy: zero out the whole struct ide_atapi_pc on init
  ide-floppy: fold idefloppy_create_test_unit_ready_cmd into idefloppy_open
  ide-cd: move request prep chunk from cdrom_do_newpc_cont to rq issue path
  ide-cd: move request prep from cdrom_start_rw_cont to rq issue path
  ide-cd: move request prep from cdrom_start_seek_continuation to rq issue path
  ide-cd: fold cdrom_start_seek into ide_cd_do_request
  ide-cd: simplify request issuing path
  ide-cd: mv ide_do_rw_cdrom ide_cd_do_request
  ide-cd: cdrom_start_seek: remove unused argument block
  ide-cd: ide_do_rw_cdrom: add the catch-all bad request case to the if-else block
  ...

16 years agoMerge branch 'release-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/ak...
Linus Torvalds [Wed, 16 Jul 2008 21:52:12 +0000 (14:52 -0700)] 
Merge branch 'release-2.6.27' of git://git./linux/kernel/git/ak/linux-acpi-merge-2.6

* 'release-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-acpi-merge-2.6: (87 commits)
  Fix FADT parsing
  Add the ability to reset the machine using the RESET_REG in ACPI's FADT table.
  ACPI: use dev_printk when possible
  PNPACPI: add support for HP vendor-specific CCSR descriptors
  PNP: avoid legacy IDE IRQs
  PNP: convert resource options to single linked list
  ISAPNP: handle independent options following dependent ones
  PNP: remove extra 0x100 bit from option priority
  PNP: support optional IRQ resources
  PNP: rename pnp_register_*_resource() local variables
  PNPACPI: ignore _PRS interrupt numbers larger than PNP_IRQ_NR
  PNP: centralize resource option allocations
  PNP: remove redundant pnp_can_configure() check
  PNP: make resource assignment functions return 0 (success) or -EBUSY (failure)
  PNP: in debug resource dump, make empty list obvious
  PNP: improve resource assignment debug
  PNP: increase I/O port & memory option address sizes
  PNP: introduce pnp_irq_mask_t typedef
  PNP: make resource option structures private to PNP subsystem
  PNP: define PNP-specific IORESOURCE_IO_* flags alongside IRQ, DMA, MEM
  ...

16 years agoblock: Trivial fix for blk_integrity_rq()
Martin K. Petersen [Wed, 16 Jul 2008 20:09:06 +0000 (16:09 -0400)] 
block: Trivial fix for blk_integrity_rq()

Fail integrity check gracefully when request does not have a bio
attached (BLOCK_PC).

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge git://git.linux-nfs.org/projects/trondmy/nfs-2.6
Linus Torvalds [Wed, 16 Jul 2008 21:49:49 +0000 (14:49 -0700)] 
Merge git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (82 commits)
  NFSv4: Remove BKL from the nfsv4 state recovery
  SUNRPC: Remove the BKL from the callback functions
  NFS: Remove BKL from the readdir code
  NFS: Remove BKL from the symlink code
  NFS: Remove BKL from the sillydelete operations
  NFS: Remove the BKL from the rename, rmdir and unlink operations
  NFS: Remove BKL from NFS lookup code
  NFS: Remove the BKL from nfs_link()
  NFS: Remove the BKL from the inode creation operations
  NFS: Remove BKL usage from open()
  NFS: Remove BKL usage from the write path
  NFS: Remove the BKL from the permission checking code
  NFS: Remove attribute update related BKL references
  NFS: Remove BKL requirement from attribute updates
  NFS: Protect inode->i_nlink updates using inode->i_lock
  nfs: set correct fl_len in nlmclnt_test()
  SUNRPC: Support registering IPv6 interfaces with local rpcbind daemon
  SUNRPC: Refactor rpcb_register to make rpcbindv4 support easier
  SUNRPC: None of rpcb_create's callers wants a privileged source port
  SUNRPC: Introduce a specific rpcb_create for contacting localhost
  ...

16 years agoFix FADT parsing
Jan Beulich [Wed, 16 Jul 2008 21:27:08 +0000 (23:27 +0200)] 
Fix FADT parsing

The (1.0 inherited) separate length fields in the FADT are byte granular.
Further, PM1a/b may have distinct lengths and live in distinct address spaces.
 acpi_tb_convert_fadt() should account for all of these conditions.

Apart from these changes I'm puzzled by the fact that, not just for
acpi_gbl_xpm1{a,b}_enable, acpi_hw_low_level_{read,write}() get an explicit
size passed rather than using the size found in the passed GAS.  What happens
on a platform that defines PM1{a,b} wider than 16 bits?  Of course,
acpi_hw_low_level_{read,write}() at present are entirely un-prepared to deal
with sizes other than 8, 16, or 32, not to speak of a non-zero bit_offset or
access_width...

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
16 years agoAdd the ability to reset the machine using the RESET_REG in ACPI's FADT table.
Aaron Durbin [Wed, 16 Jul 2008 21:27:08 +0000 (23:27 +0200)] 
Add the ability to reset the machine using the RESET_REG in ACPI's FADT table.

Signed-off-by: Aaron Durbin <adurbin@google.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
16 years agoACPI: use dev_printk when possible
Bjorn Helgaas [Fri, 27 Jun 2008 14:45:39 +0000 (08:45 -0600)] 
ACPI: use dev_printk when possible

Convert printks to use dev_printk().  The most obvious change will
be messages like this:

   -ACPI: PCI Interrupt 0000:00:04.0[A] -> GSI 31 (level, low) -> IRQ 31
   +cciss 0000:00:04.0: PCI INT A -> GSI 31 (level, low) -> IRQ 31

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoPNPACPI: add support for HP vendor-specific CCSR descriptors
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:19 +0000 (16:57 -0600)] 
PNPACPI: add support for HP vendor-specific CCSR descriptors

The HP CCSR descriptor describes MMIO address space that should appear
as a MEM resource.  This patch adds support for parsing these descriptors
in the _CRS data.

The visible effect of this is that these MEM resources will appear
in /sys/devices/pnp0/.../resources, which means that "lspnp -v" will
report it, user applications can use this to locate device CSR space,
and kernel drivers can use the normal PNP resource accessors to
locate them.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoPNP: avoid legacy IDE IRQs
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:18 +0000 (16:57 -0600)] 
PNP: avoid legacy IDE IRQs

If an IDE controller is in compatibility mode, it expects to use
IRQs 14 and 15, so PNP should avoid them.

This patch should resolve this problem report:
  parallel driver grabs IRQ14 preventing legacy SFF ATA controller from working
  https://bugzilla.novell.com/show_bug.cgi?id=375836

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoPNP: convert resource options to single linked list
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:17 +0000 (16:57 -0600)] 
PNP: convert resource options to single linked list

ISAPNP, PNPBIOS, and ACPI describe the "possible resource settings" of
a device, i.e., the possibilities an OS bus driver has when it assigns
I/O port, MMIO, and other resources to the device.

PNP used to maintain this "possible resource setting" information in
one independent option structure and a list of dependent option
structures for each device.  Each of these option structures had lists
of I/O, memory, IRQ, and DMA resources, for example:

  dev
    independent options
      ind-io0  -> ind-io1  ...
      ind-mem0 -> ind-mem1 ...
      ...
    dependent option set 0
      dep0-io0  -> dep0-io1  ...
      dep0-mem0 -> dep0-mem1 ...
      ...
    dependent option set 1
      dep1-io0  -> dep1-io1  ...
      dep1-mem0 -> dep1-mem1 ...
      ...
    ...

This data structure was designed for ISAPNP, where the OS configures
device resource settings by writing directly to configuration
registers.  The OS can write the registers in arbitrary order much
like it writes PCI BARs.

However, for PNPBIOS and ACPI devices, the OS uses firmware interfaces
that perform device configuration, and it is important to pass the
desired settings to those interfaces in the correct order.  The OS
learns the correct order by using firmware interfaces that return the
"current resource settings" and "possible resource settings," but the
option structures above doesn't store the ordering information.

This patch replaces the independent and dependent lists with a single
list of options.  For example, a device might have possible resource
settings like this:

  dev
    options
      ind-io0 -> dep0-io0 -> dep1->io0 -> ind-io1 ...

All the possible settings are in the same list, in the order they
come from the firmware "possible resource settings" list.  Each entry
is tagged with an independent/dependent flag.  Dependent entries also
have a "set number" and an optional priority value.  All dependent
entries must be assigned from the same set.  For example, the OS can
use all the entries from dependent set 0, or all the entries from
dependent set 1, but it cannot mix entries from set 0 with entries
from set 1.

Prior to this patch PNP didn't keep track of the order of this list,
and it assigned all independent options first, then all dependent
ones.  Using the example above, that resulted in a "desired
configuration" list like this:

  ind->io0 -> ind->io1 -> depN-io0 ...

instead of the list the firmware expects, which looks like this:

  ind->io0 -> depN-io0 -> ind-io1 ...

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoISAPNP: handle independent options following dependent ones
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:16 +0000 (16:57 -0600)] 
ISAPNP: handle independent options following dependent ones

The ISAPNP spec recommends that independent options precede
dependent ones, but this is not actually required.  The current
ISAPNP code incorrectly puts such trailing independent options
at the end of the last dependent option list.

This patch fixes that bug by resetting the current option list
to the independent list when we see an "End Dependent Functions"
tag.  PNPBIOS and PNPACPI handle this the same way.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: remove extra 0x100 bit from option priority
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:15 +0000 (16:57 -0600)] 
PNP: remove extra 0x100 bit from option priority

When building resource options, ISAPNP and PNPBIOS set the priority
to something like "0x100 | PNP_RES_PRIORITY_ACCEPTABLE", but we
immediately mask off the 0x100 again in pnp_build_option(), so that
bit looks superfluous.

Thanks to Rene Herman <rene.herman@gmail.com> for pointing this out.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: support optional IRQ resources
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:14 +0000 (16:57 -0600)] 
PNP: support optional IRQ resources

This patch adds an IORESOURCE_IRQ_OPTIONAL flag for use when
assigning resources to a device.  If the flag is set and we are
unable to assign an IRQ to the device, we can leave the IRQ
disabled but allow the overall resource allocation to succeed.

Some devices request an IRQ, but can run without an IRQ
(possibly with degraded performance).  This flag lets us run
the device without the IRQ instead of just leaving the
device disabled.

This is a reimplementation of this previous change by Rene
Herman <rene.herman@gmail.com>:
    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3b73a223661ed137c5d3d2635f954382e94f5a43

I reimplemented this for two reasons:
    - to prepare for converting all resource options into a single linked
      list, as opposed to the per-resource-type lists we have now, and
    - to preserve the order and number of resource options.

In PNPBIOS and ACPI, we configure a device by giving firmware a
list of resource assignments.  It is important that this list
has exactly the same number of resources, in the same order,
as the "template" list we got from the firmware in the first
place.

The problem of a sound card MPU401 being left disabled for want of
an IRQ was reported by Uwe Bugla <uwe.bugla@gmx.de>.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: rename pnp_register_*_resource() local variables
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:13 +0000 (16:57 -0600)] 
PNP: rename pnp_register_*_resource() local variables

No functional change; just rename "data" to something more
descriptive.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNPACPI: ignore _PRS interrupt numbers larger than PNP_IRQ_NR
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:12 +0000 (16:57 -0600)] 
PNPACPI: ignore _PRS interrupt numbers larger than PNP_IRQ_NR

ACPI Extended Interrupt Descriptors can encode 32-bit interrupt
numbers, so an interrupt number may exceed the size of the bitmap
we use to track possible IRQ settings.

To avoid corrupting memory, complain and ignore too-large interrupt
numbers.

There's similar code in pnpacpi_parse_irq_option(), but I didn't
change that because the small IRQ descriptor can only encode
IRQs 0-15, which do not exceed bitmap size.

In the future, we could handle IRQ numbers greater than PNP_IRQ_NR
by replacing the bitmap with a table or list.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: centralize resource option allocations
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:11 +0000 (16:57 -0600)] 
PNP: centralize resource option allocations

This patch moves all the option allocations (pnp_mem, pnp_port, etc)
into the pnp_register_{mem,port,irq,dma}_resource() functions.  This
will make it easier to rework the option data structures.

The non-trivial part of this patch is the IRQ handling.  The backends
have to allocate a local pnp_irq_mask_t bitmap, populate it, and pass
a pointer to pnp_register_irq_resource().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: remove redundant pnp_can_configure() check
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:10 +0000 (16:57 -0600)] 
PNP: remove redundant pnp_can_configure() check

pnp_assign_resources() is static and the only caller checks
pnp_can_configure() before calling it, so no need to do it
again.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: make resource assignment functions return 0 (success) or -EBUSY (failure)
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:09 +0000 (16:57 -0600)] 
PNP: make resource assignment functions return 0 (success) or -EBUSY (failure)

This patch doesn't change any behavior; it just makes the return
values more conventional.

This changes pnp_assign_dma() from a void function to one that
returns an int, just like the other assignment functions.  For
now, at least, pnp_assign_dma() always returns 0 (success), so
it appears to never fail, just like before.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: in debug resource dump, make empty list obvious
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:08 +0000 (16:57 -0600)] 
PNP: in debug resource dump, make empty list obvious

If the resource list is empty, say that explicitly.  Previously,
it was confusing because often the heading was followed by zero
resource lines, then some "add resource" lines from auto-assignment,
so the "add" lines looked like current resources.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: improve resource assignment debug
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:07 +0000 (16:57 -0600)] 
PNP: improve resource assignment debug

When we fail to assign an I/O or MEM resource, include the min/max
in the debug output to help match it with the options.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: increase I/O port & memory option address sizes
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:06 +0000 (16:57 -0600)] 
PNP: increase I/O port & memory option address sizes

ACPI Address Space Descriptors can be up to 64 bits wide.
We should keep track of the whole thing when parsing resource
options, so this patch changes PNP port and mem option
fields from "unsigned short" and "unsigned int" to
"resource_size_t".

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: introduce pnp_irq_mask_t typedef
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:05 +0000 (16:57 -0600)] 
PNP: introduce pnp_irq_mask_t typedef

This adds a typedef for the IRQ bitmap, which should cause
no functional change, but will make it easier to pass a
pointer to a bitmap to pnp_register_irq_resource().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: make resource option structures private to PNP subsystem
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:04 +0000 (16:57 -0600)] 
PNP: make resource option structures private to PNP subsystem

Nothing outside the PNP subsystem should need access to a
device's resource options, so this patch moves the option
structure declarations to a private header file.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: define PNP-specific IORESOURCE_IO_* flags alongside IRQ, DMA, MEM
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:03 +0000 (16:57 -0600)] 
PNP: define PNP-specific IORESOURCE_IO_* flags alongside IRQ, DMA, MEM

PNP previously defined PNP_PORT_FLAG_16BITADDR and PNP_PORT_FLAG_FIXED
in a private header file, but put those flags in struct resource.flags
fields.  Better to make them IORESOURCE_IO_* flags like the existing
IRQ, DMA, and MEM flags.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: whitespace/coding style fixes
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:02 +0000 (16:57 -0600)] 
PNP: whitespace/coding style fixes

No functional change; just make a couple declarations
consistent with the rest of the file.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add pnp_possible_config() -- can a device could be configured this way?
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:01 +0000 (16:57 -0600)] 
PNP: add pnp_possible_config() -- can a device could be configured this way?

As part of a heuristic to identify modem devices, 8250_pnp.c
checks to see whether a device can be configured at any of the
legacy COM port addresses.

This patch moves the code that traverses the PNP "possible resource
options" from 8250_pnp.c to the PNP subsystem.  This encapsulation
is important because a future patch will change the implementation
of those resource options.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: dont sort by type in /sys/.../resources
Bjorn Helgaas [Fri, 27 Jun 2008 22:57:00 +0000 (16:57 -0600)] 
PNP: dont sort by type in /sys/.../resources

Rather than stepping through all IO resources, then stepping through
all MMIO resources, etc., we can just iterate over the resource list
once directly.

This can change the order in /sys, e.g.,

    # cat /sys/devices/pnp0/00:07/resources     # OLD
    state = active
    io 0x3f8-0x3ff
    irq 4

    # cat /sys/devices/pnp0/00:07/resources     # NEW
    state = active
    irq 4
    io 0x3f8-0x3ff

The old code artificially sorted resources by type; the new code
just lists them in the order we read them from the ISAPNP hardware
or the BIOS.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoPNP: remove ratelimit on add resource failures
Bjorn Helgaas [Fri, 27 Jun 2008 22:56:59 +0000 (16:56 -0600)] 
PNP: remove ratelimit on add resource failures

We used to have a fixed-size resource table.  If a device had
twenty resources when the table only had space for ten, we didn't
need ten warnings, so we added the ratelimit.

Now that we can dynamically allocate new resources, we should
only get failures if the allocation fails.  That should be
rare enough that we don't need to ratelimit the messages.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoPNPACPI: keep disabled resources when parsing current config
Bjorn Helgaas [Fri, 27 Jun 2008 22:56:58 +0000 (16:56 -0600)] 
PNPACPI: keep disabled resources when parsing current config

When we parse a device's _CRS data (the current resource settings),
we should keep track of everything we find, even if it's currently
disabled or invalid.

This is what we already do for ISAPNP and PNPBIOS, and it helps
keep things matched up when we subsequently re-encode resources.
For example, consider a device with (mem, irq0, irq1, io), where
irq0 is disabled.  If we drop irq0 when parsing the _CRS, we will
mistakenly put irq1 in the irq0 slot when we encode resources
for an _SRS call.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoPNP: replace pnp_resource_table with dynamically allocated resources
Bjorn Helgaas [Fri, 27 Jun 2008 22:56:57 +0000 (16:56 -0600)] 
PNP: replace pnp_resource_table with dynamically allocated resources

PNP used to have a fixed-size pnp_resource_table for tracking the
resources used by a device.  This table often overflowed, so we've
had to increase the table size, which wastes memory because most
devices have very few resources.

This patch replaces the table with a linked list of resources where
the entries are allocated on demand.

This removes messages like these:

    pnpacpi: exceeded the max number of IO resources
    00:01: too many I/O port resources

References:

    http://bugzilla.kernel.org/show_bug.cgi?id=9535
    http://bugzilla.kernel.org/show_bug.cgi?id=9740
    http://lkml.org/lkml/2007/11/30/110

This patch also changes the way PNP uses the IORESOURCE_UNSET,
IORESOURCE_AUTO, and IORESOURCE_DISABLED flags.

Prior to this patch, the pnp_resource_table entries used the flags
like this:

    IORESOURCE_UNSET
This table entry is unused and available for use.  When this flag
is set, we shouldn't look at anything else in the resource structure.
This flag is set when a resource table entry is initialized.

    IORESOURCE_AUTO
This resource was assigned automatically by pnp_assign_{io,mem,etc}().

This flag is set when a resource table entry is initialized and
cleared whenever we discover a resource setting by reading an ISAPNP
config register, parsing a PNPBIOS resource data stream, parsing an
ACPI _CRS list, or interpreting a sysfs "set" command.

Resources marked IORESOURCE_AUTO are reinitialized and marked as
IORESOURCE_UNSET by pnp_clean_resource_table() in these cases:

    - before we attempt to assign resources automatically,
    - if we fail to assign resources automatically,
    - after disabling a device

    IORESOURCE_DISABLED
Set by pnp_assign_{io,mem,etc}() when automatic assignment fails.
Also set by PNPBIOS and PNPACPI for:

    - invalid IRQs or GSI registration failures
    - invalid DMA channels
    - I/O ports above 0x10000
    - mem ranges with negative length

After this patch, there is no pnp_resource_table, and the resource list
entries use the flags like this:

    IORESOURCE_UNSET
This flag is no longer used in PNP.  Instead of keeping
IORESOURCE_UNSET entries in the resource list, we remove
entries from the list and free them.

    IORESOURCE_AUTO
No change in meaning: it still means the resource was assigned
automatically by pnp_assign_{port,mem,etc}(), but these functions
now set the bit explicitly.

We still "clean" a device's resource list in the same places,
but rather than reinitializing IORESOURCE_AUTO entries, we
just remove them from the list.

Note that IORESOURCE_AUTO entries are always at the end of the
list, so removing them doesn't reorder other list entries.
This is because non-IORESOURCE_AUTO entries are added by the
ISAPNP, PNPBIOS, or PNPACPI "get resources" methods and by the
sysfs "set" command.  In each of these cases, we completely free
the resource list first.

    IORESOURCE_DISABLED
In addition to the cases where we used to set this flag, ISAPNP now
adds an IORESOURCE_DISABLED resource when it reads a configuration
register with a "disabled" value.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoPNP: make pnp_{port,mem,etc}_start(), et al work for invalid resources
Bjorn Helgaas [Fri, 27 Jun 2008 22:56:56 +0000 (16:56 -0600)] 
PNP: make pnp_{port,mem,etc}_start(), et al work for invalid resources

Some callers use pnp_port_start() and similar functions without
making sure the resource is valid.  This patch makes us fall
back to returning the initial values if the resource is not
valid or not even present.

This mostly preserves the previous behavior, where we would just
return the initial values set by pnp_init_resource_table().  The
original 2.6.25 code didn't range-check the "bar", so it would
return garbage if the bar exceeded the table size.  This code
returns sensible values instead.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoPNP: add pnp_resource_type_name() helper function
Bjorn Helgaas [Fri, 27 Jun 2008 22:56:55 +0000 (16:56 -0600)] 
PNP: add pnp_resource_type_name() helper function

This patch adds a "pnp_resource_type_name(struct resource *)" that
returns the string resource type.  This will be used by the sysfs
"show resources" function and the debug resource dump function.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoPNP: add pnp_resource_type() internal interface
Bjorn Helgaas [Fri, 27 Jun 2008 22:56:54 +0000 (16:56 -0600)] 
PNP: add pnp_resource_type() internal interface

Given a struct resource, this returns the type (IO, MEM, IRQ, DMA).

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoPNP: remove pnp_resource.index
Bjorn Helgaas [Fri, 27 Jun 2008 22:56:53 +0000 (16:56 -0600)] 
PNP: remove pnp_resource.index

We used pnp_resource.index to keep track of which ISAPNP configuration
register a resource should be written to.  We needed this only to
handle the case where a register is disabled but a subsequent register
in the same set is enabled.

Rather than explicitly maintaining the pnp_resource.index, this patch
adds a resource every time we read an ISAPNP configuration register
and marks the resource as IORESOURCE_DISABLED when appropriate.  This
makes the position in the pnp_resource_table always correspond to the
config register index.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoPNP: add detail to debug resource dump
Bjorn Helgaas [Fri, 27 Jun 2008 22:56:52 +0000 (16:56 -0600)] 
PNP: add detail to debug resource dump

In the debug resource dump, decode the flags and indicate when
a resource is disabled or has been automatically assigned.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPI: video: fix brightness allocation
Julia Jomantaite [Mon, 23 Jun 2008 21:50:42 +0000 (22:50 +0100)] 
ACPI: video: fix brightness allocation

Fix use of uninitialized device->brightness.

Signed-off-by: Julia Jomantaite <julia.jomantaite@gmail.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: Andi Kleen maintains the ACPI sub-system
Len Brown [Fri, 27 Jun 2008 15:31:50 +0000 (11:31 -0400)] 
ACPI: Andi Kleen maintains the ACPI sub-system

...while Len is on sabbatical from Intel

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPI: Zhang Rui maintains ACPI THERMAL and FAN
Len Brown [Fri, 27 Jun 2008 15:22:46 +0000 (11:22 -0400)] 
ACPI: Zhang Rui maintains ACPI THERMAL and FAN

Reflect that Zhang-Rui has been the sub-maintainer for
ACPI THERMAL and FAN for some time now.

Also, the Chinese custom is to speak family name first,
so rather than "Rui Zhang", write "Zhang Rui",
as he does on e-mail.

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPI: Disable MWAIT via DMI on broken Compal board
Zhao Yakui [Tue, 24 Jun 2008 10:02:57 +0000 (18:02 +0800)] 
ACPI: Disable MWAIT via DMI on broken Compal board

If a system matches in this DMI table,
Linux will disable MWAIT support for idle.
ie. "idle=nomwait" is automatically invoked
and C1_FFH and C2C3_FFH access mode are disabled.

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPI : Create "idle=nomwait" bootparam
Zhao Yakui [Tue, 24 Jun 2008 10:01:09 +0000 (18:01 +0800)] 
ACPI : Create "idle=nomwait" bootparam

"idle=nomwait" disables the use of the MWAIT
instruction from both C1 (C1_FFH) and deeper (C2C3_FFH)
C-states.

When MWAIT is unavailable, the BIOS and OS generally
negotiate to use the HALT instruction for C1,
and use IO accesses for deeper C-states.

This option is useful for power and performance
comparisons, and also to work around BIOS bugs
where broken MWAIT support is advertised.

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

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPI: Create "idle=halt" bootparam
Zhao Yakui [Tue, 24 Jun 2008 09:58:53 +0000 (17:58 +0800)] 
ACPI: Create "idle=halt" bootparam

"idle=halt" limits the idle loop to using
the halt instruction.  No MWAIT, no IO accesses,
no C-states deeper than C1.

If something is broken in the idle code,
"idle=halt" is a less severe workaround
than "idle=poll" which disables all power savings.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPI: Disable the C2C3_FFH access mode HW has no MWAIT support
Zhao Yakui [Tue, 17 Jun 2008 06:39:59 +0000 (14:39 +0800)] 
ACPI: Disable the C2C3_FFH access mode HW has no MWAIT support

991528d7348667924176f3e29addea0675298944
(ACPI: Processor native C-states using MWAIT)
started passing C2C3_FFH to _PDC to tell the BIOS
that Linux supports MWAIT for deep C-states.

However, we should first double check with the hardware
that it actually supports MWAIT before potentially exposing
a BIOS bug of an MWAIT _CST on HW that doesn't support MWAIT.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPI: Enhance /sys/firmware/interrupts to allow enable/disable/clear from user-space
Zhang Rui [Fri, 20 Jun 2008 01:42:47 +0000 (09:42 +0800)] 
ACPI: Enhance /sys/firmware/interrupts to allow enable/disable/clear from user-space

Allow users to enable/disable/clear a specific & valid GPE/Fixed Event
in user space.

This is useful for debugging, especially for some
interrupt storm issues.

All wakeup GPEs are disabled and they can not be enabled at runtime,
and we mark them as invalid.

All GPEs that don't have a _Lxx/_Exx method are marked as invalid.

All Fixed Events that don't have an event handler are marked as invalid
and they can't be enabled until an event handler is registered.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Ling Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Update version to 20080609
Bob Moore [Tue, 10 Jun 2008 06:37:53 +0000 (14:37 +0800)] 
ACPICA: Update version to 20080609

Update version to 20080609.

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Fix mutex debug code for wrong loop termination value
Bob Moore [Tue, 10 Jun 2008 06:30:04 +0000 (14:30 +0800)] 
ACPICA: Fix mutex debug code for wrong loop termination value

Loop was terminating one iteration early, missing one of the
debugger handshake mutexes. Linn Crosetto.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Cleanup of _PRT parsing code
Bob Moore [Tue, 10 Jun 2008 06:27:55 +0000 (14:27 +0800)] 
ACPICA: Cleanup of _PRT parsing code

Removed extraneous else clauses, other general cleanup.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Cleanup debug operand dump mechanism
Bob Moore [Tue, 10 Jun 2008 06:25:05 +0000 (14:25 +0800)] 
ACPICA: Cleanup debug operand dump mechanism

Eliminated unnecessary operands; eliminated use of negative index
in loop.  Operands now displayed in correct order, not backwards.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Fix for invalid large array index on 64-bit systems
Bob Moore [Tue, 10 Jun 2008 06:21:05 +0000 (14:21 +0800)] 
ACPICA: Fix for invalid large array index on 64-bit systems

This problem was introduced in 20080514 as a result of the
elimination of the acpi_native_uint type. Code uses a negative
array index, which should be eliminated.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Update disassembler for DMAR table changes
Bob Moore [Tue, 10 Jun 2008 06:19:32 +0000 (14:19 +0800)] 
ACPICA: Update disassembler for DMAR table changes

Now supports the 2007 intel Virtualization Technology for Directed
I/O specification.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Update DMAR and SRAT table definitions
Bob Moore [Tue, 10 Jun 2008 07:54:40 +0000 (15:54 +0800)] 
ACPICA: Update DMAR and SRAT table definitions

Synchronized tables with current specifications.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Workaround for reversed _PRT entries from BIOS
Bob Moore [Tue, 10 Jun 2008 06:16:47 +0000 (14:16 +0800)] 
ACPICA: Workaround for reversed _PRT entries from BIOS

Some BIOSs erroneously reverse the _PRT SourceName and the
SourceIndex.  Detect and repair this problem. MS ACPI also allows
and repairs this problem, thus ACPICA must also.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Update version to 20080514
Bob Moore [Tue, 10 Jun 2008 06:15:05 +0000 (14:15 +0800)] 
ACPICA: Update version to 20080514

Update version to 20080514

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Add const qualifier for appropriate string constants
Bob Moore [Tue, 10 Jun 2008 05:55:53 +0000 (13:55 +0800)] 
ACPICA: Add const qualifier for appropriate string constants

Mostly MODULE_NAME and printf format strings.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Several lint changes, no functional changes
Bob Moore [Tue, 10 Jun 2008 05:44:48 +0000 (13:44 +0800)] 
ACPICA: Several lint changes, no functional changes

Remove pointer cast warnings and fix for a debug printf.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Removed unused include files from source files
Bob Moore [Tue, 10 Jun 2008 05:43:34 +0000 (13:43 +0800)] 
ACPICA: Removed unused include files from source files

From lint.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Eliminate acpi_native_uint type v2
Bob Moore [Tue, 10 Jun 2008 05:42:13 +0000 (13:42 +0800)] 
ACPICA: Eliminate acpi_native_uint type v2

No longer needed; replaced mostly with u32, but also acpi_size
where a type that changes 32/64 bit on 32/64-bit platforms is
required.

v2: Fix a cast of a 32-bit int to a pointer in ACPI to avoid a compiler warning.
from David Howells

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Fix possible negative array index in acpi_ut_validate_exception
Bob Moore [Tue, 10 Jun 2008 04:53:01 +0000 (12:53 +0800)] 
ACPICA: Fix possible negative array index in acpi_ut_validate_exception

Added NULL fields to the exception string arrays to eliminate
the -1 subtraction on the SubStatus field.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Update tracking macros to reduce code/data size
Jan Beulich [Tue, 10 Jun 2008 04:49:56 +0000 (12:49 +0800)] 
ACPICA: Update tracking macros to reduce code/data size

Changed ACPI_MODULE_NAME and ACPI_FUNCTION_NAME to use arrays of
strings instead of pointers to static strings. Jan Beulich and
Bob Moore.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Fix for hang on GPE method invocation
Bob Moore [Tue, 10 Jun 2008 04:38:10 +0000 (12:38 +0800)] 
ACPICA: Fix for hang on GPE method invocation

Fixes problem where the new method argument count validation mechanism
will enter an infinite loop when a GPE method is dispatched.
Problem fixed be removing the obsolete code that passes GPE block
information to the notify handler via the control method parameter pointer.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agoACPICA: Add argument count checking to control method invocation via acpi_evaluate_object
Bob Moore [Tue, 10 Jun 2008 04:25:42 +0000 (12:25 +0800)] 
ACPICA: Add argument count checking to control method invocation via acpi_evaluate_object

Error if too few arguments, warning if too many. This applies
only to external programmatic control method execution, not
method-to-method calls within the AML.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
16 years agofujitsu-laptop: depends on INPUT
Randy Dunlap [Fri, 27 Jun 2008 02:27:21 +0000 (22:27 -0400)] 
fujitsu-laptop: depends on INPUT

fujitsu-laptop uses input_* functions, so it should depend on INPUT.

drivers/built-in.o: In function `acpi_fujitsu_add':
fujitsu-laptop.c:(.text+0xaaec7): undefined reference to `input_allocate_device'
fujitsu-laptop.c:(.text+0xaaf39): undefined reference to `input_register_device'
fujitsu-laptop.c:(.text+0xab025): undefined reference to `input_free_device'
drivers/built-in.o: In function `acpi_fujitsu_notify':
fujitsu-laptop.c:(.text+0xab0d8): undefined reference to `input_event'
fujitsu-laptop.c:(.text+0xab0e5): undefined reference to `input_event'
fujitsu-laptop.c:(.text+0xab0f5): undefined reference to `input_event'
fujitsu-laptop.c:(.text+0xab102): undefined reference to `input_event'
drivers/built-in.o: In function `acpi_fujitsu_hotkey_notify':
fujitsu-laptop.c:(.text+0xab261): undefined reference to `input_event'
drivers/built-in.o:fujitsu-laptop.c:(.text+0xab26e): more undefined references to `input_event' follow
drivers/built-in.o: In function `acpi_fujitsu_hotkey_add':
fujitsu-laptop.c:(.text+0xab49c): undefined reference to `input_allocate_device'
fujitsu-laptop.c:(.text+0xab51a): undefined reference to `input_register_device'
fujitsu-laptop.c:(.text+0xab5e4): undefined reference to `input_free_device'
make[1]: *** [.tmp_vmlinux1] Error 1

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agosnapshot: Use pm_mutex for mutual exclusion
Rafael J. Wysocki [Wed, 11 Jun 2008 20:09:45 +0000 (22:09 +0200)] 
snapshot: Use pm_mutex for mutual exclusion

We can avoid taking the BKL in snapshot_ioctl() if pm_mutex is used to prevent
the ioctls from being executed concurrently.

In addition, although it is only possible to open /dev/snapshot once, the task
which has done that may spawn a child that will inherit the open descriptor,
so in theory they can call snapshot_write(), snapshot_read() and
snapshot_release() concurrently.  pm_mutex can also be used for mutual
exclusion in such cases.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agosnapshot: Push BKL down into ioctl handlers
Alan Cox [Wed, 11 Jun 2008 20:07:52 +0000 (22:07 +0200)] 
snapshot: Push BKL down into ioctl handlers

Push BKL down into ioctl handlers - snapshot device.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>