mmc: uniphier-sd: register irqs before registering controller
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 12 Jul 2023 14:13:27 +0000 (16:13 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 9 Aug 2023 11:21:48 +0000 (13:21 +0200)
IRQs should be ready to serve when we call mmc_add_host() via
tmio_mmc_host_probe(). To achieve that, ensure that all irqs are masked
before registering the handlers.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20230712141327.20827-1-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/uniphier-sd.c

index 61acd69fac0ec0cb40821203d7f9908c8bbaa18b..4dc079f74c1b2ebb982826d91346bd6430bfe3e1 100644 (file)
@@ -706,19 +706,19 @@ static int uniphier_sd_probe(struct platform_device *pdev)
        tmio_data->max_segs = 1;
        tmio_data->max_blk_count = U16_MAX;
 
-       ret = tmio_mmc_host_probe(host);
-       if (ret)
-               goto disable_clk;
+       sd_ctrl_write32_as_16_and_16(host, CTL_IRQ_MASK, TMIO_MASK_ALL);
 
        ret = devm_request_irq(dev, irq, tmio_mmc_irq, IRQF_SHARED,
                               dev_name(dev), host);
        if (ret)
-               goto remove_host;
+               goto disable_clk;
+
+       ret = tmio_mmc_host_probe(host);
+       if (ret)
+               goto disable_clk;
 
        return 0;
 
-remove_host:
-       tmio_mmc_host_remove(host);
 disable_clk:
        uniphier_sd_clk_disable(host);
 free_host: