From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752706AbcHQI6K (ORCPT ); Wed, 17 Aug 2016 04:58:10 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:31612 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751802AbcHQI6H (ORCPT ); Wed, 17 Aug 2016 04:58:07 -0400 Subject: Re: [PATCH V8 5/8] irqchip/gicv3-its: Refactor ITS DT init code to prepare for ACPI To: Tomasz Nowicki , , , , , , , References: <1470909998-16710-1-git-send-email-tn@semihalf.com> <1470909998-16710-6-git-send-email-tn@semihalf.com> CC: , , , , , , , , , , , , , , , From: Hanjun Guo Message-ID: <57B4213E.3060201@huawei.com> Date: Wed, 17 Aug 2016 16:33:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1470909998-16710-6-git-send-email-tn@semihalf.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.17.188] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0207.57B4214A.0171,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: ba847316e49c589da0d7e83390b3dfee Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/8/11 18:06, Tomasz Nowicki wrote: > In order to add ACPI support we need to isolate ACPI&DT common code and > move DT logic to corresponding functions. To achieve this we are using > firmware agnostic handle which can be unpacked to either DT or ACPI node. > > No functional changes other than a very minor one: > 1. Terminate its_init call with -ENODEV for non-DT case which allows > to remove hack from its-gic-v3.c. > 2. Fix ITS base register address type (from 'unsigned long' to 'phys_addr_t'), > as a bonus we get nice string formatting. > 3. Since there is only one of ITS parent domain convert it to static global > variable and drop the parameter from its_probe_one. Users can refer to it > in more convenient way then. [...] > -static int __init its_probe(struct device_node *node, > - struct irq_domain *parent) > +static int __init its_probe_one(struct resource *res, > + struct fwnode_handle *handle, int numa_node) > { > - struct resource res; > struct its_node *its; > void __iomem *its_base; > u32 val; > u64 baser, tmp; > int err; > > - err = of_address_to_resource(node, 0, &res); > - if (err) { > - pr_warn("%s: no regs?\n", node->full_name); > - return -ENXIO; > - } > - > - its_base = ioremap(res.start, resource_size(&res)); > + its_base = ioremap(res->start, resource_size(res)); > if (!its_base) { > - pr_warn("%s: unable to map registers\n", node->full_name); > + pr_warn("ITS@%pa: Unable to map ITS registers\n", &res->start); > return -ENOMEM; > } > > val = readl_relaxed(its_base + GITS_PIDR2) & GIC_PIDR2_ARCH_MASK; > if (val != 0x30 && val != 0x40) { > - pr_warn("%s: no ITS detected, giving up\n", node->full_name); > + pr_warn("ITS@%pa: No ITS detected, giving up\n", &res->start); > err = -ENODEV; > goto out_unmap; > } > > err = its_force_quiescent(its_base); > if (err) { > - pr_warn("%s: failed to quiesce, giving up\n", > - node->full_name); > + pr_warn("ITS@%pa: Failed to quiesce, giving up\n", &res->start); > goto out_unmap; > } > > - pr_info("ITS: %s\n", node->full_name); > + pr_info("ITS@%pa\n", &res->start); ^^ When I was testing this patch set I found message printed as below: [ 0.000000] ITS@0x00000000c6000000 [ 0.000000] ITS@0x00000000c6000000: allocated 524288 Devices @27dc400000 (flat, esz 8, psz 16K, shr 1) [ 0.000000] ITS@0x00000000c6000000: allocated 2048 Virtual CPUs @27dc820000 (flat, esz 8, psz 4K, shr 1) [ 0.000000] ITS@0x00000000c6000000: allocated 512 Interrupt Collections @27dc80f000 (flat, esz 8, psz 4K, shr 1) Seems this print is redundant, can we remove it? Thanks Hanjun