Skip to content

Commit

Permalink
Merge tag 'mmc-v5.9-rc4-3' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:

 - Fix deadlock when removing MEMSTICK host

 - Workaround broken CMDQ on Intel GLK based IRBIS models

* tag 'mmc-v5.9-rc4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: sdhci: Workaround broken command queuing on Intel GLK based IRBIS models
  memstick: Skip allocating card when removing host
  • Loading branch information
Linus Torvalds committed Oct 2, 2020
2 parents 09a6b0b + afd7f30 commit 2270b89
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions drivers/memstick/core/memstick.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ static void memstick_check(struct work_struct *work)
} else if (host->card->stop)
host->card->stop(host->card);

if (host->removing)
goto out_power_off;

card = memstick_alloc_card(host);

if (!card) {
Expand Down Expand Up @@ -545,6 +548,7 @@ EXPORT_SYMBOL(memstick_add_host);
*/
void memstick_remove_host(struct memstick_host *host)
{
host->removing = 1;
flush_workqueue(workqueue);
mutex_lock(&host->lock);
if (host->card)
Expand Down
3 changes: 2 additions & 1 deletion drivers/mmc/host/sdhci-pci-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,8 @@ static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot)
static bool glk_broken_cqhci(struct sdhci_pci_slot *slot)
{
return slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_GLK_EMMC &&
dmi_match(DMI_BIOS_VENDOR, "LENOVO");
(dmi_match(DMI_BIOS_VENDOR, "LENOVO") ||
dmi_match(DMI_SYS_VENDOR, "IRBIS"));
}

static int glk_emmc_probe_slot(struct sdhci_pci_slot *slot)
Expand Down
1 change: 1 addition & 0 deletions include/linux/memstick.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ struct memstick_host {

struct memstick_dev *card;
unsigned int retries;
bool removing;

/* Notify the host that some requests are pending. */
void (*request)(struct memstick_host *host);
Expand Down

0 comments on commit 2270b89

Please sign in to comment.