]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/log
mirror_ubuntu-bionic-kernel.git
11 years agommc: sdhci-s3c: Fix compilation warning
Sachin Kamat [Tue, 4 Dec 2012 11:33:07 +0000 (17:03 +0530)]
mmc: sdhci-s3c: Fix compilation warning

'sc' is used only when CONFIG_PM_RUNTIME is defined. Hence define it
conditionally.

Silences the following warning:
drivers/mmc/host/sdhci-s3c.c: In function ‘sdhci_s3c_notify_change’:
drivers/mmc/host/sdhci-s3c.c:378:20: warning: unused variable ‘sc’ [-Wunused-variable]

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agoMerge tag 'mmc-fixes-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
Linus Torvalds [Fri, 7 Dec 2012 17:15:20 +0000 (09:15 -0800)]
Merge tag 'mmc-fixes-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc

Pull MMC fixes from Chris Ball:
 "Two small regression fixes:

   - sdhci-s3c: Fix runtime PM regression against 3.7-rc1
   - sh-mmcif: Fix oops against 3.6"

* tag 'mmc-fixes-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
  mmc: sh-mmcif: avoid oops on spurious interrupts (second try)
  Revert misapplied "mmc: sh-mmcif: avoid oops on spurious interrupts"
  mmc: sdhci-s3c: fix missing clock for gpio card-detect

11 years agotmpfs: fix shared mempolicy leak
Mel Gorman [Wed, 5 Dec 2012 22:01:41 +0000 (14:01 -0800)]
tmpfs: fix shared mempolicy leak

This fixes a regression in 3.7-rc, which has since gone into stable.

Commit 00442ad04a5e ("mempolicy: fix a memory corruption by refcount
imbalance in alloc_pages_vma()") changed get_vma_policy() to raise the
refcount on a shmem shared mempolicy; whereas shmem_alloc_page() went
on expecting alloc_page_vma() to drop the refcount it had acquired.
This deserves a rework: but for now fix the leak in shmem_alloc_page().

Hugh: shmem_swapin() did not need a fix, but surely it's clearer to use
the same refcounting there as in shmem_alloc_page(), delete its onstack
mempolicy, and the strange mpol_cond_copy() and __mpol_cond_copy() -
those were invented to let swapin_readahead() make an unknown number of
calls to alloc_pages_vma() with one mempolicy; but since 00442ad04a5e,
alloc_pages_vma() has kept refcount in balance, so now no problem.

Reported-and-tested-by: Tommi Rantala <tt.rantala@gmail.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agomm: vmscan: do not keep kswapd looping forever due to individual uncompactable zones
Johannes Weiner [Tue, 4 Dec 2012 16:11:31 +0000 (11:11 -0500)]
mm: vmscan: do not keep kswapd looping forever due to individual uncompactable zones

When a zone meets its high watermark and is compactable in case of
higher order allocations, it contributes to the percentage of the node's
memory that is considered balanced.

This requirement, that a node be only partially balanced, came about
when kswapd was desparately trying to balance tiny zones when all bigger
zones in the node had plenty of free memory.  Arguably, the same should
apply to compaction: if a significant part of the node is balanced
enough to run compaction, do not get hung up on that tiny zone that
might never get in shape.

When the compaction logic in kswapd is reached, we know that at least
25% of the node's memory is balanced properly for compaction (see
zone_balanced and pgdat_balanced).  Remove the individual zone checks
that restart the kswapd cycle.

Otherwise, we may observe more endless looping in kswapd where the
compaction code loops back to reclaim because of a single zone and
reclaim does nothing because the node is considered balanced overall.

See for example

  https://bugzilla.redhat.com/show_bug.cgi?id=866988

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reported-and-tested-by: Thorsten Leemhuis <fedora@leemhuis.info>
Reported-by: Jiri Slaby <jslaby@suse.cz>
Tested-by: John Ellson <john.ellson@comcast.net>
Tested-by: Zdenek Kabelac <zkabelac@redhat.com>
Tested-by: Bruno Wolff III <bruno@wolff.to>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agomm: compaction: validate pfn range passed to isolate_freepages_block
Mel Gorman [Thu, 6 Dec 2012 19:01:14 +0000 (19:01 +0000)]
mm: compaction: validate pfn range passed to isolate_freepages_block

Commit 0bf380bc70ec ("mm: compaction: check pfn_valid when entering a
new MAX_ORDER_NR_PAGES block during isolation for migration") added a
check for pfn_valid() when isolating pages for migration as the scanner
does not necessarily start pageblock-aligned.

Since commit c89511ab2f8f ("mm: compaction: Restart compaction from near
where it left off"), the free scanner has the same problem.  This patch
makes sure that the pfn range passed to isolate_freepages_block() is
within the same block so that pfn_valid() checks are unnecessary.

In answer to Henrik's wondering why others have not reported this:
reproducing this requires a large enough hole with the right aligment to
have compaction walk into a PFN range with no memmap.  Size and
alignment depends in the memory model - 4M for FLATMEM and 128M for
SPARSEMEM on x86.  It needs a "lucky" machine.

Reported-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agommc: sdhci-pci: Enable SDHCI_CAN_DO_HISPD for Ricoh SDHCI controller
Madhvapathi Sriram [Mon, 15 Oct 2012 04:47:30 +0000 (04:47 +0000)]
mmc: sdhci-pci: Enable SDHCI_CAN_DO_HISPD for Ricoh SDHCI controller

The Ricoh SDHCI controllers support Highspeed clocks as evident from
the ricoh_mmc_probe_slot() settings. Hence, SDHCI_CAN_DO_HISPD needs
to be set to enable SDIO client drivers to set/enable high speed clock
settings

Signed-off-by: Madhvapathi Sriram <Madhvapathi.Sriram@csr.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-dove: allow GPIOs to be used for card detection on Dove
Russell King [Thu, 22 Nov 2012 23:55:51 +0000 (23:55 +0000)]
mmc: sdhci-dove: allow GPIOs to be used for card detection on Dove

This commit taken from Rabeeh's Cubox kernel and re-worked for DT;
Sebastian Hasselbrath is believed to be the original author.

Some Cuboxes require a GPIO for card detection; this implements the
optional GPIO support for card detection.  This GPIO is logic 0 for
card inserted.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-dove: use two-stage initialization for sdhci-pltfm
Russell King [Thu, 22 Nov 2012 23:55:30 +0000 (23:55 +0000)]
mmc: sdhci-dove: use two-stage initialization for sdhci-pltfm

We need to use the two-stage initialization for sdhci-pltfm if we're
going to do anything extra at initialization time.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-dove: use devm_clk_get()
Russell King [Thu, 22 Nov 2012 23:55:10 +0000 (23:55 +0000)]
mmc: sdhci-dove: use devm_clk_get()

Use devm_clk_get() rather than clk_get() to make cleanup paths more simple.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: eSDHC: Recover from ADMA errors
Haijun Zhang [Tue, 4 Dec 2012 02:41:28 +0000 (10:41 +0800)]
mmc: eSDHC: Recover from ADMA errors

A-003500: False ADMA Error might be reported when ADMA is used for
multiple block read command with Stop at Block Gap. If PROCTL[SABGREQ]
is set when the particular block's data is received by the System side
logic before entire block (with CRC) data is received by the SD side
logic, and also if ADMA descriptor line is fetched at the same time,
then DMA engine might report false ADMA error. eSDHC might not be able
to Continue (PROCTL[CREQ]=1) after Stop at Block Gap.
This issue will impact the eSDHC IP VVN2.3.

Signed-off-by: Haijun Zhang <Haijun.Zhang@freescale.com>
Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: remove duplicated buswidth code
Jaehoon Chung [Thu, 8 Nov 2012 08:35:31 +0000 (17:35 +0900)]
mmc: dw_mmc: remove duplicated buswidth code

ctype is using 1-bit buswidth mode by default.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: relocate where dw_mci_setup_bus() is called from
Jaehoon Chung [Thu, 8 Nov 2012 08:35:29 +0000 (17:35 +0900)]
mmc: dw_mmc: relocate where dw_mci_setup_bus() is called from

To ensure the stable clock need to enable before set the
DW_MMC_CARD_NEED_INIT flag.  If set DW_MMC_CARD_NEED_INIT flag,
wait for 80-clock before first command after power-up.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: Limit MMC speed to 52MHz if not HS200
Al Cooper [Fri, 30 Nov 2012 15:53:35 +0000 (10:53 -0500)]
mmc: Limit MMC speed to 52MHz if not HS200

If "caps2" host capabilities does not indicate support for MMC
HS200, don't allow clock speeds >52MHz. Currently, for MMC, the
clock speed is set to the lesser of the max speed the eMMC module
supports (card->ext_csd.hs_max_dtr) or the max base clock of the
host controller (host->f_max based on BASE_CLK_FREQ in the host
CAPS register). This means that a host controller that doesn't
support HS200 mode but has a base clock of 100MHz and an eMMC module
that supports HS200 speeds will end up using a 100MHz clock.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: use devres functions in dw_mmc
Seungwon Jeon [Wed, 28 Nov 2012 10:26:03 +0000 (19:26 +0900)]
mmc: dw_mmc: use devres functions in dw_mmc

Use managed device resource functions for easy handling.
This makes driver simpler in the routine of error and exit.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sh_mmcif: remove unneeded clock connection ID
Guennadi Liakhovetski [Wed, 28 Nov 2012 09:24:27 +0000 (10:24 +0100)]
mmc: sh_mmcif: remove unneeded clock connection ID

MMCIF only uses one clock, all ARM and SuperH platforms register MMCIF
clock lookup entries with no connection ID, hence it can be dropped in
the driver too.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sh_mobile_sdhi: remove unneeded clock connection ID
Guennadi Liakhovetski [Wed, 28 Nov 2012 09:24:21 +0000 (10:24 +0100)]
mmc: sh_mobile_sdhi: remove unneeded clock connection ID

SDHI only uses one clock, all ARM and SuperH platform register SDHI clock
lookup entries with no connection ID, hence it can be dropped in the
driver too.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sh_mobile_sdhi: fix clock frequency printing
Guennadi Liakhovetski [Wed, 28 Nov 2012 09:24:13 +0000 (10:24 +0100)]
mmc: sh_mobile_sdhi: fix clock frequency printing

During its probing the SDHI driver prints out the clock frequency, but
does it wrongly, always reporting 0Hz. Use the MMC host frequency value
to fix this issue.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: Remove redundant null check before kfree in bus.c
Sachin Kamat [Tue, 20 Nov 2012 09:13:17 +0000 (14:43 +0530)]
mmc: Remove redundant null check before kfree in bus.c

kfree on a null pointer is a no-op.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: Remove redundant null check before kfree in sdio_bus.c
Sachin Kamat [Tue, 20 Nov 2012 09:13:16 +0000 (14:43 +0530)]
mmc: Remove redundant null check before kfree in sdio_bus.c

kfree on a null pointer is a no-op.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-imx-esdhc: use more devm_* functions
Shawn Guo [Mon, 26 Nov 2012 06:39:43 +0000 (14:39 +0800)]
mmc: sdhci-imx-esdhc: use more devm_* functions

Use devm_kzalloc, devm_gpio_request_one and devm_request_irq to make
cleanup path simpler.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dt: add no-1-8-v device tree flag
Daniel Drake [Sun, 25 Nov 2012 18:02:54 +0000 (13:02 -0500)]
mmc: dt: add no-1-8-v device tree flag

The OLPC XO-1.75 laptop includes a SDHCI controller which is 1.8v
capable, and it truthfully reports so in its capabilities. This
alternate voltage is used for driving new "UHS-I" SD cards at their
full speed.

However, what the controller doesn't know is that the motherboard
physically doesn't have a 1.8v supply available, so attempting to
switch to the 1.8v level will result in a situation that cannot be
recovered from without physically replugging the SD card.

Add a device tree flag that can be used on systems like these,
and hook it up to the equivalent SDHCI quirk.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Reviewed-by: Philip Rakity <prakity@nvidia.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci: add quirk for lack of 1.8v support
Daniel Drake [Sun, 25 Nov 2012 18:01:19 +0000 (13:01 -0500)]
mmc: sdhci: add quirk for lack of 1.8v support

The OLPC XO-1.75 laptop includes a SDHCI controller which is 1.8v
capable, and it truthfully reports so in its capabilities. This
alternate voltage is used for driving new "UHS-I" SD cards at their
full speed.

However, what the controller doesn't know is that the motherboard
physically doesn't have a 1.8v supply available.

Add a quirk so that systems such as this one can override disable
1.8v support, adding support for UHS-I cards (by running them at
3.3v).

This avoids a problem where the system would first try to run the
card at 1.8v, fail, and then not be able to fully reset the card
to retry at the normal 3.3v voltage.

This is more appropriate than using the MISSING_CAPS quirk, which
is intended for cases where the SDHCI controller is actually lying
about its capabilities, and would force us to somehow override both
caps words from another source.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Reviewed-by: Philip Rakity <prakity@nvidia.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdio: Add empty bus-level suspend/resume callbacks
Rafael J. Wysocki [Sun, 2 Dec 2012 13:48:50 +0000 (14:48 +0100)]
mmc: sdio: Add empty bus-level suspend/resume callbacks

Suspend methods provided by SDIO drivers are not supposed to be called by
the PM core.  Instead, when the SDIO core gets to suspend a device's
ancestor, it calls the device driver's suspend routine.  However, the PM
core executes suspend callback routines directly for device drivers whose
bus types don't provide suspend callbacks.  In consequece, because the
SDIO bus type doesn't provide a suspend callback, the SDIO drivers'
suspend routines will be executed by the PM core (which shouldn't
happen).

To prevent this from happening, add empty system suspend/resume callbacks
for the SDIO bus type.

An analogous change had been made already by commit (e841a7c mmc: sdio:
Use empty system suspend/resume callbacks at the bus level), but then it
was reverted inadvertently by commit (d8e2ac3 mmc: sdio: Fix PM_SLEEP
related build warnings) that attempted to fix build warnings introduced
by commit e841a7c.

Reported-by: NeilBrown <neilb@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: vub300: add missing usb_put_dev
Marina Makienko [Tue, 27 Nov 2012 06:46:57 +0000 (10:46 +0400)]
mmc: vub300: add missing usb_put_dev

Add missing usb_put_dev on failure path in vub300_probe().

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

Signed-off-by: Marina Makienko <makienko@ispras.ru>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-spear: Don't call clk_{un}prepare() in suspend/resume
Viresh Kumar [Thu, 8 Nov 2012 15:09:10 +0000 (20:39 +0530)]
mmc: sdhci-spear: Don't call clk_{un}prepare() in suspend/resume

clk_{un}prepare is mandatory for platforms using common clock
framework. Because for SPEAr we don't do anything in clk_{un}prepare()
calls, just call them once in probe/remove.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-spear: Initialize sdhci clk to 50 MHz
Vipul Kumar Samar [Thu, 8 Nov 2012 15:09:09 +0000 (20:39 +0530)]
mmc: sdhci-spear: Initialize sdhci clk to 50 MHz

SPEAr sdhci driver expects the clock to be set to 50 MHz for proper
functioning.  This patch sets clk to 50 MHz in probe.

Signed-off-by: Vipul Kumar Samar <vipulkumar.samar@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: host: sdhci-s3c: Add support for pinctrl
Tomasz Figa [Fri, 16 Nov 2012 14:28:17 +0000 (15:28 +0100)]
mmc: host: sdhci-s3c: Add support for pinctrl

This patch adds support for pin configuration using pinctrl subsystem
to the sdhci-s3c driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: host: sdhci-s3c: Use devm_gpio_request to request GPIOs
Tomasz Figa [Sun, 25 Nov 2012 20:40:44 +0000 (15:40 -0500)]
mmc: host: sdhci-s3c: Use devm_gpio_request to request GPIOs

The set of GPIO pins used by sdhci-s3c driver varies between
configurations, such as card detect method, pinctrl availability, etc.
This overly complicates the code requesting and freeing GPIO pins, which
must check which pins are used, when freeing them.

This patch modifies the sdhci-s3c driver to use devm_gpio_request to
free requested pins automatically after unbinding the driver.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-of-esdhc: support commands with busy response expecting TC
Jerry Huang [Fri, 23 Nov 2012 09:25:03 +0000 (17:25 +0800)]
mmc: sdhci-of-esdhc: support commands with busy response expecting TC

The IP versions older than 2.3 didn't support commands with busy
response which expect the TC bit set. But after the VVN2.3, eSDHC
IP has supported it.

Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-s3c: Use NULL instead of 0 for pointers
Tushar Behera [Tue, 20 Nov 2012 04:11:53 +0000 (09:41 +0530)]
mmc: sdhci-s3c: Use NULL instead of 0 for pointers

The third argument for of_get_property() is a pointer, hence pass
NULL instead of 0.

Fixes the following sparse warning:
sdhci-s3c.c:452:48: warning: Using plain integer as NULL pointer
sdhci-s3c.c:457:52: warning: Using plain integer as NULL pointer

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: omap_hsmmc: Cleanup bitmap definitions of Interrupt Register
Venkatraman S [Mon, 19 Nov 2012 16:30:01 +0000 (22:00 +0530)]
mmc: omap_hsmmc: Cleanup bitmap definitions of Interrupt Register

Define the most frequently used bitmasks of the Interrupt Enable /
Interrupt Status register with consistent naming ( with _EN suffix).

Use meaningful concatenation of bitfields for INT_EN_MASK, which shows
which interrupts are enabled by default.  No functional changes.

Signed-off-by: Venkatraman S <svenkatr@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: omap_hsmmc: Convert critical failure reports to dev_err
Venkatraman S [Mon, 19 Nov 2012 16:30:00 +0000 (22:00 +0530)]
mmc: omap_hsmmc: Convert critical failure reports to dev_err

Fatal errors for the driver are not reported when just error debug
is enabled. Convert selected dev_dbg to dev_err for accurate error
reporting.

Reported-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: omap_hsmmc: Introduce omap_hsmmc_prepare/complete
Felipe Balbi [Mon, 19 Nov 2012 16:29:59 +0000 (21:59 +0530)]
mmc: omap_hsmmc: Introduce omap_hsmmc_prepare/complete

prepare() is supposed to prevent new children from being registered.
On the MMC subsystem, children (new cards) registration starts with
the card detect IRQ.

Move card detect IRQ disabling to prepare() so that no new cards
will be registered while we're trying to suspend.

Likewise, move card detect IRQ enabling to complete() so we only
try to register new children after our MMC IP is back up.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: omap_hsmmc: Enable HSPE bit for high speed cards
Hebbar, Gururaja [Mon, 19 Nov 2012 16:29:58 +0000 (21:59 +0530)]
mmc: omap_hsmmc: Enable HSPE bit for high speed cards

HSMMC IP on AM33xx need a special setting to handle High-speed cards.
Other platforms like TI81xx, OMAP4 may need this as-well. This depends
on the HSMMC IP timing closure done for the high speed cards.

From AM335x TRM (SPRUH73F - 18.3.12 Output Signals Generation):

The MMC/SD/SDIO output signals can be driven on either falling edge or
rising edge depending on the SD_HCTL[2] HSPE bit. This feature allows
to reach better timing performance, and thus to increase data transfer
frequency.

There are few pre-requisites for enabling the HSPE bit
- Controller should support High-Speed-Enable Bit and
- Controller should not be using DDR Mode and
- Controller should advertise that it supports High Speed in
  capabilities register and
- MMC/SD clock coming out of controller > 25MHz

Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: omap_hsmmc: Update error code for response_busy cmd
Balaji T K [Mon, 19 Nov 2012 16:29:57 +0000 (21:59 +0530)]
mmc: omap_hsmmc: Update error code for response_busy cmd

Update error code to cmd->error for commands with response_busy and no data.

Signed-off-by: Balaji T K <balajitk@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: omap_hsmmc: No reset of cmd state machine for DCRC
Balaji T K [Mon, 19 Nov 2012 16:29:56 +0000 (21:59 +0530)]
mmc: omap_hsmmc: No reset of cmd state machine for DCRC

Avoid soft reset of command internal state machine on data errors.

Signed-off-by: Balaji T K <balajitk@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: omap_hsmmc: Fix Oops in case of data errors
Balaji T K [Mon, 19 Nov 2012 16:29:55 +0000 (21:59 +0530)]
mmc: omap_hsmmc: Fix Oops in case of data errors

ae4bf788ee9 ("mmc: omap_hsmmc: consolidate error report handling of HSMMC
IRQ") sets both end_cmd and end_trans to 1.

Setting end_cmd to 1 for Data Timeout/CRC leads to NULL pointer dereference of
host->cmd as the command complete has previously been handled.
Set end_cmd only in case of command Timeout/CRC.

Moreover host->cmd->error should not be updated on data error case, only
host->data->error needs to be updated.

Signed-off-by: Balaji T K <balajitk@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: Add sdio power bindings
Abhilash Kesavan [Mon, 19 Nov 2012 04:56:21 +0000 (10:26 +0530)]
mmc: dw_mmc: Add sdio power bindings

Add dt-based retrieval of host sdio pm capabilities. Based on
the dt based discovery do a bus init in the resume function.

Signed-off-by: Olof Johansson <olofj@chromium.org>
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-pltfm: Support optional pm properties
Abhilash Kesavan [Mon, 19 Nov 2012 04:56:20 +0000 (10:26 +0530)]
mmc: sdhci-pltfm: Support optional pm properties

Add support for optional pm capabilities such as MMC_PM_KEEP_POWER
and MMC_PM_WAKE_SDIO_IRQ.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dt: Add optional pm properties to core binding
Abhilash Kesavan [Mon, 19 Nov 2012 04:56:19 +0000 (10:26 +0530)]
mmc: dt: Add optional pm properties to core binding

Add documentation for pm capabilties such as MMC_PM_KEEP_POWER
and MMC_PM_WAKE_SDIO_IRQ.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dt: Fix typo in filename
Abhilash Kesavan [Mon, 19 Nov 2012 04:56:18 +0000 (10:26 +0530)]
mmc: dt: Fix typo in filename

Fix typo in the synopsis dwmmc controller dt binding filename.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-pxav3: add quirks2
Kevin Liu [Wed, 17 Oct 2012 11:04:48 +0000 (19:04 +0800)]
mmc: sdhci-pxav3: add quirks2

Acked-by: Zhangfei Gao <zhangfei.gao@marvell.com>
Signed-off-by: Kevin Liu <kliu5@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci: Use regulator min/max voltage range according to spec
Kevin Liu [Tue, 20 Nov 2012 13:24:32 +0000 (08:24 -0500)]
mmc: sdhci: Use regulator min/max voltage range according to spec

For regulator vmmc/vmmcq, use voltage range as below
3.3v/3.0v: (2.7v, 3.6v)
1.8v: (1.7v, 1.95v)
Original code uses the precise value which may fail in regulator
driver if it does NOT support the precise voltage.

Signed-off-by: Jialing Fu <jlfu@marvell.com>
Signed-off-by: Kevin Liu <kliu5@marvell.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: SD/MMC Host Controller for Wondermedia WM8505/WM8650
Tony Prisk [Sun, 18 Nov 2012 02:33:06 +0000 (15:33 +1300)]
mmc: SD/MMC Host Controller for Wondermedia WM8505/WM8650

This patch adds support for the SD/MMC host controller found
on Wondermedia 8xxx series SoCs, currently supported under
arm/arch-vt8500.

A binding document is also included, based on mmc.txt with
additional properties.

Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: card: Add RPMB support in IOCTL interface
Loic Pallardy [Mon, 6 Aug 2012 15:12:31 +0000 (17:12 +0200)]
mmc: card: Add RPMB support in IOCTL interface

RPMB partition is accessing though /dev/block/mmcXrpmb device
User callers can read and write entire data frame(s) as defined
by JEDEC Standard JESD84-A441, using standard IOCTL interface.

Signed-off-by: Alex Macro <alex.macro@stericsson.com>
Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: core: Add mmc_set_blockcount feature
Loic Pallardy [Mon, 6 Aug 2012 15:12:30 +0000 (17:12 +0200)]
mmc: core: Add mmc_set_blockcount feature

Provide support for automatically sending Set Block Count
(CMD23) messages. Used at least for RPMB support.

Signed-off-by: Alex Macro <alex.macro@stericsson.com>
Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Johan Rudholm <johan.rudholm@stericsson.com>
Acked-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: core: Extend sysfs to ext_csd parameters for RPMB support
Loic Pallardy [Mon, 6 Aug 2012 15:12:29 +0000 (17:12 +0200)]
mmc: core: Extend sysfs to ext_csd parameters for RPMB support

Extend current sysfs access to ext_csd rpmb parameters (RPMB partition
size) and rel_sector information.

Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Johan Rudholm <johan.rudholm@stericsson.com>
Acked-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: card: Do not scan RPMB partitions
Loic Pallardy [Mon, 6 Aug 2012 15:12:28 +0000 (17:12 +0200)]
mmc: card: Do not scan RPMB partitions

Do not scan rpmb partitions for "soft" partitions, since the rpmb
partition contains protected data. Silences the following message
during boot:

 mmcblkXRPMB: unknown partition table

Signed-off-by: Johan Rudholm <johan.rudholm@stericsson.com>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: core: Expose access to RPMB partition
Loic Pallardy [Sat, 17 Nov 2012 23:08:24 +0000 (18:08 -0500)]
mmc: core: Expose access to RPMB partition

Following JEDEC standard, if the mmc supports RPMB partition,
a new interface is created and exposed via /dev/block.
Users will be able to access RPMB partition using standard
mmc IOCTL commands.

Signed-off-by: Alex Macro <alex.macro@stericsson.com>
Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Johan Rudholm <johan.rudholm@stericsson.com>
Acked-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: host: Make UHS timing values fully unique
Kevin Liu [Wed, 17 Oct 2012 11:04:46 +0000 (19:04 +0800)]
mmc: host: Make UHS timing values fully unique

Both of MMC_TIMING_LEGACY and MMC_TIMING_UHS_SDR12 are defined
to 0. And ios->timing is set to MMC_TIMING_LEGACY during power up.
But set_ios can't distinguish these two timing if host support
spec 3.0. Just adjust timing values to be different can resolve
this issue without any other impact.

Reviewed-by: Girish K S <girish.shivananjappa@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Kevin Liu <kliu5@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci-pxav3: Add base clock quirk
Kevin Liu [Wed, 17 Oct 2012 11:04:45 +0000 (19:04 +0800)]
mmc: sdhci-pxav3: Add base clock quirk

Enable the quirk SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN since
SD_CAPABILITIES_1[15:8](BASE_FREQ) can't get correct base clock value.
It returns a fixed pre-set value like 200 on some sdhci-pxav3 based
platforms like MMP3 while return 0 on the other sdhci-pxav3 based
platforms.  So we enable the quirk and get the base clock via function
get_max_clock. Also add get_max_clock.

Reported-by: Philip Rakity <prakity@marvell.com>
Reviewed-by: Philip Rakity <prakity@Marvell.com>
Acked-by: Zhangfei Gao <zhangfei.gao@marvell.com>
Signed-off-by: Kevin Liu <kliu5@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: Standardise capability type
Lee Jones [Wed, 14 Nov 2012 12:35:51 +0000 (12:35 +0000)]
mmc: Standardise capability type

There are discrepancies with regards to how MMC capabilities
are carried throughout the subsystem. Let's standardise them
to eliminate any confusion.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: mxs-mmc: Remove platform data
Fabio Estevam [Wed, 31 Oct 2012 11:22:58 +0000 (09:22 -0200)]
mmc: mxs-mmc: Remove platform data

All MXS users have been converted to device tree and the board files have
been removed.

No need to keep platform data in the driver.

Also move bus_width declaration in the beggining of mxs_mmc_probe() to
avoid: 'warning: ISO C90 forbids mixed declarations and code'.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdio: Use multiple scatter/gather list
Kyoungil Kim [Mon, 22 Oct 2012 11:01:00 +0000 (20:01 +0900)]
mmc: sdio: Use multiple scatter/gather list

Before this patch, we always used only single sg entry for SDIO transfer.
This patch switches to using multiple sg entries. In the case of dwmci,
it supports only up to 4KB size per single sg entry. So if we want to
transfer more than 4KB, we should send more than 1 command.

When we tested before applying this patch, it took around 335 us for
5K(5120) bytes transfer with dwmci controller. After applying this patch,
it takes 242 us for 5K bytes. So this patch makes around 38% performance
improvement for 5K bytes transfer. If the transfer size is bigger, then
the performance improvement ratio will be increased.

Signed-off-by: Kyoungil Kim <ki0351.kim@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: core: Fix some driver hangs when dealing with broken devices
Trey Ramsay [Fri, 16 Nov 2012 15:31:41 +0000 (09:31 -0600)]
mmc: core: Fix some driver hangs when dealing with broken devices

There are infinite loops in the mmc code that can be caused by bad
hardware.  The code will loop forever if the device never comes back
from program mode, R1_STATE_PRG, and it is not ready for data,
R1_READY_FOR_DATA.

A long timeout is added to prevent the code from looping forever.
The timeout will occur if the device never comes back from program
state or the device never becomes ready for data.

It's not clear whether the timeout will do more than log a pr_err()
and then start a fresh hang all over again.  We may need to extend
this patch later to perform some kind of reset of the device (is
that possible?) or rejection of new I/O to the device.

Signed-off-by: Trey Ramsay <tramsay@linux.vnet.ibm.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: fix more const pointer warnings
Arnd Bergmann [Thu, 8 Nov 2012 14:26:11 +0000 (14:26 +0000)]
mmc: dw_mmc: fix more const pointer warnings

The patch "dw_mmc: fix multiple drv_data NULL dereferences" has
unfortunately clashed with my "mmc: dw_mmc: constify dw_mci_idmac_ops
in exynos back-end" patch, causing new warnings to appear.

This should hopefully fix the issue for good.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: at91-mci: remove obsolete driver
Ludovic Desroches [Mon, 29 Oct 2012 14:27:55 +0000 (15:27 +0100)]
mmc: at91-mci: remove obsolete driver

The at91-mci driver is not needed anymore since the atmel-mci driver now
supports all Atmel devices.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: omap_hsmmc: remove warning message for debounce clock
Balaji T K [Thu, 25 Oct 2012 15:58:35 +0000 (21:28 +0530)]
mmc: omap_hsmmc: remove warning message for debounce clock

MMC debounce clock is applicable only for omap2430, warning message gets
printed when enable fails for debounce clock. Remove the get debounce clock
failure message as it is noisy for other platforms.

Signed-off-by: Balaji T K <balajitk@ti.com>
Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: omap_hsmmc: add DT property for max bus frequency
Daniel Mack [Mon, 15 Oct 2012 16:05:06 +0000 (21:35 +0530)]
mmc: omap_hsmmc: add DT property for max bus frequency

Maximum bus frequency can be limited by external circuitry like level
shifters etc. Allow passing this value from DT.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: omap_hsmmc: claim pinctrl at probe time
Daniel Mack [Mon, 15 Oct 2012 16:05:05 +0000 (21:35 +0530)]
mmc: omap_hsmmc: claim pinctrl at probe time

This allows DT-driven board to set up the pin mux only when the driver
is in use.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: mxcmmc: fix SD cards not being detected sometimes.
Javier Martin [Tue, 30 Oct 2012 15:54:07 +0000 (16:54 +0100)]
mmc: mxcmmc: fix SD cards not being detected sometimes.

When a SD card is initialized some data transfers of 64 and 8 bytes
are issued. It seems the DMA has some problems dealing with these kind
of "short" transfers, leading sometimes to the SD card not being detected.

In order to solve this problem, do not use DMA for transfer sizes lower
than the sector size.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: use helper macro module_platform_driver()
Andy Shevchenko [Wed, 3 Oct 2012 13:26:37 +0000 (16:26 +0300)]
mmc: dw_mmc: use helper macro module_platform_driver()

Since v3.2 we have nice macro to define the platform driver's init and exit
calls. This patch simplifies the dw_mmc platform driver by using that macro.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Girish K S <girish.shivanajappa@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: dw_mmc: use __devexit_p macro for .remove()
Andy Shevchenko [Wed, 3 Oct 2012 13:45:23 +0000 (16:45 +0300)]
mmc: dw_mmc: use __devexit_p macro for .remove()

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Girish K S <girish.shivananjappa@linaro.org>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: queue: amend buffer swap for non-blocking transfer
Seungwon Jeon [Fri, 28 Sep 2012 10:12:53 +0000 (19:12 +0900)]
mmc: queue: amend buffer swap for non-blocking transfer

In case both 'req' and 'mq->mqrq_prev->req' are null, there is no request
to be processed. That means there is no need to switch buffer.
Switching buffer is required only after finishing 'issue_fn'.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Reviewed-by: Per Forlin <per.forlin@stericsson.com>
Tested-by: Johan Rudholm <johan.rudholm@stericsson.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: core: debugfs: Add signal_voltage to ios dump
Johan Rudholm [Fri, 26 Oct 2012 09:31:55 +0000 (11:31 +0200)]
mmc: core: debugfs: Add signal_voltage to ios dump

Signed-off-by: Johan Rudholm <johan.rudholm@stericsson.com>
Reviewed-by: Philip Rakity <prakity@nvidia.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sh-mmcif: avoid oops on spurious interrupts (second try)
Guennadi Liakhovetski [Wed, 22 Aug 2012 06:49:47 +0000 (06:49 +0000)]
mmc: sh-mmcif: avoid oops on spurious interrupts (second try)

On some systems, e.g., kzm9g, MMCIF interfaces can produce spurious
interrupts without any active request. To prevent the Oops, that results
in such cases, don't dereference the mmc request pointer until we make
sure, that we are indeed processing such a request.

Reported-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Tested-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
Cc: stable@vger.kernel.org
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agommc: sdhci: Balance vmmc regulator_enable(), and always enable vqmmc
Kevin Liu [Sat, 17 Nov 2012 22:55:51 +0000 (17:55 -0500)]
mmc: sdhci: Balance vmmc regulator_enable(), and always enable vqmmc

The vmmc regulator enable in sdhci_add_host is NOT necessary since
it can be enabled during mmc_power_up by function mmc_regulator_set_ocr.
And this extra enable will make regulator_enable/regulator_disable
unbalanced. Consequently, vmmc can't be disabled during mmc_power_off.

Also, if the vqmmc regulator exists, it should be enabled regardless it
support 1.8v or not.

Signed-off-by: Kevin Liu <kliu5@marvell.com>
Signed-off-by: Philip Rakity <prakity@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agoRevert misapplied "mmc: sh-mmcif: avoid oops on spurious interrupts"
Chris Ball [Mon, 3 Dec 2012 14:17:19 +0000 (09:17 -0500)]
Revert misapplied "mmc: sh-mmcif: avoid oops on spurious interrupts"

This reverts commit 8464dd52d3198dd05, which was a misapplied debugging
version of the patch, not the final patch itself.

Signed-off-by: Chris Ball <cjb@laptop.org>
Cc: stable@vger.kernel.org
11 years agommc: sdhci-s3c: fix missing clock for gpio card-detect
Heiko Stübner [Sun, 18 Nov 2012 18:50:05 +0000 (19:50 +0100)]
mmc: sdhci-s3c: fix missing clock for gpio card-detect

2abeb5c5ded2 ("Add clk_(enable/disable) in runtime suspend/resume")
added the capability to stop the clocks when the device is runtime
suspended, but forgot to handle the case of the card-detect using
an external gpio.

Therefore in the case that runtime-pm is enabled, start the io-clock
when a card is inserted and stop it again once it is removed.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
11 years agoMerge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Linus Torvalds [Thu, 6 Dec 2012 16:42:13 +0000 (08:42 -0800)]
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus

Pull MIPS fixes from Ralf Baechle:
 "These are the fixes for the N32 syscall bugs found by Al, an
  extraneous break that broke detection for R3000 and R3081 processors,
  an endless loop processing signals for kernel task (x86 received the
  same fix a while ago) and a fix for transparent huge page which took
  ages to track down because it was so hard to come up with a workable
  test case."

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
  MIPS: Fix endless loop when processing signals for kernel tasks
  MIPS: R3000/R3081: Fix CPU detection.
  MIPS: N32: Fix signalfd4 syscall entry point
  MIPS: N32: Fix preadv(2) and pwritev(2) entry points.
  MIPS: Avoid mcheck by flushing page range in huge_ptep_set_access_flags()

11 years agoMerge branch 'more-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty...
Linus Torvalds [Thu, 6 Dec 2012 16:39:57 +0000 (08:39 -0800)]
Merge branch 'more-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux

Pull build fix from Rusty Russell:
 "Tim Gardner <tim.gardner@canonical.com> writes:
  > It is $(obj)/oid_registry.o that is dependent on $(obj)/oid_registry_data.c.
  > The object file cannot be built until $(obj)/oid_registry_data.c has been
  > generated.
  >
  > A periodic and hard to reproduce parallel build failure is due to
  > this incorrect lib/Makefile dependency. The compile error is completely
  > disingenuous.
  >
  >   GEN     lib/oid_registry_data.c
  > Compiling 49 OIDs
  >   CC      lib/oid_registry.o
  > gcc: error: lib/oid_registry.c: No such file or directory
  > gcc: fatal error: no input files
  > compilation terminated.
  > make[3]: *** [lib/oid_registry.o] Error 4

  I can't reproduce it either.  It's completely weird; nothing ever
  removes lib/oid_registry.c, so either gcc is giving the wrong message
  or it's a weird fs with a very odd race.

  But your version is definitely more correct than the previous one,
  so..."

* 'more-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  lib/Makefile: Fix oid_registry build dependency

11 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Linus Torvalds [Thu, 6 Dec 2012 16:29:08 +0000 (08:29 -0800)]
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux

Pull module signing fixes from Rusty Russell:
 "David gave me these a month ago, during my git workflow churn :("

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  ASN.1: Fix an indefinite length skip error
  MODSIGN: Don't use enum-type bitfields in module signature info block

11 years agoMerge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 6 Dec 2012 16:27:11 +0000 (08:27 -0800)]
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull watchdog fix from Thomas Gleixner:
 "Trivial CPU hotplug regression fix for the watchdog code"

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  watchdog: Fix CPU hotplug regression

11 years agodevicetree/bindings: Move gpio-leds binding into leds directory
Grant Likely [Thu, 6 Dec 2012 09:53:13 +0000 (09:53 +0000)]
devicetree/bindings: Move gpio-leds binding into leds directory

Merely reorganizing documentation. No functional changes. It makes more
sense for the gpio-leds binding to be grouped with other led bindings
than with gpio drivers.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
11 years agolib/Makefile: Fix oid_registry build dependency
Tim Gardner [Tue, 4 Dec 2012 19:52:28 +0000 (12:52 -0700)]
lib/Makefile: Fix oid_registry build dependency

It is $(obj)/oid_registry.o that is dependent on $(obj)/oid_registry_data.c.
The object file cannot be built until $(obj)/oid_registry_data.c has been
generated.

A periodic and hard to reproduce parallel build failure is due to
this incorrect lib/Makefile dependency. The compile error is completely
disingenuous.

  GEN     lib/oid_registry_data.c
Compiling 49 OIDs
  CC      lib/oid_registry.o
gcc: error: lib/oid_registry.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
make[3]: *** [lib/oid_registry.o] Error 4

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: David Howells <dhowells@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agoirqdomain: update documentation
Linus Walleij [Sat, 1 Dec 2012 18:05:16 +0000 (19:05 +0100)]
irqdomain: update documentation

This updates the IRQdomain documentation a bit, by adding a more
verbose explanation to why we need this, and by adding some
extended documentation of the irq_domain_simple() usecase.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
11 years agoof/vendor-prefixes: add Imagination Technologies
James Hogan [Wed, 5 Dec 2012 16:08:24 +0000 (16:08 +0000)]
of/vendor-prefixes: add Imagination Technologies

The "powervr" prefix which is currently described as "Imagination
Technologies" isn't really appropriate for non-PowerVR hardware, so
deprecate it, changing the description of "powervr" to "PowerVR
(deprecated, use img)", and add a separate "img" prefix for "Imagination
Technologies Ltd.".

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
11 years agoMIPS: Fix endless loop when processing signals for kernel tasks
Dmitry Adamushko [Thu, 5 Apr 2012 18:37:34 +0000 (20:37 +0200)]
MIPS: Fix endless loop when processing signals for kernel tasks

The problem occurs [1] when a kernel-mode task returns from a system
call with a pending signal.

A real-life scenario is a child of 'khelper' returning from a failed
kernel_execve() in ____call_usermodehelper() [ kernel/kmod.c ].
kernel_execve() fails due to a pending SIGKILL, which is the result of
"kill -9 -1" (at least, busybox's init does it upon reboot).

The loop is as follows:

* syscall_exit_work:
 - work_pending:            // start_of_the_loop
 - work_notifysig:
   - do_notify_resume()
     - do_signal()
       - if (!user_mode(regs)) return;
 - resume_userspace         // TIF_SIGPENDING is still set
 - work_pending             // so we call work_pending => goto
                            // start_of_the_loop

More information can be found in another LKML thread:
http://www.serverphorums.com/read.php?12,457826

[1] The problem was also reproduced on !CONFIG_VM86 x86, and the
following fix was accepted.

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29a2e2836ff9ea65a603c89df217f4198973a74f

Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3571/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agoMIPS: R3000/R3081: Fix CPU detection.
Ralf Baechle [Fri, 8 Jun 2012 06:10:27 +0000 (07:10 +0100)]
MIPS: R3000/R3081: Fix CPU detection.

Broken since e05ea74fc56f347f872ef9946d27c53e8bf20864 (lmo) rsp.
cea7e2dfdef53fe55f359d00da562a268be06fd2 (kernel.org) [MIPS: Sort out CPU
type to name translation.]  These CPUs are no longer very popular to say
the least ...

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Reported-by: Murphy McCauley <murphy.mccauley@gmail.com>
11 years agoMIPS: N32: Fix signalfd4 syscall entry point
Ralf Baechle [Tue, 4 Dec 2012 17:50:48 +0000 (18:50 +0100)]
MIPS: N32: Fix signalfd4 syscall entry point

This needs to use the compat entry point or it's going to fail on big
endian systems.

Noticed by Al Viro.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
11 years agohwmon: (da9055) Fix chan_mux[DA9055_ADC_ADCIN3] setting
Axel Lin [Mon, 29 Oct 2012 08:34:38 +0000 (16:34 +0800)]
hwmon: (da9055) Fix chan_mux[DA9055_ADC_ADCIN3] setting

Set chan_mux[DA9055_ADC_ADCIN3] = DA9055_ADC_MUX_ADCIN3.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
11 years agohwmon: DA9055 HWMON driver
Ashish Jangam [Mon, 8 Oct 2012 13:26:47 +0000 (18:56 +0530)]
hwmon: DA9055 HWMON driver

This is the HWMON patch for DA9055 PMIC and has got dependency on the
DA9055 MFD core.

This patch monitors the DA9055 PMIC's ADC channels vddout, junction temperature
and auxiliary channels.

This patch is functionally tested on Samsung SMDKV6410.

Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Ashish Jangam <ashish.jangam@kpitcummins.com>
[Guenter Roeck: Dropped __devinit, __devexit, __devexit_p]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
11 years agohwmon: (coretemp) List TjMax for Z650/670 and N550/570
Guenter Roeck [Tue, 9 Oct 2012 19:52:18 +0000 (12:52 -0700)]
hwmon: (coretemp) List TjMax for Z650/670 and N550/570

as per processor data sheets.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
11 years agohwmon: (coretemp) Drop N4xx, N5xx, D4xx, D5xx CPUs from tjmax table
Guenter Roeck [Tue, 9 Oct 2012 19:48:16 +0000 (12:48 -0700)]
hwmon: (coretemp) Drop N4xx, N5xx, D4xx, D5xx CPUs from tjmax table

Since N4xx, N5xx, D4xx, and D5xx are now reliably detected using the model ID
and the stepping/mask, drop the respective entries from tjmax_table.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
11 years agohwmon: (coretemp) Use model table instead of if/else to identify CPU models
Guenter Roeck [Tue, 9 Oct 2012 19:45:23 +0000 (12:45 -0700)]
hwmon: (coretemp) Use model table instead of if/else to identify CPU models

Make the code easier to extend and easier to adjust by using a model table
listing CPU models, stepping/mask, and associated TjMax.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
11 years agohwmon: da9052: Use da9052_reg_update for rmw operations
Axel Lin [Thu, 11 Oct 2012 14:03:51 +0000 (22:03 +0800)]
hwmon: da9052: Use da9052_reg_update for rmw operations

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
11 years agohwmon: (coretemp) Drop dependency on PCI for TjMax detection on Atom CPUs
Guenter Roeck [Tue, 9 Oct 2012 19:27:12 +0000 (12:27 -0700)]
hwmon: (coretemp) Drop dependency on PCI for TjMax detection on Atom CPUs

So far, we use the NM10 Express Chipset PCI chip ID to detect TjMax for
Atom CPUs with model 0x1c. As it turns out, we can use the CPU stepping
(x86_mask) for the same purpose; stepping is 10 for all model 0x1c CPUs
with TjMax of 100 degrees C. This was verified by checking the output of
/proc/cpuinfo for the respective CPUs (D4xx, D5xx, N4xx, N5xx).

Other CPUs currently covered by the same code (Exx, Z6xx, Z2460) are not
supported by the NM10 Express Chipset. Most of those CPUs have TjMax of 90
degrees C, except for E6xxT models which have a TjMax of 110 degrees C.
E6xxT CPUs can however not be detected by software.

Calculate TjMax for Atom CPUs as follows. Note that the listed values are not
correct in some cases (230, 330). tjmax_table is used for those to override
the default values.

ID Stepping TjMax Models
0x1c 10 100 D4xx, N4xx, D5xx, N5xx
0x1c not 10 90 Z5xx, N2xx, 230, 330, others
0x26 - 90 Atom Tunnel Creek (Exx),
Lincroft (Z6xx)
0x27 - 90 Atom Medfield (Z2460)
0x36 - 100 Atom Cedar Trail (N2xxx, D2xxx)

Also drop the module dependency on PCI.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
11 years agohwmon: (ina2xx) use module_i2c_driver to simplify the code
Wei Yongjun [Mon, 8 Oct 2012 12:40:35 +0000 (20:40 +0800)]
hwmon: (ina2xx) use module_i2c_driver to simplify the code

Use the module_i2c_driver() macro to make the code smaller
and a bit simpler.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
11 years agohwmon: (ads7828) add support for ADS7830
Guillaume Roguez [Wed, 3 Oct 2012 20:54:08 +0000 (16:54 -0400)]
hwmon: (ads7828) add support for ADS7830

The ADS7830 device is almost the same as the ADS7828,
except that it does 8-bit sampling, instead of 12-bit.
This patch extends the ads7828 driver to support this chip.

Signed-off-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
11 years agohwmon: (ads7828) driver cleanup
Vivien Didelot [Wed, 3 Oct 2012 20:54:07 +0000 (16:54 -0400)]
hwmon: (ads7828) driver cleanup

As there is no reliable way to identify the chip, it is preferable to
remove the detect callback, to avoid misdetection.

Module parameters are not worth it here, so let's get rid of them and
add an ads7828_platform_data structure instead.

Clean the code by removing unused macros, fixing coding style issues,
avoiding function prototypes and using convenient macros such as
module_i2c_driver().

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
11 years agox86,AMD: Power driver support for AMD's family 16h processors
Boris Ostrovsky [Wed, 5 Dec 2012 11:12:42 +0000 (06:12 -0500)]
x86,AMD: Power driver support for AMD's family 16h processors

Add family 16h PCI ID to AMD's power driver to allow it report
power consumption on these processors.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
11 years agovfs: clear to the end of the buffer on partial buffer reads
Dan Carpenter [Wed, 5 Dec 2012 17:01:24 +0000 (20:01 +0300)]
vfs: clear to the end of the buffer on partial buffer reads

READ is zero so the "rw & READ" test is always false.  The intended test
was "((rw & RW_MASK) == READ)".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoASN.1: Fix an indefinite length skip error
David Howells [Mon, 22 Oct 2012 14:05:55 +0000 (15:05 +0100)]
ASN.1: Fix an indefinite length skip error

Fix an error in asn1_find_indefinite_length() whereby small definite length
elements of size 0x7f are incorrecly classified as non-small.  Without this
fix, an error will be given as the length of the length will be perceived as
being very much greater than the maximum supported size.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agoMODSIGN: Don't use enum-type bitfields in module signature info block
David Howells [Mon, 22 Oct 2012 14:05:48 +0000 (15:05 +0100)]
MODSIGN: Don't use enum-type bitfields in module signature info block

Don't use enum-type bitfields in the module signature info block as we can't be
certain how the compiler will handle them.  As I understand it, it is arch
dependent, and it is possible for the compiler to rearrange them based on
endianness and to insert a byte of padding to pad the three enums out to four
bytes.

Instead use u8 fields for these, which the compiler should emit in the right
order without padding.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
11 years agowatchdog: Fix CPU hotplug regression
Thomas Gleixner [Tue, 4 Dec 2012 17:59:34 +0000 (18:59 +0100)]
watchdog: Fix CPU hotplug regression

Norbert reported:
"3.7-rc6 booted with nmi_watchdog=0 fails to suspend to RAM or
 offline CPUs. It's reproducable with a KVM guest and physical
 system."

The reason is that commit bcd951cf(watchdog: Use hotplug thread
infrastructure) missed to take this into account. So the cpu offline
code gets stuck in the teardown function because it accesses non
initialized data structures.

Add a check for watchdog_enabled into that path to cure the issue.

Reported-and-tested-by: Norbert Warmuth <nwarmuth@t-online.de>
Tested-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1211231033230.2701@ionos
Link: http://bugs.launchpad.net/bugs/1079534
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
11 years agoclk: ux500: fix bit error
Linus Walleij [Tue, 27 Nov 2012 19:15:20 +0000 (20:15 +0100)]
clk: ux500: fix bit error

This fixes a bit error in the U8500 clock implementation: the
unused p2_pclk12 registered at bit 12 in periphereral group 6
was defined as using bit 11 rather than bit 12.

When walking over and disabling the unused clocks in the tree
at late init time, p2_pclk12 was disabled, by effectively
clearing the but for p2_pclk11 instead of bit 12 as it should
have, thus disabling gpio block 6 and 7.

Reported-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Philippe Begnic <philippe.begnic@st.com>
Cc: stable@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
11 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Linus Torvalds [Tue, 4 Dec 2012 17:32:12 +0000 (09:32 -0800)]
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux

Pull module fixes from Rusty Russell:
 "Module signing build fixes for blackfin and metag"

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  modsign: add symbol prefix to certificate list
  linux/kernel.h: define SYMBOL_PREFIX

11 years agoMerge tag 'upstream-3.7-rc9' of git://git.infradead.org/linux-ubi
Linus Torvalds [Tue, 4 Dec 2012 17:15:51 +0000 (09:15 -0800)]
Merge tag 'upstream-3.7-rc9' of git://git.infradead.org/linux-ubi

Pull UBI changes from Artem Bityutskiy:
 "Fixes for 2 brown-paperbag bugs introduced this merge window by the
  fastmap code:

   1.  The UBI background thread got stuck when a bit-flip happened
       because free LEBs was not removed from the "free" tree when we
       started using it.
   2.  I/O debugging checks did not work because we called a sleeping
       function in atomic context."

* tag 'upstream-3.7-rc9' of git://git.infradead.org/linux-ubi:
  UBI: dont call ubi_self_check_all_ff() in __wl_get_peb()
  UBI: remove PEB from free tree in get_peb_for_wl()

11 years agoMerge branch 'for-3.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Linus Torvalds [Tue, 4 Dec 2012 17:02:45 +0000 (09:02 -0800)]
Merge branch 'for-3.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq

Pull workqueue fixes from Tejun Heo:
 "So, safe fixes my ass.

  Commit 8852aac25e79 ("workqueue: mod_delayed_work_on() shouldn't queue
  timer on 0 delay") had the side-effect of performing delayed_work
  sanity checks even when @delay is 0, which should be fine for any sane
  use cases.

  Unfortunately, megaraid was being overly ingenious.  It seemingly
  wanted to use cancel_delayed_work_sync() before cancel_work_sync() was
  introduced, but didn't want to waste the space for full delayed_work
  as it was only going to use 0 @delay.  So, it only allocated space for
  struct work_struct and then cast it to struct delayed_work and passed
  it into delayed_work functions - truly awesome engineering tradeoff to
  save some bytes.

  Xiaotian fixed it by making megraid allocate full delayed_work for
  now.  It should be converted to use work_struct and cancel_work_sync()
  but I think we better do that after 3.7.

  I added another commit to change BUG_ON()s in __queue_delayed_work()
  to WARN_ON_ONCE()s so that the kernel doesn't crash even if there are
  more such abuses."

* 'for-3.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  workqueue: convert BUG_ON()s in __queue_delayed_work() to WARN_ON_ONCE()s
  megaraid: fix BUG_ON() from incorrect use of delayed work

11 years agoMIPS: N32: Fix preadv(2) and pwritev(2) entry points.
Ralf Baechle [Tue, 4 Dec 2012 16:40:44 +0000 (17:40 +0100)]
MIPS: N32: Fix preadv(2) and pwritev(2) entry points.

By using the native syscall entry point the kernel was also expecting
64-bit iovec structures.

This is broken since ddd9e91b71072b8ebe89311c3a44b077defa1756 [preadv/
pwritev: MIPS: Add preadv(2) and pwritev(2) syscalls.] which originally
added these two syscalls.  I walked through piles of code, including
libc and couldn't find anything that would have worked around the issue
so this change the API to what it should always have been.

Noticed and patch suggested by Al Viro.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>