platform/adaptation/renesas_rcar/renesas_kernel.git
17 years agoMerge branch 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus...
Linus Torvalds [Mon, 30 Apr 2007 15:10:12 +0000 (08:10 -0700)]
Merge branch 'for-2.6.22' of git://git./linux/kernel/git/paulus/powerpc

* 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (255 commits)
  [POWERPC] Remove dev_dbg redefinition in drivers/ps3/vuart.c
  [POWERPC] remove kernel module option for booke wdt
  [POWERPC] Avoid putting cpu node twice
  [POWERPC] Spinlock initializer cleanup
  [POWERPC] ppc4xx_sgdma needs dma-mapping.h
  [POWERPC] arch/powerpc/sysdev/timer.c build fix
  [POWERPC] get_property cleanups
  [POWERPC] Remove the unused HTDMSOUND driver
  [POWERPC] cell: cbe_cpufreq cleanup and crash fix
  [POWERPC] Declare enable_kernel_spe in a header
  [POWERPC] Add dt_xlate_addr() to bootwrapper
  [POWERPC] bootwrapper: CONFIG_ -> CONFIG_DEVICE_TREE
  [POWERPC] Don't define a custom bd_t for Xilixn Virtex based boards.
  [POWERPC] Add sane defaults for Xilinx EDK generated xparameters files
  [POWERPC] Add uartlite boot console driver for the zImage wrapper
  [POWERPC] Stop using ppc_sys for Xilinx Virtex boards
  [POWERPC] New registration for common Xilinx Virtex ppc405 platform devices
  [POWERPC] Merge common virtex header files
  [POWERPC] Rework Kconfig dependancies for Xilinx Virtex ppc405 platform
  [POWERPC] Clean up cpufreq Kconfig dependencies
  ...

17 years ago[POWERPC] Remove dev_dbg redefinition in drivers/ps3/vuart.c
Paul Mackerras [Mon, 30 Apr 2007 03:03:39 +0000 (13:03 +1000)]
[POWERPC] Remove dev_dbg redefinition in drivers/ps3/vuart.c

Commit 404d5b185b4eb56d6fa2f7bd27833f8df1c38ce4 changed the definition
of dev_dbg in the !DEBUG case from being a #define to being a static
inline.  There was code in drivers/ps3/vuart.c to do exactly that,
which fails to compile now.  This fixes it by removing the redefinition,
as the redefinition is now superfluous.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agoMerge branch 'linux-2.6' into for-2.6.22
Paul Mackerras [Mon, 30 Apr 2007 02:38:01 +0000 (12:38 +1000)]
Merge branch 'linux-2.6' into for-2.6.22

17 years ago[POWERPC] remove kernel module option for booke wdt
Dave Jiang [Fri, 13 Apr 2007 22:25:24 +0000 (08:25 +1000)]
[POWERPC] remove kernel module option for booke wdt

Remove option of making booke_wdt into a kernel module. This watchdog
cannot be disabled. No point being a kernel module.

Signed-off-by: Dave Jiang <djiang@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Avoid putting cpu node twice
John Rigby [Fri, 6 Apr 2007 22:57:37 +0000 (08:57 +1000)]
[POWERPC] Avoid putting cpu node twice

Call of_find_node_by_type with NULL instead of np
so the cpu node does not get put twice.
This was causing kref_put warnings.

Signed-off-by: John Rigby <jrigby@freescale.com>
Acked-by: Sylvain Munaut <tnt@246tNt.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Spinlock initializer cleanup
Thomas Gleixner [Sun, 29 Apr 2007 16:10:39 +0000 (16:10 +0000)]
[POWERPC] Spinlock initializer cleanup

Use DEFINE_SPINLOCK instead of initializing spinlocks to
SPIN_LOCK_UNLOCKED, since DEFINE_SPINLOCK is better for lockdep.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] ppc4xx_sgdma needs dma-mapping.h
Andrew Morton [Thu, 26 Apr 2007 07:07:05 +0000 (00:07 -0700)]
[POWERPC] ppc4xx_sgdma needs dma-mapping.h

For dma_alloc_*()

Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] arch/powerpc/sysdev/timer.c build fix
Srinivasa Ds [Thu, 26 Apr 2007 07:07:04 +0000 (00:07 -0700)]
[POWERPC] arch/powerpc/sysdev/timer.c build fix

arch/powerpc/sysdev/timer.c:51: error: variable `timer_sysclass' has
initializer but incomplete type
arch/powerpc/sysdev/timer.c:52: error: unknown field `resume' specified in initializer
<etc>

Signed-off-by: Srinivasa Ds <srinivasa@in.ibm.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] get_property cleanups
Stephen Rothwell [Sun, 29 Apr 2007 06:29:08 +0000 (16:29 +1000)]
[POWERPC] get_property cleanups

Just another pass through arch/powerpc for old usages.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Remove the unused HTDMSOUND driver
Adrian Bunk [Sat, 28 Apr 2007 19:19:56 +0000 (05:19 +1000)]
[POWERPC] Remove the unused HTDMSOUND driver

Recently, someone fixed a syntax error in the HTDMSOUND driver
introduced 4 years ago.

Unfortunately not by trying to compile this driver for his hardware but
by code inspection - which seems to be a strong indication that there
are no users left for this OSS sound driver.

This patch therefore removes it.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Dan Malek <dan@embeddedalley.com>
Acked-by: Marcelo Tosatti <marcelo@kvack.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] cell: cbe_cpufreq cleanup and crash fix
Olof Johansson [Sat, 28 Apr 2007 02:49:03 +0000 (12:49 +1000)]
[POWERPC] cell: cbe_cpufreq cleanup and crash fix

cbe_cpufreq cleanups:

* comment format
* whitespace
* don't init on non-cell platforms

Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Christian Krafft <krafft@de.ibm.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Declare enable_kernel_spe in a header
Johannes Berg [Fri, 27 Apr 2007 22:00:03 +0000 (08:00 +1000)]
[POWERPC] Declare enable_kernel_spe in a header

This patch puts enable_kernel_spe into <asm-powerpc/system.h> along with
enable_kernel_altivec etc.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Add dt_xlate_addr() to bootwrapper
Mark A. Greer [Fri, 27 Apr 2007 20:48:24 +0000 (06:48 +1000)]
[POWERPC] Add dt_xlate_addr() to bootwrapper

dt_xlate_reg() looks up the 'reg' property in the specified node
to get the address and size to translate.  Add dt_xlate_addr()
which is passed in the address and size to translate.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] bootwrapper: CONFIG_ -> CONFIG_DEVICE_TREE
Scott Wood [Fri, 27 Apr 2007 20:32:15 +0000 (06:32 +1000)]
[POWERPC] bootwrapper: CONFIG_ -> CONFIG_DEVICE_TREE

A usage of CONFIG_DEVICE_TREE got accidentally truncated; this
fix allows out-of-tree dts files to work.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Don't define a custom bd_t for Xilixn Virtex based boards.
Grant Likely [Fri, 27 Apr 2007 19:50:05 +0000 (05:50 +1000)]
[POWERPC] Don't define a custom bd_t for Xilixn Virtex based boards.

Why create a platform specific board_info structure that is hacked
together, ugly, and dangerous, when we've got a perfectly fine common
board_info structure that is hacked-together, ugly and dangerous.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Add sane defaults for Xilinx EDK generated xparameters files
Grant Likely [Fri, 27 Apr 2007 19:50:04 +0000 (05:50 +1000)]
[POWERPC] Add sane defaults for Xilinx EDK generated xparameters files

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Add uartlite boot console driver for the zImage wrapper
Grant Likely [Fri, 27 Apr 2007 19:50:03 +0000 (05:50 +1000)]
[POWERPC] Add uartlite boot console driver for the zImage wrapper

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Stop using ppc_sys for Xilinx Virtex boards
Grant Likely [Fri, 27 Apr 2007 19:50:02 +0000 (05:50 +1000)]
[POWERPC] Stop using ppc_sys for Xilinx Virtex boards

The arch/ppc/syslib/ppc_sys.c infrastructure does not work well for the
virtex ports.  Move the ml300 and ml403 board ports over to use the new
virtex_devices infrastructure.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] New registration for common Xilinx Virtex ppc405 platform devices
Grant Likely [Fri, 27 Apr 2007 19:50:01 +0000 (05:50 +1000)]
[POWERPC] New registration for common Xilinx Virtex ppc405 platform devices

Currently virtex support in mainline make use of the infrastructure in
arch/ppc/syslib/ppc_sys.c for registering common devices on virtex ppc405
platforms.  The ppc_sys.c code is not well suited to the dynamic nature of
FPGA designs and makes adding new board ports more complex.  This patch
adds a new listing of common devices which does not depend on the ppc_sys.c
infrastructure.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Merge common virtex header files
Grant Likely [Fri, 27 Apr 2007 19:50:00 +0000 (05:50 +1000)]
[POWERPC] Merge common virtex header files

The header files for the ml403 and ml300 are virtually identical, merge
them into a single file.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Rework Kconfig dependancies for Xilinx Virtex ppc405 platform
Grant Likely [Fri, 27 Apr 2007 19:49:59 +0000 (05:49 +1000)]
[POWERPC] Rework Kconfig dependancies for Xilinx Virtex ppc405 platform

Reverse dependency order for Xilinx Virtex parts.  For these parts, It
makes more sense for boards/chips to specify which features they
provide instead of the features listing the parts they are implemented
in.  I think it also makes adding new board ports simpler.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years ago[POWERPC] Clean up cpufreq Kconfig dependencies
Olof Johansson [Fri, 27 Apr 2007 05:52:43 +0000 (15:52 +1000)]
[POWERPC] Clean up cpufreq Kconfig dependencies

Shuffle Kconfig order, making the platform drivers menu depend on the global
option instead of each driver being dependent on it.

Also fix dependency of PPC_PMAC on the G5 one.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agoRevert "[POWERPC] Autodetect serial console on efika"
Paul Mackerras [Mon, 30 Apr 2007 00:24:24 +0000 (10:24 +1000)]
Revert "[POWERPC] Autodetect serial console on efika"

This reverts commit 9414715a7bbb45450015e9bc2676d85d919d08d4,
at Olaf Hering's request:

> Paul, please discard this patch. The optional graphics card may have
> also device_type 'serial' if it is in VGA mode.
> I will send an updated patch later.

17 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Sun, 29 Apr 2007 17:48:48 +0000 (10:48 -0700)]
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (107 commits)
  smc911x: fix compilation breakage wjen debug is on
  [netdrvr] eexpress: minor corrections
  add NAPI support to sb1250-mac.c
  ixgb: ROUND_UP macro cleanup in drivers/net/ixgb
  e1000: ROUND_UP macro cleanup in drivers/net/e1000
  Generic HDLC sparse annotations
  e100: Optionally use I/O mode only to access register space
  e100: allow bad MAC address when running with invalid eeprom csum
  ehea: fix for dlpar support
  ehea: fix for sysfs entries
  3C509: Remove unnecessary include of <linux/pm_legacy.h>
  NetXen: Fix for vmalloc issues
  NetXen: Fixes for Power PC architecture
  NetXen: Port swap feature for multi port cards
  NetXen: Removal of redundant macros
  NetXen: Multi PCI support for Quad cards
  NetXen: Removal of redundant argument passing
  NetXen: Use multiple PCI functions
  [netdrvr e100] experiment with doing RX in a similar manner to eepro100
  [PATCH] ieee80211: add missing global needed by IEEE80211_DEBUG_XXXX
  ...

17 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Sun, 29 Apr 2007 17:48:21 +0000 (10:48 -0700)]
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: (86 commits)
  SPIN_LOCK_UNLOCKED cleanup in drivers/ata/pata_winbond.c
  drivers/ata/pata_cmd640.c: fix build with CONFIG_PM=n
  pata_hpt37x: Further small fixes
  pata_hpt3x2n: Add HPT371N support and other bits
  ata: printk warning fixes
  libata: separate ATA_EHI_DID_RESET into DID_SOFTRESET and DID_HARDRESET
  ahci: consolidate common port flags
  ata_timing: ensure t->cycle is always correct
  libata: add missing call to ->cable_detect() in new EH path
  pata_amd: remove contamination added during cable_detect conversion
  libata: Handle drives that require a spin-up command before first access
  libata: HPA support
  libata: kill probe_ent and related helpers
  libata: convert the remaining PATA drivers to new init model
  libata: convert the remaining SATA drivers to new init model
  libata: convert ata_pci_init_native_mode() users to new init model
  libata: convert drivers with combined SATA/PATA ports to new init model
  libata: add init helpers including ata_pci_prepare_native_host()
  libata: convert native PCI host handling to new init model
  libata: convert legacy PCI host handling to new init model
  ...

17 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Sun, 29 Apr 2007 17:47:25 +0000 (10:47 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (105 commits)
  sonypi: use mutex instead of semaphore
  sony-laptop: remove user visible camera controls as platform attributes
  meye: make meye use sony-laptop instead of sonypi
  sony-laptop: add a meye-usable include file for camera ops
  sony-laptop: complete the motion eye camera support in sony-laptop
  sonypi: try to detect if sony-laptop has already taken one of the known ioports
  sonypi: suggest sonypi users to try sony-laptop instead
  sony-laptop: add edge modem support (also called WWAN)
  sony-laptop: add locking on accesses to the ioport and global vars
  sony-laptop: add camera enable/disable parameter, better handle possible infinite loop
  thinkpad-acpi: make drivers/misc/thinkpad_acpi:fan_mutex static
  ACPI: thinkpad-acpi: add sysfs support to wan and bluetooth subdrivers
  ACPI: thinkpad-acpi: add sysfs support to hotkey subdriver
  ACPI: thinkpad-acpi: improve dock subdriver initialization
  ACPI: thinkpad-acpi: improve debugging for acpi helpers
  ACPI: thinkpad-acpi: improve fan control documentation
  ACPI: thinkpad-acpi: map ENXIO to EINVAL for fan sysfs
  ACPI: thinkpad-acpi: fix a fan watchdog invocation
  ACPI: thinkpad-acpi: do not arm fan watchdog if it would not work
  ACPI: thinkpad-acpi: add a fan-control feature master toggle
  ...

17 years agoPull bugzilla-8346 into release branch
Len Brown [Sun, 29 Apr 2007 03:19:25 +0000 (23:19 -0400)]
Pull bugzilla-8346 into release branch

17 years agoPull sbs into release branch
Len Brown [Sun, 29 Apr 2007 03:16:59 +0000 (23:16 -0400)]
Pull sbs into release branch

17 years agoPull dock into release branch
Len Brown [Sun, 29 Apr 2007 03:13:03 +0000 (23:13 -0400)]
Pull dock into release branch

17 years agoPull ec into release branch
Len Brown [Sun, 29 Apr 2007 03:12:56 +0000 (23:12 -0400)]
Pull ec into release branch

17 years agoPull misc-for-upstream into release branch
Len Brown [Sun, 29 Apr 2007 03:12:03 +0000 (23:12 -0400)]
Pull misc-for-upstream into release branch

17 years agoPull thinkpad into release branch
Len Brown [Sun, 29 Apr 2007 03:11:19 +0000 (23:11 -0400)]
Pull thinkpad into release branch

Conflicts:

drivers/misc/Kconfig

Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoPull sony into release branch
Len Brown [Sun, 29 Apr 2007 03:09:57 +0000 (23:09 -0400)]
Pull sony into release branch

17 years agoPull asus into release branch
Len Brown [Sun, 29 Apr 2007 02:18:21 +0000 (22:18 -0400)]
Pull asus into release branch

17 years agosonypi: use mutex instead of semaphore
Matthias Kaehlcke [Tue, 24 Apr 2007 20:02:35 +0000 (22:02 +0200)]
sonypi: use mutex instead of semaphore

the Sony Programmable I/O Control driver uses a semaphore as
mutex. use the mutex API instead of the (binary) semaphore

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Acked-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agosony-laptop: remove user visible camera controls as platform attributes
malattia@linux.it [Sat, 28 Apr 2007 14:36:40 +0000 (23:36 +0900)]
sony-laptop: remove user visible camera controls as platform attributes

Avoid giving the user the possibility to shoot his own foot and let
the meye driver enable/disable the camera wisely (PCI_ID based).

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agomeye: make meye use sony-laptop instead of sonypi
malattia@linux.it [Sat, 28 Apr 2007 14:36:26 +0000 (23:36 +0900)]
meye: make meye use sony-laptop instead of sonypi

Change sonypi_camera_command() calls to sony_pic_camera_command() and use
the renamed macros.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agosony-laptop: add a meye-usable include file for camera ops
malattia@linux.it [Sat, 28 Apr 2007 14:34:36 +0000 (23:34 +0900)]
sony-laptop: add a meye-usable include file for camera ops

Copy and rename (for easier co-existence) the MEYE-wise exported interface.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agosony-laptop: complete the motion eye camera support in sony-laptop
malattia@linux.it [Sat, 28 Apr 2007 14:34:22 +0000 (23:34 +0900)]
sony-laptop: complete the motion eye camera support in sony-laptop

Add the exported sony_pic_camera_command() function to make the MEYE
driver happy.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agosonypi: try to detect if sony-laptop has already taken one of the known ioports
malattia@linux.it [Sat, 28 Apr 2007 14:34:10 +0000 (23:34 +0900)]
sonypi: try to detect if sony-laptop has already taken one of the known ioports

Get the IO resources list in sony-laptop in the same order as listed
in sonypi and make sonypi check if one of those is already busy.
The sonypi check can be disabled by a module parameter in case the user
thinks we are plainly wrong (check_ioport=0).

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agosonypi: suggest sonypi users to try sony-laptop instead
malattia@linux.it [Sat, 28 Apr 2007 14:22:11 +0000 (23:22 +0900)]
sonypi: suggest sonypi users to try sony-laptop instead

Try to migrate sonypi users to sony-laptop gracefully.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agosony-laptop: add edge modem support (also called WWAN)
malattia@linux.it [Sat, 28 Apr 2007 14:21:42 +0000 (23:21 +0900)]
sony-laptop: add edge modem support (also called WWAN)

Some SZ Vaios have a gsm built-in modem. Allow powering on/off this device.
Thanks to Joshua Wise for the base code.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agosony-laptop: add locking on accesses to the ioport and global vars
malattia@linux.it [Sat, 28 Apr 2007 14:19:36 +0000 (23:19 +0900)]
sony-laptop: add locking on accesses to the ioport and global vars

Better avoid having ioport commands mixing and global variables reading/writing.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agosony-laptop: add camera enable/disable parameter, better handle possible infinite...
malattia@linux.it [Sat, 28 Apr 2007 14:18:45 +0000 (23:18 +0900)]
sony-laptop: add camera enable/disable parameter, better handle possible infinite loop

Use a parameter to enable/disable motion eye camera (for C1VE/C1VN models)
controls and avoid entering an infinite loop if the camera is not present
and the HW doesn't answer as we expect on io commands.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agothinkpad-acpi: make drivers/misc/thinkpad_acpi:fan_mutex static
Adrian Bunk [Sat, 28 Apr 2007 19:19:38 +0000 (21:19 +0200)]
thinkpad-acpi: make drivers/misc/thinkpad_acpi:fan_mutex static

This patch makes the needlessly global fan_mutex static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoACPI: thinkpad-acpi: add sysfs support to wan and bluetooth subdrivers
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:17 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: add sysfs support to wan and bluetooth subdrivers

Add support to sysfs to the wan and bluetooth subdrivers.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoACPI: thinkpad-acpi: add sysfs support to hotkey subdriver
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:16 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: add sysfs support to hotkey subdriver

Add the hotkey sysfs support.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoACPI: thinkpad-acpi: improve dock subdriver initialization
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:15 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: improve dock subdriver initialization

The dock sub-driver has split-personality (two subdrivers), and it was
doing some unoptimal things on init because of that.  Fix it so that the
second half of it will only init when necessary, and only if the first half
initialized sucessfully in the first place.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoACPI: thinkpad-acpi: improve debugging for acpi helpers
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:14 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: improve debugging for acpi helpers

Some issues with the dock subdriver proved that a slightly improved
debugging setup for ACPI notifiers and handler helpers would be useful.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoACPI: thinkpad-acpi: improve fan control documentation
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:13 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: improve fan control documentation

Improve fan control documentation and fix one mistake.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoACPI: thinkpad-acpi: map ENXIO to EINVAL for fan sysfs
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:12 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: map ENXIO to EINVAL for fan sysfs

Currently, all fan control operations return ENXIO if unsupported
operations are requested, but return EINVAL if invalid fan modes are
requested on a given ThinkPad.

This is not strictly correct for sysfs, so map ENXIO to EINVAL in the sysfs
attribute store handlers, as we do benefit from the ENXIO in other parts of
the driver code.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoACPI: thinkpad-acpi: fix a fan watchdog invocation
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:11 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: fix a fan watchdog invocation

The fan control watchdog was being called in one place even when the fan
control operation had failed.  Fix it.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoACPI: thinkpad-acpi: do not arm fan watchdog if it would not work
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:10 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: do not arm fan watchdog if it would not work

Do not enable/rearm the fan control safety watchdog if we would not be able
to do anything to the fan anyway.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoACPI: thinkpad-acpi: add a fan-control feature master toggle
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:09 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: add a fan-control feature master toggle

Len Brown considers that an active by default fan control interface in
laptops may be too close to giving users enough rope.  There is a good
chance he is quite correct on this, especially if someone decides to use
that interface in applets and users are not aware of its risks.

This patch adds a master switch to thinkpad-acpi that enables or disables
the entire fan-control feature as a module parameter: "fan_control".  It
defaults to disabled.  Set it to non-zero to enable fan control.

Also, the patch removes the expermiental status from fan control, since it
is stable enough to not be called experimental, and the master switch makes
it safe enough to do so.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoACPICA: clear fields reserved before FADT r3
Bob Moore [Sun, 29 Apr 2007 00:53:50 +0000 (20:53 -0400)]
ACPICA: clear fields reserved before FADT r3

Linux-2.6.21 stopped booting on a P4/HT because Linux
wrote the FADT.CST_CNT value to the SMI_CMD.
Apparently this stumbled over some SMM instability,
such as confusing SMM when invoking it from cpu1.

Linux did this because even though the r2 FADT reserves
the CST_CNT field, this BIOS set that field and Linux
used it.

Turns out that up through 2.6.20 we explicitly cleared
cst_control for r2 FADTs.  So here we go back to doing that,
plus also clear some additional fields that are reserved
until FADT r3.

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

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoSPIN_LOCK_UNLOCKED cleanup in drivers/ata/pata_winbond.c
Milind Arun Choudhary [Thu, 26 Apr 2007 07:19:27 +0000 (00:19 -0700)]
SPIN_LOCK_UNLOCKED cleanup in drivers/ata/pata_winbond.c

remove SPIN_LOCK_UNLOCKED, use DEFINE_SPINLOCK instead

Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agodrivers/ata/pata_cmd640.c: fix build with CONFIG_PM=n
Andrew Morton [Thu, 26 Apr 2007 07:19:26 +0000 (00:19 -0700)]
drivers/ata/pata_cmd640.c: fix build with CONFIG_PM=n

This is grubby, but all the ata drivers do it this way.

Would it not be better to do

#define ata_scsi_device_resume NULL

in libata.h, remove all those ifdefs?

(updated version, ug, ug)

Cc: Jeff Garzik <jeff@garzik.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopata_hpt37x: Further small fixes
Alan Cox [Thu, 26 Apr 2007 07:19:25 +0000 (00:19 -0700)]
pata_hpt37x: Further small fixes

Further HPT37x changes

- No 66MHz 370/370A
- Remove dead special case check now we use the DPLL (as per the IDE driver)

Pointed out by Sergei

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopata_hpt3x2n: Add HPT371N support and other bits
Alan Cox [Thu, 26 Apr 2007 07:19:25 +0000 (00:19 -0700)]
pata_hpt3x2n: Add HPT371N support and other bits

Yes its no longer 3x2n but 3xxn, I can rename it if you want Jeff

- Don't reset both ports each time (Sergei)
- If we can't get a DPLL then abort entirely
- Use ioport access for clock (from drivers/ide)
- Add HPT371N support (from drivers/ide)

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoata: printk warning fixes
Andrew Morton [Thu, 26 Apr 2007 07:19:21 +0000 (00:19 -0700)]
ata: printk warning fixes

drivers/ata/libata-core.c: In function 'ata_hpa_resize':
drivers/ata/libata-core.c:986: warning: format '%lld' expects type 'long long int', but argument 5 has type 'u64'
drivers/ata/libata-core.c:986: warning: format '%lld' expects type 'long long int', but argument 6 has type 'u64'
drivers/ata/libata-core.c:990: warning: format '%lld' expects type 'long long int', but argument 4 has type 'u64'
drivers/ata/libata-core.c:990: warning: format '%lld' expects type 'long long int', but argument 5 has type 'u64'
drivers/ata/libata-core.c:1003: warning: format '%lld' expects type 'long long int', but argument 4 has type 'u64'

Also fix various 80-col bustage.

Cc: Jeff Garzik <jeff@garzik.org>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: separate ATA_EHI_DID_RESET into DID_SOFTRESET and DID_HARDRESET
Tejun Heo [Sun, 22 Apr 2007 17:41:05 +0000 (02:41 +0900)]
libata: separate ATA_EHI_DID_RESET into DID_SOFTRESET and DID_HARDRESET

Separate ATA_EHI_DID_RESET into ATA_EHI_DID_SOFTRESET and
ATA_EHI_DID_HARDRESET.  ATA_EHI_DID_RESET is redefined as OR of the
two flags.  This patch doesn't introduce any behavior change.  This
will be used later to determine whether _SDD is necessary or not.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoahci: consolidate common port flags
Tejun Heo [Sun, 22 Apr 2007 17:41:05 +0000 (02:41 +0900)]
ahci: consolidate common port flags

Consolidate common port flags into AHCI_FLAG_COMMON.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoata_timing: ensure t->cycle is always correct
Alan Cox [Mon, 23 Apr 2007 10:55:36 +0000 (11:55 +0100)]
ata_timing: ensure t->cycle is always correct

Russell King hit a case where quantisation errors accumulated such that
the cycle time was shorter than rather than equal to the active/recovery
time. The code already knows how to stretch times to fit the cycle time
but does not know about the reverse.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: add missing call to ->cable_detect() in new EH path
Tejun Heo [Sun, 22 Apr 2007 17:05:53 +0000 (02:05 +0900)]
libata: add missing call to ->cable_detect() in new EH path

->cable_detect() used to be called on by the old ata_bus_probe() path.
Add invocation to ata_eh_revalidate_and_attach() right after IDENTIFYs
are done.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopata_amd: remove contamination added during cable_detect conversion
Tejun Heo [Sun, 22 Apr 2007 17:04:38 +0000 (02:04 +0900)]
pata_amd: remove contamination added during cable_detect conversion

This is added by added by cff63dfceb52c564fe1ba5394d50ab7d599a11b9
 - pata: cable methods.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: Handle drives that require a spin-up command before first access
Mark Lord [Tue, 17 Apr 2007 22:26:07 +0000 (18:26 -0400)]
libata: Handle drives that require a spin-up command before first access

(S)ATA drives can be configured for "power-up in standby",
a mode whereby a specific "spin up now!" command is required
before the first media access.

Currently, a drive with this feature enabled can not be used at all
with libata, and once in this mode, the drive becomes a doorstop.

The older drivers/ide subsystem at least enumerates the drive,
so that it can be woken up after the fact from a userspace HDIO_*
command, but not libata.

This patch adds support to libata for the "power-up in standby"
mode where a "spin up now!" command (SET_FEATURES) is needed.
With this, libata will recognize such drives, spin them up,
and then re-IDENTIFY them if necessary to get a full/complete
set of drive features data.

Drives in this state are determined by looking for
special values in id[2], as documented in the current ATA specs.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: HPA support
Alan Cox [Tue, 10 Apr 2007 23:23:13 +0000 (00:23 +0100)]
libata: HPA support

Signed-off-by: Alan Cox <alan@redhat.com>
Add support for ignoring the BIOS HPA result (off by default) and setting
the disk to the full available size unless already frozen.

Tested with various platforms/disks and confirmed to work with the
Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
readback that Tejun fixed).

For normal users this brings us, I believe, to feature parity with old IDE
(and of course more featured in some areas too).
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: kill probe_ent and related helpers
Tejun Heo [Tue, 17 Apr 2007 14:44:08 +0000 (23:44 +0900)]
libata: kill probe_ent and related helpers

All drivers are converted to new init model.  Kill probe_ent,
ata_device_add() and ata_pci_init_native_mode().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: convert the remaining PATA drivers to new init model
Tejun Heo [Tue, 17 Apr 2007 14:44:08 +0000 (23:44 +0900)]
libata: convert the remaining PATA drivers to new init model

Convert pdc_adma, pata_cs5520, pata_isapnp, pata_ixp4xx_cf,
pata_legacy, pata_mpc52xx, pata_mpiix, pata_pcmcia, pata_pdc2027x,
pata_platform, pata_qdi, pata_scc and pata_winbond to new init model.

* init_one()'s now follow more consistent init order

* cs5520 now registers one host with two ports, not two hosts.  If any
  of the two ports are disabled, it's made dummy as other drivers do.

Tested pdc_adma and pata_legacy.  Both are as broken as before.  The
rest are compile tested only.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: convert the remaining SATA drivers to new init model
Tejun Heo [Tue, 17 Apr 2007 14:44:08 +0000 (23:44 +0900)]
libata: convert the remaining SATA drivers to new init model

Convert ahci, sata_sil, sata_sil24, sata_svw, sata_qstor, sata_mv,
sata_sx4, sata_vsc and sata_inic162x to new init model.

Now that host and ap are available during intialization, functions are
converted to take either host or ap instead of low level parameters
which were inevitable for functions shared between init and other
paths.  This simplifies code quite a bit.

* init_one()'s now follow more consistent init order

* ahci_setup_port() and ahci_host_init() collapsed into
  ahci_init_one() for init order consistency

* sata_vsc uses port_info instead of setting fields manually

* in sata_svw, k2_board_info converted to port_info (info is now in
  port flags).  port number is honored now.

Tested on ICH7/8 AHCI, jmb360, sil3112, 3114, 3124 and 3132.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: convert ata_pci_init_native_mode() users to new init model
Tejun Heo [Tue, 17 Apr 2007 14:44:08 +0000 (23:44 +0900)]
libata: convert ata_pci_init_native_mode() users to new init model

Convert drivers which use ata_pci_init_native_mode() to new init
model.  ata_pci_init_native_host() is used instead.  sata_nv, sata_uli
and sata_sis are in this category.

Tested on nVidia Corporation CK804 Serial ATA Controller [10de:0054]
in both BMDMA and ADMA mode.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: convert drivers with combined SATA/PATA ports to new init model
Tejun Heo [Tue, 17 Apr 2007 14:44:07 +0000 (23:44 +0900)]
libata: convert drivers with combined SATA/PATA ports to new init model

Convert sata_via and sata_promise to new init model.  Both controllers
can have combined configuration (SATA + PATA) and used twisted
initialization method (modifying port in ->port_start) to overcome
probe_ent limitations.

This patch converts both drivers to new init model in which such
configuration is natively supported.

* promise: Combined pata port now uses separate port_info entry right
  after the sata counterpart entry.

* promise: Controller configuration is discerned using ap->flags.
  This simplifies init path and makes it look more like other LLDs.

* via: Both SATA and PATA ports in vt6421 are represented in their
  own port_info structure.

Tested on PDC20375 (SATA150 TX2plus) [105a:3375] and PDC40775 (SATA
300 TX2plus) [105a:3d73].  Couldn't test via cuz my c3 won't boot the
current kernel.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: add init helpers including ata_pci_prepare_native_host()
Tejun Heo [Tue, 17 Apr 2007 14:44:07 +0000 (23:44 +0900)]
libata: add init helpers including ata_pci_prepare_native_host()

These will be used to convert LLDs to new init model.

* Add irq_handler field to port_info.  In new init model, requesting
  IRQ is LLD's responsibility and libata doesn't need to know about
  irq_handler.  Most LLDs can simply register their irq_handler but
  some need different irq_handler depending on specific chip.  The
  added port_info->irq_handler field can be used by LLDs to select
  the matching IRQ handler in such cases.

* Add ata_dummy_port_info.

* Implement ata_pci_prepare_native_host(), a helper to alloc ATA host,
  acquire all resources and init the host in one go.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: convert native PCI host handling to new init model
Tejun Heo [Tue, 17 Apr 2007 14:44:07 +0000 (23:44 +0900)]
libata: convert native PCI host handling to new init model

Convert native PCI host handling to alloc-init-register model.  New
function ata_pci_init_native_host() follows the new init model and
replaces ata_pci_init_native_mode().  As there are remaining LLD
users, the old function isn't removed yet.

ata_pci_init_one() is reimplemented using the new function and now
fully converted to new init model.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: convert legacy PCI host handling to new init model
Tejun Heo [Tue, 17 Apr 2007 14:44:07 +0000 (23:44 +0900)]
libata: convert legacy PCI host handling to new init model

Convert legacy PCI host handling to alloc-init-register model.
ata_init_legacy_host(), ata_request_legacy_irqs() and
ata_pci_init_bmdma() are separated out and follow the new init model.

The two legacy handling functions use separate ata_legacy_devres
instead of generic devm_* resources.  This reduces devres overhead for
legacy hosts which was a bit high because it didn't use PCI/iomap
merged resoruces.

ata_pci_init_one() is rewritten in terms of the aboved functions but
native mode handling is still using the old method.  Conversion will
be completed when native mode handling is updated.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: implement ata_host_alloc_pinfo() and ata_host_register()
Tejun Heo [Tue, 17 Apr 2007 14:44:07 +0000 (23:44 +0900)]
libata: implement ata_host_alloc_pinfo() and ata_host_register()

Implement ata_host_alloc_pinfo() and ata_host_register().  These helpers
will be used in the following patches to adopt new init model.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: separate out ata_host_alloc() and ata_host_register()
Tejun Heo [Tue, 17 Apr 2007 14:44:07 +0000 (23:44 +0900)]
libata: separate out ata_host_alloc() and ata_host_register()

Reorganize ata_host_alloc() and its subroutines into the following
three functions.

* ata_host_alloc() : allocates host and its ports.  shost is not
  registered automatically.

* ata_scsi_add_hosts() : allocates and adds shosts associated with an
  ATA host.  Used by ata_host_register().

* ata_host_register() : takes a fully initialized ata_host structure
  and registers it to libata layer and probes it.

Only ata_host_alloc() and ata_host_register() are exported.
ata_device_add() is rewritten using the above functions.  This patch
does not introduce any observable behavior change.  Things worth
mentioning.

* print_id is assigned at registration time and LLDs are allowed to
  overallocate ports and reduce host->n_ports during initialization.
  ata_host_register() will throw away unused ports automatically.

* All SCSI host initialization stuff now resides in
  ata_scsi_add_hosts() in libata-scsi.c, where it should be.

* ipr is now the only user of ata_host_init().  Either kill it by
  converting ipr to use ata_host_alloc() and friends or rename and
  move it to libata-scsi.c

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: separate out ata_host_start()
Tejun Heo [Tue, 17 Apr 2007 14:44:06 +0000 (23:44 +0900)]
libata: separate out ata_host_start()

Separate out ata_host_start() from ata_device_add().  ata_host_start()
calls ->port_start on each port if available and freezes the port.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: allocate ap separately from shost
Tejun Heo [Tue, 17 Apr 2007 14:44:06 +0000 (23:44 +0900)]
libata: allocate ap separately from shost

Don't embed ap inside shost.  Allocate it separately and point it back
from shosts's hostdata.  This makes port allocation more flexible and
allows regular ATA and SAS share host alloc/init paths.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoahci: add PCI ID for new VIA chip
Tejun Heo [Wed, 11 Apr 2007 08:27:14 +0000 (17:27 +0900)]
ahci: add PCI ID for new VIA chip

Add PCI ID for new VIA chip.  Original patch is from Maarten Vanraes.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Maarten Vanraes <maarten.vanraes@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: kill type mismatch compile warning
Tejun Heo [Thu, 12 Apr 2007 04:38:11 +0000 (13:38 +0900)]
libata: kill type mismatch compile warning

kill the following compile warning.

drivers/ata/libata-core.c:1786: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoahci.c: remove non-existing SB600 raid id (re-send)
Conke Hu [Wed, 11 Apr 2007 10:23:14 +0000 (18:23 +0800)]
ahci.c: remove non-existing SB600 raid id (re-send)

    SB600 RAID and SB600 SATA is the same controller and share the
same PCI ID 0x4380. There is no such PCI ID 0x4381.

Signed-off-by: Conke Hu <conke.hu@gmail.com>
 ---------

Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: improve AC_ERR_DEV handling for ->post_internal_cmd
Tejun Heo [Tue, 20 Mar 2007 06:24:11 +0000 (15:24 +0900)]
libata: improve AC_ERR_DEV handling for ->post_internal_cmd

->post_internal_cmd is simplified EH for internal commands.  Its
primary mission is to stop the controller such that no rogue memory
access or other activities occur after the internal command is
released.  It may provide error diagnostics by setting qc->err_mask
but this hasn't been a requirement.

To ignore SETXFER failure for CFA devices, libata needs to know
whether a command was failed by the device or for any other reason.
ie. internal command needs to get AC_ERR_DEV right.

This patch makes the following changes to AC_ERR_DEV handling and
->post_internal_cmd semantics to accomodate this need and simplify
callback implementation.

1. As long as the correct bits in the result TF registers are set,
   there is no need to set AC_ERR_DEV explicitly.  libata EH core
   takes care of that for both normal and internal commands.

2. The only requirement for ->post_internal_cmd() is to put the
   controller into quiescent state.  It needs not to set any err_mask.

3. ata_exec_internal_sg() performs minimal error analysis such that
   AC_ERR_DEV is automatically set as long as result_tf is filled
   correctly.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: fix native mode disabled port handling
Tejun Heo [Fri, 9 Mar 2007 10:43:35 +0000 (19:43 +0900)]
libata: fix native mode disabled port handling

Disabled port handling in ata_pci_init_native_mode() is slightly
broken in that it may end up using the wrong port_info.  This patch
updates it such that disables ports are made dummy as done in the
legacy and other cases.

While at it, fix indentation in ata_resources_present().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoahci: move port_map handling to ahci_save_initial_config()
Tejun Heo [Sun, 18 Mar 2007 13:26:53 +0000 (22:26 +0900)]
ahci: move port_map handling to ahci_save_initial_config()

Move cross checking between port_map and cap.n_ports into
ahci_save_initial_config().  After save_initial_config is done,
hpriv->port_map is always setup properly.

Tested on JMB363, ICH7 and ICH8 (with dummy ports).

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoahci: implement ata_save/restore_initial_config()
Tejun Heo [Sun, 18 Mar 2007 13:15:33 +0000 (22:15 +0900)]
ahci: implement ata_save/restore_initial_config()

There are several registers which describe how the controller is
configured.  These registers are sometimes implemented as r/w
registers which are configured by firmware and get cleared on
controller reset or after suspend/resume cycle.  ahci saved and
restored those values inside ahci_reset_controller() which is a bit
messy and doesn't work over suspend/resume cycle.

This patch implements ahci_save/restore_initial_config().  The save
function is called during driver initialization and saves cap and
port_map to hpriv.  The restore function is called after the
controller is reset to restore the initial values.

Sometimes the initial firmware values are inconsistent and need to be
fixed up.  This is handled by ahci_save_initial_config().  For this,
there are two versions of saved registers.  One to write back to the
hardware register, the other to use during driver operation.  This is
necessary to keep ahci's behavior unchanged (write back fixed up
port_map while keeping cap as-is).

This patch makes ahci save the register values once before the first
controller reset, not after it's been reset.  Also, the same stored
values are used written back after each reset, so the register values
are properly recovered after suspend/resume cycle.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agosata_promise: fix error decode regression
Mikael Pettersson [Sat, 7 Apr 2007 12:29:51 +0000 (14:29 +0200)]
sata_promise: fix error decode regression

Promise ATA ports should always be reset by pdc_reset_port()
when errors are detected, but the recent error reason decoding
update to sata_promise replaced that reset with a freeze.

This patch changes the error detection to do a reset again.
This makes the error decoding update safer, as it now only
adds error decoding without changing any other behaviour.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopata_pdc2027x: Updates
Alan Cox [Tue, 10 Apr 2007 23:19:00 +0000 (00:19 +0100)]
pata_pdc2027x: Updates

Signed-off-by: Alan Cox <alan@redhat.com>
Correct missing modefilter (crash if BAR4 unassigned)
Use Cable Detect method
Wrap ->set_mode instead ready for ->post_set_mode removal
Maxtor errata as per Jeff Garzik report
Remove duplicated private udma_mask hacking
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopata_winbond
Alan Cox [Tue, 10 Apr 2007 23:14:09 +0000 (00:14 +0100)]
pata_winbond

Not a PCI device so doesn't need PCI includes

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopata: cable methods
Alan Cox [Tue, 10 Apr 2007 23:04:20 +0000 (00:04 +0100)]
pata: cable methods

Versus upstream as requested

Last of the trivial switches to cable_detect methods.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolibata: add support for READ/WRITE LONG
Mark Lord [Fri, 16 Mar 2007 14:22:26 +0000 (10:22 -0400)]
libata: add support for READ/WRITE LONG

The READ/WRITE LONG commands are theoretically obsolete,
but the majority of drives in existance still implement them.

The WRITE_LONG and WRITE_LONG_ONCE commands are of particular
interest for fault injection testing -- eg. creating "media errors"
at specific locations on a disk.

The fussy bit is that these commands require a non-standard
sector size, usually 520 bytes instead of 512.

This patch adds support to libata for READ/WRITE LONG commands
issued via SG_IO/ATA_16.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoAdd notation that the Asus W5F laptop has a short cable instead of 80-wire.
Robin H\. Johnson [Thu, 29 Mar 2007 01:02:07 +0000 (18:02 -0700)]
Add notation that the Asus W5F laptop has a short cable instead of 80-wire.

The Asus W5F laptop uses a short cable instead of the 80-wire style, and thus
needs to be in the ich_laptop special cases for correct detection and support
of UDMA/100 for the hard drive. I noticed this because I have the W5F laptop,
and was tracing apparent slowness.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopata_optidma: rework for cable detect and to remove post_set_mode()
Alan Cox [Tue, 27 Mar 2007 05:43:43 +0000 (21:43 -0800)]
pata_optidma: rework for cable detect and to remove post_set_mode()

A lot of noise because I had to rename the optidma_set_mode() method to
avoid confusion with the new ->set_mode() method that was added. Cable
detect side is pretty trivial.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopata_winbond: restore cable method
Alan Cox [Tue, 27 Mar 2007 05:43:42 +0000 (21:43 -0800)]
pata_winbond: restore cable method

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopata_sl82c105: restore cable detect method
Alan Cox [Tue, 27 Mar 2007 05:43:41 +0000 (21:43 -0800)]
pata_sl82c105: restore cable detect method

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopata_netcell: re-remove all the crud
Alan Cox [Tue, 27 Mar 2007 05:43:40 +0000 (21:43 -0800)]
pata_netcell: re-remove all the crud

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopata_qdI: restore cable detect
Alan Cox [Tue, 27 Mar 2007 05:43:40 +0000 (21:43 -0800)]
pata_qdI: restore cable detect

Signed-off-by: Alan Cox <number6@the-village.bc.nu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopata_ali: remove all the crap again and switch to cable_detect method
Alan Cox [Tue, 27 Mar 2007 05:43:37 +0000 (21:43 -0800)]
pata_ali: remove all the crap again and switch to cable_detect method

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agosata_nv: don't read shadow registers when in ADMA mode
Robert Hancock [Tue, 27 Mar 2007 05:43:36 +0000 (21:43 -0800)]
sata_nv: don't read shadow registers when in ADMA mode

Reading from the ATA shadow registers while we are in ADMA mode may cause
undefined behavior.  Don't read the ATA status register when completing
commands for this reason, it shouldn't be needed as the controller will
notify us if the command failed.  Also, don't allow commands with result
taskfile requested to execute in ADMA mode, since that requires accessing
the shadow registers.  We also still need to override tf_read since libata
will read the result taskfile on a command failure, and we need to go into
port register mode before allowing this.

Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopcmcia - spot slave decode flaws (for testing)
Alan [Tue, 27 Mar 2007 05:43:34 +0000 (21:43 -0800)]
pcmcia - spot slave decode flaws (for testing)

It tries to spot when the slave is a mirror of the master and to fix up
problems that causes.

I've got two confirmations so far that this plus the "can fail set_xfer" patch
work for folks who had problems before.  Also if you are unfortunate enough to
be running something like HAL then it'll automount the same disk twice for you
and corrupt it without the fix (aint that nice...)

Tested (successfully) by Komuro <komurojun-mbn@nifty.com>.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>