Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp561608imm; Wed, 22 Aug 2018 08:47:27 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx4Z9juM1ZadbG72RVuzbFINFpjrUyphycr2mcO+vO1StKjNW95cMK+nAMNwEcYapQzOnAr X-Received: by 2002:a65:5144:: with SMTP id g4-v6mr51258587pgq.21.1534952847156; Wed, 22 Aug 2018 08:47:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534952847; cv=none; d=google.com; s=arc-20160816; b=xoUgaqM8OmYqHk9mxTMRQBBOF0g6IinVqHewxtiBSeL8EZQwDSdKd0tL7L0Sh0ps2z 9CD8fvwgKZkka4S2PlbSeH134792qW6PkeK5AkN2uQFDuFN91xR7uST8bbu2o+o0AJrB OyfExO5VIxEDXbN+EJ+zirF+Cm3j2VV4S07xcb7hsk9GdppAQqCvHAtfShAjsB4uZfFM 7ZfXIemh3P2LVLr4Td/5GZAUR6WAm3ZFnbiObrykxEoFS1k6C24V/O3k8Pnqlhh5bZFz SW8Xp/Y8lQew+HxkXouPVK7E48bG5cJQ2R4hQYOytl0HDlIePBnOMIgjEm7EE8U/xR29 a85Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=5jtPvhdSMDuaAF0fBRewt/wMd9hcdtnzL68QHCfspGM=; b=NzxWbqs6R4rwp1XKsbpwR0Winqmu0wstBOz1SnQx8vR8GNG3nvaBRWRZ3IsbHRYhPT rR+axW1V+Ra9KUElUc4BkGxy2AcNRjdNwmVEZigQ+xWipu5dvkN/TL9QUF7VMLayJB+q uEpNXTPguM5sg9m1AkhVC1Gnvx1PhH2Z/5MfESDfFcB2IKzm5/kVQcCt60Vl1JZuLRrn zAFHjp10g/sh/08zBcl01QrC/0LmtKs6X1fboDinlgFvlQAIZ/LsrYGvb3VxiGiMP0Jx 4hud475mtqt5D2l4eQBDzOqhGYm0kAxHow8SYnOTfv3h/32OREqNDqJ3CRzg7JfmfpgN vqlw== ARC-Authentication-Results: i=1; mx.google.com; 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 h14-v6si1969255pgg.540.2018.08.22.08.47.11; Wed, 22 Aug 2018 08:47:27 -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; 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 S1729258AbeHVTJC (ORCPT + 99 others); Wed, 22 Aug 2018 15:09:02 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34724 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728207AbeHVTJB (ORCPT ); Wed, 22 Aug 2018 15:09:01 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B626280D; Wed, 22 Aug 2018 08:43:37 -0700 (PDT) Received: from [10.4.12.131] (e110467-lin.Emea.Arm.com [10.4.12.131]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F30083F2EA; Wed, 22 Aug 2018 08:43:33 -0700 (PDT) Subject: Re: [PATCH v14 0/4] iommu/arm-smmu: Add runtime pm/sleep support To: Tomasz Figa Cc: "list@263.net:IOMMU DRIVERS" , Joerg Roedel , joro@8bytes.org, Rob Herring , Vivek Gautam , "Rafael J. Wysocki" , Will Deacon , "list@263.net:IOMMU DRIVERS" , Joerg Roedel , iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, Linux Kernel Mailing List , freedreno , Alex Williamson , Mark Rutland , Rob Clark , Linux PM , sboyd@kernel.org, jcrouse@codeaurora.org, Sricharan R , Marek Szyprowski , Archit Taneja , linux-arm-msm References: <20180727070224.23966-1-vivek.gautam@codeaurora.org> From: Robin Murphy Message-ID: <08965f23-5b97-3ea7-4bd5-4f36035fddf2@arm.com> Date: Wed, 22 Aug 2018 16:43:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/08/18 10:31, Tomasz Figa wrote: > Hi Robin, > > On Fri, Jul 27, 2018 at 4:02 PM Vivek Gautam > wrote: >> >> This series provides the support for turning on the arm-smmu's >> clocks/power domains using runtime pm. This is done using >> device links between smmu and client devices. The device link >> framework keeps the two devices in correct order for power-cycling >> across runtime PM or across system-wide PM. >> >> With addition of a new device link flag DL_FLAG_AUTOREMOVE_SUPPLIER [8] >> (available in linux-next of Rafael's linux-pm tree [9]), the device links >> created between arm-smmu and its clients will be automatically purged >> when arm-smmu driver unbinds from its device. >> >> As not all implementations support clock/power gating, we are checking >> for a valid 'smmu->dev's pm_domain' to conditionally enable the runtime >> power management for such smmu implementations that can support it. >> Otherwise, the clocks are turned to be always on in .probe until .remove. >> With conditional runtime pm now, we avoid touching dev->power.lock >> in fastpaths for smmu implementations that don't need to do anything >> useful with pm_runtime. >> This lets us to use the much-argued pm_runtime_get_sync/put_sync() >> calls in map/unmap callbacks so that the clients do not have to >> worry about handling any of the arm-smmu's power. >> >> This series also adds support for Qcom's arm-smmu-v2 variant that >> has different clocks and power requirements. >> >> Previous version of this patch series is @ [2]. >> >> Tested this series on msm8996, and sdm845 after pulling in Rafael's linux-pm >> linux-next[9] and Joerg's iommu next[10] branches, and related changes for >> device tree, etc. >> >> Hi Robin, Will, >> I have addressed the comments for v13. If there's still a chance >> can you please consider pulling this for v4.19. >> Thanks. >> >> [v14] >> * Moved arm_smmu_device_reset() from arm_smmu_pm_resume() to >> arm_smmu_runtime_resume() so that the pm_resume callback calls >> only runtime_resume to resume the device. >> This should take care of restoring the state of smmu in systems >> in which smmu lose register state on power-domain collapse. > > It's been a while since this series was posted and no more comments > seem to be left anymore. Would you have some time to take a look > again? Thanks. Other than the binding issue which turned up in the meantime, I *think* this is looking OK now in terms of being sufficiently safe for all the various awkward retention vs. state-loss combinations. There's almost certainly still ways to improve it in future, but what we have now seems like a reasonable starting point that isn't impossibly complicated to reason about. Robin.