forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
kernel/drivers/mmc/core/block.c
....@@ -47,6 +47,8 @@
4747
4848 #include <linux/uaccess.h>
4949
50
+#include <trace/hooks/mmc_core.h>
51
+
5052 #include "queue.h"
5153 #include "block.h"
5254 #include "core.h"
....@@ -71,7 +73,6 @@
7173 * ample.
7274 */
7375 #define MMC_BLK_TIMEOUT_MS (10 * 1000)
74
-#define MMC_SANITIZE_REQ_TIMEOUT 240000
7576 #define MMC_EXTRACT_INDEX_FROM_ARG(x) ((x & 0x00FF0000) >> 16)
7677 #define MMC_EXTRACT_VALUE_FROM_ARG(x) ((x & 0x0000FF00) >> 8)
7778
....@@ -101,7 +102,6 @@
101102 * There is one mmc_blk_data per slot.
102103 */
103104 struct mmc_blk_data {
104
- spinlock_t lock;
105105 struct device *parent;
106106 struct gendisk *disk;
107107 struct mmc_queue queue;
....@@ -172,7 +172,7 @@
172172 unsigned int part_type);
173173 static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
174174 struct mmc_card *card,
175
- int disable_multi,
175
+ int recovery_mode,
176176 struct mmc_queue *mq);
177177 static void mmc_blk_hsq_req_done(struct mmc_request *mrq);
178178
....@@ -315,10 +315,7 @@
315315
316316 mutex_lock(&block_mutex);
317317 if (md) {
318
- if (md->usage == 2)
319
- check_disk_change(bdev);
320318 ret = 0;
321
-
322319 if ((mode & FMODE_WRITE) && md->read_only) {
323320 mmc_blk_put(md);
324321 ret = -EROFS;
....@@ -415,44 +412,6 @@
415412 return 0;
416413 }
417414
418
-static int ioctl_do_sanitize(struct mmc_card *card)
419
-{
420
- int err;
421
-
422
- if (!mmc_can_sanitize(card)) {
423
- pr_warn("%s: %s - SANITIZE is not supported\n",
424
- mmc_hostname(card->host), __func__);
425
- err = -EOPNOTSUPP;
426
- goto out;
427
- }
428
-
429
- pr_debug("%s: %s - SANITIZE IN PROGRESS...\n",
430
- mmc_hostname(card->host), __func__);
431
-
432
- err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
433
- EXT_CSD_SANITIZE_START, 1,
434
- MMC_SANITIZE_REQ_TIMEOUT);
435
-
436
- if (err)
437
- pr_err("%s: %s - EXT_CSD_SANITIZE_START failed. err=%d\n",
438
- mmc_hostname(card->host), __func__, err);
439
-
440
- pr_debug("%s: %s - SANITIZE COMPLETED\n", mmc_hostname(card->host),
441
- __func__);
442
-out:
443
- return err;
444
-}
445
-
446
-static inline bool mmc_blk_in_tran_state(u32 status)
447
-{
448
- /*
449
- * Some cards mishandle the status bits, so make sure to check both the
450
- * busy indication and the card state.
451
- */
452
- return status & R1_READY_FOR_DATA &&
453
- (R1_CURRENT_STATE(status) == R1_STATE_TRAN);
454
-}
455
-
456415 static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
457416 u32 *resp_errs)
458417 {
....@@ -463,10 +422,12 @@
463422 do {
464423 bool done = time_after(jiffies, timeout);
465424
466
- if (card->host->ops->card_busy) {
425
+ if (!(card->host->caps2 & MMC_CAP2_NO_SD) && card->host->ops->card_busy) {
467426 status = card->host->ops->card_busy(card->host) ?
468427 0 : R1_READY_FOR_DATA | R1_STATE_TRAN << 9;
469
- usleep_range(100, 150);
428
+
429
+ if (!status)
430
+ usleep_range(100, 150);
470431 } else {
471432 err = __mmc_send_status(card, &status, 5);
472433 if (err) {
....@@ -490,13 +451,7 @@
490451 __func__, status);
491452 return -ETIMEDOUT;
492453 }
493
-
494
- /*
495
- * Some cards mishandle the status bits,
496
- * so make sure to check both the busy
497
- * indication and the card state.
498
- */
499
- } while (!mmc_blk_in_tran_state(status));
454
+ } while (!mmc_ready_for_data(status));
500455
501456 return err;
502457 }
....@@ -593,15 +548,8 @@
593548 }
594549
595550 if ((MMC_EXTRACT_INDEX_FROM_ARG(cmd.arg) == EXT_CSD_SANITIZE_START) &&
596
- (cmd.opcode == MMC_SWITCH)) {
597
- err = ioctl_do_sanitize(card);
598
-
599
- if (err)
600
- pr_err("%s: ioctl_do_sanitize() failed. err = %d",
601
- __func__, err);
602
-
603
- return err;
604
- }
551
+ (cmd.opcode == MMC_SWITCH))
552
+ return mmc_sanitize(card);
605553
606554 mmc_wait_for_req(card->host, &mrq);
607555 memcpy(&idata->ic.response, cmd.resp, sizeof(cmd.resp));
....@@ -797,7 +745,7 @@
797745 * whole block device, not on a partition. This prevents overspray
798746 * between sibling partitions.
799747 */
800
- if ((!capable(CAP_SYS_RAWIO)) || (bdev != bdev->bd_contains))
748
+ if (!capable(CAP_SYS_RAWIO) || bdev_is_partition(bdev))
801749 return -EPERM;
802750 return 0;
803751 }
....@@ -1024,6 +972,11 @@
1024972 struct mmc_blk_data *main_md =
1025973 dev_get_drvdata(&host->card->dev);
1026974 int part_err;
975
+ bool allow = true;
976
+
977
+ trace_android_vh_mmc_blk_reset(host, err, &allow);
978
+ if (!allow)
979
+ return -ENODEV;
1027980
1028981 main_md->part_curr = main_md->part_type;
1029982 part_err = mmc_blk_part_switch(host->card, md->part_type);
....@@ -1070,7 +1023,7 @@
10701023 if (ret)
10711024 break;
10721025 }
1073
- /* fallthrough */
1026
+ fallthrough;
10741027 case MMC_DRV_OP_IOCTL_RPMB:
10751028 idata = mq_rq->drv_op_data;
10761029 for (i = 0, ret = 0; i < mq_rq->ioc_count; i++) {
....@@ -1119,7 +1072,7 @@
11191072 {
11201073 struct mmc_blk_data *md = mq->blkdata;
11211074 struct mmc_card *card = md->queue.card;
1122
- unsigned int from, nr, arg;
1075
+ unsigned int from, nr;
11231076 int err = 0, type = MMC_BLK_DISCARD;
11241077 blk_status_t status = BLK_STS_OK;
11251078
....@@ -1131,24 +1084,23 @@
11311084 from = blk_rq_pos(req);
11321085 nr = blk_rq_sectors(req);
11331086
1134
- if (mmc_can_discard(card))
1135
- arg = MMC_DISCARD_ARG;
1136
- else if (mmc_can_trim(card))
1137
- arg = MMC_TRIM_ARG;
1138
- else
1139
- arg = MMC_ERASE_ARG;
11401087 do {
1088
+ unsigned int erase_arg = card->erase_arg;
1089
+
1090
+ if (mmc_card_broken_sd_discard(card))
1091
+ erase_arg = SD_ERASE_ARG;
1092
+
11411093 err = 0;
11421094 if (card->quirks & MMC_QUIRK_INAND_CMD38) {
11431095 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
11441096 INAND_CMD38_ARG_EXT_CSD,
1145
- arg == MMC_TRIM_ARG ?
1097
+ card->erase_arg == MMC_TRIM_ARG ?
11461098 INAND_CMD38_ARG_TRIM :
11471099 INAND_CMD38_ARG_ERASE,
1148
- 0);
1100
+ card->ext_csd.generic_cmd6_time);
11491101 }
11501102 if (!err)
1151
- err = mmc_erase(card, from, nr, arg);
1103
+ err = mmc_erase(card, from, nr, erase_arg);
11521104 } while (err == -EIO && !mmc_blk_reset(md, card->host, type));
11531105 if (err)
11541106 status = BLK_STS_IOERR;
....@@ -1187,7 +1139,7 @@
11871139 arg == MMC_SECURE_TRIM1_ARG ?
11881140 INAND_CMD38_ARG_SECTRIM1 :
11891141 INAND_CMD38_ARG_SECERASE,
1190
- 0);
1142
+ card->ext_csd.generic_cmd6_time);
11911143 if (err)
11921144 goto out_retry;
11931145 }
....@@ -1205,7 +1157,7 @@
12051157 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
12061158 INAND_CMD38_ARG_EXT_CSD,
12071159 INAND_CMD38_ARG_SECTRIM2,
1208
- 0);
1160
+ card->ext_csd.generic_cmd6_time);
12091161 if (err)
12101162 goto out_retry;
12111163 }
....@@ -1316,7 +1268,7 @@
13161268 }
13171269
13181270 static void mmc_blk_data_prep(struct mmc_queue *mq, struct mmc_queue_req *mqrq,
1319
- int disable_multi, bool *do_rel_wr_p,
1271
+ int recovery_mode, bool *do_rel_wr_p,
13201272 bool *do_data_tag_p)
13211273 {
13221274 struct mmc_blk_data *md = mq->blkdata;
....@@ -1382,12 +1334,12 @@
13821334 brq->data.blocks--;
13831335
13841336 /*
1385
- * After a read error, we redo the request one sector
1337
+ * After a read error, we redo the request one (native) sector
13861338 * at a time in order to accurately determine which
13871339 * sectors can be read successfully.
13881340 */
1389
- if (disable_multi)
1390
- brq->data.blocks = 1;
1341
+ if (recovery_mode)
1342
+ brq->data.blocks = queue_physical_block_size(mq->queue) >> 9;
13911343
13921344 /*
13931345 * Some controllers have HW issues while operating
....@@ -1485,7 +1437,7 @@
14851437 blk_mq_end_request(req, BLK_STS_OK);
14861438 }
14871439
1488
- spin_lock_irqsave(q->queue_lock, flags);
1440
+ spin_lock_irqsave(&mq->lock, flags);
14891441
14901442 mq->in_flight[issue_type] -= 1;
14911443
....@@ -1493,7 +1445,7 @@
14931445
14941446 mmc_cqe_check_busy(mq);
14951447
1496
- spin_unlock_irqrestore(q->queue_lock, flags);
1448
+ spin_unlock_irqrestore(&mq->lock, flags);
14971449
14981450 if (!mq->cqe_busy)
14991451 blk_mq_run_hw_queues(q, true);
....@@ -1513,8 +1465,7 @@
15131465 err = mmc_cqe_recovery(host);
15141466 if (err)
15151467 mmc_blk_reset(mq->blkdata, host, MMC_BLK_CQE_RECOVERY);
1516
- else
1517
- mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
1468
+ mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
15181469
15191470 pr_debug("%s: CQE recovery done\n", mmc_hostname(host));
15201471 }
....@@ -1533,7 +1484,7 @@
15331484 */
15341485 if (mq->in_recovery)
15351486 mmc_blk_cqe_complete_rq(mq, req);
1536
- else
1487
+ else if (likely(!blk_should_fake_timeout(req->q)))
15371488 blk_mq_complete_request(req);
15381489 }
15391490
....@@ -1605,7 +1556,7 @@
16051556
16061557 static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
16071558 struct mmc_card *card,
1608
- int disable_multi,
1559
+ int recovery_mode,
16091560 struct mmc_queue *mq)
16101561 {
16111562 u32 readcmd, writecmd;
....@@ -1614,7 +1565,7 @@
16141565 struct mmc_blk_data *md = mq->blkdata;
16151566 bool do_rel_wr, do_data_tag;
16161567
1617
- mmc_blk_data_prep(mq, mqrq, disable_multi, &do_rel_wr, &do_data_tag);
1568
+ mmc_blk_data_prep(mq, mqrq, recovery_mode, &do_rel_wr, &do_data_tag);
16181569
16191570 brq->mrq.cmd = &brq->cmd;
16201571
....@@ -1705,7 +1656,7 @@
17051656
17061657 #define MMC_READ_SINGLE_RETRIES 2
17071658
1708
-/* Single sector read during recovery */
1659
+/* Single (native) sector read during recovery */
17091660 static void mmc_blk_read_single(struct mmc_queue *mq, struct request *req)
17101661 {
17111662 struct mmc_queue_req *mqrq = req_to_mmc_queue_req(req);
....@@ -1713,6 +1664,7 @@
17131664 struct mmc_card *card = mq->card;
17141665 struct mmc_host *host = card->host;
17151666 blk_status_t error = BLK_STS_OK;
1667
+ size_t bytes_per_read = queue_physical_block_size(mq->queue);
17161668
17171669 do {
17181670 u32 status;
....@@ -1729,7 +1681,7 @@
17291681 goto error_exit;
17301682
17311683 if (!mmc_host_is_spi(host) &&
1732
- !mmc_blk_in_tran_state(status)) {
1684
+ !mmc_ready_for_data(status)) {
17331685 err = mmc_blk_fix_state(card, req);
17341686 if (err)
17351687 goto error_exit;
....@@ -1747,13 +1699,13 @@
17471699 else
17481700 error = BLK_STS_OK;
17491701
1750
- } while (blk_update_request(req, error, 512));
1702
+ } while (blk_update_request(req, error, bytes_per_read));
17511703
17521704 return;
17531705
17541706 error_exit:
17551707 mrq->data->bytes_xfered = 0;
1756
- blk_update_request(req, BLK_STS_IOERR, 512);
1708
+ blk_update_request(req, BLK_STS_IOERR, bytes_per_read);
17571709 /* Let it try the remaining request again */
17581710 if (mqrq->retries > MMC_MAX_RETRIES - 1)
17591711 mqrq->retries = MMC_MAX_RETRIES - 1;
....@@ -1788,7 +1740,7 @@
17881740 return brq->cmd.resp[0] & CMD_ERRORS ||
17891741 brq->stop.resp[0] & stop_err_bits ||
17901742 status & stop_err_bits ||
1791
- (rq_data_dir(req) == WRITE && !mmc_blk_in_tran_state(status));
1743
+ (rq_data_dir(req) == WRITE && !mmc_ready_for_data(status));
17921744 }
17931745
17941746 static inline bool mmc_blk_cmd_started(struct mmc_blk_request *brq)
....@@ -1850,7 +1802,7 @@
18501802
18511803 /* Try to get back to "tran" state */
18521804 if (!mmc_host_is_spi(mq->card->host) &&
1853
- (err || !mmc_blk_in_tran_state(status)))
1805
+ (err || !mmc_ready_for_data(status)))
18541806 err = mmc_blk_fix_state(mq->card, req);
18551807
18561808 /*
....@@ -1870,6 +1822,7 @@
18701822 err && mmc_blk_reset(md, card->host, type)) {
18711823 pr_err("%s: recovery failed!\n", req->rq_disk->disk_name);
18721824 mqrq->retries = MMC_NO_RETRIES;
1825
+ trace_android_vh_mmc_blk_mq_rw_recovery(card);
18731826 return;
18741827 }
18751828
....@@ -1894,10 +1847,9 @@
18941847 return;
18951848 }
18961849
1897
- /* FIXME: Missing single sector read for large sector size */
1898
- if (!mmc_large_sector(card) && rq_data_dir(req) == READ &&
1899
- brq->data.blocks > 1) {
1900
- /* Read one sector at a time */
1850
+ if (rq_data_dir(req) == READ && brq->data.blocks >
1851
+ queue_physical_block_size(mq->queue) >> 9) {
1852
+ /* Read one (native) sector at a time */
19011853 mmc_blk_read_single(mq, req);
19021854 return;
19031855 }
....@@ -1979,13 +1931,13 @@
19791931 struct mmc_queue_req *mqrq)
19801932 {
19811933 if (mmc_blk_urgent_bkops_needed(mq, mqrq))
1982
- mmc_start_bkops(mq->card, true);
1934
+ mmc_run_bkops(mq->card);
19831935 }
19841936
19851937 static void mmc_blk_hsq_req_done(struct mmc_request *mrq)
19861938 {
19871939 struct mmc_queue_req *mqrq =
1988
- container_of(mrq, struct mmc_queue_req, brq.mrq);
1940
+ container_of(mrq, struct mmc_queue_req, brq.mrq);
19891941 struct request *req = mmc_queue_req_to_req(mqrq);
19901942 struct request_queue *q = req->q;
19911943 struct mmc_queue *mq = q->queuedata;
....@@ -1994,10 +1946,10 @@
19941946
19951947 if (mmc_blk_rq_error(&mqrq->brq) ||
19961948 mmc_blk_urgent_bkops_needed(mq, mqrq)) {
1997
- spin_lock_irqsave(q->queue_lock, flags);
1949
+ spin_lock_irqsave(&mq->lock, flags);
19981950 mq->recovery_needed = true;
19991951 mq->recovery_req = req;
2000
- spin_unlock_irqrestore(q->queue_lock, flags);
1952
+ spin_unlock_irqrestore(&mq->lock, flags);
20011953
20021954 host->cqe_ops->cqe_recovery_start(host);
20031955
....@@ -2013,7 +1965,7 @@
20131965 */
20141966 if (mq->in_recovery)
20151967 mmc_blk_cqe_complete_rq(mq, req);
2016
- else
1968
+ else if (likely(!blk_should_fake_timeout(req->q)))
20171969 blk_mq_complete_request(req);
20181970 }
20191971
....@@ -2023,7 +1975,7 @@
20231975
20241976 if (mq->use_cqe)
20251977 mmc_blk_cqe_complete_rq(mq, req);
2026
- else
1978
+ else if (likely(!blk_should_fake_timeout(req->q)))
20271979 mmc_blk_mq_complete_rq(mq, req);
20281980 }
20291981
....@@ -2046,17 +1998,16 @@
20461998
20471999 static void mmc_blk_mq_dec_in_flight(struct mmc_queue *mq, struct request *req)
20482000 {
2049
- struct request_queue *q = req->q;
20502001 unsigned long flags;
20512002 bool put_card;
20522003
2053
- spin_lock_irqsave(q->queue_lock, flags);
2004
+ spin_lock_irqsave(&mq->lock, flags);
20542005
20552006 mq->in_flight[mmc_issue_type(mq, req)] -= 1;
20562007
20572008 put_card = (mmc_tot_in_flight(mq) == 0);
20582009
2059
- spin_unlock_irqrestore(q->queue_lock, flags);
2010
+ spin_unlock_irqrestore(&mq->lock, flags);
20602011
20612012 if (put_card)
20622013 mmc_put_card(mq->card, &mq->ctx);
....@@ -2076,7 +2027,7 @@
20762027 */
20772028 if (mq->in_recovery)
20782029 mmc_blk_mq_complete_rq(mq, req);
2079
- else
2030
+ else if (likely(!blk_should_fake_timeout(req->q)))
20802031 blk_mq_complete_request(req);
20812032
20822033 mmc_blk_mq_dec_in_flight(mq, req);
....@@ -2152,11 +2103,11 @@
21522103 * request does not need to wait (although it does need to
21532104 * complete complete_req first).
21542105 */
2155
- spin_lock_irqsave(q->queue_lock, flags);
2106
+ spin_lock_irqsave(&mq->lock, flags);
21562107 mq->complete_req = req;
21572108 mq->rw_wait = false;
21582109 waiting = mq->waiting;
2159
- spin_unlock_irqrestore(q->queue_lock, flags);
2110
+ spin_unlock_irqrestore(&mq->lock, flags);
21602111
21612112 /*
21622113 * If 'waiting' then the waiting task will complete this
....@@ -2175,10 +2126,10 @@
21752126 /* Take the recovery path for errors or urgent background operations */
21762127 if (mmc_blk_rq_error(&mqrq->brq) ||
21772128 mmc_blk_urgent_bkops_needed(mq, mqrq)) {
2178
- spin_lock_irqsave(q->queue_lock, flags);
2129
+ spin_lock_irqsave(&mq->lock, flags);
21792130 mq->recovery_needed = true;
21802131 mq->recovery_req = req;
2181
- spin_unlock_irqrestore(q->queue_lock, flags);
2132
+ spin_unlock_irqrestore(&mq->lock, flags);
21822133 wake_up(&mq->wait);
21832134 schedule_work(&mq->recovery_work);
21842135 return;
....@@ -2194,7 +2145,6 @@
21942145
21952146 static bool mmc_blk_rw_wait_cond(struct mmc_queue *mq, int *err)
21962147 {
2197
- struct request_queue *q = mq->queue;
21982148 unsigned long flags;
21992149 bool done;
22002150
....@@ -2202,7 +2152,7 @@
22022152 * Wait while there is another request in progress, but not if recovery
22032153 * is needed. Also indicate whether there is a request waiting to start.
22042154 */
2205
- spin_lock_irqsave(q->queue_lock, flags);
2155
+ spin_lock_irqsave(&mq->lock, flags);
22062156 if (mq->recovery_needed) {
22072157 *err = -EBUSY;
22082158 done = true;
....@@ -2210,7 +2160,7 @@
22102160 done = !mq->rw_wait;
22112161 }
22122162 mq->waiting = !done;
2213
- spin_unlock_irqrestore(q->queue_lock, flags);
2163
+ spin_unlock_irqrestore(&mq->lock, flags);
22142164
22152165 return done;
22162166 }
....@@ -2391,12 +2341,11 @@
23912341 goto err_kfree;
23922342 }
23932343
2394
- spin_lock_init(&md->lock);
23952344 INIT_LIST_HEAD(&md->part);
23962345 INIT_LIST_HEAD(&md->rpmbs);
23972346 md->usage = 1;
23982347
2399
- ret = mmc_init_queue(&md->queue, card, &md->lock, subname);
2348
+ ret = mmc_init_queue(&md->queue, card);
24002349 if (ret)
24012350 goto err_putdisk;
24022351
....@@ -2764,7 +2713,7 @@
27642713 int ret;
27652714 struct mmc_card *card = md->queue.card;
27662715
2767
- device_add_disk(md->parent, md->disk);
2716
+ device_add_disk(md->parent, md->disk, NULL);
27682717 md->force_ro.show = force_ro_show;
27692718 md->force_ro.store = force_ro_store;
27702719 sysfs_attr_init(&md->force_ro.attr);
....@@ -2829,8 +2778,8 @@
28292778
28302779 return ret;
28312780 }
2832
-DEFINE_SIMPLE_ATTRIBUTE(mmc_dbg_card_status_fops, mmc_dbg_card_status_get,
2833
- NULL, "%08llx\n");
2781
+DEFINE_DEBUGFS_ATTRIBUTE(mmc_dbg_card_status_fops, mmc_dbg_card_status_get,
2782
+ NULL, "%08llx\n");
28342783
28352784 /* That is two digits * 512 + 1 for newline */
28362785 #define EXT_CSD_STR_LEN 1025
....@@ -2918,8 +2867,9 @@
29182867
29192868 if (mmc_card_mmc(card) || mmc_card_sd(card)) {
29202869 md->status_dentry =
2921
- debugfs_create_file("status", S_IRUSR, root, card,
2922
- &mmc_dbg_card_status_fops);
2870
+ debugfs_create_file_unsafe("status", 0400, root,
2871
+ card,
2872
+ &mmc_dbg_card_status_fops);
29232873 if (!md->status_dentry)
29242874 return -EIO;
29252875 }
....@@ -2968,6 +2918,7 @@
29682918
29692919 struct mmc_card *this_card;
29702920 EXPORT_SYMBOL(this_card);
2921
+
29712922 static int mmc_blk_probe(struct mmc_card *card)
29722923 {
29732924 struct mmc_blk_data *md, *part_md;
....@@ -3003,8 +2954,8 @@
30032954
30042955 dev_set_drvdata(&card->dev, md);
30052956
3006
-#if IS_ENABLED(CONFIG_MMC_DW_ROCKCHIP) || IS_ENABLED(CONFIG_MMC_SDHCI_OF_ARASAN)
3007
- if (card->host->restrict_caps & RESTRICT_CARD_TYPE_EMMC)
2957
+#if defined(CONFIG_MMC_DW_ROCKCHIP) || defined(CONFIG_MMC_SDHCI_OF_ARASAN)
2958
+ if (card->type == MMC_TYPE_MMC)
30082959 this_card = card;
30092960 #endif
30102961
....@@ -3046,7 +2997,7 @@
30462997 mmc_blk_remove_debugfs(card, md);
30472998
30482999 #if defined(CONFIG_MMC_DW_ROCKCHIP)
3049
- if (card->host->restrict_caps & RESTRICT_CARD_TYPE_EMMC)
3000
+ if (card->type == MMC_TYPE_MMC)
30503001 this_card = NULL;
30513002 #endif
30523003