mmc: meson-gx: fix SDIO mode if cap_sdio_irq isn't set
Subsystems (2)
PATCH RESEND v2 1/1 mmc: meson-gx: fix SDIO mode if cap_sdio_irq isn't set
Some SDIO WiFi modules stopped working after SDIO interrupt mode was added if cap_sdio_irq isn't set in device tree. This patch was confirmed to fix the issue.
Fixes 066ecde6d826 ("mmc: meson-gx: add SDIO interrupt support")
Reported-by Geraldo Nascimento <[email protected]>
Tested-by Geraldo Nascimento <[email protected]>
Signed-off-by Heiner Kallweit <[email protected]>
---
v2:
- fix printf type issue
--- drivers/mmc/host/meson-gx-mmc.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/mmc/host/meson-gx-mmc.c +13 -10
@@ -435,7 +435,8 @@ static int meson_mmc_clk_init(struct meson_host *host) clk_reg |=FIELD_PREP (CLK_CORE_PHASE_MASK ,CLK_PHASE_180 ); clk_reg |=FIELD_PREP (CLK_TX_PHASE_MASK ,CLK_PHASE_0 ); clk_reg |=FIELD_PREP (CLK_RX_PHASE_MASK ,CLK_PHASE_0 ); - clk_reg |=CLK_IRQ_SDIO_SLEEP (host); +if (host->mmc->caps &MMC_CAP_SDIO_IRQ ) + clk_reg |=CLK_IRQ_SDIO_SLEEP (host);writel (clk_reg, host->regs +SD_EMMC_CLOCK );/* get the mux parents */
@@ -948,16 +949,18 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) {struct meson_host *host = dev_id;struct mmc_command *cmd; -u32 status, raw_status; +u32 status, raw_status, irq_mask =IRQ_EN_MASK ;irqreturn_t ret =IRQ_NONE ; +if (host->mmc->caps &MMC_CAP_SDIO_IRQ ) + irq_mask |=IRQ_SDIO ; raw_status =readl (host->regs +SD_EMMC_STATUS ); - status = raw_status & (IRQ_EN_MASK |IRQ_SDIO ); + status = raw_status & irq_mask;if (!status) {dev_dbg (host->dev, -"Unexpected IRQ! irq_en 0x%08lx - status 0x%08x\n" , -IRQ_EN_MASK |IRQ_SDIO , raw_status); +"Unexpected IRQ! irq_en 0x%08x - status 0x%08x\n" , + irq_mask, raw_status);return IRQ_NONE ; }
@@ -1204,6 +1207,11 @@ static int meson_mmc_probe(struct platform_device *pdev) goto free_host; } + mmc->caps |=MMC_CAP_CMD23 ; + +if (mmc->caps &MMC_CAP_SDIO_IRQ ) + mmc->caps2 |=MMC_CAP2_SDIO_IRQ_NOTHREAD ; + host->data = (struct meson_mmc_data *)of_device_get_match_data (&pdev->dev);if (!host->data) {
@@ -1277,11 +1285,6 @@ static int meson_mmc_probe(struct platform_device *pdev)spin_lock_init (&host->lock); - mmc->caps |=MMC_CAP_CMD23 ; - -if (mmc->caps &MMC_CAP_SDIO_IRQ ) - mmc->caps2 |=MMC_CAP2_SDIO_IRQ_NOTHREAD ; -if (host->dram_access_quirk) {/* Limit segments to 1 due to low available sram memory */ mmc->max_segs =1 ;
Signature · 1 line
2.39.1
Quoted 10 lines · Heiner Kallweit
Some SDIO WiFi modules stopped working after SDIO interrupt mode was added if
cap_sdio_irqisn't set in device tree. This patch was confirmed to fix the issue.Fixes 066ecde6d826 ("mmc: meson-gx: add SDIO interrupt support")Reported-by Geraldo Nascimento <[email protected]>Tested-by Geraldo Nascimento <[email protected]>Signed-off-by Heiner Kallweit <[email protected]>
Applied for fixes, thanks!
Kind regards
Uffe
Quoted 71 lines
---
v2:
- fix printf type issue--- drivers/mmc/host/meson-gx-mmc.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)drivers/mmc/host/meson-gx-mmc.c +13
-11@@ -435,7 +435,8 @@ static int meson_mmc_clk_init(struct meson_host *host) clk_reg |=FIELD_PREP (CLK_CORE_PHASE_MASK ,CLK_PHASE_180 ); clk_reg |=FIELD_PREP (CLK_TX_PHASE_MASK ,CLK_PHASE_0 ); clk_reg |=FIELD_PREP (CLK_RX_PHASE_MASK ,CLK_PHASE_0 ); - clk_reg |=CLK_IRQ_SDIO_SLEEP (host); +if (host->mmc->caps &MMC_CAP_SDIO_IRQ ) + clk_reg |=CLK_IRQ_SDIO_SLEEP (host);writel (clk_reg, host->regs +SD_EMMC_CLOCK );/* get the mux parents */ @@ -948,16 +949,18 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id) {struct meson_host *host = dev_id;struct mmc_command *cmd; -u32 status, raw_status; +u32 status, raw_status, irq_mask =IRQ_EN_MASK ;irqreturn_t ret =IRQ_NONE ; +if (host->mmc->caps &MMC_CAP_SDIO_IRQ ) + irq_mask |=IRQ_SDIO ; raw_status =readl (host->regs +SD_EMMC_STATUS ); - status = raw_status & (IRQ_EN_MASK |IRQ_SDIO ); + status = raw_status & irq_mask;if (!status) {dev_dbg (host->dev, -"Unexpected IRQ! irq_en 0x%08lx - status 0x%08x\n" , -IRQ_EN_MASK |IRQ_SDIO , raw_status); +"Unexpected IRQ! irq_en 0x%08x - status 0x%08x\n" , + irq_mask, raw_status);return IRQ_NONE ; }@@ -1204,6 +1207,11 @@ static int meson_mmc_probe(struct platform_device *pdev) goto free_host; } + mmc->caps |=MMC_CAP_CMD23 ; + +if (mmc->caps &MMC_CAP_SDIO_IRQ ) + mmc->caps2 |=MMC_CAP2_SDIO_IRQ_NOTHREAD ; + host->data = (struct meson_mmc_data *)of_device_get_match_data (&pdev->dev);if (!host->data) {@@ -1277,11 +1285,6 @@ static int meson_mmc_probe(struct platform_device *pdev)spin_lock_init (&host->lock); - mmc->caps |=MMC_CAP_CMD23 ; - -if (mmc->caps &MMC_CAP_SDIO_IRQ ) - mmc->caps2 |=MMC_CAP2_SDIO_IRQ_NOTHREAD ; -if (host->dram_access_quirk) {/* Limit segments to 1 due to low available sram memory */ mmc->max_segs =1 ; --2.39.1