Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp157862pxt; Thu, 5 Aug 2021 21:35:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlbishouKtGYWqjfJN2DDx4mW5Z6234hlRPE4wdiXXttcskAPeZLZSJi57L4qpVZhhnjnE X-Received: by 2002:a92:a010:: with SMTP id e16mr744494ili.138.1628224509449; Thu, 05 Aug 2021 21:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628224509; cv=none; d=google.com; s=arc-20160816; b=p4G+6GSW18wOn7useoVqpou8ak1Fw4UoH082pvnHF+z5WPCCZ3pmNHvu+KPS3UJxCg NvCzSdM2t2Q5SOtMKrt+JojMcTSoD93hdtTBBcWGRJmIkyL6NqUWClMwTMwbI4VDqg1H QxfqkL8RL3Ryezx/hI0ZdYdSe0wjxI4tQqMYvHfNgFYvPwvKZxYedpcPkLgA39AV3mjW Jd4KoW3xAZHyEXa0GZ48v4lKyDNmAO+4OIHUzchlEgqQCQD6szrdOYCx4HoqP9Glu0De nKLz/dNgGV/EpeAbaLhXzZnBkOdrLvpAxhqYHXuZq6wtY6QnNBRNxFBYQdx86cXwswFA dgUg== 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:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=6XarcnN44Xrmiuk3f9vcdwfGTFEC3ru9l27g86YwgG4=; b=CgW8+hpf9zF1dh0T2koC5J1vlelHdUcJAId+gxzdaRpgs7tQJgg58FsXkxEPmZ6+h5 n2bmpHDLSxFtG1/vC/sXmFs2nK7PxpwsHgKxa9enO8+HisnWhtoXZKvlaIetpmlfzsz6 +24SRbBkO111o0PtGLL9dNlBD/WrbCIYYoINzTFxHZC/flYy5fdLLGdVjOCTsmfDD+at c+hotZPatW+ltF/eLDoixWYEeWSyp1gAzcC7h+wuRrT63qwO1pLQ58/lmjB+PfMRKhEQ EhlJkmsgypd+nC5UJLr6H3JpURtF3XYO5228MVChY+H1e+kQ0bNQgPljWEFR449EE36Z WTZw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f10si9446938ila.58.2021.08.05.21.34.43; Thu, 05 Aug 2021 21:35:09 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232409AbhHEWED (ORCPT + 99 others); Thu, 5 Aug 2021 18:04:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229682AbhHEWEC (ORCPT ); Thu, 5 Aug 2021 18:04:02 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53554C0613D5; Thu, 5 Aug 2021 15:03:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 873A21F44331 Message-ID: <6761bb11f4554e9f9cbe468b5ff8f851c57515ef.camel@collabora.com> Subject: Re: [PATCH] media: hantro: Fix check for single irq From: Ezequiel Garcia To: Jernej Skrabec , p.zabel@pengutronix.de Cc: mchehab@kernel.org, gregkh@linuxfoundation.org, hverkuil-cisco@xs4all.nl, emil.velikov@collabora.com, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Date: Thu, 05 Aug 2021 19:03:36 -0300 In-Reply-To: <20210805190416.332563-1-jernej.skrabec@gmail.com> References: <20210805190416.332563-1-jernej.skrabec@gmail.com> Organization: Collabora Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jernej, On Thu, 2021-08-05 at 21:04 +0200, Jernej Skrabec wrote: > Some cores use only one interrupt and in such case interrupt name in DT > is not needed. Driver supposedly accounted that, but due to the wrong > field check it never worked. Fix that. > > Fixes: 18d6c8b7b4c9 ("media: hantro: add fallback handling for single irq/clk") > Signed-off-by: Jernej Skrabec > --- >  drivers/staging/media/hantro/hantro_drv.c | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c > index 8a2edd67f2c6..20e508158871 100644 > --- a/drivers/staging/media/hantro/hantro_drv.c > +++ b/drivers/staging/media/hantro/hantro_drv.c > @@ -919,7 +919,7 @@ static int hantro_probe(struct platform_device *pdev) >                 if (!vpu->variant->irqs[i].handler) >                         continue; >   > -               if (vpu->variant->num_clocks > 1) { > +               if (vpu->variant->num_irqs > 1) { Oops, thanks for spotting this. How about this instead? diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c index 31d8449ca1d2..af7054b04155 100644 --- a/drivers/staging/media/hantro/hantro_drv.c +++ b/drivers/staging/media/hantro/hantro_drv.c @@ -918,16 +918,15 @@ static int hantro_probe(struct platform_device *pdev) if (!vpu->variant->irqs[i].handler) continue; - if (vpu->variant->num_clocks > 1) { - irq_name = vpu->variant->irqs[i].name; - irq = platform_get_irq_byname(vpu->pdev, irq_name); - } else { + irq_name = vpu->variant->irqs[i].name; + irq = platform_get_irq_byname(vpu->pdev, irq_name); + if (irq <= 0) { /* - * If the driver has a single IRQ, chances are there - * will be no actual name in the DT bindings. + * Missing interrupt-names property in device tree, + * looking up interrupts by index. */ irq_name = "default"; - irq = platform_get_irq(vpu->pdev, 0); + irq = platform_get_irq(vpu->pdev, i); } if (irq <= 0) return -ENXIO; -- Kindly, Ezequiel