Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4006494imu; Mon, 28 Jan 2019 15:14:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN4nGs5xIwCyoRBfe7sULcajOJww4SirInx19OQTJaZPO0y+YAPKtdOUoPLvxwn3xarpuGmo X-Received: by 2002:a63:5d20:: with SMTP id r32mr21782667pgb.329.1548717274009; Mon, 28 Jan 2019 15:14:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548717273; cv=none; d=google.com; s=arc-20160816; b=pQrtaCmkaD5vjc2O8dXMtZw3w2xT0YhzXq7xuzzzu6YDYyfa6vJWdv7fxfPsMnS6cK k2yx3wY2sk84druNik9LmS5jHdJivHz1gzGoA+y40RNLQeIxRbyBqt3L1tnPzjS2KVOZ ojS0R8Mzf+SEdoVfRjtgrVL5hVC+2mRo8HjGHvP1h6OXj3k6NrdW3Y9Oqsic4KZLgf+c ADwFXKuAw0vdGt7vTDp0shoPZikCE7ofkrB/t/DbvRiBSqLXB34gviP3TfF7nrcjf1SX 6L+CLbFP2GWq+cyEASeXG3vs6ddDDXxy7MuH5bYF1BwXGepbguZf7MA1pXjB3QcdMAUk fu7Q== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=yBKHsR3D9hWXL+dDjCSu0z9Mco+eq9xY0zN1MUA5TEk=; b=EFSZ5CjwBrC/8ixcEQPmTBuqFc/3aaDlpNbZk1cwz3pXoDNeEaus8SqpBOrT/Ljt/M lRLMisF83PY/CgozhVqB1f7C9nOpjkZZu5oT6klB32WoR1yUsrAcfyopMBcJTPgW+SmB V7ugAHNdmkZqIXGxtYDlEv9W1bHOlV8YRwa6pJnG8t2a5vFNu1EaKspBWXfSfoMu84sj RlJA8Y48quFYV7OCOeF+eAKhgL40msHbl2Wptj8VyxATyIucGa39CEWARV8btwBag4tW cZ8pp2gn9KmoS6RYmM4l1gfVL6H07kcYpmSDg6KPbqhSEjSENj1NIZOoe5Tn5KIv/goH qJHg== 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 p20si8383422pfk.125.2019.01.28.15.14.17; Mon, 28 Jan 2019 15:14:33 -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 S1727220AbfA1XOI (ORCPT + 99 others); Mon, 28 Jan 2019 18:14:08 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:56380 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbfA1XOE (ORCPT ); Mon, 28 Jan 2019 18:14:04 -0500 Received: from 79.184.255.169.ipv4.supernova.orange.pl (79.184.255.169) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.183) id 916cbbf4bdcce02e; Tue, 29 Jan 2019 00:14:02 +0100 From: "Rafael J. Wysocki" To: Greg Kroah-Hartman , Joerg Roedel Cc: LKML , Linux PM , Ulf Hansson , Daniel Vetter , Lukas Wunner , Andrzej Hajda , Russell King - ARM Linux , Lucas Stach , Linus Walleij , Thierry Reding , Laurent Pinchart , Marek Szyprowski , Jeffy Chen Subject: [PATCH 1/4] IOMMU: Make dwo drivers use stateless device links Date: Tue, 29 Jan 2019 00:05:21 +0100 Message-ID: <3532356.d9GMSSLOvP@aspire.rjw.lan> In-Reply-To: <2405639.4es7pRLqn0@aspire.rjw.lan> References: <2405639.4es7pRLqn0@aspire.rjw.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki The device links used by rockchip-iommu and exynos-iommu are completely managed by these drivers within the IOMMU framework, so there is no reason to involve the driver core in the management of these links. For this reason, make rockchip-iommu and exynos-iommu pass DL_FLAG_STATELESS in flags to device_link_add(), so that the device links used by them are stateless. [Note that this change is requisite for a subsequent one that will rework the management of stateful device links in the driver core and it will not be compatible with the two drivers in question any more.] Signed-off-by: Rafael J. Wysocki --- drivers/iommu/exynos-iommu.c | 1 + drivers/iommu/rockchip-iommu.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) Index: linux-pm/drivers/iommu/rockchip-iommu.c =================================================================== --- linux-pm.orig/drivers/iommu/rockchip-iommu.c +++ linux-pm/drivers/iommu/rockchip-iommu.c @@ -1071,7 +1071,8 @@ static int rk_iommu_add_device(struct de iommu_group_put(group); iommu_device_link(&iommu->iommu, dev); - data->link = device_link_add(dev, iommu->dev, DL_FLAG_PM_RUNTIME); + data->link = device_link_add(dev, iommu->dev, + DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME); return 0; } Index: linux-pm/drivers/iommu/exynos-iommu.c =================================================================== --- linux-pm.orig/drivers/iommu/exynos-iommu.c +++ linux-pm/drivers/iommu/exynos-iommu.c @@ -1260,6 +1260,7 @@ static int exynos_iommu_add_device(struc * direct calls to pm_runtime_get/put in this driver. */ data->link = device_link_add(dev, data->sysmmu, + DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME); } iommu_group_put(group);