Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4703535imm; Mon, 17 Sep 2018 20:12:57 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYN+oveC2ARckFIfpeK529b0lE3aRD7DqVG+yrJnFBdetvJOAA536AV5xZP092MrLxzDaF6 X-Received: by 2002:a63:2fc6:: with SMTP id v189-v6mr25837651pgv.61.1537240377497; Mon, 17 Sep 2018 20:12:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537240377; cv=none; d=google.com; s=arc-20160816; b=AT7TIXDSyDVlu7vbYMuziATNjntI2Su5Oo4LIFs4sun0NnqWQF5j3+F24fnejON1yS WDs7XvJl6DPI4lf3iOsB3T+KXiSViX0oscUz4gm4ClLSmFVYNeMbSTOY3he2GP0QcA4P OsXY1eNwVNYk7hnrmWY4F8rHZ83J4eLHhyHh93BTU2bEzMG9fcbMRAxe+NfGnrcB633h 6qzYazyGoDVAIl7KEU5cSrRkmTlgGP3oSMhsQZCV2lvc5DpjoUnqc6TxuOUeA6Fjsvgn K98sX+v3oFfhzVQNXu+H5Ifo5AtDm1wGaJ7eeVPAB0dZzqPLlDJAhSdX66OmvJkcTMPr x0mw== 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:dmarc-filter:dkim-signature :dkim-signature; bh=9WaxF1CpXIWJ1LAODJikoLdsNs4Ye/e4fRIovgoaRQk=; b=zRAxjMjL/p4kiwYpPcWcvCF6PMTogRTWrmHdqn7SJQ1yt2QPDHe8uTggLPjN/cGiQc H5YHK5d9HI7hqaiZIh7rQ425bMV7pzm4/htgcC5Nb8xBjGzX7aZ0h+IvoUtwXvOt5vtZ zpxScd+MdUku78srMrq3EiLbftm1ktcVf8/mFNxS4yEb26j53OvLIS5mV28cjwievwFu xkiuezahDJcRhG9ZKAz/n5XrSTosh/yvvVlaABoTTgicoi6oLruWsTEswZiXzwmr6PIV XUecY5Ugb9Bw0N4gGg/QtFVdBoXQyN8MLP+2+u24axjfWUdnA9FAZGoSnSoVXwhi7v/0 yjSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="P/Jz/L/e"; dkim=pass header.i=@codeaurora.org header.s=default header.b="P/Jz/L/e"; 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 q9-v6si16641814pgj.134.2018.09.17.20.12.41; Mon, 17 Sep 2018 20:12:57 -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=@codeaurora.org header.s=default header.b="P/Jz/L/e"; dkim=pass header.i=@codeaurora.org header.s=default header.b="P/Jz/L/e"; 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 S1728944AbeIRImZ (ORCPT + 99 others); Tue, 18 Sep 2018 04:42:25 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:52996 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbeIRImY (ORCPT ); Tue, 18 Sep 2018 04:42:24 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 92B5A60C61; Tue, 18 Sep 2018 03:11:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1537240314; bh=N4Ku4hLfDN9oA/nZfGR2YEM8dFpL6CROoIGqpdUqFzc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=P/Jz/L/ekwv7wxob4vHSxF5kuNTcvsNHSOBBdq/6iHsCV87802AYJawHg6GZKYtaM VjU1tNBK3bGMxRYZ1+ZM8D3MPg5OF2l+T7HWMFUV9A/nZWcQQKYOd1mY0dgra+2I3P Fr5YR6xWYwfi3rWqZW+mrdtACocU9xAgtrvEe5uA= 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.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail-qt0-f171.google.com (mail-qt0-f171.google.com [209.85.216.171]) (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 EB127608BF; Tue, 18 Sep 2018 03:11:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1537240314; bh=N4Ku4hLfDN9oA/nZfGR2YEM8dFpL6CROoIGqpdUqFzc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=P/Jz/L/ekwv7wxob4vHSxF5kuNTcvsNHSOBBdq/6iHsCV87802AYJawHg6GZKYtaM VjU1tNBK3bGMxRYZ1+ZM8D3MPg5OF2l+T7HWMFUV9A/nZWcQQKYOd1mY0dgra+2I3P Fr5YR6xWYwfi3rWqZW+mrdtACocU9xAgtrvEe5uA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org EB127608BF 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 Received: by mail-qt0-f171.google.com with SMTP id r37-v6so457656qtc.0; Mon, 17 Sep 2018 20:11:53 -0700 (PDT) X-Gm-Message-State: APzg51BX7fo9MQsxjlJXx5gXUCecVhdE0tCKmmv3rUdE1Nr7OICHCq+W v+tu0BMVWvLgYzxwgJfpQ9plQeoGN5wvu40l7MM= X-Received: by 2002:a0c:ada8:: with SMTP id w37-v6mr20149984qvc.107.1537240313215; Mon, 17 Sep 2018 20:11:53 -0700 (PDT) MIME-Version: 1.0 References: <20180830144541.17740-1-vivek.gautam@codeaurora.org> <20180830144541.17740-3-vivek.gautam@codeaurora.org> <3ccc3690-dc9d-56e7-e2d1-62e73a189bff@codeaurora.org> In-Reply-To: From: Vivek Gautam Date: Tue, 18 Sep 2018 08:41:41 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v16 2/5] iommu/arm-smmu: Invoke pm_runtime during probe, add/remove device To: Robin Murphy Cc: Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , alex.williamson@redhat.com, Linux PM , sboyd@kernel.org, "Rafael J. Wysocki" , Will Deacon , open list , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , "robh+dt" , linux-arm-msm , freedreno , Tomasz Figa 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 Robin, On Fri, Sep 7, 2018 at 3:52 PM Vivek Gautam wrote: > > On Fri, Sep 7, 2018 at 3:22 PM Tomasz Figa wrote: > > > > On Fri, Sep 7, 2018 at 6:38 PM Vivek Gautam wrote: > > > > > > Hi Tomasz, > > > > > > > > > On 9/7/2018 2:46 PM, Tomasz Figa wrote: > > > > Hi Vivek, > > > > > > > > On Thu, Aug 30, 2018 at 11:46 PM 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. > > > >> Global locks are also initialized before enabling runtime pm as the > > > >> runtime_resume() calls device_reset() which does tlb_sync_global() > > > >> that ultimately requires locks to be initialized. > > > >> > > > >> Signed-off-by: Sricharan R > > > >> [vivek: Cleanup pm runtime calls] > > > >> Signed-off-by: Vivek Gautam > > > >> Reviewed-by: Tomasz Figa > > > >> Tested-by: Srinivas Kandagatla > > > >> --- > > > >> drivers/iommu/arm-smmu.c | 89 +++++++++++++++++++++++++++++++++++++++++++----- > > > >> 1 file changed, 81 insertions(+), 8 deletions(-) > > > > [snip] > > > >> @@ -2215,10 +2281,17 @@ static int arm_smmu_device_remove(struct platform_device *pdev) > > > >> if (!bitmap_empty(smmu->context_map, ARM_SMMU_MAX_CBS)) > > > >> dev_err(&pdev->dev, "removing device with active domains!\n"); > > > >> > > > >> + arm_smmu_rpm_get(smmu); > > > >> /* Turn the thing off */ > > > >> writel(sCR0_CLIENTPD, ARM_SMMU_GR0_NS(smmu) + ARM_SMMU_GR0_sCR0); > > > >> + arm_smmu_rpm_put(smmu); > > > >> + > > > >> + if (pm_runtime_enabled(smmu->dev)) > > > >> + pm_runtime_force_suspend(smmu->dev); > > > >> + else > > > >> + clk_bulk_disable(smmu->num_clks, smmu->clks); > > > >> > > > >> - clk_bulk_disable_unprepare(smmu->num_clks, smmu->clks); > > > >> + clk_bulk_unprepare(smmu->num_clks, smmu->clks); > > > > Aren't we missing pm_runtime_disable() here? We'll have the enable > > > > count unbalanced if the driver is removed and probed again. > > > > > > pm_runtime_force_suspend() does a pm_runtime_disable() also if i am not > > > wrong. > > > And, as mentioned in a previous thread [1], we were seeing a warning > > > which we avoided > > > by keeping force_suspend(). > > > > > > [1] https://lkml.org/lkml/2018/7/8/124 > > > > I see, thanks. I didn't realize that pm_runtime_force_suspend() > > already disables runtime PM indeed. Sorry for the noise. > > Hi Tomasz, > No problem. Thanks for looking back at it. > > Hi Robin, > If you are fine with this series, then can you please consider giving > Reviewed-by, so that we are certain that this series will go in the next merge > window. > Thanks Gentle ping. You ack will be very helpful in letting Will pull this series for 4.20. Thanks. Best regards Vivek -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation