From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: ACJfBoubb5dk/e0U2+cdR2v/o5iw9avliAoKZCkiRqGRS76my8ErY9a4m26fEs3ahHPSs58Z9sbk ARC-Seal: i=1; a=rsa-sha256; t=1516362272; cv=none; d=google.com; s=arc-20160816; b=UhTEJEEA8GAcvatnZ1mzlN/34QF4GyelX/81jPoW9rCKJiCDJQ9idNafgYzUAaTmNS wSz5DCL2PV7rvdRJCtHjetyWeOXYR3LiDe0TiMtKm4VBd6DE8JKDqlPVwflWeaWXpND4 anBzp9DtPYdoqKb0Mjws0HzXVjHs+0Pjqfp6uY5NbsmmToPBkFWvE7eRiOy3Jz4aOQB5 nalLwwuuKBI0TZxC4UmuH4YNfp7kx7PTjW/Yr+ti93qq8vkrDWVNTj5DTNrTWiwQM+n4 kyoFFqPiZsPYsT2JSIrZuASnPnzcGCmRxPKHtyDUZs88gd5kFNm6apE9Sszi5vrluIzj +oJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=GAYsFhRKtS+DGntjqcrp92XcwgwAeQopfzdTga6yJpY=; b=xt+un8uRPNbeqeg8XENMRsAMn1uGXmeGwaV28jmhmfJ5kvWNdYHPQDbPEqvTL/Eu4Q oWgmq/EN+oaOx2Z8d/oUdY4qB5J+ElIVBLZUXhHO0/bPla5eZ2aAG3pazrIQKPamX8ez LhfcUWGf8gW3lKeU7kA8w+4EeamxGwAOlzOBZvqAHvHdaOtQzMmuWK4h09Tr0swO2IDe hE4pkbjoRigpYDgNwoOKZ7yLU2XmKxr93xWAD1J5NEL9L7nkoWrrDREXN3ztxpun688G bQkgdHfyEe8nD/YvkNqvpofjOyWsx47uKJr5O8LTPRDh2Z4bEE5gqw+xpGbr17EnCzVK UgMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=RsEUoBqH; dkim=pass header.i=@codeaurora.org header.s=default header.b=gRNIPOys; spf=pass (google.com: domain of vivek.gautam@codeaurora.org designates 198.145.29.96 as permitted sender) smtp.mailfrom=vivek.gautam@codeaurora.org Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=RsEUoBqH; dkim=pass header.i=@codeaurora.org header.s=default header.b=gRNIPOys; spf=pass (google.com: domain of vivek.gautam@codeaurora.org designates 198.145.29.96 as permitted sender) smtp.mailfrom=vivek.gautam@codeaurora.org DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DEBEF60452 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 From: Vivek Gautam To: alex.williamson@redhat.com, robh+dt@kernel.org, mark.rutland@arm.com, rjw@rjwysocki.net, robin.murphy@arm.com, will.deacon@arm.com, iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, sboyd@codeaurora.org Cc: gregkh@linuxfoundation.org, sricharan@codeaurora.org, m.szyprowski@samsung.com, architt@codeaurora.org, linux-arm-msm@vger.kernel.org, vivek.gautam@codeaurora.org Subject: [PATCH v6 6/6] drm/msm: iommu: Replace runtime calls with runtime suppliers Date: Fri, 19 Jan 2018 17:13:43 +0530 Message-Id: <1516362223-22946-7-git-send-email-vivek.gautam@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516362223-22946-1-git-send-email-vivek.gautam@codeaurora.org> References: <1516362223-22946-1-git-send-email-vivek.gautam@codeaurora.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590021086011204805?= X-GMAIL-MSGID: =?utf-8?q?1590021086011204805?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: While handling the concerned iommu, there should not be a need to power control the drm devices from iommu interface. If these drm devices need to be powered around this time, the respective drivers should take care of this. Replace the pm_runtime_get/put_sync() with pm_runtime_get/put_suppliers() calls, to power-up the connected iommu through the device link interface. In case the device link is not setup these get/put_suppliers() calls will be a no-op, and the iommu driver should take care of powering on its devices accordingly. Signed-off-by: Vivek Gautam --- drivers/gpu/drm/msm/msm_iommu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c index b23d33622f37..1ab629bbee69 100644 --- a/drivers/gpu/drm/msm/msm_iommu.c +++ b/drivers/gpu/drm/msm/msm_iommu.c @@ -40,9 +40,9 @@ static int msm_iommu_attach(struct msm_mmu *mmu, const char * const *names, struct msm_iommu *iommu = to_msm_iommu(mmu); int ret; - pm_runtime_get_sync(mmu->dev); + pm_runtime_get_suppliers(mmu->dev); ret = iommu_attach_device(iommu->domain, mmu->dev); - pm_runtime_put_sync(mmu->dev); + pm_runtime_put_suppliers(mmu->dev); return ret; } @@ -52,9 +52,9 @@ static void msm_iommu_detach(struct msm_mmu *mmu, const char * const *names, { struct msm_iommu *iommu = to_msm_iommu(mmu); - pm_runtime_get_sync(mmu->dev); + pm_runtime_get_suppliers(mmu->dev); iommu_detach_device(iommu->domain, mmu->dev); - pm_runtime_put_sync(mmu->dev); + pm_runtime_put_suppliers(mmu->dev); } static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova, @@ -63,9 +63,9 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova, struct msm_iommu *iommu = to_msm_iommu(mmu); size_t ret; -// pm_runtime_get_sync(mmu->dev); + pm_runtime_get_suppliers(mmu->dev); ret = iommu_map_sg(iommu->domain, iova, sgt->sgl, sgt->nents, prot); -// pm_runtime_put_sync(mmu->dev); + pm_runtime_put_suppliers(mmu->dev); WARN_ON(ret < 0); return (ret == len) ? 0 : -EINVAL; @@ -76,9 +76,9 @@ static int msm_iommu_unmap(struct msm_mmu *mmu, uint64_t iova, { struct msm_iommu *iommu = to_msm_iommu(mmu); - pm_runtime_get_sync(mmu->dev); + pm_runtime_get_suppliers(mmu->dev); iommu_unmap(iommu->domain, iova, len); - pm_runtime_put_sync(mmu->dev); + pm_runtime_put_suppliers(mmu->dev); return 0; } -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation