dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

94529 Commits

Author SHA1 Message Date
Adrian Drzewiecki e6ffbcb6cd md: Notify sysfs when RAID1/5/10 disk is In_sync.
When RAID1 is done syncing disks, it'll update the state
of synced rdevs to In_sync. But it neglected to notify
sysfs that the attribute changed. So any programs that
are waiting for an rdev's state to change will not be
woken.

(raid5/raid10 added by neilb)

Signed-off-by: Adrian Drzewiecki <adriand@vmware.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2010-08-18 11:49:02 +10:00
NeilBrown 3a3a5ddb7a Update recovery_offset even when external metadata is used.
The update of ->recovery_offset in sync_sbs is appropriate even then external
metadata is in use.  However sync_sbs is only called when native
metadata is used.

So move that update in to the top of md_update_sb (which is the only
caller of sync_sbs) before the test on ->external.

This moves the update out of ->write_lock protection, but those fields
only need ->reconfig_mutex protection which they still have.

Also move the test on ->persistent up to where ->external is set as
for metadata update purposes they are the same.

Clear MD_CHANGE_DEVS and MD_CHANGE_CLEAN as they can only be confusing
if ->external is set or ->persistent isn't.

Finally move the update of ->utime down as it is only relevent (like
the ->events update) for native metadata.

Signed-off-by: NeilBrown <neilb@suse.de>
Reported-by: "Kwolek, Adam" <adam.kwolek@intel.com>
2010-08-18 11:39:38 +10:00
Linus Torvalds 392abeea52 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
  vt,console,kdb: preserve console_blanked while in kdb
  vt: fix regression warnings from KMS merge
  arm,kgdb: fix GDB_MAX_REGS no longer used
  kgdb: add missing __percpu markup in arch/x86/kernel/kgdb.c
  kdb: fix compile error without CONFIG_KALLSYMS
2010-08-17 18:36:19 -07:00
Linus Torvalds 472db19ff5 Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86:
  platform/x86: move rfkill for Dell Mini 1012 to compal-laptop
  thinkpad-acpi: Add KEY_CAMERA (Fn-F6) for Lenovo keyboards
  thinkpad-acpi: add support for model-specific keymaps
  thinkpad-acpi: lock down size of hotkey keymap
  thinkpad-acpi: untangle ACPI/vendor backlight selection
  thinkpad-acpi: find ACPI video device by synthetic HID
  intel_ips: potential null dereference
  drivers/platform/x86: Adjust confusing if indentation
  x86: intel_ips: do not use PCI resources before pci_enable_device()
2010-08-17 18:36:01 -07:00
Linus Torvalds e14f64c207 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  net: Fix a memmove bug in dev_gro_receive()
  net sched: fix some kernel memory leaks
  netfilter: {ip,ip6,arp}_tables: avoid lockdep false positive
  Revert "netlink: netlink_recvmsg() fix"
  ipv6: remove sysctl jiffies conversion on gc_elasticity and min_adv_mss
  xfrm: Use GFP_ATOMIC in xfrm_compile_policy
  ath5k: disable ASPM L0s for all cards
  ath9k_htc: load proper firmware for device ID 7015
  wl1251: fix trigger scan timeout usage
  ath9k_htc: Fix disconnect issue in HT40 mode.
  ath9k_htc: fix panic on packet injection using airbase-ng tool.
  ipw2100: register pm_qos request before registering pci driver
2010-08-17 18:34:37 -07:00
Linus Torvalds 19147d0eb1 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: Fix atomic64_t routine return values.
  sparc64: Fix rwsem constant bug leading to hangs.
  sparc: Hook up new fanotify and prlimit64 syscalls.
  sparc: Really fix "console=" for serial consoles.
2010-08-17 18:14:08 -07:00
Linus Torvalds 2a6a432a9c Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm:
  VIDEO: amba clcd: don't disable an already disabled clock
  ARM: Tighten check for allowable CPSR values
  ARM: 6329/1: wire up sys_accept4() on ARM
  ARM: 6328/1: Build with -fno-dwarf2-cfi-asm
  ARM: 6326/1: kgdb: fix GDB_MAX_REGS no longer used
2010-08-17 18:11:49 -07:00
David Miller a7c8962bfb arcmsr_hba: Missing slab.h include
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-17 18:07:43 -07:00
Russell King 99c796df94 VIDEO: amba clcd: don't disable an already disabled clock
Fix the clock enable/disable tracking in the AMBA CLCD driver so
that the driver doesn't try to disable an already disabled clock,
thereby causing the clock (if shared) to become unbalanced.

This resolves a problem with CLCD on LPC32xx ARM platforms.

Reported-by: Kevin Wells <wellsk40@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-08-17 22:15:09 +01:00
Graeme Smecher 7a50d06e24 of: fix missing headers for of_address_to_resource() in MTD and SysACE drivers
The drivers for Xilinx' SystemACE and physically mapped MTDs were missing
prototypes for of_address_to_resource(). This patch adds the necessary
headers.

Signed-off-by: Graeme Smecher <graeme.smecher@mail.mcgill.ca>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-08-17 13:16:47 -06:00
Johannes Berg 8b8ab9d5e3 iwlwifi: fix 3945 filter flags
Applying the filter flags directly as done since

commit 3474ad635d
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Thu Apr 29 04:43:05 2010 -0700

    iwlwifi: apply filter flags directly

broke 3945 under some unknown circumstances, as
reported by Alex.

Since I want to keep the direct application of
filter flags on iwlagn, duplicate the code into
both 3945 and agn and remove committing the
RXON that broke things from the 3945 version.

Cc: stable@kernel.org [2.6.35]
Reported-by: Alex Romosan <romosan@sycorax.lbl.gov>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-17 14:38:14 -04:00
John W. Linville c206a04fba ipw2100: don't sync status queue entries
These are allocated with pci_alloc_consistent, so calling
pci_dma_sync_single_for_cpu is incorrect usage of the API.  Remove this
misuse and consequently avoid the following backtrace:

WARNING: at lib/dma-debug.c:902 check_sync+0xce/0x43a()
Hardware name: 2373HU6
ipw2100 0000:02:02.0: DMA-API: device driver tries to sync DMA memory it has not allocated [device address=0x0000000034e88008] [size=8 bytes]
Modules linked in: microcode ipw2100(+) snd_seq_device ppdev libipw nsc_ircc snd_pcm lib80211 video output irda parport_pc cfg80211 parport thinkpad_acpi e1000 iTCO_wdt crc_ccitt snd_timer iTCO_vendor_support snd i2c_i801 pcspkr rfkill soundcore joydev snd_page_alloc yenta_socket radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core [last unloaded: scsi_wait_scan]
Pid: 0, comm: swapper Tainted: G        W   2.6.35-wl+ #8
Call Trace:
 [<c043aa42>] warn_slowpath_common+0x6a/0x7f
 [<c05d252a>] ? check_sync+0xce/0x43a
 [<c043aaca>] warn_slowpath_fmt+0x2b/0x2f
 [<c05d252a>] check_sync+0xce/0x43a
 [<c046189a>] ? print_lock_contention_bug+0x11/0xb2
 [<c05d2b6f>] debug_dma_sync_single_for_cpu+0x47/0x49
 [<c06cbd3c>] ? ehci_irq+0x31/0x331
 [<f82a224a>] ? ipw2100_irq_tasklet+0x24/0x5e9 [ipw2100]
 [<f82a224a>] ? ipw2100_irq_tasklet+0x24/0x5e9 [ipw2100]
 [<f82a221d>] pci_dma_sync_single_for_cpu.clone.1+0x42/0x4b [ipw2100]
 [<f82a23a2>] ipw2100_irq_tasklet+0x17c/0x5e9 [ipw2100]
 [<c043fd87>] tasklet_action+0x78/0xcb
 [<c0440293>] __do_softirq+0xc4/0x183
 [<c044038d>] do_softirq+0x3b/0x5f
 [<c04404d0>] irq_exit+0x3a/0x6d
 [<c0404423>] do_IRQ+0x8b/0x9f
 [<c04038b5>] common_interrupt+0x35/0x3c
 [<c062ecfa>] ? acpi_idle_enter_simple+0xfe/0x13c
 [<c045007b>] ? exit_itimers+0x2d/0x73
 [<c062ecfc>] ? acpi_idle_enter_simple+0x100/0x13c
 [<c070bf10>] cpuidle_idle_call+0x78/0xdc
 [<c040251c>] cpu_idle+0x9b/0xb7
 [<c07b1dd2>] rest_init+0xa6/0xab
 [<c0a4b96d>] start_kernel+0x389/0x38e
 [<c0a4b0c9>] i386_start_kernel+0xc9/0xd0

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-17 14:38:14 -04:00
Grant Likely f1ca09b2b5 of: Fix missing includes
This patch fixes missing includes from a number of .c files because
the code (wrongfully) depended on prom.h including them.  The include
of linux/of_address.h was removed in microblaze prom.h in commit
"of/address: Clean up function declarations" (sha1 id 22ae782f8), but
not fixed in some callers.  This patch fixes them up.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: Michal Simek <monstr@monstr.eu>
2010-08-16 23:44:49 -06:00
Dave Airlie 1b2f148963 drm: block userspace under allocating buffer and having drivers overwrite it (v2)
With the current screwed but its ABI, ioctls for the drm, Linus pointed out that we could allow userspace to specify the allocation size, but we pass it to the driver which then uses it blindly to store a struct. Now if userspace specifies the allocation size as smaller than the driver needs, the driver can possibly overwrite memory.

This patch restructures the driver ioctls so we store the structure size we are expecting, and make sure we allocate at least that size. The copy from/to userspace are still restricted to the size the user specifies, this allows ioctl structs to grow on both sides of the equation.

Up until now we didn't really use the DRM_IOCTL defines in the kernel, so this cleans them up and adds them for nouveau.

v2:
fix nouveau pushbuf arg (thanks to Ben for pointing it out)

Reported-by: Linus Torvalds <torvalds@linuxfoundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-17 14:52:25 +10:00
Dave Airlie b9f0aee833 drm: stop information leak of old kernel stack.
non-critical issue, CVE-2010-2803

Userspace controls the amount of memory to be allocate, so it can
get the ioctl to allocate more memory than the kernel uses, and get
access to kernel stack. This can only be done for processes authenticated
to the X server for DRI access, and if the user has DRI access.

Fix is to just memset the data to 0 if the user doesn't copy into
it in the first place.

Reported-by: Kees Cook <kees@ubuntu.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-17 14:51:45 +10:00
Ben Skeggs 625db6b7e3 drm/nouveau: fix earlier mistake when fixing merge conflict
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-17 12:02:43 +10:00
Ben Skeggs b515f3a2d8 drm/nvc0: fix thinko in instmem suspend/resume
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-17 11:59:53 +10:00
Francisco Jerez 20d66daf0a drm/nouveau: Workaround missing GPIO tables on an Apple iMac G4 NV18.
This should fix the reported TV-out load detection false positives
(fdo bug 29455).

Reported-by: Vlado Plaga <rechner@vlado-do.de>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-17 11:59:48 +10:00
Francisco Jerez 19bf5f7df9 drm/nouveau: Add TV-out quirk for an MSI nForce2 IGP.
The blob also thinks there's a TV connected, so hardware bug...

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-17 11:59:38 +10:00
Ben Skeggs 46d4cae200 drm/nv50-nvc0: ramht_size is meant to be in bytes, not entries
Fixes an infinite loop that can happen in RAMHT lookup.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-17 11:59:24 +10:00
Ben Skeggs 45a68a072e drm/nouveau: punt some more log messages to debug level
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-17 11:59:19 +10:00
Ben Skeggs 98720bf4e1 drm/nouveau: remove warning about unknown tmds table revisions
This message is apparently confusing people, and is being blamed for some
modesetting issues.  Lets remove the message, and instead replace it
with an unconditional printout of the table revision.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-17 11:59:16 +10:00
Ben Skeggs bd6aaea893 drm/nouveau: check for error when allocating/mapping dummy page
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-17 11:59:09 +10:00
Ben Skeggs 415e6186f1 drm/nouveau: fix race condition when under memory pressure
When VRAM is running out it's possible that the client's push buffers get
evicted to main memory.  When they're validated back in, the GPU may
be used for the copy back to VRAM, but the existing synchronisation code
only deals with inter-channel sync, not sync between PFIFO and PGRAPH on
the same channel.  This leads to PFIFO fetching from command buffers that
haven't quite been copied by PGRAPH yet.

This patch marks push buffers as so, and forces any GPU-assisted buffer
moves to be done on a different channel, which triggers the correct
synchronisation to happen before we submit them.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-17 11:58:56 +10:00
Ben Skeggs 56dfc58ea0 drm/nv50: fix minor thinko from nvc0 changes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-17 11:58:53 +10:00
Francisco Jerez 4ca2b7120c drm/nouveau: Don't try DDC on the dummy I2C channel.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-17 11:58:46 +10:00
Stephen Rothwell 60652d07a0 ata: update for of_device to platform_device replacement
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-08-16 15:13:28 -06:00
David S. Miller 300a103d15 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2010-08-16 14:09:34 -07:00
Jason Wessel beed5336eb vt,console,kdb: preserve console_blanked while in kdb
Commit b45cfba4e9 (vt,console,kdb:
implement atomic console enter/leave functions) introduced the ability
to atomically change the console mode with kernel mode setting but did
not preserve the state of the console_blanked variable.

The console_blanked variable must be restored when executing the
con_debug_leave() or further kernel mode set changes (such as using
chvt X) will fail to correctly set the state of console.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
CC: Andrew Morton <akpm@linux-foundation.org>
2010-08-16 15:58:31 -05:00
Jason Wessel fed891c89b vt: fix regression warnings from KMS merge
Fix the following new sparse warnings in vt.c introduced by the commit
b45cfba4e9 (vt,console,kdb: implement
atomic console enter/leave functions):

drivers/char/vt.c:197:5: warning: symbol 'saved_fg_console' was not declared. Should it be static?
drivers/char/vt.c:198:5: warning: symbol 'saved_last_console' was not declared. Should it be static?
drivers/char/vt.c:199:5: warning: symbol 'saved_want_console' was not declared. Should it be static?
drivers/char/vt.c:200:5: warning: symbol 'saved_vc_mode' was not declared. Should it be static?

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
CC: Andrew Morton <akpm@linux-foundation.org>
2010-08-16 15:58:30 -05:00
David S. Miller 5ca6f7c851 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2010-08-16 13:56:01 -07:00
David S. Miller 0a492896ac sparc: Really fix "console=" for serial consoles.
If a video head and keyboard are hooked up, specifying "console=ttyS0"
or similar to use a serial console will not work properly.

The key issue is that we must register all serial console capable
devices with register_console(), otherwise the command line specified
device won't be found.  The sun serial drivers would only register
themselves as console devices if the OpenFirmware specified console
device node matched.  To fix this part we now unconditionally get
the serial console register by setting serial_drv->cons always.

Secondarily we must not add_preferred_console() using the firmware
provided console setting if the user gaven an override on the kernel
command line using "console="  The "primary framebuffer" matching
logic was always triggering o n openfirmware device node match, make
it not when a command line override was given.

Reported-by: Frans Pop <elendil@planet.nl>
Tested-by: Frans Pop <elendil@planet.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-08-16 12:26:09 -07:00
Victor van den Elzen c3f755e384 platform/x86: move rfkill for Dell Mini 1012 to compal-laptop
Like others in the Mini series, the Dell Mini 1012 does not support
the smbios hook required by dell-laptop.

Signed-off-by: Victor van den Elzen <victor.vde@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:55:00 -04:00
Jens Taprogge 2b75426282 thinkpad-acpi: Add KEY_CAMERA (Fn-F6) for Lenovo keyboards
On the T410s and most likely other current models, Fn-F6 is labeled as
Camera/Headphone key.  Report key presses as KEY_CAMERA.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Acked-by: Jerone Young <jerone.young@canonical.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:57 -04:00
Henrique de Moraes Holschuh d1e14dca6a thinkpad-acpi: add support for model-specific keymaps
Use the quirks engine to select model-specific keymaps, which makes
it much easier to extend should we need it.

Keycodes are based on the tables at
http://www.thinkwiki.org/wiki/Default_meanings_of_special_keys.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:55 -04:00
Henrique de Moraes Holschuh 34a656d22f thinkpad-acpi: lock down size of hotkey keymap
Use a safer coding style for the hotkey keymap.  This does not fix any
problems, as the current code is correct.  But it might help avoid
mistakes in the future.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:52 -04:00
Henrique de Moraes Holschuh 217f09631a thinkpad-acpi: untangle ACPI/vendor backlight selection
acpi_video_backlight_support() already tells us if ACPI is handling
backlight control through the generic ACPI handle.  It is better to just
trust it.

While at it, adjust down a printk priority, and test earlier for
brightness_enable=0.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:50 -04:00
Henrique de Moraes Holschuh 122f26726b thinkpad-acpi: find ACPI video device by synthetic HID
The Linux ACPI core locates the ACPI video devices for us and marks them
with ACPI_VIDEO_HID.  Use that information to locate the video device
instead of a half-baked hunt for _BCL.

This uncouples the detection of the number of backlight brightness
levels on ThinkPads from the ACPI paths in vid_handle.

With this change, the driver should be able to always detect whether the
ThinkPad uses a 8-level or 16-level brightness scale even on newer
models for which the vid_handle paths have not been updated yet.

It will skip deactivated devices in the ACPI device tree, which is a
change in behaviour.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:47 -04:00
Dan Carpenter 52d7ee558d intel_ips: potential null dereference
There is a potential NULL dereference of "limits."  We can just return
NULL earlier to avoid it.  The caller already handles NULL returns.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:29 -04:00
Julia Lawall 2e0ee69c21 drivers/platform/x86: Adjust confusing if indentation
The assignment of ret to -EIO appears to only make sense if the branch that
it is aligned with is executed, so move it into that branch.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable braces4@
position p1,p2;
statement S1,S2;
@@

(
if (...) { ... }
|
if (...) S1@p1 S2@p2
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

if (p1[0].column == p2[0].column):
  cocci.print_main("branch",p1)
  cocci.print_secs("after",p2)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:54:20 -04:00
Kulikov Vasiliy 5629236b31 x86: intel_ips: do not use PCI resources before pci_enable_device()
IRQ and resource[] may not have correct values until
after PCI hotplug setup occurs at pci_enable_device() time.

The semantic match that finds this problem is as follows:

// <smpl>
@@
identifier x;
identifier request ~= "pci_request.*|pci_resource.*";
@@

(
* x->irq
|
* x->resource
|
* request(x, ...)
)
 ...
*pci_enable_device(x)
// </smpl>

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2010-08-16 11:53:44 -04:00
Chris Ball 83e4491818 USB HID: Add ID for eGalax Multitouch used in JooJoo tablet
The JooJoo tablet (http://thejoojoo.com/) contains an "eGalax Inc. USB
TouchController", and this patch hooks it up to the egalax-touch driver.
Without the patch we don't get any cursor motion, since it comes through
Z/RX rather than X/Y.

(The egalax-touch driver does not yet generate a correct event sequence
for the "serial" protocol used by this device, though -- see the note
added to the code, which comes from research by Stéphane Chatty.)

Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Stéphane Chatty <chatty@enac.fr>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-08-16 16:01:28 +02:00
Linus Torvalds 2245ba2a3a Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  gcc-4.6: ACPI: fix unused but set variables in ACPI
  ACPI thermal: make procfs I/F depend on CONFIG_ACPI_PROCFS
  ACPI video: make procfs I/F depend on CONFIG_ACPI_PROCFS
  ACPI processor: remove deprecated ACPI procfs I/F
  ACPI power_resource: remove unused procfs I/F
  ACPI: remove deprecated ACPI procfs I/F
  ACPI: introduce drivers/acpi/sysfs.c
  ACPI: introduce module parameter acpi.aml_debug_output
  ACPI: introduce drivers/acpi/debugfs.c
  ACPI, APEI, ERST debug support
  ACPI, APEI, Manage GHES as platform devices
  ACPI, APEI, Rename CPER and GHES severity constants
  ACPI, APEI, Fix a typo of error path of apei_resources_request
  ACPI / ACPICA: Fix reference counting problems with GPE handlers
  ACPI: Add the check of ADR flag in course of finding ACPI handle for PCI device
  ACPI / Sleep: Drop acpi_suspend_finish()
  ACPI / Sleep: Consolidate suspend and hibernation routines
  ACPI / Wakeup: Simplify enabling of wakeup devices
  ACPI / Sleep: Rework enabling wakeup devices
  ACPI / Sleep: Free NVS copy if suspending of devices fails

Fixed up totally buggered "ACPI: fix unused but set variables in ACPI"
patch that doesn't even compile in the merge.

Thanks to Sedat Dilek <sedat.dilek@googlemail.com> for noticing the
breakage before I even pulled.  And a big "Grrr.." at Len for not even
bothering to compile the tree before asking me to pull.
2010-08-15 17:37:07 -07:00
Linus Torvalds e2e96c6636 Merge git://git.infradead.org/iommu-2.6
* git://git.infradead.org/iommu-2.6:
  intel-iommu: Fix 32-bit build warning with __cmpxchg()
  intr-remap: allow disabling source id checking
2010-08-15 17:34:20 -07:00
Linus Torvalds 7355a5a654 Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6:
  mtd/nand_ids: Fix buswidth
  mtd/m25p80: fix test for end of loop
  mtd/m25p80: retlen is never NULL
  MIPS: Fix gen_nand probe structures contents
  gen_nand: Test if nr_chips field is valid
  BFIN: Fix gen_nand probe structures contents
  nand/denali: move all hardware initialization work to denali_hw_init
  nand/denali: Add a page check in denali_read_page & denali_read_page_raw
  nand/denali: use cpu_relax() while waiting for hardware interrupt
  nand/denali: change read_status function method
  nand/denali: Fixed check patch warnings
  ARM: Fix gen_nand probe structures contents
  mtd/nand_base: fix kernel-doc warnings & typos
  nand/denali: use dev_xx debug function to replace nand_dbg_print and some printk
  nand/denali: Fixed handle ECC error bugs
  nand/denali: use iowrite32() to replace denali_write32()
  nand/denali: Fixed probe function bugs
2010-08-15 17:32:47 -07:00
Linus Torvalds 5a4179460c Merge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6
* 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6:
  intel_idle: recognize Lincroft Atom Processor
  intel_idle: no longer EXPERIMENTAL
  intel_idle: disable module support
  intel_idle: add support for Westmere-EX
  intel_idle: delete power_policy modparam, and choose substate functions
  intel_idle: delete substates DEBUG modparam
2010-08-15 11:17:52 -07:00
Len Brown 95ee46aa86 Merge branch 'linus' into release
Conflicts:
	drivers/acpi/debug.c

Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-15 01:06:31 -04:00
Andi Kleen cfa806f059 gcc-4.6: ACPI: fix unused but set variables in ACPI
Some minor improvements in error handling, but overall it was mostly dead
code.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-15 00:53:08 -04:00
Zhang Rui 43d9f87b79 ACPI thermal: make procfs I/F depend on CONFIG_ACPI_PROCFS
Mark the ACPI thermal procfs I/F deprecated, because /sys/class/thermal/
is already available and has been working for years w/o any problem.

The ACPI thermal procfs I/F will be removed in 2.6.37.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-15 00:37:33 -04:00
Zhang Rui 6e37c658ae ACPI video: make procfs I/F depend on CONFIG_ACPI_PROCFS
Mark ACPI video driver procfs I/F deprecated, including:
/proc/acpi/video/*/info
/proc/acpi/video/*/DOS
/proc/acpi/video/*/ROM
/proc/acpi/video/*/POST
/proc/acpi/video/*/POST_info
/proc/acpi/video/*/*/info
/proc/acpi/video/*/*/state
/proc/acpi/video/*/*/EDID
and
/proc/acpi/video/*/*/brightness, because
1. we already have the sysfs I/F /sysclass/backlight/ as the replacement
of /proc/acpi/video/*/*/brightness.
2. the other procfs I/F is not useful for userspace.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-15 00:34:06 -04:00
Zhang Rui d09fe55510 ACPI processor: remove deprecated ACPI procfs I/F
Remove deprecated ACPI processor procfs I/F, including:
/proc/acpi/processor/CPUX/power
/proc/acpi/processor/CPUX/limit
/proc/acpi/processor/CPUX/info

/proc/acpi/processor/CPUX/throttling still exists,
as we don't have sysfs I/F available for now.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-15 00:31:45 -04:00
Zhang Rui 06af7eb043 ACPI power_resource: remove unused procfs I/F
Remove unused ACPI power procfs I/F.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-15 00:28:26 -04:00
Zhang Rui 47f5c892b0 ACPI: remove deprecated ACPI procfs I/F
Rmove deprecated ACPI procfs I/F, including
/proc/acpi/debug_layer
/proc/acpi/debug_level
/proc/acpi/info
/proc/acpi/dsdt
/proc/acpi/fadt
/proc/acpi/sleep

because the sysfs I/F is already available
and has been working well for years.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-15 00:27:51 -04:00
Zhang Rui 1c8fce27e2 ACPI: introduce drivers/acpi/sysfs.c
Introduce drivers/acpi/sysfs.c.

code for ACPI sysfs I/F, including
#ifdef ACPI_DEBUG
/sys/module/acpi/parameters/debug_layer
/sys/module/acpi/parameters/debug_level
/sys/module/acpi/parameters/trace_method_name
/sys/module/acpi/parameters/trace_debug_layer
/sys/module/acpi/parameters/trace_debug_level
/sys/module/acpi/parameters/trace_state
#endif
/sys/module/acpi/parameters/acpica_version
/sys/firmware/acpi/tables/
/sys/firmware/acpi/interrupts/
is moved to this file.

No function change in this patch.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-15 00:26:30 -04:00
Len Brown c172cb73bc Merge branch 'acpica-gpe' into release 2010-08-15 00:25:40 -04:00
Len Brown e8eb622809 Merge branch 'bugzilla-16422' into release 2010-08-14 23:57:32 -04:00
Len Brown ecd8ee0955 Merge branch 'procfs-cleanup' into release 2010-08-14 23:55:57 -04:00
Len Brown feb29c5175 Merge branch 'apei' into release 2010-08-14 23:55:47 -04:00
Len Brown f2a66185be Merge branch 'nvs' into release 2010-08-14 23:55:44 -04:00
Zhang Rui c637e4861c ACPI: introduce module parameter acpi.aml_debug_output
Introduce module parameter acpi.aml_debug_output.

With acpi.aml_debug_output set, we can get AML debug object output
(Store (AAA, Debug)), even with CONFIG_ACPI_DEBUG cleared.

Together with the runtime custom method mechanism,
we can debug AML code problems without rebuilding the kernel.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-14 23:02:14 -04:00
Zhang Rui a25ee9200e ACPI: introduce drivers/acpi/debugfs.c
Introduce drivers/acpi/debugfs.c.

Code for ACPI debugfs I/F,
i.e. /sys/kernel/debug/acpi/custom_method,
is moved to this file.

And make ACPI debugfs always built in,
even if CONFIG_ACPI_DEBUG is cleared.

BTW:this adds about 400bytes code to ACPI, when
CONFIG_ACPI_DEBUG is cleared.

[uaccess.h build fix from Andrew Morton <akpm@linux-foundation.org>]

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-14 23:02:00 -04:00
Arjan van de Ven 4725fd3ce9 intel_idle: recognize Lincroft Atom Processor
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-14 22:54:52 -04:00
Huang Ying 2ff729d506 ACPI, APEI, ERST debug support
This patch adds debugging/testing support to ERST. A misc device is
implemented to export raw ERST read/write/clear etc operations to user
space. With this patch, we can add ERST testing support to
linuxfirmwarekit ISO (linuxfirmwarekit.org) to verify the kernel
support and the firmware implementation.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-14 22:47:55 -04:00
Randy Dunlap fc58fb1807 fusion: add function parameter names to kernel-doc
Fix fusion missing kernel-doc:

  Warning(drivers/message/fusion/mptbase.c:649): No description found for parameter 'func_name'
  Warning(drivers/message/fusion/mptbase.c:8010): No description found for parameter 'cb_idx'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-14 16:21:00 -07:00
Randy Dunlap 1f5cfe2f73 fusion: fix non-kernel-doc comment block
Fix comment begin notation not to look like kernel-doc
since it's not.  Removes kernel-doc warnings.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-14 16:20:59 -07:00
Linus Torvalds d310ad0c9d Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: (22 commits)
  hwmon: (via-cputemp) Remove bogus "SHOW" global variable
  hwmon: jc42 depends on I2C
  hwmon: (pc87427) Add a maintainer
  hwmon: (pc87427) Move sysfs file removal to a separate function
  hwmon: (pc87427) Add temperature monitoring support
  hwmon: (pc87427) Add support for the second logical device
  hwmon: (pc87427) Add support for manual fan speed control
  hwmon: (pc87427) Minor style cleanups
  hwmon: (pc87427) Handle disabled fan inputs properly
  hwmon: (w83627ehf) Add support for W83667HG-B
  hwmon: (w83627ehf) Driver cleanup
  hwmon: Add driver for SMSC EMC2103 temperature monitor and fan controller
  hwmon: Remove in[0-*]_fault from sysfs-interface
  hwmon: Add 4 current alarm/beep attributes to sysfs-interface
  hwmon: Add 3 critical limit attributes to sysfs-interface
  hwmon: (asc7621) Clean up and improve detect function
  hwmon: (it87) Export labels for internal sensors
  hwmon: (lm75) Add suspend/resume feature
  hwmon: (emc1403) Add power support
  hwmon: (ltc4245) Expose all GPIO pins as analog voltages
  ...
2010-08-14 14:57:58 -07:00
Linus Torvalds c29c08b598 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (28 commits)
  [SCSI] qla4xxx: fix compilation warning
  [SCSI] make error handling more robust in the face of reservations
  [SCSI] tgt: fix warning
  [SCSI] drivers/message/fusion: Adjust confusing if indentation
  [SCSI] Return NEEDS_RETRY for eh commands with status BUSY
  [SCSI] ibmvfc: Driver version 1.0.9
  [SCSI] ibmvfc: Fix terminate_rport_io
  [SCSI] ibmvfc: Fix rport add/delete race resulting in oops
  [SCSI] lpfc 8.3.16: Change LPFC driver version to 8.3.16
  [SCSI] lpfc 8.3.16: FCoE Discovery and Failover Fixes
  [SCSI] lpfc 8.3.16: SLI Additions, updates, and code cleanup
  [SCSI] pm8001: introduce missing kfree
  [SCSI] qla4xxx: Update driver version to 5.02.00-k3
  [SCSI] qla4xxx: Added AER support for ISP82xx
  [SCSI] qla4xxx: Handle outstanding mbx cmds on hung f/w scenarios
  [SCSI] qla4xxx: updated mbx_sys_info struct to sync with FW 4.6.x
  [SCSI] qla4xxx: clear AF_DPC_SCHEDULED flage when exit from do_dpc
  [SCSI] qla4xxx: Stop firmware before doing init firmware.
  [SCSI] qla4xxx: Use the correct request queue.
  [SCSI] qla4xxx: set correct value in sess->recovery_tmo
  ...
2010-08-14 12:34:34 -07:00
H. Peter Anvin f279941863 hwmon: (via-cputemp) Remove bogus "SHOW" global variable
The via-cputemp hwmon driver was probably intending "typedef enum {
... } SHOW;", but the "typedef" was missing creating a global variable
named "SHOW".  There is absolutely no reason to have this in the
global namespace.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Acked-by: Harald Welte <HaraldWelte@viatech.com>
Cc: Juerg Haefliger <juergh@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-14 21:09:02 +02:00
Randy Dunlap 4bd2691d6c hwmon: jc42 depends on I2C
jc42 uses i2c interfaces, so it should depend on I2C.

drivers/hwmon/jc42.c:426: error: implicit declaration of function 'i2c_check_functionality'
drivers/hwmon/jc42.c:521: error: implicit declaration of function 'i2c_smbus_read_word_data'
drivers/hwmon/jc42.c:529: error: implicit declaration of function 'i2c_smbus_write_word_data'
drivers/hwmon/jc42.c:580: error: implicit declaration of function 'i2c_add_driver'
drivers/hwmon/jc42.c:585: error: implicit declaration of function 'i2c_del_driver'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-14 21:09:01 +02:00
Jean Delvare c6b8724647 hwmon: (pc87427) Move sysfs file removal to a separate function
The sysfs file removal code is the same in the probe error path and in
the remove function, so move it to a separate function to avoid code
duplication.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-08-14 21:09:00 +02:00
Jean Delvare 008e5f3350 hwmon: (pc87427) Add temperature monitoring support
Add support for the 6 temperature monitoring channels of the PC87427.
Note that the sensors resolution can vary, and I couldn't find a way
to figure it out, so we might have to compensate in user-space.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-08-14 21:08:59 +02:00
Jean Delvare 9d32df192d hwmon: (pc87427) Add support for the second logical device
The second logical device contains the voltage and temperature
registers. We have to extend the driver to support a second logical
device before we can add support for these features.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-08-14 21:08:58 +02:00
Jean Delvare 328716bc16 hwmon: (pc87427) Add support for manual fan speed control
Add initial support for PWM outputs of the PC87427 Super-I/O chip.
Only mode change and manual fan speed control are supported. Automatic
mode configuration isn't supported, and won't be until at least one
board is known, which makes uses of the PWM outputs.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-08-14 21:08:58 +02:00
Jean Delvare 0d22d5835d hwmon: (pc87427) Minor style cleanups
Follow the best practice of the day.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-08-14 21:08:57 +02:00
Jean Delvare 4e7d99e1ac hwmon: (pc87427) Handle disabled fan inputs properly
Most fan input pins of the PC87427 can have alternate functions.
Update the driver to check the configuration register and only support
fan inputs which are really used for fan monitoring.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-08-14 21:08:56 +02:00
Guenter Roeck c39aedafb2 hwmon: (w83627ehf) Add support for W83667HG-B
Add support for W83667HG-B (very similar to the W83667HG).

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-14 21:08:55 +02:00
Guenter Roeck da2e025590 hwmon: (w83627ehf) Driver cleanup
- Moved fan pwm register array pointers into per-instance data.
- Only read fan pwm data for installed/supported fans.
- Update fan max output and fan step output information from data in
  registers.
- Create max_output and step_output attribute files only if respective
  fan pwm registers exist.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-14 21:08:55 +02:00
Steve Glendinning 9df7305b5a hwmon: Add driver for SMSC EMC2103 temperature monitor and fan controller
SMSC's EMC2103 family of temperature/fan controllers have 1
onboard and up to 3 external temperature sensors, and allow
closed-loop control of one fan.  This patch adds support for
them.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-14 21:08:54 +02:00
Jean Delvare 28cbd461f0 hwmon: (asc7621) Clean up and improve detect function
* The dev variable is never used.
* Detect functions only need to set info->type, not client->name.
* Include the device address in the log message.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: George Joseph <george.joseph@fairview5.com>
Cc: Ken Milmore <ken.milmore@googlemail.com>
2010-08-14 21:08:52 +02:00
Jean Delvare 738e5e0536 hwmon: (it87) Export labels for internal sensors
Some voltage sensors can be wired internally to the IT87xxF chip's own
power supply channels. In that case, we can inform user-space that the
wiring is known by exporting proper labels for these sensors.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-14 21:08:50 +02:00
Shubhrajyoti Datta 9914518e79 hwmon: (lm75) Add suspend/resume feature
There is a shutdown feature at suspend it can be enabled to
reduce current consumption and resume it can be switched off.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti@ti.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-14 21:08:50 +02:00
Alan Cox 960f12f4d1 hwmon: (emc1403) Add power support
Add back the power interface we lost due to a slight misunderstanding of
the maintainers wishes.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-14 21:08:49 +02:00
Ira W. Snyder 5950ec8d3e hwmon: (ltc4245) Expose all GPIO pins as analog voltages
Add support for exposing all GPIO pins as analog voltages. Though this is
not an ideal use of the chip, some hardware engineers may decide that the
LTC4245 meets their design requirements when studying the datasheet.

The GPIO pins are sampled in round-robin fashion, meaning that a slow
reader will see stale data. A userspace application can detect this,
because it will get -EAGAIN when reading from a sysfs file which contains
stale data.

Users can choose to use this feature on a per-chip basis by using either
platform data or the OF device tree (where applicable).

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-14 21:08:49 +02:00
Jean Delvare b9783dcebe hwmon: (pc87360) Fix device resource declaration
It's not OK to call platform_device_add_resources() multiple times
in a row. Despite its name, this functions sets the resources, it
doesn't add them. So we have to prepare an array with all the
resources, and then call platform_device_add_resources() once.

Before this fix, only the last I/O resource would be actually
registered. The other I/O resources were leaked.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Jim Cromie <jim.cromie@gmail.com>
Cc: stable@kernel.org
2010-08-14 21:08:48 +02:00
Julia Lawall df149d02ea hwmon: (k8temp) Adjust confusing if indentation
Move the if(err) statement after the if into the if branch indicated by its
indentation.  The preceding if(err) test implies that err cannot be nonzero
unless the if branch is taken.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable braces5@
position p1,p2;
statement S1,S2;
@@

(
if (...) { ... }
|
if (...) S1@p1 S2@p2
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

if (p1[0].column == p2[0].column):
 cocci.print_main("branch",p4)
 cocci.print_secs("after",p5)
// </smpl>  

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-14 21:08:47 +02:00
Linus Torvalds d0a0c28cf1 Merge branch 'for-linus/i2c-2636' of git://git.fluff.org/bjdooks/linux
* 'for-linus/i2c-2636' of git://git.fluff.org/bjdooks/linux:
  i2c/nuc900: add i2c driver support for nuc900
  i2c: Enable NXP LPC support in Kconfig
  i2c-pxa: fix compiler warning, due to missing const
  i2c: davinci: bus recovery procedure to clear the bus
  i2c: davinci: Add cpufreq support
  i2c: davinci: Add suspend/resume support
  i2c: davinci: Add helper functions for power management
  i2c: davinci: misc. cleanups: remove MOD_REG_BIT and IO_ADDRESS usage
  i2c: davinci: Fix smbus Oops with AIC33 usage
2010-08-14 11:57:54 -07:00
Linus Torvalds b171aa2770 Merge branch 'next-spi' of git://git.secretlab.ca/git/linux-2.6
* 'next-spi' of git://git.secretlab.ca/git/linux-2.6:
  spi/amba_pl022: Fix probe and remove hook section annotations.
  spi/mpc5121: change annotations for probe and remove functions
  spi/bitbang: reinitialize transfer parameters for every message
  spi/spi-gpio: add support for controllers without MISO or MOSI pin
  spi/bitbang: add support for SPI_MASTER_NO_{TX, RX} modes
  SPI100k: Fix 8-bit and RX-only transfers
  spi/mmc_spi: mmc_spi adaptations for SPI bus locking API
  spi/mmc_spi: SPI bus locking API, using mutex

Fix trivial conflict in drivers/spi/mpc512x_psc_spi.c due to 'struct
of_device' => 'struct platform_device' rename and __init/__exit to
__devinit/__devexit fix.
2010-08-14 11:54:09 -07:00
Len Brown 5a5e28daea intel_idle: no longer EXPERIMENTAL
This is a fully supported driver.

Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-14 14:44:08 -04:00
Len Brown 6ce9cd8669 intel_idle: disable module support
Right now the module capability is cauing more trouble
than it is worth.  At least one distro built intel_idle as a module
where it lost the init race with ACPI, making it useless.

Make intel_idle bool so that if you select it, you will use it.

We can restore module capability after cpuidle is enhanced
to handle run-time changing of idle drivers.

Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-14 14:40:36 -04:00
Wey-Yi Guy 3198c68cb4 iwlwifi: use long monitor timer to avoid un-necessary reload
For 5000 and 6000g2b series of devices, use long monitor timer to check
stuck tx queues.

.6000g2b series device, it is WiFi/BT combo device, there are some cases,
tx queues are not move for a period of time because the WiFi/BT coex.

.5000 series device, it is being reported firmware got reload more
often than necessary, so extend the timer to avoid un-necessary reload.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-14 08:26:41 -07:00
Wey-Yi Guy ce60659ad8 iwlwifi: long monitor timer
Change the name for monitor timer, also adding define for long monitor
timer; long monitor timer can be used for the type of devices require longer
time to determine the uCode is stuck on tx and needed reload.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-14 08:26:32 -07:00
Linus Torvalds eb3bbf805f Merge branch 'msm-mmc_sdcc' of git://codeaurora.org/quic/kernel/dwalker/linux-msm
* 'msm-mmc_sdcc' of git://codeaurora.org/quic/kernel/dwalker/linux-msm:
  mmc: msm_sdcc: Rename config MMC_MSM7X00A to MMC_MSM
  mmc: msm_sdcc: Compile the driver for msm7x30
  mmc: msm: fix up build breakage on !PM
2010-08-13 18:06:37 -07:00
Linus Torvalds 5e85308108 Merge branch 'stable/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft-2.6
* 'stable/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft-2.6:
  firmware: ibft depends on SCSI
  ibft: Kernel oops when rmmoding iscsi_ibft with no iBFT present.
2010-08-13 18:06:15 -07:00
Linus Torvalds 75a1e32cce Merge git://git.infradead.org/~dwmw2/ideapad-2.6
* git://git.infradead.org/~dwmw2/ideapad-2.6:
  Call acpi_video_register() in intel_opregion_init() failure path
  ideapad: Only allow camera state to be set to 0 or 1
  ideapad: Stop using global variables
  Add Lenovo ideapad driver
2010-08-13 18:04:52 -07:00
Linus Torvalds 7ec3fa1f4a Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  watchdog: hpwdt (12/12): Make NMI decoding a compile-time option
  watchdog: hpwdt (11/12): move NMI-decoding init and exit to seperate functions
  watchdog: hpwdt (10/12): Use "decoding" instead of "sourcing"
  watchdog: hpwdt (9/12): hpwdt_pretimeout reorganization
  watchdog: hpwdt (8/12): implement WDIOC_GETTIMELEFT
  watchdog: hpwdt (7/12): allow full range of timer values supported by hardware
  watchdog: hpwdt (6/12): Introduce SECS_TO_TICKS() macro
  watchdog: hpwdt (5/12): Make x86 assembly ifdef guard more strict
  watchdog: hpwdt (4/12): Despecificate driver from iLO2
  watchdog: hpwdt (3/12): Group NMI sourcing specific items together
  watchdog: hpwdt (2/12): Group options that affect watchdog behavior together
  watchdog: hpwdt (1/12): clean-up include-files.
2010-08-13 17:58:54 -07:00
Linus Torvalds 10041d2d14 Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing
* 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing:
  bkl: Remove locked .ioctl file operation
  v4l: Remove reference to bkl ioctl in compat ioctl handling
  logfs: kill BKL
2010-08-13 17:52:35 -07:00
Dominik Brodowski 4914c7f881 pcmcia: xirc2ps_cs bugfix
We need to set io_lines to 10 unconditionally.

Reported-by: Komuro <komurojun-mbn@nifty.com>
CC: netdev@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-13 16:55:26 -07:00
Frederic Weisbecker c6d7ba8b12 v4l: Remove reference to bkl ioctl in compat ioctl handling
There are no more users of struct file_operations:ioctl. These
can be safely removed.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
2010-08-14 00:24:24 +02:00
dann frazier 86ded1f35d watchdog: hpwdt (12/12): Make NMI decoding a compile-time option
hpwdt is quite functional without the NMI decoding feature.
This change lets users disable the NMI portion at compile-time
via the new HPWDT_NMI_DECODING config option.

Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-08-13 20:54:53 +00:00
dann frazier 2ec7ed67dc watchdog: hpwdt (11/12): move NMI-decoding init and exit to seperate functions
Move NMI-decoding initialisation and exit code to seperate functions so that
we can ifdef-out parts of it in the future.

Also, this is for a device, so let's use dev_info instead of printk.
    
Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-08-13 20:54:52 +00:00
dann frazier 34572b29dd watchdog: hpwdt (10/12): Use "decoding" instead of "sourcing"
The term "decoding" more clearly explains what hpwdt is doing. It isn't
just finding the source of the interrupt, but rather aids in decoding what
the interrupt means.

Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-08-13 20:54:50 +00:00
dann frazier 243066bad7 watchdog: hpwdt (9/12): hpwdt_pretimeout reorganization
Reorganize this function to remove excess indentation and highlight
the single return code. (No functional change).

Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-08-13 20:54:48 +00:00
dann frazier aae67f3602 watchdog: hpwdt (8/12): implement WDIOC_GETTIMELEFT
Let applications check the amount of time left before the watchdog will fire.

Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-08-13 20:54:46 +00:00
dann frazier 6f681c2eab watchdog: hpwdt (7/12): allow full range of timer values supported by hardware
The hpwdt timer is a 16 bit value with 128ms resolution.
Let applications use this entire range.

Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-08-13 20:54:42 +00:00
dann frazier e802e32d2b watchdog: hpwdt (6/12): Introduce SECS_TO_TICKS() macro
Define a macro to convert from seconds to timer ticks.

Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-08-13 20:54:39 +00:00
dann frazier 6b7f3d5321 watchdog: hpwdt (5/12): Make x86 assembly ifdef guard more strict
The 32-bit assembly is guarded by an #ifndef CONFIG_X86_64. Kconfig prevents
us from building this driver on !X86, so that happens to suffice - but we
should really lock it down to #ifdef CONFIG_X86_32.

Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-08-13 20:54:37 +00:00
dann frazier 36e3ff44ce watchdog: hpwdt (4/12): Despecificate driver from iLO2
This driver supports both iLO2 and iLO3, but our user-visible strings
currently only reference iLO2. Let's just call it "iLO2+" to avoid having
to update strings for each iLO generation. This driver doesn't support
iLO ASICs prior to iLO2, but that is sufficiently explained in Kconfig.

Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-08-13 20:54:35 +00:00
dann frazier 923410d0bf watchdog: hpwdt (3/12): Group NMI sourcing specific items together
* Group together includes specific to NMI sourcing
* Group defines only used by NMI sourcing together
* Group declarations specific to NMI sourcing together

This gives a clean seperation of watchdog specific items and
NMI sourcing specific items (which is needed for making it
possible to build hpwdt without the NMI functionality).

Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-08-13 20:54:31 +00:00
dann frazier 550d299eeb watchdog: hpwdt (2/12): Group options that affect watchdog behavior together
Reorganization only.

Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-08-13 20:54:27 +00:00
dann frazier a52e6d181d watchdog: hpwdt (1/12): clean-up include-files.
* remove unnecessary includes
* We use a spinlock, but lacked the include
* We need bitops.h for test_and_set_bit/clear_bit

Signed-off-by: dann frazier <dannf@hp.com>
Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-08-13 20:54:24 +00:00
Brian Norris 84c4f46d9c mtd/nand_ids: Fix buswidth
The buswidth for chips of ID 0xD7 is x8, not x16.
This was my previous typo.

Signed-off-by: Brian Norris <norris@broadcom.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-13 21:11:54 +01:00
Daniel Mack b84ae4a140 Input: fix faulty XXinput_* calls
They've been introduced by 987a6c02 ("Input: switch to input_abs_*()
access functions") and they appear to be some kind of debug left-over.

[Dmitry Torokhov: these are my fault - I added XX prefixes in places where
 I wanted to do additional review of the code but failed to actually do
 that in these particular instances.]

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-13 12:03:24 -07:00
Linus Torvalds 2be1f3a73d Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
  [S390] partitions: fix build error in ibm partition detection code
  [S390] appldata: fix dev_get_stats 64 bit conversion
  [S390] wire up prlimit64 and fanotify* syscalls
  [S390] zcrypt: fix Kconfig dependencies
  [S390] sys_personality: follow u_long to unsigned int conversion
  [S390] dasd: fix format string types
2010-08-13 10:54:04 -07:00
Maxim Levitsky 6ccf15a1a7 ath5k: disable ASPM L0s for all cards
Atheros PCIe wireless cards handled by ath5k do require L0s disabled.
For distributions shipping with CONFIG_PCIEASPM (this will be enabled
by default in the future in 2.6.36) this will also mean both L1 and L0s
will be disabled when a pre 1.1 PCIe device is detected. We do know L1
works correctly even for all ath5k pre 1.1 PCIe devices though but cannot
currently undue the effect of a blacklist, for details you can read
pcie_aspm_sanity_check() and see how it adjusts the device link
capability.

It may be possible in the future to implement some PCI API to allow
drivers to override blacklists for pre 1.1 PCIe but for now it is
best to accept that both L0s and L1 will be disabled completely for
distributions shipping with CONFIG_PCIEASPM rather than having this
issue present. Motivation for adding this new API will be to help
with power consumption for some of these devices.

Example of issues you'd see:

  - On the Acer Aspire One (AOA150, Atheros Communications Inc. AR5001
    Wireless Network Adapter [168c:001c] (rev 01)) doesn't work well
    with ASPM enabled, the card will eventually stall on heavy traffic
    with often 'unsupported jumbo' warnings appearing. Disabling
    ASPM L0s in ath5k fixes these problems.

  - On the same card you would see a storm of RXORN interrupts
    even though medium is idle.

Credit for root causing and fixing the bug goes to Jussi Kivilinna.

Cc: David Quan <David.Quan@atheros.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Tim Gardner <tim.gardner@canonical.com>
Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: stable@kernel.org
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-13 13:46:20 -04:00
Rajkumar Manoharan ca6cff1f80 ath9k_htc: load proper firmware for device ID 7015
This patch handles the firmware loading properly
for device ID 7015.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-13 13:46:20 -04:00
Yuri Kululin fe0dbcc9d2 wl1251: fix trigger scan timeout usage
Use appropriate command (CMD_TRIGGER_SCAN_TO) instead of scan command
(CMD_SCAN) to configure trigger scan timeout.

This was broken in commit 3a98c30f3e.

This fix address the bug reported here:

https://bugzilla.kernel.org/show_bug.cgi?id=16554

Cc: stable@kernel.org
Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
Signed-off-by: Yuri Kululin <ext-yuri.kululin@nokia.com>
Acked-by: Kalle Valo <kvalo@adurom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-13 13:46:19 -04:00
Vivek Natarajan 71ba186c12 ath9k_htc: Fix disconnect issue in HT40 mode.
Some APs advertise that they may be HT40 capable in the capabilites
but the current operating channel configuration may be only HT20.
This causes disconnection as ath9k_htc sets WLAN_RC_40_FLAG despite
the AP operating in HT20 mode.
Hence set this flag only if the current channel configuration
is HT40 enabled.

Cc: stable@kernel.org
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-13 13:46:19 -04:00
Linus Torvalds 1547ac893a Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  V4L/DVB: v4l2-ctrls.c: needs to include slab.h
  V4L/DVB: fix Kconfig to depends on VIDEO_IR
  V4L/DVB: Fix IR_CORE dependencies
2010-08-13 10:44:24 -07:00
Linus Torvalds 2f2c779583 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (30 commits)
  ctcm: rename READ/WRITE defines to avoid redefinitions
  claw: rename READ/WRITE defines to avoid redefinitions
  phylib: available for any speed ethernet
  can: add limit for nframes and clean up signed/unsigned variables
  pkt_sched: Check .walk and .leaf class handlers
  pkt_sched: Fix sch_sfq vs tc_modify_qdisc oops
  caif-spi: Bugfix SPI_DATA_POS settings were inverted.
  caif: Bugfix - Increase default headroom size for control channel.
  net: make netpoll_rx return bool for !CONFIG_NETPOLL
  Bluetooth: Use 3-DH5 payload size for default ERTM max PDU size
  Bluetooth: Fix incorrect setting of remote_tx_win for L2CAP ERTM
  Bluetooth: Change default L2CAP ERTM retransmit timeout
  Bluetooth: Fix endianness issue with L2CAP MPS configuration
  net: Use NET_XMIT_SUCCESS where possible.
  isdn: mISDN: call pci_disable_device() if pci_probe() failed
  isdn: avm: call pci_disable_device() if pci_probe() failed
  isdn: avm: call pci_disable_device() if pci_probe() failed
  usbnet: rx_submit() should return an error code.
  pkt_sched: Add some basic qdisc class ops verification. Was: [PATCH] sfq: add dummy bind/unbind handles
  pkt_sched: sch_sfq: Add dummy unbind_tcf and put handles. Was: [PATCH] sfq: add dummy bind/unbind handles
  ...
2010-08-13 10:38:12 -07:00
Jiri Kosina 9c9e54a8df HID: hiddev: fix memory corruption due to invalid intfdata
Commit bd25f4dd69 ("HID: hiddev: use usb_find_interface,
get rid of BKL") introduced using of private intfdata in hiddev for
purpose of storing hiddev pointer.

This is a problem, because intf pointer is already being set to struct
hid_device pointer by HID core. This obviously lead to memory corruptions
at device disconnect time, such as

WARNING: at lib/kobject.c:595 kobject_put+0x37/0x4b()
kobject: '(null)' (ffff88011e9cd898): is not initialized, yet kobject_put() is being called.

Convert hiddev into accessing hiddev through struct hid_device which is
in intfdata already.

Reported-and-tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Reported-and-tested-by: Heinz Diehl <htd@fritha.org>
Reported-and-tested-by: Alan Ott <alan@signal11.us>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-08-13 12:19:45 +02:00
Chris Ball 7032269e87 HID: hiddev: protect against disconnect/NULL-dereference race
One of our users reports consistently hitting a NULL dereference that
resolves to the "hid_to_usb_dev(hid);" call in hiddev_ioctl(), when
disconnecting a Lego WeDo USB HID device from an OLPC XO running
Scratch software.  There's a FIXME comment and a guard against the
dereference, but that happens farther down the function than the
initial dereference does.

This patch moves the call to be below the guard, and the user reports
that it fixes the problem for him.  OLPC bug report:
http://dev.laptop.org/ticket/10174

Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-08-13 11:19:24 +02:00
Heiko Carstens 57a4955f13 [S390] zcrypt: fix Kconfig dependencies
warning: (ZCRYPT && CRYPTO && CRYPTO_HW && S390 && ZCRYPT=y) selects
ZCRYPT_MONOLITHIC which has unmet direct dependencies (ZCRYPT=m)

ZCRYPT_MONOLITHIC should not depend on ZCRYPT="m" when it gets
selected if ZCRYPT="y".

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2010-08-13 10:06:54 +02:00
Heiko Carstens 625c94df22 [S390] dasd: fix format string types
Get rid of these warnings:

drivers/s390/block/dasd.c: In function '__dasd_device_check_expire':
drivers/s390/block/dasd.c:1330: warning: format '%i' expects type 'int', but argument 4 has type 'long unsigned int'
drivers/s390/block/dasd.c:1337: warning: format '%i' expects type 'int', but argument 4 has type 'long unsigned int'

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2010-08-13 10:06:54 +02:00
David Woodhouse 54b9b308fa Call acpi_video_register() in intel_opregion_init() failure path
If i915 opregion is present, the acpi_video driver doesn't register
itself immediately; it defers that until the i915 opregion code is done.
But if that *fails*, the acpi_video driver was never getting registered.
And thus I have no backlight support on my Lenovo IdeaPad S10-3.

Call acpi_video_register() on the failure path, and it works again.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Matthew Garrett <mjg@redhat.com>
2010-08-13 01:10:10 +01:00
Ursula Braun 3c09e2647b ctcm: rename READ/WRITE defines to avoid redefinitions
READ/WRITE seems to be a bit too generic for defines in a device
driver. Just rename them to CTCM_READ/CTCM_WRITE to avoid warnings.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-08-12 16:04:23 -07:00
Heiko Carstens 319cb083cc claw: rename READ/WRITE defines to avoid redefinitions
READ/WRITE seems to be a bit too generic for defines in a device driver.
Just rename them to READ_CHANNEL/WRITE_CHANNEL which should suffice.

Fixes this:

In file included from drivers/s390/net/claw.c:93:
drivers/s390/net/claw.h:78:1: warning: "WRITE" redefined
In file included from /home2/heicarst/linux-2.6/arch/s390/include/asm/debug.h:12,
                 from drivers/s390/net/claw.c:68:
include/linux/fs.h:156:1: warning: this is the location of the previous definition

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-08-12 16:04:22 -07:00
Randy Dunlap 2b80163c39 V4L/DVB: v4l2-ctrls.c: needs to include slab.h
v4l2-ctrls.c needs to include slab.h to prevent build errors:

drivers/media/video/v4l2-ctrls.c:766: error: implicit declaration of function 'kzalloc'
drivers/media/video/v4l2-ctrls.c:786: error: implicit declaration of function 'kfree'
drivers/media/video/v4l2-ctrls.c:1528: error: implicit declaration of function 'kmalloc'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-12 15:08:05 -03:00
Mauro Carvalho Chehab 361be7b1d0 V4L/DVB: fix Kconfig to depends on VIDEO_IR
warning: (VIDEO_BT848 && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_DEV && PCI && I2C && VIDEO_V4L2 && INPUT || VIDEO_SAA7134 && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && VIDEO_DEV && PCI && I2C && INPUT || VIDEO_CX88 && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && VIDEO_DEV && PCI && I2C && INPUT || VIDEO_IVTV && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && PCI && I2C && INPUT || VIDEO_CX18 && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && DVB_CORE && PCI && I2C && EXPERIMENTAL && INPUT || VIDEO_EM28XX && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && V4L_USB_DRIVERS && USB && VIDEO_DEV && I2C && INPUT || VIDEO_TLG2300 && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && V4L_USB_DRIVERS && USB && VIDEO_DEV && I2C && INPUT && SND && DVB_CORE || VIDEO_CX231XX && MEDIA_SUPPORT && VIDEO_CAPTURE_DRIVERS && VIDEO_V4L2 && V4L_USB_DRIVERS && USB && VIDEO_DEV && I2C && INPUT || DVB_BUDGET_CI && MEDIA_SUPPORT && DVB_CAPTURE_DRIVERS && DVB_CORE && DVB_BUDGET_CORE && I2C && INPUT || DVB_DM1105 && MEDIA_SUPPORT && DVB_CAPTURE_DRIVERS && DVB_CORE && PCI && I2C && INPUT || VIDEO_GO7007 && STAGING && !STAGING_EXCLUDE_BUILD && VIDEO_DEV && PCI && I2C && INPUT && SND || VIDEO_CX25821 && STAGING && !STAGING_EXCLUDE_BUILD && DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT) selects VIDEO_IR which has unmet direct dependencies (IR_CORE)

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-12 15:07:57 -03:00
Mauro Carvalho Chehab cfec93f769 V4L/DVB: Fix IR_CORE dependencies
As pointed by Randy Dunlap <randy.dunlap@oracle.com>:
> ERROR: "ir_keydown" [drivers/media/video/ir-kbd-i2c.ko] undefined!
> ERROR: "__ir_input_register" [drivers/media/video/ir-kbd-i2c.ko] undefined!
> ERROR: "get_rc_map" [drivers/media/video/ir-kbd-i2c.ko] undefined!
> ERROR: "ir_input_unregister" [drivers/media/video/ir-kbd-i2c.ko] undefined!
> ERROR: "get_rc_map" [drivers/media/video/cx88/cx88xx.ko] undefined!
> ERROR: "ir_repeat" [drivers/media/video/cx88/cx88xx.ko] undefined!
> ERROR: "ir_input_unregister" [drivers/media/video/cx88/cx88xx.ko] undefined!
> ERROR: "ir_keydown" [drivers/media/video/cx88/cx88xx.ko] undefined!
> ERROR: "__ir_input_register" [drivers/media/video/cx88/cx88xx.ko] undefined!
> ERROR: "get_rc_map" [drivers/media/video/bt8xx/bttv.ko] undefined!
> ERROR: "ir_input_unregister" [drivers/media/video/bt8xx/bttv.ko] undefined!
> ERROR: "__ir_input_register" [drivers/media/video/bt8xx/bttv.ko] undefined!
> ERROR: "ir_g_keycode_from_table" [drivers/media/IR/ir-common.ko] undefined!
>
>
> #5101:
> (.text+0x8306e2): undefined reference to `ir_core_debug'
> (.text+0x830729): undefined reference to `ir_core_debug'
> ir-functions.c:(.text+0x830906): undefined reference to `ir_core_debug'
> (.text+0x8309d8): undefined reference to `ir_g_keycode_from_table'
> (.text+0x830acf): undefined reference to `ir_core_debug'
> (.text+0x830b92): undefined reference to `ir_core_debug'
> (.text+0x830bef): undefined reference to `ir_core_debug'
> (.text+0x830c6a): undefined reference to `ir_core_debug'
> (.text+0x830cf7): undefined reference to `ir_core_debug'
> budget-ci.c:(.text+0x89f5c8): undefined reference to `ir_keydown'
> budget-ci.c:(.text+0x8a0c58): undefined reference to `get_rc_map'
> budget-ci.c:(.text+0x8a0c80): undefined reference to `__ir_input_register'
> budget-ci.c:(.text+0x8a0ee0): undefined reference to `get_rc_map'
> budget-ci.c:(.text+0x8a11cd): undefined reference to `ir_input_unregister'
> (.text+0x8a8adb): undefined reference to `ir_input_unregister'
> dvb-usb-remote.c:(.text+0x8a9188): undefined reference to `get_rc_map'
> dvb-usb-remote.c:(.text+0x8a91b1): undefined reference to `__ir_input_register'
> dvb-usb-remote.c:(.text+0x8a9238): undefined reference to `get_rc_map'
> dib0700_core.c:(.text+0x8b04ca): undefined reference to `ir_keydown'
> dib0700_devices.c:(.text+0x8b2ea8): undefined reference to `ir_keydown'
> dib0700_devices.c:(.text+0x8b2ef0): undefined reference to `ir_keydown'

Those breakages seem to be caused by two bad things at IR_CORE Kconfig:

1) cx23885 is using select for IR_CORE;
2) the dvb-usb and sms dependency for IR_CORE were missing.

While here, allow users to un-select IR.

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-12 15:07:48 -03:00
Linus Torvalds 8357422d4b Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: (33 commits)
  dm mpath: support discard
  dm stripe: support discards
  dm: split discard requests on target boundaries
  dm stripe: optimize sector division
  dm stripe: move sector translation to a function
  dm: error return error for discards
  dm delay: support discard
  dm: zero silently drop discards
  dm: use dm_target_offset macro
  dm: factor out max_io_len_target_boundary
  dm: use common __issue_target_request for flush and discard support
  dm: linear support discard
  dm crypt: simplify crypt_ctr
  dm crypt: simplify crypt_config destruction logic
  dm: allow autoloading of dm mod
  dm: rename map_info flush_request to target_request_nr
  dm ioctl: refactor dm_table_complete
  dm snapshot: implement merge
  dm: do not initialise full request queue when bio based
  dm ioctl: make bio or request based device type immutable
  ...
2010-08-12 10:16:46 -07:00
Linus Torvalds ce4327d372 Merge branch 'msm-core' of git://codeaurora.org/quic/kernel/dwalker/linux-msm
* 'msm-core' of git://codeaurora.org/quic/kernel/dwalker/linux-msm:
  msm: mmc: Add msm prefix to platform data structure
  msm: trout: Remove extern declaration from source file
  arm: msm: Fix section mismatch in smd.c.
  arm: msm: trout add mmc support
  arm: msm: trout: add trout specific gpio interrupts
  arm: msm: remove unused #include <linux/version.h>
2010-08-12 10:07:32 -07:00
Linus Torvalds 1c00650c23 Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c: I2C bus multiplexer driver pca954x
  i2c: Multiplexed I2C bus core support
  i2c: Use a separate mutex for userspace client lists
  i2c: Make i2c_default_probe self-sufficient
  i2c: Drop dummy variable
  i2c: Move adapter locking helpers to i2c-core
  V4L/DVB: Use custom I2C probing function mechanism
  i2c: Add support for custom probe function
  i2c-dev: Use memdup_user
  i2c-dev: Remove unnecessary kmalloc casts
2010-08-12 10:06:29 -07:00
Linus Torvalds 26df0766a7 Merge branch 'params' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* 'params' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (22 commits)
  param: don't deref arg in __same_type() checks
  param: update drivers/acpi/debug.c to new scheme
  param: use module_param in drivers/message/fusion/mptbase.c
  ide: use module_param_named rather than module_param_call
  param: update drivers/char/ipmi/ipmi_watchdog.c to new scheme
  param: lock if_sdio's lbs_helper_name and lbs_fw_name against sysfs changes.
  param: lock myri10ge_fw_name against sysfs changes.
  param: simple locking for sysfs-writable charp parameters
  param: remove unnecessary writable charp
  param: add kerneldoc to moduleparam.h
  param: locking for kernel parameters
  param: make param sections const.
  param: use free hook for charp (fix leak of charp parameters)
  param: add a free hook to kernel_param_ops.
  param: silence .init.text references from param ops
  Add param ops struct for hvc_iucv driver.
  nfs: update for module_param_named API change
  AppArmor: update for module_param_named API change
  param: use ops in struct kernel_param, rather than get and set fns directly
  param: move the EXPORT_SYMBOL to after the definitions.
  ...
2010-08-12 10:01:59 -07:00
Linus Torvalds 580287628c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: (22 commits)
  regulator: Remove default DEBUG define from TPS6586x
  regulator: tps6507x - add missing platform_set_drvdata in tps6507x_pmic_probe
  regulator: tps6586x - add regulator_unregister() in tps6586x_regulator_remove()
  mfd: max8998 - fix incorrect kfree(i2c) in i2c_driver probe callback handler
  regulator: lp3971 - remove unnecessary ret value checking in lp3971_i2c_write()
  regulator: max8660 - fix a memory leak in max8660_remove()
  regulator: max1586 - fix a memory leak in max1586_pmic_remove()
  regulator: Default GPIO controlled WM8994 regulators to disabled
  regulator: lp3971 - remove unnecessary ret value checking in lp3971_i2c_write()
  max8998: fix off-by-one value range checking
  regulator: tps6586x: fix millivolt return values and SM2 table
  regulator: tps6586x: add dependancy on MFD_TPS6585x
  regulator: add TPS6586X regulator driver
  regulator: MAX8998: set_voltage bugfix. ramp_up delay and min/max voltage
  regulator: add support for regulators on the ab8500 MFD
  ab8500-mfd: add regulator support to ab8500 mfd device
  tps65023: Allow registering similar TPS65021
  drivers: regulators: depend on MFD_MAX8998
  drivers: regulator: add Maxim 8998 driver
  ISL6271A voltage regulator support.
  ...
2010-08-12 10:01:30 -07:00
Linus Torvalds e83ddb3354 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (40 commits)
  mfd: Fix incorrect kfree(i2c) in wm8994-core i2c_driver probe
  mfd: Fix incorrect kfree(i2c) in wm831x-core i2c_driver probe
  mfd: Fix incorrect kfree(i2c) in tps6507x i2c_driver probe
  mfd: Add TPS6586x driver
  mfd: Use macros instead of some constant magic numbers for menelaus
  mfd: Fix menelaus mmc slot 2 misconfiguration
  mfd: Missing slab.h includes
  mfd: Fix wrong wm8350-core kfree in error path
  mfd: Fix wm8994_device_init() return value
  mfd: Avoid calling platform_device_put() twice in ucb1400 probe error path
  mfd: Annotate tc6387xb probe/remove routines with __devinit/__devexit
  mfd: Fix tc6387xb resource reclaim
  mfd: Fix wrong goto labels for tc6393xb error handling
  mfd: Get rid of now unused mc13783 private header
  hwmon: Don't access struct mc13783 directly from mc13783-adc
  mfd: New mc13783 function exposing flags
  mfd: Check jz4740-adc kmalloc() result
  mfd: Fix jz4740-adc resource reclaim in probe error path
  mfd: Add WM8321 support
  mfd: Add stmpe auto sleep feature
  ...
2010-08-12 10:01:06 -07:00
Linus Torvalds 16bb85bc12 Merge git://git.infradead.org/battery-2.6
* git://git.infradead.org/battery-2.6:
  intel_mid_battery: Fix battery scaling
  intel_mid_battery: Fix the argument order to intel_scu_ipc_command
  olpc_battery: Fix build failure caused by sysfs changes
  Add s3c-adc-battery driver
  Intel MID platform battery driver

Fix up trivial conflicts (battery drivers added from different branches)
in drivers/power/{Kconfig,Makefile}
2010-08-12 09:58:33 -07:00
Linus Torvalds aa9f56b66d Merge branch 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (55 commits)
  io-mapping: move asm include inside the config option
  vgaarb: drop vga.h include
  drm/radeon: Add probing of clocks from device-tree
  drm/radeon: drop old and broken mesa warning
  drm/radeon: Fix pci_map_page() error checking
  drm: Remove count_lock for calling lastclose() after 58474713 (v2)
  drm/radeon/kms: allow FG_ALPHA_VALUE on r5xx
  drm/radeon/kms: another r6xx/r7xx CS checker fix
  DRM: Replace kmalloc/memset combos with kzalloc
  drm: expand gamma_set
  drm/edid: Split mode lists out to their own header for readability
  drm/edid: Rewrite mode parse to use the generic detailed block walk
  drm/edid: Add detailed block walk for VTB extensions
  drm/edid: Add detailed block walk for CEA extensions
  drm: Remove unused fields from drm_display_info
  drm: Use ENOENT consistently for the error return for an unmatched handle.
  drm/radeon/kms: mark 3D power states as performance
  drm: Only set DPMS once on the CRTC not after every encoder.
  drm/radeon/kms: add additional quirk for Acer rv620 laptop
  drm: Propagate error code from fb_create()
  ...

Fix up trivial conflicts in drivers/gpu/drm/drm_edid.c
2010-08-12 09:21:39 -07:00
Linus Torvalds 58d4ea65b9 Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6:
  mmc_spi: Fix unterminated of_match_table
  of/sparc: fix build regression from of_device changes
  of/device: Replace struct of_device with struct platform_device
2010-08-12 09:11:31 -07:00
Linus Torvalds 26f0cf9181 Merge branch 'stable/xen-swiotlb-0.8.6' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
* 'stable/xen-swiotlb-0.8.6' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  x86: Detect whether we should use Xen SWIOTLB.
  pci-swiotlb-xen: Add glue code to setup dma_ops utilizing xen_swiotlb_* functions.
  swiotlb-xen: SWIOTLB library for Xen PV guest with PCI passthrough.
  xen/mmu: inhibit vmap aliases rather than trying to clear them out
  vmap: add flag to allow lazy unmap to be disabled at runtime
  xen: Add xen_create_contiguous_region
  xen: Rename the balloon lock
  xen: Allow unprivileged Xen domains to create iomap pages
  xen: use _PAGE_IOMAP in ioremap to do machine mappings

Fix up trivial conflicts (adding both xen swiotlb and xen pci platform
driver setup close to each other) in drivers/xen/{Kconfig,Makefile} and
include/xen/xen-ops.h
2010-08-12 09:09:41 -07:00
Maxim Levitsky d862b13bc8 memstick: fix hangs on unexpected device removal in mspro_blk
mspro_block_remove() is called from detect thread that first calls the
mspro_block_stop(), which stops the request queue.  If we call
del_gendisk() with the queue stopped we get a deadlock.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-12 08:43:31 -07:00
Maxim Levitsky 21fd0495ea memstick: init sysfs attributes
Otherwise lockdep complains.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-12 08:43:31 -07:00
Adrian Hunter fec4dcce23 mmc_test: fix large memory allocation
- Fix mmc_test_alloc_mem.

- Use nr_free_buffer_pages() instead of sysinfo.totalram to determine
  total lowmem pages.

- Change variables containing memory sizes to unsigned long.

- Limit maximum test area size to 128MiB because that is the maximum MMC
  high capacity erase size (the maxmium SD allocation unit size is just
  4MiB)

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-12 08:43:31 -07:00
Adrian Hunter 64f7120d89 mmc_test: add performance tests
mmc_test provides tests aimed at testing SD/MMC hosts.  This patch adds
performance tests.

It is advantageous to have performance tests in a kernel
module like mmc_test for the following reasons:
	- transfer times can be measured very accurately
	- arbitrarily large transfers are possible
	- the effect of contiguous vs scattered pages
	can be determined

The new tests are:

	23. Best-case read performance
	24. Best-case write performance
	25. Best-case read performance into scattered pages
	26. Best-case write performance from scattered pages
	27. Single read performance by transfer size
	28. Single write performance by transfer size
	29. Single trim performance by transfer size
	30. Consecutive read performance by transfer size
	31. Consecutive write performance by transfer size
	32. Consecutive trim performance by transfer size

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-12 08:43:30 -07:00
Adrian Hunter 4980454868 mmc_block: add support for secure discard
Secure discard is implemented by Secure Trim if the discard is unaligned
or Secure Erase otherwise.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Jens Axboe <axboe@kernel.dk>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ben Gardiner <bengardiner@nanometrics.ca>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-12 08:43:30 -07:00
Adrian Hunter 93caf8e69e omap_hsmmc: add erase capability
Disable the data (busy) timeout for erases and set the MMC_CAP_ERASE
capability.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Jens Axboe <axboe@kernel.dk>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ben Gardiner <bengardiner@nanometrics.ca>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-12 08:43:30 -07:00
Adrian Hunter bd788c9665 mmc_block: add discard support
Enable MMC to service discard requests.  In the case of SD and MMC cards
that do not support trim, discards become erases.  In the case of cards
(MMC) that only allow erases in multiples of erase group size, round to
the nearest completely discarded erase group.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Jens Axboe <axboe@kernel.dk>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ben Gardiner <bengardiner@nanometrics.ca>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-12 08:43:30 -07:00
Adrian Hunter dfe86cba76 mmc: add erase, secure erase, trim and secure trim operations
SD/MMC cards tend to support an erase operation.  In addition, eMMC v4.4
cards can support secure erase, trim and secure trim operations that are
all variants of the basic erase command.

SD/MMC device attributes "erase_size" and "preferred_erase_size" have been
added.

"erase_size" is the minimum size, in bytes, of an erase operation.  For
MMC, "erase_size" is the erase group size reported by the card.  Note that
"erase_size" does not apply to trim or secure trim operations where the
minimum size is always one 512 byte sector.  For SD, "erase_size" is 512
if the card is block-addressed, 0 otherwise.

SD/MMC cards can erase an arbitrarily large area up to and
including the whole card.  When erasing a large area it may
be desirable to do it in smaller chunks for three reasons:

    1. A single erase command will make all other I/O on the card
       wait.  This is not a problem if the whole card is being erased, but
       erasing one partition will make I/O for another partition on the
       same card wait for the duration of the erase - which could be a
       several minutes.

    2. To be able to inform the user of erase progress.

    3. The erase timeout becomes too large to be very useful.
       Because the erase timeout contains a margin which is multiplied by
       the size of the erase area, the value can end up being several
       minutes for large areas.

"erase_size" is not the most efficient unit to erase (especially for SD
where it is just one sector), hence "preferred_erase_size" provides a good
chunk size for erasing large areas.

For MMC, "preferred_erase_size" is the high-capacity erase size if a card
specifies one, otherwise it is based on the capacity of the card.

For SD, "preferred_erase_size" is the allocation unit size specified by
the card.

"preferred_erase_size" is in bytes.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Jens Axboe <axboe@kernel.dk>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ben Gardiner <bengardiner@nanometrics.ca>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-12 08:43:30 -07:00
Randy Dunlap 7b95809045 pc8736x_gpio: depends on X86_32
Fix kconfig dependency warning for PC8736x_GPIO by restricting it to
X86_32.

  warning: (SCx200_GPIO && SCx200 || PC8736x_GPIO && X86) selects NSC_GPIO which has unmet direct dependencies (X86_32)

NSC_GPIO is X86_32 only.  The other driver (SCx200_GPIO) that selects
NSC_GPIO is X86_32 only (indirectly, since SCx200 depends on X86_32), so
limit this driver also.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Jordan Crouse <jordan.crouse@amd.com>
Cc: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-12 08:43:29 -07:00
Thomas Gleixner 0a7992c908 acpi: fix bogus preemption logic
The ACPI_PREEMPTION_POINT() logic was introduced in commit 8bd108d
(ACPICA: add preemption point after each opcode parse).  The follow up
commits abe1dfab6, 138d15692, c084ca70 tried to fix the preemption logic
back and forth, but nobody noticed that the usage of
in_atomic_preempt_off() in that context is wrong.

The check which guards the call of cond_resched() is:

    if (!in_atomic_preempt_off() && !irqs_disabled())

in_atomic_preempt_off() is not intended for general use as the comment
above the macro definition clearly says:

 * Check whether we were atomic before we did preempt_disable():
 * (used by the scheduler, *after* releasing the kernel lock)

On a CONFIG_PREEMPT=n kernel the usage of in_atomic_preempt_off() works by
accident, but with CONFIG_PREEMPT=y it's just broken.

The whole purpose of the ACPI_PREEMPTION_POINT() is to reduce the latency
on a CONFIG_PREEMPT=n kernel, so make ACPI_PREEMPTION_POINT() depend on
CONFIG_PREEMPT=n and remove the in_atomic_preempt_off() check.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16210

[akpm@linux-foundation.org: fix build]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Len Brown <lenb@kernel.org>
Cc: Francois Valenduc <francois.valenduc@tvcablenet.be>
Cc: Lin Ming <ming.m.lin@intel.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-12 08:43:29 -07:00
Dan Carpenter f78ec6b2f3 mtd/m25p80: fix test for end of loop
"plat_id" is always non-NULL here.  There is a zero element on the end
of the m25p_ids[] array and if we hit the end of the loop then plat_id
points to that.

This would lead to a NULL pointer dereference later on in the function.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-12 12:31:39 +01:00
Dan Carpenter b06cd21e2f mtd/m25p80: retlen is never NULL
This is just a cleanup, it doesn't fix any bugs.

These functions all check retlen inconsistently and it generates a
warning in Smatch (http://smatch.sf.net).  If retlen were ever NULL it
would cause an oops and the code has been this way since 2006 so someone
would have complained.  Also I looked at other places that implemented
the mtd read and write functions and they dereference retlen without
checking.

I removed the checks.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-12 12:26:22 +01:00
Marek Vasut 01cd2ababd gen_nand: Test if nr_chips field is valid
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-12 12:17:36 +01:00
Chuanxiao Dong 5eab6aaaaf nand/denali: move all hardware initialization work to denali_hw_init
All hardware initialization will be done in denali_hw_init before
irq handler registered
Change mtd name from "DENALI NAND" to be "denali-nand" since whitespace in
name can cause problems if we use cmdlinepart

Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-12 11:10:40 +01:00
Chuanxiao Dong 7d8a26fd22 nand/denali: Add a page check in denali_read_page & denali_read_page_raw
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-12 11:10:40 +01:00
Chuanxiao Dong 628bfd4164 nand/denali: use cpu_relax() while waiting for hardware interrupt
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-12 11:10:39 +01:00
Chuanxiao Dong f0bc0c778f nand/denali: change read_status function method
In mtd->write, Denali controller will use MODE_11 mode to read
NAND flash status, then return back to MODE_1O mode to do page
write.
Here comes a bug for this kind of using, sometimes controller will
not write data to NAND and just return a good interrupt to tell
driver writing work is done. The data in this page is all 0xff and
this page can not be written again. The reason is unknow.

So read Denali controller register WRITE_PROTECT to get NAND status
instead.

Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-12 11:10:37 +01:00
Chuanxiao Dong b292c341e2 nand/denali: Fixed check patch warnings
waring: no space for starting a line

Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-12 11:10:36 +01:00
Axel Lin d0a1169396 mfd: Fix incorrect kfree(i2c) in wm8994-core i2c_driver probe
The i2c_client received in probe() should not be kfree()'d.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:14 +02:00
Axel Lin a2cddb6e41 mfd: Fix incorrect kfree(i2c) in wm831x-core i2c_driver probe
The i2c_client received in probe() should not be kfree()'d.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:13 +02:00
Axel Lin 04a064236d mfd: Fix incorrect kfree(i2c) in tps6507x i2c_driver probe
The i2c_client received in probe() should not be kfree()'d.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:12 +02:00
Mike Rapoport c6c1933263 mfd: Add TPS6586x driver
Add mfd core driver for TPS6586x PMICs family.
The driver provides I/O access for the sub-device drivers and performs
regstration of the sub-devices based on the platform requirements.
In addition it implements GPIOlib interface for the chip GPIOs.

TODO:
        - add interrupt support
        - add platform data for PWM, backlight leds and charger

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:12 +02:00
Jarkko Nikula 1c888e2e38 mfd: Use macros instead of some constant magic numbers for menelaus
This patch is originally done by Carlos Eduardo Aguiar. Original fix is
commit 3305829b2816072b9c8ed01374b205ae4de74027 in
git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git

Author modified the fix for mainline version of menelaus.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:11 +02:00
Jarkko Nikula 214044b44a mfd: Fix menelaus mmc slot 2 misconfiguration
We are modifying register value instead of return value.

This fix is originally done by Carlos Eduardo Aguiar. Original fix is
commit bb4e91722e29efe31587d2cc664b6def645aecd9 in
git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git

Author modified the fix for mainline version of menelaus.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:10 +02:00
David Miller 8102bad2c0 mfd: Missing slab.h includes
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:10 +02:00
Axel Lin 8c46cf30f7 mfd: Fix wrong wm8350-core kfree in error path
This patch includes below fixes:
1. fix wm8350_create_cache error path
   make sure wm8350->reg_cache is freed in error path.
2. fix wm8350_device_init error path
   no need to kfree(wm8350->reg_cache) in the case of goto out.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:08 +02:00
Axel Lin fccbd21f33 mfd: Fix wm8994_device_init() return value
wm8994_device_init() will return 0 in the case of kzalloc fail
in current implementation.
This patch fixes the return value.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:07 +02:00
Axel Lin ef256176c7 mfd: Avoid calling platform_device_put() twice in ucb1400 probe error path
In the case of goto err2, what we want is to call
platform_device_del() instead of platform_device_unregister().
Otherwise, we call platform_device_put() twice.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:06 +02:00
Axel Lin 288129f35a mfd: Annotate tc6387xb probe/remove routines with __devinit/__devexit
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:06 +02:00
Axel Lin 08b877b80f mfd: Fix tc6387xb resource reclaim
This patch includes below fixes:
1. add a missing iounmap in tc6387xb_probe() error path
2. fix resource reclaim in tc6387xb_remove()

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:05 +02:00
Axel Lin fa6e4b181c mfd: Fix wrong goto labels for tc6393xb error handling
This patch corrects the error handling path.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:05 +02:00
Uwe Kleine-König b6e6d54cab mfd: Get rid of now unused mc13783 private header
This adds all remaining definitions that are used by the core driver
to the .c file.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:04 +02:00
Uwe Kleine-König eaf06ee225 hwmon: Don't access struct mc13783 directly from mc13783-adc
There is a shiny new mc13783 API function that can be used instead.

While at it refactor the code a bit to reduce code duplication a bit.

This removes the last user of <linux/mfd/mc13783-private.h> and so this
include file can go away.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:03 +02:00
Uwe Kleine-König 3b16bb539c mfd: New mc13783 function exposing flags
This is needed for the mc13783-adc driver to decide if a touch screen is
connected.  If so some channels are not available as generic hwmon inputs.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:03 +02:00
Axel Lin 789133b7b4 mfd: Check jz4740-adc kmalloc() result
If kmalloc() fails exit with -ENOMEM.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:02 +02:00
Axel Lin 48736c80e5 mfd: Fix jz4740-adc resource reclaim in probe error path
If mfd_add_devices() fail, we need to relese allocated resources.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:01 +02:00
Mark Brown 889135210b mfd: Add WM8321 support
The WM8321 is a PMIC for low power, high performance applications. From a
software point of view the device is identical to the WM8320, all the
differences between the two devices are visible only in hardware.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:00 +02:00
Sundar R Iyer 5981f4e65c mfd: Add stmpe auto sleep feature
Some STMPE devices support entering sleep mode automatically on a
specified timeout of inactivity on the I2C bus with the host system.

Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:28:00 +02:00
Kulikov Vasiliy 3faeb35ccc touchscreen: Fix sign bug
platform_get_irq_byname() can return negative results, it is not seen to
unsigned ts_irq. Make it signed.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Acked-By: Luotao Fu <l.fu@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:59 +02:00
Hemanth V 31fc03df5d mfd: Add support for TWL6030 PWM
TWL6030 supports PWM (Pulse Width Modulator) which is used
to control charging LED. PWM allows for controlling brightness.
This patch implements the APIs required by leds-pwm driver.

Signed-off-by: Hemanth V <hemanthv@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:59 +02:00
Lars-Peter Clausen 91f4debf5e mfd: Add JZ4740 ADC driver
This patch adds a MFD driver for the JZ4740 ADC unit. The driver is used to
demultiplex IRQs and synchronize access to shared registers between the
battery, hwmon and (future) touchscreen driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:58 +02:00
Mark Brown b12c35e22d gpiolib: Implement set_debounce for WM831x GPIOs
The debounce times are approximate, they can be selected using the two
input functions.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:57 +02:00
Luotao Fu f94add3bd4 input: STMPE touch controller support
This one adds a driver for STMPE touchscreen controllers.
This driver depends on the stmpexxx mfd core driver.

Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:56 +02:00
Rabin Vincent 76f1084531 input: Add STMPE keypad driver
Add an input driver for the keypad on STMPE I/O expanders.  This driver
uses the common support provided by the STMPE MFD driver.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:56 +02:00
Rabin Vincent 03f822f5e5 gpio: Add STMPE GPIO driver
Add support for the GPIOs on STMPE I/O Expanders.

[l.fu@pengutronix.de: fix set direction input]
[l.fu@pengutronix.de: set GPIO alternate function while requesting]
Acked-by: Luotao Fu <l.fu@pengutronix.de>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:55 +02:00
Rabin Vincent 27e34995e1 mfd: Add STMPE I/O Expander support
Add support for the STMPE family of I/O Expanders from
STMicroelectronics.  These devices include upto 24 gpios and a varying
selection of blocks, including PWM, keypad, and touchscreen controllers.
This patch adds the MFD core.

[l.fu@pengutronix.de: fix stmpe811 enable hook]
[l.fu@pengutronix.de: add touchscreen platform data]
Acked-by: Luotao Fu <l.fu@pengutronix.de>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:24 +02:00
Axel Lin d2d272a965 mfd: Properly free t7l66xb clk32k clock source
This patch includes below fixes to properly free clk32k clock source:
1. remove a redundant clk_put in t7l66xb_probe error path
2. add missing clk_disable(t7l66xb->clk32k) and clk_put(t7l66xb->clk32k)
   to properly free the clock source.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:23 +02:00
Samuel Ortiz 15742c8a42 mfd: More verbose MFD Kconfig entry
For people to be able to intellingibly decide if they want to enable MFD
drivers or not, we have to give them a much better description of what they
are.
2010-08-12 11:27:23 +02:00
Mark Brown 3cb46ac058 mfd: Staticise ab3550 register access functions
These are now exported via an ops table rather than referenced
directly and so should be staticised.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:22 +02:00
Julia Lawall e2bde78713 mfd: Fix davinci memory leak
Error handling code following a kmalloc should free the allocated data.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position p1,p2;
expression *ptr != NULL;
@@

x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...x...+> }
(
x->f1 = E
|
 (x->f1 == NULL || ...)
|
 f(...,x->f1,...)
)
...>
(
 return \(0\|<+...x...+>\|ptr\);
|
 return@p2 ...;
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:20 +02:00
Axel Lin 8af5fe3bc5 mfd: properly handle platform_device_add_resources fail in mfd_add_device
platform_device_add_resources may fail, thus add error checking for it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:19 +02:00
Julia Lawall 25fe24f884 mfd: kzalloc doesn't return ERR_PTR
Use !x rather than IS_ERR(x) to test the result of kzalloc.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,E;
@@

x = \(kmalloc\|kzalloc\|kcalloc\)(...)
... when != x = E
- IS_ERR(x)
+ !x
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:19 +02:00
Linus Walleij c0d4010e11 mfd: AB8500 mask off irrelevant bits from the SPI message
The registers on the AB8500 are only 8 bits wide, so the content
of the remaining bits is undefined. Let's mask off the undefined
stuff when returning a register in an SPI read.

Acked-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:18 +02:00
Dan Carpenter eb6e8ddf06 mfd: Fix 88pm860x uninitialized variable and clean up
The original code had a compile warning:
drivers/mfd/88pm860x-core.c:431: warning: ‘ret’ may be used
	uninitialized in this function
It seems like the warning is valid if either pdata or pdata->touch is
NULL.

This patch checks pdata and pdata->touch at the beginning of the
function.  That means everything can be pulled in one indent level.
Now all the statements fit within the 80 character limit.

Also at that point the "use_gpadc" variable isn't needed and removing
it simplifies the logic.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Haojian Zhuang <hzhuang1@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:18 +02:00
Axel Lin d281b80c46 mfd: Fix memory leak in ab3100_otp_probe
In current implementation, there is a memory leak if ab3100_otp_read fail.
And in the case of ab3100_otp_init_debugfs fail, it does not properly remove
sysfs entries.
This patch properly handle above failure cases.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:17 +02:00
Haojian Zhuang 21f1fc3860 mfd: Fix led resource in 88pm860x
Fix typo error in LED resource of 88pm860x.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:17 +02:00
Haojian Zhuang d0f7a6d6d1 mfd: Enable onkey on max8925
Enable onkey feature in max8925 driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:16 +02:00
Randy Dunlap cba86f2e20 phylib: available for any speed ethernet
Several gigabit network drivers (SB1250_MAC, TIGON3, FSL, GIANFAR,
UCC_GETH, MV643XX_ETH, XILINX_LL_TEMAC, S6GMAC, STMMAC_ETH, PASEMI_MAC,
and OCTEON_ETHERNET) select PHYLIB.  These drivers are not under
NET_ETHERNET (10/100 mbit), so this warning is generated (long, irrelevant
parts are omitted):

warning: (NET_DSA && NET && EXPERIMENTAL && NET_ETHERNET && !S390 || ... || SB1250_MAC && NETDEVICES && NETDEV_1000 && SIBYTE_SB1xxx_SOC || TIGON3 && NETDEVICES && NETDEV_1000 && PCI || FSL_PQ_MDIO && NETDEVICES && NETDEV_1000 && FSL_SOC || GIANFAR && NETDEVICES && NETDEV_1000 && FSL_SOC || UCC_GETH && NETDEVICES && NETDEV_1000 && QUICC_ENGINE || MV643XX_ETH && NETDEVICES && NETDEV_1000 && (MV64X60 || PPC32 || PLAT_ORION) || XILINX_LL_TEMAC && NETDEVICES && NETDEV_1000 && (PPC || MICROBLAZE) || S6GMAC && NETDEVICES && NETDEV_1000 && XTENSA_VARIANT_S6000 || STMMAC_ETH && NETDEV_1000 && NETDEVICES && CPU_SUBTYPE_ST40 || PASEMI_MAC && NETDEVICES && NETDEV_10000 && PPC_PASEMI && PCI || OCTEON_ETHERNET && STAGING && !STAGING_EXCLUDE_BUILD && CPU_CAVIUM_OCTEON) selects PHYLIB which has unmet direct dependencies (!S390 && NET_ETHERNET)

PHYLIB is used by non-10/100 mbit ethernet drivers, so change the dependencies
to be NETDEVICES instead of NET_ETHERNET.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-08-11 23:03:50 -07:00
Mike Snitzer 959eb4e559 dm mpath: support discard
Enable discard support in the DM multipath target.

This discard support depends on a few discard-specific fixes to the
block layer's request stacking driver methods.

Discard requests are optional so don't allow a failed discard to trigger
path failures.  If there is a real problem with a given path the
barriers associated with the discard (either before or after the
discard) will cause path failure.  That said, unconditionally passing
discard failures up the stack is not ideal.  This must be fixed once DM
has more information about the nature of the underlying storage failure.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
2010-08-12 04:14:32 +01:00
Mikulas Patocka 7b76ec11fe dm stripe: support discards
The DM core will submit a discard bio to the stripe target for each
stripe in a striped DM device.  The stripe target will determine
stripe-specific portions of the supplied bio to be remapped into
individual (at most 'num_discard_requests' extents).  If a given
stripe-specific discard bio doesn't touch a particular stripe the bio
will be dropped.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:26 +01:00
Mike Snitzer a79245b3e5 dm: split discard requests on target boundaries
Update __clone_and_map_discard to loop across all targets in a DM
device's table when it processes a discard bio.  If a discard crosses a
target boundary it must be split accordingly.

Update __issue_target_requests and __issue_target_request to allow a
cloned discard bio to have a custom start sector and size.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:24 +01:00
Mikulas Patocka c96053b767 dm stripe: optimize sector division
Optimize sector division: If the number of stripes is a power of two,
we can do shift and mask instead of division.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:21 +01:00
Mikulas Patocka 65988525ab dm stripe: move sector translation to a function
Move sector to stripe translation into a function.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:14 +01:00
Mike Snitzer 38e1b257fd dm: error return error for discards
Have the error target respond to a discard request with a hard -EIO
rather than fail the request with -EOPNOTSUPP.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:14 +01:00
Mike Snitzer 3fd5d48027 dm delay: support discard
Enable discard support for the delay target.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:13 +01:00
Mike Snitzer f8facb61b5 dm: zero silently drop discards
Have the zero target silently drop a discard rather than fail the
request with -EOPNOTSUPP.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:12 +01:00
Alasdair G Kergon b441a262e7 dm: use dm_target_offset macro
Use new dm_target_offset() macro to avoid most references to ti->begin
in dm targets.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:11 +01:00
Mike Snitzer 56a67df766 dm: factor out max_io_len_target_boundary
Split max_io_len_target_boundary out of max_io_len so that the discard
support can make use of it without duplicating max_io_len code.

Avoiding max_io_len's split_io logic enables DM's discard support to
submit the entire discard request to a target.  But discards must still
be split on target boundaries.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:10 +01:00
Mike Snitzer 06a426cee9 dm: use common __issue_target_request for flush and discard support
Rename __flush_target to __issue_target_request now that it is used to
issue both flush and discard requests.

Introduce __issue_target_requests as a convenient wrapper to
__issue_target_request 'num_flush_requests' or 'num_discard_requests'
times per target.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:09 +01:00
Mike Snitzer 5ae89a8720 dm: linear support discard
Allow discards to be passed through to linear mappings if at least one
underlying device supports it.  Discards will be forwarded only to
devices that support them.

A target that supports discards should set num_discard_requests to
indicate how many times each discard request must be submitted to it.

Verify table's underlying devices support discards prior to setting the
associated DM device as capable of discards (via QUEUE_FLAG_DISCARD).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Joe Thornber <thornber@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:08 +01:00
Milan Broz 5ebaee6d29 dm crypt: simplify crypt_ctr
Allocate cipher strings indpendently of struct crypt_config and move
cipher parsing and allocation into a separate function to prepare for
supporting the cryptoapi format e.g. "xts(aes)".

No functional change in this patch.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:07 +01:00
Milan Broz 28513fccf0 dm crypt: simplify crypt_config destruction logic
Use just one label and reuse common destructor for crypt target.

Parse remaining argv arguments in logic order.

Also do not ignore error values from IV init and set key functions.

No functional change in this patch except changed return codes
based on above.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:06 +01:00
Peter Rajnoha 7e507eb643 dm: allow autoloading of dm mod
Add devname:mapper/control and MAPPER_CTRL_MINOR module alias
to support dm-mod module autoloading.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Peter Rajnoha <prajnoha@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:05 +01:00
Mike Snitzer 57cba5d365 dm: rename map_info flush_request to target_request_nr
'target_request_nr' is a more generic name that reflects the fact that
it will be used for both flush and discard support.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:04 +01:00
Will Drewry 26803b9f06 dm ioctl: refactor dm_table_complete
This change unifies the various checks and finalization that occurs on a
table prior to use.  By doing so, it allows table construction without
traversing the dm-ioctl interface.

Signed-off-by: Will Drewry <wad@chromium.org>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:03 +01:00
Mikulas Patocka b1d5552838 dm snapshot: implement merge
Implement merge method for the snapshot origin to improve read
performance.

Without merge method, dm asks the upper layers to submit smallest possible
bios --- one page. Submitting such small bios impacts performance negatively
when reading or writing the origin device.

Without this patch, CPU consumption when reading the origin on lvm on md-raid0
was 6 to 12%, with this patch, it drops to 1 to 4%.

Note: in my testing, it actually degraded performance in some settings, I
traced it to Maxtor disks having problems with > 512-sector requests.
Reducing the number of sectors to /sys/block/sd*/queue/max_sectors_kb to
256 fixed the read performance. I think we don't have to care about weird
disks that actually degrade performance because of large requests being
sent to them.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:02 +01:00
Mike Snitzer 4a0b4ddf26 dm: do not initialise full request queue when bio based
Change bio-based mapped devices no longer to have a fully initialized
request_queue (request_fn, elevator, etc).  This means bio-based DM
devices no longer register elevator sysfs attributes ('iosched/' tree
or 'scheduler' other than "none").

In contrast, a request-based DM device will continue to have a full
request_queue and will register elevator sysfs attributes.  Therefore
a user can determine a DM device's type by checking if elevator sysfs
attributes exist.

First allocate a minimalist request_queue structure for a DM device
(needed for both bio and request-based DM).

Initialization of a full request_queue is deferred until it is known
that the DM device is request-based, at the end of the table load
sequence.

Factor DM device's request_queue initialization:
- common to both request-based and bio-based into dm_init_md_queue().
- specific to request-based into dm_init_request_based_queue().

The md->type_lock mutex is used to protect md->queue, in addition to
md->type, during table_load().

A DM device's first table_load will establish the immutable md->type.
But md->queue initialization, based on md->type, may fail at that time
(because blk_init_allocated_queue cannot allocate memory).  Therefore
any subsequent table_load must (re)try dm_setup_md_queue independently of
establishing md->type.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:02 +01:00
Mike Snitzer a5664dad7e dm ioctl: make bio or request based device type immutable
Determine whether a mapped device is bio-based or request-based when
loading its first (inactive) table and don't allow that to be changed
later.

This patch performs different device initialisation in each of the two
cases.  (We don't think it's necessary to add code to support changing
between the two types.)

Allowed md->type transitions:
  DM_TYPE_NONE to DM_TYPE_BIO_BASED
  DM_TYPE_NONE to DM_TYPE_REQUEST_BASED

We now prevent table_load from replacing the inactive table with a
conflicting type of table even after an explicit table_clear.

Introduce 'type_lock' into the struct mapped_device to protect md->type
and to prepare for the next patch that will change the queue
initialization and allocate memory while md->type_lock is held.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>

 drivers/md/dm-ioctl.c    |   15 +++++++++++++++
 drivers/md/dm.c          |   37 ++++++++++++++++++++++++++++++-------
 drivers/md/dm.h          |    5 +++++
 include/linux/dm-ioctl.h |    4 ++--
 4 files changed, 52 insertions(+), 9 deletions(-)
2010-08-12 04:14:01 +01:00
Mikulas Patocka 708e929513 dm: skip second flush on bio unsupported error
When processing barriers, skip the second flush if processing the bio
failed with -EOPNOTSUPP.  This can happen with discard+barrier requests.
If the device doesn't support discard, there would be two useless
SYNCHRONIZE CACHE commands.  The first dm_flush cannot be so easily
optimized out, so we leave it there.

Previously, -EOPNOTSUPP could be received in dec_pending only with empty
barriers and we ignored that error, assuming the device not supporting
cache flushes has cache always consistent.  With the addition of discard
barriers, this -EOPNOTSUPP can also be generated by discards and we
must record it in md->barrier_error for process_barrier.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:14:00 +01:00
Tomohiro Kusumi 87c961cb74 dm snapshot: persistent use define for disk header chunk size
This patch fixes hard-coded value for the size of a chunk that includes
disk header for persistent snapshot. It should be changed to existing
macro NUM_SNAPSHOT_HDR_CHUNKS instead of using hard-coded value 1.

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:13:59 +01:00
Julia Lawall a9c88f2ebc dm crypt: use kstrdup
Use kstrdup when the goal of an allocation is copy a string into the
allocated region.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to;
expression flag,E1,E2;
statement S;
@@

-  to = kmalloc(strlen(from) + 1,flag);
+  to = kstrdup(from, flag);
   ... when != \(from = E1 \| to = E1 \)
   if (to==NULL || ...) S
   ... when != \(from = E2 \| to = E2 \)
-  strcpy(to, from);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:13:58 +01:00
Arnd Bergmann 402ab352c2 dm ioctl: use nonseekable_open
The dm control device does not implement read/write, so it has no use for
seeking.  Using no_llseek prevents falling back to default_llseek, which
requires the BKL.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:13:57 +01:00
Kiyoshi Ueda 3f77316de0 dm: separate device deletion from dm_put
This patch separates the device deletion code from dm_put()
to make sure the deletion happens in the process context.

By this patch, device deletion always occurs in an ioctl (process)
context and dm_put() can be called in interrupt context.
As a result, the request-based dm's bad dm_put() usage pointed out
by Mikulas below disappears.
    http://marc.info/?l=dm-devel&m=126699981019735&w=2

Without this patch, I confirmed there is a case to crash the system:
    dm_put() => dm_table_destroy() => vfree() => BUG_ON(in_interrupt())

Some more backgrounds and details:
In request-based dm, a device opener can remove a mapped_device
while the last request is still completing, because bios in the last
request complete first and then the device opener can close and remove
the mapped_device before the last request completes:
  CPU0                                          CPU1
  =================================================================
  <<INTERRUPT>>
  blk_end_request_all(clone_rq)
    blk_update_request(clone_rq)
      bio_endio(clone_bio) == end_clone_bio
        blk_update_request(orig_rq)
          bio_endio(orig_bio)
                                                <<I/O completed>>
                                                dm_blk_close()
                                                dev_remove()
                                                  dm_put(md)
                                                    <<Free md>>
   blk_finish_request(clone_rq)
     ....
     dm_end_request(clone_rq)
       free_rq_clone(clone_rq)
       blk_end_request_all(orig_rq)
       rq_completed(md)

So request-based dm used dm_get()/dm_put() to hold md for each I/O
until its request completion handling is fully done.
However, the final dm_put() can call the device deletion code which
must not be run in interrupt context and may cause kernel panic.

To solve the problem, this patch moves the device deletion code,
dm_destroy(), to predetermined places that is actually deleting
the mapped_device in ioctl (process) context, and changes dm_put()
just to decrement the reference count of the mapped_device.
By this change, dm_put() can be used in any context and the symmetric
model below is introduced:
    dm_create():  create a mapped_device
    dm_destroy(): destroy a mapped_device
    dm_get():     increment the reference count of a mapped_device
    dm_put():     decrement the reference count of a mapped_device

dm_destroy() waits for all references of the mapped_device to disappear,
then deletes the mapped_device.

dm_destroy() uses active waiting with msleep(1), since deleting
the mapped_device isn't performance-critical task.
And since at this point, nobody opens the mapped_device and no new
reference will be taken, the pending counts are just for racing
completing activity and will eventually decrease to zero.

For the unlikely case of the forced module unload, dm_destroy_immediate(),
which doesn't wait and forcibly deletes the mapped_device, is also
introduced and used in dm_hash_remove_all().  Otherwise, "rmmod -f"
may be stuck and never return.
And now, because the mapped_device is deleted at this point, subsequent
accesses to the mapped_device may cause NULL pointer references.

Cc: stable@kernel.org
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:13:56 +01:00
Kiyoshi Ueda 98f332855e dm ioctl: release _hash_lock between devices in remove_all
This patch changes dm_hash_remove_all() to release _hash_lock when
removing a device.  After removing the device, dm_hash_remove_all()
takes _hash_lock and searches the hash from scratch again.

This patch is a preparation for the next patch, which changes device
deletion code to wait for md reference to be 0.  Without this patch,
the wait in the next patch may cause AB-BA deadlock:
  CPU0                                CPU1
  -----------------------------------------------------------------------
  dm_hash_remove_all()
    down_write(_hash_lock)
                                      table_status()
                                        md = find_device()
                                               dm_get(md)
                                                 <increment md->holders>
                                        dm_get_live_or_inactive_table()
                                          dm_get_inactive_table()
                                            down_write(_hash_lock)
    <in the md deletion code>
      <wait for md->holders to be 0>

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:13:55 +01:00
Kiyoshi Ueda abdc568b05 dm: prevent access to md being deleted
This patch prevents access to mapped_device which is being deleted.

Currently, even after a mapped_device has been removed from the hash,
it could be accessed through idr_find() using minor number.
That could cause a race and NULL pointer reference below:
  CPU0                          CPU1
  ------------------------------------------------------------------
  dev_remove(param)
    down_write(_hash_lock)
    dm_lock_for_deletion(md)
      spin_lock(_minor_lock)
      set_bit(DMF_DELETING)
      spin_unlock(_minor_lock)
    __hash_remove(hc)
    up_write(_hash_lock)
                                dev_status(param)
                                  md = find_device(param)
                                         down_read(_hash_lock)
                                         __find_device_hash_cell(param)
                                           dm_get_md(param->dev)
                                             md = dm_find_md(dev)
                                                    spin_lock(_minor_lock)
                                                    md = idr_find(MINOR(dev))
                                                    spin_unlock(_minor_lock)
    dm_put(md)
      free_dev(md)
                                             dm_get(md)
                                         up_read(_hash_lock)
                                  __dev_status(md, param)
                                  dm_put(md)

This patch fixes such problems.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:13:54 +01:00
Peter Rajnoha 856a6f1dbd dm ioctl: return uevent flag after rename
All the dm ioctls that generate uevents set the DM_UEVENT_GENERATED flag so
that userspace knows whether or not to wait for a uevent to be processed
before continuing,

The dm rename ioctl sets this flag but was not structured to return it
to userspace.  This patch restructures the rename ioctl processing to
behave like the other ioctls that return data and so fix this.

Signed-off-by: Peter Rajnoha <prajnoha@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:13:53 +01:00
Alasdair G Kergon 094ea9a071 dm ioctl: make __dev_status void
__dev_status() cannot fail so make it void and simplify callers.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:13:52 +01:00
Peter Rajnoha 6be5449401 dm ioctl: remove __dev_status from geometry and target message
Remove useless __dev_status call while processing an ioctl that sets up
device geometry and target message.  The data is not returned to
userspace so there is no point collecting it and in the case of
target_message it is collected before processing the message so if it
did return it might be stale.

Signed-off-by: Peter Rajnoha <prajnoha@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:13:52 +01:00
Mikulas Patocka c241104506 dm snapshot: test chunk size against both origin and snapshot
Validate chunk size against both origin and snapshot sector size

Don't allow chunk size smaller than either origin or snapshot logical
sector size. Reading or writing data not aligned to sector size is not
allowed and causes immediate errors.

This requires us to open the origin before initialising the
exception store and to export dm_snap_origin.

Cc: stable@kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:13:51 +01:00
Mikulas Patocka 1e5554c842 dm snapshot: iterate origin and cow devices
Iterate both origin and snapshot devices

iterate_devices method should call the callback for all the devices where
the bio may be remapped. Thus, snapshot_iterate_devices should call the callback
for both snapshot and origin underlying devices because it remaps some bios
to the snapshot and some to the origin.

snapshot_iterate_devices called the callback only for the origin device.
This led to badly calculated device limits if snapshot and origin were placed
on different types of disks.

Cc: stable@kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:13:50 +01:00
Alasdair G Kergon 6bbf79a140 dm mpath: fix NULL pointer dereference when path parameters missing
multipath_ctr() forgets to return an error after detecting
missing path parameters.  Fix this.

Signed-off-by: Patrick LoPresti <lopresti@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2010-08-12 04:13:49 +01:00
Benjamin Herrenschmidt 7b044f4010 drm/radeon: Add probing of clocks from device-tree
When we find no ROM we understand and a device-tree is present, see
if we can retreive clock info from there.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-12 09:41:20 +10:00
Dave Airlie b494d5d468 drm/radeon: drop old and broken mesa warning
This never really got fixed in mesa, and the kernel deals with the problem
just fine, so don't got reporting things that confuse people.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-12 09:40:05 +10:00
Benjamin Herrenschmidt a30f6fb7ce drm/radeon: Fix pci_map_page() error checking
0 is a valid DMA address from pci_map_page(), use pci_dma_mapping_error()
instead to check for errors

[airlied: fix warning + two other places with errors.]

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-12 09:38:29 +10:00
Chris Wilson 1a72d65d62 drm: Remove count_lock for calling lastclose() after 58474713 (v2)
When removing of the BKL the locking around lastclose() was rearranged
and resulted in the holding of the open_count spinlock over the call
into drm_lastclose(). The drivers were not ready for this path to be
atomic - it may indeed involve long waits to release old objects and
cleanup the GPU - and so we ended up scheduling whilst atomic.

[   54.625598] BUG: scheduling while atomic: X/3546/0x00000002
[   54.625600] Modules linked in: sco bridge stp llc input_polldev rfcomm bnep l2cap crc16 sch_sfq ipv6 md_mod acpi_cpufreq mperf cryptd aes_x86_64 aes_generic xts gf128mul dm_crypt dm_mod btusb bluetooth usbhid hid zaurus cdc_ether usbnet mii cdc_wdm cdc_acm uvcvideo videodev v4l1_compat v4l2_compat_ioctl32 snd_hda_codec_conexant arc4 pcmcia ecb snd_hda_intel joydev sdhci_pci sdhci snd_hda_codec tpm_tis firewire_ohci mmc_core e1000e uhci_hcd thinkpad_acpi nvram yenta_socket pcmcia_rsrc pcmcia_core tpm wmi sr_mod firewire_core iwlagn ehci_hcd snd_hwdep snd_pcm usbcore tpm_bios thermal led_class snd_timer iwlcore snd soundcore ac snd_page_alloc pcspkr psmouse serio_raw battery sg mac80211 evdev cfg80211 i2c_i801 iTCO_wdt iTCO_vendor_support cdrom processor crc_itu_t rfkill xfs exportfs sd_mod crc_t10dif ahci libahci libata scsi_mod [last unloaded: scsi_wait_scan]
[   54.625663] Pid: 3546, comm: X Not tainted 2.6.35-04771-g1787985 #301
[   54.625665] Call Trace:
[   54.625671]  [<ffffffff8102d599>] __schedule_bug+0x57/0x5c
[   54.625675]  [<ffffffff81384141>] schedule+0xe5/0x832
[   54.625679]  [<ffffffff81163e77>] ? put_dec+0x20/0x3c
[   54.625682]  [<ffffffff81384dd4>] schedule_timeout+0x275/0x29f
[   54.625686]  [<ffffffff810455e1>] ? process_timeout+0x0/0xb
[   54.625688]  [<ffffffff81384e17>] schedule_timeout_uninterruptible+0x19/0x1b
[   54.625691]  [<ffffffff81045893>] msleep+0x16/0x1d
[   54.625695]  [<ffffffff812a2e53>] i9xx_crtc_dpms+0x273/0x2ae
[   54.625698]  [<ffffffff812a18be>] intel_crtc_dpms+0x28/0xe7
[   54.625702]  [<ffffffff811ec0fa>] drm_helper_disable_unused_functions+0xf0/0x118
[   54.625705]  [<ffffffff811ecde3>] drm_crtc_helper_set_config+0x644/0x7c8
[   54.625708]  [<ffffffff811f12dd>] ? drm_copy_field+0x40/0x50
[   54.625711]  [<ffffffff811ebca2>] drm_fb_helper_force_kernel_mode+0x3e/0x85
[   54.625713]  [<ffffffff811ebcf2>] drm_fb_helper_restore+0x9/0x24
[   54.625717]  [<ffffffff81290a41>] i915_driver_lastclose+0x2b/0x5c
[   54.625720]  [<ffffffff811f14a7>] drm_lastclose+0x44/0x2ad
[   54.625722]  [<ffffffff811f1ed2>] drm_release+0x5c6/0x609
[   54.625726]  [<ffffffff810d1275>] fput+0x109/0x1c7
[   54.625728]  [<ffffffff810ce5e4>] filp_close+0x61/0x6b
[   54.625731]  [<ffffffff810ce680>] sys_close+0x92/0xd4
[   54.625734]  [<ffffffff81002a2b>] system_call_fastpath+0x16/0x1b

v2: The spinlock is actually superfluous as access to open_count is
entirely serialised by drm_global_mutex and so can be dropped. The
count_lock spinlock instead appears to be used to protect access to
dev->buf_alloc and dev->buf_use.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-12 09:22:19 +10:00
Marek Olšák 6ffe28f57c drm/radeon/kms: allow FG_ALPHA_VALUE on r5xx
This is a CS checker fix. I need this for FP16 alpha-test.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-12 09:13:36 +10:00
Alex Deucher 618145ea54 drm/radeon/kms: another r6xx/r7xx CS checker fix
add default case for buffer formats

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: Andre Maasikas <amaasikas@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-12 09:12:59 +10:00
Davidlohr Bueso 94e3370eb9 DRM: Replace kmalloc/memset combos with kzalloc
Currently most, if not all, memory allocation in drm_bufs.c is followed by initializing the memory with 0.

Replace the use of kmalloc+memset with kzalloc.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-12 09:12:30 +10:00
Randy Dunlap 4cde752587 firmware: ibft depends on SCSI
Prevent build errors when SCSI is not enabled:

iscsi_ibft.c:(.init.text+0x548d): undefined reference to `iscsi_boot_create_initiator'
iscsi_ibft.c:(.init.text+0x54a9): undefined reference to `iscsi_boot_create_ethernet'
iscsi_ibft.c:(.init.text+0x54c5): undefined reference to `iscsi_boot_create_target'
iscsi_ibft.c:(.init.text+0x55ff): undefined reference to `iscsi_boot_destroy_kset'
iscsi_ibft.c:(.init.text+0x561e): undefined reference to `iscsi_boot_create_kset'
iscsi_ibft.c:(.exit.text+0xe2c): undefined reference to `iscsi_boot_destroy_kset'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
2010-08-11 16:41:43 -04:00
Konrad Rzeszutek Wilk a12415ff58 ibft: Kernel oops when rmmoding iscsi_ibft with no iBFT present.
We failed to check to see if actually allocated structures
to contain the iBFT structure and went ahead to dereference it.

This patch fixes the OOPS.

Reported-by:  "Jayamohan Kalickal" <jayamohank@serverengines.com>  
Tested-by: "Jayamohan Kalickal" <jayamohank@serverengines.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: Peter Jones <pjones@redhat.com>
2010-08-11 16:35:40 -04:00
Rajkumar Manoharan da93f10684 ath9k_htc: fix panic on packet injection using airbase-ng tool.
This should fix the oops which occurs during the packet injection
on monitor interface.

EIP is at ath9k_htc_tx_start+0x69/0x220 [ath9k_htc]
 [<f84dc8ea>] ? invoke_tx_handlers+0xa5a/0xee0 [mac80211]
 [<f82c84f4>] ? ath9k_htc_tx+0x44/0xe0 [ath9k_htc]
 [<f84db7b8>] ? __ieee80211_tx+0xf8/0x190 [mac80211]
 [<f84dce0d>] ? ieee80211_tx+0x9d/0x1a0 [mac80211]
 [<f84dcfac>] ? ieee80211_xmit+0x9c/0x1c0 [mac80211]
 [<f84dd1b5>] ? ieee80211_monitor_start_xmit+0x85/0xb0 [mac80211]
 [<c04c30cd>] ? dev_hard_start_xmit+0x1ad/0x210
 [<c04b97c2>] ? __alloc_skb+0x52/0x130
 [<c04d7cd5>] ? sch_direct_xmit+0x105/0x170
 [<c04c5e9f>] ? dev_queue_xmit+0x37f/0x4b0
 [<c0567e1e>] ? packet_snd+0x21e/0x250
 [<c05684a2>] ? packet_sendmsg+0x32/0x40
 [<c04b4c63>] ? sock_aio_write+0x113/0x130
 [<c0207934>] ? do_sync_write+0xc4/0x100
 [<c0167740>] ? autoremove_wake_function+0x0/0x50
 [<c02f4414>] ? security_file_permission+0x14/0x20
 [<c0207ad4>] ? rw_verify_area+0x64/0xe0
 [<c01e6458>] ? handle_mm_fault+0x338/0x390
 [<c0207cd5>] ? vfs_write+0x185/0x1a0
 [<c058db20>] ? do_page_fault+0x160/0x3a0
 [<c0208512>] ? sys_write+0x42/0x70
 [<c01033ec>] ? syscall_call+0x7/0xb

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-11 16:24:43 -04:00
John W. Linville 2f81b47135 ipw2100: register pm_qos request before registering pci driver
It is necessary to call pm_qos_add_request prior to calling
pm_qos_update_request.  It was revealed that ipw2100 has been
doing this wrong since "pm_qos: Get rid of the allocation in
pm_qos_add_request()" (commit 82f682514a)
added a WARN that results in the following backtrace:

WARNING: at kernel/pm_qos_params.c:264 pm_qos_update_request+0x5e/0x70()
pm_qos_update_request() called for unknown object
Call Trace:
[<c1024088>] ? warn_slowpath_common+0x78/0xb0
[<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
[<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
[<c1024153>] ? warn_slowpath_fmt+0x33/0x40
[<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
[<f89fe15f>] ? ipw2100_up+0x3f/0xf10 [ipw2100]
[<c11961c9>] ? vsnprintf+0xc9/0x530
[<f89ff36c>] ? ipw2100_net_init+0x2c/0x1c0 [ipw2100]
[<c12f542d>] ? register_netdevice+0x7d/0x3c0
[<f89f9b00>] ? ipw2100_irq_tasklet+0x910/0x9a0 [ipw2100]
[<c12f579f>] ? register_netdev+0x2f/0x40
[<f89fd471>] ? ipw2100_pci_init_one+0xd21/0x1060 [ipw2100]
[<c11a5ebb>] ? local_pci_probe+0xb/0x10
[<c11a6d49>] ? pci_device_probe+0x69/0x90
[<c1224704>] ? driver_probe_device+0x74/0x180
[<c10dd15a>] ? sysfs_create_dir+0x6a/0xb0
[<c1224889>] ? __driver_attach+0x79/0x80
[<c1224810>] ? __driver_attach+0x0/0x80
[<c1223fa2>] ? bus_for_each_dev+0x52/0x80
[<c1224586>] ? driver_attach+0x16/0x20
[<c1224810>] ? __driver_attach+0x0/0x80
[<c122395f>] ? bus_add_driver+0x17f/0x250
[<c11a5ec0>] ? pci_device_shutdown+0x0/0x20
[<c11a6c80>] ? pci_device_remove+0x0/0x40
[<c1224b13>] ? driver_register+0x63/0x120
[<c11a6f96>] ? __pci_register_driver+0x36/0xa0
[<f84f9048>] ? ipw2100_init+0x48/0x67 [ipw2100]
[<c1001122>] ? do_one_initcall+0x32/0x170
[<c1087078>] ? __vunmap+0xb8/0xf0
[<f84f9000>] ? ipw2100_init+0x0/0x67 [ipw2100]
[<c10510c1>] ? sys_init_module+0x161/0x1000
[<c108f847>] ? sys_close+0x67/0xe0
[<c13647c1>] ? syscall_call+0x7/0xb

This patch moves pm_qos_add_request prior to pci_register_driver in
ipw2100 in order to avoid this problem.

Reported-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-11 16:18:01 -04:00
David Woodhouse 2016e4a0a1 ideapad: Only allow camera state to be set to 0 or 1
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-11 18:00:52 +01:00
David Woodhouse ce326329d7 ideapad: Stop using global variables
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-11 18:00:43 +01:00
Michael Lawnick 7f528135da i2c: I2C bus multiplexer driver pca954x
I2C driver for PCA954x I2C multiplexer series.

Signed-off-by: Michael Lawnick <ml.lawnick@gmx.de>
Acked-by: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-11 18:21:03 +02:00
Michael Lawnick 0826374bff i2c: Multiplexed I2C bus core support
Add multiplexed bus core support. I2C multiplexer and switches
like pca954x get instantiated as new adapters per port.

Signed-off-by: Michael Lawnick <ml.lawnick@gmx.de>
Acked-by: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-11 18:21:02 +02:00
Jean Delvare dafc50d141 i2c: Use a separate mutex for userspace client lists
Moving userspace-instantiated clients to separate lists wasn't nearly
enough to avoid deadlocks in multiplexed bus cases. We also want to
have a dedicated mutex to protect each list.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Michael Lawnick <ml.lawnick@gmx.de>
2010-08-11 18:21:01 +02:00
Jean Delvare 8031d79bae i2c: Make i2c_default_probe self-sufficient
Make i2c_default_probe self-sufficient, so that callers don't have to
do functionality checks themselves. This ensures everything is and
will stay consistent.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2010-08-11 18:21:00 +02:00
Jean Delvare d6703281ff i2c: Drop dummy variable
Now that bus_for_each_drv() is no longer __must_check, we can drop the
dummy variable that was used to store the returned value.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Justin P. Mattock <justinmattock@gmail.com>
2010-08-11 18:20:59 +02:00
Jean Delvare fe61e07e9e i2c: Move adapter locking helpers to i2c-core
Uninline i2c adapter locking helper functions, move them to i2c-core,
and use them in i2c-core itself. The functions are still exported for
external users. This makes future updates to the locking model (which
will be needed for multiplexing support) possible and transparent.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Michael Lawnick <ml.lawnick@gmx.de>
2010-08-11 18:20:58 +02:00
Jean Delvare d44f19d586 V4L/DVB: Use custom I2C probing function mechanism
Now that i2c-core offers the possibility to provide custom probing
function for I2C devices, let's make use of it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-11 18:20:57 +02:00