Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5643042imu; Mon, 26 Nov 2018 03:25:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wo1y4YQFwfO4CTRjfDX10Fvj75Bi2SYcTZc5cn5CfyJWqTeSMwrAlU9v+L6kGH2/uHKbZx X-Received: by 2002:a17:902:7107:: with SMTP id a7mr27021692pll.290.1543231543160; Mon, 26 Nov 2018 03:25:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543231543; cv=none; d=google.com; s=arc-20160816; b=jisZ4QUtwW0GDNau2XHT1Coshs0ljn+CZsJybyQFEnXC8PfGU1d0puF3ujSk/BMKEd cWBbXnguySJQIiC2xayYfEk8Vo4NZmT+KAjtwrHfxRSVcGgzQE/i6cmgHAUjKxIT0S6T L6ReUrNMSVm7y4KbFUZ7t6UIzc3QI2SNAplPYl90Q/JyXovgTRY3Q4DIcTQHHomuKjJJ qfD/Qk5CYs40mSgdE9tXSVXFhVFrZRFl6JxskAn0sHx7gVWdXe0g9P5+7XjVnV0fPcy4 FbB9CEnh0CEid9NV0jFqE3Xg8X9q9RG1tr58fPvKP0wGWLkCyCqua/PPvKGlnyUuX8FK xxhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=qkPpDKzfqPySov8JZHVitP9ke34WfELW6hpLb1nryCI=; b=ljWyzdlfY860fs2ycx5g95ike13cdIj3U8uunVPZ8YNn7c+tVio0DsZqD0oNx6F7nN 7jIYl2z35BZKY4Kk6voqT9hmqUOLTNQ0wNXmY7MxgkWH6Bcmsag+9domVQyh4+1oUPsF RgZpE2POxpYCLmKClDsm8FZToHinU4Ie4BlOqGeY8v2fvOhp0sBNTVu09FsglxFIsDly vZAijjOU65SvA0yviLc+ap0IZUxd84oMFJgMhX229RAHLVHB2dE+gKRA0QTRNVBKBsIz g3F99u2QHm2g8E7jf+NWxUA+QVXxJTj4mPjHZuxLNUpQxWbycLUdDrXmVmZcyx1v8wfJ UfXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=SS9E6cLD; dkim=pass header.i=@codeaurora.org header.s=default header.b=F9d1wR3E; 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 u5si26535plj.129.2018.11.26.03.25.19; Mon, 26 Nov 2018 03:25:43 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=SS9E6cLD; dkim=pass header.i=@codeaurora.org header.s=default header.b=F9d1wR3E; 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 S1727880AbeKZWRo (ORCPT + 99 others); Mon, 26 Nov 2018 17:17:44 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:41904 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727144AbeKZVtc (ORCPT ); Mon, 26 Nov 2018 16:49:32 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4437760BE8; Mon, 26 Nov 2018 10:55:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1543229747; bh=GB/kJloFxJ9BpSF1SfDzU6pafBMfaxJSFy4IsRKHEkU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=SS9E6cLDBZoYhiBpyLRiCTgty5Zf663NqqYiRENbGQah7X83A1Prua9wk1ZapGMNa f9jkWTMqqqWZsi9GQueJJftC0IQp/KOOFuNE6FKvPaFFm6UymvrIB77hqJQ1UAYwLL PAXfIuYpYVz7V4J6oqEuO48lbwY3NJmHdywBu1pw= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.79.40.201] (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vivek.gautam@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 86BB2609A8; Mon, 26 Nov 2018 10:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1543229743; bh=GB/kJloFxJ9BpSF1SfDzU6pafBMfaxJSFy4IsRKHEkU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=F9d1wR3EVM7evWFMuh/20OftIFj6tdmIYgZ1ndxr1NtIYS889KSPo19iYpbjYoFBF kdAMqGYLFso0NlpceuM4DG+/XPY6H8IP2EQcwZzTjN6PEle80R0frRTunFsQG/+Q+g p+iyEwCDTpxNBR4P/FMEXV0AIOgwcQIv9/LURC5s= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 86BB2609A8 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vivek.gautam@codeaurora.org Subject: Re: [RESEND PATCH v17 5/5] iommu/arm-smmu: Add support for qcom,smmu-v2 variant To: Will Deacon , thor.thayer@linux.intel.com Cc: Tomasz Figa , Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux PM , sboyd@kernel.org, linux-arm-msm , "Rafael J. Wysocki" , open list , "list@263.net:IOMMU DRIVERS" , Joerg Roedel , iommu@lists.linux-foundation.org, alex.williamson@redhat.com, robh+dt , freedreno , Robin Murphy References: <20181116112430.31248-1-vivek.gautam@codeaurora.org> <20181116112430.31248-6-vivek.gautam@codeaurora.org> <20181121173803.GB9801@arm.com> <20181123183428.GD21183@arm.com> From: Vivek Gautam Message-ID: <30fd45b5-50f0-7f2f-aab3-adc4528d21a8@codeaurora.org> Date: Mon, 26 Nov 2018 16:25:35 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181123183428.GD21183@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/24/2018 12:04 AM, Will Deacon wrote: > On Fri, Nov 23, 2018 at 03:06:29PM +0530, Vivek Gautam wrote: >> On Fri, Nov 23, 2018 at 2:52 PM Tomasz Figa wrote: >>> On Fri, Nov 23, 2018 at 6:13 PM Vivek Gautam >>> wrote: >>>> On Wed, Nov 21, 2018 at 11:09 PM Will Deacon wrote: >>>>> On Fri, Nov 16, 2018 at 04:54:30PM +0530, Vivek Gautam wrote: >>>>>> @@ -2026,6 +2027,17 @@ ARM_SMMU_MATCH_DATA(arm_mmu401, ARM_SMMU_V1_64K, GENERIC_SMMU); >>>>>> ARM_SMMU_MATCH_DATA(arm_mmu500, ARM_SMMU_V2, ARM_MMU500); >>>>>> ARM_SMMU_MATCH_DATA(cavium_smmuv2, ARM_SMMU_V2, CAVIUM_SMMUV2); >>>>>> >>>>>> +static const char * const qcom_smmuv2_clks[] = { >>>>>> + "bus", "iface", >>>>>> +}; >>>>>> + >>>>>> +static const struct arm_smmu_match_data qcom_smmuv2 = { >>>>>> + .version = ARM_SMMU_V2, >>>>>> + .model = QCOM_SMMUV2, >>>>>> + .clks = qcom_smmuv2_clks, >>>>>> + .num_clks = ARRAY_SIZE(qcom_smmuv2_clks), >>>>>> +}; >>>>> These seems redundant if we go down the route proposed by Thor, where we >>>>> just pull all of the clocks out of the device-tree. In which case, why >>>>> do we need this match_data at all? >>>> Which is better? Driver relying solely on the device tree to tell >>>> which all clocks >>>> are required to be enabled, >>>> or, the driver deciding itself based on the platform's match data, >>>> that it should >>>> have X, Y, & Z clocks that should be supplied from the device tree. >>> The former would simplify the driver, but would also make it >>> impossible to spot mistakes in DT, which would ultimately surface out >>> as very hard to debug bugs (likely complete system lockups). >> Thanks. >> Yea, this is how I understand things presently. Relying on device tree >> puts the things out of driver's control. > But it also has the undesirable effect of having to update the driver > code whenever we want to add support for a new SMMU implementation. If > we do this all in the DT, as Thor is trying to do, then older kernels > will work well with new hardware. > >> Hi Will, >> Am I unable to understand the intentions here for Thor's clock-fetch >> design change? > I'm having trouble parsing your question, sorry. Please work with Thor > so that we have a single way to get the clock information. My preference > is to take it from the firmware, for the reason I stated above. Hi Will, Sure, thanks. I will work with Thor to get this going. Hi Thor, Does it sound okay to you to squash your patch [1] into my patch [2] with your 'Signed-off-by' tag? I will update the commit log to include the information about getting clock details from device tree. [1] https://patchwork.kernel.org/patch/10628725/ [2] https://patchwork.kernel.org/patch/10686061/ Best regards Vivek > > Will