pandora-kernel.git
12 years agoh8300: Move gpio.h to gpio-internal.h
Mark Brown [Mon, 24 Oct 2011 21:59:21 +0000 (23:59 +0200)]
h8300: Move gpio.h to gpio-internal.h

The current h8300 GPIO implementation doesn't provide the standard GPIO
API, and in fact provides only direction control rather than normal GPIO
functionality. Currently this is only used by the platform interrupt
implementation rather than by a range of drivers so in preparation for
moving over to gpiolib move the header out of the way of the gpiolib
header, allowing a default GPIO implementation to be provided.

For actual use of these GPIOs with gpiolib a real driver would still need
to be written but there appears to be no current need for this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agogpio: pl061: add DT binding support
Rob Herring [Wed, 10 Aug 2011 21:31:46 +0000 (16:31 -0500)]
gpio: pl061: add DT binding support

This adds devicetree binding support to the ARM pl061 driver removing the
platform_data dependency. When DT binding is used, the gpio numbering is
assigned dynamically. For now, interrupts are not supported with DT until
irqdomains learn dynamic irq assignment.

Rather than add another case of -1, updating the driver to use NO_IRQ.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agogpio: fix build error in include/asm-generic/gpio.h
Hamo [Fri, 21 Oct 2011 01:38:32 +0000 (09:38 +0800)]
gpio: fix build error in include/asm-generic/gpio.h

Should call the platform-specific __gpio_{get,set}_value
instead of generic gpio_{get,set}_value

Signed-off-by: Yang Bai <hamo.by@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoALSA: hda - Fix pin-config for ASUS W90V
Takashi Iwai [Wed, 26 Oct 2011 21:04:08 +0000 (23:04 +0200)]
ALSA: hda - Fix pin-config for ASUS W90V

The association numbers of surround/CLFE speaker pins aren't correctly
mapped by the auto-parser.  This patch fixes the CLFE speaker pin to the
right assoc value (from 3 to 1).

Tested-by: Nika Topolchanskaya <nanodesuu@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agommc: core: Prevent too long response times for suspend
Ulf Hansson [Thu, 13 Oct 2011 14:03:58 +0000 (16:03 +0200)]
mmc: core: Prevent too long response times for suspend

While trying to suspend the mmc host there could still be
ongoing requests that we need to wait for. At the same time
a device driver must respond to a suspend request rather quickly.

Instead of potentially wait "forever" by claiming the host we now
"try" to claim the host instead. If it fails, -EBUSY is returned.

Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
Reviewed-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: recognise SDIO cards with SDIO_CCCR_REV 3.00
Bing Zhao [Fri, 21 Oct 2011 02:16:32 +0000 (19:16 -0700)]
mmc: recognise SDIO cards with SDIO_CCCR_REV 3.00

Table 6-2: CCCR bit Definitions, address 00h.  Part E1 SDIO Simplified
Specification Version 3.00, Feb. 25, 2011.

This patch has been tested with Marvell WLAN device SD8797.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sd: Handle SD3.0 cards not supporting UHS-I bus speed mode
Subhash Jadavani [Wed, 10 Aug 2011 05:46:01 +0000 (11:16 +0530)]
mmc: sd: Handle SD3.0 cards not supporting UHS-I bus speed mode

Here is Essential conditions to indicate Version 3.00 Card
(SD_SPEC=2 and SD_SPEC3=1) :
(1) The card shall support CMD6
(2) The card shall support CMD8
(3) The card shall support CMD42
(4) User area capacity shall be up to 2GB (SDSC) or 32GB (SDHC)
    User area capacity shall be more than or equal to 32GB and
    up to 2TB (SDXC)
(5) Speed Class shall be supported (SDHC or SDXC)

So even if SD card doesn't support any of the newly defined
UHS-I bus speed mode, it can advertise itself as SD3.0 cards
as long as it supports all the essential conditions of
SD3.0 cards. Given this, these type of cards should atleast
run in High Speed mode @50MHZ if it supports HS.

But current initialization sequence for SD3.0 cards is
such that these non-UHS-I SD3.0 cards runs in Default
Speed mode @25MHz.

This patch makes sure that these non-UHS-I SD3.0 cards run
in High Speed Mode @50MHz.

Tested this patch with SanDisk Extreme SDHC 8GB Class 10 card.

Reported-by: "Hiremath, Vaibhav" <hvaibhav@ti.com>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: support HPI send command
Jaehoon Chung [Tue, 18 Oct 2011 05:26:42 +0000 (01:26 -0400)]
mmc: core: support HPI send command

HPI command is defined in eMMC4.41.
This feature is important for eMMC4.5 devices.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: Add cache control for eMMC4.5 device
Seungwon Jeon [Fri, 14 Oct 2011 05:03:21 +0000 (14:03 +0900)]
mmc: core: Add cache control for eMMC4.5 device

This patch adds cache feature of eMMC4.5 Spec.
If device supports cache capability, host can utilize some specific
operations.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: Modify the timeout value for writing power class
Seungwon Jeon [Tue, 18 Oct 2011 04:20:57 +0000 (13:20 +0900)]
mmc: core: Modify the timeout value for writing power class

This patch will apply the generic CMD6 timeout to switch command
for power class.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: new discard feature support at eMMC v4.5
Kyungmin Park [Tue, 18 Oct 2011 00:34:04 +0000 (09:34 +0900)]
mmc: core: new discard feature support at eMMC v4.5

MMC v4.5 supports the DISCARD feature (CMD38).  It's different from
trim and there's no check bit.  Currently it's only supported at v4.5.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: mmc sanitize feature support for v4.5
Kyungmin Park [Fri, 14 Oct 2011 05:15:48 +0000 (14:15 +0900)]
mmc: core: mmc sanitize feature support for v4.5

In the v4.5, there's no secure erase & trim support.
Instead it supports the sanitize feature.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: dw_mmc: modify DATA register offset
Jaehoon Chung [Mon, 17 Oct 2011 10:36:23 +0000 (19:36 +0900)]
mmc: dw_mmc: modify DATA register offset

In dw_mmc 2.40a spec, Data register's offset is changed.
Before we used Data register offset 0x100. but if somebody uses a
2.40a controller, we must use 0x200 for Data register.

This patch adds a version-id checking point and uses SDMMC_DATA(x)
instead of SDMMC_DATA.  It assumes 2.40a is the latest version.

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>
12 years agommc: sdhci-pci: add flag for devices that can support runtime PM
Adrian Hunter [Mon, 17 Oct 2011 07:52:44 +0000 (10:52 +0300)]
mmc: sdhci-pci: add flag for devices that can support runtime PM

Only allow runtime PM for devices that specifically indicate
that they support it.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: omap_hsmmc: ensure pbias configuration is always done
Adrian Hunter [Fri, 6 May 2011 09:14:10 +0000 (12:14 +0300)]
mmc: omap_hsmmc: ensure pbias configuration is always done

Go through the driver's set_power() functions rather than
calling regulator_enable/disable() directly because otherwise
pbias configuration for MMC1 is not done.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: Add Power Off Notify Feature eMMC 4.5
Girish K S [Thu, 13 Oct 2011 06:34:16 +0000 (12:04 +0530)]
mmc: core: Add Power Off Notify Feature eMMC 4.5

This patch adds support for the power off notify feature, available in
eMMC 4.5 devices. If the host has support for this feature, then the
mmc core will notify the device by setting the POWER_OFF_NOTIFICATION
byte in the extended csd register with a value of 1 (POWER_ON).

For suspend mode short timeout is used, whereas for the normal poweroff
long timeout is used.

Signed-off-by: Girish K S <girish.shivananjappa@linaro.org>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci-s3c: fix potential NULL dereference
Jaehoon Chung [Wed, 12 Oct 2011 04:14:29 +0000 (13:14 +0900)]
mmc: sdhci-s3c: fix potential NULL dereference

sc->clk_bus[ptr] could be NULL.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: replace printk with appropriate display macro
Girish K S [Tue, 11 Oct 2011 06:14:09 +0000 (11:44 +0530)]
mmc: replace printk with appropriate display macro

All the files using printk function for displaying kernel messages
in the mmc driver have been replaced with corresponding macro.

Signed-off-by: Girish K S <girish.shivananjappa@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: Add default timeout value for CMD6
Seungwon Jeon [Fri, 23 Sep 2011 05:15:29 +0000 (14:15 +0900)]
mmc: core: Add default timeout value for CMD6

EXT_CSD[248] includes the default maximum timeout for CMD6.
This field is added at eMMC4.5 Spec. And it can be used for default
timeout except for some operations which don't define the timeout
(i.e. background operation, sanitize, flush cache) in eMMC4.5 Spec.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci-pci: add runtime pm support
Adrian Hunter [Mon, 3 Oct 2011 12:33:34 +0000 (15:33 +0300)]
mmc: sdhci-pci: add runtime pm support

Ths patch allows runtime PM for sdhci-pci, runtime suspending after
inactivity of 50ms and ensuring runtime resume before SDHC registers
are accessed.  During runtime suspend, interrupts are masked.
The host controller state is restored at runtime resume.

For Medfield, the host controller's card detect mechanism is
supplanted by an always-on GPIO which provides for card detect wake-up.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: move ->request() call from atomic context
Adrian Hunter [Mon, 3 Oct 2011 12:33:33 +0000 (15:33 +0300)]
mmc: core: move ->request() call from atomic context

mmc_request_done() is sometimes called from interrupt or other atomic
context.  Mostly all mmc_request_done() does is complete(), however it
contains code to retry on error, which uses ->request().  As the error
path is certainly not performance critical, this may be moved to the
waiting function mmc_wait_for_req_done().

This allows ->request() to use runtime PM get_sync() and guarantee it
is never in an atomic context.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Ulf Hansson <ulf.hansson@stericsson.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: Add module.h to drivers/mmc users assuming implicit presence.
Paul Gortmaker [Sun, 3 Jul 2011 19:15:51 +0000 (15:15 -0400)]
mmc: Add module.h to drivers/mmc users assuming implicit presence.

We are cleaning up the implicit presence of module.h; these guys are
some of the people who just assume it will be there.  Call it out
explitly for those that really need it.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: using module_param requires the inclusion of moduleparam.h
Stephen Rothwell [Sun, 9 Oct 2011 14:35:16 +0000 (10:35 -0400)]
mmc: using module_param requires the inclusion of moduleparam.h

Commit "mmc: add module param to set fault injection attributes" adds
a module_param to this file.  But it is relying on the old implicit
"module.h is everywhere" behaviour, and without the explicit include
of moduleparam.h, the pending module.h split up produces this error:

core/debugfs.c:28:35: error: expected ')' before numeric constant

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: general purpose MMC partition support.
Namjae Jeon [Thu, 6 Oct 2011 14:41:38 +0000 (23:41 +0900)]
mmc: core: general purpose MMC partition support.

It allows gerneral purpose partitions in MMC Device.  And I try to simply
make mmc_blk_alloc_parts using mmc_part structure suggested by Andrei
Warkentin.  After patching, we see general purpose partitions like this:
> cat /proc/partitions
          179 0 847872 mmcblk0
          179 192 4096 mmcblk0gp3
          179 160 4096 mmcblk0gp2
          179 128 4096 mmcblk0gp1
          179 96  1052672 mmcblk0gp0
          179 64  1024 mmcblk0boot1
          179 32  1024 mmcblk0boot0

Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: Andrei Warkentin <awarkentin@vmware.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: ext_csd.raw_* used in comparison but never set
Andrei Warkentin [Sat, 24 Sep 2011 16:12:30 +0000 (12:12 -0400)]
mmc: core: ext_csd.raw_* used in comparison but never set

f39b2dd9d ("mmc: core: Bus width testing needs to handle suspend/resume")
added code to only compare read-only ext_csd fields in bus width testing
code, yet it's comparing some fields that are never set.

The affected fields are ext_csd.raw_erased_mem_count and
ext_csd.raw_partition_support.

Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
Acked-by: Philip Rakity <prakity@marvell.com>
Cc: <stable@kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: irq: Remove IRQF_DISABLED
Yong Zhang [Thu, 22 Sep 2011 08:59:04 +0000 (16:59 +0800)]
mmc: irq: Remove IRQF_DISABLED

Since commit [e58aa3d2: genirq: Run irq handlers with interrupts
disabled], we run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler returns with
interrupts enabled (see commit [b738a50a: genirq: Warn when handler
enables interrupts]).

So now this flag is a NOOP and can be removed.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Acked-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: block: support no access to boot partitions
Adrian Hunter [Fri, 23 Sep 2011 09:48:21 +0000 (12:48 +0300)]
mmc: block: support no access to boot partitions

Intel Medfield platform blocks access to eMMC boot partitions which
results in switch errors.  Since there is no access, mmcboot0/1
devices should not be created.  Add a host capability to reflect that.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: block: fix boot partition switch error path
Adrian Hunter [Fri, 23 Sep 2011 09:48:20 +0000 (12:48 +0300)]
mmc: block: fix boot partition switch error path

In the case of a switch error, do not update partition config as though
the switch succeeded, and ensure blk_end_request is called on the
failed request.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Andrei Warkentin <andrey.warkentin@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: eMMC 4.5 Power Class Selection Feature
Girish K S [Fri, 23 Sep 2011 15:11:47 +0000 (20:41 +0530)]
mmc: core: eMMC 4.5 Power Class Selection Feature

This patch adds the power class selection feature available for mmc
versions 4.0 and above.  During the enumeration stage before switching
to the lower data bus, check if the power class is supported for the
current bus width. If the power class is available then switch to the
power class and use the higher data bus. If power class is not supported
then switch to the lower data bus in a worst case.

Signed-off-by: Girish K S <girish.shivananjappa@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agofault-injection: update documentation with the mmc module param
Per Forlin [Tue, 13 Sep 2011 21:03:30 +0000 (23:03 +0200)]
fault-injection: update documentation with the mmc module param

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: add module param to set fault injection attributes
Per Forlin [Tue, 13 Sep 2011 21:03:29 +0000 (23:03 +0200)]
mmc: add module param to set fault injection attributes

Replace setup("fail_mmc_request") and faulty "ifdef KERNEL" with
a simple module_param(). The module param mmc_core.fail_request
may be used to set the fault injection attributes during boot time
or module load time.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agofault-inject: export setup_fault_attr()
Per Forlin [Tue, 13 Sep 2011 21:03:28 +0000 (23:03 +0200)]
fault-inject: export setup_fault_attr()

mmc_core module needs to use setup_fault_attr() in order
to set fault injection attributes during module load time.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci-esdhc-imx: add basic imx6q usdhc support
Shawn Guo [Mon, 19 Sep 2011 09:32:21 +0000 (17:32 +0800)]
mmc: sdhci-esdhc-imx: add basic imx6q usdhc support

This patch adds the basic support for imx6q usdhc, which is a
derivative of esdhc controller.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: add sd uhs string for mmc_ios_show
Aaron Lu [Fri, 2 Sep 2011 08:06:08 +0000 (16:06 +0800)]
mmc: core: add sd uhs string for mmc_ios_show

This is a minor fix. It makes mmc_ios_show print proper string when the
host's timing is one of the newly added UHS-I modes.

Signed-off-by: Aaron Lu <aaron.lu@amd.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sh_mmcif: simplify platform data
Guennadi Liakhovetski [Tue, 30 Aug 2011 16:26:39 +0000 (18:26 +0200)]
mmc: sh_mmcif: simplify platform data

Provide platforms with a simplified way to specify MMCIF DMA slave IDs in
a way, similar to SDHI and other sh_dma clients.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: block: add eMMC hardware reset support
Adrian Hunter [Mon, 29 Aug 2011 13:42:15 +0000 (16:42 +0300)]
mmc: block: add eMMC hardware reset support

For cards that support hardware reset (just eMMC), try a reset and
retry before returning an I/O error.  However this is not done for
ECC errors and is never done twice for the same operation type
(READ, WRITE, DISCARD, SECURE DISCARD) until that type of operation
again succeeds.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: mmc-test: add eMMC hardware reset test
Adrian Hunter [Mon, 29 Aug 2011 13:42:14 +0000 (16:42 +0300)]
mmc: mmc-test: add eMMC hardware reset test

MMC core provides a checking function that checks if the reset
has happended.  Add a test to use that function.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci-pci: add eMMC hardware reset support
Adrian Hunter [Mon, 29 Aug 2011 13:42:13 +0000 (16:42 +0300)]
mmc: sdhci-pci: add eMMC hardware reset support

Implement eMMC hardware reset for Medfield.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci: add eMMC hardware reset support
Adrian Hunter [Mon, 29 Aug 2011 13:42:12 +0000 (16:42 +0300)]
mmc: sdhci: add eMMC hardware reset support

Add an SDHCI operation for hardware reset and connect it to the
host controller operation.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: add eMMC hardware reset support
Adrian Hunter [Mon, 29 Aug 2011 13:42:11 +0000 (16:42 +0300)]
mmc: core: add eMMC hardware reset support

eMMC's may have a hardware reset line.  This patch provides a
host controller operation to implement hardware reset and
a function to reset and reinitialize the card.  Also, for MMC,
the reset is always performed before initialization.

The host must set the new host capability MMC_CAP_HW_RESET
to enable hardware reset.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: mmci: simplify err check in mmci_post_request
Per Forlin [Mon, 29 Aug 2011 13:35:59 +0000 (15:35 +0200)]
mmc: mmci: simplify err check in mmci_post_request

The error condition indicates that mmci_post_request() should cleanup
after the mmci_pre_request(). In this case the resources allocated by
device_prep_slave_sg() are freed by calling dmaengine_terminate_all().
dma_unmap_sg() should always be performed if the host_cookie is set.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: clarify how to use post_req in case of errors
Per Forlin [Mon, 29 Aug 2011 13:35:58 +0000 (15:35 +0200)]
mmc: core: clarify how to use post_req in case of errors

The err condition in post_req() is set to undo a call made to pre_req()
that hasn't been started yet.  The err condition is not set if an MMC
request returns an error.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: Set correct bus mode before card init
Stefan Nilsson XK [Thu, 15 Sep 2011 15:50:38 +0000 (17:50 +0200)]
mmc: core: Set correct bus mode before card init

Earlier all cards where initiated with bus mode set as OPENDRAIN, and then
later switched to PUSHPULL. According to the MMC/SD/SDIO specifications
only MMC cards use OPENDRAIN during init. For both SD and SDIO the bus
mode shall be PUSHPULL before attempting to init the card.

The consequence of having incorrect bus mode can lead to not being able
to detect the card. Therefore the default behavior have now been changed
to PUSHPULL in mmc_power_up, and will only be temporarily switched when
trying to attach or init a MMC card.

Signed-off-by: Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com>
Signed-off-by: Ulf HANSSON <ulf.hansson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdio: Workaround for dev with broken CMD53
Stefan Nilsson XK [Thu, 15 Sep 2011 15:43:04 +0000 (17:43 +0200)]
mmc: sdio: Workaround for dev with broken CMD53

Adds a quirk which can be turned on for SDIO devices that do not support
512 byte requests in byte mode during CMD53. These requests will always
be sent in block mode instead.

This patch also enables this quirk for ST-Ericsson CW1200 WLAN device.

Signed-off-by: Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com>
Signed-off-by: Ulf HANSSON <ulf.hansson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci-pxa: Check pdata before using its members
Tanmay Upadhyay [Wed, 14 Sep 2011 05:59:02 +0000 (11:29 +0530)]
mmc: sdhci-pxa: Check pdata before using its members

Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com>
Acked-by: Zhangfei Gao <zhangfei.gao@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: Fix hangs related to insert/remove of cards
Ulf Hansson [Wed, 21 Sep 2011 18:08:13 +0000 (14:08 -0400)]
mmc: core: Fix hangs related to insert/remove of cards

During a rescan operation mmc_attach(sd|mmc|sdio) functions are
called. The error handling in these function can trigger a detach
of the bus, which also meant a power off. This is not notified by
the rescan operation which then continues to the next attach function.

If a power off has been done, the framework must never send any
new commands to the host driver, without first doing a new power up.
This will most likely trigger any host driver to hang.

Moving power off out of detach and instead handle power off
separately when it is actually needed, solves the issue.

Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: <stable@kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci-spear: Don't set power gpio to 1 on probe
Viresh Kumar [Mon, 12 Sep 2011 11:22:49 +0000 (16:52 +0530)]
mmc: sdhci-spear: Don't set power gpio to 1 on probe

Currently if card_power_gpio is passed from platform data, it is acquired
and its value is either set or reset. After that we overwrite it with 1,
which is not required.

So, this patch removes the extra line which sets its value.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci-of-esdhc: Access Freescale eSDHC registers as 32-bit
Xu lei [Fri, 9 Sep 2011 12:05:46 +0000 (20:05 +0800)]
mmc: sdhci-of-esdhc: Access Freescale eSDHC registers as 32-bit

Freescale eSDHC registers only support 32-bit accesses, this patch
ensures that all Freescale eSDHC register accesses are 32-bit.

Signed-off-by: Xu lei <B33228@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agoMerge branch 'slab/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penber...
Linus Torvalds [Wed, 26 Oct 2011 19:46:18 +0000 (21:46 +0200)]
Merge branch 'slab/for-linus' of git://git./linux/kernel/git/penberg/linux

* 'slab/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux:
  tools, slub: Fix off-by-one buffer corruption after readlink() call
  slub: Discard slab page when node partial > minimum partial number
  slub: correct comments error for per cpu partial
  mm: restrict access to slab files under procfs and sysfs
  slub: Code optimization in get_partial_node()
  slub: doc: update the slabinfo.c file path
  slub: explicitly document position of inserting slab to partial list
  slub: update slabinfo tools to report per cpu partial list statistics
  slub: per cpu cache for partial pages
  slub: return object pointer from get_partial() / new_slab().
  slub: pass kmem_cache_cpu pointer to get_partial()
  slub: Prepare inuse field in new_slab()
  slub: Remove useless statements in __slab_alloc
  slub: free slabs without holding locks
  slub: use print_hex_dump
  slab: use print_hex_dump

12 years agommc: core: Put eMMC in Sleep mode before suspend
Balaji T K [Thu, 8 Sep 2011 16:38:39 +0000 (22:08 +0530)]
mmc: core: Put eMMC in Sleep mode before suspend

Put MMC to sleep if it supports SLEEP/AWAKE (CMD5) in the mmc suspend
so that Vcc (NAND core) can be cut to minimize power consumption.
eMMC put into SLEEP can respond to CMD0 or H/W reset or CMD5.
Current implemention on resume from suspend relies on CMD0 in
mmc_init_card to get out of SLEEP mode.

Signed-off-by: Balaji T K <balajitk@ti.com>
Acked-by: Venkatraman S <svenkatr@ti.com>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci-s3c: add default controller configuration
Thomas Abraham [Wed, 14 Sep 2011 07:09:17 +0000 (12:39 +0530)]
mmc: sdhci-s3c: add default controller configuration

The default controller configuration which was previously setup by
platform helper functions is moved into the driver.

Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: add a short delay in mmc_power_off
Daniel Drake [Wed, 7 Sep 2011 09:22:09 +0000 (10:22 +0100)]
mmc: core: add a short delay in mmc_power_off

Stress-testing the runtime power management of libertas_sdio
through a rmmod/insmod loop revealed that it is quite easy to
cause an ETIMEDOUT failure in mmc_sdio_power_restore() leading to:
   libertas_sdio: probe of mmc1:0001:1 failed with error -16

Experimentation shows that a very short delay (100us) is needed in
the power down path before the card can be successfully booted again.
We know that this setup is lacking poweroff clamps on the card's power
lines, but as only a short delay is needed, apply this unconditionally.
Also bump up to 1ms sleep for extra legroom.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci-tegra: Add 8-bit support to device tree binding.
Stephen Warren [Tue, 30 Aug 2011 19:17:16 +0000 (13:17 -0600)]
mmc: sdhci-tegra: Add 8-bit support to device tree binding.

The previous patch which implemented a DT binding for sdhci-tegra did not
allow all platform data fields to be initialized from DT. The following
were missing:

is_8bit: Implemented by this patch.

pm_flags: Not implemented yet. There are no mainline users of this field.
  I'm not quite sure what it's for, and hence how to represent this
  in DT; the value ends up being assigned to host->mmc->pm_caps.

While we're at it, fix the binding documentation to refer to "SD/MMC"
instead of "eSDHC", since that's the correct name; "eSDHC" was cut/paste
from the Freescale binding docs.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: dw_mmc: Support SDIO interrupts for all slots
Shashidhar Hiremath [Mon, 29 Aug 2011 07:41:46 +0000 (13:11 +0530)]
mmc: dw_mmc: Support SDIO interrupts for all slots

The Patch adds the support for SDIO interrupts for all slots.
It includes enabling of SDIO interrupts through dw_mci_enable_sdio_irq
and the handling of the slot specific interrupts in the Interrupt Service
Routine.

Signed-off-by: Shashidhar Hiremath <shashidharh@vayavyalabs.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: msm_sdcc: Handle dma resource not present case
Subhash Jadavani [Mon, 2 May 2011 12:40:40 +0000 (18:10 +0530)]
mmc: msm_sdcc: Handle dma resource not present case

If DMA resource is not available then SDCC driver
should atleast work in PIO data transfer mode.

Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: msm_sdcc: Change initialization order of busclk_timer in probe
Sahitya Tummala [Mon, 2 May 2011 12:40:01 +0000 (18:10 +0530)]
mmc: msm_sdcc: Change initialization order of busclk_timer in probe

Intialize busclk_timer before it is accessed in probe.

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: msm_sdcc: Use MCI_INT_MASK0 for PIO interrupts
Sahitya Tummala [Mon, 2 May 2011 12:39:18 +0000 (18:09 +0530)]
mmc: msm_sdcc: Use MCI_INT_MASK0 for PIO interrupts

Not all targets have IRQ1 line routed from the SD controller to
the processor. So we cannot rely on IRQ1 for PIO interrupts.
This patch moves all PIO interrupts to IRQ0 and enables the PIO
mode.

Signed-off-by: Murali Palnati <palnatim@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agomsm: mmc: Remove "pio_irq" resource
Sahitya Tummala [Mon, 2 May 2011 12:37:43 +0000 (18:07 +0530)]
msm: mmc: Remove "pio_irq" resource

On some targets, MCI_IRQ_MASK1 is not routed to the MSM in which
case only "cmd_irq" must be used even for PIO. With this change,
all the targets will use only "cmd_irq" for both CMD and PIO.

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: msm_sdcc: Enable SDC host->clk only after setting the rate.
Sahitya Tummala [Mon, 2 May 2011 12:37:01 +0000 (18:07 +0530)]
mmc: msm_sdcc: Enable SDC host->clk only after setting the rate.

For clocks that support rates which can be set (most clocks other
than _pclk AHB clocks), a rate must be set using clk_set_rate()
before the clock is enabled for the first time with clk_enable().
Subsequent calls to clk_enable() need not be preceded with the
clk_set_rate() calls unless we wish to change the clock rate that
is set previously.

SDC host->clk is currently enabled without setting the clock rate
even once. This patch fixes this, by ensuring that the clock rate
for this clock is first set before enabling the clock.

Signed-off-by: Murali Palnati <palnatim@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: msm_sdcc: Handle error cases in probe
Sahitya Tummala [Mon, 2 May 2011 12:36:05 +0000 (18:06 +0530)]
mmc: msm_sdcc: Handle error cases in probe

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agomsm: Implement init_card operation for MSM SDCC
Alexander Tarasikov [Sun, 21 Aug 2011 11:52:44 +0000 (15:52 +0400)]
msm: Implement init_card operation for MSM SDCC

This allows boards with non-standard sdio cards to fill the CIS/CCCR data.
It is particularly important for old msm72k boards using wl1251.
Also drop the obsolete embedded_sdio_data structure from the header
as it was intended to surve a similiar purpose but was not implemented.

Signed-off-by: Alexander Tarasikov <alexander.tarasikov@gmail.com>
Acked-by: Sahitya Tummala <stummala@codeaurora.org>
[davidb: minor formatting cleanup]
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: msm_sdcc: Fix a typo in MSM SDCC driver gpio setup
Alexander Tarasikov [Sun, 21 Aug 2011 11:52:43 +0000 (15:52 +0400)]
mmc: msm_sdcc: Fix a typo in MSM SDCC driver gpio setup

The use of && instead of || caused a NULL pointer dereference if
gpio setup was not passed via platform data

Signed-off-by: Alexander Tarasikov <alexander.tarasikov@gmail.com>
Acked-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agoARM: shmobile: ag5evm, ap4: Named SDHI IRQ sources
Simon Horman [Thu, 25 Aug 2011 01:27:28 +0000 (10:27 +0900)]
ARM: shmobile: ag5evm, ap4: Named SDHI IRQ sources

This allows specific (non-multiplexed) IRQ handlers to be used.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Paul Mundt <lethal@linux-sh.org>
Acked-by: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhi: Allow named IRQs to use specific handlers
Simon Horman [Fri, 26 Aug 2011 08:42:39 +0000 (10:42 +0200)]
mmc: sdhi: Allow named IRQs to use specific handlers

Allow named IRQs to use corresponding specific handlers. If named IRQs are
used, at least an "sdcard" IRQ has to be specified by the platform. If
names are not used, an arbitrary number of IRQs can be provided by the
platform, in which case the generic ISR will be used for each of them.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
[g.liakhovetski@gmx.de: style and typo corrections, platform data check]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: tmio: Provide separate interrupt handlers
Simon Horman [Thu, 25 Aug 2011 01:27:26 +0000 (10:27 +0900)]
mmc: tmio: Provide separate interrupt handlers

Provide separate interrupt handlers which may be used by platforms where
SDHI has three interrupt sources.

This patch also removes the commented-out handling of CRC and other errors.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: tmio: Cache interrupt masks
Simon Horman [Thu, 25 Aug 2011 01:27:25 +0000 (10:27 +0900)]
mmc: tmio: Cache interrupt masks

This avoids the need to look up the masks each time an interrupt is handled.
As suggested by Guennadi.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: fix integer assignments to pointer
Venkatraman S [Wed, 24 Aug 2011 19:00:50 +0000 (00:30 +0530)]
mmc: fix integer assignments to pointer

Fix the sparse warning output "warning: Using plain integer as NULL pointer"

Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: queue: declare mmc_alloc_sg as static
Venkatraman S [Tue, 23 Aug 2011 15:46:02 +0000 (21:16 +0530)]
mmc: queue: declare mmc_alloc_sg as static

Fix the sparse warning "drivers/mmc/card/queue.c:111:20: warning:
symbol 'mmc_alloc_sg' was not declared. Should it be static?"

Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: Kconfig: remove i.MX individual SoC dependency
Sascha Hauer [Wed, 24 Aug 2011 06:41:08 +0000 (08:41 +0200)]
mmc: Kconfig: remove i.MX individual SoC dependency

The individual SoC dependency in Kconfig hardly scales anymore.
Instead of having such a fine grained dependency just depend
on ARCH_MXC and risk that the uninformed user has to look in
the help text to figure out which driver is the correct one.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci-tegra: Add Device Tree probing support
Grant Likely [Tue, 23 Aug 2011 18:15:33 +0000 (12:15 -0600)]
mmc: sdhci-tegra: Add Device Tree probing support

Add hooks to read gpio configuration out of the device tree node.

[grant.likely: Rewrite of original patch from John Bonesio]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
[swarren: Fixed tegra_sdhci_get_ro() to retrieve pdata correctly]
[swarren: Reworked to avoid #ifdef CONFIG_OF]
[swarren: Reworked binding based on fsl-imx-esdhc.txt]
[swarren: Documented binding]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: enable runtime PM by default
Daniel Drake [Wed, 20 Jul 2011 16:39:22 +0000 (17:39 +0100)]
mmc: enable runtime PM by default

Now that we have improved the runtime power management powerup/powerdown
code, we believe that MMC_CAP_POWER_OFF_CARD is no longer necessary:
runtime PM should now work everywhere.

The only hard evidence for introducing MMC_CAP_POWER_OFF_CARD was the
Marvell sd8686 wifi chip, which was believed to require external gpio
manipulation which wasn't supported by some boards.

After further investigation it was realized (and confirmed by Marvell
folks) that sd8686 requirements can be fulfilled by changing the reset
sequence itself, even if no external gpio is manipulated.

For further information, see the following thread:
http://www.mail-archive.com/linux-mmc@vger.kernel.org/msg04289.html

Enable this trivially for a release or two. If no problems are reported,
we will follow up with a more extensive patch to remove this flag
altogether. If problems are reported, we can look at whitelist/blacklist
possibilities as before.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agofault-inject: add documentation on MMC IO fault injection
Per Forlin [Fri, 19 Aug 2011 12:52:38 +0000 (14:52 +0200)]
fault-inject: add documentation on MMC IO fault injection

Add description on how to enable random fault injection
for MMC IO.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: core: add random fault injection
Per Forlin [Fri, 19 Aug 2011 12:52:37 +0000 (14:52 +0200)]
mmc: core: add random fault injection

This adds support to inject data errors after a completed host transfer.
The mmc core will return error even though the host transfer is successful.
This simple fault injection proved to be very useful to test the
non-blocking error handling in the mmc_blk_issue_rw_rq().
Random faults can also test how the host driver handles pre_req()
and post_req() in case of errors.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agofault-inject: export fault injection functions
Per Forlin [Fri, 19 Aug 2011 12:52:36 +0000 (14:52 +0200)]
fault-inject: export fault injection functions

Export symbols should_fail() and fault_create_debugfs_attr() in order
to let modules utilize the fault injection framework.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: sdhci-esdhc-imx: Enable ADMA2
Richard Zhu [Thu, 11 Aug 2011 20:51:46 +0000 (16:51 -0400)]
mmc: sdhci-esdhc-imx: Enable ADMA2

Eanble the ADMA2 mode for freescale esdhc imx driver, tested on MX25
3DS board, MX51 BBG board and MX53 LOCO board.

This patch is only used to enable the ADMA2 for MX51/53 platforms.
MX25/35 can't support the ADMA2 mode, set BROKEN_ADMA quirk on
MX25/35 platforms.

The ADMA mode supported or not can be distinguished by bit 20 of
the Capability Register (offset 0x40) in the FSL eSDHC module.

Signed-off-by: Richard Zhu <richard.zhu@linaro.org>
Tested-and-acked-by: Eric Miao <eric.miao@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: at91_mci: remove the use of irq_to_gpio
Nicolas Ferre [Thu, 4 Aug 2011 15:49:03 +0000 (16:49 +0100)]
mmc: at91_mci: remove the use of irq_to_gpio

Remove the use of irq_to_gpio() in the card detection interrupt
handler. The information is available in the board structure and
we can avoid using a function that has little meaning.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: atmel-mci: fix a potential issue about pending PDC interrupts
Ludovic Desroches [Thu, 11 Aug 2011 15:25:48 +0000 (15:25 +0000)]
mmc: atmel-mci: fix a potential issue about pending PDC interrupts

This patch fixes a potential issue about PDC interrupts. For example we
have a ENDRX pending interrupt and a RXBUFF pending interrupt. We have
received the RXBUFF interrupt but the transfer is not finished (so we
didn't have time to give a new buffer to the PDC controller). Then we
will compute ENDRX interrupt and we will give a new buffer to the PDC
controller, just after we will compute the RXBUFF interrupt and give
one or two new buffers to the PDC controller but we are not sure that
the first buffer given has been filled. So in this situation we may
have "lost" one sg buffer. It's the same for transmission.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: atmel-mci: correct sg buffer size evaluation
Ludovic Desroches [Thu, 11 Aug 2011 15:25:47 +0000 (15:25 +0000)]
mmc: atmel-mci: correct sg buffer size evaluation

Assuming that a sg buffer size is a page size is false so use sg_dma_len.
A 4096 bytes can be required with two 2048-bytes sg buffer.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: atmel-mci: use ATMEL_PDC_SCND_BUF_OFF instead of a literal value
Ludovic Desroches [Thu, 11 Aug 2011 15:25:46 +0000 (15:25 +0000)]
mmc: atmel-mci: use ATMEL_PDC_SCND_BUF_OFF instead of a literal value

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: atmel-mci: change atmci_start_command to atmci_send_command
Ludovic Desroches [Thu, 11 Aug 2011 15:25:45 +0000 (15:25 +0000)]
mmc: atmel-mci: change atmci_start_command to atmci_send_command

Rename atmci_start_command() to atmci_send_command() which is more
appropriate; atmci_start_command suggests we're sending a start command.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: atmel-mci: add pdc support and runtime capabilities detection
Ludovic Desroches [Thu, 11 Aug 2011 15:25:44 +0000 (15:25 +0000)]
mmc: atmel-mci: add pdc support and runtime capabilities detection

Add pdc support for atmel-mci. It makes at91-mci driver useless because it
was only used for the old atmel MCI core which has pdc but no dma support.
To allow removing at91-mci, the capabilities of the MCI core are detected
at runtime -- then the driver will use pio, pdc or dma transfers.
Warning: at91rm9200 is not supported, to support it we need to use swab32
on data but I have no board to test it.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: atmel-mci: indentation
Ludovic Desroches [Thu, 11 Aug 2011 15:25:43 +0000 (15:25 +0000)]
mmc: atmel-mci: indentation

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: atmel-mci: change atmci_readl and atmci_writel macros
Ludovic Desroches [Thu, 11 Aug 2011 15:25:42 +0000 (15:25 +0000)]
mmc: atmel-mci: change atmci_readl and atmci_writel macros

Change atmci_readl and atmci_writel macros: remove string concatenation.
We can use these macros with registers which are not prefixed by ATMCI_.
This is the case if we want to write PDC registers which are common to
several devices so they are not prefixed with ATMCI_.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agommc: atmel-mci: change namespace
Ludovic Desroches [Thu, 11 Aug 2011 15:25:41 +0000 (15:25 +0000)]
mmc: atmel-mci: change namespace

Homogenize namespace to atmci.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier...
Linus Torvalds [Wed, 26 Oct 2011 19:43:07 +0000 (21:43 +0200)]
Merge branch 'for-linus' of git://git./linux/kernel/git/vapier/blackfin

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin:
  Blackfin: irq: remove IRQF_DISABLED
  Blackfin: boards: clean up i2c_board_info
  Blackfin: drop unused Kconfig symbol
  Blackfin: bf537-stamp: register ASoC EVAL-ADAU1373 board driver
  Blackfin: bf537-stamp: Register adav801 codec and ASoC machine driver
  Blackfin: bf537-stamp: register adau1701 codec and asoc machine driver
  Blackfin: merge asm/mutex.h into kbuild too
  Blackfin: bf537-stamp: fix ad73311 codec config macro
  Blackfin: bf537-stamp: fix ad1836 name
  Blackfin: kgdb_test: rework code to avoid -O0 usage
  Blackfin: fix sparse warnings in copy_to/from_user
  Blackfin: bf548-ezkit: update defconfig
  Blackfin: SMP: fix scheduling deadlock
  Blackfin: H8606: fixup bogus ioresource init
  Blackfin: SMP: convert to common asm-generic/atomic.h

12 years agoMerge branch 'for-linus' of git://neil.brown.name/md
Linus Torvalds [Wed, 26 Oct 2011 19:39:42 +0000 (21:39 +0200)]
Merge branch 'for-linus' of git://neil.brown.name/md

* 'for-linus' of git://neil.brown.name/md: (34 commits)
  md: Fix some bugs in recovery_disabled handling.
  md/raid5: fix bug that could result in reads from a failed device.
  lib/raid6: Fix filename emitted in generated code
  md.c: trivial comment fix
  MD: Allow restarting an interrupted incremental recovery.
  md: clear In_sync bit on devices added to an active array.
  md: add proper write-congestion reporting to RAID1 and RAID10.
  md: rename "mdk_personality" to "md_personality"
  md/bitmap remove fault injection options.
  md/raid5: typedef removal: raid5_conf_t -> struct r5conf
  md/raid1: typedef removal: conf_t -> struct r1conf
  md/raid10: typedef removal: conf_t -> struct r10conf
  md/raid0: typedef removal: raid0_conf_t -> struct r0conf
  md/multipath: typedef removal: multipath_conf_t -> struct mpconf
  md/linear: typedef removal: linear_conf_t -> struct linear_conf
  md/faulty: remove typedef: conf_t -> struct faulty_conf
  md/linear: remove typedefs: dev_info_t -> struct dev_info
  md: remove typedefs: mirror_info_t -> struct mirror_info
  md: remove typedefs: r10bio_t -> struct r10bio and r1bio_t -> struct r1bio
  md: remove typedefs: mdk_thread_t -> struct md_thread
  ...

12 years agoMerge branch 'for-linus' of git://git.open-osd.org/linux-open-osd
Linus Torvalds [Wed, 26 Oct 2011 19:33:50 +0000 (21:33 +0200)]
Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd

* 'for-linus' of git://git.open-osd.org/linux-open-osd: (21 commits)
  ore: Enable RAID5 mounts
  exofs: Support for RAID5 read-4-write interface.
  ore: RAID5 Write
  ore: RAID5 read
  fs/Makefile: Always inspect exofs/
  ore: Make ore_calc_stripe_info EXPORT_SYMBOL
  ore/exofs: Change ore_check_io API
  ore/exofs: Define new ore_verify_layout
  ore: Support for partial component table
  ore: Support for short read/writes
  exofs: Support for short read/writes
  ore: Remove check for ios->kern_buff in _prepare_for_striping to later
  ore: cleanup: Embed an ore_striping_info inside ore_io_state
  ore: Only IO one group at a time (API change)
  ore/exofs: Change the type of the devices array (API change)
  ore: Make ore_striping_info and ore_calc_stripe_info public
  exofs: Remove unused data_map member from exofs_sb_info
  exofs: Rename struct ore_components comps => oc
  exofs/super.c: local functions should be static
  exofs/ore.c: local functions should be static
  ...

12 years agoMerge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 26 Oct 2011 15:43:08 +0000 (17:43 +0200)]
Merge branch 'x86-cleanups-for-linus' of git://git./linux/kernel/git/tip/tip

* 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86-64, unistd: Remove bogus __IGNORE_getcpu
  x86, mm, trivial: Remove unnecessary get_order() in free_thread_info()
  x86, cleanup: Remove unneeded version.h include from arch/x86/

12 years agoMerge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 26 Oct 2011 15:42:03 +0000 (17:42 +0200)]
Merge branch 'x86-asm-for-linus' of git://git./linux/kernel/git/tip/tip

* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86-64: Fix CFI data for interrupt frames
  x86-64: Don't apply destructive erratum workaround on unaffected CPUs

12 years agoMerge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 26 Oct 2011 15:30:33 +0000 (17:30 +0200)]
Merge branch 'x86-apic-for-linus' of git://git./linux/kernel/git/tip/tip

* 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/irq: Standardize on CONFIG_SPARSE_IRQ=y
  x86, ioapic: Clean up ioapic/apic_id usage
  x86, ioapic: Factor out print_IO_APIC() to only print one io apic
  x86, ioapic: Print out irte with right ioapic index
  x86, ioapic: Split up setup_ioapic_entry()
  x86, ioapic: Pass struct irq_attr * to setup_ioapic_irq()
  apic, i386/bigsmp: Fix false warnings regarding logical APIC ID mismatches

12 years agoRemove stale "depends on NETDEV_1000"in staging drivers
Linus Torvalds [Wed, 26 Oct 2011 15:21:19 +0000 (17:21 +0200)]
Remove stale "depends on NETDEV_1000"in staging drivers

Mark Einon points out that the Kconfig option for NETDEV_1000 no longer
exists, and the merge of the staging drivers should have removed that
for the et131x driver.

And while checking for it, I noticed that slicoss had the same stale
dependency.  Remove that one too.

Reported-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 26 Oct 2011 15:15:03 +0000 (17:15 +0200)]
Merge branch 'timers-core-for-linus' of git://git./linux/kernel/git/tip/tip

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
  time, s390: Get rid of compile warning
  dw_apb_timer: constify clocksource name
  time: Cleanup old CONFIG_GENERIC_TIME references that snuck in
  time: Change jiffies_to_clock_t() argument type to unsigned long
  alarmtimers: Fix error handling
  clocksource: Make watchdog reset lockless
  posix-cpu-timers: Cure SMP accounting oddities
  s390: Use direct ktime path for s390 clockevent device
  clockevents: Add direct ktime programming function
  clockevents: Make minimum delay adjustments configurable
  nohz: Remove "Switched to NOHz mode" debugging messages
  proc: Consider NO_HZ when printing idle and iowait times
  nohz: Make idle/iowait counter update conditional
  nohz: Fix update_ts_time_stat idle accounting
  cputime: Clean up cputime_to_usecs and usecs_to_cputime macros
  alarmtimers: Rework RTC device selection using class interface
  alarmtimers: Add try_to_cancel functionality
  alarmtimers: Add more refined alarm state tracking
  alarmtimers: Remove period from alarm structure
  alarmtimers: Remove interval cap limit hack
  ...

12 years agoMerge branches 'slab/next' and 'slub/partial' into slab/for-linus
Pekka Enberg [Wed, 26 Oct 2011 15:09:12 +0000 (18:09 +0300)]
Merge branches 'slab/next' and 'slub/partial' into slab/for-linus

12 years agoMerge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 26 Oct 2011 15:08:43 +0000 (17:08 +0200)]
Merge branch 'sched-core-for-linus' of git://git./linux/kernel/git/tip/tip

* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (46 commits)
  llist: Add back llist_add_batch() and llist_del_first() prototypes
  sched: Don't use tasklist_lock for debug prints
  sched: Warn on rt throttling
  sched: Unify the ->cpus_allowed mask copy
  sched: Wrap scheduler p->cpus_allowed access
  sched: Request for idle balance during nohz idle load balance
  sched: Use resched IPI to kick off the nohz idle balance
  sched: Fix idle_cpu()
  llist: Remove cpu_relax() usage in cmpxchg loops
  sched: Convert to struct llist
  llist: Add llist_next()
  irq_work: Use llist in the struct irq_work logic
  llist: Return whether list is empty before adding in llist_add()
  llist: Move cpu_relax() to after the cmpxchg()
  llist: Remove the platform-dependent NMI checks
  llist: Make some llist functions inline
  sched, tracing: Show PREEMPT_ACTIVE state in trace_sched_switch
  sched: Remove redundant test in check_preempt_tick()
  sched: Add documentation for bandwidth control
  sched: Return unused runtime on group dequeue
  ...

12 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 26 Oct 2011 15:07:07 +0000 (17:07 +0200)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86: Fix insn decoder for longer instruction

12 years agoMerge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 26 Oct 2011 15:03:38 +0000 (17:03 +0200)]
Merge branch 'perf-core-for-linus' of git://git./linux/kernel/git/tip/tip

* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (121 commits)
  perf symbols: Increase symbol KSYM_NAME_LEN size
  perf hists browser: Refuse 'a' hotkey on non symbolic views
  perf ui browser: Use libslang to read keys
  perf tools: Fix tracing info recording
  perf hists browser: Elide DSO column when it is set to just one DSO, ditto for threads
  perf hists: Don't consider filtered entries when calculating column widths
  perf hists: Don't decay total_period for filtered entries
  perf hists browser: Honour symbol_conf.show_{nr_samples,total_period}
  perf hists browser: Do not exit on tab key with single event
  perf annotate browser: Don't change selection line when returning from callq
  perf tools: handle endianness of feature bitmap
  perf tools: Add prelink suggestion to dso update message
  perf script: Fix unknown feature comment
  perf hists browser: Apply the dso and thread filters when merging new batches
  perf hists: Move the dso and thread filters from hist_browser
  perf ui browser: Honour the xterm colors
  perf top tui: Give color hints just on the percentage, like on --stdio
  perf ui browser: Make the colors configurable and change the defaults
  perf tui: Remove unneeded call to newtCls on startup
  perf hists: Don't format the percentage on hist_entry__snprintf
  ...

Fix up conflicts in arch/x86/kernel/kprobes.c manually.

Ingo's tree did the insane "add volatile to const array", which just
doesn't make sense ("volatile const"?).  But we could remove the const
*and* make the array volatile to make doubly sure that gcc doesn't
optimize it away..

Also fix up kernel/trace/ring_buffer.c non-data-conflicts manually: the
reader_lock has been turned into a raw lock by the core locking merge,
and there was a new user of it introduced in this perf core merge.  Make
sure that new use also uses the raw accessor functions.

12 years agoMerge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 26 Oct 2011 14:44:09 +0000 (16:44 +0200)]
Merge branch 'irq-core-for-linus' of git://git./linux/kernel/git/tip/tip

* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  genirq: Add IRQF_RESUME_EARLY and resume such IRQs earlier
  genirq: Fix fatfinered fixup really
  genirq: percpu: allow interrupt type to be set at enable time
  genirq: Add support for per-cpu dev_id interrupts
  genirq: Add IRQCHIP_SKIP_SET_WAKE flag

12 years agoMerge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 26 Oct 2011 14:26:53 +0000 (16:26 +0200)]
Merge branch 'core-rcu-for-linus' of git://git./linux/kernel/git/tip/tip

* 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (45 commits)
  rcu: Move propagation of ->completed from rcu_start_gp() to rcu_report_qs_rsp()
  rcu: Remove rcu_needs_cpu_flush() to avoid false quiescent states
  rcu: Wire up RCU_BOOST_PRIO for rcutree
  rcu: Make rcu_torture_boost() exit loops at end of test
  rcu: Make rcu_torture_fqs() exit loops at end of test
  rcu: Permit rt_mutex_unlock() with irqs disabled
  rcu: Avoid having just-onlined CPU resched itself when RCU is idle
  rcu: Suppress NMI backtraces when stall ends before dump
  rcu: Prohibit grace periods during early boot
  rcu: Simplify unboosting checks
  rcu: Prevent early boot set_need_resched() from __rcu_pending()
  rcu: Dump local stack if cannot dump all CPUs' stacks
  rcu: Move __rcu_read_unlock()'s barrier() within if-statement
  rcu: Improve rcu_assign_pointer() and RCU_INIT_POINTER() documentation
  rcu: Make rcu_assign_pointer() unconditionally insert a memory barrier
  rcu: Make rcu_implicit_dynticks_qs() locals be correct size
  rcu: Eliminate in_irq() checks in rcu_enter_nohz()
  nohz: Remove nohz_cpu_mask
  rcu: Document interpretation of RCU-lockdep splats
  rcu: Allow rcutorture's stat_interval parameter to be changed at runtime
  ...

12 years agoALSA: hda - Fix surround/CLFE headphone and speaker pins order
Takashi Iwai [Wed, 26 Oct 2011 14:06:27 +0000 (16:06 +0200)]
ALSA: hda - Fix surround/CLFE headphone and speaker pins order

When 5.1 or more headphone or speaker pins are provided, the parser still
takes as is without fixing the order of channel mapping, which leads in
the unexpected strange channel order by surround outputs.

This patch fixes the issue by applying the same fix-up not only to
line_out_pins[] but also hp_pins[] and speaker_pins[].

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 26 Oct 2011 14:17:32 +0000 (16:17 +0200)]
Merge branch 'core-locking-for-linus' of git://git./linux/kernel/git/tip/tip

* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits)
  rtmutex: Add missing rcu_read_unlock() in debug_rt_mutex_print_deadlock()
  lockdep: Comment all warnings
  lib: atomic64: Change the type of local lock to raw_spinlock_t
  locking, lib/atomic64: Annotate atomic64_lock::lock as raw
  locking, x86, iommu: Annotate qi->q_lock as raw
  locking, x86, iommu: Annotate irq_2_ir_lock as raw
  locking, x86, iommu: Annotate iommu->register_lock as raw
  locking, dma, ipu: Annotate bank_lock as raw
  locking, ARM: Annotate low level hw locks as raw
  locking, drivers/dca: Annotate dca_lock as raw
  locking, powerpc: Annotate uic->lock as raw
  locking, x86: mce: Annotate cmci_discover_lock as raw
  locking, ACPI: Annotate c3_lock as raw
  locking, oprofile: Annotate oprofilefs lock as raw
  locking, video: Annotate vga console lock as raw
  locking, latencytop: Annotate latency_lock as raw
  locking, timer_stats: Annotate table_lock as raw
  locking, rwsem: Annotate inner lock as raw
  locking, semaphores: Annotate inner lock as raw
  locking, sched: Annotate thread_group_cputimer as raw
  ...

Fix up conflicts in kernel/posix-cpu-timers.c manually: making
cputimer->cputime a raw lock conflicted with the ABBA fix in commit
bcd5cff7216f ("cputimer: Cure lock inversion").