From patchwork Fri Oct 21 17:14:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sricharan Ramabadhran X-Patchwork-Id: 9389705 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A1A9A60780 for ; Fri, 21 Oct 2016 17:14:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F00C2A1F0 for ; Fri, 21 Oct 2016 17:14:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8397E2A1F5; Fri, 21 Oct 2016 17:14:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AECC2A1F0 for ; Fri, 21 Oct 2016 17:14:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933587AbcJURO4 (ORCPT ); Fri, 21 Oct 2016 13:14:56 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:47853 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933068AbcJUROx (ORCPT ); Fri, 21 Oct 2016 13:14:53 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 799AF61D67; Fri, 21 Oct 2016 17:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1477070092; bh=btXtJIW1RR4gcsrij5N7vk5ZHs0NCM6GRGbcgUj6yF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=biyDZpqEjFNlYkV+TnUunVrRQEGGDitfX6+GTjoASvCKNFARnSi7vVixz5xZKagXn bTJUT5rURFBgGNAkGQu6BcQlPFuT1KuzQbL+lGmdzxGtyityHMnvzGd57ZHo+Af8cM 9g4OgZ2kt7RXqpNubyN191UpuIWCh3qmwXhifqp8= Received: from blr-ubuntu-32.ap.qualcomm.com (unknown [202.46.23.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sricharan@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1869161D49; Fri, 21 Oct 2016 17:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1477070091; bh=btXtJIW1RR4gcsrij5N7vk5ZHs0NCM6GRGbcgUj6yF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DENw14vNFPg4fp8oFovwJ9kdA5IsDIepvfLT19clmScDI1XTQd67J+wFnqUsjpHib 1RhnG0oXQYHmKpj6RHMwcr0f2ahn6DZ4+EEWC4cp0YV7tGnZ24bq581WKhFKbtSiYj UFAtW8tWpmEC8vTG+Eq1M7bLmq6TLxDCXPdKQ2rc= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 1869161D49 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=sricharan@codeaurora.org From: Sricharan R To: m.szyprowski@samsung.com, will.deacon@arm.com, robin.murphy@arm.com, joro@8bytes.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, srinivas.kandagatla@linaro.org Cc: sricharan@codeaurora.org Subject: [PATCH 4/4] iommu/arm-smmu: Add the device_link between masters and smmu Date: Fri, 21 Oct 2016 22:44:26 +0530 Message-Id: <1477070066-15044-5-git-send-email-sricharan@codeaurora.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1477070066-15044-1-git-send-email-sricharan@codeaurora.org> References: <1477070066-15044-1-git-send-email-sricharan@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The device link between master and its smmu is added so that the smmu gets runtime enabled/disabled when the master needs it. This is done from add_device callback which gets called once when the master is added to the smmu group. Signed-off-by: Sricharan R --- drivers/iommu/arm-smmu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 578cdc2..71ce4b6 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -1470,6 +1470,15 @@ static int arm_smmu_add_device(struct device *dev) goto out_free; pm_runtime_put_sync(smmu->dev); + /* + * Establish the link between smmu and master, so that the + * smmu gets runtime enabled/disabled as per the master's + * needs. + */ + + device_link_add(dev, smmu->dev, DEVICE_LINK_AVAILABLE, + DEVICE_LINK_PM_RUNTIME); + return 0; out_free: