Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4610312pxj; Wed, 12 May 2021 09:11:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5i/YugTkdrYuYba1bCBwNca2CxvuUecX8zpBKZy5YUruR9RHsAITf4kXHZKnBkYxGYrfQ X-Received: by 2002:a05:6512:6c2:: with SMTP id u2mr25112102lff.371.1620835906420; Wed, 12 May 2021 09:11:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835906; cv=none; d=google.com; s=arc-20160816; b=HpXk1p7M08DdFgRtwrdPNGumEaBgYebGI2hFi7p0ZpfDGiSsHYS/WvhoKRqGoX/GF2 rZxcFPzzlwrAeN/wpt9NCscD0GYlFwBAGjIR/dR67lxvUwa8SKF7TlJ2bU7VfWCyRI0x Ukd5MhaJecJJy3lpM/zNuQTQ3Ztz4zo5OkqDZXLf0fMnmnPYygkLZmdSUvvpQPxJOipZ gsj/WCjjMOcXFVv+Indqsc5uL0qgFMKVm8u1bWnwsM2TYV0S+fdmCWPi79uV4CAYg6Eu UrggbaflZXvxoaeLVxJziHv6OmpC73DLF0rUZfHm3pe2GHiYeQay96Xt3Lf6jewGBvsy L8JQ== 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=eM/jKwYrD6/Z3GYSlgeUHMOE2o2A9yBiV+iP9a+2KsM=; b=r2gfmje7ZiKOcXsCtQxGWpo2JHrRFAAgAuGphyeGjzwaU4cF3ZvLM1Kfl0Dr/hasnu YoXCpdZUs+zrf/lzp+16Nz1zVDN9ndaq72kSRaWW6b70NB/7eTdgTxdQxGDq4YG090ra Q0zWP8eXPSzvNaYQfmTxxStJnw/wefEhwPRH06G/Be13QdiIzm7pqLrISJu/OuFsXQ5T 4TEMB5wFiOI15xl6/OPY3VBLDyLYaD8pRsLY2vgblL+pFtk4QXaq6P8obHOO8CIRNSGX Pf04DYUYkeW/rVIA+psUveciTDjXBXQQzFxOwNzis62/1AwlSEBPQaZEqln3xU9ubRUB 7Biw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YPjm3kmL; 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 n17si299003lfl.164.2021.05.12.09.11.15; Wed, 12 May 2021 09:11:46 -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=YPjm3kmL; 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 S235571AbhELQIW (ORCPT + 99 others); Wed, 12 May 2021 12:08:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:40954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231872AbhELP2u (ORCPT ); Wed, 12 May 2021 11:28:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2812261417; Wed, 12 May 2021 15:14:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832500; bh=wem3YfuaWefC9ignoFfbVMy/yemeUqLbn8D8n9HZZFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YPjm3kmLAzH9aJ0vdDmip5DIRP+TmAdGxV50WOnIO4hWwHrLextHZBa+mCbJJjHij r8i4sNMiCnTMkfKVYP3rt0cvjaFt4qSlbg+XbuUzhO5cQ8o/02tAKZ/d16FSWn0g9I z+3KE4UWdargxB15/YpqFw4lIDkoUjoRnRJjrqN8= 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 5.10 306/530] ata: libahci_platform: fix IRQ check Date: Wed, 12 May 2021 16:46:56 +0200 Message-Id: <20210512144829.857113907@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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 de638dafce21..b2f552088291 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -582,11 +582,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