Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751630AbeAQEWK (ORCPT + 1 other); Tue, 16 Jan 2018 23:22:10 -0500 Received: from mail-vk0-f48.google.com ([209.85.213.48]:33673 "EHLO mail-vk0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750816AbeAQEWI (ORCPT ); Tue, 16 Jan 2018 23:22:08 -0500 X-Google-Smtp-Source: ACJfBovDcOvF73j9J/HYUgl6UWlKQBNBe8JqaxIyY8CdWTQzFxhDdZe2kAKikh9RpuAhRI2U3VMS4Q== MIME-Version: 1.0 In-Reply-To: <20180116132540.18939-2-jeffy.chen@rock-chips.com> References: <20180116132540.18939-1-jeffy.chen@rock-chips.com> <20180116132540.18939-2-jeffy.chen@rock-chips.com> From: Tomasz Figa Date: Wed, 17 Jan 2018 13:21:44 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 01/13] iommu/rockchip: Request irqs in rk_iommu_probe() To: Jeffy Chen Cc: linux-kernel@vger.kernel.org, Ricky Liang , Robin Murphy , simon xue , Heiko Stuebner , "open list:ARM/Rockchip SoC..." , "open list:IOMMU DRIVERS" , Joerg Roedel , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi Jeffy, Thanks for the patch. Please see my comments inline. On Tue, Jan 16, 2018 at 10:25 PM, Jeffy Chen wrote: Please add patch description. > Suggested-by: Robin Murphy > Signed-off-by: Jeffy Chen > --- [snip] > - for (i = 0; i < iommu->num_irq; i++) { > - iommu->irq[i] = platform_get_irq(pdev, i); > - if (iommu->irq[i] < 0) { > - dev_err(dev, "Failed to get IRQ, %d\n", iommu->irq[i]); > + num_irq = of_irq_count(dev->of_node); > + for (i = 0; i < num_irq; i++) { > + irq = platform_get_irq(pdev, i); This lacks consistency. of_irq_count() is used for counting, but platform_get_irq() is used for getting. Either platform_ or of_ API should be used for both and I'd lean for platform_, since it's more general. > + if (irq < 0) { > + dev_err(dev, "Failed to get IRQ, %d\n", irq); > return -ENXIO; > } > + err = devm_request_irq(iommu->dev, irq, rk_iommu_irq, > + IRQF_SHARED, dev_name(dev), iommu); > + if (err) > + return err; > } Looks like there is some more initialization below. Is the driver okay with the IRQ being potentially fired right here? (Shared IRQ handlers might be run at request_irq() time for testing.) > > iommu->reset_disabled = device_property_read_bool(dev, ^^ Best regards, Tomasz