Patch "pata_arasan_cf: fix IRQ check" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    pata_arasan_cf: fix IRQ check

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pata_arasan_cf-fix-irq-check.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5cf21c6712e90b2019cb80c3c5f3b4fd18011f73
Author: Sergey Shtylyov <s.shtylyov@xxxxxxxxxxxx>
Date:   Thu Mar 25 23:50:24 2021 +0300

    pata_arasan_cf: fix IRQ check
    
    [ Upstream commit c7e8f404d56b99c80990b19a402c3f640d74be05 ]
    
    The driver's probe() method is written as if platform_get_irq() returns 0
    on error, while actually it returns a negative error code (with all the
    other values considered valid IRQs). Rewrite the driver's IRQ checking code
    to pass the positive IRQ #s to ata_host_activate(), propagate upstream
    -EPROBE_DEFER, and set up the driver to polling mode on (negative) errors
    and IRQ0 (libata treats IRQ #0 as a polling mode anyway)...
    
    Fixes: a480167b23ef ("pata_arasan_cf: Adding support for arasan compact flash host controller")
    Signed-off-by: Sergey Shtylyov <s.shtylyov@xxxxxxxxxxxx>
    Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index e9cf31f38450..63f39440a9b4 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -818,12 +818,19 @@ static int arasan_cf_probe(struct platform_device *pdev)
 	else
 		quirk = CF_BROKEN_UDMA; /* as it is on spear1340 */
 
-	/* if irq is 0, support only PIO */
-	acdev->irq = platform_get_irq(pdev, 0);
-	if (acdev->irq)
+	/*
+	 * If there's an error getting IRQ (or we do get IRQ0),
+	 * support only PIO
+	 */
+	ret = platform_get_irq(pdev, 0);
+	if (ret > 0) {
+		acdev->irq = ret;
 		irq_handler = arasan_cf_interrupt;
-	else
+	} else	if (ret == -EPROBE_DEFER) {
+		return ret;
+	} else	{
 		quirk |= CF_BROKEN_MWDMA | CF_BROKEN_UDMA;
+	}
 
 	acdev->pbase = res->start;
 	acdev->vbase = devm_ioremap(&pdev->dev, res->start,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux