aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card (follow)
AgeCommit message (Collapse)AuthorFilesLines
2008-10-12mmc_block: filter out PC requestsPierre Ossman1-1/+1
We do not support PC (SCSI) commands, so don't pretend we do by letting them through. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-10-12mmc_block: indicate strict orderingPierre Ossman1-0/+1
The MMC block driver services requests one at a time and in strict order. Indicate this to the block layer so that it can handle barriers in an efficient manner. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-10-12mmc_block: inform block layer about sector count restrictionPierre Ossman2-28/+15
Make sure we consider the maximum block count when we tell the block layer about the maximum sector count. That way we don't have to chop up the request ourselves. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-10-10Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds1-3/+7
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (37 commits) [SCSI] zfcp: fix double dbf id usage [SCSI] zfcp: wait on SCSI work to be finished before proceeding with init dev [SCSI] zfcp: fix erp list usage without using locks [SCSI] zfcp: prevent fc_remote_port_delete calls for unregistered rport [SCSI] zfcp: fix deadlock caused by shared work queue tasks [SCSI] zfcp: put threshold data in hba trace [SCSI] zfcp: Simplify zfcp data structures [SCSI] zfcp: Simplify get_adapter_by_busid [SCSI] zfcp: remove all typedefs and replace them with standards [SCSI] zfcp: attach and release SAN nameserver port on demand [SCSI] zfcp: remove unused references, declarations and flags [SCSI] zfcp: Update message with input from review [SCSI] zfcp: add queue_full sysfs attribute [SCSI] scsi_dh: suppress comparison warning [SCSI] scsi_dh: add Dell product information into rdac device handler [SCSI] qla2xxx: remove the unused SCSI_QLOGIC_FC_FIRMWARE option [SCSI] qla2xxx: fix printk format warnings [SCSI] qla2xxx: Update version number to 8.02.01-k8. [SCSI] qla2xxx: Ignore payload reserved-bits during RSCN processing. [SCSI] qla2xxx: Additional residual-count corrections during UNDERRUN handling. ...
2008-10-09block: don't depend on consecutive minor spaceTejun Heo1-1/+1
* Implement disk_devt() and part_devt() and use them to directly access devt instead of computing it from ->major and ->first_minor. Note that all references to ->major and ->first_minor outside of block layer is used to determine devt of the disk (the part0) and as ->major and ->first_minor will continue to represent devt for the disk, converting these users aren't strictly necessary. However, convert them for consistency. * Implement disk_max_parts() to avoid directly deferencing genhd->minors. * Update bdget_disk() such that it doesn't assume consecutive minor space. * Move devt computation from register_disk() to add_disk() and make it the only one (all other usages use the initially determined value). These changes clean up the code and will help disk->part dereference fix and extended block device numbers. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2008-10-03[SCSI] mmc_block: use generic helper to print capacitiesPierre Ossman1-3/+7
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-09-21Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmcLinus Torvalds2-5/+8
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc: mmc_test: initialize mmc_test_lock statically mmc_block: handle error from mmc_register_driver() atmel-mci: Set MMC_CAP_NEEDS_POLL if no detect_pin atmel-mci: Fix bogus debugfs file size atmel-mci: Fix memory leak in atmci_regs_show atmel-mci: debugfs: enable clock before dumping regs tmio_mmc: fix compilation with debug enabled
2008-09-20mmc_test: initialize mmc_test_lock staticallyAkinobu Mita1-3/+1
The mutex mmc_test_lock is initialized at every time mmc_test device is probed. Probing another mmc_test device may break the mutex, if the probe function is called while the mutex is locked. This patch fixes it by statically initializing mmc_test_lock. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-09-20mmc_block: handle error from mmc_register_driver()Akinobu Mita1-2/+7
Check error from mmc_register_driver() and properly unwind block device registration. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-09-05drivers/mmc/card/block.c: fix refcount leak in mmc_block_open()Andrew Morton1-1/+3
mmc_block_open() increments md->usage although it returns with -EROFS when default mounting a MMC/SD card with write protect switch on. This reference counting bug prevents /dev/mmcblkX from being released on card removal, and situation worsen with reinsertion until the minor number range runs out. Reported-by: <sasin@solomon-systech.com> Acked-by: Pierre Ossman <drzeus-list@drzeus.cx> Cc: <stable@kernel.org> [2.6.25.x, 2.6.26.x] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-01mmc_block: use proper sg iteratorsPierre Ossman1-6/+11
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-08-01mmc_test: Revert "mmc_test: test oversized sg lists"Pierre Ossman1-82/+3
This reverts commit 48b5352ea1891455eb8e824cf7d92f66931a090f. Oversized sg lists are not allowed anymore, and the core even checks for them in debug mode, so this test is entirely incorrect. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-07-23mmc_test: print message when attaching to cardPierre Ossman1-0/+2
Make it a bit more obvious that the card has been claimed by the mmc_test driver so that people don't have to wonder why their block device never shows up. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-07-23mmc_block: bounce buffer highmem supportPierre Ossman1-66/+31
Support highmem pages in the bounce buffer code by using the sg_copy_from/to_buffer() functions. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-07-23mmc_test: test oversized sg listsPierre Ossman1-3/+82
Add tests that make sure the driver properly checks the blocks and blksz fields and doesn't assume the sg list has a size that perfectly matches the current request. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-07-23mmc_test: highmem testsPierre Ossman1-1/+137
Add a couple of tests to make sure the host driver handles highmem memory pages properly. Unfortunately there is no way to guarantee an allocation below 4 GB in i386, so it might give you addresses that are out of reach for the hardware (OTOH, so will any other highmem allocation in the kernel). Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-07-15sdio_uart: Fix SDIO break control to now return success or an errorDavid Howells1-3/+6
This is a consequence of patch 9ea761bfef52c116fed4715d4043392c2503fe6a. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-07-15mmc: remove multiwrite capabilityPierre Ossman1-28/+19
Relax requirements on host controllers and only require that they do not report a transfer count than is larger than the actual one (i.e. a lower value is okay). This is how many other parts of the kernel behaves so upper layers should already be prepared to handle that scenario. This gives us a performance boost on MMC cards. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-07-15mmc_test: cleanupPierre Ossman1-190/+364
Clean up and reorganise the mmc_test driver so that it (hopefully) is easier to extend with more complex tests. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-07-15mmc_block: wait for card even on failuresPierre Ossman1-4/+9
Many failures are non-permanent, but the card might need some time to finish what it is doing before becoming responsive again. Make sure we wait for it to finish programming before dealing with the error. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-07-15mmc_test: only bind to supported cardsPierre Ossman1-1/+4
We can only perform the tests on MMC and SD cards, so avoid binding to any other type. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-07-15mmc_test: add test case controlPierre Ossman1-2/+8
Add the ability to run just a single test case by writing the test case number into the sysfs "test" file. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-06-05mmc: Fix crash in mmc_block on 64-bitBen Collins1-1/+1
Fairly simple. "dev_use" was being allocated as a zero length array because of bad math on 64-bit systems, causing a crash in find_first_zero_bit(). One-liner follows: Signed-off-by: Ben Collins <ben.collins@canonical.com> Acked-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-05-14mmc: mmc host test driverPierre Ossman3-0/+905
A dummy driver that performs a series of requests that are often mis- handled by host drivers. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2008-01-28blk_end_request: changing mmc (take 4)Kiyoshi Ueda2-21/+7
This patch converts mmc to use blk_end_request interfaces. Related 'uptodate' arguments are converted to 'error'. Cc: Pierre Ossman <drzeus-mmc@drzeus.cx> Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-11-29sdio_uart: fix sign of paramter status in sdio_uart_receive_chars()Andre Haupt1-1/+1
This also fixes a sparse warning about different signedness. Only compile tested, because i do not have the hardware. Signed-off-by: Andre Haupt <andre@bitwigglers.org> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-11-27mmc: Add missing sg_init_table() callHaavard Skinnemoen1-1/+2
mmc_init_queue only initializes the scatterlists with sg_init_table() when using a bounce buffer. This leads to a BUG() when CONFIG_DEBUG_SG is set. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-11-21mmc: Avoid re-using minor numbers before the original device is closed.David Woodhouse1-8/+6
Move the code which marks the minor number as free to mmc_blk_put() so that it happens on the final close() (or removal), instead of doing it at removal even when the device is still logically open. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-11-21mmc_block: check card state after writePierre Ossman1-1/+7
Some cards have been reported to signal that they're ready prematurely. Checking both the busy bit and card state solves the issue. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-11-08mmc: Fix sg helper copy-and-paste errorRoland Dreier1-1/+1
Commit 45711f1a ("[SG] Update drivers to use sg helpers") had the following bogus change in drivers/mmc/card/queue.c: > - src_buf = page_address(src->page) + src->offset; > + src_buf = sg_virt(dst); (Notice that "src" is converted to "dst"). Turn this "dst" back into the intended "src". Signed-off-by: Roland Dreier <roland@digitalvampire.org> Tested-by: Romano Giannetti <romano.giannetti@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-22[SG] Update drivers to use sg helpersJens Axboe1-7/+8
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-16mmc: need to zero sglist on initJens Axboe1-3/+3
Otherwise we could have junk in the sg fields, fooling the sg chaining into thinking ->page is valid. Acked-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-09-23MMC/SD card driver learns SPIDavid Brownell1-8/+15
Teaching the MMC/SD block card driver about SPI. - Provide the SPI response type flags with each request issued. - Understand that multiblock SPI writes don't use STOP_TRANSMISSION. - Correct check for APP_CMD failure. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: fix recursion issues between sdio-uart driver and tty layerNicolas Pitre1-2/+19
In a few places, sdio_uart_irq() is called directly instead of waiting for the actual interrupt to be raised and the SDIO IRQ thread scheduled in order to reduce latency. However, some interaction with the tty core may end up calling us back (serial echo, flow control, etc.) creating two issues: - the host lock gets claimed twice from the same thread causing a deadlock; - the same direct calls to sdio_uart_irq() may be performed causing unexpected reentrancy into the IRQ handler. This patch handles both of those issues. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: add default c_ispeed/c_ospeed values to sdio_uart driverNicolas Pitre1-0/+2
Note that the default baudrate is 4800 instead of 9600 as a convenience because that's what GPS devices want which is still the main use for this driver. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: add /proc interface to sdio_uart driverNicolas Pitre1-0/+62
This mimics what the serial_core does. Useful for diagnostics. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23sdio: UART/GPS driverNicolas Pitre3-0/+1086
This currently only accepts the GPS class since that's all I have for testing. Tested with a Matsushita GPS and gpsd version 2.34. Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23mmc: remove confusing flagPierre Ossman1-1/+0
The MMC_DATA_MULTI flag never had a proper definition of what it means, so remove it and let the drivers check the block count in the request. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23mmc: mmc_set_data_timeout() parameter write is redundantPierre Ossman1-2/+2
The write parameter in mmc_set_data_timeout() is redundant as the data structure contains information about the direction of the transfer. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-09-23mmc: remove custom error codesPierre Ossman1-2/+2
Convert the MMC layer to use standard error codes and not its own, incompatible values. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-08-09mmc: reorganize bounce buffer initPierre Ossman1-7/+7
Reorganize the code that initializes mmc_block's bounce buffer in order to avoid warnings when MMC_BLOCK_BOUNCE isn't used. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-07-26Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmcLinus Torvalds1-1/+1
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc: drivers/mmc/core/: make 3 functions static mmc: add missing printk levels mmc: remove redundant debug information from sdhci and wbsd mmc: proper debugging output in core mmc: be more verbose about card insertions/removal mmc: Don't hold lock when releasing an added card mmc: add a might_sleep() to mmc_claim_host() mmc: update kerneldoc mmc: update header file paths sdhci: add support to ENE-CB714 mmc: check error bits before command completion
2007-07-26mmc: update header file pathsPierre Ossman1-1/+1
Make sure all headers in the files reflect their true position in the tree. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-07-24[BLOCK] Get rid of request_queue_t typedefJens Axboe1-4/+4
Some of the code has been gradually transitioned to using the proper struct request_queue, but there's lots left. So do a full sweet of the kernel and get rid of this typedef and replace its uses with the proper type. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-07-19some kmalloc/memset ->kzalloc (tree wide)Yoann Padioleau1-2/+1
Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc). Here is a short excerpt of the semantic patch performing this transformation: @@ type T2; expression x; identifier f,fld; expression E; expression E1,E2; expression e1,e2,e3,y; statement S; @@ x = - kmalloc + kzalloc (E1,E2) ... when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\) - memset((T2)x,0,E1); @@ expression E1,E2,E3; @@ - kzalloc(E1 * E2,E3) + kcalloc(E1,E2,E3) [akpm@linux-foundation.org: get kcalloc args the right way around] Signed-off-by: Yoann Padioleau <padator@wanadoo.fr> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Acked-by: Russell King <rmk@arm.linux.org.uk> Cc: Bryan Wu <bryan.wu@analog.com> Acked-by: Jiri Slaby <jirislaby@gmail.com> Cc: Dave Airlie <airlied@linux.ie> Acked-by: Roland Dreier <rolandd@cisco.com> Cc: Jiri Kosina <jkosina@suse.cz> Acked-by: Dmitry Torokhov <dtor@mail.ru> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Acked-by: Pierre Ossman <drzeus-list@drzeus.cx> Cc: Jeff Garzik <jeff@garzik.org> Cc: "David S. Miller" <davem@davemloft.net> Acked-by: Greg KH <greg@kroah.com> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17Freezer: make kernel threads nonfreezable by defaultRafael J. Wysocki1-5/+2
Currently, the freezer treats all tasks as freezable, except for the kernel threads that explicitly set the PF_NOFREEZE flag for themselves. This approach is problematic, since it requires every kernel thread to either set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't care for the freezing of tasks at all. It seems better to only require the kernel threads that want to or need to be frozen to use some freezer-related code and to remove any freezer-related code from the other (nonfreezable) kernel threads, which is done in this patch. The patch causes all kernel threads to be nonfreezable by default (ie. to have PF_NOFREEZE set by default) and introduces the set_freezable() function that should be called by the freezable kernel threads in order to unset PF_NOFREEZE. It also makes all of the currently freezable kernel threads call set_freezable(), so it shouldn't cause any (intentional) change of behaviour to appear. Additionally, it updates documentation to describe the freezing of tasks more accurately. [akpm@linux-foundation.org: build fixes] Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Nigel Cunningham <nigel@nigel.suspend2.net> Cc: Pavel Machek <pavel@ucw.cz> Cc: Oleg Nesterov <oleg@tv-sign.ru> Cc: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-09mmc: bounce requests for simple hostsPierre Ossman4-15/+208
Some hosts cannot do scatter/gather in hardware. Since not doing sg is such a big performance hit, we (optionally) bounce the requests to a simple linear buffer that we hand over to the driver. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-24mmc: clean up unused parts of block driverPierre Ossman3-53/+8
Remove dead code and unused structs from the block driver. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-14mmc: use assigned major for block devicePierre Ossman1-13/+4
The MMC block devices now have an assigned major. Make sure we actually use it. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-05-08mmc: Use menuconfig objectsJan Engelhardt1-2/+1
Change Kconfig objects from "menu, config" into "menuconfig" so that the user can disable the whole feature without having to enter the menu first. Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>