Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2950057imm; Thu, 24 May 2018 19:43:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoXpPElHAsXfjUnTaIbOJ3folLGuwfPAV7/lUhCIi4CMl36y9qzM/7Pnn15VmwPSL8oK4SE X-Received: by 2002:a62:415d:: with SMTP id o90-v6mr611394pfa.140.1527216226588; Thu, 24 May 2018 19:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527216226; cv=none; d=google.com; s=arc-20160816; b=I4ZYhuinVTYrif+qTiq0mjAtWYhK1TaDb5PNIn9uFcVS2R6NUS9zBGO6IF1S/X8Y7H N7R5cX1n2Rf5ypr5Syf9XhQRCxW3NY0MmLsV9E2zjlIJX96gE/pfHoID1771JT6II7Cs Mtw7XAgvaefF2Q/92yI46tashKj8vxWZYxwrSJEG8eiPdpLhuNd8Pt/WSBKHux0nHI9r EV8VDuCl6k8LPzIRcEXGVCnABg/stsTotpW1lwYRhZxOxjNg3xpymePgT0OJmvRjg+GV w1mEvMNEx7jWrOSgKmIaQFdKOe2HzzOHMMzltsa+B3eAIsHpZgvrO2L8PWT8w2yhPbge PybA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=bFuAMiY/FFTZkANZA6LZWv5vrZcTbILn7tN695IurK4=; b=GYWoLCLuHDfF/a14+FoPP+ZQqRQGA0SoTmHVGYjcCDaVJYdlXpm8H6pZZU24wj8pgf OXO/k06ni1ymYAEKeov4QE+KsOYcBgC+XhRzYvB6j86JuzEkTJeg/qo5UmSTX0azv/av 7krdtkVWZu6tk98Ukd9e+2RUDMlGvekb3VOq4ctgQo9YEFHWuZEQ/LhxZzOo6HXEWNF7 crtPDOpn++m0TtzsN7wLSwNeCGrZrOqcgks7lGYlCC+Af+ebix40150gIqbYmOJjguXB MhWUp84UwnpF2jhN+Kn/N7flbitusC7Br8LFKJ+4qLCUrgFw8ZaePKXK/4eEOUvEmnoH /wvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=khaxhdwd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l67-v6si22546307pfg.326.2018.05.24.19.43.32; Thu, 24 May 2018 19:43:46 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=khaxhdwd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969377AbeEXVVe (ORCPT + 99 others); Thu, 24 May 2018 17:21:34 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:38803 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967358AbeEXVVb (ORCPT ); Thu, 24 May 2018 17:21:31 -0400 Received: by mail-io0-f182.google.com with SMTP id z4-v6so4034387iof.5 for ; Thu, 24 May 2018 14:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bFuAMiY/FFTZkANZA6LZWv5vrZcTbILn7tN695IurK4=; b=khaxhdwd+lirD+rPggF5F8e91DGodCm4/N6rZC+P3I68U3fC9mobq9EWIMbHTJTgQn 6Abkm1O/G9eGqDIwsLsswwKK/AoxzeiOff5ESqa+Hswrn+hrSmBJ/aaQzxkxbZd5iY/n rW7uxxz7u3uSh8SnjIqqiflKGQz+VF/rUHj+U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bFuAMiY/FFTZkANZA6LZWv5vrZcTbILn7tN695IurK4=; b=XzkOD8xZZbYk1+zHh3SDQLNXhxUE73VkE7ZmFLcMNZE/5fJ9poCQZRil/ZQW3fm1d9 W0nZt1QZ62PB6u3W7BIDTEyA2KETo9IYFrn/oMA4LiyXGqdA86g+PetDPi8or/NSml0c rcOQkmF1TUStIxz7R4xo4CHhQla8EZXMhM/mTSYeqQPkEYqnWKeX+6W050WVqIO5/JYn HqkyNs3u31XzFksX1zUsQyQEQERuvGMpQ9w9xS19pJKu5G6pHpD8CxDjeWP7VmPKf1nj DKFmUm1uThIHkqL9ukt4YufcNyZIdPyfcvMRDhrCqRstA5zQ5uOyygOobDzl+55J6T0B +LDg== X-Gm-Message-State: ALKqPweak/XNFL+5bDIOg+LzTzRUT2228hkrYBfoXCTXyXEHrZyr6RQa dbRG4kazeq9rh6E81XJNO00WEupQpzBDQcokB/7WyHSw X-Received: by 2002:a6b:1456:: with SMTP id 83-v6mr8218291iou.218.1527196890934; Thu, 24 May 2018 14:21:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:7353:0:0:0:0:0 with HTTP; Thu, 24 May 2018 14:21:30 -0700 (PDT) In-Reply-To: <96169281-49b2-121f-0b7e-f54aae66db91@nvidia.com> References: <1526639490-12167-1-git-send-email-ulf.hansson@linaro.org> <1526639490-12167-9-git-send-email-ulf.hansson@linaro.org> <5a79d3a2-d090-645b-da69-524b7e7a4d90@nvidia.com> <51f7de26-579a-8b9e-4e79-f4eee923ab38@codeaurora.org> <3838f17a-2ac8-bf3f-f0b1-f69bbe17629c@nvidia.com> <1687797a-93f1-7e5c-6060-01c12c070964@nvidia.com> <96169281-49b2-121f-0b7e-f54aae66db91@nvidia.com> From: Ulf Hansson Date: Thu, 24 May 2018 23:21:30 +0200 Message-ID: Subject: Re: [PATCH 8/9] PM / Domains: Add support for multi PM domains per device to genpd To: Jon Hunter Cc: Rajendra Nayak , Geert Uytterhoeven , Linux PM , Greg Kroah-Hartman , Kevin Hilman , "Rafael J . Wysocki" , Linux Kernel Mailing List , Todor Tomov , Viresh Kumar , linux-tegra@vger.kernel.org, Vincent Guittot , Linux ARM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [...] >>> >>> * genpd_dev_pm_attach_by_id() - Attach a device to one of its PM domain. >>> * @dev: Device to attach. >>> * @index: The index of the PM domain. >>> >>> This naming and description is a bit misleading, because really it is not >>> attaching the device that is passed, but creating a new device to attach >>> a >>> PM domain to. So we should consider renaming and changing the description >>> and indicate that users need to link the device. >> >> >> I picked the name to be consistent with the existing >> genpd_dev_pm_attach(). Do you have a better suggestion? > > > Well, it appears to get more of a 'get' function and so I don't see why we > could not have 'genpd_dev_get_by_id()' and then we could have a > genpd_dev_put() as well (which would call genpd_dev_pm_detach). > >> I agree, some details is missing to the description, let me try to >> improve it. Actually, I was trying to follow existing descriptions >> from genpd_dev_pm_attach(), so perhaps that also needs a little >> update. >> >> However, do note that, neither genpd_dev_pm_attach() or >> genpd_dev_pm_attach_by_id() is supposed to be called by drivers, but >> rather only by the driver core. So description may not be so >> important. >> >> In regards to good descriptions, for sure the API added in patch9, >> dev_pm_domain_attach_by_id(), needs a good one, as this is what >> drivers should be using. > > > OK. Same appears to apply here to the description as I mentioned above. > Still seems to be more of a 'get' than an attach. So I wonder if it should > be dev_pm_domain_get_by_id() instead? Regarding "get" vs "attach", I suggest we continue to discuss that in patch 9. Whatever is decided, $subject patch needs to follow. > >>> Finally, how is a PM domain attached via calling >>> genpd_dev_pm_attach_by_id() >>> detached? >> >> >> Via the existing genpd_dev_pm_detach(), according to what I have >> described in the change log. I clarify the description in regards to >> this as well. > > > OK, so this bit is a to-do as that is not yet exposed AFAICT. I see that you > said 'although we need to extend it to cover cleanup of the earlier > registered device, via calling device_unregister().' So if we do this then > that would be fine. Let me clarify the changelog. It's not a to-do, as it's already done as part of $subject patch. So I guess we are in agreement that we don't need another API to deal with detach? Kind regards Uffe