Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2707983pxv; Sun, 11 Jul 2021 23:23:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXVmabAokUDlahvATe5d0O/TjBnymMBpBiKqu1M0FWcGuuGT23AcJ+xcJKuzUsi2B9yi49 X-Received: by 2002:a05:6638:2593:: with SMTP id s19mr42811155jat.11.1626070980514; Sun, 11 Jul 2021 23:23:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626070980; cv=none; d=google.com; s=arc-20160816; b=IyZ/Bm0twojBIGJnVHyJV3cuP26upT6UPtDfcbxKCUhsnx+wlLGP2q6VTlOQJ/9ajV 6MYCnn8vC1//8iq4iEBwmlAB6zMlGfDmGMcd6XitF4DOcevutWWDbGMO6YdBgzOg3gTe fDxNfQrVFSrC7/iw5dhID6JXkJhT6p8mtdsiZ4e7pYNjVcmvyPkAJOn+7u+abts4l8YP /ZjGdpkMV3slc20vAEejb9ivFZtkI5IJr7b+xswD1q6hilOpynIhLtnidda3sXiUEtgY 1I1+g50de/SAZyJuoS7gy+5KzaDu73siocoSmsoKWT++YTvPaj17c+twZA8k3gon6G6a GqbA== 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=1s9qRw+324Z7pxScUdUYRKtRSC8Ldg4ShsjRXfNUdgo=; b=ETSoG8R+iJLCu8ctrRvRVvdaP53HKv/QJ0VTpypZtTIKVBOfYTkgzX/zgWze1s2LSr CBeoe7sYPeTE2yDHb4xBTWWWc2rPdxNJbMdcUbTQZ8sJff+5/BqTUgOxWLYUwyowfDZp hycl5xAiXNKl7aYsI3xK//BAOf0IyyiaLjxJ/6OjTa8NZrSI+B/d8secUIDAXiEdwvcg TR3/CNuchpcMhjXfBoMLJTW+xZALWDWtU9Zi7AZpL8SO6nrEiCEt9UckxAi0UdtljNaZ yGgEiwT0PgL5ghTbOXTIxu2bVV/zvUhDCWJ288z1c3J/KGwEuWoXiJ1yHIqR+xYakfPc 4XRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BJyDZxLL; 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 g3si16141206ilc.117.2021.07.11.23.22.48; Sun, 11 Jul 2021 23:23:00 -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=BJyDZxLL; 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 S233767AbhGLGZE (ORCPT + 99 others); Mon, 12 Jul 2021 02:25:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:39960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234653AbhGLGX1 (ORCPT ); Mon, 12 Jul 2021 02:23:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2026661107; Mon, 12 Jul 2021 06:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626070808; bh=fAySR2GxltjBMCs0mwVQzIM8EBH+3hm24OaJlIaGlVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BJyDZxLLOofz2zNVIOzTylqDStEHwSLKfdKbe2dtu2UZFbfBb+Kee6vUnF5LavxXd om/06qKn646iZkKvYmK3MCUA14nrvKKKNe3hyJ9gxmhWce5gHTPKTQpWU7RA725TwO +IfdO/yd++Ed3aAnwuC6NsTILOsMMS8w0xgBfYHU= 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.4 148/348] pata_octeon_cf: avoid WARN_ON() in ata_host_activate() Date: Mon, 12 Jul 2021 08:08:52 +0200 Message-Id: <20210712060720.733179035@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060659.886176320@linuxfoundation.org> References: <20210712060659.886176320@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 bfc1f378c8953e68ccdbfe0a8c20748427488b80 ] Iff platform_get_irq() fails (or returns IRQ0) and thus the polling mode has to be used, ata_host_activate() hits the WARN_ON() due to 'irq_handler' parameter being non-NULL if the polling mode is selected. Let's only set the pointer to the driver's IRQ handler if platform_get_irq() returns a valid IRQ # -- this should avoid the unnecessary WARN_ON()... Fixes: 43f01da0f279 ("MIPS/OCTEON/ata: Convert pata_octeon_cf.c to use device tree.") Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/3a241167-f84d-1d25-5b9b-be910afbe666@omp.ru Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/ata/pata_octeon_cf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c index d3d851b014a3..ac3b1fda820f 100644 --- a/drivers/ata/pata_octeon_cf.c +++ b/drivers/ata/pata_octeon_cf.c @@ -898,10 +898,11 @@ static int octeon_cf_probe(struct platform_device *pdev) return -EINVAL; } - irq_handler = octeon_cf_interrupt; i = platform_get_irq(dma_dev, 0); - if (i > 0) + if (i > 0) { irq = i; + irq_handler = octeon_cf_interrupt; + } } of_node_put(dma_node); } -- 2.30.2