Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp316507pxj; Thu, 20 May 2021 09:59:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFtLbgLO+cnZ9GOhzt8lVPiOVwLikOpT8XUFeYea24t3QtuxAKnxCx9nYImjhT1mkIZLWu X-Received: by 2002:a05:6638:597:: with SMTP id a23mr7299504jar.27.1621529954969; Thu, 20 May 2021 09:59:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621529954; cv=none; d=google.com; s=arc-20160816; b=oI0wOlAXBJMocapXko4TdSx0Rzdu7XYIPVW2SyDDGv1WtCyroyVu51nTPFAf2imKla 5/N/hKUlHaAhAGvb5/fZCBI7wYkZi3RHtNVoMoaxhEalPp6znlqmDq7ERifk+hi5rvIE GU9dKWFeebXHiFsboKTw8RH8nGHftO7dF3dWJZDhHD1EVqaUeTjZZq8R0yuXXtKGXruP hjxMDgPDDf8ZH4Hb3UU69cTCJsfL/e9kPVnNNFpZAH3wn9ftLRMxWeRUg4xM4K1a0exo p/0piECUrtacK9EzyR97I6IBjU8zXEI4H1IGFHKImsHmHqPlal8UU4z8KuOKanf4GQ3b Jc5Q== 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=fbKMSKeoCq5asjqlcO/n5ak8S9kU7igz4elf7/nIR1s=; b=qcD1i8ne+k75WfKh6gTL/9ZoOWFEuNUO+AmeHhnffysdw8y7srTbih5H98e3stNCjp XQF7q4G6gDzKlv+yAxpM3OlPY4YS/tQuadCRk68+hj6bUvc2ueFd/lBhcVgmu0E75/a0 r9bKcaHJD+04R6GTtbPM+Ob2glB46AgAEFCx3guzpVq2QSubS6fuqgXtyetY1fQGdHxk wUfsMh3vTv9tazQQwhMu5eJIqBQbEi9rb7/ar7EdUDh+NWMuOZAis2YAZL7wRFm05n/3 IHDOEcRd2a9lyvmYxeL5ajokqC6AOuPomoV4BIg9P7ddO77vJ383g9Ad3bbH0Cm3s2E4 ZqQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jk7eLQhQ; 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 p18si2739053jam.69.2021.05.20.09.59.02; Thu, 20 May 2021 09:59:14 -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=jk7eLQhQ; 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 S234833AbhETKBH (ORCPT + 99 others); Thu, 20 May 2021 06:01:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:58460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234613AbhETJ4j (ORCPT ); Thu, 20 May 2021 05:56:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7E83D61405; Thu, 20 May 2021 09:37:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503465; bh=tVTv+aXED1UpheeDz+k8kU9g/uaMaGmFqE3wfhfqOXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jk7eLQhQtmUFxfjFprOKHzcDjhrgSmHX56LVhr1unJGTPruieG5/GzMDs0ca3RpoG 8abNj7cFnpLx4n5sBWfuhv1zONwCeihsZRFx3WuIU7EdE3I2UOvutpOcw2XFrfNfq5 K9mtiwqSe4E9H4o3oCCoBEHty98MBDEqF/G+nLd4= 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.19 234/425] ata: libahci_platform: fix IRQ check Date: Thu, 20 May 2021 11:20:03 +0200 Message-Id: <20210520092139.121732005@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 522b543f718d..6a55aac0c60f 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -544,11 +544,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