From patchwork Fri Jun 17 06:26:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 70283 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp126391qgy; Thu, 16 Jun 2016 23:28:41 -0700 (PDT) X-Received: by 10.98.59.77 with SMTP id i74mr617924pfa.45.1466144921621; Thu, 16 Jun 2016 23:28:41 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8si1730297pac.132.2016.06.16.23.28.41; Thu, 16 Jun 2016 23:28:41 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665AbcFQG20 (ORCPT + 14 others); Fri, 17 Jun 2016 02:28:26 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:57146 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755198AbcFQG1U (ORCPT ); Fri, 17 Jun 2016 02:27:20 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O8W00MCOKLESF90@mailout3.w1.samsung.com>; Fri, 17 Jun 2016 07:27:14 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-28-576398426c4d Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id EE.5F.04866.24893675; Fri, 17 Jun 2016 07:27:14 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O8W00HUZKL21910@eusync4.samsung.com>; Fri, 17 Jun 2016 07:27:14 +0100 (BST) From: Marek Szyprowski To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marek Szyprowski , Joerg Roedel , Inki Dae , Kukjin Kim , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , "Rafael J. Wysocki" , Ulf Hansson , Mark Brown , Greg Kroah-Hartman Subject: [PATCH v2 06/10] driver core: Avoid endless recursion if device has more than one link Date: Fri, 17 Jun 2016 08:26:56 +0200 Message-id: <1466144820-6286-7-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1466144820-6286-1-git-send-email-m.szyprowski@samsung.com> References: <1466144820-6286-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLLMWRmVeSWpSXmKPExsVy+t/xa7pOM5LDDe4947DYOGM9q8XUh0/Y LJoXr2ezmHR/AovFgv3WFp2zN7BbvH5haNH/+DWzxabH11gtLu+aw2bxufcIo8WM8/uYLNYe uctuceb0JVaL42vDHfg9nhycx+SxaVUnm8eda3vYPPbPXcPusXlJvcfkG8sZPbZcbWfx6Nuy itHj8ya5AM4oLpuU1JzMstQifbsEroy5XYEFM9gqHvz/x9LAOJ+1i5GTQ0LAROLGtPWMELaY xIV769m6GLk4hASWMkqc/rieFcJpYpL4se4zG0gVm4ChRNfbLrAqEYGVjBLb9uxjBnGYBRYy SzSvaWYBqRIWSJS4u+kKE4jNIqAqsX3TCrA4r4C7RMPi5ywQ++QkTh6bDHYHp4CHxItbP8Di QkA1uw6fYp7AyLuAkWEVo2hqaXJBcVJ6rpFecWJucWleul5yfu4mRkggf93BuPSY1SFGAQ5G JR7eFaLJ4UKsiWXFlbmHGCU4mJVEeEsmAYV4UxIrq1KL8uOLSnNSiw8xSnOwKInzztz1PkRI ID2xJDU7NbUgtQgmy8TBKdXAWHlXgy3q0/uZx9oW/uo9Je7jdaDXYrZOYseR1r/apjO1W5k2 rK2tu8+st1JzfWex9z2pV3dOHl07lfOHQ9FdvhkajbXhJ81C9hmFP1TdeOKtk09o1U75ZO0G h815cl+mlOkrXndveNY4Y7en6oPVBg0dUvsPME151Djd707Ex8wnE9Y2W6osV2Ipzkg01GIu Kk4EADvtkZdgAgAA Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patch fixes endless recursion, which happends when device has more than one link. Signed-off-by: Marek Szyprowski --- drivers/base/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/core.c b/drivers/base/core.c index 215cd44de761..4e778539b750 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -57,7 +57,8 @@ static int device_reorder_to_tail(struct device *dev, void *not_used) device_pm_move_last(dev); device_for_each_child(dev, NULL, device_reorder_to_tail); list_for_each_entry(link, &dev->consumer_links, c_node) - device_reorder_to_tail(link->consumer, NULL); + if (link->consumer != dev) + device_reorder_to_tail(link->consumer, NULL); return 0; }