aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc
AgeCommit message (Collapse)Author
2007-05-01mmc: deprecate mmc bus topologyPierre Ossman
The classic MMC bus was defined as multi card bus system, which is reflected in the design in the MMC layer. When SD showed up, the bus topology was abandoned and a star topology (one card per host) was mandated. MMC version 4 has followed this, officially deprecating the bus topology. As we do not have any known users of the bus topology we can remove support for it. This will simplify the code and rectify some incorrect assumptions in the newer additions. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: remove card upon suspendPierre Ossman
Suspending MMC/SD cards (versus removing and readding them) is an inherently unsafe operation and has even been broken for some time. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: allow suspended block driver to be removedPierre Ossman
Make sure we don't deadlock when removing a suspended block queue, something that might happen if the card is removed during suspend. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: Flush pending detects on host removalPierre Ossman
Make sure we kill of any pending detection runs when the host is removed instead of when it is freed. Also add some debugging to make sure the driver doesn't queue up more detection after it has removed the host. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: Move host and card drivers to subdirsPierre Ossman
Clean up the drivers/mmc directory by moving card and host drivers into subdirectories. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: Move queue functions to mmc_blockPierre Ossman
The mmc block queue functions are tailored for the mmc_block driver, so move those functions into that module. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: Move "present" markingPierre Ossman
The "present" state indicates that the card is a registered device, so it is more clear to put it together with the actual registration. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: Move OCR bit definesPierre Ossman
All host drivers were #include:ing mmc/protocol.h just to get access to the OCR bit defines. Move these to host.h instead. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: add type field to cardsPierre Ossman
Split out the type of card into its own field as it hardly qualifies as a state. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: MMC sector based cardsPierre Ossman
Support for MMC 4.2 sector based cards. This tweaks the init a bit and reads a new field out of the EXT_CSD. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: use right timing mode constantPierre Ossman
Fix copy-n-paste error. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm: layout fixes, small changes to comments and printfsAlex Dubov
Cosmetic changes to the code. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: implement software scatter-gatherAlex Dubov
It was found that delays associated with issue and completion of the commands severely limit performance of the new, fast SD cards. To alleviate this issue scatter-gather emulation in software is implemented for both dma and pio transfer modes. Non-block aligned and high memory sg entries are accounted for. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: fix resume handlerAlex Dubov
Resume should not explicitly check for media type. Instead, it may relay on success of socket initialization. Small changes are introduced to tifm_sd_initialize to make it more robust. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: replace command completion state machine with full checkingAlex Dubov
State machine used to to track mmc command state was found to be fragile and unreliable, making many cards unusable. The safer solution is to perform all needed checks at every card event. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: merge dma and pio request processing pathsAlex Dubov
To allow for switching of trasfer mode (dma/pio) on a per-request basis, pio and dma request issue and completion function are now merged. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: separate command flags, socket flags and register bit masksAlex Dubov
host->flags variable was hosting a collection of bits with different semantics. For clarity, hardware bit masks are now defined as macros, socket flags represented as bit fields and flags (now cmd_flags) only hosts command processing modifiers. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: remove wait for power off on removeAlex Dubov
This wait was needed because of the mmc layer failure to wait for completion of all outstanding commands before host removal. It should be fixed now in the mmc layer. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm_sd: remove tifm_sd_terminate functionAlex Dubov
tifm_sd_terminate can only lawfully be called on device removal so it can be merged with tifm_sd_remove. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm: simplify bus match and uevent handlersAlex Dubov
Remove code duplicating the kernel functionality and clean up data structures involved in driver matching. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01tifm: hide details of interrupt processing from socket driversAlex Dubov
Instead of passing transformed value of adapter interrupt status to socket drivers, implement two separate callbacks - one for card events and another for dma events. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01wbsd: remove block crc testPierre Ossman
Block completion interrupts occur faster than we can process them, so just ignore them competely. Commit also fixes up some incorrect register defines. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: enforce correct sg listPierre Ossman
Now that we've fixed our only offender when it comes to strange sg list, add a check so that future users keep the sg list proper with regard to transfer size. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-01mmc: cull sg list to match mmc request sizeAlex Dubov
mmc layer may introduce additional (compared to block layer) limits on request size. Culling of the sg list to match adjusted request size simplifies the handling of such cases in the low level driver, allowing it to skip block count checks while processing sg entries. (fixes for wbsd and sdhci by Pierre Ossman) Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-04-27uevent: use add_uevent_var() instead of open coding itEric Rannaud
Make use of add_uevent_var() instead of (often incorrectly) open coding it. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Eric Rannaud <eric.rannaud@gmail.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-03-12[ARM] 4256/1: i.MX/MX1 SDHC fix/workaround of SD card recognition problemsPavel Pisa
The SDHC controllers cannot process shorter transfers. They has to be handled as longer ones, but it such case CRC error is evaluated. There was a case in the code still, where this error is not ignored as it should to be process these transfers. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-03-06sdhci: release irq during suspendPierre Ossman
Release the device's irq during sleep, as all well-behaved drivers should. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-03-06sdhci: make isr tolerant of read errorsMark Lord
The interrupt is shared with another device, which resumes earlier than the sdhci controller, and generates an interrupt. The sdhci interrupt handler runs, sees 0xffffffff in its own device's interrupt status, and tries to handle it.. The reason for the 0xffffffff is that the device is still suspended, and *all* regs are reading back 0xffffffff. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-03-06mmc: require explicit support for high-speedPierre Ossman
The new high-speed timings are similar to each other and the old system, but not identical. And although things "just work" most of the time, sometimes it does not. So we need to start marking which hosts are known to fully comply with the new timings. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-19Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (117 commits) [ARM] 4058/2: iop32x: set ->broken_parity_status on n2100 onboard r8169 ports [ARM] 4140/1: AACI stability add ac97 timeout and retries [ARM] 4139/1: AACI record support [ARM] 4138/1: AACI: multiple channel support for IRQ handling [ARM] 4211/1: Provide a defconfig for ns9xxx [ARM] 4210/1: base for new machine type "NetSilicon NS9360" [ARM] 4222/1: S3C2443: Remove reference to missing S3C2443_PM [ARM] 4221/1: S3C2443: DMA support [ARM] 4220/1: S3C24XX: DMA system initialised from sysdev [ARM] 4219/1: S3C2443: DMA source definitions [ARM] 4218/1: S3C2412: fix CONFIG_CPU_S3C2412_ONLY wrt to S3C2443 [ARM] 4217/1: S3C24XX: remove the dma channel show at startup [ARM] 4090/2: avoid clash between PXA and SA1111 defines [ARM] 4216/1: add .gitignore entries for ARM specific files [ARM] 4214/2: S3C2410: Add Armzone QT2410 [ARM] 4215/1: s3c2410 usb device: per-platform vbus_draw [ARM] 4213/1: S3C2410 - Update definition of ADCTSC_XY_PST [ARM] 4098/1: ARM: rtc_lock only used with rtc_cmos [ARM] 4137/1: Add kexec support [ARM] 4201/1: SMP barriers pair needed for the secondary boot process ... Fix up conflict due to typedef removal in sound/arm/aaci.h
2007-02-14[PATCH] remove many unneeded #includes of sched.hTim Schmielau
After Al Viro (finally) succeeded in removing the sched.h #include in module.h recently, it makes sense again to remove other superfluous sched.h includes. There are quite a lot of files which include it but don't actually need anything defined in there. Presumably these includes were once needed for macros that used to live in sched.h, but moved to other header files in the course of cleaning it up. To ease the pain, this time I did not fiddle with any header files and only removed #includes from .c-files, which tend to cause less trouble. Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha, arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig, allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all configs in arch/arm/configs on arm. I also checked that no new warnings were introduced by the patch (actually, some warnings are removed that were emitted by unnecessarily included header files). Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-11Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc: tifm_sd: treat "status error" as normal command completion mmc: wbsd: Remove stray kunmap_atomic() mmc: sdhci: Stop asking for mail mmc: sdhci: Remove driver version mmc: wbsd: Remove driver version
2007-02-11tifm_sd: treat "status error" as normal command completionAlex Dubov
TI FlasMedia controller attempts to validate command responses and issues a "status error" if response does not matches its perceived (by controller) value. As mmc layer does its own validation we can safely ignore the controller's opinion. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-11mmc: wbsd: Remove stray kunmap_atomic()Pierre Ossman
There was one kunmap_atomic() left over from 4a0ddbd25ad4e03a0a1657f5cb2259c9a35fe9e6 that was causing crashes. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-09[PATCH] TIFM should depend on PCI - TIFM_CORE leads to use of pci primitivesAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-09mmc: sdhci: Stop asking for mailPierre Ossman
We get enough error reports without having to ask for it. Remove notices about mailing the development list. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-09mmc: sdhci: Remove driver versionPierre Ossman
The driver version was only really meaningful when it was an out-of-tree driver. Now we can use the version of the kernel. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-09mmc: wbsd: Remove driver versionPierre Ossman
The driver version was only really meaningful when it was an out-of-tree driver. Now we can use the version of the kernel. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-08[ARM] 4151/1: AT91 / AVR32: Move at91_pdc.h to linux/atmel_pdc.hAndrew Victor
The Atmel AT91 and AVR32 processor architectures share many of the same peripherals. The PDC (Peripheral Data Controller) registers are also implemented within in a number of the on-chip peripherals (eg, USART, MMC, SPI, SSC, etc). In a attempt not to duplicate the register definitions in each peripheral, or in each architecture, the at91_pdc.h header in asm-arm/arch-at91 and asm-avr32/arch-at32ap has been replaced with linux/atmel_pdc.h. The definitions have also been renamed from AT91_PDC_* to ATMEL_PDC_*, and the drivers updated accordingly. Original patch from Nicolas Ferre. Signed-off-by: Andrew Victor <andrew@sanpeople.com> Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-02-04mmc: tifm: replace kmap with page_addressPierre Ossman
Since we actively avoid highmem, calling kmap_atomic() instead of page_address() is effectively only obfuscation. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: sdhci: fix voltage ocrPierre Ossman
Some bad if-clauses caused the driver to just report the highest supported voltage, not all. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: sdhci: replace kmap with page_addressPierre Ossman
Since we actively avoid highmem, calling kmap_atomic() instead of page_address() is effectively only obfuscation. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: wbsd: replace kmap with page_addressPierre Ossman
Since we actively avoid highmem, calling kmap_atomic() instead of page_address() is effectively only obfuscation. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: handle pci_enable_device() return value in sdhciPierre Ossman
Make sure we report back any errors from pci_enable_device(). Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: Proper unclaim in mmc_blockPierre Ossman
Make sure we release the claim on the host even on failure. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: Graceful fallback for fancy featuresPierre Ossman
MMC high-speed, wide bus support and SD high-speed are functions that aren't critical for correct operation of the card. As such, they shouldn't mark the card as bad or dead when there is a failure activating these features. This is needed in particular on some really stupid hardware (e.g. Winbond's) where not all data transfer commands are supported. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: Handle wbsd's stupid command listPierre Ossman
The wbsd hardware is so incredibly brain damaged that it has an internal list of commands that result in data transfers. The result being that commands that aren't on this list aren't supported. Instead of locking up, waiting for a data interrupt that will never come, we try to fail a bit more gracefully. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: Allow host drivers to specify max block countPierre Ossman
Many controllers have an upper limit on the number of blocks that can be transferred in one request. Allow the host drivers to specify this and make sure we avoid hitting this limit. Also change the max_sectors field to avoid confusion. This makes it map less directly to the block layer limits, but as they didn't apply directly on MMC cards anyway, this isn't a great loss. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04mmc: Allow host drivers to specify a max block sizePierre Ossman
Most controllers have an upper limit on the block size. Allow the host drivers to specify this and make sure we avoid hitting this limit. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04tifm_sd: add suspend and resume functionalityAlex Dubov
Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>