Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp62660pxj; Thu, 20 May 2021 04:38:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLsSsedp+GgDyeOND878pUFEZg0GToCDHcAWeIK0XKuAOVwQ5XmzCkK06XUTMVYLiQ10rE X-Received: by 2002:aa7:de02:: with SMTP id h2mr4458516edv.61.1621510685914; Thu, 20 May 2021 04:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621510685; cv=none; d=google.com; s=arc-20160816; b=mSj2x0gT+6rdlrvjllXcdAOyL2H+M+qXQOciSCouQwEnbacCwA+Jackq/0OC9RTd1B giyj2jLDTnvgsnPvrqz+GSGIQN5Ibx8L8BSYEdA4RA2i+o+NT7DWLOrn4GjI5iXR54Qe bM4sYouw+K0Ql4h1TWicTE5evmigkWyWsFoPGv0C26PFxAhMnFKj3PA1Ph3GVSVcG1mG fsRpcSzVO7fR3heTMoXiybwH4DTZ5fWEIlEp97yrOr2LdOXuewfqubeIqPXfEFjYmRWG ehfW/Z/XMCcvC//qSA6epsFUlO1bVvj34GVFb44xNI31kK0bfRM1sJFk47DhoZi5rX/4 L+Mw== 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=0p5Bzn7Xgzaat1XgA4C7ptosHFN9SjsV6gCfQiOgsDE=; b=lOYiQvpDHv1VYLmFo+ZVf4rk0hepsip223+86rkAlB/kE/cRCHmUU90wkkxm5xHjD2 xBRQ3nStjwdKOielIqqxKElOrt9zb7ek+eQo5FDJhwvAThLJkDeAiJXTZn3VIAZ8ie7X eU0TTLBvsRfRzmFZWrRAcjIpnrieueN97FWSR6kA6gdQa0y2RGxaLbMRNlH2eGov9Wu9 3kadGW7FQ/LBvdjbhj2x6KVUQQ2vi5k62HtqyXvuVQF9wUVIt9NfbXXenbKVekog93cy /ReEDtvh3MQjWrIfB73BvPUHzwvpMZBkpNx53An895vXXK9RBs9MDmPYjbc2tKyJdy8n T+Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FRSPT2X7; 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 a15si208968edr.48.2021.05.20.04.37.42; Thu, 20 May 2021 04:38:05 -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=FRSPT2X7; 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 S241237AbhETLg4 (ORCPT + 99 others); Thu, 20 May 2021 07:36:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:37104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239751AbhETLQ7 (ORCPT ); Thu, 20 May 2021 07:16:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D87826194E; Thu, 20 May 2021 10:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505364; bh=n+yVOn8ArjBE+m6x7z1F11aBR1x3/xZBgUpKtegzW9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FRSPT2X7yUflvujR2OLogcFv1dlcT9B43Mpriq8uKQldUQlN2l7hPKsPNbrP6tgxX FAsWkTFU1D/4Y42zWgJs4G9cm1ZaxSo1kL1Gf86IOBkz8YaQwtv2HEjofGBR4vaLRa k7Frd3Frp5WstboThq2F9kxZBeJRyja0rI8LN8cQ= 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 101/190] pata_ipx4xx_cf: fix IRQ check Date: Thu, 20 May 2021 11:22:45 +0200 Message-Id: <20210520092105.538064763@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 e379b40cc0f179403ce0b82b7e539f635a568da5 ] 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 errors upstream, and treat IRQ0 as error, returning -EINVAL, as the libata code treats 0 as an indication that polling should be used anyway... Fixes: 0df0d0a0ea9f ("[libata] ARM: add ixp4xx PATA driver") Signed-off-by: Sergey Shtylyov Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/ata/pata_ixp4xx_cf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index abda44183512..fb8d1f68f36f 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c @@ -169,8 +169,12 @@ static int ixp4xx_pata_probe(struct platform_device *pdev) return -ENOMEM; irq = platform_get_irq(pdev, 0); - if (irq) + if (irq > 0) irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING); + else if (irq < 0) + return irq; + else + return -EINVAL; /* Setup expansion bus chip selects */ *data->cs0_cfg = data->cs0_bits; -- 2.30.2