Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp450748rdb; Tue, 23 Jan 2024 04:57:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQbhKPPfodzvnLke6VBJV+yj135hkIXMNsSdfNhwhO6pFVOsk5CI4Hu7PWCM9miq+VFnHR X-Received: by 2002:a5b:9d1:0:b0:dbe:30ec:6220 with SMTP id y17-20020a5b09d1000000b00dbe30ec6220mr3188618ybq.85.1706014621424; Tue, 23 Jan 2024 04:57:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706014621; cv=pass; d=google.com; s=arc-20160816; b=AZxzFbri7olnmUk0eoFCN47BaBmdmwgRDs0tuIgsY9YiUuz6s3OoS07L5i9JmjzFAH CN42i/zFHJyxIvusLxnQKDs3x/IcB1VlsDCTrWXDgFy40kTGgo8w0L/WiRvhsXt8x/Dt 0518Pe0HjZpR7BNJ3ZpVPnqUGCMXrFex6VDfSKppm3oCP31sFEjYnQ6hvcplIImURgcU a7mqhr+DfiKtiEqtI59+VVttwZmpUzTmfBmSN5vQ0847r0DPTgyvOU63Sh0iy4AWNDwN YpGSbhxs+Cq3YiZUr6HXnTnTfjOBbKhNPaOTTjpRSbuq6b3nyQB7vbcGOC8GyxQTfULl kMSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=Z+asE/AToOCsan6HoT4XnPwjdlU0T+m2L6pRIK9YYNg=; fh=KxdscRHZ1euspA7qJazTzcZ+rFaZhonR5KdhB5HeyRs=; b=zfMIO09nL8IejExvX8ynb87KwZ7TIeyE1zWX1ddtk1QdMzYQekjoMAnrio5NywYVhS 9BB2bPa4pc5C8Zx25LIF2k/g+2V9GbTQdjQtjkmAdVLZ+sein1EG3zfPzpNi+Mh5JsVE td8NfynvwkTEkVClPdw49LCZzmDCPFE16q8IGgxwFU+x/aCiTzM8oNhWi+9Ydog2GaSw I6aSLBkYGDuKTChoW5FhwAjQYDdhAFoxIv9QM04AZPnQwXy7Py/t5QrIz0nbdjbQEdSN mVr2nfq2u6OJOukrQCPFbh9Wdra4u6ssDZqupx/kc+ov/4Yyr8zwyTalJLiwZelDQl6r 5Vog== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=miusm1XE; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-35278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35278-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x11-20020ae9e90b000000b007834bf573dfsi7843374qkf.284.2024.01.23.04.57.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 04:57:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=miusm1XE; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-35278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35278-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 320CA1C22D21 for ; Tue, 23 Jan 2024 12:57:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4DC105F54E; Tue, 23 Jan 2024 12:53:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="miusm1XE" Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF229604B7 for ; Tue, 23 Jan 2024 12:53:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706014435; cv=none; b=GsSheGZVJpGjnq+Qz+yfXsiWJ/j21IOS+rV8ArMF0ar7MFjPY+tRBHNO/Q7375k3p+Gxl704UOYAwnFpuB+5tsEr7koce0/nBGdKUhjXE80XxrVRniXE4D12GYK3NHUMaOhRjVVdoQFFEhprIEooYXY4rirN7/NumZ+uuVuCjQM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706014435; c=relaxed/simple; bh=SrubDBE5WcpcfK7f3xovnFiXn5W/MQUApTBY96p2ZzE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=fxiXfUeHcIQtMnRZ5WqtMCV//+Smy0DbLR9m6mnu2Xepf3UEetXyXmD2CW//UhOdj/U4bjF+A8ZpLSW0SsxtkoycTt93u99pBCYyTAkTYhuVkrjYLKMRYcaTTpIAH7JlKPszRq59emh9rQbj2CILOHtEKYOt9cE/zP4vmWaJJTk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=miusm1XE; arc=none smtp.client-ip=209.85.128.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-600094c5703so17267697b3.3 for ; Tue, 23 Jan 2024 04:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706014433; x=1706619233; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Z+asE/AToOCsan6HoT4XnPwjdlU0T+m2L6pRIK9YYNg=; b=miusm1XEW4kveUW39ihoH7X2eavQf30EvZ5jgVfQWWY/zt/IWT22Rm+4iDYPEIVkki 2TLNjczpT94D4VDDycDi6L03wipZAqwwisLsWa/xIxepIGeqP0cVZxjK0dXzHL6K+jgc M8ApoJ1YNlZXrp7Q80rdHzUeWd5/seBUnP06WpRchKAb4aYecJLRtYbmICvX+KWaukaP TRmKIJ4zm2CDeoHgCsRBkPfphfQdDdtcJIjGzzmXmj/Q7BNpjvM2fdD/606BivVFpJxb Gbu/LHx9nlo6APz1V7Hb4mJO8/IK2RmitPxp+HlO7Y8mIKJ6w+Kvjs4dXOzx1TXdAz4p Stww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706014433; x=1706619233; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Z+asE/AToOCsan6HoT4XnPwjdlU0T+m2L6pRIK9YYNg=; b=MgIWHOvXM39XFQ7VVt6+WofBH+CyIAmbtfvQWq1lOhTIsAyShlQUTWCDKZ6IPASvx9 +ZvcpjXGFQ9iZZVMUYhxo1/C92e/7/JMd7i4zTF5s+3hzJKQi/eMNp4Anpmwtn2KPqvx lV0nYl6ljC1J0jfNqSGgpXdIPz4DyzPVKAEEGYTB7JTjgG0q8MRXFpwuJuN1E/CyLZyq NBEi7blDHRsWmceuyqagSrMWgfXXF2o0jiSAmCQugVz6lsaw2MKKkiXgbQ7E7dUVHERl hBPP/29grTYuN3rPZ3f++DlA5vdnJRIl+mArh7cE5OW48u9WhBU5H+ta/dU/Pl32AIfd BweA== X-Gm-Message-State: AOJu0YzdMWchb1hiD3U6tN6t0PEJYrZtp/n0H/JdE7LWwC5zigyDEoO/ t5w86lmxsr/QsWbeXeZ+obusgF+TbAbLki4+PkZ7VFJt6m1ccw8Gd2UMYwNq3WpzjhXTT5kUlN6 a5xyFP+K/BPNEpNHcZc+nOxF5+XH/Tx3AIFDX3A== X-Received: by 2002:a81:9113:0:b0:5e3:320b:7c with SMTP id i19-20020a819113000000b005e3320b007cmr4912440ywg.37.1706014432844; Tue, 23 Jan 2024 04:53:52 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240122-gdsc-hwctrl-v4-0-9061e8a7aa07@linaro.org> <20240122-gdsc-hwctrl-v4-1-9061e8a7aa07@linaro.org> In-Reply-To: <20240122-gdsc-hwctrl-v4-1-9061e8a7aa07@linaro.org> From: Ulf Hansson Date: Tue, 23 Jan 2024 13:53:17 +0100 Message-ID: Subject: Re: [PATCH v4 1/5] PM: domains: Allow devices attached to genpd to be managed by HW To: Abel Vesa Cc: "Rafael J. Wysocki" , Kevin Hilman , Pavel Machek , Len Brown , Greg Kroah-Hartman , Bjorn Andersson , Andy Gross , Konrad Dybcio , Michael Turquette , Stephen Boyd , Stanimir Varbanov , Vikash Garodia , "Bryan O'Donoghue" , Mauro Carvalho Chehab , Taniya Das , Jagadeesh Kona , Dmitry Baryshkov , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="UTF-8" [...] > + > +/** > + * dev_pm_genpd_get_hwmode - Get the HW mode setting for the device. > + * > + * @dev: Device for which the current HW-mode setting should be fetched. > + * > + * This helper function allows consumer drivers to fetch the current HW mode > + * setting of its the device. > + * > + * It is assumed that the users guarantee that the genpd wouldn't be detached > + * while this routine is getting called. > + */ > +bool dev_pm_genpd_get_hwmode(struct device *dev) > +{ > + struct generic_pm_domain *genpd; > + > + genpd = dev_to_genpd_safe(dev); > + if (!genpd) > + return false; > + > + if (genpd->get_hwmode_dev) > + return genpd->get_hwmode_dev(genpd, dev); Not sure why I haven't spotted this before - but we should probably assign dev_gpd_data(dev)->hw_mode here, rather than returning the result from the callback directly. > + > + return dev_gpd_data(dev)->hw_mode; > +} > +EXPORT_SYMBOL_GPL(dev_pm_genpd_get_hwmode); [...] Kind regards Uffe