Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp403785imm; Wed, 11 Jul 2018 04:41:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpffCj/j0ngnHTPRVpUzXuj3CDPXTs2ftaYo8dt3B2edKu8RtobUDCH6Yn4CmAEGO6FXF3hH X-Received: by 2002:a17:902:6b09:: with SMTP id o9-v6mr27933355plk.256.1531309274242; Wed, 11 Jul 2018 04:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531309274; cv=none; d=google.com; s=arc-20160816; b=WPfN4IcxrtFdk1+wvYL3q/X83Du7fcvDcBqRIOyc361dmHJenk7tnv9F9jVJ34zoUQ RA1D11LR8+QEYqbq+aZd4fOSHDArec5GBhyY/bJhYOWO7su6yDQ+tTFKSA+N4e7fO0rO ipdbwJ2jYcgz49NH8dwlsbVK6K6s4FAU5grvwwBvmf0cPlD+0pIpfK6IvXzpnqKn4J6U aZCiN6JvClv7S4oT1CyQuIh3fDbeB8vx7Fcc/MhYhx8QKdiIAPu27elRNCAT7Sdgck6b qx616er2iYy4dOQ+akVPUBQ6/31bkVj+gvJ3JtUfYn0OKGJ3STrDVwDxWNK9vA9L/fKL l2EQ== 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 :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=/uoMqa+qvp1//HrVJ9XZy8u5iIj+bzy/OVoC42PzYT8=; b=GuAEKztouCU//860Zx88MLV8r+7i5t/hnynhDDMLppeaPuuGgkToMF2MRZzMIhFSS/ 1oULky/U5sYjTqRVreEZBE5wT8ycMXuvNCpDjrnxVtXCgUJA10zbUsOa5g8jyXyiuu89 N8UVSoQBidvKZi8hHmhMwz6fkJSAqwdqY999HvGFj3Hj6f637vRYSfbJGqJ/6443vju+ 3SSmekw4bxsoLqNcCPS53WLa9TE1Ld7uxpSpkUkODt/tzuzXlAjz/jKm6zXCToXKmUO6 cwWGCwqztklmaOMsan5H1sWrDgs96aBCj51ZWQbAxfO3qfaDQ9JQZU0sVm/l4ZR+d9hR GPBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=I3ozVhSi; 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 t25-v6si405067pgm.601.2018.07.11.04.40.58; Wed, 11 Jul 2018 04:41:14 -0700 (PDT) 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=I3ozVhSi; 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 S1732344AbeGKKIy (ORCPT + 99 others); Wed, 11 Jul 2018 06:08:54 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:33337 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbeGKKIy (ORCPT ); Wed, 11 Jul 2018 06:08:54 -0400 Received: by mail-yw0-f193.google.com with SMTP id c135-v6so8931984ywa.0 for ; Wed, 11 Jul 2018 03:05:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/uoMqa+qvp1//HrVJ9XZy8u5iIj+bzy/OVoC42PzYT8=; b=I3ozVhSiqgpYIQChkDeoKad6cwkbgRjaI0+h7WW0hkQ4xhhqp37V2rAzvYVP4CchYw jMIgjHeHF/rb6LnRsByi9T6Bf1KgL45Qt8nTkkDRGf3akZlQt8qWw/qX44jumRL7HmJ6 zx06LwZgI3NB8pm01YxH/qFj3SOuxPaF/umHs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/uoMqa+qvp1//HrVJ9XZy8u5iIj+bzy/OVoC42PzYT8=; b=Jl+4Cp9GksIqzqs2Oqq6Sd+adojXCCAF2ptGXoEcllvF0uC6+YTTx/p+1wcYoKEi98 89BleUK/xZ+nKDp01wCB3836H8vY4Wjjk4OU+clj0JAHpLeEgeq9Vittzy5AgzNGdsfG yJgd7w8M1ybD6yy+X2CZAg9Qw987ZjDUQ3fgTc2Q/syJPXyaGx43+aYZuOna96Z/1sFC GOFmErZdP3WgSMVi1f8uP2ofIq0r0Tuz6kC+dUUR5E3ElIFNMQb4e3k+qk7SlIPsR9ct dqzSaItWrf2g3aEujKtidMBGuVbTeiNr+w8icZFCj0LEAsF/8KtAzokJyiUKXVU7DSN4 NuuQ== X-Gm-Message-State: APt69E1Blskm8Z4Xa6pK6stRw0+JEnmn7feMByBKY8AaN3GsL/KIPSnc 1hU70UqnkvlBtG7n643fZsiKQf0paqA= X-Received: by 2002:a81:2881:: with SMTP id o123-v6mr14002509ywo.6.1531303520701; Wed, 11 Jul 2018 03:05:20 -0700 (PDT) Received: from mail-yb0-f182.google.com (mail-yb0-f182.google.com. [209.85.213.182]) by smtp.gmail.com with ESMTPSA id c74-v6sm12507551ywh.17.2018.07.11.03.05.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 03:05:18 -0700 (PDT) Received: by mail-yb0-f182.google.com with SMTP id r3-v6so9781947ybo.4 for ; Wed, 11 Jul 2018 03:05:17 -0700 (PDT) X-Received: by 2002:a25:207:: with SMTP id 7-v6mr14786222ybc.7.1531303517505; Wed, 11 Jul 2018 03:05:17 -0700 (PDT) MIME-Version: 1.0 References: <20180708173413.1965-1-vivek.gautam@codeaurora.org> <20180708173413.1965-3-vivek.gautam@codeaurora.org> <1694664.FhRBrgajmF@aspire.rjw.lan> In-Reply-To: <1694664.FhRBrgajmF@aspire.rjw.lan> From: Tomasz Figa Date: Wed, 11 Jul 2018 19:05:06 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v12 2/4] iommu/arm-smmu: Invoke pm_runtime during probe, add/remove device To: "Rafael J. Wysocki" Cc: Vivek Gautam , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Rob Herring , Mark Rutland , Robin Murphy , Will Deacon , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , devicetree@vger.kernel.org, Linux Kernel Mailing List , Alex Williamson , Rob Clark , Linux PM , freedreno , sboyd@kernel.org, Sricharan R , Marek Szyprowski , Archit Taneja , linux-arm-msm , jcrouse@codeaurora.org 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 Hi Rafael, Thanks for review. On Wed, Jul 11, 2018 at 6:53 PM Rafael J. Wysocki wrote: > > On Sunday, July 8, 2018 7:34:11 PM CEST 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 > > Reviewed-by: Tomasz Figa > > --- > > > > - Change since v11 > > * Replaced pm_runtime_disable() with pm_runtime_force_suspend() > > to avoid warning about " Unpreparing enabled clock". > > Full warning text mentioned in cover patch. > > > > drivers/iommu/arm-smmu.c | 92 +++++++++++++++++++++++++++++++++++++++++++----- > > 1 file changed, 84 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c > > index a01d0dde21dd..09265e206e2d 100644 > > --- a/drivers/iommu/arm-smmu.c > > +++ b/drivers/iommu/arm-smmu.c > > @@ -268,6 +268,20 @@ static struct arm_smmu_option_prop arm_smmu_options[] = { > > { 0, NULL}, > > }; > > > > +static inline int arm_smmu_rpm_get(struct arm_smmu_device *smmu) > > +{ > > + if (pm_runtime_enabled(smmu->dev)) > > Why do you need the pm_runtime_enabled() checks here and below? > > pm_runtime_get_sync() and pm_runtime_put() should work just fine if > runtime PM is not enabled. Because pm_runtime_get_sync() acquires a spin lock, even if only for the short time of checking if runtime PM is enabled and SMMU driver maintainers didn't want any spin locks in certain IOMMU API code paths on hardware implementations that don't need runtime PM, while we still need to be able to control runtime PM there on hardware implementations that need so. Best regards, Tomasz