Received: by 10.223.176.5 with SMTP id f5csp1340186wra; Wed, 31 Jan 2018 05:06:19 -0800 (PST) X-Google-Smtp-Source: AH8x227fcNH80ecxIdOi+5ECM0kvRq777iRIRZu4DBxhCAHJbdyzvsoslQQGNkQaUURHeAZTW1uY X-Received: by 2002:a17:902:8f86:: with SMTP id z6-v6mr28532625plo.352.1517403978903; Wed, 31 Jan 2018 05:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517403978; cv=none; d=google.com; s=arc-20160816; b=nc5XYohfmNDiRaPA+qc0iIOV/lbaSgtV57a+rtw4cV/1MC37pgbfJDiv20Hv7S0dCe LY3RdsnwjJKXbYrMh1+w8LIf3D6y34+YGgGmkrhN46V/V34adMFNfOcpR8V5Pqz8g+/t +BCOCLSVhkJjBYtUWYbKLqUk+d5e3tgRKILqiLHJfrlVa/QRjUFlLcw0ucEsKFkdjJOO yJl/4VMjSkifmEcgBMEdO/rxLoylAh/MIOtzCAvgwbtxjqbZfHWNGH+tOzk+l1o9ViM9 JwG1gHTffynLbVaMzrduVrc0Mxyi86Rjq7Va4SKESjhEMqcYCbcrOORKeHTtXZzAAmYF v8Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=gJ7dzTpgaowCuYov1IyUuEXU6ySfHkJFxYXaNcdbwEc=; b=gYCdyYBdoOLrBXzOvoKLNBTOo+6zajon/WNE3dPDyt9cui9ByMK/ZEfZGbuWrZblsI 2vf+MTKW7ijh05OP2cwHga9AdMPUe3mSDS+KcrrIBXXR4PbREPkWNp49/GcCAkz5PWMx 2TKoaEpEBWm8ZELq/ZNN4tXYYxkDYJGJeJpIBOtCdM1XpZL4mf5oOoEch+eyuiBRsYfH sVNMmhpMUZNtD7nKD9Xbn0Cp8WzrD4PZXOT2qvgyLdMs1oBQFclpvyE6x1gedzSDvuMX ZMMOkjCZMZ8NFpiBBYVC0hr685llv/CsCP/GJ53uRke3dprl1oNd8GP5GdAdIBch1IUE zVug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si5762870pgq.11.2018.01.31.05.06.03; Wed, 31 Jan 2018 05:06:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752543AbeAaMeo (ORCPT + 99 others); Wed, 31 Jan 2018 07:34:44 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37544 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751662AbeAaMem (ORCPT ); Wed, 31 Jan 2018 07:34:42 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 54A8C80D; Wed, 31 Jan 2018 04:34:42 -0800 (PST) Received: from e107981-ln.cambridge.arm.com (e107981-ln.cambridge.arm.com [10.1.207.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3B3E13F487; Wed, 31 Jan 2018 04:34:40 -0800 (PST) Date: Wed, 31 Jan 2018 12:34:34 +0000 From: Lorenzo Pieralisi To: Shameerali Kolothum Thodi Cc: Neil Leeder , Mark Langsdorf , Jon Masters , Timur Tabi , "linux-kernel@vger.kernel.org" , Mark Brown , Mark Salter , "linux-arm-kernel@lists.infradead.org" , Will Deacon , Mark Rutland , Linuxarm Subject: Re: [PATCH 1/2] acpi: arm64: add iort support for PMCG Message-ID: <20180131123434.GA933@e107981-ln.cambridge.arm.com> References: <1501876754-1064-1-git-send-email-nleeder@codeaurora.org> <1501876754-1064-2-git-send-email-nleeder@codeaurora.org> <5FC3163CFD30C246ABAA99954A238FA8386400F7@FRAEML521-MBX.china.huawei.com> <20180130180013.GA16154@e107981-ln.cambridge.arm.com> <5FC3163CFD30C246ABAA99954A238FA838641882@FRAEML521-MBX.china.huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5FC3163CFD30C246ABAA99954A238FA838641882@FRAEML521-MBX.china.huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 31, 2018 at 12:10:47PM +0000, Shameerali Kolothum Thodi wrote: [...] > > I went back and re-read the patches, I think the point here is that the > > perf driver (ie PATCH 2 that, by the way, is not maiinline) uses > > devm_ioremap_resource() to map the counters and that's what is causing > > failures when PMCG is part of SMMUv3 registers. > > Thanks for going through this. No, this is not where we are seeing the failure. > May be I was not clear in my earlier mail. The failure happens in SMMUv3 > driver probe function when it calls devm_ioremap_resource(). Understood - because the PMU PMCG driver calls it first, that's what I was referring to. My point is that: - the PMCG platform device resources should be built with the correct resource hierarchy - and even then, I do not think that using devm_ioremap_resource() in the PMCG PMU driver is the correct way of handling its resource reservation (ie the kernel must be able to detect that a resource is contained in a parent one but I am not sure devm_ioremap_resource() is the way to handle this correctly) > > It is the resources hierarchy that is wrong and in turn, I do not think > > devm_request_mem_region() is the right way of requesting it for the > > PMCG driver. > > > > I need to look into this but I suspect that's something that should > > be handled in the PMCG driver, that has to request the memory region > > _differently_ (ie ioremap copes with this overlap - it is the > > devm_request_mem_region() in devm_ioremap_resource() that fails, correct > > ?). > > It looks like, in IORT code, > > iort_add_platform_device()--> platform_device_add()-->insert_resource(), inserts > both SMMUv3 and PMCG resources into the resource tree and then when the probe > of SMMUv3 is called, it detects the conflict. > > [ 85.548749] arm-smmu-v3 arm-smmu-v3.0.auto: can't request region for resource [mem 0x148000000-0x14801ffff] > > Of course, changing devm_ioremap_resource() to devm_ioremap() in SMMv3 > driver probe solves the issue for us, but not sure that's the right approach or not. See above. Lorenzo