Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752114AbdLUN3W (ORCPT ); Thu, 21 Dec 2017 08:29:22 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:44829 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751818AbdLUN3T (ORCPT ); Thu, 21 Dec 2017 08:29:19 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20171221132917euoutp0237123800a613e380681bf373ef4b12df~CUlbOWqPv0927809278euoutp02Z X-AuditID: cbfec7f5-f79d06d0000031c7-e6-5a3bb72c47bd Subject: Re: [PATCH v3 4/4] regulator: core: Balance coupled regulators voltages To: Mark Brown Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Liam Girdwood , Rob Herring , Mark Rutland , Marek Szyprowski , Bartlomiej Zolnierkiewicz From: Maciej Purski Message-id: Date: Thu, 21 Dec 2017 14:29:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-version: 1.0 In-reply-to: <20171215151958.GH1827@finisterre> Content-type: text/plain; charset="windows-1252"; format="flowed" Content-language: en-US Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMKsWRmVeSWpSXmKPExsWy7djP87o6262jDHoaFCw2zljPajH14RM2 i/lHzrFafLvSwWRxedccNou1R+6yWyy9fpHJonXvEXYHDo8189YweuycdZfdY9OqTjaPvi2r GD0+b5ILYI3isklJzcksSy3St0vgyli+9xprQSdPxe5pPxkbGG9xdjFyckgImEgc69/LBGGL SVy4t56ti5GLQ0hgKaPEou+TWCCcz4wSh9/NZ4bpWN12EKpqGaPEuQ1TWCGcZ4wSc2f0g80S FgiSmPxxOxuILSKgLHH1+16wUcwCE5kkLvxZDFTEwcEmoCWxpj0epIZXwE5i/YZF7CA2i4Cq RHfrf0YQW1QgQuL44eWMEDWCEj8m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Yzy07GLveBR9iFOBgVOLh vZFqFSXEmlhWXJl7iFGCg1lJhPfwEusoId6UxMqq1KL8+KLSnNTiQ4zSHCxK4ry9e1ZHCgmk J5akZqemFqQWwWSZODilGhjtfyq8NYk7M03h2fytyTazBOY3f7T8EP+jOnSKrpz7A6POZWbn OlUK/KvCF+rrR049bLhgcvklP5Z5z/RavvtO3SQktfqLOl+FMMOz7VO8GmT605+HOTx+1uW9 h3PeZPvzbFsqZZ4vZHW3edFmmHbjrWrE+T1cYlMqduzQPVYk2VX6l1Mu1kSJpTgj0VCLuag4 EQAvGzGwiwIAAA== X-CMS-MailID: 20171221132915eucas1p203cd8f6a1ab419d165a0b77144afb068 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20171207094754eucas1p1528c6c30135124430a5c703eb81de8d2 X-RootMTR: 20171207094754eucas1p1528c6c30135124430a5c703eb81de8d2 References: <1512639975-22241-1-git-send-email-m.purski@samsung.com> <1512639975-22241-5-git-send-email-m.purski@samsung.com> <20171212115427.GG16323@sirena.org.uk> <0bca0d20-1ca8-be4c-a60e-bbc0c640ae41@samsung.com> <20171215151958.GH1827@finisterre> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1520 Lines: 29 On 12/15/2017 04:19 PM, Mark Brown wrote: > On Wed, Dec 13, 2017 at 10:25:00AM +0100, Maciej Purski wrote: > >>> shared. To that end I'd adjust the code so that we always have a >>> coupling descriptor and then handle the case where there's only one >>> regulator described in there. > >> Do you have any suggestion, how should I implement that path? The thing which >> makes it more complicated is locking, because set_voltage_unlocked is done >> under one regulator's mutex and its suppliers, while balance procedure locks >> every coupled regulator without its suppliers. The suppliers for a single >> regulator are locked when setting a single regulator's voltage takes place. > > We only really need to lock the supplies when doing the actual mechanics > of voltage changes so I'm not sure I see a big issue here - if we always > go through balancing first then voltage setting it should be fine. If > everything is always balancing (even uncoupled regulators) then part of > the transition should be moving some if not all of the data updates to > balancing. > Now I can understand your point, but I still have doubts what is the advantage of that solution. For non-coupled regulators we end up with useless data structure - coupling_desc. That also might cause some confusion. We expect coupled regulators to be a very rare case, so in most of the cases we will have a pointless structure in reg_dev with a pointer to itself. Maybe you suggest that coupling_desc should contain something different?