Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp62736pxj; Thu, 20 May 2021 04:38:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/7ALO8uUDyRl+rdAsFUkEDsy0lsh1pewpziAKqYVC+ZbIoCC4LXI5JrugQ/z1fdFwMPMA X-Received: by 2002:a17:906:8a53:: with SMTP id gx19mr4209152ejc.372.1621510693944; Thu, 20 May 2021 04:38:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621510693; cv=none; d=google.com; s=arc-20160816; b=tGk99t7olsY5aw/QEjUqJ6K5rEchMp5lu+WPtYQMo6bthHwIj6OGPzq28IVuVh1sBE IOTbAm/v4jFpDEV0HOx5YI47ydBgySzgClK80lBhBgiykpQhulty7CKMH5ZMhMd47sHo gn3cxbTOUR01s/bYDmZ72gbMBZn1wfnvfgeZTLn4Ut0ZBxqXwKn2DhbeQeDosoglUjvW Xyob46uTtj+XAdaQJWb7dGQC12mQV502Z3h00ektVyJ+UATZZl8IlBMmv8xy63PoNHF1 OnVBkBtqXawU7vsmnRBqsilrIst7Yq7RyQWyiuqg1veB1mP15YABEz9WO29hPKKzZbzE HX8A== 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=OjjI6CuR5+88n8HNCXag4Ivq6C4ACMw+nH9bF9C1Lxw=; b=AnLgRo7BM+pg9SOEPrAuef4eZIv2iQ9xjpIee/afFQOba4CV0rGuZJnkwerq9i3YPn Hsibz1Or66jhGkT10N5UWlwZrgfb5cw8n7grkWIU57i0FXJVVYqCIGAg4lZstQKErICC UcNsLlpb5JMJkseKEXMYBiilxkbQCMkP9+wlIeMXiVlpRSsOKTp4IUmNcc/WvPGMA2cl m2nrWScbFmyHGIF+l6VR1KwgS0RUkHSERgjz0Epgtp9Gg15f4pQGMqwaErpuHiIECsc5 aSWEB9z2QMt0Dw9M3O/KqCzBGnhXPj1cTDrR0FRtXgkusAtUYxSOkPAiWkEOTnDZiLu8 GPMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s5OIEiy7; 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 j1si2186947ejx.156.2021.05.20.04.37.49; Thu, 20 May 2021 04:38:13 -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=s5OIEiy7; 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 S241805AbhETLhN (ORCPT + 99 others); Thu, 20 May 2021 07:37:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:37174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239790AbhETLRB (ORCPT ); Thu, 20 May 2021 07:17:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 911B56143F; Thu, 20 May 2021 10:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505371; bh=9bCk7lst2Wr2aSBAmq/2HsY7GvcqAWinacpkppcJSuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s5OIEiy7xo4HJobES/D9vHolyqpWeb4Tp9LKm1ILHeN329Ysr6qu/WGpVdWgT/4RP oSQp2wVsdYOhQZ86RY9y41h/iC0B3R01TRGLqtvdNfLUxhPHpCJaEVbisuS4irT6fS /a5f4oN7HghdD5KUnxiAJOAYmC3lp0Ju3SodpIOs= 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.4 103/190] ata: libahci_platform: fix IRQ check Date: Thu, 20 May 2021 11:22:47 +0200 Message-Id: <20210520092105.601733089@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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 65371e1befe8..8839ad6b73e3 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -516,11 +516,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