8 years agohwmon: (coretemp) Further relax temperature range checks
Guenter Roeck [Wed, 1 Jun 2011 18:03:41 +0000]
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>

8 years agohwmon: (coretemp) Fix TjMax detection for older CPUs
Guenter Roeck [Tue, 31 May 2011 13:54:21 +0000]
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


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

8 years agoRevert "mm: fail GFP_DMA allocations when ZONE_DMA is not configured"
Linus Torvalds [Wed, 1 Jun 2011 21:11:24 +0000]
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>

8 years agoMerge git://git.infradead.org/iommu-2.6
Linus Torvalds [Wed, 1 Jun 2011 20:48:50 +0000]
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

8 years agoblock: fix mismerge of the DISK_EVENT_MEDIA_CHANGE removal
Linus Torvalds [Wed, 1 Jun 2011 20:29:19 +0000]
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

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>

8 years agotile: enable CONFIG_BUGVERBOSE
Chris Metcalf [Wed, 1 Jun 2011 20:06:04 +0000]

Trivial config change to enable backtraces on panic.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

8 years agoiwl4965: correctly validate temperature value
Stanislaw Gruszka [Wed, 1 Jun 2011 15:17:57 +0000]
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.


Cc: stable@kernel.org # 2.6.39+
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

8 years agobluetooth l2cap: fix locking in l2cap_global_chan_by_psm
Johannes Berg [Wed, 1 Jun 2011 06:29:54 +0000]
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>

8 years agoath9k: fix two more bugs in tx power
Daniel Halperin [Tue, 31 May 2011 18:59:30 +0000]
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>

8 years agocfg80211: don't drop p2p probe responses
Eliad Peller [Sun, 29 May 2011 12:53:20 +0000]
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>

8 years agohwmon: (coretemp) Relax target temperature range check
Jean Delvare [Tue, 31 May 2011 19:50:51 +0000]
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>

8 years agohwmon: (max6642) Rename temp_fault sysfs attribute to temp2_fault
Per Dalen [Tue, 31 May 2011 13:54:21 +0000]
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>

8 years agoxen/blkback: potential null dereference in error handling
Dan Carpenter [Fri, 27 May 2011 06:27:16 +0000]
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>

8 years agoxen/blkback: don't call vbd_size() if bd_disk is NULL
Laszlo Ersek [Wed, 25 May 2011 10:24:25 +0000]
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>

8 years agoMerge git://git.infradead.org/mtd-2.6
Linus Torvalds [Wed, 1 Jun 2011 12:47:39 +0000]
Merge git://git.infradead.org/mtd-2.6

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

8 years agointel-iommu: Fix off-by-one in RMRR setup
David Woodhouse [Mon, 30 May 2011 23:22:52 +0000]
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>

8 years agoARM: OMAP4: MMC: increase delay for pbias
Balaji T K [Wed, 1 Jun 2011 11:15:22 +0000]
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>

8 years agointel-iommu: Add domain check in domain_remove_one_dev_info
Mike Habeck [Sat, 28 May 2011 18:15:07 +0000]
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>

8 years agointel-iommu: Remove Host Bridge devices from identity mapping
Mike Travis [Sat, 28 May 2011 18:15:06 +0000]
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>

8 years agointel-iommu: Use coherent DMA mask when requested
Mike Travis [Sat, 28 May 2011 18:15:05 +0000]
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

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>

8 years agointel-iommu: Dont cache iova above 32bit
Chris Wright [Sat, 28 May 2011 18:15:04 +0000]
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.


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>

8 years agointel-iommu: Speed up processing of the identity_mapping function
Mike Travis [Sat, 28 May 2011 18:15:03 +0000]
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>

8 years agointel-iommu: Check for identity mapping candidate using system dma mask
Chris Wright [Sat, 28 May 2011 18:15:02 +0000]
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>

8 years agointel-iommu: Only unlink device domains from iommu
Alex Williamson [Tue, 24 May 2011 16:19:04 +0000]
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>

8 years agointel-iommu: Enable super page (2MiB, 1GiB, etc.) support
Youquan Song [Wed, 25 May 2011 18:13:49 +0000]
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>

8 years agomtd: fix physmap.h warnings
Randy Dunlap [Mon, 23 May 2011 18:37:09 +0000]
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>

8 years agoUBIFS: fix recovery broken by the previous recovery fix
Artem Bityutskiy [Thu, 26 May 2011 05:58:19 +0000]
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>

8 years agoUBIFS: amend ubifs_recover_leb interface
Artem Bityutskiy [Thu, 26 May 2011 05:36:52 +0000]
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>

8 years agoUBIFS: introduce a "grouped" journal head flag
Artem Bityutskiy [Thu, 26 May 2011 05:26:05 +0000]
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>

8 years agoUBIFS: supress false error messages
Artem Bityutskiy [Thu, 26 May 2011 03:51:48 +0000]
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>

8 years agoarm: omap2plus: move NAND_BLOCK_SIZE out of boards
Igor Grinberg [Mon, 30 May 2011 07:11:45 +0000]
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>

8 years agoomap4: hwmod: Enable the keypad
Shubhrajyoti D [Wed, 4 May 2011 21:57:44 +0000]
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>

8 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]
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>

8 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]
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>

8 years agoomap: rx51: Don't power up speaker amplifier at bootup
Jarkko Nikula [Tue, 31 May 2011 08:27:01 +0000]
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>

8 years agoomap: rx51: Set regulator V28_A always on
Jarkko Nikula [Tue, 31 May 2011 08:27:00 +0000]
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>

8 years agoARM: OMAP4: MMC: no regulator off during probe for eMMC
Balaji T K [Mon, 30 May 2011 14:25:34 +0000]
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>

8 years agoarm: omap2plus: fix ads7846 pendown gpio request
Igor Grinberg [Wed, 4 May 2011 15:04:55 +0000]
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>

8 years agoARM: OMAP2: Add missing iounmap in omap4430_phy_init
Todd Poynor [Thu, 26 May 2011 19:25:53 +0000]
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>

8 years agoARM: omap4: Pass core and wakeup mux tables to omap4_mux_init
Colin Cross [Wed, 4 May 2011 21:57:57 +0000]
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>

8 years agoARM: omap2+: mux: Allow board mux settings to be NULL
Colin Cross [Tue, 31 May 2011 19:00:09 +0000]
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>

8 years agoOMAP4: fix return value of omap4_l3_init
Rabin Vincent [Sat, 7 May 2011 16:58:47 +0000]
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>

8 years agoOMAP: iovmm: fix SW flags passed by user
Omar Ramirez Luna [Fri, 25 Mar 2011 20:04:31 +0000]
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>

8 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]
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:

// <smpl>
expression e1,e2;

... when != e1 = e2
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Tony Lindgren <tony@atomide.com>

8 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]
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

8 years agokgdbts: only use new asm-generic/ptrace.h api when needed
Mike Frysinger [Sat, 28 May 2011 14:04:25 +0000]
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>

8 years agoOMAP2+: mux: fix compilation warnings
Govindraj.R [Wed, 1 Jun 2011 05:58:56 +0000]
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>

8 years agoblock: blkdev_get() should access ->bd_disk only after success
Tejun Heo [Wed, 1 Jun 2011 06:27:41 +0000]
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>

8 years agoAppArmor: fix oops in apparmor_setprocattr
Kees Cook [Tue, 31 May 2011 18:31:41 +0000]
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

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>

8 years agoRevert "net: fix section mismatches"
David S. Miller [Wed, 1 Jun 2011 02:27:48 +0000]
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>

8 years agodrivers/net/usb/catc.c: Fix potential deadlock in catc_ctrl_run()
Alexey Khoroshilov [Mon, 30 May 2011 07:06:24 +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>

8 years agosctp: stop pending timers and purge queues when peer restart asoc
Wei Yongjun [Sun, 29 May 2011 23:23:36 +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

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

8 years agodrivers/net: ks8842 Fix crash on received packet when in PIO mode.
Dennis Aberilla [Sun, 29 May 2011 11:46:54 +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>

8 years agoip_options_compile: properly handle unaligned pointer
Chris Metcalf [Sun, 29 May 2011 10:55:44 +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>

8 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]
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

8 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]
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

8 years agoiwlagn: fix incorrect PCI subsystem id for 6150 devices
Wey-Yi Guy [Mon, 30 May 2011 16:32:52 +0000]
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>

8 years agozd1211rw: fix to work on OHCI
Jussi Kivilinna [Mon, 30 May 2011 07:15:47 +0000]
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>

8 years agowl12xx: fix oops in sched_scan when forcing a passive scan
Luciano Coelho [Fri, 27 May 2011 12:34:48 +0000]
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()

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

8 years agowl12xx: add separate config value for DFS dwell time on sched scan
Luciano Coelho [Fri, 27 May 2011 12:34:47 +0000]
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>

8 years agowl12xx: fix DFS channels handling in scheduled scan
Luciano Coelho [Fri, 27 May 2011 12:34:46 +0000]
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>

8 years agowl12xx: fix passive and radar channel generation for scheduled scan
Luciano Coelho [Fri, 27 May 2011 12:34:45 +0000]
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>

8 years agolibertas: Set command sequence number later to ensure consistency
Daniel Drake [Thu, 26 May 2011 20:31:08 +0000]
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

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

8 years agoCFQ: Fix typo and remove unnecessary semicolon
Kyungmin Park [Tue, 31 May 2011 08:04:09 +0000]
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>

8 years ago[IA64] wire up sendmmsg() syscall for Itanium
Tony Luck [Tue, 31 May 2011 17:09:24 +0000]
[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>

8 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]
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

8 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]
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

8 years agoOMAP: SRAM: Fix warning: format '%08lx' expects type 'long unsigned int'
Santosh Shilimkar [Mon, 4 Apr 2011 08:50:08 +0000]
OMAP: SRAM: Fix warning: format '%08lx' expects type 'long unsigned int'

Fix below build warning.

 CC arch/arm/plat-omap/sram.o
arch/arm/plat-omap/sram.c: In function 'omap_map_sram':
arch/arm/plat-omap/sram.c:224: warning: format '%08lx' expects
type 'long unsigned int', but argument 2 has type 'unsigned int'

While at this, convert SRAM printk(* "") to pr_*("").

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Tony Lindgren <tony@atomide.com>

8 years agoarm: omap3: cm-t3517: fix section mismatch warning
Igor Grinberg [Mon, 30 May 2011 07:11:45 +0000]
arm: omap3: cm-t3517: fix section mismatch warning

WARNING: arch/arm/mach-omap2/built-in.o(.text+0x11014): Section mismatch
in reference from the function cm_t3517_init_usbh() to the (unknown
reference) .init.data:(unknown)
The function cm_t3517_init_usbh() references
the (unknown reference) __initdata (unknown).
This is often because cm_t3517_init_usbh lacks a __initdata
annotation or the annotation of (unknown) is wrong.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Tony Lindgren <tony@atomide.com>

8 years agoOMAP2+: Fix 9 section mismatch(es) warnings from mach-omap2/built-in.o
Santosh Shilimkar [Mon, 30 May 2011 07:11:45 +0000]
OMAP2+: Fix 9 section mismatch(es) warnings from mach-omap2/built-in.o

The serial*_data should have been marked as __initdata as per
it's usage in the board files. Fix the same to remove the
section mismatch warnings caused by it.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Silesh C V <silesh@ti.com>
[tony@atomide.com: updated with additional fixes from Silesh]
Signed-off-by: Tony Lindgren <tony@atomide.com>

8 years agoARM: OMAP2: Add missing include of linux/gpio.h
Axel Lin [Tue, 31 May 2011 12:55:44 +0000]
ARM: OMAP2: Add missing include of linux/gpio.h

I got some build error like below while executing "make omap2plus_defconfig".

CC arch/arm/mach-omap2/board-2430sdp.o
arch/arm/mach-omap2/board-2430sdp.c: In function 'omap_2430sdp_init':
arch/arm/mach-omap2/board-2430sdp.c:247: error: 'GPIOF_OUT_INIT_LOW' undeclared (first use in this function)
arch/arm/mach-omap2/board-2430sdp.c:247: error: (Each undeclared identifier is reported only once
arch/arm/mach-omap2/board-2430sdp.c:247: error: for each function it appears in.)

This patch fixes the build error by include linux/gpio.h instead of mach/gpio.h.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Syed Mohammed Khasim <x0khasim@ti.com>
Cc: Grazvydas Ignotas <notasas@gmail.com>
Cc: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>

8 years agoOMAP: fix compilation error
Janusz Krzysztofik [Mon, 30 May 2011 22:44:31 +0000]
OMAP: fix compilation error

Forward-declare platform_device structure in
arch/arm/plat-omap/include/plat/flash.h, otherwise compilation may break

In file included from arch/arm/mach-omap1/flash.c:15:
arch/arm/plat-omap/include/plat/flash.h:14: warning: 'struct platform_device' declared inside parameter list
arch/arm/plat-omap/include/plat/flash.h:14: warning: its scope is only this definition or declaration, which is probably not what you want
arch/arm/mach-omap1/flash.c:16: warning: 'struct platform_device' declared inside parameter list
arch/arm/mach-omap1/flash.c:17: error: conflicting types for 'omap1_set_vpp'
arch/arm/plat-omap/include/plat/flash.h:14: error: previous declaration of 'omap1_set_vpp' was here

Detected and corrected while building for Amstrad Delta, confirmed with

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Tony Lindgren <tony@atomide.com>

8 years agoblock: remove unwanted semicolons
Namhyung Kim [Tue, 31 May 2011 11:45:53 +0000]
block: remove unwanted semicolons

Since those defined functions require additional semicolon
from the caller, they could cause potential syntax errors
when used in if-else statements.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>

8 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 31 May 2011 11:32:54 +0000]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Put back -pg to tsc.o and add no GCOV to vread_tsc_64.o

8 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
Linus Torvalds [Tue, 31 May 2011 11:30:59 +0000]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  autofs4: bogus dentry_unhash() added in ->unlink()
  vfs: shrink_dcache_parent before rmdir, dir rename

8 years agopowerpc/pmac: Don't register pmac PIC syscore ops when HW not present
Benjamin Herrenschmidt [Tue, 31 May 2011 08:01:23 +0000]
powerpc/pmac: Don't register pmac PIC syscore ops when HW not present

The Apple custom PIC only exist in some earlier machine models,
anything with an MPIC will crash on suspend if we register those
syscore ops unconditionally.

This is a regression caused by commit f5a592f7d74e ("PM / PowerPC: Use
struct syscore_ops instead of sysdevs for PM")

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

8 years agofat: Fix corrupt inode flags when remove ATTR_SYS flag
OGAWA Hirofumi [Tue, 31 May 2011 10:38:07 +0000]
fat: Fix corrupt inode flags when remove ATTR_SYS flag

We are clearly missing '~' in fat_ioctl_set_attributes().

Cc: <stable@kernel.org>
Reported-by: Dmitry Dmitriev <dimondmm@yandex.ru>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

8 years agorcu: Cure load woes
Peter Zijlstra [Mon, 30 May 2011 11:34:51 +0000]
rcu: Cure load woes

Commit cc3ce5176d83 (rcu: Start RCU kthreads in TASK_INTERRUPTIBLE
state) fudges a sleeping task' state, resulting in the scheduler seeing
task waking up. The result is unbalanced load calculation.

The problem that patch tried to address is that the RCU threads could
stay in UNINTERRUPTIBLE state for quite a while and triggering the hung
task detector due to on-demand wake-ups.

Cure the problem differently by always giving the tasks at least one
wake-up once the CPU is fully up and running, this will kick them out of
the initial UNINTERRUPTIBLE state and into the regular INTERRUPTIBLE
wait state.

[ The alternative would be teaching kthread_create() to start threads as
  INTERRUPTIBLE but that needs a tad more thought. ]

Reported-by: Damien Wyart <damien.wyart@free.fr>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Paul E. McKenney <paul.mckenney@linaro.org>
Link: http://lkml.kernel.org/r/1306755291.1200.2872.camel@twins
Signed-off-by: Ingo Molnar <mingo@elte.hu>

8 years agoMerge branch 'sh/runtime-pm-misery' into sh-fixes-for-linus
Paul Mundt [Tue, 31 May 2011 07:00:58 +0000]
Merge branch 'sh/runtime-pm-misery' into sh-fixes-for-linus

8 years agodmaengine: shdma: Fix up fallout from runtime PM changes.
Paul Mundt [Tue, 31 May 2011 06:53:03 +0000]
dmaengine: shdma: Fix up fallout from runtime PM changes.

The runtime PM changes introduce sh_dmae_rst() wrapping via the
runtime_resume helper, depending on dev_get_drvdata() to fetch the
platform data needed for the DMAOR initialization default at a time
where drvdata hasn't yet been established by the probe path, resulting
in general probe misery:

        Unable to handle kernel NULL pointer dereference at virtual address 000000c4
        pc = 8025adee
        *pde = 00000000
        Oops: 0000 [#1]
        Modules linked in:

        Pid : 1, Comm:           swapper
        CPU : 0                  Not tainted  (3.0.0-rc1-00012-g9436b4a-dirty #1456)

        PC is at sh_dmae_rst+0x28/0x86
        PR is at sh_dmae_rst+0x22/0x86
        PC  : 8025adee SP  : 9e803d10 SR  : 400080f1 TEA : 000000c4
        R0  : 000000c4 R1  : 0000fff8 R2  : 00000000 R3  : 00000040
        R4  : 000000f0 R5  : 00000000 R6  : 00000000 R7  : 804f184c
        R8  : 00000000 R9  : 804dd0e8 R10 : 80283204 R11 : ffffffda
        R12 : 000000a0 R13 : 804dd18c R14 : 9e803d10
        MACH: 00000000 MACL: 00008f20 GBR : 00000000 PR  : 8025ade8

        Call trace:
        [<8025ae70>] sh_dmae_runtime_resume+0x24/0x34
        [<80283238>] pm_generic_runtime_resume+0x34/0x3c
        [<80283370>] rpm_callback+0x4a/0x7e
        [<80283efc>] rpm_resume+0x240/0x384
        [<80283f54>] rpm_resume+0x298/0x384
        [<8028428c>] __pm_runtime_resume+0x44/0x7c
        [<8038a358>] __ioremap_caller+0x0/0xec
        [<80284296>] __pm_runtime_resume+0x4e/0x7c
        [<8038a358>] __ioremap_caller+0x0/0xec
        [<80666254>] sh_dmae_probe+0x180/0x6a0
        [<802803ae>] platform_drv_probe+0x26/0x2e

Fix up the ordering accordingly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

8 years agoRevert "clocksource: sh_cmt: Runtime PM support"
Paul Mundt [Tue, 31 May 2011 06:26:42 +0000]
Revert "clocksource: sh_cmt: Runtime PM support"

This reverts commit 01fa68b58492a5d6708a91c1f474b6a099a9509e.

The same note as per the sh_tmu change applies here, too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

8 years agoRevert "clocksource: sh_tmu: Runtime PM support"
Paul Mundt [Tue, 31 May 2011 06:23:20 +0000]
Revert "clocksource: sh_tmu: Runtime PM support"

This reverts commit 1b842e91fea9447eff5eb687e28ad61c02f5033e.

There is a fundamental ordering race between the early and late probe
paths and the runtime PM tie-in that results in __pm_runtime_resume()
attempting to take a lock that hasn't been initialized yet (which by
proxy also suggests that pm_runtime_init() hasn't yet been run on the
device either, making the entire thing unsafe) -- resulting in instant
death on SMP or on UP with spinlock debugging enabled:

 sh_tmu.0: used for clock events
 sh_tmu.0: used for periodic clock events
BUG: spinlock trylock failure on UP on CPU#0, swapper/0
 lock: 804db198, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0

Revert it for now until the ordering issues can be resolved, or we can get
some more help from the runtime PM framework to make this possible.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

8 years agosh: Fix up asm-generic/ptrace.h fallout.
Paul Mundt [Tue, 31 May 2011 05:39:49 +0000]
sh: Fix up asm-generic/ptrace.h fallout.

There was an ordering issue with regards to instruction_pointer() being
used in profile_pc() prior to the asm-generic/ptrace.h include, which
subsequently provided the instruction_pointer() definition. In the
interest of simplicity we simply open-code the regs->pc deref for the
profile_pc() definition instead.

The FP functions were also broken due to a lack of a common regs->fp,
so provide a common GET_FP() that is safe for both architectures in order
to fix up the frame pointer helpers too.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

8 years agosh64: Move from P1SEG to CAC_ADDR for consistent sync.
Paul Mundt [Tue, 31 May 2011 05:38:29 +0000]
sh64: Move from P1SEG to CAC_ADDR for consistent sync.

sh64 doesn't define a P1SEGADDR, resulting in a build failure. The proper
mapping can be attained for both sh32 and 64 via the CAC_ADDR macro, so
switch to that instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

8 years agosh64: asm/pgtable.h needs asm/mmu.h
Paul Mundt [Tue, 31 May 2011 05:37:44 +0000]
sh64: asm/pgtable.h needs asm/mmu.h

Needed to satisfy the __in_29bit_mode() check.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

8 years agosh: asm/tlb.h needs linux/swap.h
Nobuhiro Iwamatsu [Tue, 31 May 2011 04:27:41 +0000]
sh: asm/tlb.h needs linux/swap.h

Commit 1e56a56410bb64bce62d44563e35a143fc2d515f introduced the mmu_gather
rework for sh, but missed a linux/swap.h include:

CC      arch/sh/mm/tlb-urb.o
In file included from arch/sh/mm/tlb-urb.c:14:0:
arch/sh/include/asm/tlb.h: In function '__tlb_remove_page':
arch/sh/include/asm/tlb.h:92:2: error: implicit declaration of function 'free_page_and_swap_cache'

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

8 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux...
Paul Mundt [Tue, 31 May 2011 04:10:26 +0000]
Merge branch 'master' of git://git./linux/kernel/git/torvalds/linux-2.6 into sh-fixes-for-linus

8 years agox86: Fix mwait_play_dead() faulting on mwait-incapable cpus
Avi Kivity [Mon, 30 May 2011 12:23:57 +0000]
x86: Fix mwait_play_dead() faulting on mwait-incapable cpus

A logic error in mwait_play_dead() causes the kernel to use
mwait even on cpus which don't support it, such as KVM virtual

Introduced by:

  349c004e3d31: x86: A fast way to check capabilities of the current cpu

Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=36222
Reported-by: Török Edwin <edwintorok@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/1306758237-9327-1-git-send-email-avi@redhat.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>

8 years agox86 idle: Fix mwait deprecation warning message
Borislav Petkov [Mon, 30 May 2011 09:38:06 +0000]
x86 idle: Fix mwait deprecation warning message


  arch/x86/kernel/process.c:645:1: warning: unknown escape sequence '\i'

due to missing escape backslash, introduced by this commit:

  5d4c47e0195b: x86 idle: deprecate mwait_idle() and "idle=mwait" cmdline param

Signed-off-by: Borislav Petkov <bp@alien8.de>
Cc: Len Brown <len.brown@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1306748286-24701-1-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@elte.hu>

8 years agoautofs4: bogus dentry_unhash() added in ->unlink()
Al Viro [Mon, 30 May 2011 05:50:53 +0000]
autofs4: bogus dentry_unhash() added in ->unlink()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

8 years agovfs: shrink_dcache_parent before rmdir, dir rename
Sage Weil [Mon, 30 May 2011 04:20:59 +0000]
vfs: shrink_dcache_parent before rmdir, dir rename

The dentry_unhash push-down series missed that shink_dcache_parent needs to
be called prior to rmdir or dir rename to clear DCACHE_REFERENCED and
allow efficient dentry reclaim.

Reported-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

8 years agoRevert "block: Remove extra discard_alignment from hd_struct."
Jens Axboe [Mon, 30 May 2011 05:42:51 +0000]
Revert "block: Remove extra discard_alignment from hd_struct."

It was not a good idea to start dereferencing disk->queue from
the fs sysfs strategy for displaying discard alignment. We ran
into first a NULL pointer deref, and after fixing that we sometimes
see unvalid disk->queue pointer values.

Since discard is the only one of the bunch actually looking into
the queue, just revert the change.

This reverts commit 23ceb5b7719e9276d4fa72a3ecf94dd396755276.


8 years agovirtio_net: delay TX callbacks
Michael S. Tsirkin [Thu, 19 May 2011 23:11:23 +0000]
virtio_net: delay TX callbacks

Ask for delayed callbacks on TX ring full, to give the
other side more of a chance to make progress.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

8 years agovirtio: add api for delayed callbacks
Michael S. Tsirkin [Thu, 19 May 2011 23:11:14 +0000]
virtio: add api for delayed callbacks

Add an API that tells the other side that callbacks
should be delayed until a lot of work has been done.
Implement using the new event_idx feature.

Note: it might seem advantageous to let the drivers
ask for a callback after a specific capacity has
been reached. However, as a single head can
free many entries in the descriptor table,
we don't really have a clue about capacity
until get_buf is called. The API is the simplest
to implement at the moment, we'll see what kind of
hints drivers can pass when there's more than one
user of the feature.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

8 years agovirtio_test: support event index
Michael S. Tsirkin [Thu, 19 May 2011 23:11:05 +0000]
virtio_test: support event index

Add ability to test the new event idx feature,
enable by default.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

8 years agovhost: support event index
Michael S. Tsirkin [Thu, 19 May 2011 23:10:54 +0000]
vhost: support event index

Support the new event index feature. When acked,
utilize it to reduce the # of interrupts sent to the guest.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

8 years agovirtio_ring: support event idx feature
Michael S. Tsirkin [Thu, 19 May 2011 23:10:44 +0000]
virtio_ring: support event idx feature

Support for the new event idx feature:
1. When enabling interrupts, publish the current avail index
   value to the host to get interrupts on the next update.
2. Use the new avail_event feature to reduce the number
   of exits from the guest.

Simple test with the simulator:

[virtio]# time ./virtio_test
spurious wakeus: 0x7

real    0m0.169s
user    0m0.140s
sys     0m0.019s
[virtio]# time ./virtio_test --no-event-idx
spurious wakeus: 0x11

real    0m0.649s
user    0m0.295s
sys     0m0.335s

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

8 years agovirtio ring: inline function to check for events
Michael S. Tsirkin [Thu, 19 May 2011 23:10:27 +0000]
virtio ring: inline function to check for events

With the new used_event and avail_event and features, both
host and guest need similar logic to check whether events are
enabled, so it helps to put the common code in the header.

Note that Xen has similar logic for notification hold-off
in include/xen/interface/io/ring.h with req_event and req_prod
corresponding to event_idx + 1 and new_idx respectively.
+1 comes from the fact that req_event and req_prod in Xen start at 1,
while event index in virtio starts at 0.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

8 years agovirtio: event index interface
Michael S. Tsirkin [Thu, 19 May 2011 23:10:17 +0000]
virtio: event index interface

Define a new feature bit for the guest and host to utilize
an event index (like Xen) instead if a flag bit to enable/disable
interrupts and kicks.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

8 years agovirtio: add full three-clause BSD text to headers.
Rusty Russell [Mon, 30 May 2011 17:14:13 +0000]
virtio: add full three-clause BSD text to headers.

It's unclear to me if it's important, but it's obviously causing my
technical colleages some headaches and I'd hate such imprecision to
slow virtio adoption.

I've emailed this to all non-trivial contributors for approval, too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Ryan Harper <ryanh@us.ibm.com>
Acked-by: Anthony Liguori <aliguori@us.ibm.com>
Acked-by: Eric Van Hensbergen <ericvh@gmail.com>
Acked-by: john cooper <john.cooper@redhat.com>
Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>