All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] device core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER
@ 2018-06-27 12:50 ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-06-27 12:50 UTC (permalink / raw)
  To: rjw, linux-kernel
  Cc: Vivek Gautam, Lukas Wunner, Jonathan Corbet, Greg Kroah-Hartman,
	Thierry Reding, David Airlie, Jonathan Hunter, Philipp Zabel,
	Shawn Guo, Sascha Hauer, Robin Murphy, linux-doc, dri-devel,
	linux-tegra, linux-arm-kernel, linux-pm, linux-arm-msm

Now that we want to add another flag to autoremove the device link
on supplier unbind, it's fair to rename the existing flag from
DL_FLAG_AUTOREMOVE to DL_FLAG_AUTOREMOVE_CONSUMER so that we can
add similar flag for supplier later.
And, while we are touching device.h, fix a doc build warning.

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: linux-doc@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-tegra@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org
---
 Documentation/driver-api/device_link.rst |  8 ++++----
 drivers/base/core.c                      | 15 ++++++++-------
 drivers/gpu/drm/tegra/dc.c               |  2 +-
 drivers/gpu/ipu-v3/ipu-pre.c             |  3 ++-
 drivers/gpu/ipu-v3/ipu-prg.c             |  3 ++-
 drivers/soc/imx/gpc.c                    |  2 +-
 include/linux/device.h                   | 12 ++++++------
 7 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
index 70e328e16aad..a005b904a264 100644
--- a/Documentation/driver-api/device_link.rst
+++ b/Documentation/driver-api/device_link.rst
@@ -81,10 +81,10 @@ integration is desired.
 Two other flags are specifically targeted at use cases where the device
 link is added from the consumer's ``->probe`` callback:  ``DL_FLAG_RPM_ACTIVE``
 can be specified to runtime resume the supplier upon addition of the
-device link.  ``DL_FLAG_AUTOREMOVE`` causes the device link to be automatically
-purged when the consumer fails to probe or later unbinds.  This obviates
-the need to explicitly delete the link in the ``->remove`` callback or in
-the error path of the ``->probe`` callback.
+device link.  ``DL_FLAG_AUTOREMOVE_CONSUMER`` causes the device link to be
+automatically purged when the consumer fails to probe or later unbinds.
+This obviates the need to explicitly delete the link in the ``->remove``
+callback or in the error path of the ``->probe`` callback.
 
 Limitations
 ===========
diff --git a/drivers/base/core.c b/drivers/base/core.c
index df3e1a44707a..14c1e3151e08 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -178,10 +178,10 @@ void device_pm_move_to_tail(struct device *dev)
  * of the link.  If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be
  * ignored.
  *
- * If the DL_FLAG_AUTOREMOVE is set, the link will be removed automatically
- * when the consumer device driver unbinds from it.  The combination of both
- * DL_FLAG_AUTOREMOVE and DL_FLAG_STATELESS set is invalid and will cause NULL
- * to be returned.
+ * If the DL_FLAG_AUTOREMOVE_CONSUMER is set, the link will be removed
+ * automatically when the consumer device driver unbinds from it.
+ * The combination of both DL_FLAG_AUTOREMOVE_CONSUMER and DL_FLAG_STATELESS
+ * set is invalid and will cause NULL to be returned.
  *
  * A side effect of the link creation is re-ordering of dpm_list and the
  * devices_kset list by moving the consumer device and all devices depending
@@ -198,7 +198,8 @@ struct device_link *device_link_add(struct device *consumer,
 	struct device_link *link;
 
 	if (!consumer || !supplier ||
-	    ((flags & DL_FLAG_STATELESS) && (flags & DL_FLAG_AUTOREMOVE)))
+	    ((flags & DL_FLAG_STATELESS) &&
+	     (flags & DL_FLAG_AUTOREMOVE_CONSUMER)))
 		return NULL;
 
 	device_links_write_lock();
@@ -479,7 +480,7 @@ static void __device_links_no_driver(struct device *dev)
 		if (link->flags & DL_FLAG_STATELESS)
 			continue;
 
-		if (link->flags & DL_FLAG_AUTOREMOVE)
+		if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER)
 			kref_put(&link->kref, __device_link_del);
 		else if (link->status != DL_STATE_SUPPLIER_UNBIND)
 			WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
@@ -515,7 +516,7 @@ void device_links_driver_cleanup(struct device *dev)
 		if (link->flags & DL_FLAG_STATELESS)
 			continue;
 
-		WARN_ON(link->flags & DL_FLAG_AUTOREMOVE);
+		WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
 		WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
 		WRITE_ONCE(link->status, DL_STATE_DORMANT);
 	}
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index c3afe7b2237e..965088afcfad 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -2312,7 +2312,7 @@ static int tegra_dc_couple(struct tegra_dc *dc)
 	 * POWER_CONTROL registers during CRTC enabling.
 	 */
 	if (dc->soc->coupled_pm && dc->pipe == 1) {
-		u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE;
+		u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER;
 		struct device_link *link;
 		struct device *partner;
 
diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
index 0f70e8847540..2f8db9d62551 100644
--- a/drivers/gpu/ipu-v3/ipu-pre.c
+++ b/drivers/gpu/ipu-v3/ipu-pre.c
@@ -128,7 +128,8 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
 	list_for_each_entry(pre, &ipu_pre_list, list) {
 		if (pre_node == pre->dev->of_node) {
 			mutex_unlock(&ipu_pre_list_mutex);
-			device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE);
+			device_link_add(dev, pre->dev,
+					DL_FLAG_AUTOREMOVE_CONSUMER);
 			of_node_put(pre_node);
 			return pre;
 		}
diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c
index 83f9dd934a5d..38a3a9764e49 100644
--- a/drivers/gpu/ipu-v3/ipu-prg.c
+++ b/drivers/gpu/ipu-v3/ipu-prg.c
@@ -100,7 +100,8 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
 	list_for_each_entry(prg, &ipu_prg_list, list) {
 		if (prg_node == prg->dev->of_node) {
 			mutex_unlock(&ipu_prg_list_mutex);
-			device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE);
+			device_link_add(dev, prg->dev,
+					DL_FLAG_AUTOREMOVE_CONSUMER);
 			prg->id = ipu_id;
 			of_node_put(prg_node);
 			return prg;
diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
index 32f0748fd067..aa9e65bc965e 100644
--- a/drivers/soc/imx/gpc.c
+++ b/drivers/soc/imx/gpc.c
@@ -202,7 +202,7 @@ static int imx_pgc_power_domain_probe(struct platform_device *pdev)
 			goto genpd_err;
 	}
 
-	device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE);
+	device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE_CONSUMER);
 
 	return 0;
 
diff --git a/include/linux/device.h b/include/linux/device.h
index 055a69dbcd18..3929805cdd59 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -90,7 +90,7 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
  * @num_vf:	Called to find out how many virtual functions a device on this
  *		bus supports.
  * @dma_configure:	Called to setup DMA configuration on a device on
-			this bus.
+ *			this bus.
  * @pm:		Power management operations of this bus, callback the specific
  *		device driver's pm-ops.
  * @iommu_ops:  IOMMU specific operations for this bus, used to attach IOMMU
@@ -784,14 +784,14 @@ enum device_link_state {
  * Device link flags.
  *
  * STATELESS: The core won't track the presence of supplier/consumer drivers.
- * AUTOREMOVE: Remove this link automatically on consumer driver unbind.
+ * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
  * PM_RUNTIME: If set, the runtime PM framework will use this link.
  * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
  */
-#define DL_FLAG_STATELESS	BIT(0)
-#define DL_FLAG_AUTOREMOVE	BIT(1)
-#define DL_FLAG_PM_RUNTIME	BIT(2)
-#define DL_FLAG_RPM_ACTIVE	BIT(3)
+#define DL_FLAG_STATELESS		BIT(0)
+#define DL_FLAG_AUTOREMOVE_CONSUMER	BIT(1)
+#define DL_FLAG_PM_RUNTIME		BIT(2)
+#define DL_FLAG_RPM_ACTIVE		BIT(3)
 
 /**
  * struct device_link - Device link representation.
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 1/2] device core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER
@ 2018-06-27 12:50 ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-06-27 12:50 UTC (permalink / raw)
  To: rjw, linux-kernel
  Cc: Vivek Gautam, Lukas Wunner, Jonathan Corbet, Greg Kroah-Hartman,
	Thierry Reding, David Airlie, Jonathan Hunter, Philipp Zabel,
	Shawn Guo, Sascha Hauer, Robin Murphy, linux-doc, dri-devel,
	linux-tegra, linux-arm-kernel, linux-pm, linux-arm-msm

Now that we want to add another flag to autoremove the device link
on supplier unbind, it's fair to rename the existing flag from
DL_FLAG_AUTOREMOVE to DL_FLAG_AUTOREMOVE_CONSUMER so that we can
add similar flag for supplier later.
And, while we are touching device.h, fix a doc build warning.

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: linux-doc@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-tegra@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org
---
 Documentation/driver-api/device_link.rst |  8 ++++----
 drivers/base/core.c                      | 15 ++++++++-------
 drivers/gpu/drm/tegra/dc.c               |  2 +-
 drivers/gpu/ipu-v3/ipu-pre.c             |  3 ++-
 drivers/gpu/ipu-v3/ipu-prg.c             |  3 ++-
 drivers/soc/imx/gpc.c                    |  2 +-
 include/linux/device.h                   | 12 ++++++------
 7 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
index 70e328e16aad..a005b904a264 100644
--- a/Documentation/driver-api/device_link.rst
+++ b/Documentation/driver-api/device_link.rst
@@ -81,10 +81,10 @@ integration is desired.
 Two other flags are specifically targeted at use cases where the device
 link is added from the consumer's ``->probe`` callback:  ``DL_FLAG_RPM_ACTIVE``
 can be specified to runtime resume the supplier upon addition of the
-device link.  ``DL_FLAG_AUTOREMOVE`` causes the device link to be automatically
-purged when the consumer fails to probe or later unbinds.  This obviates
-the need to explicitly delete the link in the ``->remove`` callback or in
-the error path of the ``->probe`` callback.
+device link.  ``DL_FLAG_AUTOREMOVE_CONSUMER`` causes the device link to be
+automatically purged when the consumer fails to probe or later unbinds.
+This obviates the need to explicitly delete the link in the ``->remove``
+callback or in the error path of the ``->probe`` callback.
 
 Limitations
 ===========
diff --git a/drivers/base/core.c b/drivers/base/core.c
index df3e1a44707a..14c1e3151e08 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -178,10 +178,10 @@ void device_pm_move_to_tail(struct device *dev)
  * of the link.  If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be
  * ignored.
  *
- * If the DL_FLAG_AUTOREMOVE is set, the link will be removed automatically
- * when the consumer device driver unbinds from it.  The combination of both
- * DL_FLAG_AUTOREMOVE and DL_FLAG_STATELESS set is invalid and will cause NULL
- * to be returned.
+ * If the DL_FLAG_AUTOREMOVE_CONSUMER is set, the link will be removed
+ * automatically when the consumer device driver unbinds from it.
+ * The combination of both DL_FLAG_AUTOREMOVE_CONSUMER and DL_FLAG_STATELESS
+ * set is invalid and will cause NULL to be returned.
  *
  * A side effect of the link creation is re-ordering of dpm_list and the
  * devices_kset list by moving the consumer device and all devices depending
@@ -198,7 +198,8 @@ struct device_link *device_link_add(struct device *consumer,
 	struct device_link *link;
 
 	if (!consumer || !supplier ||
-	    ((flags & DL_FLAG_STATELESS) && (flags & DL_FLAG_AUTOREMOVE)))
+	    ((flags & DL_FLAG_STATELESS) &&
+	     (flags & DL_FLAG_AUTOREMOVE_CONSUMER)))
 		return NULL;
 
 	device_links_write_lock();
@@ -479,7 +480,7 @@ static void __device_links_no_driver(struct device *dev)
 		if (link->flags & DL_FLAG_STATELESS)
 			continue;
 
-		if (link->flags & DL_FLAG_AUTOREMOVE)
+		if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER)
 			kref_put(&link->kref, __device_link_del);
 		else if (link->status != DL_STATE_SUPPLIER_UNBIND)
 			WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
@@ -515,7 +516,7 @@ void device_links_driver_cleanup(struct device *dev)
 		if (link->flags & DL_FLAG_STATELESS)
 			continue;
 
-		WARN_ON(link->flags & DL_FLAG_AUTOREMOVE);
+		WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
 		WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
 		WRITE_ONCE(link->status, DL_STATE_DORMANT);
 	}
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index c3afe7b2237e..965088afcfad 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -2312,7 +2312,7 @@ static int tegra_dc_couple(struct tegra_dc *dc)
 	 * POWER_CONTROL registers during CRTC enabling.
 	 */
 	if (dc->soc->coupled_pm && dc->pipe == 1) {
-		u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE;
+		u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER;
 		struct device_link *link;
 		struct device *partner;
 
diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
index 0f70e8847540..2f8db9d62551 100644
--- a/drivers/gpu/ipu-v3/ipu-pre.c
+++ b/drivers/gpu/ipu-v3/ipu-pre.c
@@ -128,7 +128,8 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
 	list_for_each_entry(pre, &ipu_pre_list, list) {
 		if (pre_node == pre->dev->of_node) {
 			mutex_unlock(&ipu_pre_list_mutex);
-			device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE);
+			device_link_add(dev, pre->dev,
+					DL_FLAG_AUTOREMOVE_CONSUMER);
 			of_node_put(pre_node);
 			return pre;
 		}
diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c
index 83f9dd934a5d..38a3a9764e49 100644
--- a/drivers/gpu/ipu-v3/ipu-prg.c
+++ b/drivers/gpu/ipu-v3/ipu-prg.c
@@ -100,7 +100,8 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
 	list_for_each_entry(prg, &ipu_prg_list, list) {
 		if (prg_node == prg->dev->of_node) {
 			mutex_unlock(&ipu_prg_list_mutex);
-			device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE);
+			device_link_add(dev, prg->dev,
+					DL_FLAG_AUTOREMOVE_CONSUMER);
 			prg->id = ipu_id;
 			of_node_put(prg_node);
 			return prg;
diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
index 32f0748fd067..aa9e65bc965e 100644
--- a/drivers/soc/imx/gpc.c
+++ b/drivers/soc/imx/gpc.c
@@ -202,7 +202,7 @@ static int imx_pgc_power_domain_probe(struct platform_device *pdev)
 			goto genpd_err;
 	}
 
-	device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE);
+	device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE_CONSUMER);
 
 	return 0;
 
diff --git a/include/linux/device.h b/include/linux/device.h
index 055a69dbcd18..3929805cdd59 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -90,7 +90,7 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
  * @num_vf:	Called to find out how many virtual functions a device on this
  *		bus supports.
  * @dma_configure:	Called to setup DMA configuration on a device on
-			this bus.
+ *			this bus.
  * @pm:		Power management operations of this bus, callback the specific
  *		device driver's pm-ops.
  * @iommu_ops:  IOMMU specific operations for this bus, used to attach IOMMU
@@ -784,14 +784,14 @@ enum device_link_state {
  * Device link flags.
  *
  * STATELESS: The core won't track the presence of supplier/consumer drivers.
- * AUTOREMOVE: Remove this link automatically on consumer driver unbind.
+ * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
  * PM_RUNTIME: If set, the runtime PM framework will use this link.
  * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
  */
-#define DL_FLAG_STATELESS	BIT(0)
-#define DL_FLAG_AUTOREMOVE	BIT(1)
-#define DL_FLAG_PM_RUNTIME	BIT(2)
-#define DL_FLAG_RPM_ACTIVE	BIT(3)
+#define DL_FLAG_STATELESS		BIT(0)
+#define DL_FLAG_AUTOREMOVE_CONSUMER	BIT(1)
+#define DL_FLAG_PM_RUNTIME		BIT(2)
+#define DL_FLAG_RPM_ACTIVE		BIT(3)
 
 /**
  * struct device_link - Device link representation.
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 1/2] device core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER
@ 2018-06-27 12:50 ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-06-27 12:50 UTC (permalink / raw)
  To: linux-arm-kernel

Now that we want to add another flag to autoremove the device link
on supplier unbind, it's fair to rename the existing flag from
DL_FLAG_AUTOREMOVE to DL_FLAG_AUTOREMOVE_CONSUMER so that we can
add similar flag for supplier later.
And, while we are touching device.h, fix a doc build warning.

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: linux-doc at vger.kernel.org
Cc: dri-devel at lists.freedesktop.org
Cc: linux-tegra at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-pm at vger.kernel.org
Cc: linux-arm-msm at vger.kernel.org
---
 Documentation/driver-api/device_link.rst |  8 ++++----
 drivers/base/core.c                      | 15 ++++++++-------
 drivers/gpu/drm/tegra/dc.c               |  2 +-
 drivers/gpu/ipu-v3/ipu-pre.c             |  3 ++-
 drivers/gpu/ipu-v3/ipu-prg.c             |  3 ++-
 drivers/soc/imx/gpc.c                    |  2 +-
 include/linux/device.h                   | 12 ++++++------
 7 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
index 70e328e16aad..a005b904a264 100644
--- a/Documentation/driver-api/device_link.rst
+++ b/Documentation/driver-api/device_link.rst
@@ -81,10 +81,10 @@ integration is desired.
 Two other flags are specifically targeted at use cases where the device
 link is added from the consumer's ``->probe`` callback:  ``DL_FLAG_RPM_ACTIVE``
 can be specified to runtime resume the supplier upon addition of the
-device link.  ``DL_FLAG_AUTOREMOVE`` causes the device link to be automatically
-purged when the consumer fails to probe or later unbinds.  This obviates
-the need to explicitly delete the link in the ``->remove`` callback or in
-the error path of the ``->probe`` callback.
+device link.  ``DL_FLAG_AUTOREMOVE_CONSUMER`` causes the device link to be
+automatically purged when the consumer fails to probe or later unbinds.
+This obviates the need to explicitly delete the link in the ``->remove``
+callback or in the error path of the ``->probe`` callback.
 
 Limitations
 ===========
diff --git a/drivers/base/core.c b/drivers/base/core.c
index df3e1a44707a..14c1e3151e08 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -178,10 +178,10 @@ void device_pm_move_to_tail(struct device *dev)
  * of the link.  If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be
  * ignored.
  *
- * If the DL_FLAG_AUTOREMOVE is set, the link will be removed automatically
- * when the consumer device driver unbinds from it.  The combination of both
- * DL_FLAG_AUTOREMOVE and DL_FLAG_STATELESS set is invalid and will cause NULL
- * to be returned.
+ * If the DL_FLAG_AUTOREMOVE_CONSUMER is set, the link will be removed
+ * automatically when the consumer device driver unbinds from it.
+ * The combination of both DL_FLAG_AUTOREMOVE_CONSUMER and DL_FLAG_STATELESS
+ * set is invalid and will cause NULL to be returned.
  *
  * A side effect of the link creation is re-ordering of dpm_list and the
  * devices_kset list by moving the consumer device and all devices depending
@@ -198,7 +198,8 @@ struct device_link *device_link_add(struct device *consumer,
 	struct device_link *link;
 
 	if (!consumer || !supplier ||
-	    ((flags & DL_FLAG_STATELESS) && (flags & DL_FLAG_AUTOREMOVE)))
+	    ((flags & DL_FLAG_STATELESS) &&
+	     (flags & DL_FLAG_AUTOREMOVE_CONSUMER)))
 		return NULL;
 
 	device_links_write_lock();
@@ -479,7 +480,7 @@ static void __device_links_no_driver(struct device *dev)
 		if (link->flags & DL_FLAG_STATELESS)
 			continue;
 
-		if (link->flags & DL_FLAG_AUTOREMOVE)
+		if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER)
 			kref_put(&link->kref, __device_link_del);
 		else if (link->status != DL_STATE_SUPPLIER_UNBIND)
 			WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
@@ -515,7 +516,7 @@ void device_links_driver_cleanup(struct device *dev)
 		if (link->flags & DL_FLAG_STATELESS)
 			continue;
 
-		WARN_ON(link->flags & DL_FLAG_AUTOREMOVE);
+		WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
 		WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
 		WRITE_ONCE(link->status, DL_STATE_DORMANT);
 	}
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index c3afe7b2237e..965088afcfad 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -2312,7 +2312,7 @@ static int tegra_dc_couple(struct tegra_dc *dc)
 	 * POWER_CONTROL registers during CRTC enabling.
 	 */
 	if (dc->soc->coupled_pm && dc->pipe == 1) {
-		u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE;
+		u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER;
 		struct device_link *link;
 		struct device *partner;
 
diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
index 0f70e8847540..2f8db9d62551 100644
--- a/drivers/gpu/ipu-v3/ipu-pre.c
+++ b/drivers/gpu/ipu-v3/ipu-pre.c
@@ -128,7 +128,8 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
 	list_for_each_entry(pre, &ipu_pre_list, list) {
 		if (pre_node == pre->dev->of_node) {
 			mutex_unlock(&ipu_pre_list_mutex);
-			device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE);
+			device_link_add(dev, pre->dev,
+					DL_FLAG_AUTOREMOVE_CONSUMER);
 			of_node_put(pre_node);
 			return pre;
 		}
diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c
index 83f9dd934a5d..38a3a9764e49 100644
--- a/drivers/gpu/ipu-v3/ipu-prg.c
+++ b/drivers/gpu/ipu-v3/ipu-prg.c
@@ -100,7 +100,8 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
 	list_for_each_entry(prg, &ipu_prg_list, list) {
 		if (prg_node == prg->dev->of_node) {
 			mutex_unlock(&ipu_prg_list_mutex);
-			device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE);
+			device_link_add(dev, prg->dev,
+					DL_FLAG_AUTOREMOVE_CONSUMER);
 			prg->id = ipu_id;
 			of_node_put(prg_node);
 			return prg;
diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
index 32f0748fd067..aa9e65bc965e 100644
--- a/drivers/soc/imx/gpc.c
+++ b/drivers/soc/imx/gpc.c
@@ -202,7 +202,7 @@ static int imx_pgc_power_domain_probe(struct platform_device *pdev)
 			goto genpd_err;
 	}
 
-	device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE);
+	device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE_CONSUMER);
 
 	return 0;
 
diff --git a/include/linux/device.h b/include/linux/device.h
index 055a69dbcd18..3929805cdd59 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -90,7 +90,7 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
  * @num_vf:	Called to find out how many virtual functions a device on this
  *		bus supports.
  * @dma_configure:	Called to setup DMA configuration on a device on
-			this bus.
+ *			this bus.
  * @pm:		Power management operations of this bus, callback the specific
  *		device driver's pm-ops.
  * @iommu_ops:  IOMMU specific operations for this bus, used to attach IOMMU
@@ -784,14 +784,14 @@ enum device_link_state {
  * Device link flags.
  *
  * STATELESS: The core won't track the presence of supplier/consumer drivers.
- * AUTOREMOVE: Remove this link automatically on consumer driver unbind.
+ * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
  * PM_RUNTIME: If set, the runtime PM framework will use this link.
  * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
  */
-#define DL_FLAG_STATELESS	BIT(0)
-#define DL_FLAG_AUTOREMOVE	BIT(1)
-#define DL_FLAG_PM_RUNTIME	BIT(2)
-#define DL_FLAG_RPM_ACTIVE	BIT(3)
+#define DL_FLAG_STATELESS		BIT(0)
+#define DL_FLAG_AUTOREMOVE_CONSUMER	BIT(1)
+#define DL_FLAG_PM_RUNTIME		BIT(2)
+#define DL_FLAG_RPM_ACTIVE		BIT(3)
 
 /**
  * struct device_link - Device link representation.
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
  2018-06-27 12:50 ` Vivek Gautam
  (?)
@ 2018-06-27 12:50   ` Vivek Gautam
  -1 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-06-27 12:50 UTC (permalink / raw)
  To: rjw, linux-kernel
  Cc: Vivek Gautam, Jonathan Corbet, Greg Kroah-Hartman, Robin Murphy,
	linux-doc, linux-arm-kernel, linux-pm, linux-arm-msm

Add a flag to autoremove the device links on supplier driver
unbind. This obviates the need to explicitly delete the link
in the remove path.
We remove these links only when the supplier's link to its
consumers has gone to DL_STATE_SUPPLIER_UNBIND state.

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Suggested-by: Lukas Wunner <lukas@wunner.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: linux-doc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org
---
 Documentation/driver-api/device_link.rst |  4 ++++
 drivers/base/core.c                      | 10 ++++++++++
 include/linux/device.h                   |  2 ++
 3 files changed, 16 insertions(+)

diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
index a005b904a264..d6763272e747 100644
--- a/Documentation/driver-api/device_link.rst
+++ b/Documentation/driver-api/device_link.rst
@@ -86,6 +86,10 @@ automatically purged when the consumer fails to probe or later unbinds.
 This obviates the need to explicitly delete the link in the ``->remove``
 callback or in the error path of the ``->probe`` callback.
 
+Similarly, when the device link is added from supplier's ``->probe`` callback,
+``DL_FLAG_AUTOREMOVE_SUPPLIER`` causes the device link to be automatically
+purged when the supplier fails to probe or later unbinds.
+
 Limitations
 ===========
 
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 14c1e3151e08..e721218bf352 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -518,6 +518,16 @@ void device_links_driver_cleanup(struct device *dev)
 
 		WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
 		WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
+
+		/*
+		 * autoremove the links between this @dev and its consumer
+		 * devices that are not active, i.e. where the link state
+		 * has moved to DL_STATE_SUPPLIER_UNBIND.
+		 */
+		if (link->status == DL_STATE_SUPPLIER_UNBIND &&
+		    link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER)
+			kref_put(&link->kref, __device_link_del);
+
 		WRITE_ONCE(link->status, DL_STATE_DORMANT);
 	}
 
diff --git a/include/linux/device.h b/include/linux/device.h
index 3929805cdd59..e80920452b49 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -787,11 +787,13 @@ enum device_link_state {
  * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
  * PM_RUNTIME: If set, the runtime PM framework will use this link.
  * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
+ * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
  */
 #define DL_FLAG_STATELESS		BIT(0)
 #define DL_FLAG_AUTOREMOVE_CONSUMER	BIT(1)
 #define DL_FLAG_PM_RUNTIME		BIT(2)
 #define DL_FLAG_RPM_ACTIVE		BIT(3)
+#define DL_FLAG_AUTOREMOVE_SUPPLIER	BIT(4)
 
 /**
  * struct device_link - Device link representation.
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-06-27 12:50   ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-06-27 12:50 UTC (permalink / raw)
  To: rjw, linux-kernel
  Cc: Vivek Gautam, Jonathan Corbet, Greg Kroah-Hartman, Robin Murphy,
	linux-doc, linux-arm-kernel, linux-pm, linux-arm-msm

Add a flag to autoremove the device links on supplier driver
unbind. This obviates the need to explicitly delete the link
in the remove path.
We remove these links only when the supplier's link to its
consumers has gone to DL_STATE_SUPPLIER_UNBIND state.

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Suggested-by: Lukas Wunner <lukas@wunner.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: linux-doc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-pm@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org
---
 Documentation/driver-api/device_link.rst |  4 ++++
 drivers/base/core.c                      | 10 ++++++++++
 include/linux/device.h                   |  2 ++
 3 files changed, 16 insertions(+)

diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
index a005b904a264..d6763272e747 100644
--- a/Documentation/driver-api/device_link.rst
+++ b/Documentation/driver-api/device_link.rst
@@ -86,6 +86,10 @@ automatically purged when the consumer fails to probe or later unbinds.
 This obviates the need to explicitly delete the link in the ``->remove``
 callback or in the error path of the ``->probe`` callback.
 
+Similarly, when the device link is added from supplier's ``->probe`` callback,
+``DL_FLAG_AUTOREMOVE_SUPPLIER`` causes the device link to be automatically
+purged when the supplier fails to probe or later unbinds.
+
 Limitations
 ===========
 
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 14c1e3151e08..e721218bf352 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -518,6 +518,16 @@ void device_links_driver_cleanup(struct device *dev)
 
 		WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
 		WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
+
+		/*
+		 * autoremove the links between this @dev and its consumer
+		 * devices that are not active, i.e. where the link state
+		 * has moved to DL_STATE_SUPPLIER_UNBIND.
+		 */
+		if (link->status == DL_STATE_SUPPLIER_UNBIND &&
+		    link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER)
+			kref_put(&link->kref, __device_link_del);
+
 		WRITE_ONCE(link->status, DL_STATE_DORMANT);
 	}
 
diff --git a/include/linux/device.h b/include/linux/device.h
index 3929805cdd59..e80920452b49 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -787,11 +787,13 @@ enum device_link_state {
  * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
  * PM_RUNTIME: If set, the runtime PM framework will use this link.
  * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
+ * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
  */
 #define DL_FLAG_STATELESS		BIT(0)
 #define DL_FLAG_AUTOREMOVE_CONSUMER	BIT(1)
 #define DL_FLAG_PM_RUNTIME		BIT(2)
 #define DL_FLAG_RPM_ACTIVE		BIT(3)
+#define DL_FLAG_AUTOREMOVE_SUPPLIER	BIT(4)
 
 /**
  * struct device_link - Device link representation.
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-06-27 12:50   ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-06-27 12:50 UTC (permalink / raw)
  To: linux-arm-kernel

Add a flag to autoremove the device links on supplier driver
unbind. This obviates the need to explicitly delete the link
in the remove path.
We remove these links only when the supplier's link to its
consumers has gone to DL_STATE_SUPPLIER_UNBIND state.

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Suggested-by: Lukas Wunner <lukas@wunner.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: linux-doc at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-pm at vger.kernel.org
Cc: linux-arm-msm at vger.kernel.org
---
 Documentation/driver-api/device_link.rst |  4 ++++
 drivers/base/core.c                      | 10 ++++++++++
 include/linux/device.h                   |  2 ++
 3 files changed, 16 insertions(+)

diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
index a005b904a264..d6763272e747 100644
--- a/Documentation/driver-api/device_link.rst
+++ b/Documentation/driver-api/device_link.rst
@@ -86,6 +86,10 @@ automatically purged when the consumer fails to probe or later unbinds.
 This obviates the need to explicitly delete the link in the ``->remove``
 callback or in the error path of the ``->probe`` callback.
 
+Similarly, when the device link is added from supplier's ``->probe`` callback,
+``DL_FLAG_AUTOREMOVE_SUPPLIER`` causes the device link to be automatically
+purged when the supplier fails to probe or later unbinds.
+
 Limitations
 ===========
 
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 14c1e3151e08..e721218bf352 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -518,6 +518,16 @@ void device_links_driver_cleanup(struct device *dev)
 
 		WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
 		WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
+
+		/*
+		 * autoremove the links between this @dev and its consumer
+		 * devices that are not active, i.e. where the link state
+		 * has moved to DL_STATE_SUPPLIER_UNBIND.
+		 */
+		if (link->status == DL_STATE_SUPPLIER_UNBIND &&
+		    link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER)
+			kref_put(&link->kref, __device_link_del);
+
 		WRITE_ONCE(link->status, DL_STATE_DORMANT);
 	}
 
diff --git a/include/linux/device.h b/include/linux/device.h
index 3929805cdd59..e80920452b49 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -787,11 +787,13 @@ enum device_link_state {
  * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
  * PM_RUNTIME: If set, the runtime PM framework will use this link.
  * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
+ * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
  */
 #define DL_FLAG_STATELESS		BIT(0)
 #define DL_FLAG_AUTOREMOVE_CONSUMER	BIT(1)
 #define DL_FLAG_PM_RUNTIME		BIT(2)
 #define DL_FLAG_RPM_ACTIVE		BIT(3)
+#define DL_FLAG_AUTOREMOVE_SUPPLIER	BIT(4)
 
 /**
  * struct device_link - Device link representation.
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
  2018-06-27 12:50   ` Vivek Gautam
  (?)
@ 2018-07-04  7:16     ` Vivek Gautam
  -1 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-04  7:16 UTC (permalink / raw)
  To: rjw, linux-kernel
  Cc: Jonathan Corbet, Greg Kroah-Hartman, Robin Murphy, linux-doc,
	linux-arm-kernel, linux-pm, linux-arm-msm, Ulf Hansson,
	Marek Szyprowski

Adding Ulf and Marek.

On 6/27/2018 6:20 PM, Vivek Gautam wrote:
> Add a flag to autoremove the device links on supplier driver
> unbind. This obviates the need to explicitly delete the link
> in the remove path.
> We remove these links only when the supplier's link to its
> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>
> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> Suggested-by: Lukas Wunner <lukas@wunner.de>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: linux-doc@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-msm@vger.kernel.org
> ---

Hi Rafael, et al.

Gentle ping.
Do you have comments on this series. I would really like to conclude these
device link additions sooner, and get things moving on the long awaited
arm-smmu clock/runtime support series.

Thanks again for reviewing these patches.

Best regards
Vivek
>   Documentation/driver-api/device_link.rst |  4 ++++
>   drivers/base/core.c                      | 10 ++++++++++
>   include/linux/device.h                   |  2 ++
>   3 files changed, 16 insertions(+)
>
> diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
> index a005b904a264..d6763272e747 100644
> --- a/Documentation/driver-api/device_link.rst
> +++ b/Documentation/driver-api/device_link.rst
> @@ -86,6 +86,10 @@ automatically purged when the consumer fails to probe or later unbinds.
>   This obviates the need to explicitly delete the link in the ``->remove``
>   callback or in the error path of the ``->probe`` callback.
>   
> +Similarly, when the device link is added from supplier's ``->probe`` callback,
> +``DL_FLAG_AUTOREMOVE_SUPPLIER`` causes the device link to be automatically
> +purged when the supplier fails to probe or later unbinds.
> +
>   Limitations
>   ===========
>   
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 14c1e3151e08..e721218bf352 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -518,6 +518,16 @@ void device_links_driver_cleanup(struct device *dev)
>   
>   		WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
>   		WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
> +
> +		/*
> +		 * autoremove the links between this @dev and its consumer
> +		 * devices that are not active, i.e. where the link state
> +		 * has moved to DL_STATE_SUPPLIER_UNBIND.
> +		 */
> +		if (link->status == DL_STATE_SUPPLIER_UNBIND &&
> +		    link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER)
> +			kref_put(&link->kref, __device_link_del);
> +
>   		WRITE_ONCE(link->status, DL_STATE_DORMANT);
>   	}
>   
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 3929805cdd59..e80920452b49 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -787,11 +787,13 @@ enum device_link_state {
>    * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
>    * PM_RUNTIME: If set, the runtime PM framework will use this link.
>    * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
> + * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
>    */
>   #define DL_FLAG_STATELESS		BIT(0)
>   #define DL_FLAG_AUTOREMOVE_CONSUMER	BIT(1)
>   #define DL_FLAG_PM_RUNTIME		BIT(2)
>   #define DL_FLAG_RPM_ACTIVE		BIT(3)
> +#define DL_FLAG_AUTOREMOVE_SUPPLIER	BIT(4)
>   
>   /**
>    * struct device_link - Device link representation.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04  7:16     ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-04  7:16 UTC (permalink / raw)
  To: rjw, linux-kernel
  Cc: Jonathan Corbet, Greg Kroah-Hartman, Robin Murphy, linux-doc,
	linux-arm-kernel, linux-pm, linux-arm-msm, Ulf Hansson,
	Marek Szyprowski

Adding Ulf and Marek.

On 6/27/2018 6:20 PM, Vivek Gautam wrote:
> Add a flag to autoremove the device links on supplier driver
> unbind. This obviates the need to explicitly delete the link
> in the remove path.
> We remove these links only when the supplier's link to its
> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>
> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> Suggested-by: Lukas Wunner <lukas@wunner.de>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: linux-doc@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-msm@vger.kernel.org
> ---

Hi Rafael, et al.

Gentle ping.
Do you have comments on this series. I would really like to conclude these
device link additions sooner, and get things moving on the long awaited
arm-smmu clock/runtime support series.

Thanks again for reviewing these patches.

Best regards
Vivek
>   Documentation/driver-api/device_link.rst |  4 ++++
>   drivers/base/core.c                      | 10 ++++++++++
>   include/linux/device.h                   |  2 ++
>   3 files changed, 16 insertions(+)
>
> diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
> index a005b904a264..d6763272e747 100644
> --- a/Documentation/driver-api/device_link.rst
> +++ b/Documentation/driver-api/device_link.rst
> @@ -86,6 +86,10 @@ automatically purged when the consumer fails to probe or later unbinds.
>   This obviates the need to explicitly delete the link in the ``->remove``
>   callback or in the error path of the ``->probe`` callback.
>   
> +Similarly, when the device link is added from supplier's ``->probe`` callback,
> +``DL_FLAG_AUTOREMOVE_SUPPLIER`` causes the device link to be automatically
> +purged when the supplier fails to probe or later unbinds.
> +
>   Limitations
>   ===========
>   
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 14c1e3151e08..e721218bf352 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -518,6 +518,16 @@ void device_links_driver_cleanup(struct device *dev)
>   
>   		WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
>   		WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
> +
> +		/*
> +		 * autoremove the links between this @dev and its consumer
> +		 * devices that are not active, i.e. where the link state
> +		 * has moved to DL_STATE_SUPPLIER_UNBIND.
> +		 */
> +		if (link->status == DL_STATE_SUPPLIER_UNBIND &&
> +		    link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER)
> +			kref_put(&link->kref, __device_link_del);
> +
>   		WRITE_ONCE(link->status, DL_STATE_DORMANT);
>   	}
>   
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 3929805cdd59..e80920452b49 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -787,11 +787,13 @@ enum device_link_state {
>    * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
>    * PM_RUNTIME: If set, the runtime PM framework will use this link.
>    * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
> + * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
>    */
>   #define DL_FLAG_STATELESS		BIT(0)
>   #define DL_FLAG_AUTOREMOVE_CONSUMER	BIT(1)
>   #define DL_FLAG_PM_RUNTIME		BIT(2)
>   #define DL_FLAG_RPM_ACTIVE		BIT(3)
> +#define DL_FLAG_AUTOREMOVE_SUPPLIER	BIT(4)
>   
>   /**
>    * struct device_link - Device link representation.

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04  7:16     ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-04  7:16 UTC (permalink / raw)
  To: linux-arm-kernel

Adding Ulf and Marek.

On 6/27/2018 6:20 PM, Vivek Gautam wrote:
> Add a flag to autoremove the device links on supplier driver
> unbind. This obviates the need to explicitly delete the link
> in the remove path.
> We remove these links only when the supplier's link to its
> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>
> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> Suggested-by: Lukas Wunner <lukas@wunner.de>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: linux-doc at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-pm at vger.kernel.org
> Cc: linux-arm-msm at vger.kernel.org
> ---

Hi Rafael, et al.

Gentle ping.
Do you have comments on this series. I would really like to conclude these
device link additions sooner, and get things moving on the long awaited
arm-smmu clock/runtime support series.

Thanks again for reviewing these patches.

Best regards
Vivek
>   Documentation/driver-api/device_link.rst |  4 ++++
>   drivers/base/core.c                      | 10 ++++++++++
>   include/linux/device.h                   |  2 ++
>   3 files changed, 16 insertions(+)
>
> diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
> index a005b904a264..d6763272e747 100644
> --- a/Documentation/driver-api/device_link.rst
> +++ b/Documentation/driver-api/device_link.rst
> @@ -86,6 +86,10 @@ automatically purged when the consumer fails to probe or later unbinds.
>   This obviates the need to explicitly delete the link in the ``->remove``
>   callback or in the error path of the ``->probe`` callback.
>   
> +Similarly, when the device link is added from supplier's ``->probe`` callback,
> +``DL_FLAG_AUTOREMOVE_SUPPLIER`` causes the device link to be automatically
> +purged when the supplier fails to probe or later unbinds.
> +
>   Limitations
>   ===========
>   
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 14c1e3151e08..e721218bf352 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -518,6 +518,16 @@ void device_links_driver_cleanup(struct device *dev)
>   
>   		WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
>   		WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
> +
> +		/*
> +		 * autoremove the links between this @dev and its consumer
> +		 * devices that are not active, i.e. where the link state
> +		 * has moved to DL_STATE_SUPPLIER_UNBIND.
> +		 */
> +		if (link->status == DL_STATE_SUPPLIER_UNBIND &&
> +		    link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER)
> +			kref_put(&link->kref, __device_link_del);
> +
>   		WRITE_ONCE(link->status, DL_STATE_DORMANT);
>   	}
>   
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 3929805cdd59..e80920452b49 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -787,11 +787,13 @@ enum device_link_state {
>    * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
>    * PM_RUNTIME: If set, the runtime PM framework will use this link.
>    * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
> + * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
>    */
>   #define DL_FLAG_STATELESS		BIT(0)
>   #define DL_FLAG_AUTOREMOVE_CONSUMER	BIT(1)
>   #define DL_FLAG_PM_RUNTIME		BIT(2)
>   #define DL_FLAG_RPM_ACTIVE		BIT(3)
> +#define DL_FLAG_AUTOREMOVE_SUPPLIER	BIT(4)
>   
>   /**
>    * struct device_link - Device link representation.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
  2018-07-04  7:16     ` Vivek Gautam
  (?)
@ 2018-07-04 10:44       ` Rafael J. Wysocki
  -1 siblings, 0 replies; 39+ messages in thread
From: Rafael J. Wysocki @ 2018-07-04 10:44 UTC (permalink / raw)
  To: Vivek Gautam, Greg Kroah-Hartman
  Cc: linux-kernel, Jonathan Corbet, Robin Murphy, linux-doc,
	linux-arm-kernel, linux-pm, linux-arm-msm, Ulf Hansson,
	Marek Szyprowski

On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
> Adding Ulf and Marek.
> 
> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
> > Add a flag to autoremove the device links on supplier driver
> > unbind. This obviates the need to explicitly delete the link
> > in the remove path.
> > We remove these links only when the supplier's link to its
> > consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
> >
> > Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> > Suggested-by: Lukas Wunner <lukas@wunner.de>
> > Cc: Jonathan Corbet <corbet@lwn.net>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Robin Murphy <robin.murphy@arm.com>
> > Cc: linux-doc@vger.kernel.org
> > Cc: linux-arm-kernel@lists.infradead.org
> > Cc: linux-pm@vger.kernel.org
> > Cc: linux-arm-msm@vger.kernel.org
> > ---
> 
> Hi Rafael, et al.
> 
> Gentle ping.
> Do you have comments on this series. I would really like to conclude these
> device link additions sooner, and get things moving on the long awaited
> arm-smmu clock/runtime support series.
> 
> Thanks again for reviewing these patches.

They are fine by me.

I can queue them up for 4.19 if no one has objections (Greg in
particular).

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04 10:44       ` Rafael J. Wysocki
  0 siblings, 0 replies; 39+ messages in thread
From: Rafael J. Wysocki @ 2018-07-04 10:44 UTC (permalink / raw)
  To: Vivek Gautam, Greg Kroah-Hartman
  Cc: linux-kernel, Jonathan Corbet, Robin Murphy, linux-doc,
	linux-arm-kernel, linux-pm, linux-arm-msm, Ulf Hansson,
	Marek Szyprowski

On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
> Adding Ulf and Marek.
> 
> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
> > Add a flag to autoremove the device links on supplier driver
> > unbind. This obviates the need to explicitly delete the link
> > in the remove path.
> > We remove these links only when the supplier's link to its
> > consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
> >
> > Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> > Suggested-by: Lukas Wunner <lukas@wunner.de>
> > Cc: Jonathan Corbet <corbet@lwn.net>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Robin Murphy <robin.murphy@arm.com>
> > Cc: linux-doc@vger.kernel.org
> > Cc: linux-arm-kernel@lists.infradead.org
> > Cc: linux-pm@vger.kernel.org
> > Cc: linux-arm-msm@vger.kernel.org
> > ---
> 
> Hi Rafael, et al.
> 
> Gentle ping.
> Do you have comments on this series. I would really like to conclude these
> device link additions sooner, and get things moving on the long awaited
> arm-smmu clock/runtime support series.
> 
> Thanks again for reviewing these patches.

They are fine by me.

I can queue them up for 4.19 if no one has objections (Greg in
particular).

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04 10:44       ` Rafael J. Wysocki
  0 siblings, 0 replies; 39+ messages in thread
From: Rafael J. Wysocki @ 2018-07-04 10:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
> Adding Ulf and Marek.
> 
> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
> > Add a flag to autoremove the device links on supplier driver
> > unbind. This obviates the need to explicitly delete the link
> > in the remove path.
> > We remove these links only when the supplier's link to its
> > consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
> >
> > Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> > Suggested-by: Lukas Wunner <lukas@wunner.de>
> > Cc: Jonathan Corbet <corbet@lwn.net>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Robin Murphy <robin.murphy@arm.com>
> > Cc: linux-doc at vger.kernel.org
> > Cc: linux-arm-kernel at lists.infradead.org
> > Cc: linux-pm at vger.kernel.org
> > Cc: linux-arm-msm at vger.kernel.org
> > ---
> 
> Hi Rafael, et al.
> 
> Gentle ping.
> Do you have comments on this series. I would really like to conclude these
> device link additions sooner, and get things moving on the long awaited
> arm-smmu clock/runtime support series.
> 
> Thanks again for reviewing these patches.

They are fine by me.

I can queue them up for 4.19 if no one has objections (Greg in
particular).

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
  2018-07-04 10:44       ` Rafael J. Wysocki
  (?)
@ 2018-07-04 11:19         ` Vivek Gautam
  -1 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-04 11:19 UTC (permalink / raw)
  To: Rafael J. Wysocki, Greg Kroah-Hartman, Robin Murphy
  Cc: linux-kernel, Jonathan Corbet, linux-doc, linux-arm-kernel,
	linux-pm, linux-arm-msm, Ulf Hansson, Marek Szyprowski



On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
>> Adding Ulf and Marek.
>>
>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
>>> Add a flag to autoremove the device links on supplier driver
>>> unbind. This obviates the need to explicitly delete the link
>>> in the remove path.
>>> We remove these links only when the supplier's link to its
>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>>>
>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>> Cc: linux-doc@vger.kernel.org
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: linux-pm@vger.kernel.org
>>> Cc: linux-arm-msm@vger.kernel.org
>>> ---
>> Hi Rafael, et al.
>>
>> Gentle ping.
>> Do you have comments on this series. I would really like to conclude these
>> device link additions sooner, and get things moving on the long awaited
>> arm-smmu clock/runtime support series.
>>
>> Thanks again for reviewing these patches.
> Hi Rafael,

> They are fine by me.

Cool.

>
> I can queue them up for 4.19 if no one has objections (Greg in
> particular).

Thanks for this.
Robin, If this approach is fine with you too, then I can go ahead and 
respin the
smmu patch series - updating the device link flag.

Best regards
Vivek

> Thanks,
> Rafael
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04 11:19         ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-04 11:19 UTC (permalink / raw)
  To: Rafael J. Wysocki, Greg Kroah-Hartman, Robin Murphy
  Cc: linux-kernel, Jonathan Corbet, linux-doc, linux-arm-kernel,
	linux-pm, linux-arm-msm, Ulf Hansson, Marek Szyprowski



On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
>> Adding Ulf and Marek.
>>
>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
>>> Add a flag to autoremove the device links on supplier driver
>>> unbind. This obviates the need to explicitly delete the link
>>> in the remove path.
>>> We remove these links only when the supplier's link to its
>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>>>
>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>> Cc: linux-doc@vger.kernel.org
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: linux-pm@vger.kernel.org
>>> Cc: linux-arm-msm@vger.kernel.org
>>> ---
>> Hi Rafael, et al.
>>
>> Gentle ping.
>> Do you have comments on this series. I would really like to conclude these
>> device link additions sooner, and get things moving on the long awaited
>> arm-smmu clock/runtime support series.
>>
>> Thanks again for reviewing these patches.
> Hi Rafael,

> They are fine by me.

Cool.

>
> I can queue them up for 4.19 if no one has objections (Greg in
> particular).

Thanks for this.
Robin, If this approach is fine with you too, then I can go ahead and 
respin the
smmu patch series - updating the device link flag.

Best regards
Vivek

> Thanks,
> Rafael
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04 11:19         ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-04 11:19 UTC (permalink / raw)
  To: linux-arm-kernel



On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
>> Adding Ulf and Marek.
>>
>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
>>> Add a flag to autoremove the device links on supplier driver
>>> unbind. This obviates the need to explicitly delete the link
>>> in the remove path.
>>> We remove these links only when the supplier's link to its
>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>>>
>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>> Cc: linux-doc at vger.kernel.org
>>> Cc: linux-arm-kernel at lists.infradead.org
>>> Cc: linux-pm at vger.kernel.org
>>> Cc: linux-arm-msm at vger.kernel.org
>>> ---
>> Hi Rafael, et al.
>>
>> Gentle ping.
>> Do you have comments on this series. I would really like to conclude these
>> device link additions sooner, and get things moving on the long awaited
>> arm-smmu clock/runtime support series.
>>
>> Thanks again for reviewing these patches.
> Hi Rafael,

> They are fine by me.

Cool.

>
> I can queue them up for 4.19 if no one has objections (Greg in
> particular).

Thanks for this.
Robin, If this approach is fine with you too, then I can go ahead and 
respin the
smmu patch series - updating the device link flag.

Best regards
Vivek

> Thanks,
> Rafael
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
  2018-07-04 10:44       ` Rafael J. Wysocki
  (?)
@ 2018-07-04 11:32         ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 39+ messages in thread
From: Greg Kroah-Hartman @ 2018-07-04 11:32 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Vivek Gautam, linux-kernel, Jonathan Corbet, Robin Murphy,
	linux-doc, linux-arm-kernel, linux-pm, linux-arm-msm,
	Ulf Hansson, Marek Szyprowski

On Wed, Jul 04, 2018 at 12:44:20PM +0200, Rafael J. Wysocki wrote:
> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
> > Adding Ulf and Marek.
> > 
> > On 6/27/2018 6:20 PM, Vivek Gautam wrote:
> > > Add a flag to autoremove the device links on supplier driver
> > > unbind. This obviates the need to explicitly delete the link
> > > in the remove path.
> > > We remove these links only when the supplier's link to its
> > > consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
> > >
> > > Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> > > Suggested-by: Lukas Wunner <lukas@wunner.de>
> > > Cc: Jonathan Corbet <corbet@lwn.net>
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Cc: Robin Murphy <robin.murphy@arm.com>
> > > Cc: linux-doc@vger.kernel.org
> > > Cc: linux-arm-kernel@lists.infradead.org
> > > Cc: linux-pm@vger.kernel.org
> > > Cc: linux-arm-msm@vger.kernel.org
> > > ---
> > 
> > Hi Rafael, et al.
> > 
> > Gentle ping.
> > Do you have comments on this series. I would really like to conclude these
> > device link additions sooner, and get things moving on the long awaited
> > arm-smmu clock/runtime support series.
> > 
> > Thanks again for reviewing these patches.
> 
> They are fine by me.
> 
> I can queue them up for 4.19 if no one has objections (Greg in
> particular).

No objection from me!

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04 11:32         ` Greg Kroah-Hartman
  0 siblings, 0 replies; 39+ messages in thread
From: Greg Kroah-Hartman @ 2018-07-04 11:32 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Vivek Gautam, linux-kernel, Jonathan Corbet, Robin Murphy,
	linux-doc, linux-arm-kernel, linux-pm, linux-arm-msm,
	Ulf Hansson, Marek Szyprowski

On Wed, Jul 04, 2018 at 12:44:20PM +0200, Rafael J. Wysocki wrote:
> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
> > Adding Ulf and Marek.
> > 
> > On 6/27/2018 6:20 PM, Vivek Gautam wrote:
> > > Add a flag to autoremove the device links on supplier driver
> > > unbind. This obviates the need to explicitly delete the link
> > > in the remove path.
> > > We remove these links only when the supplier's link to its
> > > consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
> > >
> > > Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> > > Suggested-by: Lukas Wunner <lukas@wunner.de>
> > > Cc: Jonathan Corbet <corbet@lwn.net>
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Cc: Robin Murphy <robin.murphy@arm.com>
> > > Cc: linux-doc@vger.kernel.org
> > > Cc: linux-arm-kernel@lists.infradead.org
> > > Cc: linux-pm@vger.kernel.org
> > > Cc: linux-arm-msm@vger.kernel.org
> > > ---
> > 
> > Hi Rafael, et al.
> > 
> > Gentle ping.
> > Do you have comments on this series. I would really like to conclude these
> > device link additions sooner, and get things moving on the long awaited
> > arm-smmu clock/runtime support series.
> > 
> > Thanks again for reviewing these patches.
> 
> They are fine by me.
> 
> I can queue them up for 4.19 if no one has objections (Greg in
> particular).

No objection from me!
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04 11:32         ` Greg Kroah-Hartman
  0 siblings, 0 replies; 39+ messages in thread
From: Greg Kroah-Hartman @ 2018-07-04 11:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 04, 2018 at 12:44:20PM +0200, Rafael J. Wysocki wrote:
> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
> > Adding Ulf and Marek.
> > 
> > On 6/27/2018 6:20 PM, Vivek Gautam wrote:
> > > Add a flag to autoremove the device links on supplier driver
> > > unbind. This obviates the need to explicitly delete the link
> > > in the remove path.
> > > We remove these links only when the supplier's link to its
> > > consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
> > >
> > > Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> > > Suggested-by: Lukas Wunner <lukas@wunner.de>
> > > Cc: Jonathan Corbet <corbet@lwn.net>
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Cc: Robin Murphy <robin.murphy@arm.com>
> > > Cc: linux-doc at vger.kernel.org
> > > Cc: linux-arm-kernel at lists.infradead.org
> > > Cc: linux-pm at vger.kernel.org
> > > Cc: linux-arm-msm at vger.kernel.org
> > > ---
> > 
> > Hi Rafael, et al.
> > 
> > Gentle ping.
> > Do you have comments on this series. I would really like to conclude these
> > device link additions sooner, and get things moving on the long awaited
> > arm-smmu clock/runtime support series.
> > 
> > Thanks again for reviewing these patches.
> 
> They are fine by me.
> 
> I can queue them up for 4.19 if no one has objections (Greg in
> particular).

No objection from me!

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 1/2] device core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER
  2018-06-27 12:50 ` Vivek Gautam
  (?)
@ 2018-07-04 12:55   ` Ulf Hansson
  -1 siblings, 0 replies; 39+ messages in thread
From: Ulf Hansson @ 2018-07-04 12:55 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: Rafael J. Wysocki, Linux Kernel Mailing List, Lukas Wunner,
	Jonathan Corbet, Greg Kroah-Hartman, Thierry Reding,
	David Airlie, Jonathan Hunter, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Robin Murphy, linux-doc, dri-devel, linux-tegra,
	Linux ARM, Linux PM, linux-arm-msm

On 27 June 2018 at 14:50, Vivek Gautam <vivek.gautam@codeaurora.org> wrote:
> Now that we want to add another flag to autoremove the device link
> on supplier unbind, it's fair to rename the existing flag from
> DL_FLAG_AUTOREMOVE to DL_FLAG_AUTOREMOVE_CONSUMER so that we can
> add similar flag for supplier later.
> And, while we are touching device.h, fix a doc build warning.
>
> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> Cc: Lukas Wunner <lukas@wunner.de>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Jonathan Hunter <jonathanh@nvidia.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Sascha Hauer <kernel@pengutronix.de>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: linux-doc@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-tegra@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-msm@vger.kernel.org

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  Documentation/driver-api/device_link.rst |  8 ++++----
>  drivers/base/core.c                      | 15 ++++++++-------
>  drivers/gpu/drm/tegra/dc.c               |  2 +-
>  drivers/gpu/ipu-v3/ipu-pre.c             |  3 ++-
>  drivers/gpu/ipu-v3/ipu-prg.c             |  3 ++-
>  drivers/soc/imx/gpc.c                    |  2 +-
>  include/linux/device.h                   | 12 ++++++------
>  7 files changed, 24 insertions(+), 21 deletions(-)
>
> diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
> index 70e328e16aad..a005b904a264 100644
> --- a/Documentation/driver-api/device_link.rst
> +++ b/Documentation/driver-api/device_link.rst
> @@ -81,10 +81,10 @@ integration is desired.
>  Two other flags are specifically targeted at use cases where the device
>  link is added from the consumer's ``->probe`` callback:  ``DL_FLAG_RPM_ACTIVE``
>  can be specified to runtime resume the supplier upon addition of the
> -device link.  ``DL_FLAG_AUTOREMOVE`` causes the device link to be automatically
> -purged when the consumer fails to probe or later unbinds.  This obviates
> -the need to explicitly delete the link in the ``->remove`` callback or in
> -the error path of the ``->probe`` callback.
> +device link.  ``DL_FLAG_AUTOREMOVE_CONSUMER`` causes the device link to be
> +automatically purged when the consumer fails to probe or later unbinds.
> +This obviates the need to explicitly delete the link in the ``->remove``
> +callback or in the error path of the ``->probe`` callback.
>
>  Limitations
>  ===========
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index df3e1a44707a..14c1e3151e08 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -178,10 +178,10 @@ void device_pm_move_to_tail(struct device *dev)
>   * of the link.  If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be
>   * ignored.
>   *
> - * If the DL_FLAG_AUTOREMOVE is set, the link will be removed automatically
> - * when the consumer device driver unbinds from it.  The combination of both
> - * DL_FLAG_AUTOREMOVE and DL_FLAG_STATELESS set is invalid and will cause NULL
> - * to be returned.
> + * If the DL_FLAG_AUTOREMOVE_CONSUMER is set, the link will be removed
> + * automatically when the consumer device driver unbinds from it.
> + * The combination of both DL_FLAG_AUTOREMOVE_CONSUMER and DL_FLAG_STATELESS
> + * set is invalid and will cause NULL to be returned.
>   *
>   * A side effect of the link creation is re-ordering of dpm_list and the
>   * devices_kset list by moving the consumer device and all devices depending
> @@ -198,7 +198,8 @@ struct device_link *device_link_add(struct device *consumer,
>         struct device_link *link;
>
>         if (!consumer || !supplier ||
> -           ((flags & DL_FLAG_STATELESS) && (flags & DL_FLAG_AUTOREMOVE)))
> +           ((flags & DL_FLAG_STATELESS) &&
> +            (flags & DL_FLAG_AUTOREMOVE_CONSUMER)))
>                 return NULL;
>
>         device_links_write_lock();
> @@ -479,7 +480,7 @@ static void __device_links_no_driver(struct device *dev)
>                 if (link->flags & DL_FLAG_STATELESS)
>                         continue;
>
> -               if (link->flags & DL_FLAG_AUTOREMOVE)
> +               if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER)
>                         kref_put(&link->kref, __device_link_del);
>                 else if (link->status != DL_STATE_SUPPLIER_UNBIND)
>                         WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
> @@ -515,7 +516,7 @@ void device_links_driver_cleanup(struct device *dev)
>                 if (link->flags & DL_FLAG_STATELESS)
>                         continue;
>
> -               WARN_ON(link->flags & DL_FLAG_AUTOREMOVE);
> +               WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
>                 WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
>                 WRITE_ONCE(link->status, DL_STATE_DORMANT);
>         }
> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> index c3afe7b2237e..965088afcfad 100644
> --- a/drivers/gpu/drm/tegra/dc.c
> +++ b/drivers/gpu/drm/tegra/dc.c
> @@ -2312,7 +2312,7 @@ static int tegra_dc_couple(struct tegra_dc *dc)
>          * POWER_CONTROL registers during CRTC enabling.
>          */
>         if (dc->soc->coupled_pm && dc->pipe == 1) {
> -               u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE;
> +               u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER;
>                 struct device_link *link;
>                 struct device *partner;
>
> diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
> index 0f70e8847540..2f8db9d62551 100644
> --- a/drivers/gpu/ipu-v3/ipu-pre.c
> +++ b/drivers/gpu/ipu-v3/ipu-pre.c
> @@ -128,7 +128,8 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
>         list_for_each_entry(pre, &ipu_pre_list, list) {
>                 if (pre_node == pre->dev->of_node) {
>                         mutex_unlock(&ipu_pre_list_mutex);
> -                       device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE);
> +                       device_link_add(dev, pre->dev,
> +                                       DL_FLAG_AUTOREMOVE_CONSUMER);
>                         of_node_put(pre_node);
>                         return pre;
>                 }
> diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c
> index 83f9dd934a5d..38a3a9764e49 100644
> --- a/drivers/gpu/ipu-v3/ipu-prg.c
> +++ b/drivers/gpu/ipu-v3/ipu-prg.c
> @@ -100,7 +100,8 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
>         list_for_each_entry(prg, &ipu_prg_list, list) {
>                 if (prg_node == prg->dev->of_node) {
>                         mutex_unlock(&ipu_prg_list_mutex);
> -                       device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE);
> +                       device_link_add(dev, prg->dev,
> +                                       DL_FLAG_AUTOREMOVE_CONSUMER);
>                         prg->id = ipu_id;
>                         of_node_put(prg_node);
>                         return prg;
> diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
> index 32f0748fd067..aa9e65bc965e 100644
> --- a/drivers/soc/imx/gpc.c
> +++ b/drivers/soc/imx/gpc.c
> @@ -202,7 +202,7 @@ static int imx_pgc_power_domain_probe(struct platform_device *pdev)
>                         goto genpd_err;
>         }
>
> -       device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE);
> +       device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE_CONSUMER);
>
>         return 0;
>
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 055a69dbcd18..3929805cdd59 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -90,7 +90,7 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
>   * @num_vf:    Called to find out how many virtual functions a device on this
>   *             bus supports.
>   * @dma_configure:     Called to setup DMA configuration on a device on
> -                       this bus.
> + *                     this bus.
>   * @pm:                Power management operations of this bus, callback the specific
>   *             device driver's pm-ops.
>   * @iommu_ops:  IOMMU specific operations for this bus, used to attach IOMMU
> @@ -784,14 +784,14 @@ enum device_link_state {
>   * Device link flags.
>   *
>   * STATELESS: The core won't track the presence of supplier/consumer drivers.
> - * AUTOREMOVE: Remove this link automatically on consumer driver unbind.
> + * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
>   * PM_RUNTIME: If set, the runtime PM framework will use this link.
>   * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
>   */
> -#define DL_FLAG_STATELESS      BIT(0)
> -#define DL_FLAG_AUTOREMOVE     BIT(1)
> -#define DL_FLAG_PM_RUNTIME     BIT(2)
> -#define DL_FLAG_RPM_ACTIVE     BIT(3)
> +#define DL_FLAG_STATELESS              BIT(0)
> +#define DL_FLAG_AUTOREMOVE_CONSUMER    BIT(1)
> +#define DL_FLAG_PM_RUNTIME             BIT(2)
> +#define DL_FLAG_RPM_ACTIVE             BIT(3)
>
>  /**
>   * struct device_link - Device link representation.
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 1/2] device core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER
@ 2018-07-04 12:55   ` Ulf Hansson
  0 siblings, 0 replies; 39+ messages in thread
From: Ulf Hansson @ 2018-07-04 12:55 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: Rafael J. Wysocki, Linux Kernel Mailing List, Lukas Wunner,
	Jonathan Corbet, Greg Kroah-Hartman, Thierry Reding,
	David Airlie, Jonathan Hunter, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Robin Murphy, linux-doc, dri-devel, linux-tegra,
	Linux ARM, Linux PM, linux-arm-msm

On 27 June 2018 at 14:50, Vivek Gautam <vivek.gautam@codeaurora.org> wrote:
> Now that we want to add another flag to autoremove the device link
> on supplier unbind, it's fair to rename the existing flag from
> DL_FLAG_AUTOREMOVE to DL_FLAG_AUTOREMOVE_CONSUMER so that we can
> add similar flag for supplier later.
> And, while we are touching device.h, fix a doc build warning.
>
> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> Cc: Lukas Wunner <lukas@wunner.de>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Jonathan Hunter <jonathanh@nvidia.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Sascha Hauer <kernel@pengutronix.de>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: linux-doc@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-tegra@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-msm@vger.kernel.org

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  Documentation/driver-api/device_link.rst |  8 ++++----
>  drivers/base/core.c                      | 15 ++++++++-------
>  drivers/gpu/drm/tegra/dc.c               |  2 +-
>  drivers/gpu/ipu-v3/ipu-pre.c             |  3 ++-
>  drivers/gpu/ipu-v3/ipu-prg.c             |  3 ++-
>  drivers/soc/imx/gpc.c                    |  2 +-
>  include/linux/device.h                   | 12 ++++++------
>  7 files changed, 24 insertions(+), 21 deletions(-)
>
> diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
> index 70e328e16aad..a005b904a264 100644
> --- a/Documentation/driver-api/device_link.rst
> +++ b/Documentation/driver-api/device_link.rst
> @@ -81,10 +81,10 @@ integration is desired.
>  Two other flags are specifically targeted at use cases where the device
>  link is added from the consumer's ``->probe`` callback:  ``DL_FLAG_RPM_ACTIVE``
>  can be specified to runtime resume the supplier upon addition of the
> -device link.  ``DL_FLAG_AUTOREMOVE`` causes the device link to be automatically
> -purged when the consumer fails to probe or later unbinds.  This obviates
> -the need to explicitly delete the link in the ``->remove`` callback or in
> -the error path of the ``->probe`` callback.
> +device link.  ``DL_FLAG_AUTOREMOVE_CONSUMER`` causes the device link to be
> +automatically purged when the consumer fails to probe or later unbinds.
> +This obviates the need to explicitly delete the link in the ``->remove``
> +callback or in the error path of the ``->probe`` callback.
>
>  Limitations
>  ===========
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index df3e1a44707a..14c1e3151e08 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -178,10 +178,10 @@ void device_pm_move_to_tail(struct device *dev)
>   * of the link.  If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be
>   * ignored.
>   *
> - * If the DL_FLAG_AUTOREMOVE is set, the link will be removed automatically
> - * when the consumer device driver unbinds from it.  The combination of both
> - * DL_FLAG_AUTOREMOVE and DL_FLAG_STATELESS set is invalid and will cause NULL
> - * to be returned.
> + * If the DL_FLAG_AUTOREMOVE_CONSUMER is set, the link will be removed
> + * automatically when the consumer device driver unbinds from it.
> + * The combination of both DL_FLAG_AUTOREMOVE_CONSUMER and DL_FLAG_STATELESS
> + * set is invalid and will cause NULL to be returned.
>   *
>   * A side effect of the link creation is re-ordering of dpm_list and the
>   * devices_kset list by moving the consumer device and all devices depending
> @@ -198,7 +198,8 @@ struct device_link *device_link_add(struct device *consumer,
>         struct device_link *link;
>
>         if (!consumer || !supplier ||
> -           ((flags & DL_FLAG_STATELESS) && (flags & DL_FLAG_AUTOREMOVE)))
> +           ((flags & DL_FLAG_STATELESS) &&
> +            (flags & DL_FLAG_AUTOREMOVE_CONSUMER)))
>                 return NULL;
>
>         device_links_write_lock();
> @@ -479,7 +480,7 @@ static void __device_links_no_driver(struct device *dev)
>                 if (link->flags & DL_FLAG_STATELESS)
>                         continue;
>
> -               if (link->flags & DL_FLAG_AUTOREMOVE)
> +               if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER)
>                         kref_put(&link->kref, __device_link_del);
>                 else if (link->status != DL_STATE_SUPPLIER_UNBIND)
>                         WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
> @@ -515,7 +516,7 @@ void device_links_driver_cleanup(struct device *dev)
>                 if (link->flags & DL_FLAG_STATELESS)
>                         continue;
>
> -               WARN_ON(link->flags & DL_FLAG_AUTOREMOVE);
> +               WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
>                 WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
>                 WRITE_ONCE(link->status, DL_STATE_DORMANT);
>         }
> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> index c3afe7b2237e..965088afcfad 100644
> --- a/drivers/gpu/drm/tegra/dc.c
> +++ b/drivers/gpu/drm/tegra/dc.c
> @@ -2312,7 +2312,7 @@ static int tegra_dc_couple(struct tegra_dc *dc)
>          * POWER_CONTROL registers during CRTC enabling.
>          */
>         if (dc->soc->coupled_pm && dc->pipe == 1) {
> -               u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE;
> +               u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER;
>                 struct device_link *link;
>                 struct device *partner;
>
> diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
> index 0f70e8847540..2f8db9d62551 100644
> --- a/drivers/gpu/ipu-v3/ipu-pre.c
> +++ b/drivers/gpu/ipu-v3/ipu-pre.c
> @@ -128,7 +128,8 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
>         list_for_each_entry(pre, &ipu_pre_list, list) {
>                 if (pre_node == pre->dev->of_node) {
>                         mutex_unlock(&ipu_pre_list_mutex);
> -                       device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE);
> +                       device_link_add(dev, pre->dev,
> +                                       DL_FLAG_AUTOREMOVE_CONSUMER);
>                         of_node_put(pre_node);
>                         return pre;
>                 }
> diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c
> index 83f9dd934a5d..38a3a9764e49 100644
> --- a/drivers/gpu/ipu-v3/ipu-prg.c
> +++ b/drivers/gpu/ipu-v3/ipu-prg.c
> @@ -100,7 +100,8 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
>         list_for_each_entry(prg, &ipu_prg_list, list) {
>                 if (prg_node == prg->dev->of_node) {
>                         mutex_unlock(&ipu_prg_list_mutex);
> -                       device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE);
> +                       device_link_add(dev, prg->dev,
> +                                       DL_FLAG_AUTOREMOVE_CONSUMER);
>                         prg->id = ipu_id;
>                         of_node_put(prg_node);
>                         return prg;
> diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
> index 32f0748fd067..aa9e65bc965e 100644
> --- a/drivers/soc/imx/gpc.c
> +++ b/drivers/soc/imx/gpc.c
> @@ -202,7 +202,7 @@ static int imx_pgc_power_domain_probe(struct platform_device *pdev)
>                         goto genpd_err;
>         }
>
> -       device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE);
> +       device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE_CONSUMER);
>
>         return 0;
>
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 055a69dbcd18..3929805cdd59 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -90,7 +90,7 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
>   * @num_vf:    Called to find out how many virtual functions a device on this
>   *             bus supports.
>   * @dma_configure:     Called to setup DMA configuration on a device on
> -                       this bus.
> + *                     this bus.
>   * @pm:                Power management operations of this bus, callback the specific
>   *             device driver's pm-ops.
>   * @iommu_ops:  IOMMU specific operations for this bus, used to attach IOMMU
> @@ -784,14 +784,14 @@ enum device_link_state {
>   * Device link flags.
>   *
>   * STATELESS: The core won't track the presence of supplier/consumer drivers.
> - * AUTOREMOVE: Remove this link automatically on consumer driver unbind.
> + * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
>   * PM_RUNTIME: If set, the runtime PM framework will use this link.
>   * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
>   */
> -#define DL_FLAG_STATELESS      BIT(0)
> -#define DL_FLAG_AUTOREMOVE     BIT(1)
> -#define DL_FLAG_PM_RUNTIME     BIT(2)
> -#define DL_FLAG_RPM_ACTIVE     BIT(3)
> +#define DL_FLAG_STATELESS              BIT(0)
> +#define DL_FLAG_AUTOREMOVE_CONSUMER    BIT(1)
> +#define DL_FLAG_PM_RUNTIME             BIT(2)
> +#define DL_FLAG_RPM_ACTIVE             BIT(3)
>
>  /**
>   * struct device_link - Device link representation.
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
>
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 1/2] device core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER
@ 2018-07-04 12:55   ` Ulf Hansson
  0 siblings, 0 replies; 39+ messages in thread
From: Ulf Hansson @ 2018-07-04 12:55 UTC (permalink / raw)
  To: linux-arm-kernel

On 27 June 2018 at 14:50, Vivek Gautam <vivek.gautam@codeaurora.org> wrote:
> Now that we want to add another flag to autoremove the device link
> on supplier unbind, it's fair to rename the existing flag from
> DL_FLAG_AUTOREMOVE to DL_FLAG_AUTOREMOVE_CONSUMER so that we can
> add similar flag for supplier later.
> And, while we are touching device.h, fix a doc build warning.
>
> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> Cc: Lukas Wunner <lukas@wunner.de>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Jonathan Hunter <jonathanh@nvidia.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Sascha Hauer <kernel@pengutronix.de>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: linux-doc at vger.kernel.org
> Cc: dri-devel at lists.freedesktop.org
> Cc: linux-tegra at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-pm at vger.kernel.org
> Cc: linux-arm-msm at vger.kernel.org

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  Documentation/driver-api/device_link.rst |  8 ++++----
>  drivers/base/core.c                      | 15 ++++++++-------
>  drivers/gpu/drm/tegra/dc.c               |  2 +-
>  drivers/gpu/ipu-v3/ipu-pre.c             |  3 ++-
>  drivers/gpu/ipu-v3/ipu-prg.c             |  3 ++-
>  drivers/soc/imx/gpc.c                    |  2 +-
>  include/linux/device.h                   | 12 ++++++------
>  7 files changed, 24 insertions(+), 21 deletions(-)
>
> diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
> index 70e328e16aad..a005b904a264 100644
> --- a/Documentation/driver-api/device_link.rst
> +++ b/Documentation/driver-api/device_link.rst
> @@ -81,10 +81,10 @@ integration is desired.
>  Two other flags are specifically targeted at use cases where the device
>  link is added from the consumer's ``->probe`` callback:  ``DL_FLAG_RPM_ACTIVE``
>  can be specified to runtime resume the supplier upon addition of the
> -device link.  ``DL_FLAG_AUTOREMOVE`` causes the device link to be automatically
> -purged when the consumer fails to probe or later unbinds.  This obviates
> -the need to explicitly delete the link in the ``->remove`` callback or in
> -the error path of the ``->probe`` callback.
> +device link.  ``DL_FLAG_AUTOREMOVE_CONSUMER`` causes the device link to be
> +automatically purged when the consumer fails to probe or later unbinds.
> +This obviates the need to explicitly delete the link in the ``->remove``
> +callback or in the error path of the ``->probe`` callback.
>
>  Limitations
>  ===========
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index df3e1a44707a..14c1e3151e08 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -178,10 +178,10 @@ void device_pm_move_to_tail(struct device *dev)
>   * of the link.  If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be
>   * ignored.
>   *
> - * If the DL_FLAG_AUTOREMOVE is set, the link will be removed automatically
> - * when the consumer device driver unbinds from it.  The combination of both
> - * DL_FLAG_AUTOREMOVE and DL_FLAG_STATELESS set is invalid and will cause NULL
> - * to be returned.
> + * If the DL_FLAG_AUTOREMOVE_CONSUMER is set, the link will be removed
> + * automatically when the consumer device driver unbinds from it.
> + * The combination of both DL_FLAG_AUTOREMOVE_CONSUMER and DL_FLAG_STATELESS
> + * set is invalid and will cause NULL to be returned.
>   *
>   * A side effect of the link creation is re-ordering of dpm_list and the
>   * devices_kset list by moving the consumer device and all devices depending
> @@ -198,7 +198,8 @@ struct device_link *device_link_add(struct device *consumer,
>         struct device_link *link;
>
>         if (!consumer || !supplier ||
> -           ((flags & DL_FLAG_STATELESS) && (flags & DL_FLAG_AUTOREMOVE)))
> +           ((flags & DL_FLAG_STATELESS) &&
> +            (flags & DL_FLAG_AUTOREMOVE_CONSUMER)))
>                 return NULL;
>
>         device_links_write_lock();
> @@ -479,7 +480,7 @@ static void __device_links_no_driver(struct device *dev)
>                 if (link->flags & DL_FLAG_STATELESS)
>                         continue;
>
> -               if (link->flags & DL_FLAG_AUTOREMOVE)
> +               if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER)
>                         kref_put(&link->kref, __device_link_del);
>                 else if (link->status != DL_STATE_SUPPLIER_UNBIND)
>                         WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
> @@ -515,7 +516,7 @@ void device_links_driver_cleanup(struct device *dev)
>                 if (link->flags & DL_FLAG_STATELESS)
>                         continue;
>
> -               WARN_ON(link->flags & DL_FLAG_AUTOREMOVE);
> +               WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
>                 WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
>                 WRITE_ONCE(link->status, DL_STATE_DORMANT);
>         }
> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> index c3afe7b2237e..965088afcfad 100644
> --- a/drivers/gpu/drm/tegra/dc.c
> +++ b/drivers/gpu/drm/tegra/dc.c
> @@ -2312,7 +2312,7 @@ static int tegra_dc_couple(struct tegra_dc *dc)
>          * POWER_CONTROL registers during CRTC enabling.
>          */
>         if (dc->soc->coupled_pm && dc->pipe == 1) {
> -               u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE;
> +               u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER;
>                 struct device_link *link;
>                 struct device *partner;
>
> diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
> index 0f70e8847540..2f8db9d62551 100644
> --- a/drivers/gpu/ipu-v3/ipu-pre.c
> +++ b/drivers/gpu/ipu-v3/ipu-pre.c
> @@ -128,7 +128,8 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
>         list_for_each_entry(pre, &ipu_pre_list, list) {
>                 if (pre_node == pre->dev->of_node) {
>                         mutex_unlock(&ipu_pre_list_mutex);
> -                       device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE);
> +                       device_link_add(dev, pre->dev,
> +                                       DL_FLAG_AUTOREMOVE_CONSUMER);
>                         of_node_put(pre_node);
>                         return pre;
>                 }
> diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c
> index 83f9dd934a5d..38a3a9764e49 100644
> --- a/drivers/gpu/ipu-v3/ipu-prg.c
> +++ b/drivers/gpu/ipu-v3/ipu-prg.c
> @@ -100,7 +100,8 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
>         list_for_each_entry(prg, &ipu_prg_list, list) {
>                 if (prg_node == prg->dev->of_node) {
>                         mutex_unlock(&ipu_prg_list_mutex);
> -                       device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE);
> +                       device_link_add(dev, prg->dev,
> +                                       DL_FLAG_AUTOREMOVE_CONSUMER);
>                         prg->id = ipu_id;
>                         of_node_put(prg_node);
>                         return prg;
> diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
> index 32f0748fd067..aa9e65bc965e 100644
> --- a/drivers/soc/imx/gpc.c
> +++ b/drivers/soc/imx/gpc.c
> @@ -202,7 +202,7 @@ static int imx_pgc_power_domain_probe(struct platform_device *pdev)
>                         goto genpd_err;
>         }
>
> -       device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE);
> +       device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE_CONSUMER);
>
>         return 0;
>
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 055a69dbcd18..3929805cdd59 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -90,7 +90,7 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
>   * @num_vf:    Called to find out how many virtual functions a device on this
>   *             bus supports.
>   * @dma_configure:     Called to setup DMA configuration on a device on
> -                       this bus.
> + *                     this bus.
>   * @pm:                Power management operations of this bus, callback the specific
>   *             device driver's pm-ops.
>   * @iommu_ops:  IOMMU specific operations for this bus, used to attach IOMMU
> @@ -784,14 +784,14 @@ enum device_link_state {
>   * Device link flags.
>   *
>   * STATELESS: The core won't track the presence of supplier/consumer drivers.
> - * AUTOREMOVE: Remove this link automatically on consumer driver unbind.
> + * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
>   * PM_RUNTIME: If set, the runtime PM framework will use this link.
>   * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
>   */
> -#define DL_FLAG_STATELESS      BIT(0)
> -#define DL_FLAG_AUTOREMOVE     BIT(1)
> -#define DL_FLAG_PM_RUNTIME     BIT(2)
> -#define DL_FLAG_RPM_ACTIVE     BIT(3)
> +#define DL_FLAG_STATELESS              BIT(0)
> +#define DL_FLAG_AUTOREMOVE_CONSUMER    BIT(1)
> +#define DL_FLAG_PM_RUNTIME             BIT(2)
> +#define DL_FLAG_RPM_ACTIVE             BIT(3)
>
>  /**
>   * struct device_link - Device link representation.
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
  2018-06-27 12:50   ` Vivek Gautam
  (?)
@ 2018-07-04 12:55     ` Ulf Hansson
  -1 siblings, 0 replies; 39+ messages in thread
From: Ulf Hansson @ 2018-07-04 12:55 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: Rafael J. Wysocki, Linux Kernel Mailing List, Jonathan Corbet,
	Greg Kroah-Hartman, Robin Murphy, linux-doc, Linux ARM, Linux PM,
	linux-arm-msm

On 27 June 2018 at 14:50, Vivek Gautam <vivek.gautam@codeaurora.org> wrote:
> Add a flag to autoremove the device links on supplier driver
> unbind. This obviates the need to explicitly delete the link
> in the remove path.
> We remove these links only when the supplier's link to its
> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>
> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> Suggested-by: Lukas Wunner <lukas@wunner.de>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: linux-doc@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-msm@vger.kernel.org

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  Documentation/driver-api/device_link.rst |  4 ++++
>  drivers/base/core.c                      | 10 ++++++++++
>  include/linux/device.h                   |  2 ++
>  3 files changed, 16 insertions(+)
>
> diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
> index a005b904a264..d6763272e747 100644
> --- a/Documentation/driver-api/device_link.rst
> +++ b/Documentation/driver-api/device_link.rst
> @@ -86,6 +86,10 @@ automatically purged when the consumer fails to probe or later unbinds.
>  This obviates the need to explicitly delete the link in the ``->remove``
>  callback or in the error path of the ``->probe`` callback.
>
> +Similarly, when the device link is added from supplier's ``->probe`` callback,
> +``DL_FLAG_AUTOREMOVE_SUPPLIER`` causes the device link to be automatically
> +purged when the supplier fails to probe or later unbinds.
> +
>  Limitations
>  ===========
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 14c1e3151e08..e721218bf352 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -518,6 +518,16 @@ void device_links_driver_cleanup(struct device *dev)
>
>                 WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
>                 WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
> +
> +               /*
> +                * autoremove the links between this @dev and its consumer
> +                * devices that are not active, i.e. where the link state
> +                * has moved to DL_STATE_SUPPLIER_UNBIND.
> +                */
> +               if (link->status == DL_STATE_SUPPLIER_UNBIND &&
> +                   link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER)
> +                       kref_put(&link->kref, __device_link_del);
> +
>                 WRITE_ONCE(link->status, DL_STATE_DORMANT);
>         }
>
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 3929805cdd59..e80920452b49 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -787,11 +787,13 @@ enum device_link_state {
>   * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
>   * PM_RUNTIME: If set, the runtime PM framework will use this link.
>   * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
> + * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
>   */
>  #define DL_FLAG_STATELESS              BIT(0)
>  #define DL_FLAG_AUTOREMOVE_CONSUMER    BIT(1)
>  #define DL_FLAG_PM_RUNTIME             BIT(2)
>  #define DL_FLAG_RPM_ACTIVE             BIT(3)
> +#define DL_FLAG_AUTOREMOVE_SUPPLIER    BIT(4)
>
>  /**
>   * struct device_link - Device link representation.
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04 12:55     ` Ulf Hansson
  0 siblings, 0 replies; 39+ messages in thread
From: Ulf Hansson @ 2018-07-04 12:55 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: Rafael J. Wysocki, Linux Kernel Mailing List, Jonathan Corbet,
	Greg Kroah-Hartman, Robin Murphy, linux-doc, Linux ARM, Linux PM,
	linux-arm-msm

On 27 June 2018 at 14:50, Vivek Gautam <vivek.gautam@codeaurora.org> wrote:
> Add a flag to autoremove the device links on supplier driver
> unbind. This obviates the need to explicitly delete the link
> in the remove path.
> We remove these links only when the supplier's link to its
> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>
> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> Suggested-by: Lukas Wunner <lukas@wunner.de>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: linux-doc@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-pm@vger.kernel.org
> Cc: linux-arm-msm@vger.kernel.org

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  Documentation/driver-api/device_link.rst |  4 ++++
>  drivers/base/core.c                      | 10 ++++++++++
>  include/linux/device.h                   |  2 ++
>  3 files changed, 16 insertions(+)
>
> diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
> index a005b904a264..d6763272e747 100644
> --- a/Documentation/driver-api/device_link.rst
> +++ b/Documentation/driver-api/device_link.rst
> @@ -86,6 +86,10 @@ automatically purged when the consumer fails to probe or later unbinds.
>  This obviates the need to explicitly delete the link in the ``->remove``
>  callback or in the error path of the ``->probe`` callback.
>
> +Similarly, when the device link is added from supplier's ``->probe`` callback,
> +``DL_FLAG_AUTOREMOVE_SUPPLIER`` causes the device link to be automatically
> +purged when the supplier fails to probe or later unbinds.
> +
>  Limitations
>  ===========
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 14c1e3151e08..e721218bf352 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -518,6 +518,16 @@ void device_links_driver_cleanup(struct device *dev)
>
>                 WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
>                 WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
> +
> +               /*
> +                * autoremove the links between this @dev and its consumer
> +                * devices that are not active, i.e. where the link state
> +                * has moved to DL_STATE_SUPPLIER_UNBIND.
> +                */
> +               if (link->status == DL_STATE_SUPPLIER_UNBIND &&
> +                   link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER)
> +                       kref_put(&link->kref, __device_link_del);
> +
>                 WRITE_ONCE(link->status, DL_STATE_DORMANT);
>         }
>
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 3929805cdd59..e80920452b49 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -787,11 +787,13 @@ enum device_link_state {
>   * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
>   * PM_RUNTIME: If set, the runtime PM framework will use this link.
>   * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
> + * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
>   */
>  #define DL_FLAG_STATELESS              BIT(0)
>  #define DL_FLAG_AUTOREMOVE_CONSUMER    BIT(1)
>  #define DL_FLAG_PM_RUNTIME             BIT(2)
>  #define DL_FLAG_RPM_ACTIVE             BIT(3)
> +#define DL_FLAG_AUTOREMOVE_SUPPLIER    BIT(4)
>
>  /**
>   * struct device_link - Device link representation.
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
>
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04 12:55     ` Ulf Hansson
  0 siblings, 0 replies; 39+ messages in thread
From: Ulf Hansson @ 2018-07-04 12:55 UTC (permalink / raw)
  To: linux-arm-kernel

On 27 June 2018 at 14:50, Vivek Gautam <vivek.gautam@codeaurora.org> wrote:
> Add a flag to autoremove the device links on supplier driver
> unbind. This obviates the need to explicitly delete the link
> in the remove path.
> We remove these links only when the supplier's link to its
> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>
> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> Suggested-by: Lukas Wunner <lukas@wunner.de>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: linux-doc at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-pm at vger.kernel.org
> Cc: linux-arm-msm at vger.kernel.org

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  Documentation/driver-api/device_link.rst |  4 ++++
>  drivers/base/core.c                      | 10 ++++++++++
>  include/linux/device.h                   |  2 ++
>  3 files changed, 16 insertions(+)
>
> diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
> index a005b904a264..d6763272e747 100644
> --- a/Documentation/driver-api/device_link.rst
> +++ b/Documentation/driver-api/device_link.rst
> @@ -86,6 +86,10 @@ automatically purged when the consumer fails to probe or later unbinds.
>  This obviates the need to explicitly delete the link in the ``->remove``
>  callback or in the error path of the ``->probe`` callback.
>
> +Similarly, when the device link is added from supplier's ``->probe`` callback,
> +``DL_FLAG_AUTOREMOVE_SUPPLIER`` causes the device link to be automatically
> +purged when the supplier fails to probe or later unbinds.
> +
>  Limitations
>  ===========
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 14c1e3151e08..e721218bf352 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -518,6 +518,16 @@ void device_links_driver_cleanup(struct device *dev)
>
>                 WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
>                 WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
> +
> +               /*
> +                * autoremove the links between this @dev and its consumer
> +                * devices that are not active, i.e. where the link state
> +                * has moved to DL_STATE_SUPPLIER_UNBIND.
> +                */
> +               if (link->status == DL_STATE_SUPPLIER_UNBIND &&
> +                   link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER)
> +                       kref_put(&link->kref, __device_link_del);
> +
>                 WRITE_ONCE(link->status, DL_STATE_DORMANT);
>         }
>
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 3929805cdd59..e80920452b49 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -787,11 +787,13 @@ enum device_link_state {
>   * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
>   * PM_RUNTIME: If set, the runtime PM framework will use this link.
>   * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
> + * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
>   */
>  #define DL_FLAG_STATELESS              BIT(0)
>  #define DL_FLAG_AUTOREMOVE_CONSUMER    BIT(1)
>  #define DL_FLAG_PM_RUNTIME             BIT(2)
>  #define DL_FLAG_RPM_ACTIVE             BIT(3)
> +#define DL_FLAG_AUTOREMOVE_SUPPLIER    BIT(4)
>
>  /**
>   * struct device_link - Device link representation.
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 1/2] device core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER
  2018-07-04 12:55   ` Ulf Hansson
  (?)
@ 2018-07-04 17:37     ` Vivek Gautam
  -1 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-04 17:37 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J. Wysocki, Linux Kernel Mailing List, Lukas Wunner,
	Jonathan Corbet, Greg Kroah-Hartman, Thierry Reding,
	David Airlie, Jonathan Hunter, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Robin Murphy, linux-doc, dri-devel, linux-tegra,
	Linux ARM, Linux PM, linux-arm-msm

On Wed, Jul 4, 2018 at 6:25 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 27 June 2018 at 14:50, Vivek Gautam <vivek.gautam@codeaurora.org> wrote:
>> Now that we want to add another flag to autoremove the device link
>> on supplier unbind, it's fair to rename the existing flag from
>> DL_FLAG_AUTOREMOVE to DL_FLAG_AUTOREMOVE_CONSUMER so that we can
>> add similar flag for supplier later.
>> And, while we are touching device.h, fix a doc build warning.
>>
>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>> Cc: Lukas Wunner <lukas@wunner.de>
>> Cc: Jonathan Corbet <corbet@lwn.net>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Thierry Reding <thierry.reding@gmail.com>
>> Cc: David Airlie <airlied@linux.ie>
>> Cc: Jonathan Hunter <jonathanh@nvidia.com>
>> Cc: Philipp Zabel <p.zabel@pengutronix.de>
>> Cc: Shawn Guo <shawnguo@kernel.org>
>> Cc: Sascha Hauer <kernel@pengutronix.de>
>> Cc: Robin Murphy <robin.murphy@arm.com>
>> Cc: linux-doc@vger.kernel.org
>> Cc: dri-devel@lists.freedesktop.org
>> Cc: linux-tegra@vger.kernel.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-pm@vger.kernel.org
>> Cc: linux-arm-msm@vger.kernel.org
>
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Thank you Ulf for reviewing the series.

Best regards
Vivek

>
> Kind regards
> Uffe
>
>> ---
>>  Documentation/driver-api/device_link.rst |  8 ++++----
>>  drivers/base/core.c                      | 15 ++++++++-------
>>  drivers/gpu/drm/tegra/dc.c               |  2 +-
>>  drivers/gpu/ipu-v3/ipu-pre.c             |  3 ++-
>>  drivers/gpu/ipu-v3/ipu-prg.c             |  3 ++-
>>  drivers/soc/imx/gpc.c                    |  2 +-
>>  include/linux/device.h                   | 12 ++++++------
>>  7 files changed, 24 insertions(+), 21 deletions(-)
>>
>> diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
>> index 70e328e16aad..a005b904a264 100644
>> --- a/Documentation/driver-api/device_link.rst
>> +++ b/Documentation/driver-api/device_link.rst
>> @@ -81,10 +81,10 @@ integration is desired.
>>  Two other flags are specifically targeted at use cases where the device
>>  link is added from the consumer's ``->probe`` callback:  ``DL_FLAG_RPM_ACTIVE``
>>  can be specified to runtime resume the supplier upon addition of the
>> -device link.  ``DL_FLAG_AUTOREMOVE`` causes the device link to be automatically
>> -purged when the consumer fails to probe or later unbinds.  This obviates
>> -the need to explicitly delete the link in the ``->remove`` callback or in
>> -the error path of the ``->probe`` callback.
>> +device link.  ``DL_FLAG_AUTOREMOVE_CONSUMER`` causes the device link to be
>> +automatically purged when the consumer fails to probe or later unbinds.
>> +This obviates the need to explicitly delete the link in the ``->remove``
>> +callback or in the error path of the ``->probe`` callback.
>>
>>  Limitations
>>  ===========
>> diff --git a/drivers/base/core.c b/drivers/base/core.c
>> index df3e1a44707a..14c1e3151e08 100644
>> --- a/drivers/base/core.c
>> +++ b/drivers/base/core.c
>> @@ -178,10 +178,10 @@ void device_pm_move_to_tail(struct device *dev)
>>   * of the link.  If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be
>>   * ignored.
>>   *
>> - * If the DL_FLAG_AUTOREMOVE is set, the link will be removed automatically
>> - * when the consumer device driver unbinds from it.  The combination of both
>> - * DL_FLAG_AUTOREMOVE and DL_FLAG_STATELESS set is invalid and will cause NULL
>> - * to be returned.
>> + * If the DL_FLAG_AUTOREMOVE_CONSUMER is set, the link will be removed
>> + * automatically when the consumer device driver unbinds from it.
>> + * The combination of both DL_FLAG_AUTOREMOVE_CONSUMER and DL_FLAG_STATELESS
>> + * set is invalid and will cause NULL to be returned.
>>   *
>>   * A side effect of the link creation is re-ordering of dpm_list and the
>>   * devices_kset list by moving the consumer device and all devices depending
>> @@ -198,7 +198,8 @@ struct device_link *device_link_add(struct device *consumer,
>>         struct device_link *link;
>>
>>         if (!consumer || !supplier ||
>> -           ((flags & DL_FLAG_STATELESS) && (flags & DL_FLAG_AUTOREMOVE)))
>> +           ((flags & DL_FLAG_STATELESS) &&
>> +            (flags & DL_FLAG_AUTOREMOVE_CONSUMER)))
>>                 return NULL;
>>
>>         device_links_write_lock();
>> @@ -479,7 +480,7 @@ static void __device_links_no_driver(struct device *dev)
>>                 if (link->flags & DL_FLAG_STATELESS)
>>                         continue;
>>
>> -               if (link->flags & DL_FLAG_AUTOREMOVE)
>> +               if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER)
>>                         kref_put(&link->kref, __device_link_del);
>>                 else if (link->status != DL_STATE_SUPPLIER_UNBIND)
>>                         WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
>> @@ -515,7 +516,7 @@ void device_links_driver_cleanup(struct device *dev)
>>                 if (link->flags & DL_FLAG_STATELESS)
>>                         continue;
>>
>> -               WARN_ON(link->flags & DL_FLAG_AUTOREMOVE);
>> +               WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
>>                 WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
>>                 WRITE_ONCE(link->status, DL_STATE_DORMANT);
>>         }
>> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
>> index c3afe7b2237e..965088afcfad 100644
>> --- a/drivers/gpu/drm/tegra/dc.c
>> +++ b/drivers/gpu/drm/tegra/dc.c
>> @@ -2312,7 +2312,7 @@ static int tegra_dc_couple(struct tegra_dc *dc)
>>          * POWER_CONTROL registers during CRTC enabling.
>>          */
>>         if (dc->soc->coupled_pm && dc->pipe == 1) {
>> -               u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE;
>> +               u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER;
>>                 struct device_link *link;
>>                 struct device *partner;
>>
>> diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
>> index 0f70e8847540..2f8db9d62551 100644
>> --- a/drivers/gpu/ipu-v3/ipu-pre.c
>> +++ b/drivers/gpu/ipu-v3/ipu-pre.c
>> @@ -128,7 +128,8 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
>>         list_for_each_entry(pre, &ipu_pre_list, list) {
>>                 if (pre_node == pre->dev->of_node) {
>>                         mutex_unlock(&ipu_pre_list_mutex);
>> -                       device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE);
>> +                       device_link_add(dev, pre->dev,
>> +                                       DL_FLAG_AUTOREMOVE_CONSUMER);
>>                         of_node_put(pre_node);
>>                         return pre;
>>                 }
>> diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c
>> index 83f9dd934a5d..38a3a9764e49 100644
>> --- a/drivers/gpu/ipu-v3/ipu-prg.c
>> +++ b/drivers/gpu/ipu-v3/ipu-prg.c
>> @@ -100,7 +100,8 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
>>         list_for_each_entry(prg, &ipu_prg_list, list) {
>>                 if (prg_node == prg->dev->of_node) {
>>                         mutex_unlock(&ipu_prg_list_mutex);
>> -                       device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE);
>> +                       device_link_add(dev, prg->dev,
>> +                                       DL_FLAG_AUTOREMOVE_CONSUMER);
>>                         prg->id = ipu_id;
>>                         of_node_put(prg_node);
>>                         return prg;
>> diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
>> index 32f0748fd067..aa9e65bc965e 100644
>> --- a/drivers/soc/imx/gpc.c
>> +++ b/drivers/soc/imx/gpc.c
>> @@ -202,7 +202,7 @@ static int imx_pgc_power_domain_probe(struct platform_device *pdev)
>>                         goto genpd_err;
>>         }
>>
>> -       device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE);
>> +       device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE_CONSUMER);
>>
>>         return 0;
>>
>> diff --git a/include/linux/device.h b/include/linux/device.h
>> index 055a69dbcd18..3929805cdd59 100644
>> --- a/include/linux/device.h
>> +++ b/include/linux/device.h
>> @@ -90,7 +90,7 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
>>   * @num_vf:    Called to find out how many virtual functions a device on this
>>   *             bus supports.
>>   * @dma_configure:     Called to setup DMA configuration on a device on
>> -                       this bus.
>> + *                     this bus.
>>   * @pm:                Power management operations of this bus, callback the specific
>>   *             device driver's pm-ops.
>>   * @iommu_ops:  IOMMU specific operations for this bus, used to attach IOMMU
>> @@ -784,14 +784,14 @@ enum device_link_state {
>>   * Device link flags.
>>   *
>>   * STATELESS: The core won't track the presence of supplier/consumer drivers.
>> - * AUTOREMOVE: Remove this link automatically on consumer driver unbind.
>> + * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
>>   * PM_RUNTIME: If set, the runtime PM framework will use this link.
>>   * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
>>   */
>> -#define DL_FLAG_STATELESS      BIT(0)
>> -#define DL_FLAG_AUTOREMOVE     BIT(1)
>> -#define DL_FLAG_PM_RUNTIME     BIT(2)
>> -#define DL_FLAG_RPM_ACTIVE     BIT(3)
>> +#define DL_FLAG_STATELESS              BIT(0)
>> +#define DL_FLAG_AUTOREMOVE_CONSUMER    BIT(1)
>> +#define DL_FLAG_PM_RUNTIME             BIT(2)
>> +#define DL_FLAG_RPM_ACTIVE             BIT(3)
>>
>>  /**
>>   * struct device_link - Device link representation.
>> --
>> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
>> of Code Aurora Forum, hosted by The Linux Foundation
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 1/2] device core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER
@ 2018-07-04 17:37     ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-04 17:37 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J. Wysocki, Linux Kernel Mailing List, Lukas Wunner,
	Jonathan Corbet, Greg Kroah-Hartman, Thierry Reding,
	David Airlie, Jonathan Hunter, Philipp Zabel, Shawn Guo,
	Sascha Hauer, Robin Murphy, linux-doc, dri-devel, linux-tegra,
	Linux ARM, Linux PM, linux-arm-msm

On Wed, Jul 4, 2018 at 6:25 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 27 June 2018 at 14:50, Vivek Gautam <vivek.gautam@codeaurora.org> wrote:
>> Now that we want to add another flag to autoremove the device link
>> on supplier unbind, it's fair to rename the existing flag from
>> DL_FLAG_AUTOREMOVE to DL_FLAG_AUTOREMOVE_CONSUMER so that we can
>> add similar flag for supplier later.
>> And, while we are touching device.h, fix a doc build warning.
>>
>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>> Cc: Lukas Wunner <lukas@wunner.de>
>> Cc: Jonathan Corbet <corbet@lwn.net>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Thierry Reding <thierry.reding@gmail.com>
>> Cc: David Airlie <airlied@linux.ie>
>> Cc: Jonathan Hunter <jonathanh@nvidia.com>
>> Cc: Philipp Zabel <p.zabel@pengutronix.de>
>> Cc: Shawn Guo <shawnguo@kernel.org>
>> Cc: Sascha Hauer <kernel@pengutronix.de>
>> Cc: Robin Murphy <robin.murphy@arm.com>
>> Cc: linux-doc@vger.kernel.org
>> Cc: dri-devel@lists.freedesktop.org
>> Cc: linux-tegra@vger.kernel.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-pm@vger.kernel.org
>> Cc: linux-arm-msm@vger.kernel.org
>
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Thank you Ulf for reviewing the series.

Best regards
Vivek

>
> Kind regards
> Uffe
>
>> ---
>>  Documentation/driver-api/device_link.rst |  8 ++++----
>>  drivers/base/core.c                      | 15 ++++++++-------
>>  drivers/gpu/drm/tegra/dc.c               |  2 +-
>>  drivers/gpu/ipu-v3/ipu-pre.c             |  3 ++-
>>  drivers/gpu/ipu-v3/ipu-prg.c             |  3 ++-
>>  drivers/soc/imx/gpc.c                    |  2 +-
>>  include/linux/device.h                   | 12 ++++++------
>>  7 files changed, 24 insertions(+), 21 deletions(-)
>>
>> diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
>> index 70e328e16aad..a005b904a264 100644
>> --- a/Documentation/driver-api/device_link.rst
>> +++ b/Documentation/driver-api/device_link.rst
>> @@ -81,10 +81,10 @@ integration is desired.
>>  Two other flags are specifically targeted at use cases where the device
>>  link is added from the consumer's ``->probe`` callback:  ``DL_FLAG_RPM_ACTIVE``
>>  can be specified to runtime resume the supplier upon addition of the
>> -device link.  ``DL_FLAG_AUTOREMOVE`` causes the device link to be automatically
>> -purged when the consumer fails to probe or later unbinds.  This obviates
>> -the need to explicitly delete the link in the ``->remove`` callback or in
>> -the error path of the ``->probe`` callback.
>> +device link.  ``DL_FLAG_AUTOREMOVE_CONSUMER`` causes the device link to be
>> +automatically purged when the consumer fails to probe or later unbinds.
>> +This obviates the need to explicitly delete the link in the ``->remove``
>> +callback or in the error path of the ``->probe`` callback.
>>
>>  Limitations
>>  ===========
>> diff --git a/drivers/base/core.c b/drivers/base/core.c
>> index df3e1a44707a..14c1e3151e08 100644
>> --- a/drivers/base/core.c
>> +++ b/drivers/base/core.c
>> @@ -178,10 +178,10 @@ void device_pm_move_to_tail(struct device *dev)
>>   * of the link.  If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be
>>   * ignored.
>>   *
>> - * If the DL_FLAG_AUTOREMOVE is set, the link will be removed automatically
>> - * when the consumer device driver unbinds from it.  The combination of both
>> - * DL_FLAG_AUTOREMOVE and DL_FLAG_STATELESS set is invalid and will cause NULL
>> - * to be returned.
>> + * If the DL_FLAG_AUTOREMOVE_CONSUMER is set, the link will be removed
>> + * automatically when the consumer device driver unbinds from it.
>> + * The combination of both DL_FLAG_AUTOREMOVE_CONSUMER and DL_FLAG_STATELESS
>> + * set is invalid and will cause NULL to be returned.
>>   *
>>   * A side effect of the link creation is re-ordering of dpm_list and the
>>   * devices_kset list by moving the consumer device and all devices depending
>> @@ -198,7 +198,8 @@ struct device_link *device_link_add(struct device *consumer,
>>         struct device_link *link;
>>
>>         if (!consumer || !supplier ||
>> -           ((flags & DL_FLAG_STATELESS) && (flags & DL_FLAG_AUTOREMOVE)))
>> +           ((flags & DL_FLAG_STATELESS) &&
>> +            (flags & DL_FLAG_AUTOREMOVE_CONSUMER)))
>>                 return NULL;
>>
>>         device_links_write_lock();
>> @@ -479,7 +480,7 @@ static void __device_links_no_driver(struct device *dev)
>>                 if (link->flags & DL_FLAG_STATELESS)
>>                         continue;
>>
>> -               if (link->flags & DL_FLAG_AUTOREMOVE)
>> +               if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER)
>>                         kref_put(&link->kref, __device_link_del);
>>                 else if (link->status != DL_STATE_SUPPLIER_UNBIND)
>>                         WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
>> @@ -515,7 +516,7 @@ void device_links_driver_cleanup(struct device *dev)
>>                 if (link->flags & DL_FLAG_STATELESS)
>>                         continue;
>>
>> -               WARN_ON(link->flags & DL_FLAG_AUTOREMOVE);
>> +               WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
>>                 WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
>>                 WRITE_ONCE(link->status, DL_STATE_DORMANT);
>>         }
>> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
>> index c3afe7b2237e..965088afcfad 100644
>> --- a/drivers/gpu/drm/tegra/dc.c
>> +++ b/drivers/gpu/drm/tegra/dc.c
>> @@ -2312,7 +2312,7 @@ static int tegra_dc_couple(struct tegra_dc *dc)
>>          * POWER_CONTROL registers during CRTC enabling.
>>          */
>>         if (dc->soc->coupled_pm && dc->pipe == 1) {
>> -               u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE;
>> +               u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER;
>>                 struct device_link *link;
>>                 struct device *partner;
>>
>> diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
>> index 0f70e8847540..2f8db9d62551 100644
>> --- a/drivers/gpu/ipu-v3/ipu-pre.c
>> +++ b/drivers/gpu/ipu-v3/ipu-pre.c
>> @@ -128,7 +128,8 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
>>         list_for_each_entry(pre, &ipu_pre_list, list) {
>>                 if (pre_node == pre->dev->of_node) {
>>                         mutex_unlock(&ipu_pre_list_mutex);
>> -                       device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE);
>> +                       device_link_add(dev, pre->dev,
>> +                                       DL_FLAG_AUTOREMOVE_CONSUMER);
>>                         of_node_put(pre_node);
>>                         return pre;
>>                 }
>> diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c
>> index 83f9dd934a5d..38a3a9764e49 100644
>> --- a/drivers/gpu/ipu-v3/ipu-prg.c
>> +++ b/drivers/gpu/ipu-v3/ipu-prg.c
>> @@ -100,7 +100,8 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
>>         list_for_each_entry(prg, &ipu_prg_list, list) {
>>                 if (prg_node == prg->dev->of_node) {
>>                         mutex_unlock(&ipu_prg_list_mutex);
>> -                       device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE);
>> +                       device_link_add(dev, prg->dev,
>> +                                       DL_FLAG_AUTOREMOVE_CONSUMER);
>>                         prg->id = ipu_id;
>>                         of_node_put(prg_node);
>>                         return prg;
>> diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
>> index 32f0748fd067..aa9e65bc965e 100644
>> --- a/drivers/soc/imx/gpc.c
>> +++ b/drivers/soc/imx/gpc.c
>> @@ -202,7 +202,7 @@ static int imx_pgc_power_domain_probe(struct platform_device *pdev)
>>                         goto genpd_err;
>>         }
>>
>> -       device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE);
>> +       device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE_CONSUMER);
>>
>>         return 0;
>>
>> diff --git a/include/linux/device.h b/include/linux/device.h
>> index 055a69dbcd18..3929805cdd59 100644
>> --- a/include/linux/device.h
>> +++ b/include/linux/device.h
>> @@ -90,7 +90,7 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
>>   * @num_vf:    Called to find out how many virtual functions a device on this
>>   *             bus supports.
>>   * @dma_configure:     Called to setup DMA configuration on a device on
>> -                       this bus.
>> + *                     this bus.
>>   * @pm:                Power management operations of this bus, callback the specific
>>   *             device driver's pm-ops.
>>   * @iommu_ops:  IOMMU specific operations for this bus, used to attach IOMMU
>> @@ -784,14 +784,14 @@ enum device_link_state {
>>   * Device link flags.
>>   *
>>   * STATELESS: The core won't track the presence of supplier/consumer drivers.
>> - * AUTOREMOVE: Remove this link automatically on consumer driver unbind.
>> + * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
>>   * PM_RUNTIME: If set, the runtime PM framework will use this link.
>>   * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
>>   */
>> -#define DL_FLAG_STATELESS      BIT(0)
>> -#define DL_FLAG_AUTOREMOVE     BIT(1)
>> -#define DL_FLAG_PM_RUNTIME     BIT(2)
>> -#define DL_FLAG_RPM_ACTIVE     BIT(3)
>> +#define DL_FLAG_STATELESS              BIT(0)
>> +#define DL_FLAG_AUTOREMOVE_CONSUMER    BIT(1)
>> +#define DL_FLAG_PM_RUNTIME             BIT(2)
>> +#define DL_FLAG_RPM_ACTIVE             BIT(3)
>>
>>  /**
>>   * struct device_link - Device link representation.
>> --
>> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
>> of Code Aurora Forum, hosted by The Linux Foundation
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 1/2] device core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER
@ 2018-07-04 17:37     ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-04 17:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 4, 2018 at 6:25 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 27 June 2018 at 14:50, Vivek Gautam <vivek.gautam@codeaurora.org> wrote:
>> Now that we want to add another flag to autoremove the device link
>> on supplier unbind, it's fair to rename the existing flag from
>> DL_FLAG_AUTOREMOVE to DL_FLAG_AUTOREMOVE_CONSUMER so that we can
>> add similar flag for supplier later.
>> And, while we are touching device.h, fix a doc build warning.
>>
>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>> Cc: Lukas Wunner <lukas@wunner.de>
>> Cc: Jonathan Corbet <corbet@lwn.net>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Thierry Reding <thierry.reding@gmail.com>
>> Cc: David Airlie <airlied@linux.ie>
>> Cc: Jonathan Hunter <jonathanh@nvidia.com>
>> Cc: Philipp Zabel <p.zabel@pengutronix.de>
>> Cc: Shawn Guo <shawnguo@kernel.org>
>> Cc: Sascha Hauer <kernel@pengutronix.de>
>> Cc: Robin Murphy <robin.murphy@arm.com>
>> Cc: linux-doc at vger.kernel.org
>> Cc: dri-devel at lists.freedesktop.org
>> Cc: linux-tegra at vger.kernel.org
>> Cc: linux-arm-kernel at lists.infradead.org
>> Cc: linux-pm at vger.kernel.org
>> Cc: linux-arm-msm at vger.kernel.org
>
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Thank you Ulf for reviewing the series.

Best regards
Vivek

>
> Kind regards
> Uffe
>
>> ---
>>  Documentation/driver-api/device_link.rst |  8 ++++----
>>  drivers/base/core.c                      | 15 ++++++++-------
>>  drivers/gpu/drm/tegra/dc.c               |  2 +-
>>  drivers/gpu/ipu-v3/ipu-pre.c             |  3 ++-
>>  drivers/gpu/ipu-v3/ipu-prg.c             |  3 ++-
>>  drivers/soc/imx/gpc.c                    |  2 +-
>>  include/linux/device.h                   | 12 ++++++------
>>  7 files changed, 24 insertions(+), 21 deletions(-)
>>
>> diff --git a/Documentation/driver-api/device_link.rst b/Documentation/driver-api/device_link.rst
>> index 70e328e16aad..a005b904a264 100644
>> --- a/Documentation/driver-api/device_link.rst
>> +++ b/Documentation/driver-api/device_link.rst
>> @@ -81,10 +81,10 @@ integration is desired.
>>  Two other flags are specifically targeted at use cases where the device
>>  link is added from the consumer's ``->probe`` callback:  ``DL_FLAG_RPM_ACTIVE``
>>  can be specified to runtime resume the supplier upon addition of the
>> -device link.  ``DL_FLAG_AUTOREMOVE`` causes the device link to be automatically
>> -purged when the consumer fails to probe or later unbinds.  This obviates
>> -the need to explicitly delete the link in the ``->remove`` callback or in
>> -the error path of the ``->probe`` callback.
>> +device link.  ``DL_FLAG_AUTOREMOVE_CONSUMER`` causes the device link to be
>> +automatically purged when the consumer fails to probe or later unbinds.
>> +This obviates the need to explicitly delete the link in the ``->remove``
>> +callback or in the error path of the ``->probe`` callback.
>>
>>  Limitations
>>  ===========
>> diff --git a/drivers/base/core.c b/drivers/base/core.c
>> index df3e1a44707a..14c1e3151e08 100644
>> --- a/drivers/base/core.c
>> +++ b/drivers/base/core.c
>> @@ -178,10 +178,10 @@ void device_pm_move_to_tail(struct device *dev)
>>   * of the link.  If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be
>>   * ignored.
>>   *
>> - * If the DL_FLAG_AUTOREMOVE is set, the link will be removed automatically
>> - * when the consumer device driver unbinds from it.  The combination of both
>> - * DL_FLAG_AUTOREMOVE and DL_FLAG_STATELESS set is invalid and will cause NULL
>> - * to be returned.
>> + * If the DL_FLAG_AUTOREMOVE_CONSUMER is set, the link will be removed
>> + * automatically when the consumer device driver unbinds from it.
>> + * The combination of both DL_FLAG_AUTOREMOVE_CONSUMER and DL_FLAG_STATELESS
>> + * set is invalid and will cause NULL to be returned.
>>   *
>>   * A side effect of the link creation is re-ordering of dpm_list and the
>>   * devices_kset list by moving the consumer device and all devices depending
>> @@ -198,7 +198,8 @@ struct device_link *device_link_add(struct device *consumer,
>>         struct device_link *link;
>>
>>         if (!consumer || !supplier ||
>> -           ((flags & DL_FLAG_STATELESS) && (flags & DL_FLAG_AUTOREMOVE)))
>> +           ((flags & DL_FLAG_STATELESS) &&
>> +            (flags & DL_FLAG_AUTOREMOVE_CONSUMER)))
>>                 return NULL;
>>
>>         device_links_write_lock();
>> @@ -479,7 +480,7 @@ static void __device_links_no_driver(struct device *dev)
>>                 if (link->flags & DL_FLAG_STATELESS)
>>                         continue;
>>
>> -               if (link->flags & DL_FLAG_AUTOREMOVE)
>> +               if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER)
>>                         kref_put(&link->kref, __device_link_del);
>>                 else if (link->status != DL_STATE_SUPPLIER_UNBIND)
>>                         WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
>> @@ -515,7 +516,7 @@ void device_links_driver_cleanup(struct device *dev)
>>                 if (link->flags & DL_FLAG_STATELESS)
>>                         continue;
>>
>> -               WARN_ON(link->flags & DL_FLAG_AUTOREMOVE);
>> +               WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER);
>>                 WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND);
>>                 WRITE_ONCE(link->status, DL_STATE_DORMANT);
>>         }
>> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
>> index c3afe7b2237e..965088afcfad 100644
>> --- a/drivers/gpu/drm/tegra/dc.c
>> +++ b/drivers/gpu/drm/tegra/dc.c
>> @@ -2312,7 +2312,7 @@ static int tegra_dc_couple(struct tegra_dc *dc)
>>          * POWER_CONTROL registers during CRTC enabling.
>>          */
>>         if (dc->soc->coupled_pm && dc->pipe == 1) {
>> -               u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE;
>> +               u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER;
>>                 struct device_link *link;
>>                 struct device *partner;
>>
>> diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
>> index 0f70e8847540..2f8db9d62551 100644
>> --- a/drivers/gpu/ipu-v3/ipu-pre.c
>> +++ b/drivers/gpu/ipu-v3/ipu-pre.c
>> @@ -128,7 +128,8 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
>>         list_for_each_entry(pre, &ipu_pre_list, list) {
>>                 if (pre_node == pre->dev->of_node) {
>>                         mutex_unlock(&ipu_pre_list_mutex);
>> -                       device_link_add(dev, pre->dev, DL_FLAG_AUTOREMOVE);
>> +                       device_link_add(dev, pre->dev,
>> +                                       DL_FLAG_AUTOREMOVE_CONSUMER);
>>                         of_node_put(pre_node);
>>                         return pre;
>>                 }
>> diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c
>> index 83f9dd934a5d..38a3a9764e49 100644
>> --- a/drivers/gpu/ipu-v3/ipu-prg.c
>> +++ b/drivers/gpu/ipu-v3/ipu-prg.c
>> @@ -100,7 +100,8 @@ ipu_prg_lookup_by_phandle(struct device *dev, const char *name, int ipu_id)
>>         list_for_each_entry(prg, &ipu_prg_list, list) {
>>                 if (prg_node == prg->dev->of_node) {
>>                         mutex_unlock(&ipu_prg_list_mutex);
>> -                       device_link_add(dev, prg->dev, DL_FLAG_AUTOREMOVE);
>> +                       device_link_add(dev, prg->dev,
>> +                                       DL_FLAG_AUTOREMOVE_CONSUMER);
>>                         prg->id = ipu_id;
>>                         of_node_put(prg_node);
>>                         return prg;
>> diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
>> index 32f0748fd067..aa9e65bc965e 100644
>> --- a/drivers/soc/imx/gpc.c
>> +++ b/drivers/soc/imx/gpc.c
>> @@ -202,7 +202,7 @@ static int imx_pgc_power_domain_probe(struct platform_device *pdev)
>>                         goto genpd_err;
>>         }
>>
>> -       device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE);
>> +       device_link_add(dev, dev->parent, DL_FLAG_AUTOREMOVE_CONSUMER);
>>
>>         return 0;
>>
>> diff --git a/include/linux/device.h b/include/linux/device.h
>> index 055a69dbcd18..3929805cdd59 100644
>> --- a/include/linux/device.h
>> +++ b/include/linux/device.h
>> @@ -90,7 +90,7 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
>>   * @num_vf:    Called to find out how many virtual functions a device on this
>>   *             bus supports.
>>   * @dma_configure:     Called to setup DMA configuration on a device on
>> -                       this bus.
>> + *                     this bus.
>>   * @pm:                Power management operations of this bus, callback the specific
>>   *             device driver's pm-ops.
>>   * @iommu_ops:  IOMMU specific operations for this bus, used to attach IOMMU
>> @@ -784,14 +784,14 @@ enum device_link_state {
>>   * Device link flags.
>>   *
>>   * STATELESS: The core won't track the presence of supplier/consumer drivers.
>> - * AUTOREMOVE: Remove this link automatically on consumer driver unbind.
>> + * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
>>   * PM_RUNTIME: If set, the runtime PM framework will use this link.
>>   * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
>>   */
>> -#define DL_FLAG_STATELESS      BIT(0)
>> -#define DL_FLAG_AUTOREMOVE     BIT(1)
>> -#define DL_FLAG_PM_RUNTIME     BIT(2)
>> -#define DL_FLAG_RPM_ACTIVE     BIT(3)
>> +#define DL_FLAG_STATELESS              BIT(0)
>> +#define DL_FLAG_AUTOREMOVE_CONSUMER    BIT(1)
>> +#define DL_FLAG_PM_RUNTIME             BIT(2)
>> +#define DL_FLAG_RPM_ACTIVE             BIT(3)
>>
>>  /**
>>   * struct device_link - Device link representation.
>> --
>> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
>> of Code Aurora Forum, hosted by The Linux Foundation
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
  2018-07-04 10:44       ` Rafael J. Wysocki
  (?)
@ 2018-07-04 18:09         ` Vivek Gautam
  -1 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-04 18:09 UTC (permalink / raw)
  To: Rafael J. Wysocki, Greg Kroah-Hartman
  Cc: linux-kernel, Jonathan Corbet, Robin Murphy, linux-doc,
	linux-arm-kernel, linux-pm, linux-arm-msm, Ulf Hansson,
	Marek Szyprowski



On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
>> Adding Ulf and Marek.
>>
>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
>>> Add a flag to autoremove the device links on supplier driver
>>> unbind. This obviates the need to explicitly delete the link
>>> in the remove path.
>>> We remove these links only when the supplier's link to its
>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>>>
>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>> Cc: linux-doc@vger.kernel.org
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: linux-pm@vger.kernel.org
>>> Cc: linux-arm-msm@vger.kernel.org
>>> ---
>> Hi Rafael, et al.
>>
>> Gentle ping.
>> Do you have comments on this series. I would really like to conclude these
>> device link additions sooner, and get things moving on the long awaited
>> arm-smmu clock/runtime support series.
>>
>> Thanks again for reviewing these patches.
> They are fine by me.
>
> I can queue them up for 4.19 if no one has objections (Greg in
> particular).

Hi Rafael,

I will resubmit these 2 patches as part of the arm-smmu series, as one
of the patch in the series depends on addition of 
DL_FLAG_AUTOREMOVE_SUPPLIER.
So these 2 patches and arm-smmu series should go together.
Can you please consider givnig your Ack?

Best regards
Vivek

>
> Thanks,
> Rafael
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04 18:09         ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-04 18:09 UTC (permalink / raw)
  To: Rafael J. Wysocki, Greg Kroah-Hartman
  Cc: linux-kernel, Jonathan Corbet, Robin Murphy, linux-doc,
	linux-arm-kernel, linux-pm, linux-arm-msm, Ulf Hansson,
	Marek Szyprowski



On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
>> Adding Ulf and Marek.
>>
>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
>>> Add a flag to autoremove the device links on supplier driver
>>> unbind. This obviates the need to explicitly delete the link
>>> in the remove path.
>>> We remove these links only when the supplier's link to its
>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>>>
>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>> Cc: linux-doc@vger.kernel.org
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: linux-pm@vger.kernel.org
>>> Cc: linux-arm-msm@vger.kernel.org
>>> ---
>> Hi Rafael, et al.
>>
>> Gentle ping.
>> Do you have comments on this series. I would really like to conclude these
>> device link additions sooner, and get things moving on the long awaited
>> arm-smmu clock/runtime support series.
>>
>> Thanks again for reviewing these patches.
> They are fine by me.
>
> I can queue them up for 4.19 if no one has objections (Greg in
> particular).

Hi Rafael,

I will resubmit these 2 patches as part of the arm-smmu series, as one
of the patch in the series depends on addition of 
DL_FLAG_AUTOREMOVE_SUPPLIER.
So these 2 patches and arm-smmu series should go together.
Can you please consider givnig your Ack?

Best regards
Vivek

>
> Thanks,
> Rafael
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04 18:09         ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-04 18:09 UTC (permalink / raw)
  To: linux-arm-kernel



On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
>> Adding Ulf and Marek.
>>
>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
>>> Add a flag to autoremove the device links on supplier driver
>>> unbind. This obviates the need to explicitly delete the link
>>> in the remove path.
>>> We remove these links only when the supplier's link to its
>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>>>
>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>> Cc: linux-doc at vger.kernel.org
>>> Cc: linux-arm-kernel at lists.infradead.org
>>> Cc: linux-pm at vger.kernel.org
>>> Cc: linux-arm-msm at vger.kernel.org
>>> ---
>> Hi Rafael, et al.
>>
>> Gentle ping.
>> Do you have comments on this series. I would really like to conclude these
>> device link additions sooner, and get things moving on the long awaited
>> arm-smmu clock/runtime support series.
>>
>> Thanks again for reviewing these patches.
> They are fine by me.
>
> I can queue them up for 4.19 if no one has objections (Greg in
> particular).

Hi Rafael,

I will resubmit these 2 patches as part of the arm-smmu series, as one
of the patch in the series depends on addition of 
DL_FLAG_AUTOREMOVE_SUPPLIER.
So these 2 patches and arm-smmu series should go together.
Can you please consider givnig your Ack?

Best regards
Vivek

>
> Thanks,
> Rafael
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
  2018-07-04 18:09         ` Vivek Gautam
  (?)
@ 2018-07-04 23:19           ` Rafael J. Wysocki
  -1 siblings, 0 replies; 39+ messages in thread
From: Rafael J. Wysocki @ 2018-07-04 23:19 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: Rafael J. Wysocki, Greg Kroah-Hartman, Linux Kernel Mailing List,
	Jonathan Corbet, Robin Murphy, open list:DOCUMENTATION,
	Linux ARM, Linux PM, linux-arm-msm, Ulf Hansson,
	Marek Szyprowski

On Wed, Jul 4, 2018 at 8:09 PM, Vivek Gautam
<vivek.gautam@codeaurora.org> wrote:
>
>
> On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
>>
>> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
>>>
>>> Adding Ulf and Marek.
>>>
>>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
>>>>
>>>> Add a flag to autoremove the device links on supplier driver
>>>> unbind. This obviates the need to explicitly delete the link
>>>> in the remove path.
>>>> We remove these links only when the supplier's link to its
>>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>>>>
>>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
>>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>>> Cc: linux-doc@vger.kernel.org
>>>> Cc: linux-arm-kernel@lists.infradead.org
>>>> Cc: linux-pm@vger.kernel.org
>>>> Cc: linux-arm-msm@vger.kernel.org
>>>> ---
>>>
>>> Hi Rafael, et al.
>>>
>>> Gentle ping.
>>> Do you have comments on this series. I would really like to conclude
>>> these
>>> device link additions sooner, and get things moving on the long awaited
>>> arm-smmu clock/runtime support series.
>>>
>>> Thanks again for reviewing these patches.
>>
>> They are fine by me.
>>
>> I can queue them up for 4.19 if no one has objections (Greg in
>> particular).
>
>
> Hi Rafael,
>
> I will resubmit these 2 patches as part of the arm-smmu series, as one
> of the patch in the series depends on addition of
> DL_FLAG_AUTOREMOVE_SUPPLIER.
> So these 2 patches and arm-smmu series should go together.
> Can you please consider givnig your Ack?

I would prefer to apply them myself to be honest and put them on an
public git branch for you to pull from.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04 23:19           ` Rafael J. Wysocki
  0 siblings, 0 replies; 39+ messages in thread
From: Rafael J. Wysocki @ 2018-07-04 23:19 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: Rafael J. Wysocki, Greg Kroah-Hartman, Linux Kernel Mailing List,
	Jonathan Corbet, Robin Murphy, open list:DOCUMENTATION,
	Linux ARM, Linux PM, linux-arm-msm, Ulf Hansson,
	Marek Szyprowski

On Wed, Jul 4, 2018 at 8:09 PM, Vivek Gautam
<vivek.gautam@codeaurora.org> wrote:
>
>
> On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
>>
>> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
>>>
>>> Adding Ulf and Marek.
>>>
>>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
>>>>
>>>> Add a flag to autoremove the device links on supplier driver
>>>> unbind. This obviates the need to explicitly delete the link
>>>> in the remove path.
>>>> We remove these links only when the supplier's link to its
>>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>>>>
>>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
>>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>>> Cc: linux-doc@vger.kernel.org
>>>> Cc: linux-arm-kernel@lists.infradead.org
>>>> Cc: linux-pm@vger.kernel.org
>>>> Cc: linux-arm-msm@vger.kernel.org
>>>> ---
>>>
>>> Hi Rafael, et al.
>>>
>>> Gentle ping.
>>> Do you have comments on this series. I would really like to conclude
>>> these
>>> device link additions sooner, and get things moving on the long awaited
>>> arm-smmu clock/runtime support series.
>>>
>>> Thanks again for reviewing these patches.
>>
>> They are fine by me.
>>
>> I can queue them up for 4.19 if no one has objections (Greg in
>> particular).
>
>
> Hi Rafael,
>
> I will resubmit these 2 patches as part of the arm-smmu series, as one
> of the patch in the series depends on addition of
> DL_FLAG_AUTOREMOVE_SUPPLIER.
> So these 2 patches and arm-smmu series should go together.
> Can you please consider givnig your Ack?

I would prefer to apply them myself to be honest and put them on an
public git branch for you to pull from.

Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-04 23:19           ` Rafael J. Wysocki
  0 siblings, 0 replies; 39+ messages in thread
From: Rafael J. Wysocki @ 2018-07-04 23:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 4, 2018 at 8:09 PM, Vivek Gautam
<vivek.gautam@codeaurora.org> wrote:
>
>
> On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
>>
>> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
>>>
>>> Adding Ulf and Marek.
>>>
>>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
>>>>
>>>> Add a flag to autoremove the device links on supplier driver
>>>> unbind. This obviates the need to explicitly delete the link
>>>> in the remove path.
>>>> We remove these links only when the supplier's link to its
>>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>>>>
>>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
>>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>>> Cc: linux-doc at vger.kernel.org
>>>> Cc: linux-arm-kernel at lists.infradead.org
>>>> Cc: linux-pm at vger.kernel.org
>>>> Cc: linux-arm-msm at vger.kernel.org
>>>> ---
>>>
>>> Hi Rafael, et al.
>>>
>>> Gentle ping.
>>> Do you have comments on this series. I would really like to conclude
>>> these
>>> device link additions sooner, and get things moving on the long awaited
>>> arm-smmu clock/runtime support series.
>>>
>>> Thanks again for reviewing these patches.
>>
>> They are fine by me.
>>
>> I can queue them up for 4.19 if no one has objections (Greg in
>> particular).
>
>
> Hi Rafael,
>
> I will resubmit these 2 patches as part of the arm-smmu series, as one
> of the patch in the series depends on addition of
> DL_FLAG_AUTOREMOVE_SUPPLIER.
> So these 2 patches and arm-smmu series should go together.
> Can you please consider givnig your Ack?

I would prefer to apply them myself to be honest and put them on an
public git branch for you to pull from.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
  2018-07-04 23:19           ` Rafael J. Wysocki
  (?)
@ 2018-07-05  4:28             ` Vivek Gautam
  -1 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-05  4:28 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Rafael J. Wysocki, Greg Kroah-Hartman, Linux Kernel Mailing List,
	Jonathan Corbet, Robin Murphy, open list:DOCUMENTATION,
	Linux ARM, Linux PM, linux-arm-msm, Ulf Hansson,
	Marek Szyprowski



On 7/5/2018 4:49 AM, Rafael J. Wysocki wrote:
> On Wed, Jul 4, 2018 at 8:09 PM, Vivek Gautam
> <vivek.gautam@codeaurora.org> wrote:
>>
>> On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
>>> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
>>>> Adding Ulf and Marek.
>>>>
>>>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
>>>>> Add a flag to autoremove the device links on supplier driver
>>>>> unbind. This obviates the need to explicitly delete the link
>>>>> in the remove path.
>>>>> We remove these links only when the supplier's link to its
>>>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>>>>>
>>>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>>>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
>>>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>>>> Cc: linux-doc@vger.kernel.org
>>>>> Cc: linux-arm-kernel@lists.infradead.org
>>>>> Cc: linux-pm@vger.kernel.org
>>>>> Cc: linux-arm-msm@vger.kernel.org
>>>>> ---
>>>> Hi Rafael, et al.
>>>>
>>>> Gentle ping.
>>>> Do you have comments on this series. I would really like to conclude
>>>> these
>>>> device link additions sooner, and get things moving on the long awaited
>>>> arm-smmu clock/runtime support series.
>>>>
>>>> Thanks again for reviewing these patches.
>>> They are fine by me.
>>>
>>> I can queue them up for 4.19 if no one has objections (Greg in
>>> particular).
>>
>> Hi Rafael,
>>
>> I will resubmit these 2 patches as part of the arm-smmu series, as one
>> of the patch in the series depends on addition of
>> DL_FLAG_AUTOREMOVE_SUPPLIER.
>> So these 2 patches and arm-smmu series should go together.
>> Can you please consider givnig your Ack?
> I would prefer to apply them myself to be honest and put them on an
> public git branch for you to pull from.

Sure. Fine with me. I will base the smmu patches on your branch.

Thanks
Vivek
>
> Thanks,
> Rafael

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-05  4:28             ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-05  4:28 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Rafael J. Wysocki, Greg Kroah-Hartman, Linux Kernel Mailing List,
	Jonathan Corbet, Robin Murphy, open list:DOCUMENTATION,
	Linux ARM, Linux PM, linux-arm-msm, Ulf Hansson,
	Marek Szyprowski



On 7/5/2018 4:49 AM, Rafael J. Wysocki wrote:
> On Wed, Jul 4, 2018 at 8:09 PM, Vivek Gautam
> <vivek.gautam@codeaurora.org> wrote:
>>
>> On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
>>> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
>>>> Adding Ulf and Marek.
>>>>
>>>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
>>>>> Add a flag to autoremove the device links on supplier driver
>>>>> unbind. This obviates the need to explicitly delete the link
>>>>> in the remove path.
>>>>> We remove these links only when the supplier's link to its
>>>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>>>>>
>>>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>>>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
>>>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>>>> Cc: linux-doc@vger.kernel.org
>>>>> Cc: linux-arm-kernel@lists.infradead.org
>>>>> Cc: linux-pm@vger.kernel.org
>>>>> Cc: linux-arm-msm@vger.kernel.org
>>>>> ---
>>>> Hi Rafael, et al.
>>>>
>>>> Gentle ping.
>>>> Do you have comments on this series. I would really like to conclude
>>>> these
>>>> device link additions sooner, and get things moving on the long awaited
>>>> arm-smmu clock/runtime support series.
>>>>
>>>> Thanks again for reviewing these patches.
>>> They are fine by me.
>>>
>>> I can queue them up for 4.19 if no one has objections (Greg in
>>> particular).
>>
>> Hi Rafael,
>>
>> I will resubmit these 2 patches as part of the arm-smmu series, as one
>> of the patch in the series depends on addition of
>> DL_FLAG_AUTOREMOVE_SUPPLIER.
>> So these 2 patches and arm-smmu series should go together.
>> Can you please consider givnig your Ack?
> I would prefer to apply them myself to be honest and put them on an
> public git branch for you to pull from.

Sure. Fine with me. I will base the smmu patches on your branch.

Thanks
Vivek
>
> Thanks,
> Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-05  4:28             ` Vivek Gautam
  0 siblings, 0 replies; 39+ messages in thread
From: Vivek Gautam @ 2018-07-05  4:28 UTC (permalink / raw)
  To: linux-arm-kernel



On 7/5/2018 4:49 AM, Rafael J. Wysocki wrote:
> On Wed, Jul 4, 2018 at 8:09 PM, Vivek Gautam
> <vivek.gautam@codeaurora.org> wrote:
>>
>> On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
>>> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
>>>> Adding Ulf and Marek.
>>>>
>>>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
>>>>> Add a flag to autoremove the device links on supplier driver
>>>>> unbind. This obviates the need to explicitly delete the link
>>>>> in the remove path.
>>>>> We remove these links only when the supplier's link to its
>>>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
>>>>>
>>>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
>>>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
>>>>> Cc: Jonathan Corbet <corbet@lwn.net>
>>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>>>> Cc: linux-doc at vger.kernel.org
>>>>> Cc: linux-arm-kernel at lists.infradead.org
>>>>> Cc: linux-pm at vger.kernel.org
>>>>> Cc: linux-arm-msm at vger.kernel.org
>>>>> ---
>>>> Hi Rafael, et al.
>>>>
>>>> Gentle ping.
>>>> Do you have comments on this series. I would really like to conclude
>>>> these
>>>> device link additions sooner, and get things moving on the long awaited
>>>> arm-smmu clock/runtime support series.
>>>>
>>>> Thanks again for reviewing these patches.
>>> They are fine by me.
>>>
>>> I can queue them up for 4.19 if no one has objections (Greg in
>>> particular).
>>
>> Hi Rafael,
>>
>> I will resubmit these 2 patches as part of the arm-smmu series, as one
>> of the patch in the series depends on addition of
>> DL_FLAG_AUTOREMOVE_SUPPLIER.
>> So these 2 patches and arm-smmu series should go together.
>> Can you please consider givnig your Ack?
> I would prefer to apply them myself to be honest and put them on an
> public git branch for you to pull from.

Sure. Fine with me. I will base the smmu patches on your branch.

Thanks
Vivek
>
> Thanks,
> Rafael

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
  2018-07-05  4:28             ` Vivek Gautam
  (?)
@ 2018-07-11  9:46               ` Rafael J. Wysocki
  -1 siblings, 0 replies; 39+ messages in thread
From: Rafael J. Wysocki @ 2018-07-11  9:46 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: Rafael J. Wysocki, Greg Kroah-Hartman, Linux Kernel Mailing List,
	Jonathan Corbet, Robin Murphy, open list:DOCUMENTATION,
	Linux ARM, Linux PM, linux-arm-msm, Ulf Hansson,
	Marek Szyprowski

On Thursday, July 5, 2018 6:28:16 AM CEST Vivek Gautam wrote:
> 
> On 7/5/2018 4:49 AM, Rafael J. Wysocki wrote:
> > On Wed, Jul 4, 2018 at 8:09 PM, Vivek Gautam
> > <vivek.gautam@codeaurora.org> wrote:
> >>
> >> On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
> >>> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
> >>>> Adding Ulf and Marek.
> >>>>
> >>>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
> >>>>> Add a flag to autoremove the device links on supplier driver
> >>>>> unbind. This obviates the need to explicitly delete the link
> >>>>> in the remove path.
> >>>>> We remove these links only when the supplier's link to its
> >>>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
> >>>>>
> >>>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> >>>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
> >>>>> Cc: Jonathan Corbet <corbet@lwn.net>
> >>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >>>>> Cc: Robin Murphy <robin.murphy@arm.com>
> >>>>> Cc: linux-doc@vger.kernel.org
> >>>>> Cc: linux-arm-kernel@lists.infradead.org
> >>>>> Cc: linux-pm@vger.kernel.org
> >>>>> Cc: linux-arm-msm@vger.kernel.org
> >>>>> ---
> >>>> Hi Rafael, et al.
> >>>>
> >>>> Gentle ping.
> >>>> Do you have comments on this series. I would really like to conclude
> >>>> these
> >>>> device link additions sooner, and get things moving on the long awaited
> >>>> arm-smmu clock/runtime support series.
> >>>>
> >>>> Thanks again for reviewing these patches.
> >>> They are fine by me.
> >>>
> >>> I can queue them up for 4.19 if no one has objections (Greg in
> >>> particular).
> >>
> >> Hi Rafael,
> >>
> >> I will resubmit these 2 patches as part of the arm-smmu series, as one
> >> of the patch in the series depends on addition of
> >> DL_FLAG_AUTOREMOVE_SUPPLIER.
> >> So these 2 patches and arm-smmu series should go together.
> >> Can you please consider givnig your Ack?
> > I would prefer to apply them myself to be honest and put them on an
> > public git branch for you to pull from.
> 
> Sure. Fine with me. I will base the smmu patches on your branch.

The patches have been applied and are available for pulling in the pm-core
branch of the linux-pm.git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git pm-core

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-11  9:46               ` Rafael J. Wysocki
  0 siblings, 0 replies; 39+ messages in thread
From: Rafael J. Wysocki @ 2018-07-11  9:46 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: Rafael J. Wysocki, Greg Kroah-Hartman, Linux Kernel Mailing List,
	Jonathan Corbet, Robin Murphy, open list:DOCUMENTATION,
	Linux ARM, Linux PM, linux-arm-msm, Ulf Hansson,
	Marek Szyprowski

On Thursday, July 5, 2018 6:28:16 AM CEST Vivek Gautam wrote:
> 
> On 7/5/2018 4:49 AM, Rafael J. Wysocki wrote:
> > On Wed, Jul 4, 2018 at 8:09 PM, Vivek Gautam
> > <vivek.gautam@codeaurora.org> wrote:
> >>
> >> On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
> >>> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
> >>>> Adding Ulf and Marek.
> >>>>
> >>>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
> >>>>> Add a flag to autoremove the device links on supplier driver
> >>>>> unbind. This obviates the need to explicitly delete the link
> >>>>> in the remove path.
> >>>>> We remove these links only when the supplier's link to its
> >>>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
> >>>>>
> >>>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> >>>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
> >>>>> Cc: Jonathan Corbet <corbet@lwn.net>
> >>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >>>>> Cc: Robin Murphy <robin.murphy@arm.com>
> >>>>> Cc: linux-doc@vger.kernel.org
> >>>>> Cc: linux-arm-kernel@lists.infradead.org
> >>>>> Cc: linux-pm@vger.kernel.org
> >>>>> Cc: linux-arm-msm@vger.kernel.org
> >>>>> ---
> >>>> Hi Rafael, et al.
> >>>>
> >>>> Gentle ping.
> >>>> Do you have comments on this series. I would really like to conclude
> >>>> these
> >>>> device link additions sooner, and get things moving on the long awaited
> >>>> arm-smmu clock/runtime support series.
> >>>>
> >>>> Thanks again for reviewing these patches.
> >>> They are fine by me.
> >>>
> >>> I can queue them up for 4.19 if no one has objections (Greg in
> >>> particular).
> >>
> >> Hi Rafael,
> >>
> >> I will resubmit these 2 patches as part of the arm-smmu series, as one
> >> of the patch in the series depends on addition of
> >> DL_FLAG_AUTOREMOVE_SUPPLIER.
> >> So these 2 patches and arm-smmu series should go together.
> >> Can you please consider givnig your Ack?
> > I would prefer to apply them myself to be honest and put them on an
> > public git branch for you to pull from.
> 
> Sure. Fine with me. I will base the smmu patches on your branch.

The patches have been applied and are available for pulling in the pm-core
branch of the linux-pm.git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git pm-core

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind
@ 2018-07-11  9:46               ` Rafael J. Wysocki
  0 siblings, 0 replies; 39+ messages in thread
From: Rafael J. Wysocki @ 2018-07-11  9:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday, July 5, 2018 6:28:16 AM CEST Vivek Gautam wrote:
> 
> On 7/5/2018 4:49 AM, Rafael J. Wysocki wrote:
> > On Wed, Jul 4, 2018 at 8:09 PM, Vivek Gautam
> > <vivek.gautam@codeaurora.org> wrote:
> >>
> >> On 7/4/2018 4:14 PM, Rafael J. Wysocki wrote:
> >>> On Wednesday, July 4, 2018 9:16:20 AM CEST Vivek Gautam wrote:
> >>>> Adding Ulf and Marek.
> >>>>
> >>>> On 6/27/2018 6:20 PM, Vivek Gautam wrote:
> >>>>> Add a flag to autoremove the device links on supplier driver
> >>>>> unbind. This obviates the need to explicitly delete the link
> >>>>> in the remove path.
> >>>>> We remove these links only when the supplier's link to its
> >>>>> consumers has gone to DL_STATE_SUPPLIER_UNBIND state.
> >>>>>
> >>>>> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> >>>>> Suggested-by: Lukas Wunner <lukas@wunner.de>
> >>>>> Cc: Jonathan Corbet <corbet@lwn.net>
> >>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >>>>> Cc: Robin Murphy <robin.murphy@arm.com>
> >>>>> Cc: linux-doc at vger.kernel.org
> >>>>> Cc: linux-arm-kernel at lists.infradead.org
> >>>>> Cc: linux-pm at vger.kernel.org
> >>>>> Cc: linux-arm-msm at vger.kernel.org
> >>>>> ---
> >>>> Hi Rafael, et al.
> >>>>
> >>>> Gentle ping.
> >>>> Do you have comments on this series. I would really like to conclude
> >>>> these
> >>>> device link additions sooner, and get things moving on the long awaited
> >>>> arm-smmu clock/runtime support series.
> >>>>
> >>>> Thanks again for reviewing these patches.
> >>> They are fine by me.
> >>>
> >>> I can queue them up for 4.19 if no one has objections (Greg in
> >>> particular).
> >>
> >> Hi Rafael,
> >>
> >> I will resubmit these 2 patches as part of the arm-smmu series, as one
> >> of the patch in the series depends on addition of
> >> DL_FLAG_AUTOREMOVE_SUPPLIER.
> >> So these 2 patches and arm-smmu series should go together.
> >> Can you please consider givnig your Ack?
> > I would prefer to apply them myself to be honest and put them on an
> > public git branch for you to pull from.
> 
> Sure. Fine with me. I will base the smmu patches on your branch.

The patches have been applied and are available for pulling in the pm-core
branch of the linux-pm.git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git pm-core

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2018-07-11  9:48 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-27 12:50 [PATCH 1/2] device core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER Vivek Gautam
2018-06-27 12:50 ` Vivek Gautam
2018-06-27 12:50 ` Vivek Gautam
2018-06-27 12:50 ` [PATCH 2/2] device core: Add flag to autoremove device link on supplier unbind Vivek Gautam
2018-06-27 12:50   ` Vivek Gautam
2018-06-27 12:50   ` Vivek Gautam
2018-07-04  7:16   ` Vivek Gautam
2018-07-04  7:16     ` Vivek Gautam
2018-07-04  7:16     ` Vivek Gautam
2018-07-04 10:44     ` Rafael J. Wysocki
2018-07-04 10:44       ` Rafael J. Wysocki
2018-07-04 10:44       ` Rafael J. Wysocki
2018-07-04 11:19       ` Vivek Gautam
2018-07-04 11:19         ` Vivek Gautam
2018-07-04 11:19         ` Vivek Gautam
2018-07-04 11:32       ` Greg Kroah-Hartman
2018-07-04 11:32         ` Greg Kroah-Hartman
2018-07-04 11:32         ` Greg Kroah-Hartman
2018-07-04 18:09       ` Vivek Gautam
2018-07-04 18:09         ` Vivek Gautam
2018-07-04 18:09         ` Vivek Gautam
2018-07-04 23:19         ` Rafael J. Wysocki
2018-07-04 23:19           ` Rafael J. Wysocki
2018-07-04 23:19           ` Rafael J. Wysocki
2018-07-05  4:28           ` Vivek Gautam
2018-07-05  4:28             ` Vivek Gautam
2018-07-05  4:28             ` Vivek Gautam
2018-07-11  9:46             ` Rafael J. Wysocki
2018-07-11  9:46               ` Rafael J. Wysocki
2018-07-11  9:46               ` Rafael J. Wysocki
2018-07-04 12:55   ` Ulf Hansson
2018-07-04 12:55     ` Ulf Hansson
2018-07-04 12:55     ` Ulf Hansson
2018-07-04 12:55 ` [PATCH 1/2] device core: Rename flag AUTOREMOVE to AUTOREMOVE_CONSUMER Ulf Hansson
2018-07-04 12:55   ` Ulf Hansson
2018-07-04 12:55   ` Ulf Hansson
2018-07-04 17:37   ` Vivek Gautam
2018-07-04 17:37     ` Vivek Gautam
2018-07-04 17:37     ` Vivek Gautam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.