GitHub/mt8127/android_kernel_alcatel_ttab.git
13 years agoktest: Fix result of rebooting the kernel
Steven Rostedt [Thu, 2 Jun 2011 03:25:13 +0000 (23:25 -0400)]
ktest: Fix result of rebooting the kernel

The command that is called that reboots the kernel may fail
but the return code is not passed back to the ktest.pl script.
This is because a ';' is used between the two commands and
if the second command fails, only the first command's return
code is returned. Using a '&&' between the two commands fixes
this.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
13 years agoktest: Fix off-by-one in config bisect result
Steven Rostedt [Thu, 2 Jun 2011 03:22:30 +0000 (23:22 -0400)]
ktest: Fix off-by-one in config bisect result

Because in perl the array size returned by $#arr, is the last
index and not the actually size of the array, we end the config
bisect early, thinking there is only one config left when there
are in fact two. Thus the result has a 50% chance of picking
the correct config that caused the problem.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
13 years agoMerge branch 'for-jens/xen-blkback.fixes' of git://git.kernel.org/pub/scm/linux/kerne...
Jens Axboe [Thu, 2 Jun 2011 11:14:15 +0000 (13:14 +0200)]
Merge branch 'for-jens/xen-blkback.fixes' of git://git./linux/kernel/git/konrad/xen into for-linus

13 years agoblock: Use hlist_entry() for io_context.cic_list.first
Paul Bolle [Thu, 2 Jun 2011 11:05:02 +0000 (13:05 +0200)]
block: Use hlist_entry() for io_context.cic_list.first

list_entry() and hlist_entry() are both simply aliases for
container_of(), but since io_context.cic_list.first is an hlist_node one
should at least use the correct alias.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agocfq-iosched: Remove bogus check in queue_fail path
Paul Bolle [Thu, 2 Jun 2011 11:05:02 +0000 (13:05 +0200)]
cfq-iosched: Remove bogus check in queue_fail path

queue_fail can only be reached if cic is NULL, so its check for cic must
be bogus.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years ago[SCSI] Fix oops caused by queue refcounting failure
James Bottomley [Wed, 25 May 2011 20:52:14 +0000 (15:52 -0500)]
[SCSI] Fix oops caused by queue refcounting failure

In certain circumstances, we can get an oops from a torn down device.
Most notably this is from CD roms trying to call scsi_ioctl.  The root
cause of the problem is the fact that after scsi_remove_device() has
been called, the queue is fully torn down.  This is actually wrong
since the queue can be used until the sdev release function is called.
Therefore, we add an extra reference to the queue which is released in
sdev->release, so the queue always exists.

Reported-by: Parag Warudkar <parag.lkml@gmail.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <jbottomley@parallels.com>
13 years agovideo: Convert vmalloc/memset to vzalloc
Joe Perches [Sat, 28 May 2011 18:13:33 +0000 (11:13 -0700)]
video: Convert vmalloc/memset to vzalloc

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
13 years agoefifb: Disallow manual bind and unbind
Andy Lutomirski [Thu, 26 May 2011 14:13:34 +0000 (10:13 -0400)]
efifb: Disallow manual bind and unbind

Both were buggy: bind would happily scribble over a real graphics
device and unbind wouldn't destroy the framebuffer.  Hotplugging
efifb makes no sense anyway, so just disable it.

As an added benefit, we save some runtime memory.

Signed-off-by: Andy Lutomirski <luto@mit.edu>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
13 years agoefifb: Fix mismatched request/release_mem_region
Andy Lutomirski [Thu, 26 May 2011 14:13:32 +0000 (10:13 -0400)]
efifb: Fix mismatched request/release_mem_region

Signed-off-by: Andy Lutomirski <luto@mit.edu>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
13 years agoefifb: Enable write-combining
Andy Lutomirski [Thu, 26 May 2011 14:13:31 +0000 (10:13 -0400)]
efifb: Enable write-combining

Running fbcon on an uncached framebuffer is remarkably slow.  So try
to enable write combining in efifb.

Without this patch, it takes 5.8 seconds from efifb probe to i915
probe (default options; no plymouth or quiet mode).  With this patch,
it only takes 1.7 seconds.  That means we wasted over 4 seconds just
writing to UC memory.

Signed-off-by: Andy Lutomirski <luto@mit.edu>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
13 years agodrivers/video/pxa168fb.c: add missing clk_put
Julia Lawall [Wed, 1 Jun 2011 17:10:13 +0000 (17:10 +0000)]
drivers/video/pxa168fb.c: add missing clk_put

Add a label for error-handling code in the case where only clk_get has
succeeded.  Rename the label failed to be consistent with the rest.

A simplified version of the semantic match that finds the missing clk_put
is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression e1,e2;
statement S;
@@

e1 = clk_get@p1(...);
... when != e1 = e2
    when != clk_put(e1)
    when any
if (...) { ... when != clk_put(e1)
               when != if (...) { ... clk_put(e1) ... }
* return@p3 ...;
 } else S
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
13 years agodrivers/video/imxfb.c: add missing clk_put
Julia Lawall [Wed, 1 Jun 2011 17:10:11 +0000 (17:10 +0000)]
drivers/video/imxfb.c: add missing clk_put

Reorder the labels at the end of the function to correspond to the order in
which the resources are allocated.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression e1,e2;
statement S;
@@

e1 = clk_get@p1(...);
... when != e1 = e2
    when != clk_put(e1)
    when any
if (...) { ... when != clk_put(e1)
               when != if (...) { ... clk_put(e1) ... }
* return@p3 ...;
 } else S
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
13 years agofbdev: bf537-lq035: add missing blacklight properties type
Steven Miao [Mon, 30 May 2011 03:23:36 +0000 (03:23 +0000)]
fbdev: bf537-lq035: add missing blacklight properties type

Seems this new field was missed, probably due to this driver being merged
around the time this new backlight field was being added.  At any rate,
initial the type field to avoid ugly WARN() dumps.

Signed-off-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
13 years agosavagefb: Use panel CVT mode as default
Tormod Volden [Sat, 28 May 2011 15:06:11 +0000 (15:06 +0000)]
savagefb: Use panel CVT mode as default

If there is no EDID but an LCD panel is detected, generate a CVT
mode from the panel resolution (at 60 Hz), and use this as a
default mode instead of the hardcoded 800x600x8 mode.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
13 years agofbdev: sh_mobile_lcdcfb: Fix up fallout from MERAM changes.
Paul Mundt [Thu, 26 May 2011 06:01:22 +0000 (15:01 +0900)]
fbdev: sh_mobile_lcdcfb: Fix up fallout from MERAM changes.

The LCDC driver does no longer compile:

  CC      drivers/video/sh_mobile_meram.o
  CC      drivers/video/sh_mobile_lcdcfb.o
drivers/video/sh_mobile_lcdcfb.c: In function 'sh_mobile_lcdc_start':
drivers/video/sh_mobile_lcdcfb.c:640:4: error: 'ret' undeclared (first use in this function)
drivers/video/sh_mobile_lcdcfb.c:640:4: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [drivers/video/sh_mobile_lcdcfb.o] Error 1
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2

Reported-by: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
13 years agodrivers/net/can/flexcan.c: add missing clk_put
Julia Lawall [Wed, 1 Jun 2011 19:48:50 +0000 (19:48 +0000)]
drivers/net/can/flexcan.c: add missing clk_put

The failed_get label is used after the call to clk_get has succeeded, so it
should be moved up above the call to clk_put.

The failed_req labels doesn't do anything different than failed_get, so
delete it.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression e1,e2;
statement S;
@@

e1 = clk_get@p1(...);
... when != e1 = e2
    when != clk_put(e1)
    when any
if (...) { ... when != clk_put(e1)
               when != if (...) { ... clk_put(e1) ... }
* return@p3 ...;
 } else S
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoARM: mach-shmobile: add DMAC clock definitions on SH7372
Guennadi Liakhovetski [Wed, 1 Jun 2011 07:32:07 +0000 (07:32 +0000)]
ARM: mach-shmobile: add DMAC clock definitions on SH7372

These definitions are needed to let the runtime PM subsystem turn off
DMAC clocks, when it is suspended by the driver.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
13 years agodmaengine: shdma: fix a regression: initialise DMA channels for memcpy
Guennadi Liakhovetski [Tue, 31 May 2011 09:25:16 +0000 (09:25 +0000)]
dmaengine: shdma: fix a regression: initialise DMA channels for memcpy

A recent patch has introduced a regression, where repeating a memcpy
DMA test with shdma module unloading between them skips the DMA channel
configuration. Fix this regression by always configuring the channel
during its allocation.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
13 years agonet: dm9000: Get the chip in a known good state before enabling interrupts
Mark Brown [Wed, 1 Jun 2011 10:18:09 +0000 (10:18 +0000)]
net: dm9000: Get the chip in a known good state before enabling interrupts

Currently the DM9000 driver requests the primary interrupt before it
resets the chip and puts it into a known good state. This means that if
the chip is asserting interrupt for some reason we can end up with a
screaming IRQ that the interrupt handler is unable to deal with. Avoid
this by only requesting the interrupt after we've reset the chip so we
know what state it's in.

This started manifesting itself on one of my boards in the past month or
so, I suspect as a result of some core infrastructure changes removing
some form of mitigation against bad behaviour here, even when things boot
it seems that the new code brings the interface up more quickly.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/davinci_emac.c: add missing clk_put
Julia Lawall [Wed, 1 Jun 2011 07:10:10 +0000 (07:10 +0000)]
drivers/net/davinci_emac.c: add missing clk_put

Go to existing error handling code at the end of the function that calls
clk_put.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression e1,e2;
statement S;
@@

e1 = clk_get@p1(...);
... when != e1 = e2
    when != clk_put(e1)
    when any
if (...) { ... when != clk_put(e1)
               when != if (...) { ... clk_put(e1) ... }
* return@p3 ...;
 } else S
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoaf-packet: Add flag to distinguish VID 0 from no-vlan.
Ben Greear [Wed, 1 Jun 2011 06:49:10 +0000 (06:49 +0000)]
af-packet: Add flag to distinguish VID 0 from no-vlan.

Currently, user-space cannot determine if a 0 tcp_vlan_tci
means there is no VLAN tag or the VLAN ID was zero.

Add flag to make this explicit.  User-space can check for
TP_STATUS_VLAN_VALID || tp_vlan_tci > 0, which will be backwards
compatible. Older could would have just checked for tp_vlan_tci,
so it will work no worse than before.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif: Fix race when conditionally taking rtnl lock
sjur.brandeland@stericsson.com [Wed, 1 Jun 2011 00:55:37 +0000 (00:55 +0000)]
caif: Fix race when conditionally taking rtnl lock

Take the RTNL lock unconditionally when calling dev_close.
Taking the lock conditionally may cause race conditions.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agousbnet/cdc_ncm: add missing .reset_resume hook
Stefan Metzmacher [Wed, 1 Jun 2011 02:01:41 +0000 (02:01 +0000)]
usbnet/cdc_ncm: add missing .reset_resume hook

This avoids messages like this after suspend:

   cdc_ncm 2-1.4:1.6: no reset_resume for driver cdc_ncm?
   cdc_ncm 2-1.4:1.7: no reset_resume for driver cdc_ncm?
   cdc_ncm 2-1.4:1.6: usb0: unregister 'cdc_ncm' usb-0000:00:1d.0-1.4, CDC NCM

This is important for the Ericsson F5521gw GSM/UMTS modem.
Otherwise modemmanager looses the fact that the cdc_ncm and cdc_acm devices
belong together.

The cdc_ether module does the same.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agovlan: fix typo in vlan_dev_hard_start_xmit()
Wei Yongjun [Tue, 31 May 2011 22:53:19 +0000 (22:53 +0000)]
vlan: fix typo in vlan_dev_hard_start_xmit()

commit 4af429d29b341bb1735f04c2fb960178ed5d52e7 (vlan: lockless
transmit path) have a typo in vlan_dev_hard_start_xmit(), using
u64_stats_update_begin() to end the stat update, it should be
u64_stats_update_end().

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/ipv4: Check for mistakenly passed in non-IPv4 address
Marcus Meissner [Thu, 2 Jun 2011 04:05:22 +0000 (21:05 -0700)]
net/ipv4: Check for mistakenly passed in non-IPv4 address

Check against mistakenly passing in IPv6 addresses (which would result
in an INADDR_ANY bind) or similar incompatible sockaddrs.

Signed-off-by: Marcus Meissner <meissner@suse.de>
Cc: Reinhard Max <max@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agohwmon: (coretemp) Further relax temperature range checks
Guenter Roeck [Wed, 1 Jun 2011 18:03:41 +0000 (11:03 -0700)]
hwmon: (coretemp) Further relax temperature range checks

Further relax temperature range checks after reading the IA32_TEMPERATURE_TARGET
register. If the register returns a value other than 0 in bits 16..32, assume
that the returned value is correct.

This change applies to both packet and core temperature limits.

Cc: Carsten Emde <C.Emde@osadl.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
13 years agohwmon: (coretemp) Fix TjMax detection for older CPUs
Guenter Roeck [Tue, 31 May 2011 13:54:21 +0000 (06:54 -0700)]
hwmon: (coretemp) Fix TjMax detection for older CPUs

Commit a321cedb12904114e2ba5041a3673ca24deb09c9 excludes CPU models 0xe, 0xf,
0x16, and 0x1a from TjMax temperature adjustment, even though several of those
CPUs are known to have TiMax other than 100 degrees C, and even though the code
in adjust_tjmax() explicitly handles those CPUs and points to a Web document
listing several of the affected CPU IDs.

Reinstate original TjMax adjustment if TjMax can not be determined using the
IA32_TEMPERATURE_TARGET register.

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

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Huaxu Wan <huaxu.wan@linux.intel.com>
Cc: Carsten Emde <C.Emde@osadl.org>
Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Yong Wang <yong.y.wang@linux.intel.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Tested-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Cc: <stable@kernel.org> # .35.x .36.x .37.x .38.x .39.x
13 years agodrm/radeon/kms: add missing Evergreen texture formats to the CS parser
Marek Olšák [Fri, 6 May 2011 23:09:57 +0000 (01:09 +0200)]
drm/radeon/kms: add missing Evergreen texture formats to the CS parser

BC6 and BC7 are described in ARB_texture_compression_bptc.

No idea what FMT_32_AS_32_32_32_32 is good for.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: viewport height has to be even
Alex Deucher [Fri, 27 May 2011 14:05:03 +0000 (10:05 -0400)]
drm/radeon/kms: viewport height has to be even

Otherwise, no vblank interrupts.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=37522

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: remove duplicate reg from r600 safe regs
Alex Deucher [Thu, 26 May 2011 18:20:38 +0000 (14:20 -0400)]
drm/radeon/kms: remove duplicate reg from r600 safe regs

It got added twice by accident.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: add support for Llano Fusion APUs
Alex Deucher [Tue, 31 May 2011 19:42:48 +0000 (15:42 -0400)]
drm/radeon/kms: add support for Llano Fusion APUs

- add gpu init support
- add blit support
- add ucode loader

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: add llano pci ids
Alex Deucher [Tue, 31 May 2011 19:42:49 +0000 (15:42 -0400)]
drm/radeon/kms: add llano pci ids

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: fill in asic struct for llano
Alex Deucher [Tue, 31 May 2011 19:42:47 +0000 (15:42 -0400)]
drm/radeon/kms: fill in asic struct for llano

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon/kms: add family ids for llano APUs
Alex Deucher [Tue, 31 May 2011 19:42:46 +0000 (15:42 -0400)]
drm/radeon/kms: add family ids for llano APUs

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agodrm/radeon: fix oops in ttm reserve when pageflipping (v2)
Dave Airlie [Sun, 29 May 2011 07:48:32 +0000 (17:48 +1000)]
drm/radeon: fix oops in ttm reserve when pageflipping (v2)

We need to take a reference to this object, pinning doesn't take a reference
so if userspace deletes the object it can disappear even if pinned.

v2: fix error paths to unreference properly also.

should fix:
https://bugzilla.kernel.org/show_bug.cgi?id=32402
and
https://bugzilla.redhat.com/show_bug.cgi?id=680651

Acked-By: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
13 years agoRevert "mm: fail GFP_DMA allocations when ZONE_DMA is not configured"
Linus Torvalds [Wed, 1 Jun 2011 21:11:24 +0000 (06:11 +0900)]
Revert "mm: fail GFP_DMA allocations when ZONE_DMA is not configured"

This reverts commit a197b59ae6e8bee56fcef37ea2482dc08414e2ac.

As rmk says:
 "Commit a197b59ae6e8 (mm: fail GFP_DMA allocations when ZONE_DMA is not
  configured) is causing regressions on ARM with various drivers which
  use GFP_DMA.

  The behaviour up until now has been to silently ignore that flag when
  CONFIG_ZONE_DMA is not enabled, and to allocate from the normal zone.
  However, as a result of the above commit, such allocations now fail
  which causes drivers to fail.  These are regressions compared to the
  previous kernel version."

so just revert it.

Requested-by: Russell King <linux@arm.linux.org.uk>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge git://git.infradead.org/iommu-2.6
Linus Torvalds [Wed, 1 Jun 2011 20:48:50 +0000 (05:48 +0900)]
Merge git://git.infradead.org/iommu-2.6

* git://git.infradead.org/iommu-2.6:
  intel-iommu: Fix off-by-one in RMRR setup
  intel-iommu: Add domain check in domain_remove_one_dev_info
  intel-iommu: Remove Host Bridge devices from identity mapping
  intel-iommu: Use coherent DMA mask when requested
  intel-iommu: Dont cache iova above 32bit
  intel-iommu: Speed up processing of the identity_mapping function
  intel-iommu: Check for identity mapping candidate using system dma mask
  intel-iommu: Only unlink device domains from iommu
  intel-iommu: Enable super page (2MiB, 1GiB, etc.) support
  intel-iommu: Flush unmaps at domain_exit
  intel-iommu: Remove obsolete comment from detect_intel_iommu
  intel-iommu: fix VT-d PMR disable for TXT on S3 resume

13 years agoblock: fix mismerge of the DISK_EVENT_MEDIA_CHANGE removal
Linus Torvalds [Wed, 1 Jun 2011 20:29:19 +0000 (05:29 +0900)]
block: fix mismerge of the DISK_EVENT_MEDIA_CHANGE removal

Jens' back-merge commit 698567f3fa79 ("Merge commit 'v2.6.39' into
for-2.6.40/core") was incorrectly done, and re-introduced the
DISK_EVENT_MEDIA_CHANGE lines that had been removed earlier in commits

 - 9fd097b14918 ("block: unexport DISK_EVENT_MEDIA_CHANGE for
   legacy/fringe drivers")

 - 7eec77a1816a ("ide: unexport DISK_EVENT_MEDIA_CHANGE for ide-gd
   and ide-cd")

because of conflicts with the "g->flags" updates near-by by commit
d4dc210f69bc ("block: don't block events on excl write for non-optical
devices")

As a result, we re-introduced the hanging behavior due to infinite disk
media change reports.

Tssk, tssk, people! Don't do back-merges at all, and *definitely* don't
do them to hide merge conflicts from me - especially as I'm likely
better at merging them than you are, since I do so many merges.

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agotile: enable CONFIG_BUGVERBOSE
Chris Metcalf [Wed, 1 Jun 2011 20:06:04 +0000 (16:06 -0400)]
tile: enable CONFIG_BUGVERBOSE

Trivial config change to enable backtraces on panic.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
13 years agoiwl4965: correctly validate temperature value
Stanislaw Gruszka [Wed, 1 Jun 2011 15:17:57 +0000 (17:17 +0200)]
iwl4965: correctly validate temperature value

In some cases we can read wrong temperature value. If after that
temperature value will not be updated to good one, we badly configure
tx power parameters and device is unable to send a data.

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

Cc: stable@kernel.org # 2.6.39+
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agobluetooth l2cap: fix locking in l2cap_global_chan_by_psm
Johannes Berg [Wed, 1 Jun 2011 06:29:54 +0000 (08:29 +0200)]
bluetooth l2cap: fix locking in l2cap_global_chan_by_psm

read_lock() ... read_unlock_bh() is clearly bogus.
This was broken by

commit 23691d75cdc69c3b285211b4d77746aa20a17d18
Author: Gustavo F. Padovan <padovan@profusion.mobi>
Date:   Wed Apr 27 18:26:32 2011 -0300

    Bluetooth: Remove l2cap_sk_list

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix two more bugs in tx power
Daniel Halperin [Tue, 31 May 2011 18:59:30 +0000 (11:59 -0700)]
ath9k: fix two more bugs in tx power

This is the same fix as

   commit 841051602e3fa18ea468fe5a177aa92b6eb44b56
   Author: Matteo Croce <technoboy85@gmail.com>
   Date:   Fri Dec 3 02:25:08 2010 +0100

   The ath9k driver subtracts 3 dBm to the txpower as with two radios the
   signal power is doubled.
   The resulting value is assigned in an u16 which overflows and makes
   the card work at full power.

in two more places. I grepped the ath tree and didn't find any others.

Cc: stable@kernel.org
Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: don't drop p2p probe responses
Eliad Peller [Sun, 29 May 2011 12:53:20 +0000 (15:53 +0300)]
cfg80211: don't drop p2p probe responses

Commit 0a35d36 ("cfg80211: Use capability info to detect mesh beacons")
assumed that probe response with both ESS and IBSS bits cleared
means that the frame was sent by a mesh sta.

However, these capabilities are also being used in the p2p_find phase,
and the mesh-validation broke it.

Rename the WLAN_CAPABILITY_IS_MBSS macro, and verify that mesh ies
exist before assuming this frame was sent by a mesh sta.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agohwmon: (coretemp) Relax target temperature range check
Jean Delvare [Tue, 31 May 2011 19:50:51 +0000 (15:50 -0400)]
hwmon: (coretemp) Relax target temperature range check

The current temperature range check of MSR_IA32_TEMPERATURE_TARGET
seems too strict to me, some TjMax values documented in
Documentation/hwmon/coretemp wouldn't pass. Relax the check so that
all the documented values pass.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Carsten Emde <C.Emde@osadl.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
13 years agohwmon: (max6642) Rename temp_fault sysfs attribute to temp2_fault
Per Dalen [Tue, 31 May 2011 13:54:21 +0000 (06:54 -0700)]
hwmon: (max6642) Rename temp_fault sysfs attribute to temp2_fault

The temp_fault sysfs attribute is wrong, it should be temp2_fault instead.

Reported-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Per Dalen <per.dalen@appeartv.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
13 years agoxen/blkback: potential null dereference in error handling
Dan Carpenter [Fri, 27 May 2011 06:27:16 +0000 (09:27 +0300)]
xen/blkback: potential null dereference in error handling

blkbk->pending_pages can be NULL here so I added a check for it.

Signed-off-by: Dan Carpenter <error27@gmail.com>
[v1: Redid the loop a bit]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoxen/blkback: don't call vbd_size() if bd_disk is NULL
Laszlo Ersek [Wed, 25 May 2011 10:24:25 +0000 (12:24 +0200)]
xen/blkback: don't call vbd_size() if bd_disk is NULL

...because vbd_size() dereferences bd_disk if bd_part is NULL.

Signed-off-by: Laszlo Ersek<lersek@redhat.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
13 years agoMerge git://git.infradead.org/mtd-2.6
Linus Torvalds [Wed, 1 Jun 2011 12:47:39 +0000 (21:47 +0900)]
Merge git://git.infradead.org/mtd-2.6

* git://git.infradead.org/mtd-2.6:
  mtd: fix physmap.h warnings

13 years agointel-iommu: Fix off-by-one in RMRR setup
David Woodhouse [Mon, 30 May 2011 23:22:52 +0000 (00:22 +0100)]
intel-iommu: Fix off-by-one in RMRR setup

We were mapping an extra byte (and hence usually an extra page):
iommu_prepare_identity_map() expects to be given an 'end' argument which
is the last byte to be mapped; not the first byte *not* to be mapped.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoARM: OMAP4: MMC: increase delay for pbias
Balaji T K [Wed, 1 Jun 2011 11:15:22 +0000 (16:45 +0530)]
ARM: OMAP4: MMC: increase delay for pbias

4 micro seconds is not enough for PBIAS if MMC regulator is
enabled from MMC regulator OFF.
Increase the delay for PBIAS to stabilize.
Wait for PBIAS and timeout if not.

Resolves MMC/SD failure on OMAP4
"Pbias Voltage is not same as LDO"

Signed-off-by: Balaji T K <balajitk@ti.com>
Acked-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agointel-iommu: Add domain check in domain_remove_one_dev_info
Mike Habeck [Sat, 28 May 2011 18:15:07 +0000 (13:15 -0500)]
intel-iommu: Add domain check in domain_remove_one_dev_info

The comment in domain_remove_one_dev_info() states "No need to compare
PCI domain; it has to be the same". But for the si_domain that isn't
going to be true, as it consists of all the PCI devices that are
identity mapped thus multiple PCI domains can be in si_domain.  The
code needs to validate the PCI domain too.

Signed-off-by: Mike Habeck <habeck@sgi.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Cc: stable@kernel.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agointel-iommu: Remove Host Bridge devices from identity mapping
Mike Travis [Sat, 28 May 2011 18:15:06 +0000 (13:15 -0500)]
intel-iommu: Remove Host Bridge devices from identity mapping

When using the 1:1 (identity) PCI DMA remapping, PCI Host Bridge devices
that do not use the IOMMU causes a kernel panic.  Fix that by not
inserting those devices into the si_domain.

Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Mike Habeck <habeck@sgi.com>
Cc: stable@kernel.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agointel-iommu: Use coherent DMA mask when requested
Mike Travis [Sat, 28 May 2011 18:15:05 +0000 (13:15 -0500)]
intel-iommu: Use coherent DMA mask when requested

The __intel_map_single function is not honoring the passed in DMA mask.
This results in not using the coherent DMA mask when called from
intel_alloc_coherent().

Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Reviewed-by: Mike Habeck <habeck@sgi.com>
Cc: stable@kernel.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agointel-iommu: Dont cache iova above 32bit
Chris Wright [Sat, 28 May 2011 18:15:04 +0000 (13:15 -0500)]
intel-iommu: Dont cache iova above 32bit

Mike Travis and Mike Habeck reported an issue where iova allocation
would return a range that was larger than a device's dma mask.

https://lkml.org/lkml/2011/3/29/423

The dmar initialization code will reserve all PCI MMIO regions and copy
those reservations into a domain specific iova tree.  It is possible for
one of those regions to be above the dma mask of a device.  It is typical
to allocate iovas with a 32bit mask (despite device's dma mask possibly
being larger) and cache the result until it exhausts the lower 32bit
address space.  Freeing the iova range that is >= the last iova in the
lower 32bit range when there is still an iova above the 32bit range will
corrupt the cached iova by pointing it to a region that is above 32bit.
If that region is also larger than the device's dma mask, a subsequent
allocation will return an unusable iova and cause dma failure.

Simply don't cache an iova that is above the 32bit caching boundary.

Reported-by: Mike Travis <travis@sgi.com>
Reported-by: Mike Habeck <habeck@sgi.com>
Cc: stable@kernel.org
Acked-by: Mike Travis <travis@sgi.com>
Tested-by: Mike Habeck <habeck@sgi.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agointel-iommu: Speed up processing of the identity_mapping function
Mike Travis [Sat, 28 May 2011 18:15:03 +0000 (13:15 -0500)]
intel-iommu: Speed up processing of the identity_mapping function

When there are a large count of PCI devices, and the pass through
option for iommu is set, much time is spent in the identity_mapping
function hunting though the iommu domains to check if a specific
device is "identity mapped".

Speed up the function by checking the cached info to see if
it's mapped to the static identity domain.

Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Mike Habeck <habeck@sgi.com>
Cc: stable@kernel.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agointel-iommu: Check for identity mapping candidate using system dma mask
Chris Wright [Sat, 28 May 2011 18:15:02 +0000 (13:15 -0500)]
intel-iommu: Check for identity mapping candidate using system dma mask

The identity mapping code appears to make the assumption that if the
devices dma_mask is greater than 32bits the device can use identity
mapping.  But that is not true: take the case where we have a 40bit
device in a 44bit architecture. The device can potentially receive a
physical address that it will truncate and cause incorrect addresses
to be used.

Instead check to see if the device's dma_mask is large enough
to address the system's dma_mask.

Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Mike Habeck <habeck@sgi.com>
Cc: stable@kernel.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agointel-iommu: Only unlink device domains from iommu
Alex Williamson [Tue, 24 May 2011 16:19:04 +0000 (12:19 -0400)]
intel-iommu: Only unlink device domains from iommu

Commit a97590e5 added unlinking domains from iommus to reciprocate the
iommu from domains unlinking that was already done.  We actually want
to only do this for device domains and never for the static
identity map domain or VM domains.  The SI domain is special and
never freed, while VM domain->id lives in their own special address
space, separate from iommu->domain_ids.

In the current code, a VM can get domain->id zero, then mark that
domain unused when unbound from pci-stub.  This leads to DMAR
write faults when the device is re-bound to the host driver.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: stable@kernel.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agointel-iommu: Enable super page (2MiB, 1GiB, etc.) support
Youquan Song [Wed, 25 May 2011 18:13:49 +0000 (19:13 +0100)]
intel-iommu: Enable super page (2MiB, 1GiB, etc.) support

There are no externally-visible changes with this. In the loop in the
internal __domain_mapping() function, we simply detect if we are mapping:
  - size >= 2MiB, and
  - virtual address aligned to 2MiB, and
  - physical address aligned to 2MiB, and
  - on hardware that supports superpages.

(and likewise for larger superpages).

We automatically use a superpage for such mappings. We never have to
worry about *breaking* superpages, since we trust that we will always
*unmap* the same range that was mapped. So all we need to do is ensure
that dma_pte_clear_range() will also cope with superpages.

Adjust pfn_to_dma_pte() to take a superpage 'level' as an argument, so
it can return a PTE at the appropriate level rather than always
extending the page tables all the way down to level 1. Again, this is
simplified by the fact that we should never encounter existing small
pages when we're creating a mapping; any old mapping that used the same
virtual range will have been entirely removed and its obsolete page
tables freed.

Provide an 'intel_iommu=sp_off' argument on the command line as a
chicken bit. Not that it should ever be required.

==

The original commit seen in the iommu-2.6.git was Youquan's
implementation (and completion) of my own half-baked code which I'd
typed into an email. Followed by half a dozen subsequent 'fixes'.

I've taken the unusual step of rewriting history and collapsing the
original commits in order to keep the main history simpler, and make
life easier for the people who are going to have to backport this to
older kernels. And also so I can give it a more coherent commit comment
which (hopefully) gives a better explanation of what's going on.

The original sequence of commits leading to identical code was:

Youquan Song (3):
      intel-iommu: super page support
      intel-iommu: Fix superpage alignment calculation error
      intel-iommu: Fix superpage level calculation error in dma_pfn_level_pte()

David Woodhouse (4):
      intel-iommu: Precalculate superpage support for dmar_domain
      intel-iommu: Fix hardware_largepage_caps()
      intel-iommu: Fix inappropriate use of superpages in __domain_mapping()
      intel-iommu: Fix phys_pfn in __domain_mapping for sglist pages

Signed-off-by: Youquan Song <youquan.song@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agomtd: fix physmap.h warnings
Randy Dunlap [Mon, 23 May 2011 18:37:09 +0000 (11:37 -0700)]
mtd: fix physmap.h warnings

Fix build warnings in physmap.h:

include/linux/mtd/physmap.h:25: warning: 'struct platform_device' declared inside parameter list
include/linux/mtd/physmap.h:25: warning: its scope is only this definition or declaration, which is probably not what you want
include/linux/mtd/physmap.h:26: warning: 'struct platform_device' declared inside parameter list
include/linux/mtd/physmap.h:27: warning: 'struct platform_device' declared inside parameter list

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 years agoUBIFS: fix recovery broken by the previous recovery fix
Artem Bityutskiy [Thu, 26 May 2011 05:58:19 +0000 (08:58 +0300)]
UBIFS: fix recovery broken by the previous recovery fix

Unfortunately, the recovery fix d1606a59b6be4ea392eabd40d1250aa1eeb19efb
(UBIFS: fix extremely rare mount failure) broke recovery. This commit make
UBIFS drop the last min. I/O unit in all journal heads, but this is needed only
for the GC head. And this does not work for non-GC heads. For example, if
suppose we have min. I/O units A and B, and A contains a valid node X, which
was fsynced, and then a group of nodes Y which spans the rest of A and B. In
this case we'll drop not only Y, but also X, which is obviously incorrect.

This patch fixes the issue and additionally makes recovery to drop last min.
I/O unit only for the GC head, and leave things as they have been for ages for
the other heads - this is safer.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
13 years agoUBIFS: amend ubifs_recover_leb interface
Artem Bityutskiy [Thu, 26 May 2011 05:36:52 +0000 (08:36 +0300)]
UBIFS: amend ubifs_recover_leb interface

Instead of passing "grouped" parameter to 'ubifs_recover_leb()' which tells
whether the nodes are grouped in the LEB to recover, pass the journal head
number and let 'ubifs_recover_leb()' look at the journal head's 'grouped' flag.

This patch is a preparation to a further fix where we'll need to know the
journal head number for other purposes.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
13 years agoUBIFS: introduce a "grouped" journal head flag
Artem Bityutskiy [Thu, 26 May 2011 05:26:05 +0000 (08:26 +0300)]
UBIFS: introduce a "grouped" journal head flag

Journal heads are different in a way how UBIFS writes nodes there. All normal
journal heads receive grouped nodes, while the GC journal heads receives
ungrouped nodes. This patch adds a 'grouped' flag to 'struct ubifs_jhead' which
describes this property.

This patch is a preparation to a further recovery fix.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
13 years agoUBIFS: supress false error messages
Artem Bityutskiy [Thu, 26 May 2011 03:51:48 +0000 (06:51 +0300)]
UBIFS: supress false error messages

Commit ab51afe05273741f72383529ef488aa1ea598ec6 was a good clean-up, but
it introduced a regression - now UBIFS prints scary error messages during
recovery on all corrupted nodes, even though the corruptions are expected
(due to a power cut). This patch fixes the issue.

Additionally fix a typo in a commentary introduced by the same commit.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
13 years agoarm: omap2plus: move NAND_BLOCK_SIZE out of boards
Igor Grinberg [Mon, 30 May 2011 07:11:45 +0000 (00:11 -0700)]
arm: omap2plus: move NAND_BLOCK_SIZE out of boards

Several boards defining mtd partitions also defined NAND_BLOCK_SIZE as
SZ_128K. Move the define to common-board-devices.h

This removes multiple defines of NAND_BLOCK_SIZE.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
[tony@atomide.com: updated comments]
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoomap4: hwmod: Enable the keypad
Shubhrajyoti D [Wed, 4 May 2011 21:57:44 +0000 (14:57 -0700)]
omap4: hwmod: Enable the keypad

Commit 407a6888f7362cb3dabe69ea6d9dcf3c750dc56a (OMAP4: hwmod data:
Add AESS, McPDM, bandgap, counter_32k, MMC, KBD, ISS & IPU) added the
entry for keypad, but did not enable it.

Enable the keypad in the hwmod database so it works.

Signed-off-by: Shubhrajyoti D<shubhrajyoti@ti.com>
Acked-by: Benoit Cousson<b-cousson@ti.com>
[tony@atomide.com: updated comments]
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoomap3: Free Beagle rev gpios when they are read, so others can read them later
Tasslehoff Kjappfot [Tue, 31 May 2011 11:58:56 +0000 (04:58 -0700)]
omap3: Free Beagle rev gpios when they are read, so others can read them later

Free Beagle rev gpios when they are read, so others can read them later

Signed-off-by: Tasslehoff Kjappfot <tasskjapp@gmail.com>
[tony@atomide.com: updated comments]
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoarm: omap3: beagle: Ensure msecure is mux'd to be able to set the RTC
Alexander Holler [Tue, 5 Apr 2011 13:40:08 +0000 (15:40 +0200)]
arm: omap3: beagle: Ensure msecure is mux'd to be able to set the RTC

Without msecure beeing high it isn't possible to set (or start)
the RTC.

Tested with a BeagleBoard C4.

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoomap: rx51: Don't power up speaker amplifier at bootup
Jarkko Nikula [Tue, 31 May 2011 08:27:01 +0000 (11:27 +0300)]
omap: rx51: Don't power up speaker amplifier at bootup

Speaker amplifier is accidentally powered up in early TWL gpio setup. This
causes a few mA of needless battery current consumption. Without this patch
the amplifier can be shutdown only by having one active audio playback and
shutdown cycle to speaker output.

Thanks to Kalle Jokiniemi <kalle.jokiniemi@nokia.com> for noticing the issue.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Kalle Jokiniemi <kalle.jokiniemi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoomap: rx51: Set regulator V28_A always on
Jarkko Nikula [Tue, 31 May 2011 08:27:00 +0000 (11:27 +0300)]
omap: rx51: Set regulator V28_A always on

The V28_A domain in Nokia N900 that supplies VDD voltages to TLV320AIC34 and
TPA6130A2 should not be shutdown. This is because otherwise there will be
leak from VIO to VDD in TLV320AIC34 and this leak consumes more battery
current that is saved from keeping V28_A off. With this patch the battery
current consumption is approximately 1.5 mA lower.

Thanks to Kalle Jokiniemi <kalle.jokiniemi@nokia.com> for noticing the issue.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Kalle Jokiniemi <kalle.jokiniemi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoARM: OMAP4: MMC: no regulator off during probe for eMMC
Balaji T K [Mon, 30 May 2011 14:25:34 +0000 (19:55 +0530)]
ARM: OMAP4: MMC: no regulator off during probe for eMMC

eMMC does not handle power off when not in sleep state,
Skip regulator disable during probe when eMMC is
not in known state - state left by bootloader.

Resolves eMMC failure on OMAP4
mmc0: error -110 whilst initialising MMC card

Signed-off-by: Balaji T K <balajitk@ti.com>
Tested-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Acked-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoarm: omap2plus: fix ads7846 pendown gpio request
Igor Grinberg [Wed, 4 May 2011 15:04:55 +0000 (18:04 +0300)]
arm: omap2plus: fix ads7846 pendown gpio request

introduced by: 96974a24
(omap: consolidate touch screen initialization among different boards)

ads7846 driver can use either gpio_pendown or get_pendown_state()
callback. In case of gpio_pendown, it requests the provided gpio_pendown
thus resulting in double requesting that gpio:

ads7846 spi1.0: failed to request pendown GPIO57
ads7846: probe of spi1.0 failed with error -16

Fix this by restricting the gpio request to the case of
get_pendown_state() callback is used.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Tested-by: Thomas Weber <weber@corscience.de>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoARM: OMAP2: Add missing iounmap in omap4430_phy_init
Todd Poynor [Thu, 26 May 2011 19:25:53 +0000 (12:25 -0700)]
ARM: OMAP2: Add missing iounmap in omap4430_phy_init

!dev case needs iounmap before return.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoARM: omap4: Pass core and wakeup mux tables to omap4_mux_init
Colin Cross [Wed, 4 May 2011 21:57:57 +0000 (14:57 -0700)]
ARM: omap4: Pass core and wakeup mux tables to omap4_mux_init

OMAP4 contains two separate instances of the padconf registers,
one in the core system config and one in the wakeup system config.
Pass in two tables to apply the correct values to each instance.

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoARM: omap2+: mux: Allow board mux settings to be NULL
Colin Cross [Tue, 31 May 2011 19:00:09 +0000 (12:00 -0700)]
ARM: omap2+: mux: Allow board mux settings to be NULL

OMAP4 has two mux instances, and the board may not have settings
for one of them.  Allow the board file to pass NULL for an
instance's mux settings, which will initialize the mux instance
but skip writing board settings.

Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoOMAP4: fix return value of omap4_l3_init
Rabin Vincent [Sat, 7 May 2011 16:58:47 +0000 (22:28 +0530)]
OMAP4: fix return value of omap4_l3_init

Don't PTR_ERR() a non-error pointer:

 initcall omap4_l3_init+0x0/0xdc returned -544980480 after 0 usecs
 initcall omap4_l3_init+0x0/0xdc returned with error code -544980480

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoOMAP: iovmm: fix SW flags passed by user
Omar Ramirez Luna [Fri, 25 Mar 2011 20:04:31 +0000 (14:04 -0600)]
OMAP: iovmm: fix SW flags passed by user

Commit d038aee24dcd5a2a0d8547f5396f67ae9698ac8e
"omap: iovmm: don't check 'da' to set IOVMF_DA_FIXED flag",
changes iovmm to receive flags specified by user, however
the upper 16 bits of the flags are wiped by iovmm itself.

This fixes IOVMF_DA_FIXED flags from being lost, and lets the user
map its desired "device addresses".

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Acked-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoarch/arm/mach-omap1/dma.c: Invert calls to platform_device_put and platform_device_del
Julia Lawall [Fri, 13 May 2011 16:46:10 +0000 (18:46 +0200)]
arch/arm/mach-omap1/dma.c: Invert calls to platform_device_put and platform_device_del

Platform_device_del should be called before platform_device_put, as
platform_device_put can delete the structure.

Additionally, improve the error handling code for the call to ioremap, so
that it calls platform_device_put.

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

// <smpl>
@@
expression e1,e2;
@@

*platform_device_put(e1);
... when != e1 = e2
*platform_device_del(e1);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Wed, 1 Jun 2011 07:35:37 +0000 (16:35 +0900)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  AppArmor: fix oops in apparmor_setprocattr

13 years agokgdbts: only use new asm-generic/ptrace.h api when needed
Mike Frysinger [Sat, 28 May 2011 14:04:25 +0000 (10:04 -0400)]
kgdbts: only use new asm-generic/ptrace.h api when needed

The new instruction_pointer_set helper is defined for people who have
converted to asm-generic/ptrace.h, so don't use it generally unless
the arch needs it (in which case it has been converted).  This should
fix building of kgdb tests for arches not yet converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoOMAP2+: mux: fix compilation warnings
Govindraj.R [Wed, 1 Jun 2011 05:58:56 +0000 (11:28 +0530)]
OMAP2+: mux: fix compilation warnings

Fix below compilation warnings.

arch/arm/mach-omap2/omap_hwmod.c: In function 'omap_hwmod_for_each':
arch/arm/mach-omap2/omap_hwmod.c:1631: warning: 'ret' may be used uninitialized in this function

arch/arm/mach-omap2/mux.c: In function 'omap_mux_get_gpio':
arch/arm/mach-omap2/mux.c:917: warning: 'm' may be used uninitialized in this function

Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
13 years agoblock: blkdev_get() should access ->bd_disk only after success
Tejun Heo [Wed, 1 Jun 2011 06:27:41 +0000 (08:27 +0200)]
block: blkdev_get() should access ->bd_disk only after success

d4dc210f69 (block: don't block events on excl write for non-optical
devices) added dereferencing of bdev->bd_disk to test
GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE; however, bdev->bd_disk can be
%NULL if open failed which can lead to an oops.

Test the flag after testing open was successful, not before.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: David Miller <davem@davemloft.net>
Tested-by: David Miller <davem@davemloft.net>
Cc: stable@kernel.org
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agoAppArmor: fix oops in apparmor_setprocattr
Kees Cook [Tue, 31 May 2011 18:31:41 +0000 (11:31 -0700)]
AppArmor: fix oops in apparmor_setprocattr

When invalid parameters are passed to apparmor_setprocattr a NULL deref
oops occurs when it tries to record an audit message. This is because
it is passing NULL for the profile parameter for aa_audit. But aa_audit
now requires that the profile passed is not NULL.

Fix this by passing the current profile on the task that is trying to
setprocattr.

Signed-off-by: Kees Cook <kees@ubuntu.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Cc: stable@kernel.org
Signed-off-by: James Morris <jmorris@namei.org>
13 years agoRevert "net: fix section mismatches"
David S. Miller [Wed, 1 Jun 2011 02:27:48 +0000 (19:27 -0700)]
Revert "net: fix section mismatches"

This reverts commit e5cb966c0838e4da43a3b0751bdcac7fe719f7b4.

It causes new build regressions with gcc-4.2 which is
pretty common on non-x86 platforms.

Reported-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/usb/catc.c: Fix potential deadlock in catc_ctrl_run()
Alexey Khoroshilov [Mon, 30 May 2011 07:06:24 +0000 (07:06 +0000)]
drivers/net/usb/catc.c: Fix potential deadlock in catc_ctrl_run()

catc_ctrl_run() calls usb_submit_urb() with GFP_KERNEL, while it is called from
catc_ctrl_async() and catc_ctrl_done() with catc->ctrl_lock spinlock held.

The patch replaces GFP_KERNEL with GFP_ATOMIC.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: stop pending timers and purge queues when peer restart asoc
Wei Yongjun [Sun, 29 May 2011 23:23:36 +0000 (23:23 +0000)]
sctp: stop pending timers and purge queues when peer restart asoc

If the peer restart the asoc, we should not only fail any unsent/unacked
data, but also stop the T3-rtx, SACK, T4-rto timers, and teardown ASCONF
queues.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net: ks8842 Fix crash on received packet when in PIO mode.
Dennis Aberilla [Sun, 29 May 2011 11:46:54 +0000 (11:46 +0000)]
drivers/net: ks8842 Fix crash on received packet when in PIO mode.

This patch fixes a driver crash during packet reception due to not enough
bytes allocated in the skb. Since the loop reads out 4 bytes at a time, we
need to allow for up to 3 bytes of slack space.

Signed-off-by: Dennis Aberilla <denzzzhome@yahoo.com>
Signed-off-by: David S. Miller <davem@zippy.davemloft.net>
13 years agoip_options_compile: properly handle unaligned pointer
Chris Metcalf [Sun, 29 May 2011 10:55:44 +0000 (10:55 +0000)]
ip_options_compile: properly handle unaligned pointer

The current code takes an unaligned pointer and does htonl() on it to
make it big-endian, then does a memcpy().  The problem is that the
compiler decides that since the pointer is to a __be32, it is legal
to optimize the copy into a processor word store.  However, on an
architecture that does not handled unaligned writes in kernel space,
this produces an unaligned exception fault.

The solution is to track the pointer as a "char *" (which removes a bunch
of unpleasant casts in any case), and then just use put_unaligned_be32()
to write the value to memory.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: David S. Miller <davem@zippy.davemloft.net>
13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
Linus Torvalds [Tue, 31 May 2011 21:45:08 +0000 (06:45 +0900)]
Merge git://git./linux/kernel/git/rusty/linux-2.6-for-linus

* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  virtio_net: delay TX callbacks
  virtio: add api for delayed callbacks
  virtio_test: support event index
  vhost: support event index
  virtio_ring: support event idx feature
  virtio ring: inline function to check for events
  virtio: event index interface
  virtio: add full three-clause BSD text to headers.
  virtio balloon: kill tell-host-first logic
  virtio console: don't manually set or finalize VIRTIO_CONSOLE_F_MULTIPORT.
  drivers, block: virtio_blk: Replace cryptic number with the macro
  virtio_blk: allow re-reading config space at runtime
  lguest: remove support for VIRTIO_F_NOTIFY_ON_EMPTY.
  lguest: fix up compilation after move
  lguest: fix timer interrupt setup

13 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Tue, 31 May 2011 21:44:10 +0000 (06:44 +0900)]
Merge branch 'release' of git://git./linux/kernel/git/aegl/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] wire up sendmmsg() syscall for Itanium

13 years agoiwlagn: fix incorrect PCI subsystem id for 6150 devices
Wey-Yi Guy [Mon, 30 May 2011 16:32:52 +0000 (09:32 -0700)]
iwlagn: fix incorrect PCI subsystem id for 6150 devices

For 6150 devices, modify the supported PCI subsystem ID.

Cc: stable@kernel.org
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agozd1211rw: fix to work on OHCI
Jussi Kivilinna [Mon, 30 May 2011 07:15:47 +0000 (10:15 +0300)]
zd1211rw: fix to work on OHCI

zd1211 devices register 'EP 4 OUT' endpoint as Interrupt type on USB 2.0:

      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1

However on USB 1.1 endpoint becomes Bulk:

      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0

Commit 37939810b937aba830dd751291fcdc51cae1a6cb assumed that endpoint is
always interrupt type and changed usb_bulk_msg() calls to usb_interrupt_msg().

Problem here is that usb_bulk_msg() on interrupt endpoint selfcorrects the
call and changes requested pipe to interrupt type (see usb_bulk_msg).
However with usb_interrupt_msg() on bulk endpoint does not correct the
pipe type to bulk, but instead URB is submitted with interrupt type pipe.

So pre-2.6.39 used usb_bulk_msg() and therefore worked with both endpoint
types, however in 2.6.39 usb_interrupt_msg() with bulk endpoint causes
ohci_hcd to fail submitted URB instantly with -ENOSPC and preventing zd1211rw
from working with OHCI.

Fix this by detecting endpoint type and using correct endpoint/pipe types
for URB. Also fix asynchronous zd_usb_iowrite16v_async() to use right
URB type on 'EP 4 OUT'.

Cc: stable@kernel.org
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl12xx: fix oops in sched_scan when forcing a passive scan
Luciano Coelho [Fri, 27 May 2011 12:34:48 +0000 (15:34 +0300)]
wl12xx: fix oops in sched_scan when forcing a passive scan

Fix kernel oops when trying to use passive scheduled scans.  The
reason was that in passive scans there are no SSIDs, so there was a
NULL pointer dereference.

To solve the problem, we now check the number of SSIDs provided in the
sched_scan request and only access the list if there's one or more
(ie. passive scan is not forced).  We also force all the channels to
be passive by adding the IEEE80211_CHAN_PASSIVE_SCAN flag locally
before the checks in the wl1271_scan_get_sched_scan_channels()
function.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl12xx: add separate config value for DFS dwell time on sched scan
Luciano Coelho [Fri, 27 May 2011 12:34:47 +0000 (15:34 +0300)]
wl12xx: add separate config value for DFS dwell time on sched scan

Use a different value for DFS dwell time when performing a scheduled
scan.  Previously we were using the same value as for normal passive
scans.  This adds some flexibility between these two different types
of passive scan.

For now we use 150 TUs for DFS channel dwell time.  This may need to
be fine-tuned in the future.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl12xx: fix DFS channels handling in scheduled scan
Luciano Coelho [Fri, 27 May 2011 12:34:46 +0000 (15:34 +0300)]
wl12xx: fix DFS channels handling in scheduled scan

DFS channels were never getting included in the scheduled scans,
because they always contain the passive flag as well and the call was
asking for DFS and active channels.

Fix this by ignoring the passive flag when collecting DFS channels.
Also, move the DFS channels in the channel list before the 5GHz active
channels (this was implemented in the FW differently than specified).

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl12xx: fix passive and radar channel generation for scheduled scan
Luciano Coelho [Fri, 27 May 2011 12:34:45 +0000 (15:34 +0300)]
wl12xx: fix passive and radar channel generation for scheduled scan

We were comparing bitwise AND results with a boolean, so when the
boolean was set to true, it was not matching as it should.

Fix this by booleanizing the bitwise AND results with !!.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: Set command sequence number later to ensure consistency
Daniel Drake [Thu, 26 May 2011 20:31:08 +0000 (21:31 +0100)]
libertas: Set command sequence number later to ensure consistency

Before this patch, the command sequence number is being set before
lbs_queue_cmd() adds the command to the queue. However, lbs_queue_cmd()
sometimes forces commands to queue-jump (e.g. CMD_802_11_WAKEUP_CONFIRM).
It currently does this without considering that sequence numbers might need
adjusting to keep things running in order.

Fix this by setting the sequence number at a later stage, just before
we're actually submitting the command to the hardware. Also fixes a
possible race where seqnum was being modified outside of the driver
lock.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoCFQ: Fix typo and remove unnecessary semicolon
Kyungmin Park [Tue, 31 May 2011 08:04:09 +0000 (10:04 +0200)]
CFQ: Fix typo and remove unnecessary semicolon

Fix comment typo and remove unnecessary semicolon at macro

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years ago[IA64] wire up sendmmsg() syscall for Itanium
Tony Luck [Tue, 31 May 2011 17:09:24 +0000 (10:09 -0700)]
[IA64] wire up sendmmsg() syscall for Itanium

Add entries in unistd.h and entry.S to make this new syscall visible.

Signed-off-by: Tony Luck <tony.luck@intel.com>
13 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 31 May 2011 17:07:22 +0000 (02:07 +0900)]
Merge branch 'x86-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Fix mwait_play_dead() faulting on mwait-incapable cpus
  x86 idle: Fix mwait deprecation warning message

Evil merge to remove extra quote noticed by Joe Perches

13 years agoMerge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 31 May 2011 17:03:22 +0000 (02:03 +0900)]
Merge branch 'core-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  rcu: Cure load woes