Commit Graph

441252 Commits

Author SHA1 Message Date
Tim Kryger 4d1f52f9a9 mmc: core: Improve support for deferred regulators
Callers of mmc_regulator_get_supply could benefit from knowing if either
of the regulators are present but not yet available.  Since callers do
not currently examine the return value, modify this function to return
zero or -EPROBE_DEFER if either regulator get returns the same.

Furthermore, since callers check vmmc/vqmmc using IS_ERR and can deal
with absent regulators, switch to devm_regulator_get_optional. This has
the added benefit of allowing this function to behave correctly even in
the !CONFIG_REGULATOR case such that the stub can be removed.

Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:08:24 -04:00
Alexander Shiyan bc3c17711e mmc: mxcmmc: Use mmc_regulator_get_supply() API
This patch replaces regulator manipulation with
mmc_regulator_get_supply() function from MMC core.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:08:24 -04:00
Alexandre Belloni 6e9e406282 mmc: atmel: don't test host->data
Found using smatch:
drivers/mmc/host/atmel-mci.c:827 atmci_pdc_complete() warn: variable
dereferenced before check 'host->data' (see line 807)

Stop testing host->data as it is not NULL at that point.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:08:23 -04:00
Arnd Bergmann b677b88503 mmc: rtsx: fix possible linking error if built-in
rtsx_usb_sdmmc module uses the LED classdev if available, but the code
failed to consider the situation that it is built-in and the LED classdev is a
module, leading to following linking error:

   LD      init/built-in.o
drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove':
rtsx_usb_sdmmc.c:(.text+0x2a018e): undefined reference to
`led_classdev_unregister'
drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe':
rtsx_usb_sdmmc.c:(.text+0x2a197e): undefined reference to
`led_classdev_register'

Fix by excluding such condition when defining macro RTSX_USB_USE_LEDS_CLASS.

Signed-off-by: Roger Tseng <rogerable@realtek.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:08:23 -04:00
Daniel Willmann 91769986a7 mmc: mxs: fix card detection function for broken card detect
Return -ENOSYS in get_cd if broken-cd is specified in the device tree.

Commit a91fe279ae (mmc: mxs: use standard flag for broken card
detection) sets MMC_CAP_NEEDS_POLL when broken-cd is specified. This
driver sets this flag unconditionally as it does not support a card
detect interrupt. Instead, broken-cd means that there is no card detect
signal connected.

The mmc core checks the get_cd function return value to determine if a
card is present. Only for a non-zero return value it will attempt to
initialize the card. So retuning -ENOSYS will allow the card to be
initialized.

For comparison, mmc_gpio_get_cd in slot-gpio.c also returns -ENOSYS if
the card detect GPIO is not valid.

Signed-off-by: Daniel Willmann <daniel@totalueberwachung.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:08:22 -04:00
Alex Smith 1acee84b6f mmc: jz4740: don't wait for PRG_DONE after stop command with R1 response
As of commit bcc3e1726d ("mmc: block: Use R1 responses for stop cmds for
read requests"), stop commands for reads do not have MMC_RSP_BUSY set.
In this case we should not wait for a PRG_DONE IRQ after sending the
stop command: it will not get raised when the busy flag is not set,
causing the request to fail with a timeout.

Signed-off-by: Alex Smith <alex.smith@imgtec.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Chris Ball <chris@printf.net>
Cc: James Hogan <james.hogan@imgtec.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:08:22 -04:00
Seungwon Jeon c373eb489b mmc: core: add DT bindings for eMMC HS400 1.8/1.2V
Provide the option to configure these speed modes per host,
for those host driver's that can't distinguish this in runtime.
Specially, if host can support HS400, it means that host can also
support HS200.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:08:10 -04:00
Seungwon Jeon 0a5b6438ee mmc: add support for HS400 mode of eMMC5.0
This patch adds HS400 mode support for eMMC5.0 device.  HS400 mode is high
speed DDR interface timing from HS200.  Clock frequency is up to 200MHz
and only 8-bit bus width is supported. In addition, tuning process of
HS200 is required to synchronize the command response on the CMD line
because CMD input timing for HS400 mode is the same as HS200 mode.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Reviewed-by: Jackey Shen <jackey.shen@amd.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:06:06 -04:00
Seungwon Jeon 577fb13199 mmc: rework selection of bus speed mode
Current implementation for bus speed mode selection is too
complicated. This patch is to simplify the codes and remove
some duplicate parts.

The following changes are including:
* Adds functions for each mode selection(HS, HS-DDR, HS200 and etc)
* Rearranged the mode selection sequence with supported device type
* Adds maximum speed for HS200 mode(hs200_max_dtr)
* Adds field definition for HS_TIMING of EXT_CSD

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:06:04 -04:00
Seungwon Jeon 2385049dd5 mmc: step power class after final selection of bus mode
Power class is changed once only after selection of bus modes
including speed and bus-width finishes finally.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:06:02 -04:00
Seungwon Jeon 2415c0ef61 mmc: identify available device type to select
Device types which are supported by both host and device can be
identified when EXT_CSD is read. There is no need to check host's
capability anymore.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:05:57 -04:00
Seungwon Jeon cdc991790c mmc: drop the speed mode of card's state
Timing mode identifier has same role and can take the place
of speed mode. This change removes all related speed mode.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:05:53 -04:00
Sebastian Hesselbarth b78871d0cf mmc: mvsdio: workaround for spurious irqs
SDIO controllers found on Marvell Kirkwood SoCs seem to cause a late,
spurious irq although all interrupts have been disabled. This irq
doesn't do any harm, neither to HW nor driver. To avoid some
"unexpected irq" warning later, we workaround above issue by bailing
out of irq handler early, if we didn't expect any.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:05:46 -04:00
Sebastian Hesselbarth fcf902bea3 mmc: mvsdio: silence card detect notice
mvsdio reports method of card detection with dev_notice, while for
removable cards it may be sane, for non-removable cards it is not.
Also, as the user cannot do anything about it, silence the message
by reducing it from dev_notice to dev_dbg.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:05:28 -04:00
Tim Kryger ceae98f20e mmc: core: Try other signal levels during power up
The eMMC signalling voltage is determined by VCCQ which is provided to
the card by the host.  Signalling is not required to begin at 3.3v and,
if the host and card both support a particular VCC/VCCQ combination, it
can be used immediately.

In contrast, SD Cards must begin with 3.3v signalling and may switch to
a lower voltage signalling if instructed to do so in CMD11.  A message
is required to coordinate this operation because the card only receives
a 3.3v VDD and must know when to use the 1.8v produced by its internal
regulator.

It makes sense for the core to begin with 3.3v signalling but when that
can't be set, 1.8v and 1.2v signalling also should be attempted.  This
is especially important when an external regulator with a limited range
is used to supply VCCQ to an eMMC part.

Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:05:22 -04:00
Jonas Jensen 1b66e94e6b mmc: moxart: Add MOXA ART SD/MMC driver
Add SD/MMC driver for MOXA ART SoCs.

The "MOXA ART MMC controller" is likely a faraday "ftsdc010",
a controller with support in U-Boot:

http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/ftsdc010_mci.c

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:05:16 -04:00
Roger Tseng c7f6558d84 mmc: Add realtek USB sdmmc host driver
Realtek USB SD/MMC host driver provides mmc host support based on the
Realtek USB card reader MFD driver.

Signed-off-by: Roger Tseng <rogerable@realtek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:05:09 -04:00
Axel Lin 3beef62479 mmc: sdhci-s3c: Remove unused define for NUM_GPIOS
NUM_GPIOS is not used after e19499ae10 ("mmc: sdhci-s3c: let device
core setup the default pin configuration").  Thus remove it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:04:35 -04:00
Jaehoon Chung ae0eb348e1 mmc: dw_mmc: restore the card-present checking point
Restore the card-present checking point.

(The following part was removed from commit bf626e5 ("mmc: dw_mmc:
use slot-gpio to handle cd pin")

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:04:35 -04:00
Jaehoon Chung 9795a846e1 mmc: dw_mmc: remove dw_mci_of_cd_gpio/wp_gpio()
If mmc_of_parse() is used, dw_mci_of_get_cd_gpio/wp_gpio didn't need.
Already implemented into mmc_of_parse().

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:04:34 -04:00
Jaehoon Chung f16afa883e mmc: dw_mmc: remove unnecessary function.
Remove unnecessary function.  This function didn't re-use anywhere.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:04:34 -04:00
Jaehoon Chung 4a1b27ad34 mmc: dw_mmc: fix minor coding style.
Fixed an indentation block.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:04:33 -04:00
Jaehoon Chung 907abd5101 mmc: dw_mmc: remove unused member variable.
Since using the device-tree, didn't use the callback pointer.
So removed the unused callback pointer.
When the set_power callback is used, it should be added in future.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:04:33 -04:00
Jaehoon Chung 612de4c1b3 mmc: dw_mmc: replace the bus_hz checking point
It's right to check immediately whether host->bus_hz is assigned or not.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:04:32 -04:00
Jaehoon Chung d8a4fb0e60 mmc: dw_mmc: use the mmc_of_parse() instead of local parser
mmc_of_parse() have been already parsed the general capability.
Didn't need to use the local parser.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:04:32 -04:00
Alexander Shiyan 384a81d585 mmc: mxcmmc: Convert to SIMPLE_DEV_PM_OPS
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:04:31 -04:00
Alexander Shiyan 01e4f95853 mmc: mxcmmc: Convert to devm-* API
Replace existing resource handling in the driver with managed
device resource, this ensures more consistent error values and
simplifies error paths.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:04:31 -04:00
Sachin Kamat 15a2e2ab62 mmc: dw_mmc: exynos: Staticize dw_mci_exynos_pmops
'dw_mci_exynos_pmops' is local to this file.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-05-12 18:04:30 -04:00
Micky Ching 5027251ece mmc: rtsx: add R1-no-CRC mmc command type handle
a27fbf2f06 ("mmc: add ignorance case for CMD13 CRC error") produced
a cmd.flags unhandled in realtek pci host driver.  This will make MMC
card fail to initialize, this patch is used to handle the new cmd.flags
condition and MMC card can be used.

Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-22 07:06:40 -04:00
Ulf Hansson 573185cc7e mmc: core: Invoke sdio func driver's PM callbacks from the sdio bus
The sdio func device is added to the driver model after the card
device.

This means the sdio func device will be suspend before the card device
and thus resumed after. The consequence are the mmc core don't
explicity need to protect itself from receiving sdio requests in
suspended state. Instead that can be handled from the sdio bus, which
is thus invokes the PM callbacks instead of old dummy function.

In the case were the sdio func driver don't implement the PM callbacks
the mmc core will in the early phase of system suspend, remove the
card from the driver model and thus power off it.

Cc: Aaron Lu <aaron.lu@intel.com>
Cc: NeilBrown <neilb@suse.de>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Aaron Lu <aaron.lu@intel.com>
Tested-by: xiaoming wang <xiaoming.wang@intel.com>
Tested-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-22 07:06:40 -04:00
Stefan Wahren f7bf11a3a2 mmc: core: Use maximum timeout values in case TACC field is zero
When plugging a specific micro SD card at MMC socket of a custom i.MX28 board,
we get the following kernel warning:

WARNING: CPU: 0 PID: 30 at drivers/mmc/host/mxs-mmc.c:342 mxs_mmc_start_cmd+0x34c/0x378()
Modules linked in:
CPU: 0 PID: 30 Comm: kworker/u2:1 Not tainted 3.14.0-rc5 #8
Workqueue: kmmcd mmc_rescan
[<c0015420>] (unwind_backtrace) from [<c0012cb0>] (show_stack+0x10/0x14)
[<c0012cb0>] (show_stack) from [<c001daf8>] (warn_slowpath_common+0x6c/0x8c)
[<c001daf8>] (warn_slowpath_common) from [<c001db34>] (warn_slowpath_null+0x1c/0x24)
[<c001db34>] (warn_slowpath_null) from [<c0349478>] (mxs_mmc_start_cmd+0x34c/0x378)
[<c0349478>] (mxs_mmc_start_cmd) from [<c0338fa0>] (mmc_start_request+0xc4/0xf4)
[<c0338fa0>] (mmc_start_request) from [<c03390b4>] (mmc_wait_for_req+0x50/0x164)
[<c03390b4>] (mmc_wait_for_req) from [<c03405b8>] (mmc_app_send_scr+0x158/0x1c8)
[<c03405b8>] (mmc_app_send_scr) from [<c033ee1c>] (mmc_sd_setup_card+0x80/0x3c8)
[<c033ee1c>] (mmc_sd_setup_card) from [<c033f788>] (mmc_sd_init_card+0x124/0x66c)
[<c033f788>] (mmc_sd_init_card) from [<c033fd7c>] (mmc_attach_sd+0xac/0x174)
[<c033fd7c>] (mmc_attach_sd) from [<c033a658>] (mmc_rescan+0x25c/0x2d8)
[<c033a658>] (mmc_rescan) from [<c003597c>] (process_one_work+0x1b4/0x4ec)
[<c003597c>] (process_one_work) from [<c0035de4>] (worker_thread+0x130/0x464)
[<c0035de4>] (worker_thread) from [<c003c824>] (kthread+0xb4/0xd0)
[<c003c824>] (kthread) from [<c000f420>] (ret_from_fork+0x14/0x34)

The error is due to an invalid value in CSD register of a specific 2GB
micro SD card. The CSD version of this card is 1.0 but the TACC field
has the invalid value 0.

cid:0000005553442020000000000000583f
csd:00000032535a83bfedb7ffbf1680003f
date:08/2005
erase_size:512
fwrev:0x0
hwrev:0x0
manfid:0x000000
name:USD
oemid:0x0000
preferred_erase_size:4194304
scr:0225000000000000
serial:0x00000000
type:SD

Since the kernel is making use of this TACC field to calculate the SD
card timeout, an invalid value 0 leads to a warning at
mxs_ns_to_ssp_ticks() and later the following misleading error message
appears in a loop:

mxs-mmc 80010000.ssp: card claims to support voltages below defined range
mxs-mmc 80010000.ssp: no support for card's volts
mmc0: error -22 whilst initialising MMC card

This error is only found on this 2GB SD card on mxs platform.
On x86 this card works without any problems.

The following patch based on the work of Peter Chan and Otavio Salvador.
It catches the case that the determined timeout is still 0 and sets it
to a valid value.

Successful tested on a i.MX28 board.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-22 07:06:39 -04:00
Axel Lin d1e58212ca mmc: Convert to use ATTRIBUTE_GROUPS
Use new ATTRIBUTE_GROUPS macro to declare attribute groups.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-22 07:06:38 -04:00
Fabio Estevam 297d40560b mmc: card.h: Use NULL instead of 0 for END_FIXUP
Fix the following sparse warnings:

drivers/mmc/card/block.c:2421:9: warning: Using plain integer as NULL pointer

drivers/mmc/core/quirks.c:69:9: warning: Using plain integer as NULL pointer

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-22 07:06:38 -04:00
Markus Mayer fa372a51cb mmc: Delay the card_event callback into the mmc_rescan worker
This change removes the callback from atomic context which it doesn't
need to be in, and puts it in line with the debounced rescan.

This code is based on these e-mail threads with Christian Daudt:

  https://lkml.org/lkml/2013/8/19/539
  https://lkml.org/lkml/2014/3/19/79

Signed-off-by: Markus Mayer <markus.mayer@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-22 07:06:36 -04:00
Seungwon Jeon bb8175a8aa mmc: sdhci: clarify DDR timing mode between SD-UHS and eMMC
Added MMC_DDR52 as eMMC's DDR mode is distinguished from SD-UHS.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-20 17:00:06 -04:00
Seungwon Jeon cab3a8021b mmc: dw_mmc: clarify DDR timing mode between SD-UHS and eMMC
Replaced UHS_DDR50 with MMC_DDR52. And MMC_CAP_UHS_DDR50
is removed because of non-implementation of UHS signaling.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-20 17:00:01 -04:00
Seungwon Jeon 1a0ae377bf mmc: rtsx: clarify DDR timing mode between SD-UHS and eMMC
Added MMC_DDR52 as eMMC's DDR mode is distinguished from SD-UHS.

CC: Wei WANG <wei_wang@realsil.com.cn>
CC: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-20 16:59:56 -04:00
Seungwon Jeon 4039ff4741 mmc: sh_mmcif: clarify DDR timing mode between SD-UHS and eMMC
Replaced UHS_DDR50 with MMC_DDR52.

CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-20 16:59:52 -04:00
Seungwon Jeon 5438ad95a5 mmc: omap: clarify DDR timing mode between SD-UHS and eMMC
Replaced UHS_DDR50 with MMC_DDR52.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-20 16:59:48 -04:00
Seungwon Jeon 6dad6c9594 mmc: mmci: clarify DDR timing mode between SD-UHS and eMMC
Added MMC_DDR52 as eMMC's DDR mode distinguished from SD-UHS.

CC: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-20 16:59:41 -04:00
Seungwon Jeon 79f7ae7c45 mmc: clarify DDR timing mode between SD-UHS and eMMC
This change distinguishes DDR timing mode of current
mixed usage to clarify device type.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
2014-04-20 16:59:28 -04:00
Linus Torvalds a798c10faf Linux 3.15-rc2 2014-04-20 11:08:50 -07:00
Linus Torvalds 372feacb36 Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine fixes from Vinod Koul:
 "Back from long weekend here in India and now the time to send fixes
  for slave dmaengine.
   - Dan's fix of sirf xlate code
   - Jean's fix for timberland
   - edma fixes by Sekhar for SG handling and Yuan for changing init
     call"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dma: fix eDMA driver as a subsys_initcall
  dmaengine: sirf: off by one in of_dma_sirfsoc_xlate()
  platform: Fix timberdale dependencies
  dma: edma: fix incorrect SG list handling
2014-04-20 10:35:31 -07:00
Linus Torvalds 5269519f9f IOMMU Fixes for Linux v3.15-rc1
Fixes for regressions:
 
 	* Fix wrong IOMMU enumeration causing some SCSI device drivers
 	  initialization failures
 	* ARM-SMMU fixes for a panic condition and a wrong return value.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJTU5YcAAoJECvwRC2XARrjQF0P/3OFeKUG2CQK7WDVj6ogqgwh
 OpvmdzEmOjZc6igZMIKvD7qYhFHR51L4M0FD91jWcEIgEuQZgwYMXPEhxaQRgx7E
 t8bKbkyFRZfCDYDbZJN14Sk+YYStnwi/5n84G938V2HZC/1OMKyqohhDBXUaIcAK
 tzu92P7m3yn11wCV2WQ28OyCtgcE5SPQyUxU8SN8YTrtsUmHXljVvQ17hJ5DgpeX
 XQSyUcoXnub6spr93PQWuzh3nAwPZUlrRKR9p2nxspL4Q4TxbqjFOdeZg3p12+9W
 Et6DKPkf8Xq4cbGJQU8bPYXWEp26NasFcGMDqtlcZBFNOO9stwaCf28YE4r/LUxQ
 StkjaZcUzhDxEjyUqksQjU6kCUh/6/nIl1DtnrpF2y3aZgkBSxx5rj4Vowqpbnf3
 AnR0BbeOUgWtuH98nUCKXJdDCaTWiFUAwzlAWN1Byp922Ol05obfE7QgyPHT2Gsb
 j1GJqBTw1lAM5s1I/vl1+uJm9W/jD+9tCHmOfmTxPswKnFhji7Un9hXoopSEhFEE
 pc29KMofFmYAM6n2a4p4FrGFLkbaYg+SC6vlNiQuLIi/KRid60xVeZGgzEU+0ajB
 O+MhARdd3ulFMPxoOWKR8XQkz1vo3cb4ArJfCG72dfg/AUqDO8vTp3kIsi5dx61e
 8308WSsq+gv2QNFVbrdj
 =vhSn
 -----END PGP SIGNATURE-----

Merge tag 'iommu-fixes-v3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull iommu fixes from Joerg Roedel:
 "Fixes for regressions:

   - fix wrong IOMMU enumeration causing some SCSI device drivers
     initialization failures
   - ARM-SMMU fixes for a panic condition and a wrong return value"

* tag 'iommu-fixes-v3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/arm-smmu: fix panic in arm_smmu_alloc_init_pte
  iommu/arm-smmu: Return 0 on unmap failure
  iommu/vt-d: fix bug in matching PCI devices with DRHD/RMRR descriptors
  iommu/vt-d: Fix get_domain_for_dev() handling of upstream PCIe bridges
  iommu/vt-d: fix memory leakage caused by commit ea8ea46
2014-04-20 10:33:49 -07:00
Linus Torvalds 200bde278d Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf tooling fixes from Ingo Molnar:
 "Three small tooling fixes"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf tools: Improve error reporting
  perf tools: Adjust symbols in VDSO
  perf kvm: Fix 'Min time' counting in report command
2014-04-20 10:32:33 -07:00
Ingo Molnar fd741edc25 perf/urgent fixes:
User visible:
 
 . Adjust symbols in VDSO to properly resolve its function names (Vladimir Nikulichev)
 
 . Improve error reporting for record session failure (Adrien BAK)
 
 . Fix 'Min time' counting in report command (Alexander Yarygin)
 
 Signed-off-by: Jiri Olsa <jolsa@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTUvYSAAoJEPZqUSBWB3s9NK4P/0sNNlm6GFrA/AvwkodtIrTa
 MAVOcmWxP/ayafJkSVmPjDHwi4tlcfdzgilD1jG+M9OerwNvBi5yAcO6BZCRGueO
 9Inej82QzGwZES0Llq68HYIh8nx+85XP2ASJga84JvFKRuSLVlgPkkXzhQTa/Gpp
 FMI+h4GvPkIXnakfiq1u9Icth5zgcJuJMDmgDs1h9F9c2Ry4ecaghx+PSrc7vf10
 TWAYIvNNuykE9twOJWiBh8SuN0ws3rVA3ozJPkTlBtq9WIgNjxsFhBDV28njcaNY
 bokkDIjfgTPkWSPVBE3TbN1WwBBd/B3zreRKIYXGLZLJ0ey1C2aT/0uaW45UjyIr
 r7cCkSvdFIJIBf1nD/zC/KYJ/OW8ciUJo/Iwn3+M6cRx2nxkWoRhZphOuehLjqzF
 5aQBoE5USUVusi26BXGopP+fr+Inr2chEXB3gdq0MKV9HbTIegWze+/y5vEgjUFQ
 HR3RAgNbLXLdYWDk/PHvUHywBX64KE8AU/eGXg7BRJt+gB+ShYC4LP4xBfnWwxa4
 zKWbdOsqPwUsO9vVERxw8bQFsFiGkZhbllqKVMjhxjPL3hCG508ggG7jZRqFRCYW
 BNoHaCIPv4pTzTh5opncaxQtApsVW5LcfM2GwwEIaNyfOBT8qOVnM0AHyzLuab2i
 loqvffbTT+bopK0x+OiL
 =CtdG
 -----END PGP SIGNATURE-----

Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/urgent

Pull perf/urgent fixes from Jiri Olsa:

User visible changes:

  * Adjust symbols in VDSO to properly resolve its function names (Vladimir Nikulichev)

  * Improve error reporting for record session failure (Adrien BAK)

  * Fix 'Min time' counting in report command (Alexander Yarygin)

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2014-04-20 09:53:55 +02:00
Adrien BAK ffa91880a9 perf tools: Improve error reporting
In the current version, when using perf record, if something goes
wrong in tools/perf/builtin-record.c:375
  session = perf_session__new(file, false, NULL);

The error message:
"Not enough memory for reading per file header"

is issued. This error message seems to be outdated and is not very
helpful. This patch proposes to replace this error message by
"Perf session creation failed"

I believe this issue has been brought to lkml:
https://lkml.org/lkml/2014/2/24/458
although this patch only tackles a (small) part of the issue.

Additionnaly, this patch improves error reporting in
tools/perf/util/data.c open_file_write.

Currently, if the call to open fails, the user is unaware of it.
This patch logs the error, before returning the error code to
the caller.

Reported-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Adrien BAK <adrien.bak@metascale.org>
Link: http://lkml.kernel.org/r/1397786443.3093.4.camel@beast
[ Reorganize the changelog into paragraphs ]
[ Added empty line after fd declaration in open_file_write ]
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
2014-04-20 00:15:12 +02:00
Vladimir Nikulichev 922d0e4d9f perf tools: Adjust symbols in VDSO
pert-report doesn't resolve function names in VDSO:

$ perf report --stdio -g flat,0.0,15,callee --sort pid
...
            8.76%
               0x7fff6b1fe861
               __gettimeofday
               ACE_OS::gettimeofday()
...

In this case symbol values should be adjusted the same way as for executables,
relocatable objects and prelinked libraries.

After fix:

$ perf report --stdio -g flat,0.0,15,callee --sort pid
...
            8.76%
               __vdso_gettimeofday
               __gettimeofday
               ACE_OS::gettimeofday()

Signed-off-by: Vladimir Nikulichev <nvs@tbricks.com>
Tested-by: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Link: http://lkml.kernel.org/r/969812.163009436-sendEmail@nvs
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
2014-04-20 00:15:11 +02:00
Alexander Yarygin acb61fc8ed perf kvm: Fix 'Min time' counting in report command
Every event in the perf-kvm has a 'stats' structure, which contains
max/min/average/etc times of handling this event.
The problem is that the 'perf-kvm stat report' command always shows
that 'min time' is 0us for every event. Example:

 # perf kvm stat report

 Analyze events for all VCPUs:

    VM-EXIT    Samples  Samples%     Time%   Min Time   Max Time Avg time
  [..]
  0xB2 MSCH         12     0.07%     0.00%        0us        8us 7.31us ( +-   2.11% )
  0xB2 CHSC         12     0.07%     0.00%        0us       18us 9.39us ( +-   9.49% )
  0xB2 STPX          8     0.05%     0.00%        0us        2us 1.88us ( +-   7.18% )
  0xB2 STSI          7     0.04%     0.00%        0us       44us 16.49us ( +-  38.20% )
  [..]

This happens because the 'stats' structure is not initialized and
stats->min equals to 0. Lets initialize the structure for every
event after its allocation using init_stats() function. This initializes
stats->min to -1 and makes 'Min time' statistics counting work:

 # perf kvm stat report

 Analyze events for all VCPUs:

    VM-EXIT    Samples  Samples%     Time%   Min Time   Max Time Avg time
  [..]
  0xB2 MSCH         12     0.07%     0.00%        6us        8us 7.31us ( +-   2.11% )
  0xB2 CHSC         12     0.07%     0.00%        7us       18us 9.39us ( +-   9.49% )
  0xB2 STPX          8     0.05%     0.00%        1us        2us 1.88us ( +-   7.18% )
  0xB2 STSI          7     0.04%     0.00%        1us       44us 16.49us ( +-  38.20% )
  [..]

Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1397053319-2130-3-git-send-email-borntraeger@de.ibm.com
[ Fixing the perf examples changelog output ]
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
2014-04-20 00:14:08 +02:00
Eric Dumazet 404ca80eb5 coredump: fix va_list corruption
A va_list needs to be copied in case it needs to be used twice.

Thanks to Hugh for debugging this issue, leading to various panics.

Tested:

  lpq84:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern

'produce_core' is simply : main() { *(int *)0 = 1;}

  lpq84:~# ./produce_core
  Segmentation fault (core dumped)
  lpq84:~# dmesg | tail -1
  [  614.352947] Core dump to |/foobar12345 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 (null) pipe failed

Notice the last argument was replaced by a NULL (we were lucky enough to
not crash, but do not try this on your production machine !)

After fix :

  lpq83:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern
  lpq83:~# ./produce_core
  Segmentation fault
  lpq83:~# dmesg | tail -1
  [  740.800441] Core dump to |/foobar12345 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 pipe failed

Fixes: 5fe9d8ca21 ("coredump: cn_vprintf() has no reason to call vsnprintf() twice")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Diagnosed-by: Hugh Dickins <hughd@google.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@vger.kernel.org # 3.11+
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-04-19 13:23:31 -07:00