Received: by 10.223.185.116 with SMTP id b49csp5062179wrg; Wed, 7 Mar 2018 05:54:28 -0800 (PST) X-Google-Smtp-Source: AG47ELujZ4PoVOPUfq7OazmDKlsLkMcDXGfaAMtnI6qG6wGnwkb6jhAnSIUB7rmJwnD8YFzztGgF X-Received: by 10.98.229.21 with SMTP id n21mr22491632pff.158.1520430868119; Wed, 07 Mar 2018 05:54:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520430868; cv=none; d=google.com; s=arc-20160816; b=NjcXqZ9pe9ElNVjbbI8WnsqUM9keJl2WBaiDMdJC13M/zKFlgDNdxyeYXgP9cAvFXQ RApvDC0iaJJ4xB2dGmOuaFJFs8SAUlfJxEonJU4a28zPIBahZA6AnCii1WmGJHITb19Z 1gReV6xqiSB0l26+ZaPAy8hRjya2G56YBBy9vmhe5lQ2EjjpNNCz4UrUy9tpLw14UGI8 l7sE1IM0ahK19RohW9SdpJr3extn/gIpBt+a1fgrESVLjzOE+LGcDBxv07crP9VBHQTT P4hvAj1ES9B1o9+XQPMp5rfN+WachkF2KeFZxtoJRBNCQ8r7bD8XVSUpS2hpwO52wAd7 Moow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=cWC+Ezk+rnDZxnTDwXzLb/Y3TBy3dra8mjSYK3bQkvw=; b=imzVcoLAcgsDtZ+OQLswkJNZHpaDpvORAljIEwNE4EHggc1FX4pC5wxwJEfCTWXCgw uMd2anbvCezv00KtUKsOerH5f4OprAKOjOoMlSnayXZOhNMpu+VIpqGtNbrCb3vZDzaw IDbRVwPP5IWIWpdwDwzZv2a8thxjp28dfF7UyfC4UZiSyvgq0Y+IRSDyatlncDUklHei mcp5wwl2OMgIMIETvXk9DWTeAjykCV2Yj9AJs6L2oYcDJMItzJFJ2iUtmzCwIORtjzkD jQVjExuGC18LsZuMrHuwK1aQyQKWMSeaG3RzZ4Npue+5KFikgW67H+JKREj2lpxg9OOX qy4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nuO2f7I7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r64si13914765pfd.303.2018.03.07.05.54.13; Wed, 07 Mar 2018 05:54:28 -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=@chromium.org header.s=google header.b=nuO2f7I7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754280AbeCGNwv (ORCPT + 99 others); Wed, 7 Mar 2018 08:52:51 -0500 Received: from mail-ua0-f196.google.com ([209.85.217.196]:41760 "EHLO mail-ua0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159AbeCGNwr (ORCPT ); Wed, 7 Mar 2018 08:52:47 -0500 Received: by mail-ua0-f196.google.com with SMTP id u99so1425420uau.8 for ; Wed, 07 Mar 2018 05:52:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cWC+Ezk+rnDZxnTDwXzLb/Y3TBy3dra8mjSYK3bQkvw=; b=nuO2f7I7ygwBkb19yYPsskxu/Ptbmw7ZZO3ESHnK9aG/Gz7WnOb9gggz0Zlyt2dTRx ULwfMk1k9ACP+d5K4xNyqxqpng7BLkm9Y94r+3kNGuMKyRlkRSDW/szhdOj/+tv2qTOT A3DcmO8YtAKx6s4IGDEflJTKkZR+CAWfIBmL8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cWC+Ezk+rnDZxnTDwXzLb/Y3TBy3dra8mjSYK3bQkvw=; b=LYLWCyhJ7Oef3EjHY1kFQyEntCzveiKMorxQnqO9V+bM3M7eVUjA4gR4EPfbVEzQ8l r3sYVS9XsIYiINFmaAtYMk9Q248qOmcZM8t1RDnFJksnBWTOoVvoP0JtK5wvyHROWZ8u so/Wz+NLbhKLmbCd8ceNSyrhgTBIOgtRP/qh8HAbCIawMlMos0ouyDccoXVMW08GDlif c2H/tYWVVp8As6vpxW4IqdzKf/am1/XsRYTPClm3e3Rru3AmqkwCspxikOZqh5LdBjTi FdA52RD4a6G9J5xh7y5wNv+KsLquIsieynb6gh8QtXKsThLUyIsQObkCVF8LMynnIGRl kP6w== X-Gm-Message-State: AElRT7HOv2NkAn4+KIrRRVCX1MA+JzJrM3S7YZnENeZ3alUs7tqr93Gg RMe9XMoa3Wgl+wBIjIyA2wrryTNpEU8= X-Received: by 10.176.36.136 with SMTP id i8mr1179662uan.65.1520430765768; Wed, 07 Mar 2018 05:52:45 -0800 (PST) Received: from mail-vk0-f54.google.com (mail-vk0-f54.google.com. [209.85.213.54]) by smtp.gmail.com with ESMTPSA id 5sm12286184vkl.4.2018.03.07.05.52.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 05:52:44 -0800 (PST) Received: by mail-vk0-f54.google.com with SMTP id z130so1336174vkd.0 for ; Wed, 07 Mar 2018 05:52:43 -0800 (PST) X-Received: by 10.31.102.70 with SMTP id a67mr15734983vkc.176.1520430762620; Wed, 07 Mar 2018 05:52:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.0.99 with HTTP; Wed, 7 Mar 2018 05:52:22 -0800 (PST) In-Reply-To: References: <20180302101050.6191-1-vivek.gautam@codeaurora.org> <20180302101050.6191-4-vivek.gautam@codeaurora.org> From: Tomasz Figa Date: Wed, 7 Mar 2018 22:52:22 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 3/5] iommu/arm-smmu: Invoke pm_runtime during probe, add/remove device To: Robin Murphy Cc: Vivek Gautam , Joerg Roedel , Rob Herring , Mark Rutland , "Rafael J. Wysocki" , Will Deacon , Rob Clark , "open list:IOMMU DRIVERS" , devicetree@vger.kernel.org, Linux Kernel Mailing List , jcrouse@codeaurora.org, Stephen Boyd , Sricharan R , Marek Szyprowski , Archit Taneja , linux-arm-msm Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 7, 2018 at 9:38 PM, Robin Murphy wrote: > On 02/03/18 10:10, Vivek Gautam wrote: >> >> From: Sricharan R >> >> The smmu device probe/remove and add/remove master device callbacks >> gets called when the smmu is not linked to its master, that is without >> the context of the master device. So calling runtime apis in those places >> separately. >> >> Signed-off-by: Sricharan R >> [vivek: Cleanup pm runtime calls] >> Signed-off-by: Vivek Gautam >> --- >> drivers/iommu/arm-smmu.c | 96 >> ++++++++++++++++++++++++++++++++++++++++++++---- >> 1 file changed, 88 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c >> index c8b16f53f597..3d6a1875431f 100644 >> --- a/drivers/iommu/arm-smmu.c >> +++ b/drivers/iommu/arm-smmu.c >> @@ -209,6 +209,8 @@ struct arm_smmu_device { >> struct clk_bulk_data *clks; >> int num_clks; >> + bool rpm_supported; >> + > > > Can we not automatically infer this from whether clocks and/or power domains > are specified or not, then just use pm_runtime_enabled() as the fast-path > check as Tomasz originally proposed? I wouldn't tie this to presence of clocks, since as a next step we would want to actually control the clocks separately. (As far as I understand, on QCom SoCs we might want to have runtime PM active for the translation to work, but clocks gated whenever access to SMMU registers is not needed.) Moreover, you might still have some super high scale thousand-core systems that require clocks to be prepare-enabled, but runtime PM would be undesirable for the reasons we discussed before. > > I worry that relying on statically-defined matchdata is just going to blow > up the driver and DT binding into a maintenance nightmare; I really don't > want to start needing separate definitions for e.g. "arm,juno-etr-mmu-401" > and "arm,juno-hdlcd-mmu-401" just because one otherwise-identical instance > within the SoC is in a separate controllable power domain while the others > aren't. I don't see a reason why both couldn't just have RPM supported regardless of whether there is a real power domain. It would effectively be just a no-op for those that don't have one. IMHO the only reason to avoid having the RPM enabled is the scalability issue we discussed before. Best regards, Tomasz