From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755003AbcI2G67 (ORCPT ); Thu, 29 Sep 2016 02:58:59 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:19607 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754025AbcI2G6t (ORCPT ); Thu, 29 Sep 2016 02:58:49 -0400 X-AuditID: cbfec7f4-f791c6d000006eac-78-57ecbba5bf73 Subject: Re: [PATCH v4 0/5] Functional dependencies between devices To: "Rafael J. Wysocki" , Linux PM list Cc: Greg Kroah-Hartman , Alan Stern , Linux Kernel Mailing List , Tomeu Vizoso , Mark Brown , Lukas Wunner , Kevin Hilman , Ulf Hansson , "Luis R. Rodriguez" From: Marek Szyprowski Message-id: Date: Thu, 29 Sep 2016 08:58:43 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-version: 1.0 In-reply-to: <10860219.QqH5akBVoh@vostro.rjw.lan> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02SbUhTURjHObt317vl6jbfnnythURalrQPFwtRCrof/CBFjUTJkTeVnMqm lho6FV+aaZaINisnvnyYc8J8QXxNEyU1UZcmlIZpWqkFWaJplttV8NvvnPN7zvP8D4fExM18 ZzI6NoFVxspjJIQQb+nfGDld074sO5vxw4kumZ0n6KyqBoL+3DjHo81tzwh6taAP0V8WXejF 150YPTw0zqeLNkcJurB+nKAH6mUBB5jW6WrEmPQPCObDZAfBdD832DBNE7k4Uz69jpiGpgmc WTW5M2W5LfxgQYjwQgQbE53EKs/4hwuj8qsV8Tr3e+WrYzw1qgcNEpBASaEoy4Bz7AijMw2E BglJMVWDoLPBhHGLVQQFc1v8vQrtkpGwsJiqRVC4EMZJiwjq1QYbDSJJO+oidL07Z3HsKRn0 m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4CZxJeXh1kh bHmJzWveMk9gFJiFpGUWkrJZSMoWMDKvYhRJLS3OTc8tNtIrTswtLs1L10vOz93ECIzTbcd+ btnB2PUu+BCjAAejEg9vx6nX4UKsiWXFlbmHGCU4mJVEeOV2vQkX4k1JrKxKLcqPLyrNSS0+ xGgK9MREZinR5HxgCskriTc0MTS3NDQytrAwNzJSEued+uFKuJBAemJJanZqakFqEUwfEwen VAOjxoIoB77pcZ85z7SUNm2Tzckr1222PDU1hvPuFf28s13n5BWVfRg1X++y8T0ukFi2/m/e 9tR9Upo/4vfx6J5gdLeatZXHxTE3wWDPcg0DFcOItwbcl95KT8v+vMrvdnG7UfAm4cUXIuui pzenLxJUv2rJqRdd/HRxgbLAVM915h+TYmwmNimxFGckGmoxFxUnAgBZ9/vL6QIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20160929065844eucas1p1b45a87da7a5b28c8b895c18152ca2f06 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20160929003536eucas1p1aecbfc8dc35c3a782185abe475bc3daa X-RootMTR: 20160929003536eucas1p1aecbfc8dc35c3a782185abe475bc3daa References: <27296716.H9VWo8ShOm@vostro.rjw.lan> <10860219.QqH5akBVoh@vostro.rjw.lan> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rafael, On 2016-09-29 02:24, Rafael J. Wysocki wrote: > Hi Everyone, > > On Thursday, September 08, 2016 11:25:44 PM Rafael J. Wysocki wrote: >>> Hi Everyone, >>> >>> This is a refresh of the functional dependencies series that I posted last >>> year and which has picked up by Marek quite recently. For reference, >>> appended is my introductory message sent previously (which may be >>> slightly outdated now). >>> >>> As last time, the first patch rearranges the code around >>> __device_release_driver() a bit to prepare it for the next one (it >>> actually hasn't changed AFAICS). >>> >>> The second patch introduces the actual device links mechanics, but without >>> system suspend/resume and runtime PM support which are added by the >>> subsequent patches. >>> >>> Some bugs found by Marek during his work on these patches should be fixed >>> here. In particular, the endless recursion in device_reorder_to_tail() >>> which simply was broken before. >>> >>> There are two additional patches to address the issue with runtime PM >>> support >>> that occured when runtime PM was disabled for some suppliers due to a PM >>> sleep transition in progress. Those patches simply make runtime PM >>> helpers >>> return 0 in that case which may be controversial, so please let me know if >>> there are concerns about those. >>> >>> The way device_link_add() works is a bit different, as it takes an >>> additional >>> status argument now. That makes it possible to create a link in any >>> state, >>> with extra care of course, and should address the problem pointed to by >>> Lukas >>> during the previous discussion. >>> >>> Also some comments from Tomeu have been addressed. >> An update here. >> >> The first patch hasn't changed, so I'm resending it. >> >> The majority of changes in the other patches are in order to address Lukas' >> comments. >> >> First off, I added a DEVICE_LINK_STATELESS flag that will prevent the driver >> core from trying to maintain device links having it set. >> >> Also, the DEVICE_LINK_PERSISTENT flag was dropped (as link "persistence" is >> the default behavior now) and there's a new one, DEVICE_LINK_AUTOREMOVE, >> that will cause the driver core to remove the link on the consumer driver >> unbind. >> >> Moreover, the code checks attempts to create a link between a parent and a >> child device now and actively prevents that from happening. >> >> The changelog of the second patch has been updated as requested by Ulf. >> >> The third patch was updated to fix a bug related to the (previously missing) >> clearing of power.direct_complete for supplier devices having consumers that >> don't use direct_complete. >> >> The next two (runtime PM) patches turned out to be unnecessary, so I've >> dropped them. >> >> The runtime PM patch [4/5] was reorganized somewhat to reduce the >> indentation >> level in there, but the code flow introduced by it is essentially the same >> and the last patch was simply rebased on top of the new series. > Time for another update. :-) > > Fewer changes this time, mostly to address issues found by Lukas and Marek. > > The most significant one is to make device_link_add() cope with the case when > the consumer device has not been registered yet when it is called. The > supplier device still is required to be registered and the function will return > NULL if that is not the case. > > Another significant change is in patch [4/5] that now makes the core apply > pm_runtime_get_sync()/pm_runtime_put() to supplier devices around the probing > of a consumer one (in analogy with the parent). Thanks for the update! Updated version fixes all the remaining issues. Tested-by: Marek Szyprowski Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland