Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp448095pxj; Thu, 20 May 2021 13:10:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtVhWJADT2vejy0P61kK+KaX9O/kzay7rAUxAsGH6Iiw2jCMgEgbMxrxArsL3d/1+lG94H X-Received: by 2002:a92:7c02:: with SMTP id x2mr7247518ilc.8.1621541427140; Thu, 20 May 2021 13:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621541427; cv=none; d=google.com; s=arc-20160816; b=kMhCUEwLfpBsoxN+5FStBHGBd1DFhDvKkiVVLhNPo842ZyEJpB83DkkzY1+9E/IS+6 R6FeRQrM6rPPi9xfjRm0PkClOpsqPGuIU20bWZlGpjH1zH7VxiT7aQ7Os/SDT0gHiFHz ZchySJk0LY8MZCoGWGJYWL+LnvOGYsFAsE+RBxayR00YHfB6WMgRRR96gCNEBRNCQ33G +Dc0ChRZLJHyKkfPS+60AiZN2gVUn4jWSOZNvdh/oAOcGEruw3UdsVil4R96hC/R9OG0 cQ596ExsL80Kr7wEhuzl4XCUtylcPXQTCCF8u4f2er5jrzBEbs3LR7mhUGbX/YiuPnE9 2Ptw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+oQSbYORvU4+c7BWN74xLISiezQHlRP/LVLoEf+AgBA=; b=U7pORJPNwyo5Xl5831supgxx/emCcdB2EqNEdVT0oVt5OFbe+p3vzttAbuBZkWISAr GLIduO3h+/8pK1gFQzc2jhqzQBAUqT5nHaXnpfJBiQEcG6Wa2fPCw4VUzQb08sK/LJiN SbFR5+3yAv0YuinAQ3JT36s/ENv7K8goJfXcqagFHlf6X628FZKFFsODdoDp48hL7vO/ GzaW4cFjEnzzMexYI7+3NYBiJUoG+s9sIwMX4d5s/8z6z0h5l2zUPG4uJcQXxclUHG2q 8dDBGY67SpLLVFyN8zQFYp2Cvt3LrXMIr2RUD+ivQdjzmG8Iu1SPehn8utksF2ngq6Wa 7atQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wfE+SHbV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n9si2987034jaj.15.2021.05.20.13.10.13; Thu, 20 May 2021 13:10:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wfE+SHbV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237594AbhETKqR (ORCPT + 99 others); Thu, 20 May 2021 06:46:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:58206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236838AbhETKaY (ORCPT ); Thu, 20 May 2021 06:30:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7568361483; Thu, 20 May 2021 09:51:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504307; bh=9yT1C6ivptOcf1SjqlhFfhMlKdmn6jgeBZ4gfhiVVPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wfE+SHbVZHI73Iv8AK82CPuUvjjqcItvApfgp4G4fD8Znf0FMSF47iGtMGUpA5+0B j03LYcg8kK1EQERcF93hIwgWwiDXZ+lFYPobj1XGAadL3/Cjkm3si5wo/5u0gMDZaA A3vvvN8j47cwuweOgEsckkN9QEVyxvNPT+6iwovo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergey Shtylyov , Jens Axboe , Sasha Levin Subject: [PATCH 4.14 186/323] ata: libahci_platform: fix IRQ check Date: Thu, 20 May 2021 11:21:18 +0200 Message-Id: <20210520092126.484950441@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sergey Shtylyov [ Upstream commit b30d0040f06159de97ad9c0b1536f47250719d7d ] Iff platform_get_irq() returns 0, ahci_platform_init_host() would return 0 early (as if the call was successful). Override IRQ0 with -EINVAL instead as the 'libata' regards 0 as "no IRQ" (thus polling) anyway... Fixes: c034640a32f8 ("ata: libahci: properly propagate return value of platform_get_irq()") Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/4448c8cc-331f-2915-0e17-38ea34e251c8@omprussia.ru Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/ata/libahci_platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index 5929672b809e..19d495244ce8 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -518,11 +518,13 @@ int ahci_platform_init_host(struct platform_device *pdev, int i, irq, n_ports, rc; irq = platform_get_irq(pdev, 0); - if (irq <= 0) { + if (irq < 0) { if (irq != -EPROBE_DEFER) dev_err(dev, "no irq\n"); return irq; } + if (!irq) + return -EINVAL; hpriv->irq = irq; -- 2.30.2