Skip to content

Commit

Permalink
Merge tag 'mmc-v4.11-rc7' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:
 "MMC core:

   - kmalloc sdio scratch buffer to make it DMA-friendly

  MMC host:

   - dw_mmc: Fix behaviour for SDIO IRQs when runtime PM is used

   - sdhci-esdhc-imx: Correct pad I/O drive strength for UHS-DDR50
     cards"

* tag 'mmc-v4.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: sdhci-esdhc-imx: increase the pad I/O drive strength for DDR50 card
  mmc: dw_mmc: Don't allow Runtime PM for SDIO cards
  mmc: sdio: fix alignment issue in struct sdio_func
  • Loading branch information
torvalds committed Apr 21, 2017
2 parents 4d4dfc1 + 9f32784 commit 11b211e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
12 changes: 11 additions & 1 deletion drivers/mmc/core/sdio_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ static void sdio_release_func(struct device *dev)
sdio_free_func_cis(func);

kfree(func->info);

kfree(func->tmpbuf);
kfree(func);
}

Expand All @@ -282,6 +282,16 @@ struct sdio_func *sdio_alloc_func(struct mmc_card *card)
if (!func)
return ERR_PTR(-ENOMEM);

/*
* allocate buffer separately to make sure it's properly aligned for
* DMA usage (incl. 64 bit DMA)
*/
func->tmpbuf = kmalloc(4, GFP_KERNEL);
if (!func->tmpbuf) {
kfree(func);
return ERR_PTR(-ENOMEM);
}

func->card = card;

device_initialize(&func->dev);
Expand Down
11 changes: 9 additions & 2 deletions drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/ioport.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/stat.h>
Expand Down Expand Up @@ -1621,10 +1622,16 @@ static void dw_mci_init_card(struct mmc_host *mmc, struct mmc_card *card)

if (card->type == MMC_TYPE_SDIO ||
card->type == MMC_TYPE_SD_COMBO) {
set_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags);
if (!test_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags)) {
pm_runtime_get_noresume(mmc->parent);
set_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags);
}
clk_en_a = clk_en_a_old & ~clken_low_pwr;
} else {
clear_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags);
if (test_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags)) {
pm_runtime_put_noidle(mmc->parent);
clear_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags);
}
clk_en_a = clk_en_a_old | clken_low_pwr;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/mmc/host/sdhci-esdhc-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ static int esdhc_change_pinstate(struct sdhci_host *host,

switch (uhs) {
case MMC_TIMING_UHS_SDR50:
case MMC_TIMING_UHS_DDR50:
pinctrl = imx_data->pins_100mhz;
break;
case MMC_TIMING_UHS_SDR104:
Expand Down
2 changes: 1 addition & 1 deletion include/linux/mmc/sdio_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct sdio_func {
unsigned int state; /* function state */
#define SDIO_STATE_PRESENT (1<<0) /* present in sysfs */

u8 tmpbuf[4]; /* DMA:able scratch buffer */
u8 *tmpbuf; /* DMA:able scratch buffer */

unsigned num_info; /* number of info strings */
const char **info; /* info strings */
Expand Down

0 comments on commit 11b211e

Please sign in to comment.