Skip to content

Commit fdb7ef5

Browse files
author
Ulf Hansson
committed
Merge branch 'fixes' into next
2 parents 3feb459 + d7fb9c2 commit fdb7ef5

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎drivers/mmc/core/sdio_cis.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "sdio_cis.h"
2121
#include "sdio_ops.h"
2222

23+
#define SDIO_READ_CIS_TIMEOUT_MS (10 * 1000) /* 10s */
24+
2325
static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func,
2426
const unsigned char *buf, unsigned size)
2527
{
@@ -274,6 +276,8 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
274276

275277
do {
276278
unsigned char tpl_code, tpl_link;
279+
unsigned long timeout = jiffies +
280+
msecs_to_jiffies(SDIO_READ_CIS_TIMEOUT_MS);
277281

278282
ret = mmc_io_rw_direct(card, 0, 0, ptr++, 0, &tpl_code);
279283
if (ret)
@@ -326,6 +330,8 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
326330
prev = &this->next;
327331

328332
if (ret == -ENOENT) {
333+
if (time_after(jiffies, timeout))
334+
break;
329335
/* warn about unknown tuples */
330336
pr_warn_ratelimited("%s: queuing unknown"
331337
" CIS tuple 0x%02x (%u bytes)\n",

‎drivers/mmc/host/sdhci-pltfm.h‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,13 @@ static inline void *sdhci_pltfm_priv(struct sdhci_pltfm_host *host)
111111
return host->private;
112112
}
113113

114+
extern const struct dev_pm_ops sdhci_pltfm_pmops;
115+
#ifdef CONFIG_PM_SLEEP
114116
int sdhci_pltfm_suspend(struct device *dev);
115117
int sdhci_pltfm_resume(struct device *dev);
116-
extern const struct dev_pm_ops sdhci_pltfm_pmops;
118+
#else
119+
static inline int sdhci_pltfm_suspend(struct device *dev) { return 0; }
120+
static inline int sdhci_pltfm_resume(struct device *dev) { return 0; }
121+
#endif
117122

118123
#endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */

0 commit comments

Comments
 (0)