- 28 12月, 2015 1 次提交
-
-
由 Colin Cross 提交于
It is quite common for Android devices to utilize more then 8 partitions on internal eMMC storage. The vanilla kernel can support this via CONFIG_MMC_BLOCK_MINORS, however that solution caps the system to 256 minors total, which limits the number of mmc cards the system can support. This patch, which has been carried for quite awhile in the AOSP common tree, provides an alternative solution that doesn't seem to limit the total card count. So I wanted to submit it for consideration upstream. This patch sets the GENHD_FL_EXT_DEVT flag, which will allocate minor number in major 259 for partitions past disk->minors. It also removes the use of disk_devt to determine devidx from md->disk. md->disk->first_minor is always initialized from devidx and can always be used to recover it. Cc: Ulf Hansson <ulf.hansson@linaro.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ben Hutchings <ben@decadent.org.uk> Cc: Chuanxiao Dong <chuanxiao.dong@intel.com> Cc: Shawn Lin <shawn.lin@rock-chips.com> Cc: Austin S Hemmelgarn <ahferroin7@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Android Kernel Team <kernel-team@android.com> Cc: linux-mmc@vger.kernel.org Signed-off-by: NColin Cross <ccross@android.com> [jstultz: Added context to commit message] Signed-off-by: NJohn Stultz <john.stultz@linaro.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 22 12月, 2015 1 次提交
-
-
由 yalin wang 提交于
Use kmalloc instead of kzalloc, as zeroing the memory isn't needed. Signed-off-by: Nyalin wang <yalin.wang2010@gmail.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 09 11月, 2015 1 次提交
-
-
由 Luca Porzio 提交于
Anytime a write operation is performed with Reliable Write flag enabled, the eMMC device is enforced to bypass the cache and do a write to the underling NVM device by Jedec specification; this causes a performance penalty since write operations can't be optimized by the device cache. In our tests, we replayed a typical mobile daily trace pattern and found ~9% overall time reduction in trace replay by using this patch. Also the write ops within 4KB~64KB chunk size range get a 40~60% performance improvement by using the patch (as this range of write chunks are the ones affected by REQ_META). This patch has been discussed in the Mobile & Embedded Linux Storage Forum and it's the results of feedbacks from many people. We also checked with fsdevl and f2fs mailing list developers that this change in the usage of REQ_META is not affecting FS behavior and we got positive feedbacks. Reporting here the feedbacks: http://comments.gmane.org/gmane.linux.file-systems/97219 http://thread.gmane.org/gmane.linux.file-systems.f2fs/3178/focus=3183Signed-off-by: NBruce Ford <bford@micron.com> Signed-off-by: NLuca Porzio <lporzio@micron.com> Fixes: ce39f9d1 ("mmc: support packed write command for eMMC4.5 devices") Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 26 10月, 2015 2 次提交
-
-
由 Grant Grundler 提交于
MMC_IOC_CMD and MMC_IOC_MULTI_CMD ioctl() code currently bails on any eMMC errors. However, in case there is any resp[] data, we should attempt to copy resp[] back to user space. The user app can then determine which command(s) failed in the MMC_IOC_MULTI_CMD case AND/OR report better diagnostics in both cases. Gwendal Grignou provided the idea and it was previously implemented and tested on v3.18 ChromeOS kernel: https://chromium-review.googlesource.com/#/c/299956Signed-off-by: NGrant Grundler <grundler@chromium.org> Reviewed-by: NHyung Taek Ryoo <hryoo@nvidia.com> Reviewed-by: NGwendal Grignou <gwendal@chromium.org> Tested-by: NDavid Riley <davidriley@chromium.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Jon Hunter 提交于
Certain eMMC devices allow vendor specific device information to be read via a sequence of vendor commands. These vendor commands must be issued in sequence and an atomic fashion. One way to support this would be to add an ioctl function for sending a sequence of commands to the device atomically as proposed here. These multi commands are simple array of the existing mmc_ioc_cmd structure. The structure passed via the ioctl uses a __u64 type to specify the number of commands (so that the structure is aligned on a 64-bit boundary) and a zero length array as a header for list of commands to be issued. The maximum number of commands that can be sent is determined by MMC_IOC_MAX_CMDS (which defaults to 255 and should be more than sufficient). This based upon work by Seshagiri Holi <sholi@nvidia.com>. Signed-off-by: NSeshagiri Holi <sholi@nvidia.com> Signed-off-by: NJon Hunter <jonathanh@nvidia.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 27 8月, 2015 1 次提交
-
-
由 Shawn Lin 提交于
For some mass production of kingston eMMCs which adopt Phison's firmware will meet an unrecoverable data conrruption occasionally if performing trim due to a firmware bug confirmed by vendor. We found it on Intel-C3230RK platform. So we add fixup of broken trim for it. Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 17 8月, 2015 2 次提交
-
-
由 Yangbo Lu 提交于
Some Sandisk cards(such as "SDMB-32" and "SDM032" cards) can't support CMD23, and would generate CMD timeout. So add FIX-UP for these two types Sandisk cards. Error log: mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900 mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900 mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900 end_request: I/O error, dev mmcblk0, sector 0 Buffer I/O error on device mmcblk0, logical block 0 mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900 Signed-off-by: NYangbo Lu <yangbo.lu@freescale.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Andy Shevchenko 提交于
It's excessive to use prefix for the parameters when you do modprobe mmc-block mmcblk.perdev_minors=16 Make this available only for built-in case. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 24 7月, 2015 1 次提交
-
-
由 Tomas Winkler 提交于
Enclosing mmc_blk_put() is missing in power_ro_lock_show() sysfs handler, let's add it. Fixes: add710ea ("mmc: boot partition ro lock support") Signed-off-by: NTomas Winkler <tomas.winkler@intel.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 16 6月, 2015 1 次提交
-
-
由 Ding Wang 提交于
The current handler of MMC_BLK_CMD_ERR in mmc_blk_issue_rw_rq function may cause new coming request permanent missing when the ongoing request (previoulsy started) complete end. The problem scenario is as follows: (1) Request A is ongoing; (2) Request B arrived, and finally mmc_blk_issue_rw_rq() is called; (3) Request A encounters the MMC_BLK_CMD_ERR error; (4) In the error handling of MMC_BLK_CMD_ERR, suppose mmc_blk_cmd_err() end request A completed and return zero. Continue the error handling, suppose mmc_blk_reset() reset device success; (5) Continue the execution, while loop completed because variable ret is zero now; (6) Finally, mmc_blk_issue_rw_rq() return without processing request B. The process related to the missing request may wait that IO request complete forever, possibly crashing the application or hanging the system. Fix this issue by starting new request when reset success. Signed-off-by: NDing Wang <justin.wang@spreadtrum.com> Fixes: 67716327 ("mmc: block: add eMMC hardware reset support") Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 01 6月, 2015 3 次提交
-
-
由 Kuninori Morimoto 提交于
card->csd.capacity is defined as "unsigned int", and sector_t is defined as "u64" or "unsigned long" (depends on CONFIG_LBDAF). Thus, sector_t data might have strange data (see below). This patch cast it to typeof(sector_t) Special thanks to coverity <http://www.coverity.com> ex) if sector_t was u64 unsigned int data; sector_t sector; data = 0x800000; sector = (data << 8); // 0xffffffff80000000 sector = (((typeof(sector_t))data) << 8); // 0x80000000 or data = 0x80000000; sector = (data << 8); // 0x0 sector = (((typeof(sector_t))data) << 8); // 0x8000000000 Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Adrian Hunter 提交于
Retry errored data requests when re-tuning is needed and add a flag to struct mmc_blk_request so that the retry is only done once. Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Adrian Hunter 提交于
If re-tuning is needed, do it in the recovery path to give recovery commands a better chance of success. Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 06 5月, 2015 1 次提交
-
-
由 Chuanxiao Dong 提交于
During kernel boot, it will try to read some logical sectors of each block device node for the possible partition table. But since RPMB partition is special and can not be accessed by normal eMMC read / write CMDs, it will cause below error messages during kernel boot: ... mmc0: Got data interrupt 0x00000002 even though no data operation was in progress. mmcblk0rpmb: error -110 transferring data, sector 0, nr 32, cmd response 0x900, card status 0xb00 mmcblk0rpmb: retrying using single block read mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900 mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900 mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900 mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900 mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900 mmcblk0rpmb: timed out sending r/w cmd command, card status 0x400900 end_request: I/O error, dev mmcblk0rpmb, sector 0 Buffer I/O error on device mmcblk0rpmb, logical block 0 end_request: I/O error, dev mmcblk0rpmb, sector 8 Buffer I/O error on device mmcblk0rpmb, logical block 1 end_request: I/O error, dev mmcblk0rpmb, sector 16 Buffer I/O error on device mmcblk0rpmb, logical block 2 end_request: I/O error, dev mmcblk0rpmb, sector 24 Buffer I/O error on device mmcblk0rpmb, logical block 3 ... This patch will discard the access request in eMMC queue if it is RPMB partition access request. By this way, it avoids trigger above error messages. Fixes: 090d25fe ("mmc: core: Expose access to RPMB partition") Signed-off-by: NYunpeng Gao <yunpeng.gao@intel.com> Signed-off-by: NChuanxiao Dong <chuanxiao.dong@intel.com> Tested-by: NMichael Shigorin <mike@altlinux.org> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 17 4月, 2015 1 次提交
-
-
由 Ulf Hansson 提交于
This reverts commit 6685ac62 ("mmc: core: Convert mmc_driver to device_driver") The reverted commit went too far in simplifing the device driver parts for mmc. Let's restore the old mmc_driver to enable driver core to sooner or later to remove the ->probe(), ->remove() and ->shutdown() callbacks from the struct device_driver. Note that, the old ->suspend|resume() callbacks in the struct mmc_driver don't need to be restored, since the mmc block layer has converted to the modern system PM ops. Fixes: 6685ac62 ("mmc: core: Convert mmc_driver to device_driver") Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org> Acked-by: NJaehoon Chung <jh80.chung@samsung.com>
-
- 11 4月, 2015 1 次提交
-
-
由 James Bottomley 提交于
The current string_get_size() overflows when the device size goes over 2^64 bytes because the string helper routine computes the suffix from the size in bytes. However, the entirety of Linux thinks in terms of blocks, not bytes, so this will artificially induce an overflow on very large devices. Fix this by making the function string_get_size() take blocks and the block size instead of bytes. This should allow us to keep working until the current SCSI standard overflows. Also fix virtio_blk and mmc (both of which were also artificially multiplying by the block size to pass a byte side to string_get_size()). The mathematics of this is pretty simple: we're taking a product of size in blocks (S) and block size (B) and trying to re-express this in exponential form: S*B = R*N^E (where N, the exponent is either 1000 or 1024) and R < N. Mathematically, S = RS*N^ES and B=RB*N^EB, so if RS*RB < N it's easy to see that S*B = RS*RB*N^(ES+EB). However, if RS*BS > N, we can see that this can be re-expressed as RS*BS = R*N (where R = RS*BS/N < N) so the whole exponent becomes R*N^(ES+EB+1) [jejb: fix incorrect 32 bit do_div spotted by kbuild test robot <fengguang.wu@intel.com>] Acked-by: NUlf Hansson <ulf.hansson@linaro.org> Reviewed-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
-
- 28 1月, 2015 1 次提交
-
-
由 Tobias Klauser 提交于
Directly return the result of mmc_blk_alloc_req() instead of assigning and returning the variable md. Signed-off-by: NTobias Klauser <tklauser@distanz.ch> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 21 1月, 2015 1 次提交
-
-
由 Asaf Vertz 提交于
Fixed the following warning (reported by cppcheck): [drivers/mmc/card/block.c:2149]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. Signed-off-by: NAsaf Vertz <asaf.vertz@tandemg.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 26 11月, 2014 1 次提交
-
-
由 Ben Hutchings 提交于
Currently the driver imposes a limit of 256 total minor numbers, apparently based on the historic Unix/Linux limit. This is quite restrictive, particularly if we raise the maximum number of partitions per card to 256 to match sd. In order to make the full minor number space available we would have to replace the static dev_use and name_use arrays with struct ida. But we can at least allow use of 256 cards rather than just 256 minors, with only a small change. Signed-off-by: NBen Hutchings <ben@decadent.org.uk> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 10 11月, 2014 5 次提交
-
-
由 Ulf Hansson 提交于
By using mmc_get_ext_csd() in favor of mmc_send_ext_csd, we decrease code duplication. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Ulf Hansson 提交于
In most of the cases mmc_get|set_drvdata() didn't simplify code, which should be the primary reason for such macros. Let's remove them and convert to the common device_driver macros, dev_set|get_drvdata() instead. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Ulf Hansson 提交于
The struct mmc_driver adds an extra layer on top of the struct device_driver. That would be fine, if there were a good reason, but that's not the case. Let's simplify code by converting to the common struct device_driver instead and thus also removing superfluous overhead. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Ulf Hansson 提交于
Instead of having specific mmc system PM callbacks for the mmc driver, let's convert to use the common ones. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Baruch Siach 提交于
Make force_ro consistent with other sysfs entries. Fixes: 371a689f ('mmc: MMC boot partitions support') Cc: Andrei Warkentin <andrey.warkentin@gmail.com> Signed-off-by: NBaruch Siach <baruch@tkos.co.il> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 24 9月, 2014 1 次提交
-
-
由 Joe Perches 提交于
Use the much more common pr_warn instead of pr_warning. Other miscellanea: o Coalesce formats o Realign arguments o Remove extra spaces when coalescing formats Signed-off-by: NJoe Perches <joe@perches.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 19 9月, 2014 1 次提交
-
-
由 Johan Rudholm 提交于
Stop command errors are not fatal to the transfer since we make sure that the card returns to the transfer state and check the card status. Change an unnecessary error to an info. Signed-off-by: NJohan Rudholm <johanru@axis.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 09 9月, 2014 3 次提交
-
-
由 Ulf Hansson 提交于
It seems very unlikely that eMMC devices would hold a standard partitiontable in one of it's boot areas. Therefore, let's prevent them from being scanned. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Kuninori Morimoto 提交于
Now, mmc framework uses multi_io_quirk for I/O HW bug workaround. MMC_CAP2_NO_MULTI_READ flag is no longer needed Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
由 Kuninori Morimoto 提交于
Historically, we have been using MMC_CAP* to handle host HW issues and currently the block layer uses MMC_CAP2_NO_MULTI_READ flag for a multi I/O HW bug workaround. There are a few tweaks needed to make MMC_CAP2_NO_MULTI_READ suite all situations. Therefore let's add an optional host ops callback to enable host drivers to return the number of blocks it allows per request. In a future patch and when host drivers have converted to the new callback, MMC_CAP2_NO_MULTI_READ shall be removed. Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 26 7月, 2014 1 次提交
-
-
由 Lukas Czerner 提交于
Currently when the device secure discard implementation is blacklisted (MMC_QUIRK_SEC_ERASE_TRIM_BROKEN quirk is set) instead of secure discard we're going to do normal discard, which is wrong. When the secure discard is known to be broken we should just disallow it entirely and not advertise this functionality to the user. Fix it. Also move mmc_fixup_device() in from of mmc_blk_alloc() so we can get quirks set before we attempt to set queue information. Signed-off-by: NLukas Czerner <lczerner@redhat.com> Acked-by: NJaehoon Chung <jh80.chung@samsung.com> Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
-
- 23 2月, 2014 4 次提交
-
-
由 Ulf Hansson 提交于
When sending a stop command at the recovery path, use a R1B response when the failing data request are a WRITE. Thus we also care about the busy detection completion in this case. For a failing READ request, we use a R1 response for the stop command, since we don't need to care about busy detection in this case. To align behavior between hosts supporting MMC_CAP_WAIT_WHILE_BUSY and those who are not, we add a CMD13 polling method for the card's status. We also respect whether the host has specified the max_busy_timeout, which means we may fallback to CMD13 polling if the timeout is greater than what the host are able to support. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NChris Ball <chris@printf.net>
-
由 Ulf Hansson 提交于
Currently for write request we don't trust the hw busy detection to be fully handled by host, thus we also poll the card's status until we see it's gets out of the busy state. Still there are scenarios where it will a benefit to trust the hw busy detection done by the host, since no additional polling is needed. Let's prepare card_busy_detect() to be able to handle this. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NChris Ball <chris@printf.net>
-
由 Ulf Hansson 提交于
To complete a data write request we poll for the card's status register by sending CMD13. The are other scenarios when this polling method are needed, which is why we here moves this code to it's own function. No functional change. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NChris Ball <chris@printf.net>
-
由 Ulf Hansson 提交于
While using open ended transmission and thus ending the transfer by sending a stop command, we shall use R1B only for writes and R1 shall be used for reads. Previously R1B were used in both cases. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NChris Ball <chris@printf.net>
-
- 14 2月, 2014 1 次提交
-
-
由 Ulf Hansson 提交于
There is no need for keeping a host cap for MMC_CAP2_SANITIZE, instead we just make the feature default available. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NChris Ball <chris@printf.net>
-
- 14 1月, 2014 1 次提交
-
-
由 Ray Jui 提交于
Under function mmc_blk_issue_rq, after an MMC discard operation, the MMC request data structure may be freed in memory. Later in the same function, the check of req->cmd_flags & MMC_REQ_SPECIAL_MASK is dangerous and invalid. It causes the MMC host not to be released when it should. This patch fixes the issue by marking the special request down before the discard/flush operation. Reported by: Harold (SoonYeal) Yang <haroldsy@broadcom.com> Signed-off-by: NRay Jui <rjui@broadcom.com> Reviewed-by: NSeungwon Jeon <tgih.jun@samsung.com> Acked-by: NSeungwon Jeon <tgih.jun@samsung.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: NChris Ball <cjb@laptop.org>
-
- 31 10月, 2013 1 次提交
-
-
由 Ulf Hansson 提交于
By adding a card state that records if it is suspended or resumed, we can accept asyncronus suspend/resume requests for the mmc and sd bus_ops. MMC_CAP_AGGRESSIVE_PM, will at request inactivity through the runtime bus_ops callbacks, execute a suspend of the the card. In the state were this has been done, we can receive a suspend request for the mmc bus, which for sd and mmc forced the card to active state by a pm_runtime_get_sync. In other words, the card was resumed and then immediately suspended again, completely unnecessary. Since the suspend/resume bus_ops callbacks for sd and mmc are now capable of handling asynchronous requests, we no longer need to force the card to active state before executing suspend. Evidently preventing the above sequence for MMC_CAP_AGGRESSIVE_PM. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NChris Ball <cjb@laptop.org>
-
- 25 8月, 2013 2 次提交
-
-
由 Franck Jullien 提交于
A previous commit (fdfa20c1) reordered the shutdown sequence in mmc_blk_remove_req. However, mmc_cleanup_queue is now called before we get the card pointer, and mmc_cleanup_queue sets mq->card to NULL. This patch moves the card pointer assignment before mmc_cleanup_queue. Signed-off-by: NFranck Jullien <franck.jullien@gmail.com> Signed-off-by: NChris Ball <cjb@laptop.org>
-
由 KOBAYASHI Yoshitake 提交于
Current MMC driver doesn't handle generic error (bit19 of device status) in write sequence. As a result, write data gets lost when generic error occurs. For example, a generic error when updating a filesystem management information causes a loss of write data and corrupts the filesystem. In the worst case, the system will never boot. This patch includes the following functionality: 1. To enable error checking for the response of CMD12 and CMD13 in write command sequence 2. To retry write sequence when a generic error occurs Messages are added for v2 to show what occurs. Signed-off-by: NKOBAYASHI Yoshitake <yoshitake.kobayashi@toshiba.co.jp> Signed-off-by: NChris Ball <cjb@laptop.org>
-
- 28 6月, 2013 1 次提交
-
-
由 Ulf Hansson 提交于
Considering shutdown of the card, the responsibility to initate this sequence shall be driven from the mmc_bus. This patch enables the mmc_bus to handle this sequence properly. A new .shutdown callback is added in the mmc_driver struct which is used to shutdown the blk device. Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org> Signed-off-by: NChris Ball <cjb@laptop.org>
-