aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/atmel-mci.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-11-02mmc: Convert timers to use timer_setup()Kees Cook1-7/+6
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Ludovic Desroches <ludovic.desroches@microchip.com> Cc: Ulf Hansson <ulf.hansson@linaro.org> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Carlo Caione <carlo@caione.org> Cc: Kevin Hilman <khilman@baylibre.com> Cc: Nicolas Pitre <nico@fluxnic.net> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alex Dubov <oakad@yahoo.com> Cc: Bruce Chang <brucechang@via.com.tw> Cc: Harald Welte <HaraldWelte@viatech.com> Cc: Tony Olech <tony.olech@elandigitalsystems.com> Cc: Pierre Ossman <pierre@ossman.eu> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Paul Cercueil <paul@crapouillou.net> Cc: Heiner Kallweit <hkallweit1@gmail.com> Cc: Shawn Lin <shawn.lin@rock-chips.com> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Cc: Allen <allen.lkml@gmail.com> Cc: linux-mmc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-omap@vger.kernel.org Cc: linux-usb@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-08-30mmc: Convert to using %pOF instead of full_nameRob Herring1-2/+2
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Ulf Hansson <ulf.hansson@linaro.org> Cc: Ludovic Desroches <ludovic.desroches@microchip.com> Cc: Jan Glauber <jglauber@cavium.com> Cc: David Daney <david.daney@cavium.com> Cc: "Steven J. Hill" <Steven.Hill@cavium.com> Cc: linux-mmc@vger.kernel.org Acked-by: David Daney <david.daney@cavium.com> Tested-by: Steven J. Hill <Steven.Hill@cavium.com> Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-08-30mmc: atmel-mci: add missing of_node_putJulia Lawall1-0/+1
for_each_child_of_node performs an of_node_get on each iteration, so a break out the loop requires an of_node_put. The semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // <smpl> @@ local idexpression n; expression e,e1; iterator name for_each_child_of_node; @@ for_each_child_of_node(e1,n) { ... ( of_node_put(n); | e = n | + of_node_put(n); ? break; ) ... } ... when != n // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-08-30mmc: atmel-mci: remove unused sg_len variableShawn Lin1-3/+2
We got a warning: drivers/mmc/host/atmel-mci.c:1086:15: warning: variable 'sg_len' set but not used [-Wunused-but-set-variable] Ideally we should check to see if sg_len is zero but looking into the code closely, I didn't find any possible to do that as atmci_start_request didn't even deploy any error handling for its host->prepare_data hook. So even we return error value for iflags like what other host drivers did, for instance, sdhci and dwmmc, it still need some extra work to improve the code. Just remove it to silent the warning, although it isn't perfect. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-06-20mmc: atmel-mci: Delete an error message for a failed memory allocationMarkus Elfring1-3/+1
Omit an extra message for a memory allocation failure. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-06-20mmc: atmel-mci: Remove AVR32 bits from the driverAndy Shevchenko1-22/+2
AVR32 is gone. Now it's time to clean up the driver by removing leftovers that was used by AVR32 related code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-04-24mmc: use new core function mmc_get_dma_dirHeiner Kallweit1-19/+11
Use new core function mmc_get_dma_dir(). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: atmel-mci: Remove redundant runtime PM callsUlf Hansson1-9/+0
Commit 9250aea76bfc ("mmc: core: Enable runtime PM management of host devices"), made some calls to the runtime PM API from the driver redundant. Especially those which deals with runtime PM reference counting, so let's remove them. Cc: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
2016-03-17mmc: atmel-mci: Check pdata for NULL before dereferencing it at DMA configBrent Taylor1-1/+1
Using an at91sam9g20ek development board with DTS configuration may trigger a kernel panic because of a NULL pointer dereference exception, while configuring DMA. Let's fix this by adding a check for pdata before dereferencing it. Signed-off-by: Brent Taylor <motobud@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-02-29mmc: atmel-mci: remove the MMC_DATA_STREAM flagJaehoon Chung1-7/+2
Remove the MMC_DATA_STREAM flag because it isn't used anymore. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-01-18Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32Linus Torvalds1-1/+17
Pull AVR32 updates from Hans-Christian Noren Egtvedt. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32: mmc: atmel: get rid of struct mci_dma_data mmc: atmel-mci: restore dma on AVR32 avr32: wire up missing syscalls avr32: wire up accept4 syscall
2016-01-14mmc: atmel: get rid of struct mci_dma_dataMans Rullgard1-1/+0
As struct mci_dma_data is now only used by AVR32, it is nothing but pointless indirection. Replace it with struct dw_dma_slave in the AVR32 platform code and with a void pointer elsewhere. Signed-off-by: Mans Rullgard <mans@mansr.com> Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-01-14mmc: atmel-mci: restore dma on AVR32Mans Rullgard1-0/+17
Commit ecb89f2f5f3e7 ("mmc: atmel-mci: remove compat for non DT board when requesting dma chan") broke dma on AVR32 and any other boards not using DT. This restores a fallback mechanism for such cases. Signed-off-by: Mans Rullgard <mans@mansr.com> Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-12-22mmc: atmel-mci: atmci_convert_chksize depends on controller versionludovic.desroches@atmel.com1-16/+27
The atmci_convert_chksize() function is no more valid for controller version 0x600 due to the introduction of '2 data' chunk size. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-12-22mmc: atmel-mci: move atmel-mci-regs.h content in atmel-mci.cludovic.desroches@atmel.com1-1/+149
atmel-mci-regs.h is only included in atmel-mci.c so move its content in the driver and do some cleanup in these definitions to remove checkpatch errors. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-08-27mmc: atmel-mci: remove useless includeAlexandre Belloni1-1/+0
Definitions from linux/platform_data/atmel.h are not used, remove the include. 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>
2015-05-18mmc: atmel-mci: fix bad variable type for clkdivLudovic Desroches1-2/+7
clkdiv is declared as an u32 but it can be set to a negative value causing a huge divisor value. Change its type to int to avoid this case. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Cc: <stable@vger.kernel.org> # 3.4 and later Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-12-13mmc: atmel-mci: use SET_RUNTIME_PM_OPS() macroLudovic Desroches1-1/+1
The currently used SET_PM_RUNTIME_PM_OPS() macro is defined to the SET_RUNTIME_PM_OPS() macro. Convert to the later, since that's the proper one to use. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-12-02mmc: atmel-mci: use probe deferring if dma controller is not ready yetludovic.desroches@atmel.com1-24/+24
Return probe defer if requesting a dma channel without a dma controller probed. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-12-02mmc: atmel-mci: stop using specific initcallludovic.desroches@atmel.com1-13/+2
No more use late initcall to manage probing order. Use probe deferring if needed. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-12-02mmc: atmel-mci: remove __init/__exit attributesludovic.desroches@atmel.com1-5/+5
Using __init/__exit attributes can cause several breakages so remove them. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-12-02mmc: atmel-mci: remove useless DMA stuff for non-dt devicesludovic.desroches@atmel.com1-8/+0
All devices with a DMA controller are DT compliant and legacy support has been removed. For those reasons, some DMA stuff is useless. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-11-26mmc: atmel-mci: remove compat for non DT board when requesting dma chanludovic.desroches@atmel.com1-19/+1
All boards with a dma controller have DT support so using dma_request_slave_channel_compat is no more needed. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-11-26mmc: atmel-mci: adopt pinctrl supportWenyou Yang1-0/+5
Amend the atmel mci pin controller to optionally take a pin control handle and set the state of the pins to: - "default" on boot, resume and before performing an transfer. - "sleep" on suspend(). This should make it possible to optimize energy usage for the pins both for the suspend/resume cycle. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-11-10mmc: atmel-mci: add runtime pm supportWenyou Yang1-23/+67
Add runtime pm support to atmel mci controller. Use runtime pm APIs to enable/disable atmel mci's clock. Use runtime autosuspend APIs to enable auto suspend delay. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> [Ulf: Fixed compile error]
2014-11-10mmc: host: atmel-mci: Add support for non-removable slotsTimo Kokkonen1-2/+9
Add support for non-removable slots which have no card detection GPIO and which should not be polled for a card change. Signed-off-by: Timo Kokkonen <timo.kokkonen@offcode.fi> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-11-10mmc: atmel-mci: move mach header to platform_dataAlexandre Belloni1-1/+1
Move the mach header that can come either from arm/mach-at91 or avr32 to platform_data to be able to switch the AT91 platforms to multiplatform. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> [Ulf: Fixed compile error]
2014-09-29mmc: atmel-mci: fix mismatched section on atmci_cleanup_slotArnd Bergmann1-1/+1
As of 528bc7808f4e ("mmc: atmel-mci: Release mmc resources on failure in probe"), the atmci_probe() function calls atmci_cleanup_slot in the failure path. This causes a new warning whenever the driver is built: WARNING: drivers/mmc/host/built-in.o(.init.text+0xa04): Section mismatch in reference from the function atmci_probe() to the function .exit.text:atmci_cleanup_slot() The function __init atmci_probe() references a function __exit atmci_cleanup_slot(). Gcc correctly warns about this function getting dropped in the link stage for the built-in case, which would cause undefined behavior when this error path is hit. The solution is to simply drop the __exit annotation. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 528bc7808f4e ("mmc: atmel-mci: Release mmc resources on failure in probe") Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-09-24mmc: atmel-mci: Release mmc resources on failure in probePramod Gurav1-2/+9
This change takes care of releasing mmc resources on error cases in probe function which was missing. Also release timer in remove function. Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-09-24mmc: atmel-mci: Switch to using managed resource in probePramod Gurav1-27/+14
This change uses managed resource APIs to allocate resources such as, clk, gpio, io in order to simplify the driver unload or failure cases. Hence does away with release statements of the same resources in error labels and remove function. Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-09-09mmc: atmel-mci: add 0x600 IP versionNicolas Ferre1-0/+1
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-06-12mmc: atmel-mci: incude asm/cacheclush.hArnd Bergmann1-0/+1
This avoids a build error due to the use of flush_dcache_page. drivers/mmc/host/atmel-mci.c: In function 'atmci_read_data_pio': drivers/mmc/host/atmel-mci.c:1870:5: error: implicit declaration of function 'flush_dcache_page' [-Werror=implicit-function-declaration] flush_dcache_page(sg_page(sg)); ^ Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-05-12mmc: atmel: don't test host->dataAlexandre Belloni1-10/+3
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-01-13mmc: atmel-mci: add vmmc-supply supportAlexandre Belloni1-0/+7
Other MMC hosts handle a regulator named vmmc-supply that allows to power the MMC card or SDIO device before communicating on the bus. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Chris Ball <chris@printf.net>
2014-01-13mmc: atmel-mci: fix timeout errors in SDIO mode when using DMALudovic Desroches1-1/+12
With some SDIO devices, timeout errors can happen when reading data. To solve this issue, the DMA transfer has to be activated before sending the command to the device. This order is incorrect in PDC mode. So we have to take care if we are using DMA or PDC to know when to send the MMC command. Cc: stable <stable@vger.kernel.org> # 3.2+ Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-10-30mmc: atmel-mci: Remove redundant suspend and resume callbacksUlf Hansson1-61/+0
Suspend and resume of cards are handled by the protocol layer and consequently the mmc_suspend|resume_host APIs are marked as deprecated. While moving away from using the deprecated APIs, there are nothing left to be done for the suspend and resume callbacks, so remove them. Cc: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-09-25mmc: atmel-mci: fix oops in atmci_tasklet_funcRodolfo Giometti1-6/+8
In some cases, a NULL pointer dereference happens because data is NULL when STATE_END_REQUEST case is reached in atmci_tasklet_func. Cc: <stable@vger.kernel.org> # 3.9+ Signed-off-by: Rodolfo Giometti <giometti@enneenne.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-09-25mmc: atmel-mci: abort transfer on timeout errorLudovic Desroches1-0/+7
When a software timeout occurs, the transfer is not stopped. In DMA case, it causes DMA channel to be stuck because the transfer is still active causing following transfers to be queued but not computed. Cc: <stable@vger.kernel.org> # 3.9+ Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Reported-by: Alexander Morozov <etesial@gmail.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-08-24mmc: atmel-mci: prepare clk before calling enableBoris BREZILLON1-7/+27
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to avoid common clk framework warnings. Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27mmc: atmel-mci: remove include <mach/cpu.h>Nicolas Ferre1-2/+0
Header file not needed anymore as we have removed the calls to cpu_is_xxx() macro. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: remove unnecessary platform_set_drvdata()Jingoo Han1-2/+0
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Acked-by: Seungwon Jeon <tgih.jun@samsung.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Tony Prisk <linux@prisktech.co.nz> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: atmel-mci: add CONFIG_PM_SLEEP to suspend/resume functionsJingoo Han1-6/+4
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/mmc/host/atmel-mci.c:2509:12: warning: 'atmci_suspend' defined but not used [-Wunused-function] drivers/mmc/host/atmel-mci.c:2539:12: warning: 'atmci_resume' defined but not used [-Wunused-function] Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26mmc: atmel-mci: convert to dma_request_slave_channel_compat()Ludovic Desroches1-13/+12
Use generic DMA DT helper. Platforms booting with or without DT populated are both supported. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-08mmc: atmel-mci: pio hang on block errorsTerry Barnaby1-4/+10
The driver is doing, by default, multi-block reads. When a block error occurs, card/block.c instigates a single block read: "mmcblk0: retrying using single block read". It leaves the sg chain intact and just changes the length attribute for the first sg entry and the overall sg_len parameter. When atmci_read_data_pio is called to read the single block of data it ignores the sg_len and expects to read more than 512 bytes as it sees there are multiple items in the sg list. No more data comes as the controller has only been commanded to get one block. Signed-off-by: Terry Barnaby <terry@beam.ltd.uk> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Cc: stable <stable@vger.kernel.org> # 3.2+ Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22mmc: at91/avr32/atmel-mci: fix DMA-channel leak on module unloadJohan Hovold1-2/+0
Fix regression introduced by commit 796211b7953 ("mmc: atmel-mci: add pdc support and runtime capabilities detection") which removed the need for CONFIG_MMC_ATMELMCI_DMA but kept the Kconfig-entry as well as the compile guards around dma_release_channel() in remove(). Consequently, DMA is always enabled (if supported), but the DMA-channel is not released on module unload unless the DMA-config option is selected. Remove the no longer used CONFIG_MMC_ATMELMCI_DMA option completely. Signed-off-by: Johan Hovold <jhovold@gmail.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2012-12-12Merge tag 'headers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds1-1/+1
Pull ARM SoC Header cleanups from Olof Johansson: "This is a collection of header file cleanups, mostly for OMAP and AT91, that keeps moving the platforms in the direction of multiplatform by removing the need for mach-dependent header files used in drivers and other places." Fix up mostly trivial conflicts as per Olof. * tag 'headers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (106 commits) ARM: OMAP2+: Move iommu/iovmm headers to platform_data ARM: OMAP2+: Make some definitions local ARM: OMAP2+: Move iommu2 to drivers/iommu/omap-iommu2.c ARM: OMAP2+: Move plat/iovmm.h to include/linux/omap-iommu.h ARM: OMAP2+: Move iopgtable header to drivers/iommu/ ARM: OMAP: Merge iommu2.h into iommu.h atmel: move ATMEL_MAX_UART to platform_data/atmel.h ARM: OMAP: Remove omap_init_consistent_dma_size() arm: at91: move at91rm9200 rtc header in drivers/rtc arm: at91: move reset controller header to arm/arm/mach-at91 arm: at91: move pit define to the driver arm: at91: move at91_shdwc.h to arch/arm/mach-at91 arm: at91: move board header to arch/arm/mach-at91 arn: at91: move at91_tc.h to arch/arm/mach-at91 arm: at91 move at91_aic.h to arch/arm/mach-at91 arm: at91 move board.h to arch/arm/mach-at91 arm: at91: move platfarm_data to include/linux/platform_data/atmel.h arm: at91: drop machine defconfig ARM: OMAP: Remove NEED_MACH_GPIO_H ARM: OMAP: Remove unnecessary mach and plat includes ...
2012-11-28mmc: remove use of __devinitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Chris Ball <cjb@laptop.org> Cc: Manuel Lauss <manuel.lauss@gmail.com> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com> Cc: Venkatraman S <svenkatr@ti.com> Cc: Ian Molton <ian@mnementh.co.uk> Cc: Bruce Chang <brucechang@via.com.tw> Cc: Harald Welte <HaraldWelte@viatech.com> Cc: Pierre Ossman <pierre@ossman.eu> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-06arm: at91: move platfarm_data to include/linux/platform_data/atmel.hJean-Christophe PLAGNIOL-VILLARD1-1/+1
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
2012-10-10Merge tag 'mmc-merge-for-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmcLinus Torvalds1-16/+97
Pull MMC updates from Chris Ball: "Core: - Add DT properties for card detection (broken-cd, cd-gpios, non-removable) - Don't poll non-removable devices - Fixup/rework eMMC sleep mode/"power off notify" feature - Support eMMC background operations (BKOPS). To set the one-time programmable fuse that enables bkops on an eMMC that doesn't already have it set, you can use the "mmc bkops enable" command in: git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git Drivers: - atmel-mci, dw_mmc, pxa-mci, dove, s3c, spear: Add device tree support - bfin_sdh: Add support for the controller in bf60x - dw_mmc: Support Samsung Exynos SoCs - eSDHC: Add ADMA support - sdhci: Support testing a cd-gpio (from slot-gpio) instead of presence bit - sdhci-pltfm: Support broken-cd DT property - tegra: Convert to only supporting DT (mach-tegra has gone DT-only)" * tag 'mmc-merge-for-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (67 commits) mmc: core: Fixup broken suspend and eMMC4.5 power off notify mmc: sdhci-spear: Add clk_{un}prepare() support mmc: sdhci-spear: add device tree bindings mmc: sdhci-s3c: Add clk_(enable/disable) in runtime suspend/resume mmc: core: Replace MMC_CAP2_BROKEN_VOLTAGE with test for fixed regulator mmc: sdhci-pxav3: Use sdhci_get_of_property for parsing DT quirks mmc: dt: Support "broken-cd" property in sdhci-pltfm mmc: sdhci-s3c: fix the wrong number of max bus clocks mmc: sh-mmcif: avoid oops on spurious interrupts mmc: sh-mmcif: properly handle MMC_WRITE_MULTIPLE_BLOCK completion IRQ mmc: sdhci-s3c: Fix crash on module insertion for second time mmc: sdhci-s3c: Enable only required bus clock mmc: Revert "mmc: dw_mmc: Add check for IDMAC configuration" mmc: mxcmmc: fix bug that may block a data transfer forever mmc: omap_hsmmc: Pass on the suspend failure to the PM core mmc: atmel-mci: AP700x PDC is not connected to MCI mmc: atmel-mci: DMA can be used with other controllers mmc: mmci: use clk_prepare_enable and clk_disable_unprepare mmc: sdhci-s3c: Add device tree support mmc: dw_mmc: add support for exynos specific implementation of dw-mshc ...
2012-10-03mmc: atmel-mci: AP700x PDC is not connected to MCIHein_Tibosch1-1/+1
Earlier, atmel-mci was adapted to make use of the peripheral DMA controller (PDC), in case normal DMA wouldn't work. ( http://comments.gmane.org/gmane.linux.kernel.mmc/9403 ) This works OK on ARM platforms (AT91), but it broke the driver for AVR32, the AP700x. Although the MCI has PDC support, the connection is not done for AVR chips. This patch makes the use of PDC depend on !CONFIG_AVR32. Signed-off-by: Hein Tibosch <hein_tibosch@yahoo.es> Signed-off-by: Chris Ball <cjb@laptop.org>