From patchwork Fri Jun 8 08:41:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 137943 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp599101lji; Fri, 8 Jun 2018 01:41:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKSooueRGORBKPzxlpqHNkdQ4J/Hh2sSYE1arZ0T8VxYKQmwTNeqJM7C/9epKWyqmrDdqYL X-Received: by 2002:a63:7a4a:: with SMTP id j10-v6mr4509082pgn.421.1528447297427; Fri, 08 Jun 2018 01:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528447297; cv=none; d=google.com; s=arc-20160816; b=ph6UQVVvtYEOW8dpeVHvJ7WHFD3yplAVts0FEW9CnS/5yA20+FLPDUnOQebDE/HDmt uAxOAXMnztM9NN45JFdTBtw03ierr2HQe5F9fIEchyVCCB7ZtNo+SXH90zItyPmKARvr 74pVIil5Q4y02bdpBL2jbI0ezgndvvUryZJLOXykypAj5KZ01hzfgs4bVVPCacgK31hy 08XQROTlC81lqH29L1pN+MmLFpiiCfM0Mh9n9VnK49zZ015xsBTCsyXUpnylQWEWSjlg IYw92AgaVrwAKqylMH4C29ngWPUwTuZ9gGsLEXQkYmGni3bTgpzhV2H/hfSjL8rfYCqj UfNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=lFI85TFjXTrmSJlssrc8909ZxQ6rKenRxACha+HrB9s=; b=nvVw4qkSVn6C1gIEEmPy8bClS6sTyCyfPjz8F/bkaWA5aIGX87ATSH0FlG0KioiGBW 3AEc/qn75Bd0U66iNhmt9KypSt41psRhPv224FZUrwZ1wXUBmPAfwOV3DGl6rIV09nKf sZyRSSKu9P7gGsqg/ngJEApntuK0gYKLkQ1K5XFMLGW5z+JAyQvuU290ajDdiTNW61WF wtSxeu7Ynnw82rOh0K0PlabQbVsUKmDJPPDMzLZvsJEuWfbunc/Vl/4FlZBbyPWmiEag X9xqh5J6wz8GnRvRvgn0d3PwNSM+tTnRxr9Jzpxs4zpxpHCTT5Cvc5A2AC/+wzce/+/c vWwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=qUNU/H0X; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3-v6si54134145pld.309.2018.06.08.01.41.37; Fri, 08 Jun 2018 01:41:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=qUNU/H0X; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752864AbeFHIlg (ORCPT + 10 others); Fri, 8 Jun 2018 04:41:36 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:46749 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752478AbeFHIle (ORCPT ); Fri, 8 Jun 2018 04:41:34 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180608084132euoutp02f131c7397c3d59ec6f05e2e06b1a6de1~2IrbXp0O70763107631euoutp02L; Fri, 8 Jun 2018 08:41:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180608084132euoutp02f131c7397c3d59ec6f05e2e06b1a6de1~2IrbXp0O70763107631euoutp02L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528447292; bh=lFI85TFjXTrmSJlssrc8909ZxQ6rKenRxACha+HrB9s=; h=From:To:Cc:Subject:Date:References:From; b=qUNU/H0XSve9VO2TZOFhIqcbm2aKaGBfgtLX2Wv4Tce4DI+K99x4ubfWxyx1nhlo8 SCxZEBWsTjZTtNwqdI4ADDehNamnCAh++HnocNJVTEhlBcdsvMjkeCDpYXe+KxX/u1 ag6iRB/Gm4w5CEWM5u96eTmL5dOMQ7/wDmDPIoDo= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180608084130eucas1p1966a84fe64269ad1ff7598bc4d0033c5~2IrZ3bWtZ1370013700eucas1p1I; Fri, 8 Jun 2018 08:41:30 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id CC.11.17380.9314A1B5; Fri, 8 Jun 2018 09:41:29 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180608084128eucas1p270adc2869c111aa55a99200b11cc8aa1~2IrXqG7Q-2249322493eucas1p2F; Fri, 8 Jun 2018 08:41:28 +0000 (GMT) X-AuditID: cbfec7f4-6f9ff700000043e4-a1-5b1a413931d9 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 15.F3.04178.8314A1B5; Fri, 8 Jun 2018 09:41:28 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P9Z004PMXH0QA10@eusync3.samsung.com>; Fri, 08 Jun 2018 09:41:28 +0100 (BST) From: Marek Szyprowski To: linux-pm@vger.kernel.org Cc: Marek Szyprowski , "Rafael J . Wysocki" , Ulf Hansson , Bartlomiej Zolnierkiewicz Subject: [PATCH] PM / runtime: Fix state of suppliers of links created during consumer probe Date: Fri, 08 Jun 2018 10:41:15 +0200 Message-id: <20180608084115.19242-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42LZduznOV1LR6log+NLxC02zljPavG59wij xdojd9ktzpy+xGpxfG24A6vHnWt72Dy2XG1n8ejbsorR4/MmuQCWKC6blNSczLLUIn27BK6M d0sesRTM56k4fr+LpYGxlauLkZNDQsBE4syxlexdjFwcQgIrGCVenX3NBuF8ZpR48GsKM0xV 7+mlzBCJZYwStzcsZ4RwGpgkpn9/ywJSxSZgKNH1tosNxBYRkJGYemU/K0gRs8BORok9x68y gSSEBeIk2pauAGtgEVCVWPPvJCuIzStgK/Hr8QmodfISqzccAFsnIXCVVeL5p0fsEAkXia+T f7JA2MISr45vgYrLSHR2HGSCaGhmlGifMYsdwulhlNg6ZwcbRJW1xOHjF8HWMQvwSUzaNh1o BQdQnFeio00IosRD4kT/JTaQsJBArETDX+EJjBILGBlWMYqnlhbnpqcWG+WllusVJ+YWl+al 6yXn525iBMbS6X/Hv+xg3PUn6RCjAAejEg9vgpVktBBrYllxZe4hRgkOZiUR3mdKUtFCvCmJ lVWpRfnxRaU5qcWHGKU5WJTEeeM06qKEBNITS1KzU1MLUotgskwcnFINjHMCNrZZTdunxbK3 U073VsZKhZy/kZ8vnN7Pp73F48/1DBvOlZ5vFz7yOmRqvPfD4bN5ZXrN/O6fuw/Z1M49qjg5 v/HVl2sfnXuu8r7KPKKz5urmxgXxHAecf/c8T/7NsK/AJcN2/8471RsttyUf+qJx98x5pzPy qbqf9D8W2Fspf7r/cLpBrY4SS3FGoqEWc1FxIgDXb14/oQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrAJMWRmVeSWpSXmKPExsVy+t/xq7oWjlLRBtc381psnLGe1eJz7xFG i7VH7rJbnDl9idXi+NpwB1aPO9f2sHlsudrO4tG3ZRWjx+dNcgEsUVw2Kak5mWWpRfp2CVwZ 75Y8YimYz1Nx/H4XSwNjK1cXIyeHhICJRO/ppcxdjFwcQgJLGCVmztrEDuE0MUksudzIBFLF JmAo0fW2iw3EFhGQkZh6ZT8rSBGzwG5GicfbNrODJIQF4iQ+NL5gBrFZBFQl1vw7yQpi8wrY Svx6fIIZYp28xOoNB5gnMHItYGRYxSiSWlqcm55bbKhXnJhbXJqXrpecn7uJEejvbcd+bt7B eGlj8CFGAQ5GJR7eBCvJaCHWxLLiytxDjBIczEoivM+UpKKFeFMSK6tSi/Lji0pzUosPMUpz sCiJ8543qIwSEkhPLEnNTk0tSC2CyTJxcEo1MDr5aSc3u1nVvll8td/q7+wSofkLbZ3+mv4/ fEc3b6oFt3C0JvvOdd05ekr9S2P+GutlirSHWd2oqU/r1rZZNddqbvSXvxl63pdNM+18OTq+ 3ldJz0i+9ZWv9usSieuvYg9r83+KYbzOWW/A8uv9Dp1JsiFWW7b4d0cEGJ6tfD4rV+rfZAth JZbijERDLeai4kQAX5NMkPMBAAA= X-CMS-MailID: 20180608084128eucas1p270adc2869c111aa55a99200b11cc8aa1 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180608084128eucas1p270adc2869c111aa55a99200b11cc8aa1 References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org When device links with DL_FLAG_PM_RUNTIME are created during consumer probe, the supplier device is unconditionally runtime activated by pm_runtime_get_sync(). However this get() is not noticed by rpm_put_suppliers() called at the end of probe(), because the newly created link lacks a rpm_active state bit. This worked when probe() called pm_runtime_(resume,suspend)_suppliers() unconditionally, but patch 1e8378619841 ("PM / runtime: Fixup reference counting of device link suppliers at probe") changed probe() to rely on the generic rpm_put_suppliers() code. This patch updates the newly created link state to proper value. Fixes: 1e8378619841 ("PM / runtime: Fixup reference counting of device link suppliers at probe") Signed-off-by: Marek Szyprowski --- This fixes Exynos IOMMU driver being unconditionally set to runtime active state since the mentioned commit. --- drivers/base/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 Reviewed-by: Ulf Hansson diff --git a/drivers/base/core.c b/drivers/base/core.c index ad7b50897bcc..8ffd353f40ce 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -259,8 +259,10 @@ struct device_link *device_link_add(struct device *consumer, * runtime PM usage counter after consumer probe * in driver_probe_device(). */ - if (flags & DL_FLAG_PM_RUNTIME) + if (flags & DL_FLAG_PM_RUNTIME) { pm_runtime_get_sync(supplier); + link->rpm_active = true; + } link->status = DL_STATE_CONSUMER_PROBE; break;