Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp851441imm; Mon, 1 Oct 2018 21:15:59 -0700 (PDT) X-Google-Smtp-Source: ACcGV60ulAYseqTxbbqhjpewk8dfCky+b81fVREKHhlf9Tu+gqR9rmkwFT15bQhuZ8/O4OS/FrBr X-Received: by 2002:a62:a116:: with SMTP id b22-v6mr14210516pff.99.1538453759215; Mon, 01 Oct 2018 21:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538453759; cv=none; d=google.com; s=arc-20160816; b=zfN2vHG8JsfUMl2Ee82vhZGk4X79gQSS/VVSkjr4NC/tKOLtOBv0/EoTCZ3aG1zkzc uppO2GCxXvEJXQd0h2I0TAfE6+WalYCpVq7DQRnhTs3xIGM9GgTlL6IuVe59ASuqxZ/E TYRfgsZgMsE/6+fjmKsl9ZtRuHhuJDJV8WjiQ1l/AlsRCT/dLsTl01zHSsI496MhSN/S BM0hzsKr0y8KHt6qT2CbS3WR4317ubxBf2hGURBEX5/s9tVlJCykebpAsUuJmavy20zc dDP6N3J/IyxF3OeSNbyxgMtRWJ5Anz+jO2YxJiMlyMSVTMo20vJEYzK3Cq+3YvINehCC 0oWQ== 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=+bTUdGKWy5k83o9NC+i2Bnji09LN7tTf4o6nEx6t3Jw=; b=N2whvM7hgssZL2SIpXJjREoow0X1wn1SWS2MNKKJSIU4k/oe0/Hrowp7E5AhML7hYE XvN2PDN76VbtB2KH85T+sQhjGEaK3SiqXE5+N7+RN/vl1cTSRe7su3I8Q1h5Z+SUAOpB b1yjt9N+JU5cfm+Kandtj5HYHw5WL9QcZcUv7ZLItEo/9vVZne50cHHZocUNpxvmVyRd HcdldxjhMsIufZE6YYXV5nK401cZhgOkziDIolBX7t2rpgU4HUHaBF8amLRqUNT8ZPsM PVaTQGzXN/WjZVF2IjtqXKCPvhkbPJBBobDKk+ybN5A5bnE7I4BfG+jCPDRQvuyz+Sce IPYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=Xnk2GnVW; dkim=pass header.i=@codeaurora.org header.s=default header.b=h8GLxgxi; 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 r59-v6si13887486plb.39.2018.10.01.21.15.44; Mon, 01 Oct 2018 21:15:59 -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=Xnk2GnVW; dkim=pass header.i=@codeaurora.org header.s=default header.b=h8GLxgxi; 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 S1726803AbeJBK4T (ORCPT + 99 others); Tue, 2 Oct 2018 06:56:19 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:49208 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726276AbeJBK4T (ORCPT ); Tue, 2 Oct 2018 06:56:19 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 745BA60C1B; Tue, 2 Oct 2018 04:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538453708; bh=7y/x1RS4D0d0PWDLdliZbR09//VM70ZNHNOmcl13ARE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Xnk2GnVWQ62pkU3p/Pbd4ljw3OVNYv5sElzxwg6ROh4N37BKbfpU9m0R8JdsXG+jn wKoIKt4nPXL3VJioJwChzDjKXRCejZ99UMV0QgdUvLpkJulTREWSUWyI6PYQSKTxhq 4p8U2rxWKdbPc3GoDw/cRCxMHXja7aGB2COvDDNk= 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 mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 4C3C760C1D; Tue, 2 Oct 2018 04:15:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538453707; bh=7y/x1RS4D0d0PWDLdliZbR09//VM70ZNHNOmcl13ARE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=h8GLxgxiLbI+VzPFZTbtolJz2PioW95U2MwVvKs4Ioq6plA8zaS1MvWdMvS/8K6VE nQtbxJpDNA5cLqxCH7k9rFQ2ZXdheyUNqcQBGCskcYBRmSdUum16E6pYWLJfkWHo63 Oeb5xSD90nT08rVCtoaWAPWbg2KVs52656xaBNc0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4C3C760C1D 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-qk1-f173.google.com with SMTP id q5-v6so351753qki.6; Mon, 01 Oct 2018 21:15:07 -0700 (PDT) X-Gm-Message-State: ABuFfoj4sCkkIJhjCK42YCyD6JEuYIE6jScQ7Qd5xqayvKJL51J4huQV qlpSYUpVBzGKnc28sDQaHI2YoMvlyfvRMVK1iGI= X-Received: by 2002:a37:6388:: with SMTP id x130-v6mr10673451qkb.118.1538453706523; Mon, 01 Oct 2018 21:15:06 -0700 (PDT) MIME-Version: 1.0 References: <20180830144541.17740-1-vivek.gautam@codeaurora.org> <20180830144541.17740-3-vivek.gautam@codeaurora.org> <20181001125854.GB31488@arm.com> In-Reply-To: <20181001125854.GB31488@arm.com> From: Vivek Gautam Date: Tue, 2 Oct 2018 09:44:54 +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: Will Deacon Cc: Joerg Roedel , "robh+dt" , Robin Murphy , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list , alex.williamson@redhat.com, Mark Rutland , "Rafael J. Wysocki" , Rob Clark , Linux PM , freedreno , sboyd@kernel.org, Tomasz Figa , Jordan Crouse , 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 Hi Will, On Mon, Oct 1, 2018 at 6:29 PM Will Deacon wrote: > > Hi Vivek, > > On Thu, Aug 30, 2018 at 08:15:38PM +0530, 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(-) > > This doesn't apply on my tree[1], possibly because I've got Robin's non-strict > invalidation queued there. However, that got me thinking -- how does this > work in conjunction with the timer-based TLB invalidation? Do we need to > rpm_{get,put} around flush_iotlb_all()? If so, do we still need the calls > in map/unmap when non-strict mode is in use? I haven't tested things with flush queues, but from what it looks like both .flush_iotlb_all, and .iotlb_sync callbacks need rpm_get/put(). I will respin the patches. Thanks Vivek > > Will > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/log/?h=for-joerg/arm-smmu/updates -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation