Re: [PATCH v1 1/1] treewide: Align match_string() with sysfs_match_string()

2024-06-04 Thread Sakari Ailus
Hi Andy,

On Sun, Jun 02, 2024 at 06:57:12PM +0300, Andy Shevchenko wrote:
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index 503773707e01..9cb350de30f0 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -798,7 +798,7 @@ static bool acpi_info_matches_ids(struct acpi_device_info 
> *info,
>   if (!(info->valid & ACPI_VALID_HID))
>   return false;
>  
> - index = match_string(ids, -1, info->hardware_id.string);
> + index = __match_string(ids, -1, info->hardware_id.string);
>   if (index >= 0)
>   return true;
>  
> @@ -809,7 +809,7 @@ static bool acpi_info_matches_ids(struct acpi_device_info 
> *info,
>   return false;
>  
>   for (i = 0; i < cid_list->count; i++) {
> - index = match_string(ids, -1, cid_list->ids[i].string);
> + index = __match_string(ids, -1, cid_list->ids[i].string);
>   if (index >= 0)
>   return true;
>   }

Reviewed-by: Sakari Ailus  # drivers/acpi

-- 
Sakari Ailus


[PATCH v5 0/2] Small runtime PM API changes

2024-01-30 Thread Sakari Ailus
Hi folks,

Here's a small but a different set of patches for making two relatively
minor changes to runtime PM API. I restarted version numbering as this is
meaningfully different from the previous set.

pm_runtime_get_if_active() loses its second argument as it only made sense
to have ign_usage_count argument true.

The other change is also small but it has an effect on callers:
pm_runtime_put_autosuspend() will, in the future, be re-purposed to
include a call to pm_runtime_mark_last_busy() as well. Before this,
current users of the function are moved to __pm_runtime_put_autosuspend()
(added by this patchset) which will continue to have the current
behaviour.

I haven't included the conversion patches in this set as I only want to do
that once this set has been approved and merged. The tree specific patches
can be found here, on linux-next master (there are some V4L2 patches
there, too, please ignore them for now):
https://git.kernel.org/pub/scm/linux/kernel/git/sailus/linux-next.git/log/?

Later on, users calling pm_runtime_mark_last_busy() immediately followed
by __pm_runtime_put_autosuspend() will be switched back to
pm_runtime_put_autosuspend() once its behaviour change has been done (a
patch near top of that branch). I'll provide these once the preceding ones
have been merged.

Comments are welcome.

since v4:

- patch 1: Squash patch 2
  
https://lists.freedesktop.org/archives/dri-devel/2024-January/438739.html>.

- patch 1: Add to documentation of pm_runtime_get_if_{active,in_use} that
  if PM runtime is disabled, an error is returned and the usage_count
  remains unmodified.

- patch 1: Fix spelling of "explicitly" in the commit message.

- Use upper case "PM:" prefix in subject.

since v3:

- patch 1: Drop the previously added documentation on driver use of
  pm_runtime_get_conditional().

- Add a patch to make pm_runtime_get_conditional() static, including
  switching i915 to pm_runtime_get_if_{active,in_use}.

since v2:

- Rebase on v6.8-rc1 (no changes).

- Add Rodrigo's Reviewed-by: to the 1st patch.

since v1:

- patch 1: Rename __pm_runtime_get_conditional() as
  pm_runtime_get_conditional().

- patch 1: Reword documentation on driver use of
  pm_runtime_get_conditional().

Sakari Ailus (2):
  PM: runtime: Simplify pm_runtime_get_if_active() usage
  PM: runtime: Add pm_runtime_put_autosuspend() replacement

 Documentation/power/runtime_pm.rst  | 22 +---
 drivers/accel/ivpu/ivpu_pm.c|  2 +-
 drivers/base/power/runtime.c| 35 +++--
 drivers/gpu/drm/i915/intel_runtime_pm.c |  5 +++-
 drivers/gpu/drm/xe/xe_pm.c  |  2 +-
 drivers/media/i2c/ccs/ccs-core.c|  2 +-
 drivers/media/i2c/ov64a40.c |  2 +-
 drivers/media/i2c/thp7312.c |  2 +-
 drivers/net/ipa/ipa_smp2p.c |  2 +-
 drivers/pci/pci.c   |  2 +-
 include/linux/pm_runtime.h  | 30 ++---
 sound/hda/hdac_device.c |  2 +-
 12 files changed, 73 insertions(+), 35 deletions(-)

-- 
2.39.2



[PATCH v5 1/2] PM: runtime: Simplify pm_runtime_get_if_active() usage

2024-01-30 Thread Sakari Ailus
There are two ways to opportunistically increment a device's runtime PM
usage count, calling either pm_runtime_get_if_active() or
pm_runtime_get_if_in_use(). The former has an argument to tell whether to
ignore the usage count or not, and the latter simply calls the former with
ign_usage_count set to false. The other users that want to ignore the
usage_count will have to explicitly set that argument to true which is a
bit cumbersome.

To make this function more practical to use, remove the ign_usage_count
argument from the function. The main implementation is in a static
function called pm_runtime_get_conditional() and implementations of
pm_runtime_get_if_active() and pm_runtime_get_if_in_use() are moved to
runtime.c.

Signed-off-by: Sakari Ailus 
Reviewed-by: Alex Elder 
Reviewed-by: Laurent Pinchart 
Acked-by: Takashi Iwai  # sound/
Reviewed-by: Jacek Lawrynowicz  # 
drivers/accel/ivpu/
Acked-by: Rodrigo Vivi  # drivers/gpu/drm/i915/
Reviewed-by: Rodrigo Vivi 
Acked-by: Bjorn Helgaas  # drivers/pci/
---
 Documentation/power/runtime_pm.rst  |  5 ++--
 drivers/accel/ivpu/ivpu_pm.c|  2 +-
 drivers/base/power/runtime.c| 35 +++--
 drivers/gpu/drm/i915/intel_runtime_pm.c |  5 +++-
 drivers/gpu/drm/xe/xe_pm.c  |  2 +-
 drivers/media/i2c/ccs/ccs-core.c|  2 +-
 drivers/media/i2c/ov64a40.c |  2 +-
 drivers/media/i2c/thp7312.c |  2 +-
 drivers/net/ipa/ipa_smp2p.c |  2 +-
 drivers/pci/pci.c   |  2 +-
 include/linux/pm_runtime.h  | 18 +++--
 sound/hda/hdac_device.c |  2 +-
 12 files changed, 50 insertions(+), 29 deletions(-)

diff --git a/Documentation/power/runtime_pm.rst 
b/Documentation/power/runtime_pm.rst
index 65b86e487afe..da99379071a4 100644
--- a/Documentation/power/runtime_pm.rst
+++ b/Documentation/power/runtime_pm.rst
@@ -396,10 +396,9 @@ drivers/base/power/runtime.c and 
include/linux/pm_runtime.h:
   nonzero, increment the counter and return 1; otherwise return 0 without
   changing the counter
 
-  `int pm_runtime_get_if_active(struct device *dev, bool ign_usage_count);`
+  `int pm_runtime_get_if_active(struct device *dev);`
 - return -EINVAL if 'power.disable_depth' is nonzero; otherwise, if the
-  runtime PM status is RPM_ACTIVE, and either ign_usage_count is true
-  or the device's usage_count is non-zero, increment the counter and
+  runtime PM status is RPM_ACTIVE, increment the counter and
   return 1; otherwise return 0 without changing the counter
 
   `void pm_runtime_put_noidle(struct device *dev);`
diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c
index 0af8864cb3b5..c6d93c7a1c58 100644
--- a/drivers/accel/ivpu/ivpu_pm.c
+++ b/drivers/accel/ivpu/ivpu_pm.c
@@ -292,7 +292,7 @@ int ivpu_rpm_get_if_active(struct ivpu_device *vdev)
 {
int ret;
 
-   ret = pm_runtime_get_if_active(vdev->drm.dev, false);
+   ret = pm_runtime_get_if_in_use(vdev->drm.dev);
drm_WARN_ON(>drm, ret < 0);
 
return ret;
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 05793c9fbb84..5275a6b2e980 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -1176,7 +1176,7 @@ int __pm_runtime_resume(struct device *dev, int rpmflags)
 EXPORT_SYMBOL_GPL(__pm_runtime_resume);
 
 /**
- * pm_runtime_get_if_active - Conditionally bump up device usage counter.
+ * pm_runtime_get_conditional - Conditionally bump up device usage counter.
  * @dev: Device to handle.
  * @ign_usage_count: Whether or not to look at the current usage counter value.
  *
@@ -1197,7 +1197,7 @@ EXPORT_SYMBOL_GPL(__pm_runtime_resume);
  * The caller is responsible for decrementing the runtime PM usage counter of
  * @dev after this function has returned a positive value for it.
  */
-int pm_runtime_get_if_active(struct device *dev, bool ign_usage_count)
+static int pm_runtime_get_conditional(struct device *dev, bool ign_usage_count)
 {
unsigned long flags;
int retval;
@@ -1218,8 +1218,39 @@ int pm_runtime_get_if_active(struct device *dev, bool 
ign_usage_count)
 
return retval;
 }
+
+/**
+ * pm_runtime_get_if_active - Bump up runtime PM usage counter if the device is
+ *   in active state
+ * @dev: Target device.
+ *
+ * Increment the runtime PM usage counter of @dev if its runtime PM status is
+ * %RPM_ACTIVE, in which case it returns 1. If the device is in a different
+ * state, 0 is returned. -EINVAL is returned if runtime PM is disabled for the
+ * device, in which case also the usage_count will remain unmodified.
+ */
+int pm_runtime_get_if_active(struct device *dev)
+{
+   return pm_runtime_get_conditional(dev, true);
+}
 EXPORT_SYMBOL_GPL(pm_runtime_get_if_active);
 
+/**
+ * pm_runtime_get_if_in_use - Conditionally bump up runtime PM usage counter.
+ * @dev: Target device.
+ *
+ * Increment the runt

Re: [PATCH v3 1/2] pm: runtime: Simplify pm_runtime_get_if_active() usage

2024-01-26 Thread Sakari Ailus
Hi Alex,

On Fri, Jan 26, 2024 at 09:12:02AM -0600, Alex Elder wrote:
> On 1/22/24 5:41 AM, Sakari Ailus wrote:
> > There are two ways to opportunistically increment a device's runtime PM
> > usage count, calling either pm_runtime_get_if_active() or
> > pm_runtime_get_if_in_use(). The former has an argument to tell whether to
> > ignore the usage count or not, and the latter simply calls the former with
> > ign_usage_count set to false. The other users that want to ignore the
> > usage_count will have to explitly set that argument to true which is a bit
> > cumbersome.
> > 
> > To make this function more practical to use, remove the ign_usage_count
> > argument from the function. The main implementation is renamed as
> > pm_runtime_get_conditional().
> > 
> > Signed-off-by: Sakari Ailus 
> > Reviewed-by: Alex Elder  # drivers/net/ipa/ipa_smp2p.c
> 
> I actually intended my "Reviewed-by" to cover the entire patch.  I
> checked every caller and they all looked good to me.

Thanks, I'll drop the file name. AFAIR it was just below that file, so I
added it, but I could be wrong, too.

v5 will also squash the 2nd patch of v4 into this one
https://lore.kernel.org/linux-pm/ZbBAWROxRKE8Y8VU@kekkonen.localdomain/T/#m76d34e679e12d8536a20eb29af6e826e2a85a24b>,
I hope that's fine.

-- 
Kind regards,

Sakari Ailus


Re: [PATCH v4 1/3] pm: runtime: Simplify pm_runtime_get_if_active() usage

2024-01-23 Thread Sakari Ailus
On Tue, Jan 23, 2024 at 03:48:01PM -0600, Bjorn Helgaas wrote:
> On Tue, Jan 23, 2024 at 08:44:04PM +0000, Sakari Ailus wrote:
> > On Tue, Jan 23, 2024 at 11:24:23AM -0600, Bjorn Helgaas wrote:
> > ...
> 
> > > - I don't know whether it's feasible, but it would be nice if the
> > >   intel_pm_runtime_pm.c rework could be done in one shot instead of
> > >   being split between patches 1/3 and 2/3.
> > > 
> > >   Maybe it could be a preliminary patch that uses the existing
> > >   if_active/if_in_use interfaces, followed by the trivial if_active
> > >   updates in this patch.  I think that would make the history easier
> > >   to read than having the transitory pm_runtime_get_conditional() in
> > >   the middle.
> > 
> > I think I'd merge the two patches. The second patch is fairly small, after
> > all, and both deal with largely the same code.
> 
> I'm not sure which two patches you mean, but the fact that two patches
> deal with largely the same code is not necessarily an argument for
> merging them.  From a reviewing perspective, it's nice if a patch like

Patches 1 and 2. The third patch introduces a new Runtime PM API function.

> 1/3, where it's largely mechanical and easy to review, is separated
> from patches that make more substantive changes.
> 
> That's why I think it'd be nice if the "interesting"
> intel_pm_runtime_pm.c changes were all in the same patch, and ideally,
> if that patch *only* touched intel_pm_runtime_pm.c.

I don't think squashing the second patch to the first really changes this
meaningfully: the i915 driver simply needs both
pm_runtime_get_if_{active,in_use}, and this is what the patch does to other
drivers already. Making the pm_runtime_get_conditional static would also
fit for the first patch if the desire is to not to introduce it at all.

-- 
Sakari Ailus


Re: [PATCH v4 1/3] pm: runtime: Simplify pm_runtime_get_if_active() usage

2024-01-23 Thread Sakari Ailus
Hi Bjorn,

Thanks for the review.

On Tue, Jan 23, 2024 at 11:24:23AM -0600, Bjorn Helgaas wrote:
> On Tue, Jan 23, 2024 at 11:56:42AM +0200, Sakari Ailus wrote:
> > There are two ways to opportunistically increment a device's runtime PM
> > usage count, calling either pm_runtime_get_if_active() or
> > pm_runtime_get_if_in_use(). The former has an argument to tell whether to
> > ignore the usage count or not, and the latter simply calls the former with
> > ign_usage_count set to false. The other users that want to ignore the
> > usage_count will have to explitly set that argument to true which is a bit
> > cumbersome.
> > 
> > To make this function more practical to use, remove the ign_usage_count
> > argument from the function. The main implementation is renamed as
> > pm_runtime_get_conditional().
> > 
> > Signed-off-by: Sakari Ailus 
> > Reviewed-by: Alex Elder  # drivers/net/ipa/ipa_smp2p.c
> > Reviewed-by: Laurent Pinchart 
> > Acked-by: Takashi Iwai  # sound/
> > Reviewed-by: Jacek Lawrynowicz  # 
> > drivers/accel/ivpu/
> > Acked-by: Rodrigo Vivi  # drivers/gpu/drm/i915/
> > Reviewed-by: Rodrigo Vivi 
> 
> Acked-by: Bjorn Helgaas  # drivers/pci/
> 
> - Previous PM history uses "PM: " in the subject lines (not "pm: ").

Oops. I'm not sure why I used lower case. (Maybe I've written too many
times "media:" prefix to the subject?) I'll fix this in v5.

> 
> - I don't know whether it's feasible, but it would be nice if the
>   intel_pm_runtime_pm.c rework could be done in one shot instead of
>   being split between patches 1/3 and 2/3.
> 
>   Maybe it could be a preliminary patch that uses the existing
>   if_active/if_in_use interfaces, followed by the trivial if_active
>   updates in this patch.  I think that would make the history easier
>   to read than having the transitory pm_runtime_get_conditional() in
>   the middle.

I think I'd merge the two patches. The second patch is fairly small, after
all, and both deal with largely the same code.

> 
> - Similarly, it would be nice if pm_runtime_get_conditional() never
>   had to be published in pm_runtime.h, instead of being temporarily
>   added there by this patch and then immediately made private by 2/3.
>   Maybe that's not practical, I dunno.

-- 
Regards,

Sakari Ailus


[PATCH v4 2/3] pm: runtime: Make pm_runtime_get_if_conditional() private

2024-01-23 Thread Sakari Ailus
Stop offering pm_runtime_get_if_conditional() API function for drivers,
instead require them to use pm_runtime_get_if_{active,in_use}. Also
convert the only user, the i915 driver, to use the said functions.

Signed-off-by: Sakari Ailus 
---
 drivers/base/power/runtime.c| 34 --
 drivers/gpu/drm/i915/intel_runtime_pm.c |  5 +++-
 include/linux/pm_runtime.h  | 38 ++---
 3 files changed, 38 insertions(+), 39 deletions(-)

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 83e0cd2a19e7..d2c17e29567d 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -1197,7 +1197,7 @@ EXPORT_SYMBOL_GPL(__pm_runtime_resume);
  * The caller is responsible for decrementing the runtime PM usage counter of
  * @dev after this function has returned a positive value for it.
  */
-int pm_runtime_get_conditional(struct device *dev, bool ign_usage_count)
+static int pm_runtime_get_conditional(struct device *dev, bool ign_usage_count)
 {
unsigned long flags;
int retval;
@@ -1218,7 +1218,37 @@ int pm_runtime_get_conditional(struct device *dev, bool 
ign_usage_count)
 
return retval;
 }
-EXPORT_SYMBOL_GPL(pm_runtime_get_conditional);
+
+/**
+ * pm_runtime_get_if_active - Bump up runtime PM usage counter if the device is
+ *   in active state
+ * @dev: Target device.
+ *
+ * Increment the runtime PM usage counter of @dev if its runtime PM status is
+ * %RPM_ACTIVE, in which case it returns 1. If the device is in a different
+ * state, 0 is returned. -EINVAL is returned if runtime PM is disabled for the
+ * device.
+ */
+int pm_runtime_get_if_active(struct device *dev)
+{
+   return pm_runtime_get_conditional(dev, true);
+}
+EXPORT_SYMBOL_GPL(pm_runtime_get_if_active);
+
+/**
+ * pm_runtime_get_if_in_use - Conditionally bump up runtime PM usage counter.
+ * @dev: Target device.
+ *
+ * Increment the runtime PM usage counter of @dev if its runtime PM status is
+ * %RPM_ACTIVE and its runtime PM usage counter is greater than 0, in which 
case
+ * it returns 1. If the device is in a different state or its usage_count is 0,
+ * 0 is returned. -EINVAL is returned if runtime PM is disabled for the device.
+ */
+int pm_runtime_get_if_in_use(struct device *dev)
+{
+   return pm_runtime_get_conditional(dev, false);
+}
+EXPORT_SYMBOL_GPL(pm_runtime_get_if_in_use);
 
 /**
  * __pm_runtime_set_status - Set runtime PM status of a device.
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c 
b/drivers/gpu/drm/i915/intel_runtime_pm.c
index b5f8abd2a22b..d4e844128826 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -246,7 +246,10 @@ static intel_wakeref_t 
__intel_runtime_pm_get_if_active(struct intel_runtime_pm
 * function, since the power state is undefined. This applies
 * atm to the late/early system suspend/resume handlers.
 */
-   if (pm_runtime_get_conditional(rpm->kdev, ignore_usecount) <= 0)
+   if ((ignore_usecount &&
+pm_runtime_get_if_active(rpm->kdev) <= 0) ||
+   (!ignore_usecount &&
+pm_runtime_get_if_in_use(rpm->kdev) <= 0))
return 0;
}
 
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index a212b3008ade..436baa167498 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -72,8 +72,8 @@ extern int pm_runtime_force_resume(struct device *dev);
 extern int __pm_runtime_idle(struct device *dev, int rpmflags);
 extern int __pm_runtime_suspend(struct device *dev, int rpmflags);
 extern int __pm_runtime_resume(struct device *dev, int rpmflags);
-extern int pm_runtime_get_conditional(struct device *dev,
-   bool ign_usage_count);
+extern int pm_runtime_get_if_active(struct device *dev);
+extern int pm_runtime_get_if_in_use(struct device *dev);
 extern int pm_schedule_suspend(struct device *dev, unsigned int delay);
 extern int __pm_runtime_set_status(struct device *dev, unsigned int status);
 extern int pm_runtime_barrier(struct device *dev);
@@ -95,35 +95,6 @@ extern void pm_runtime_release_supplier(struct device_link 
*link);
 
 extern int devm_pm_runtime_enable(struct device *dev);
 
-/**
- * pm_runtime_get_if_active - Bump up runtime PM usage counter if the device is
- *   in active state
- * @dev: Target device.
- *
- * Increment the runtime PM usage counter of @dev if its runtime PM status is
- * %RPM_ACTIVE, in which case it returns 1. If the device is in a different
- * state, 0 is returned. -EINVAL is returned if runtime PM is disabled for the
- * device.
- */
-static inline int pm_runtime_get_if_active(struct device *dev)
-{
-   return pm_runtime_get_conditional(dev, true);
-}
-
-/**
- * pm_runtime_get_if_in_use - Cond

[PATCH v4 0/3] Small runtime PM API changes

2024-01-23 Thread Sakari Ailus
Hi folks,

Here's a small but a different set of patches for making two relatively
minor changes to runtime PM API. I restarted version numbering as this is
meaningfully different from the previous set.

pm_runtime_get_if_active() loses its second argument as it only made sense
to have ign_usage_count argument true.

The other change is also small but it has an effect on callers:
pm_runtime_put_autosuspend() will, in the future, be re-purposed to
include a call to pm_runtime_mark_last_busy() as well. Before this,
current users of the function are moved to __pm_runtime_put_autosuspend()
(added by this patchset) which will continue to have the current
behaviour.

I haven't included the conversion patches in this set as I only want to do
that once this set has been approved and merged. The tree specific patches
can be found here, on linux-next master (there are some V4L2 patches
there, too, please ignore them for now):
https://git.kernel.org/pub/scm/linux/kernel/git/sailus/linux-next.git/log/?

Later on, users calling pm_runtime_mark_last_busy() immediately followed
by __pm_runtime_put_autosuspend() will be switched back to
pm_runtime_put_autosuspend() once its behaviour change has been done (a
patch near top of that branch). I'll provide these once the preceding ones
have been merged.

Comments are welcome.

since v3:

- patch 1: Drop the previously added documentation on driver use of
  pm_runtime_get_conditional().

- Add a patch to make pm_runtime_get_conditional() static, including
  switching i915 to pm_runtime_get_if_{active,in_use}.

since v2:

- Rebase on v6.8-rc1 (no changes).

- Add Rodrigo's Reviewed-by: to the 1st patch.

since v1:

- patch 1: Rename __pm_runtime_get_conditional() as
  pm_runtime_get_conditional().

- patch 1: Reword documentation on driver use of
  pm_runtime_get_conditional().

Sakari Ailus (3):
  pm: runtime: Simplify pm_runtime_get_if_active() usage
  pm: runtime: Make pm_runtime_get_if_conditional() private
  pm: runtime: Add pm_runtime_put_autosuspend() replacement

 Documentation/power/runtime_pm.rst  | 22 +---
 drivers/accel/ivpu/ivpu_pm.c|  2 +-
 drivers/base/power/runtime.c| 34 +++--
 drivers/gpu/drm/i915/intel_runtime_pm.c |  5 +++-
 drivers/gpu/drm/xe/xe_pm.c  |  2 +-
 drivers/media/i2c/ccs/ccs-core.c|  2 +-
 drivers/media/i2c/ov64a40.c |  2 +-
 drivers/media/i2c/thp7312.c |  2 +-
 drivers/net/ipa/ipa_smp2p.c |  2 +-
 drivers/pci/pci.c   |  2 +-
 include/linux/pm_runtime.h  | 30 +++---
 sound/hda/hdac_device.c |  2 +-
 12 files changed, 72 insertions(+), 35 deletions(-)

-- 
2.39.2



[PATCH v4 1/3] pm: runtime: Simplify pm_runtime_get_if_active() usage

2024-01-23 Thread Sakari Ailus
There are two ways to opportunistically increment a device's runtime PM
usage count, calling either pm_runtime_get_if_active() or
pm_runtime_get_if_in_use(). The former has an argument to tell whether to
ignore the usage count or not, and the latter simply calls the former with
ign_usage_count set to false. The other users that want to ignore the
usage_count will have to explitly set that argument to true which is a bit
cumbersome.

To make this function more practical to use, remove the ign_usage_count
argument from the function. The main implementation is renamed as
pm_runtime_get_conditional().

Signed-off-by: Sakari Ailus 
Reviewed-by: Alex Elder  # drivers/net/ipa/ipa_smp2p.c
Reviewed-by: Laurent Pinchart 
Acked-by: Takashi Iwai  # sound/
Reviewed-by: Jacek Lawrynowicz  # 
drivers/accel/ivpu/
Acked-by: Rodrigo Vivi  # drivers/gpu/drm/i915/
Reviewed-by: Rodrigo Vivi 
---
 Documentation/power/runtime_pm.rst  |  5 ++--
 drivers/accel/ivpu/ivpu_pm.c|  2 +-
 drivers/base/power/runtime.c|  6 ++---
 drivers/gpu/drm/i915/intel_runtime_pm.c |  2 +-
 drivers/gpu/drm/xe/xe_pm.c  |  2 +-
 drivers/media/i2c/ccs/ccs-core.c|  2 +-
 drivers/media/i2c/ov64a40.c |  2 +-
 drivers/media/i2c/thp7312.c |  2 +-
 drivers/net/ipa/ipa_smp2p.c |  2 +-
 drivers/pci/pci.c   |  2 +-
 include/linux/pm_runtime.h  | 32 +
 sound/hda/hdac_device.c |  2 +-
 12 files changed, 41 insertions(+), 20 deletions(-)

diff --git a/Documentation/power/runtime_pm.rst 
b/Documentation/power/runtime_pm.rst
index 65b86e487afe..da99379071a4 100644
--- a/Documentation/power/runtime_pm.rst
+++ b/Documentation/power/runtime_pm.rst
@@ -396,10 +396,9 @@ drivers/base/power/runtime.c and 
include/linux/pm_runtime.h:
   nonzero, increment the counter and return 1; otherwise return 0 without
   changing the counter
 
-  `int pm_runtime_get_if_active(struct device *dev, bool ign_usage_count);`
+  `int pm_runtime_get_if_active(struct device *dev);`
 - return -EINVAL if 'power.disable_depth' is nonzero; otherwise, if the
-  runtime PM status is RPM_ACTIVE, and either ign_usage_count is true
-  or the device's usage_count is non-zero, increment the counter and
+  runtime PM status is RPM_ACTIVE, increment the counter and
   return 1; otherwise return 0 without changing the counter
 
   `void pm_runtime_put_noidle(struct device *dev);`
diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c
index 0af8864cb3b5..c6d93c7a1c58 100644
--- a/drivers/accel/ivpu/ivpu_pm.c
+++ b/drivers/accel/ivpu/ivpu_pm.c
@@ -292,7 +292,7 @@ int ivpu_rpm_get_if_active(struct ivpu_device *vdev)
 {
int ret;
 
-   ret = pm_runtime_get_if_active(vdev->drm.dev, false);
+   ret = pm_runtime_get_if_in_use(vdev->drm.dev);
drm_WARN_ON(>drm, ret < 0);
 
return ret;
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 05793c9fbb84..83e0cd2a19e7 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -1176,7 +1176,7 @@ int __pm_runtime_resume(struct device *dev, int rpmflags)
 EXPORT_SYMBOL_GPL(__pm_runtime_resume);
 
 /**
- * pm_runtime_get_if_active - Conditionally bump up device usage counter.
+ * pm_runtime_get_conditional - Conditionally bump up device usage counter.
  * @dev: Device to handle.
  * @ign_usage_count: Whether or not to look at the current usage counter value.
  *
@@ -1197,7 +1197,7 @@ EXPORT_SYMBOL_GPL(__pm_runtime_resume);
  * The caller is responsible for decrementing the runtime PM usage counter of
  * @dev after this function has returned a positive value for it.
  */
-int pm_runtime_get_if_active(struct device *dev, bool ign_usage_count)
+int pm_runtime_get_conditional(struct device *dev, bool ign_usage_count)
 {
unsigned long flags;
int retval;
@@ -1218,7 +1218,7 @@ int pm_runtime_get_if_active(struct device *dev, bool 
ign_usage_count)
 
return retval;
 }
-EXPORT_SYMBOL_GPL(pm_runtime_get_if_active);
+EXPORT_SYMBOL_GPL(pm_runtime_get_conditional);
 
 /**
  * __pm_runtime_set_status - Set runtime PM status of a device.
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c 
b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 860b51b56a92..b5f8abd2a22b 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -246,7 +246,7 @@ static intel_wakeref_t 
__intel_runtime_pm_get_if_active(struct intel_runtime_pm
 * function, since the power state is undefined. This applies
 * atm to the late/early system suspend/resume handlers.
 */
-   if (pm_runtime_get_if_active(rpm->kdev, ignore_usecount) <= 0)
+   if (pm_runtime_get_conditional(rpm->kdev, ignore_usecount) <= 0)
return 0;
}
 
diff --git a/drivers/gpu/drm/xe/xe_p

Re: [PATCH v3 1/2] pm: runtime: Simplify pm_runtime_get_if_active() usage

2024-01-22 Thread Sakari Ailus
Hi Rafael, Björn,

Thanks for the review.

On Mon, Jan 22, 2024 at 07:16:54PM +0100, Rafael J. Wysocki wrote:
> On Mon, Jan 22, 2024 at 7:12 PM Bjorn Helgaas  wrote:
> >
> > On Mon, Jan 22, 2024 at 01:41:21PM +0200, Sakari Ailus wrote:
> > > There are two ways to opportunistically increment a device's runtime PM
> > > usage count, calling either pm_runtime_get_if_active() or
> > > pm_runtime_get_if_in_use(). The former has an argument to tell whether to
> > > ignore the usage count or not, and the latter simply calls the former with
> > > ign_usage_count set to false. The other users that want to ignore the
> > > usage_count will have to explitly set that argument to true which is a bit
> > > cumbersome.
> >
> > s/explitly/explicitly/
> >
> > > To make this function more practical to use, remove the ign_usage_count
> > > argument from the function. The main implementation is renamed as
> > > pm_runtime_get_conditional().
> > >
> > > Signed-off-by: Sakari Ailus 
> > > Reviewed-by: Alex Elder  # drivers/net/ipa/ipa_smp2p.c
> > > Reviewed-by: Laurent Pinchart 
> > > Acked-by: Takashi Iwai  # sound/
> > > Reviewed-by: Jacek Lawrynowicz  # 
> > > drivers/accel/ivpu/
> > > Acked-by: Rodrigo Vivi  # drivers/gpu/drm/i915/
> > > Reviewed-by: Rodrigo Vivi 
> >
> > Acked-by: Bjorn Helgaas  # drivers/pci/
> >
> > > -EXPORT_SYMBOL_GPL(pm_runtime_get_if_active);
> > > +EXPORT_SYMBOL_GPL(pm_runtime_get_conditional);
> >
> > If pm_runtime_get_conditional() is exported, shouldn't it also be
> > documented in Documentation/power/runtime_pm.rst?
> >
> > But I'm dubious about exporting it because
> > __intel_runtime_pm_get_if_active() is the only caller, and you end up
> > with the same pattern there that we have before this series in the PM
> > core.  Why can't intel_runtime_pm.c be updated to use
> > pm_runtime_get_if_active() or pm_runtime_get_if_in_use() directly, and
> > make pm_runtime_get_conditional() static?
> 
> Sounds like a good suggestion to me.

The i915 driver uses both but I guess it's not too much different to check
ignore_usecount separately than passing it to the API function?

I'll add another patch to do this and moving
pm_runtime_get_if_{active,in_use} implementations to runtime.c.

-- 
Regards,

Sakari Ailus


[PATCH v3 1/2] pm: runtime: Simplify pm_runtime_get_if_active() usage

2024-01-22 Thread Sakari Ailus
There are two ways to opportunistically increment a device's runtime PM
usage count, calling either pm_runtime_get_if_active() or
pm_runtime_get_if_in_use(). The former has an argument to tell whether to
ignore the usage count or not, and the latter simply calls the former with
ign_usage_count set to false. The other users that want to ignore the
usage_count will have to explitly set that argument to true which is a bit
cumbersome.

To make this function more practical to use, remove the ign_usage_count
argument from the function. The main implementation is renamed as
pm_runtime_get_conditional().

Signed-off-by: Sakari Ailus 
Reviewed-by: Alex Elder  # drivers/net/ipa/ipa_smp2p.c
Reviewed-by: Laurent Pinchart 
Acked-by: Takashi Iwai  # sound/
Reviewed-by: Jacek Lawrynowicz  # 
drivers/accel/ivpu/
Acked-by: Rodrigo Vivi  # drivers/gpu/drm/i915/
Reviewed-by: Rodrigo Vivi 
---
 Documentation/power/runtime_pm.rst  |  5 ++--
 drivers/accel/ivpu/ivpu_pm.c|  2 +-
 drivers/base/power/runtime.c| 10 +---
 drivers/gpu/drm/i915/intel_runtime_pm.c |  2 +-
 drivers/gpu/drm/xe/xe_pm.c  |  2 +-
 drivers/media/i2c/ccs/ccs-core.c|  2 +-
 drivers/media/i2c/ov64a40.c |  2 +-
 drivers/media/i2c/thp7312.c |  2 +-
 drivers/net/ipa/ipa_smp2p.c |  2 +-
 drivers/pci/pci.c   |  2 +-
 include/linux/pm_runtime.h  | 32 +
 sound/hda/hdac_device.c |  2 +-
 12 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/Documentation/power/runtime_pm.rst 
b/Documentation/power/runtime_pm.rst
index 65b86e487afe..da99379071a4 100644
--- a/Documentation/power/runtime_pm.rst
+++ b/Documentation/power/runtime_pm.rst
@@ -396,10 +396,9 @@ drivers/base/power/runtime.c and 
include/linux/pm_runtime.h:
   nonzero, increment the counter and return 1; otherwise return 0 without
   changing the counter
 
-  `int pm_runtime_get_if_active(struct device *dev, bool ign_usage_count);`
+  `int pm_runtime_get_if_active(struct device *dev);`
 - return -EINVAL if 'power.disable_depth' is nonzero; otherwise, if the
-  runtime PM status is RPM_ACTIVE, and either ign_usage_count is true
-  or the device's usage_count is non-zero, increment the counter and
+  runtime PM status is RPM_ACTIVE, increment the counter and
   return 1; otherwise return 0 without changing the counter
 
   `void pm_runtime_put_noidle(struct device *dev);`
diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c
index 0af8864cb3b5..c6d93c7a1c58 100644
--- a/drivers/accel/ivpu/ivpu_pm.c
+++ b/drivers/accel/ivpu/ivpu_pm.c
@@ -292,7 +292,7 @@ int ivpu_rpm_get_if_active(struct ivpu_device *vdev)
 {
int ret;
 
-   ret = pm_runtime_get_if_active(vdev->drm.dev, false);
+   ret = pm_runtime_get_if_in_use(vdev->drm.dev);
drm_WARN_ON(>drm, ret < 0);
 
return ret;
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 05793c9fbb84..b4cb3f19b0d8 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -1176,7 +1176,7 @@ int __pm_runtime_resume(struct device *dev, int rpmflags)
 EXPORT_SYMBOL_GPL(__pm_runtime_resume);
 
 /**
- * pm_runtime_get_if_active - Conditionally bump up device usage counter.
+ * pm_runtime_get_conditional - Conditionally bump up device usage counter.
  * @dev: Device to handle.
  * @ign_usage_count: Whether or not to look at the current usage counter value.
  *
@@ -1196,8 +1196,12 @@ EXPORT_SYMBOL_GPL(__pm_runtime_resume);
  *
  * The caller is responsible for decrementing the runtime PM usage counter of
  * @dev after this function has returned a positive value for it.
+ *
+ * This function is not primarily intended for use in drivers, most of which 
are
+ * better served by either pm_runtime_get_if_active() or
+ * pm_runtime_get_if_in_use() instead.
  */
-int pm_runtime_get_if_active(struct device *dev, bool ign_usage_count)
+int pm_runtime_get_conditional(struct device *dev, bool ign_usage_count)
 {
unsigned long flags;
int retval;
@@ -1218,7 +1222,7 @@ int pm_runtime_get_if_active(struct device *dev, bool 
ign_usage_count)
 
return retval;
 }
-EXPORT_SYMBOL_GPL(pm_runtime_get_if_active);
+EXPORT_SYMBOL_GPL(pm_runtime_get_conditional);
 
 /**
  * __pm_runtime_set_status - Set runtime PM status of a device.
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c 
b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 860b51b56a92..b5f8abd2a22b 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -246,7 +246,7 @@ static intel_wakeref_t 
__intel_runtime_pm_get_if_active(struct intel_runtime_pm
 * function, since the power state is undefined. This applies
 * atm to the late/early system suspend/resume handlers.
 */
-   if (pm_runtime_get_if_active(rpm->kdev, 

[PATCH v3 0/2] Small runtime PM API changes

2024-01-22 Thread Sakari Ailus
Hi folks,

Here's a small but a different set of patches for making two relatively
minor changes to runtime PM API. I restarted version numbering as this is
meaningfully different from the previous set.

pm_runtime_get_if_active() loses its second argument as it only made sense
to have ign_usage_count argument true.

The other change is also small but it has an effect on callers:
pm_runtime_put_autosuspend() will, in the future, be re-purposed to
include a call to pm_runtime_mark_last_busy() as well. Before this,
current users of the function are moved to __pm_runtime_put_autosuspend()
(added by this patchset) which will continue to have the current
behaviour.

I haven't included the conversion patches in this set as I only want to do
that once this set has been approved and merged. The tree specific patches
can be found here, on linux-next master (there are some V4L2 patches
there, too, please ignore them for now):
https://git.kernel.org/pub/scm/linux/kernel/git/sailus/linux-next.git/log/?h=pm>

Later on, users calling pm_runtime_mark_last_busy() immediately followed
by __pm_runtime_put_autosuspend() will be switched back to
pm_runtime_put_autosuspend() once its behaviour change has been done (a
patch near top of that branch). I'll provide these once the preceding ones
have been merged.

Comments are welcome.

since v2:

- Rebase on v6.8-rc1 (no changes).

- Add Rodrigo's Reviewed-by: to the 1st patch.

since v1:

- patch 1: Rename __pm_runtime_get_conditional() as
  pm_runtime_get_conditional().

- patch 1: Reword documentation on driver use of
  pm_runtime_get_conditional().

Sakari Ailus (2):
  pm: runtime: Simplify pm_runtime_get_if_active() usage
  pm: runtime: Add pm_runtime_put_autosuspend() replacement

 Documentation/power/runtime_pm.rst  | 22 -
 drivers/accel/ivpu/ivpu_pm.c|  2 +-
 drivers/base/power/runtime.c| 10 --
 drivers/gpu/drm/i915/intel_runtime_pm.c |  2 +-
 drivers/gpu/drm/xe/xe_pm.c  |  2 +-
 drivers/media/i2c/ccs/ccs-core.c|  2 +-
 drivers/media/i2c/ov64a40.c |  2 +-
 drivers/media/i2c/thp7312.c |  2 +-
 drivers/net/ipa/ipa_smp2p.c |  2 +-
 drivers/pci/pci.c   |  2 +-
 include/linux/pm_runtime.h  | 44 ++---
 sound/hda/hdac_device.c |  2 +-
 12 files changed, 68 insertions(+), 26 deletions(-)

-- 
2.39.2



Re: [Intel-gfx] [PATCH 3/3] media: v4l2-core: Describe privacy_led field of v4l2_subdev

2023-05-17 Thread Sakari Ailus
Hi Bagas,

On Fri, Feb 03, 2023 at 05:02:15PM +0700, Bagas Sanjaya wrote:
> Stephen Rothwell reported htmldocs warning:
> 
> include/media/v4l2-subdev.h:1088: warning: Function parameter or member 
> 'privacy_led' not described in 'v4l2_subdev'
> 
> Describe privacy_led field to fix the warning.
> 
> Link: 
> https://lore.kernel.org/linux-next/20230203135303.32da1...@canb.auug.org.au/
> Fixes: 10d96e289fbd77 ("media: v4l2-core: Make the v4l2-core code 
> enable/disable the privacy LED if present")
> Reported-by: Stephen Rothwell 
> Signed-off-by: Bagas Sanjaya 
> ---
>  include/media/v4l2-subdev.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> index 1ef5bbbf9d38c8..3e7a97c0657e1c 100644
> --- a/include/media/v4l2-subdev.h
> +++ b/include/media/v4l2-subdev.h
> @@ -1033,6 +1033,7 @@ struct v4l2_subdev_platform_data {
>   * @active_state: Active state for the subdev (NULL for subdevs tracking the
>   * state internally). Initialized by calling
>   * v4l2_subdev_init_finalize().
> + * @privacy_led: Privacy LED associated with the sub-device.
>   * @enabled_streams: Bitmask of enabled streams used by
>   *v4l2_subdev_enable_streams() and
>   *v4l2_subdev_disable_streams() helper functions for fallback

I'm not sure how this ever was an issue --- privacy_led field was
documented in the same patch that added it.

-- 
Kind regards,

Sakari Ailus


Re: [Intel-gfx] [PATCH 1/3] lib/string_helpers: Consolidate yesno() implementation

2022-01-19 Thread Sakari Ailus
Hi Lucas,

On Tue, Jan 18, 2022 at 11:24:48PM -0800, Lucas De Marchi wrote:
> @@ -1354,8 +1345,7 @@ static bool tomoyo_print_condition(struct 
> tomoyo_io_buffer *head,
>   case 3:
>   if (cond->grant_log != TOMOYO_GRANTLOG_AUTO)
>   tomoyo_io_printf(head, " grant_log=%s",
> -  tomoyo_yesno(cond->grant_log ==
> -   TOMOYO_GRANTLOG_YES));
> +  yesno(cond->grant_log == 
> TOMOYO_GRANTLOG_YES));

This would be better split on two lines.

Then,

Reviewed-by: Sakari Ailus 

-- 
Sakari Ailus


Re: [Intel-gfx] [PATCH 5/9] drm/i915: Associate ACPI connector nodes with connector entries

2021-05-05 Thread Sakari Ailus
Hi Andy, Hans,

On Wed, May 05, 2021 at 12:17:14PM +0300, Andy Shevchenko wrote:
> On Wed, May 5, 2021 at 12:07 PM Hans de Goede  wrote:
> > On 5/4/21 9:52 AM, Andy Shevchenko wrote:
> > > On Monday, May 3, 2021, Hans de Goede  > > <mailto:hdego...@redhat.com>> wrote:
> 
> ...
> 
> > > +   fwnode = device_get_next_child_node(kdev, fwnode);
> 
> > > Who is dropping reference counting on fwnode ?
> >
> > We are dealing with ACPI fwnode-s here and those are not ref-counted, they
> > are embedded inside a struct acpi_device and their lifetime is tied to
> > that struct. They should probably still be ref-counted (with the count
> > never dropping to 0) so that the generic fwnode functions behave the same
> > anywhere but atm the ACPI nodes are not refcounted, see: 
> > acpi_get_next_subnode()
> > in drivers/acpi/property.c which is the get_next_child_node() implementation
> > for ACPI fwnode-s.
> 
> Yes, ACPI currently is exceptional, but fwnode API is not.
> If you may guarantee that this case won't ever be outside of ACPI and
> even though if ACPI won't ever gain a reference counting for fwnodes,
> we can leave it as is.
> 
> > > I’m in the middle of a pile of fixes for fwnode refcounting when
> > > for_each_child or get_next_child is used. So, please double check you
> > > drop a reference.
> >
> > The kdoc comments on device_get_next_child_node() / 
> > fwnode_get_next_child_node()
> > do not mention anything about these functions returning a reference.
> 
> It's possible. I dunno if it had to be done earlier. Sakari?

The fwnode API has worked with references for a long time, looks like from
the very beginning of it, as in patch
8a0662d9ed2968e1186208336a8e1fab3fdfea63 .

If you're expecting an fwnode family of function returning another node,
then that function has to have taken a reference to that node before
returning it. Otherwise there's no guarantee that node is still there when
it is returned.

It may be this is not documented for every function doing so. That should
probably be added.

-- 
Kind regards,

Sakari Ailus
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v3 10/12] media: constify fb ops across all drivers

2019-12-04 Thread Sakari Ailus
On Tue, Dec 03, 2019 at 06:38:52PM +0200, Jani Nikula wrote:
> Now that the fbops member of struct fb_info is const, we can start
> making the ops const as well.
> 
> Remove the redundant fbops assignments while at it.
> 
> v2:
> - actually add const in vivid
> - fix typo (Christophe de Dinechin)
> 
> Cc: Hans Verkuil 
> Cc: Andy Walls 
> Cc: linux-me...@vger.kernel.org
> Cc: ivtv-de...@ivtvdriver.org
> Reviewed-by: Daniel Vetter 
> Signed-off-by: Jani Nikula 

Reviewed-by: Sakari Ailus 

-- 
Sakari Ailus
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [PATCH v3 11/41] media/v4l2-core/mm: convert put_page() to put_user_page*()

2019-08-07 Thread Sakari Ailus
On Tue, Aug 06, 2019 at 06:33:10PM -0700, john.hubb...@gmail.com wrote:
> From: John Hubbard 
> 
> For pages that were retained via get_user_pages*(), release those pages
> via the new put_user_page*() routines, instead of via put_page() or
> release_pages().
> 
> This is part a tree-wide conversion, as described in commit fc1d8e7cca2d
> ("mm: introduce put_user_page*(), placeholder versions").
> 
> Cc: Mauro Carvalho Chehab 
> Cc: Kees Cook 
> Cc: Hans Verkuil 
> Cc: Sakari Ailus 
> Cc: Jan Kara 
> Cc: Robin Murphy 
> Cc: Souptick Joarder 
> Cc: Dan Williams 
> Cc: linux-me...@vger.kernel.org
> Signed-off-by: John Hubbard 

Acked-by: Sakari Ailus 

-- 
Sakari Ailus
sakari.ai...@linux.intel.com
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [-next PATCH 3/4] treewide: Use DEVICE_ATTR_RO

2017-12-21 Thread Sakari Ailus
Hi Joe,

On Tue, Dec 19, 2017 at 10:15:08AM -0800, Joe Perches wrote:
> diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c 
> b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
> index a1c81c12718c..4338b8a1309f 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
> @@ -158,10 +158,10 @@ static ssize_t dynamic_pool_show(struct device *dev,
>   return ret;
>  };
>  
> -static DEVICE_ATTR(active_bo, 0444, active_bo_show, NULL);
> -static DEVICE_ATTR(free_bo, 0444, free_bo_show, NULL);
> -static DEVICE_ATTR(reserved_pool, 0444, reserved_pool_show, NULL);
> -static DEVICE_ATTR(dynamic_pool, 0444, dynamic_pool_show, NULL);
> +static DEVICE_ATTR_RO(active_bo);
> +static DEVICE_ATTR_RO(free_bo);
> +static DEVICE_ATTR_RO(reserved_pool);
> +static DEVICE_ATTR_RO(dynamic_pool);
>  
>  static struct attribute *sysfs_attrs_ctrl[] = {
>   _attr_active_bo.attr,

I have the exact same changes queued up in my tree. As there seem to be no
dependencies to other patches in your set, how about dropping this chunk?

Thanks.

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH V3 22/29] [media] atomisp: deprecate pci_get_bus_and_slot()

2017-11-29 Thread Sakari Ailus
Hi Sinan,

On Mon, Nov 27, 2017 at 11:57:59AM -0500, Sinan Kaya wrote:
> diff --git 
> a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c 
> b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> index 4631b1d..51dcef57 100644
> --- a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> +++ b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> @@ -39,7 +39,7 @@ static inline int platform_is(u8 model)
>  
>  static int intel_mid_msgbus_init(void)
>  {
> - pci_root = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> + pci_root = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
>   if (!pci_root) {
>   pr_err("%s: Error: msgbus PCI handle NULL\n", __func__);
>   return -ENODEV;

This file has been removed, I'm applying the rest of the patch.

Please use the media tree as the base in the future. Thanks.

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx