Received: by 10.223.185.111 with SMTP id b44csp573968wrg; Fri, 9 Mar 2018 09:38:57 -0800 (PST) X-Google-Smtp-Source: AG47ELvt8KpcpPiBG8gKXLbc7tNcVnt2NWqgBYiWLtFi+vO0NME8YHxGqKIm0E4XLF0zVPuqL16p X-Received: by 2002:a17:902:48c8:: with SMTP id u8-v6mr28865877plh.306.1520617137306; Fri, 09 Mar 2018 09:38:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520617137; cv=none; d=google.com; s=arc-20160816; b=V3EfNHje2/fORm0yLe21uNDUCmgpUXN9kHHkZHMr8o6Zf8LPCbBzSGKjoEJTsXVrnH HelUKczQPMuNQtSaLeAk7Z3TQ/Cdv4/HYpLl0E6jrA3oKROdpDYnk3PEmCXZ6dKSeSNg Pw3NVCytQwlPc42mpakGRywmth+yBIaI5d4e9sFY+3Yxdxbrs7r7jUIYsjCydIfzCt2A tZ65+QWLEnQL8PJnGAUe7+bP7lyW2qGmxdHyt6a/TJ4UtdYgPjnj2iDhwY4E7xC3yj6e jSck0DOguLxLn0pPkbsjX3TCsT5fOvnr2PgiGHitPYlWnUNGGp2btxT1j8bJV+/cCpIU TE3A== 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=JysoYqTmkGY4BANTOzgUQla/LIPB83qjzMJKq6Xp3QY=; b=Jf7CyPCjGDpYzN8Wge8PlAxYTl7sEevbS5iY5ESZB9AUumKJ8dmtYWBalfbw1D7ksq hOvU0yh79EAqZ6z9+v5HxRwijxHwQFvUdaaodrr7PS4eJWJ+tKlVL42ToDsKYzEFT08o gfnuXAlU5EMEtwbhSopQEEw/xgNKHKBirbsVpoww3r2p0N+uezDzDmZD0IkDKg+CYUW/ EHVFBzdw5tXhUY7F/9i4qkTkoIHrQwpfLfjArffq3Kgjp4taRcNyLfWEl6HRbWzujeED YvULhC9IwBt87wk/TXQ/eKDfZ0Js5Fw7mxJrGKNQEVFaUMm1p66U45BGMoJd6r351Yhw IvVw== 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 s19si982688pgo.626.2018.03.09.09.38.42; Fri, 09 Mar 2018 09:38:57 -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; 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 S932391AbeCIRgh (ORCPT + 99 others); Fri, 9 Mar 2018 12:36:37 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:55714 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbeCIRgg (ORCPT ); Fri, 9 Mar 2018 12:36:36 -0500 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 B4F1E1596; Fri, 9 Mar 2018 09:36:35 -0800 (PST) Received: from [10.1.210.88] (e110467-lin.cambridge.arm.com [10.1.210.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DE8FC3F487; Fri, 9 Mar 2018 09:36:32 -0800 (PST) Subject: Re: [PATCH v8 3/5] iommu/arm-smmu: Invoke pm_runtime during probe, add/remove device To: Tomasz Figa 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 , Lorenzo Pieralisi References: <20180302101050.6191-1-vivek.gautam@codeaurora.org> <20180302101050.6191-4-vivek.gautam@codeaurora.org> <30a2fa5e-3d8e-acb6-ab31-bec652f1be99@arm.com> <6fe36177-a8a5-5f17-bf65-1a53538221a4@arm.com> From: Robin Murphy Message-ID: Date: Fri, 9 Mar 2018 17:36:31 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 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 [ +Lorenzo ] On 09/03/18 04:50, Tomasz Figa wrote: [...] >>> Now we need a way to do the check. Perhaps for the time being it would >>> be enough to just check for the power-domains property in DT? >> >> >> AFAICS, it might be as simple as arm_smmu_probe() doing this: >> >> /* >> * We want to avoid touching dev->power.lock in fastpaths unless >> * it's really going to do something useful - pm_runtime_enabled() >> * can serve as an ideal proxy for that decision. >> */ >> if (dev->pm_domain) >> pm_runtime_enable(dev); >> >> or maybe even just gate all the calls with "if (smmu->dev.pm_domain)" >> directly (like pcie-mediatek does), but I'm not sure which would be >> conceptually cleaner. > > Okay, that was easier than I expected. Thanks. :) > > Actually, there is one more thing that might need rechecking. Are you > sure that dev->pm_domain is NULL for the devices, for which we don't > want runtime PM to be enabled? I think ACPI was mentioned and ACPI > includes the concept of PM domains. Thanks for pointing that out - thankfully, I've confirmed that the SMMUs on my Juno don't have dev->pm_domain set when booting with ACPI, and double-checking the ACPI code I think we're OK here. Since the SMMUs are only described in the static IORT table and not in the ACPI namespace, they won't have the ACPI companion device that acpi_dev_pm_attach() looks for, and thus should always be ignored. Lorenzo, do I have that right? Robin.