Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1415239 > unrolled thread
| Started by | Lee Jones <lee.jones@linaro.org> |
|---|---|
| First post | 2016-06-06 18:00 +0200 |
| Last post | 2016-06-07 11:30 +0200 |
| Articles | 20 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 0/7] reset: Consumers to explicitly request 'exclusive' or 'shared' lines Lee Jones <lee.jones@linaro.org> - 2016-06-06 18:00 +0200
[PATCH 6/7] phy: miphy28lp: Inform the reset framework that our reset line may be shared Lee Jones <lee.jones@linaro.org> - 2016-06-06 18:00 +0200
Re: [STLinux Kernel] [PATCH 6/7] phy: miphy28lp: Inform the reset framework that our reset line may be shared Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 10:40 +0200
Re: [PATCH 6/7] phy: miphy28lp: Inform the reset framework that our reset line may be shared Kishon Vijay Abraham I <kishon@ti.com> - 2016-06-07 11:10 +0200
[PATCH 2/7] reset: Ensure drivers are explicit when requesting reset lines Lee Jones <lee.jones@linaro.org> - 2016-06-06 18:00 +0200
[PATCH 7/7] usb: dwc3: st: Inform the reset framework that our reset line may be shared Lee Jones <lee.jones@linaro.org> - 2016-06-06 18:00 +0200
[PATCH 9/10] usb: host: ehci-st: Inform the reset framework that our reset line may be shared Lee Jones <lee.jones@linaro.org> - 2016-06-06 19:20 +0200
Re: [PATCH 9/10] usb: host: ehci-st: Inform the reset framework that our reset line may be shared Alan Stern <stern@rowland.harvard.edu> - 2016-06-06 19:50 +0200
[PATCH 8/10] phy: phy-stih407-usb: Inform the reset framework that our reset line may be shared Lee Jones <lee.jones@linaro.org> - 2016-06-06 19:20 +0200
[PATCH 10/10] usb: host: ohci-st: Inform the reset framework that our reset line may be shared Lee Jones <lee.jones@linaro.org> - 2016-06-06 19:20 +0200
Re: [STLinux Kernel] [PATCH 8/10] phy: phy-stih407-usb: Inform the reset framework that our reset line may be shared Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 10:40 +0200
Re: [PATCH 8/10] phy: phy-stih407-usb: Inform the reset framework that our reset line may be shared Kishon Vijay Abraham I <kishon@ti.com> - 2016-06-07 11:10 +0200
Re: [STLinux Kernel] [PATCH 7/7] usb: dwc3: st: Inform the reset framework that our reset line may be shared Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 10:50 +0200
[PATCH 5/7] reset: TRIVIAL: Add line break at same place for similar APIs Lee Jones <lee.jones@linaro.org> - 2016-06-06 18:00 +0200
[PATCH 1/7] reset: Reorder inline reset_control_get*() wrappers Lee Jones <lee.jones@linaro.org> - 2016-06-06 18:10 +0200
[PATCH 3/7] reset: Supply *_shared variant calls when using of_* API Lee Jones <lee.jones@linaro.org> - 2016-06-06 18:10 +0200
[PATCH 4/7] reset: Supply *_shared variant calls when using *_optional APIs Lee Jones <lee.jones@linaro.org> - 2016-06-06 18:10 +0200
Re: [STLinux Kernel] [PATCH 0/7] reset: Consumers to explicitly request 'exclusive' or 'shared' lines Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 10:50 +0200
Re: [STLinux Kernel] [PATCH 0/7] reset: Consumers to explicitly request 'exclusive' or 'shared' lines Lee Jones <lee.jones@linaro.org> - 2016-06-07 11:20 +0200
Re: [STLinux Kernel] [PATCH 0/7] reset: Consumers to explicitly request 'exclusive' or 'shared' lines Lee Jones <lee.jones@linaro.org> - 2016-06-07 11:30 +0200
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-06 18:00 +0200 |
| Subject | [PATCH 0/7] reset: Consumers to explicitly request 'exclusive' or 'shared' lines |
| Message-ID | <rH56x-6VJ-19@gated-at.bofh.it> |
Phasing out generic reset line requests enables us to make some better
decisions on when and how to (de)assert said lines. If an 'exclusive'
line is requested, we know a device *requires* a reset and that it's
preferable to act upon a request right away. However, if a 'shared'
reset line is requested, we can reasonably assume sure that placing a
device into reset isn't a hard requirement, but probably a measure to
save power and is thus able to cope with not being asserted if another
device is still in use.
In order allow gentle adoption and not to forcing all consumers to
move to the API immediately, causing administration headache between
subsystems, this patch adds some temporary stand-in shim-calls. This
will ease the burden at merge time and allow subsystems to migrate over
to the new API in a more realistic time-frame.
Lee Jones (7):
reset: Reorder inline reset_control_get*() wrappers
reset: Ensure drivers are explicit when requesting reset lines
reset: Supply *_shared variant calls when using of_* API
reset: Supply *_shared variant calls when using *_optional APIs
reset: TRIVIAL: Add line break at same place for similar APIs
phy: miphy28lp: Inform the reset framework that our reset line may be
shared
usb: dwc3: st: Inform the reset framework that our reset line may be
shared
drivers/phy/phy-miphy28lp.c | 3 +-
drivers/usb/dwc3/dwc3-st.c | 6 +-
include/linux/reset.h | 211 +++++++++++++++++++++++++++++++++++---------
3 files changed, 173 insertions(+), 47 deletions(-)
--
2.8.3
[toc] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-06 18:00 +0200 |
| Subject | [PATCH 6/7] phy: miphy28lp: Inform the reset framework that our reset line may be shared |
| Message-ID | <rH56x-6VJ-17@gated-at.bofh.it> |
| In reply to | #1415239 |
On the STiH410 B2120 development board the MiPHY28lp shares its reset
line with the Synopsys DWC3 SuperSpeed (SS) USB 3.0 Dual-Role-Device
(DRD). New functionality in the reset subsystems forces consumers to
be explicit when requesting shared/exclusive reset lines.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/phy/phy-miphy28lp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c
index 3acd2a1..213e2e1 100644
--- a/drivers/phy/phy-miphy28lp.c
+++ b/drivers/phy/phy-miphy28lp.c
@@ -1143,7 +1143,8 @@ static int miphy28lp_probe_resets(struct device_node *node,
struct miphy28lp_dev *miphy_dev = miphy_phy->phydev;
int err;
- miphy_phy->miphy_rst = of_reset_control_get(node, "miphy-sw-rst");
+ miphy_phy->miphy_rst =
+ of_reset_control_get_shared(node, "miphy-sw-rst");
if (IS_ERR(miphy_phy->miphy_rst)) {
dev_err(miphy_dev->dev,
--
2.8.3
[toc] | [prev] | [next] | [standalone]
| From | Peter Griffin <peter.griffin@linaro.org> |
|---|---|
| Date | 2016-06-07 10:40 +0200 |
| Subject | Re: [STLinux Kernel] [PATCH 6/7] phy: miphy28lp: Inform the reset framework that our reset line may be shared |
| Message-ID | <rHkIh-nf-7@gated-at.bofh.it> |
| In reply to | #1415241 |
On Mon, 06 Jun 2016, Lee Jones wrote: > On the STiH410 B2120 development board the MiPHY28lp shares its reset > line with the Synopsys DWC3 SuperSpeed (SS) USB 3.0 Dual-Role-Device > (DRD). New functionality in the reset subsystems forces consumers to > be explicit when requesting shared/exclusive reset lines. > > Signed-off-by: Lee Jones <lee.jones@linaro.org> > --- > drivers/phy/phy-miphy28lp.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Acked-by: Peter Griffin <peter.griffin@linaro.org>
[toc] | [prev] | [next] | [standalone]
| From | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| Date | 2016-06-07 11:10 +0200 |
| Subject | Re: [PATCH 6/7] phy: miphy28lp: Inform the reset framework that our reset line may be shared |
| Message-ID | <rHlbj-Mt-5@gated-at.bofh.it> |
| In reply to | #1415241 |
On Monday 06 June 2016 09:26 PM, Lee Jones wrote:
> On the STiH410 B2120 development board the MiPHY28lp shares its reset
> line with the Synopsys DWC3 SuperSpeed (SS) USB 3.0 Dual-Role-Device
> (DRD). New functionality in the reset subsystems forces consumers to
> be explicit when requesting shared/exclusive reset lines.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
> drivers/phy/phy-miphy28lp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c
> index 3acd2a1..213e2e1 100644
> --- a/drivers/phy/phy-miphy28lp.c
> +++ b/drivers/phy/phy-miphy28lp.c
> @@ -1143,7 +1143,8 @@ static int miphy28lp_probe_resets(struct device_node *node,
> struct miphy28lp_dev *miphy_dev = miphy_phy->phydev;
> int err;
>
> - miphy_phy->miphy_rst = of_reset_control_get(node, "miphy-sw-rst");
> + miphy_phy->miphy_rst =
> + of_reset_control_get_shared(node, "miphy-sw-rst");
>
> if (IS_ERR(miphy_phy->miphy_rst)) {
> dev_err(miphy_dev->dev,
>
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-06 18:00 +0200 |
| Subject | [PATCH 2/7] reset: Ensure drivers are explicit when requesting reset lines |
| Message-ID | <rH56y-6VJ-33@gated-at.bofh.it> |
| In reply to | #1415239 |
Phasing out generic reset line requests enables us to make some better
decisions on when and how to (de)assert said lines. If an 'exclusive'
line is requested, we know a device *requires* a reset and that it's
preferable to act upon a request right away. However, if a 'shared'
reset line is requested, we can reasonably assume sure that placing a
device into reset isn't a hard requirement, but probably a measure to
save power and is thus able to cope with not being asserted if another
device is still in use.
In order allow gentle adoption and not to forcing all consumers to
move to the API immediately, causing administration headache between
subsystems, this patch adds some temporary stand-in shim-calls. This
will ease the burden at merge time and allow subsystems to migrate over
to the new API in a more realistic time-frame.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
include/linux/reset.h | 106 ++++++++++++++++++++++++++++++++++++++------------
1 file changed, 82 insertions(+), 24 deletions(-)
diff --git a/include/linux/reset.h b/include/linux/reset.h
index 33eaf11..9cf4cf3 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -84,8 +84,8 @@ static inline struct reset_control *__devm_reset_control_get(
#endif /* CONFIG_RESET_CONTROLLER */
/**
- * reset_control_get - Lookup and obtain an exclusive reference to a
- * reset controller.
+ * reset_control_get_exclusive - Lookup and obtain an exclusive reference
+ * to a reset controller.
* @dev: device to be reset by the controller
* @id: reset line name
*
@@ -98,8 +98,8 @@ static inline struct reset_control *__devm_reset_control_get(
*
* Use of id names is optional.
*/
-static inline struct reset_control *__must_check reset_control_get(
- struct device *dev, const char *id)
+static inline struct reset_control *
+__must_check reset_control_get_exclusive(struct device *dev, const char *id)
{
#ifndef CONFIG_RESET_CONTROLLER
WARN_ON(1);
@@ -135,15 +135,15 @@ static inline struct reset_control *reset_control_get_shared(
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
}
-static inline struct reset_control *reset_control_get_optional(
+static inline struct reset_control *reset_control_get_optional_exclusive(
struct device *dev, const char *id)
{
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
}
/**
- * of_reset_control_get - Lookup and obtain an exclusive reference to a
- * reset controller.
+ * of_reset_control_get_exclusive - Lookup and obtain an exclusive reference
+ * to a reset controller.
* @node: device to be reset by the controller
* @id: reset line name
*
@@ -151,15 +151,16 @@ static inline struct reset_control *reset_control_get_optional(
*
* Use of id names is optional.
*/
-static inline struct reset_control *of_reset_control_get(
+static inline struct reset_control *of_reset_control_get_exclusive(
struct device_node *node, const char *id)
{
return __of_reset_control_get(node, id, 0, 0);
}
/**
- * of_reset_control_get_by_index - Lookup and obtain an exclusive reference to
- * a reset controller by index.
+ * of_reset_control_get_exclusive_by_index - Lookup and obtain an exclusive
+ * reference to a reset controller
+ * by index.
* @node: device to be reset by the controller
* @index: index of the reset controller
*
@@ -167,23 +168,27 @@ static inline struct reset_control *of_reset_control_get(
* in whatever order. Returns a struct reset_control or IS_ERR() condition
* containing errno.
*/
-static inline struct reset_control *of_reset_control_get_by_index(
+static inline struct reset_control *of_reset_control_get_exclusive_by_index(
struct device_node *node, int index)
{
return __of_reset_control_get(node, NULL, index, 0);
}
/**
- * devm_reset_control_get - resource managed reset_control_get()
+ * devm_reset_control_get_exclusive - resource managed
+ * reset_control_get_exclusive()
* @dev: device to be reset by the controller
* @id: reset line name
*
- * Managed reset_control_get(). For reset controllers returned from this
- * function, reset_control_put() is called automatically on driver detach.
- * See reset_control_get() for more information.
+ * Managed reset_control_get_exclusive(). For reset controllers returned
+ * from this function, reset_control_put() is called automatically on driver
+ * detach.
+ *
+ * See reset_control_get_exclusive() for more information.
*/
-static inline struct reset_control *__must_check devm_reset_control_get(
- struct device *dev, const char *id)
+static inline struct reset_control *
+__must_check devm_reset_control_get_exclusive(struct device *dev,
+ const char *id)
{
#ifndef CONFIG_RESET_CONTROLLER
WARN_ON(1);
@@ -206,23 +211,26 @@ static inline struct reset_control *devm_reset_control_get_shared(
return __devm_reset_control_get(dev, id, 0, 1);
}
-static inline struct reset_control *devm_reset_control_get_optional(
+static inline struct reset_control *devm_reset_control_get_optional_exclusive(
struct device *dev, const char *id)
{
return __devm_reset_control_get(dev, id, 0, 0);
}
/**
- * devm_reset_control_get_by_index - resource managed reset_control_get
+ * devm_reset_control_get_exclusive_by_index - resource managed
+ * reset_control_get_exclusive()
* @dev: device to be reset by the controller
* @index: index of the reset controller
*
- * Managed reset_control_get(). For reset controllers returned from this
- * function, reset_control_put() is called automatically on driver detach.
- * See reset_control_get() for more information.
+ * Managed reset_control_get_exclusive(). For reset controllers returned from
+ * this function, reset_control_put() is called automatically on driver
+ * detach.
+ *
+ * See reset_control_get_exclusive() for more information.
*/
-static inline struct reset_control *devm_reset_control_get_by_index(
- struct device *dev, int index)
+static inline struct reset_control *
+devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
{
return __devm_reset_control_get(dev, NULL, index, 0);
}
@@ -243,4 +251,54 @@ static inline struct reset_control *devm_reset_control_get_shared_by_index(
return __devm_reset_control_get(dev, NULL, index, 1);
}
+/*
+ * TEMPORARY calls to use during transition:
+ *
+ * of_reset_control_get() => of_reset_control_get_exclusive()
+ *
+ * These inline function calls will be removed once all consumers
+ * have been moved over to the new explicit API.
+ */
+static inline struct reset_control *reset_control_get(
+ struct device *dev, const char *id)
+{
+ return reset_control_get_exclusive(dev, id);
+}
+
+static inline struct reset_control *reset_control_get_optional(
+ struct device *dev, const char *id)
+{
+ return reset_control_get_optional_exclusive(dev, id);
+}
+
+static inline struct reset_control *of_reset_control_get(
+ struct device_node *node, const char *id)
+{
+ return of_reset_control_get_exclusive(node, id);
+}
+
+static inline struct reset_control *of_reset_control_get_by_index(
+ struct device_node *node, int index)
+{
+ return of_reset_control_get_exclusive_by_index(node, index);
+}
+
+static inline struct reset_control *devm_reset_control_get(
+ struct device *dev, const char *id)
+{
+ return devm_reset_control_get_exclusive(dev, id);
+}
+
+static inline struct reset_control *devm_reset_control_get_optional(
+ struct device *dev, const char *id)
+{
+ return devm_reset_control_get_optional_exclusive(dev, id);
+
+}
+
+static inline struct reset_control *devm_reset_control_get_by_index(
+ struct device *dev, int index)
+{
+ return devm_reset_control_get_exclusive_by_index(dev, index);
+}
#endif
--
2.8.3
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-06 18:00 +0200 |
| Subject | [PATCH 7/7] usb: dwc3: st: Inform the reset framework that our reset line may be shared |
| Message-ID | <rH56x-6VJ-25@gated-at.bofh.it> |
| In reply to | #1415239 |
On the STiH410 B2120 development board the MiPHY28lp shares its reset
line with the Synopsys DWC3 SuperSpeed (SS) USB 3.0 Dual-Role-Device
(DRD). New functionality in the reset subsystems forces consumers to
be explicit when requesting shared/exclusive reset lines.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/usb/dwc3/dwc3-st.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
index 5c0adb9..e77bacb 100644
--- a/drivers/usb/dwc3/dwc3-st.c
+++ b/drivers/usb/dwc3/dwc3-st.c
@@ -227,7 +227,8 @@ static int st_dwc3_probe(struct platform_device *pdev)
dev_vdbg(&pdev->dev, "glue-logic addr 0x%p, syscfg-reg offset 0x%x\n",
dwc3_data->glue_base, dwc3_data->syscfg_reg_off);
- dwc3_data->rstc_pwrdn = devm_reset_control_get(dev, "powerdown");
+ dwc3_data->rstc_pwrdn =
+ devm_reset_control_get_exclusive(dev, "powerdown");
if (IS_ERR(dwc3_data->rstc_pwrdn)) {
dev_err(&pdev->dev, "could not get power controller\n");
ret = PTR_ERR(dwc3_data->rstc_pwrdn);
@@ -237,7 +238,8 @@ static int st_dwc3_probe(struct platform_device *pdev)
/* Manage PowerDown */
reset_control_deassert(dwc3_data->rstc_pwrdn);
- dwc3_data->rstc_rst = devm_reset_control_get(dev, "softreset");
+ dwc3_data->rstc_rst =
+ devm_reset_control_get_shared(dev, "softreset");
if (IS_ERR(dwc3_data->rstc_rst)) {
dev_err(&pdev->dev, "could not get reset controller\n");
ret = PTR_ERR(dwc3_data->rstc_rst);
--
2.8.3
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-06 19:20 +0200 |
| Subject | [PATCH 9/10] usb: host: ehci-st: Inform the reset framework that our reset line may be shared |
| Message-ID | <rH6lY-7QH-23@gated-at.bofh.it> |
| In reply to | #1415243 |
On the STiH410 B2120 development board the ST EHCI IP shares its reset
line with the OHCI IP. New functionality in the reset subsystems forces
consumers to be explicit when requesting shared/exclusive reset lines.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/usb/host/ehci-st.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-st.c b/drivers/usb/host/ehci-st.c
index a94ed67..6cfce6f 100644
--- a/drivers/usb/host/ehci-st.c
+++ b/drivers/usb/host/ehci-st.c
@@ -206,7 +206,7 @@ static int st_ehci_platform_probe(struct platform_device *dev)
priv->clk48 = NULL;
}
- priv->pwr = devm_reset_control_get_optional(&dev->dev, "power");
+ priv->pwr = devm_reset_control_get_optional_shared(&dev->dev, "power");
if (IS_ERR(priv->pwr)) {
err = PTR_ERR(priv->pwr);
if (err == -EPROBE_DEFER)
@@ -214,7 +214,7 @@ static int st_ehci_platform_probe(struct platform_device *dev)
priv->pwr = NULL;
}
- priv->rst = devm_reset_control_get_optional(&dev->dev, "softreset");
+ priv->rst = devm_reset_control_get_optional_shared(&dev->dev, "softreset");
if (IS_ERR(priv->rst)) {
err = PTR_ERR(priv->rst);
if (err == -EPROBE_DEFER)
--
2.8.3
[toc] | [prev] | [next] | [standalone]
| From | Alan Stern <stern@rowland.harvard.edu> |
|---|---|
| Date | 2016-06-06 19:50 +0200 |
| Subject | Re: [PATCH 9/10] usb: host: ehci-st: Inform the reset framework that our reset line may be shared |
| Message-ID | <rH6OZ-80Q-13@gated-at.bofh.it> |
| In reply to | #1415300 |
On Mon, 6 Jun 2016, Lee Jones wrote: > On the STiH410 B2120 development board the ST EHCI IP shares its reset > line with the OHCI IP. New functionality in the reset subsystems forces > consumers to be explicit when requesting shared/exclusive reset lines. > > Signed-off-by: Lee Jones <lee.jones@linaro.org> For this andd the 10/10 patch: Acked-by: Alan Stern <stern@rowland.harvard.edu>
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-06 19:20 +0200 |
| Subject | [PATCH 8/10] phy: phy-stih407-usb: Inform the reset framework that our reset line may be shared |
| Message-ID | <rH6lY-7QH-21@gated-at.bofh.it> |
| In reply to | #1415243 |
On the STiH410 B2120 development board the ports on the Generic PHY
share their reset lines with each other. New functionality in the
reset subsystems forces consumers to be explicit when requesting
shared/exclusive reset lines.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/phy/phy-stih407-usb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/phy-stih407-usb.c b/drivers/phy/phy-stih407-usb.c
index 1d5ae5f..b1f44ab 100644
--- a/drivers/phy/phy-stih407-usb.c
+++ b/drivers/phy/phy-stih407-usb.c
@@ -105,13 +105,13 @@ static int stih407_usb2_picophy_probe(struct platform_device *pdev)
phy_dev->dev = dev;
dev_set_drvdata(dev, phy_dev);
- phy_dev->rstc = devm_reset_control_get(dev, "global");
+ phy_dev->rstc = devm_reset_control_get_shared(dev, "global");
if (IS_ERR(phy_dev->rstc)) {
dev_err(dev, "failed to ctrl picoPHY reset\n");
return PTR_ERR(phy_dev->rstc);
}
- phy_dev->rstport = devm_reset_control_get(dev, "port");
+ phy_dev->rstport = devm_reset_control_get_exclusive(dev, "port");
if (IS_ERR(phy_dev->rstport)) {
dev_err(dev, "failed to ctrl picoPHY reset\n");
return PTR_ERR(phy_dev->rstport);
--
2.8.3
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-06 19:20 +0200 |
| Subject | [PATCH 10/10] usb: host: ohci-st: Inform the reset framework that our reset line may be shared |
| Message-ID | <rH6lZ-7QH-57@gated-at.bofh.it> |
| In reply to | #1415304 |
On the STiH410 B2120 development board the ST EHCI IP shares its reset
line with the OHCI IP. New functionality in the reset subsystems forces
consumers to be explicit when requesting shared/exclusive reset lines.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/usb/host/ohci-st.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/host/ohci-st.c b/drivers/usb/host/ohci-st.c
index acf2eb2..1f1f23c 100644
--- a/drivers/usb/host/ohci-st.c
+++ b/drivers/usb/host/ohci-st.c
@@ -188,13 +188,13 @@ static int st_ohci_platform_probe(struct platform_device *dev)
priv->clk48 = NULL;
}
- priv->pwr = devm_reset_control_get_optional(&dev->dev, "power");
+ priv->pwr = devm_reset_control_get_optional_shared(&dev->dev, "power");
if (IS_ERR(priv->pwr)) {
err = PTR_ERR(priv->pwr);
goto err_put_clks;
}
- priv->rst = devm_reset_control_get_optional(&dev->dev, "softreset");
+ priv->rst = devm_reset_control_get_optional_shared(&dev->dev, "softreset");
if (IS_ERR(priv->rst)) {
err = PTR_ERR(priv->rst);
goto err_put_clks;
--
2.8.3
[toc] | [prev] | [next] | [standalone]
| From | Peter Griffin <peter.griffin@linaro.org> |
|---|---|
| Date | 2016-06-07 10:40 +0200 |
| Subject | Re: [STLinux Kernel] [PATCH 8/10] phy: phy-stih407-usb: Inform the reset framework that our reset line may be shared |
| Message-ID | <rHkIh-nf-1@gated-at.bofh.it> |
| In reply to | #1415304 |
On Mon, 06 Jun 2016, Lee Jones wrote: > On the STiH410 B2120 development board the ports on the Generic PHY > share their reset lines with each other. New functionality in the > reset subsystems forces consumers to be explicit when requesting > shared/exclusive reset lines. > > Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Peter Griffin <peter.griffin@linaro.org>
[toc] | [prev] | [next] | [standalone]
| From | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| Date | 2016-06-07 11:10 +0200 |
| Subject | Re: [PATCH 8/10] phy: phy-stih407-usb: Inform the reset framework that our reset line may be shared |
| Message-ID | <rHlbk-Mt-19@gated-at.bofh.it> |
| In reply to | #1415304 |
On Monday 06 June 2016 10:38 PM, Lee Jones wrote:
> On the STiH410 B2120 development board the ports on the Generic PHY
> share their reset lines with each other. New functionality in the
> reset subsystems forces consumers to be explicit when requesting
> shared/exclusive reset lines.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
> drivers/phy/phy-stih407-usb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/phy-stih407-usb.c b/drivers/phy/phy-stih407-usb.c
> index 1d5ae5f..b1f44ab 100644
> --- a/drivers/phy/phy-stih407-usb.c
> +++ b/drivers/phy/phy-stih407-usb.c
> @@ -105,13 +105,13 @@ static int stih407_usb2_picophy_probe(struct platform_device *pdev)
> phy_dev->dev = dev;
> dev_set_drvdata(dev, phy_dev);
>
> - phy_dev->rstc = devm_reset_control_get(dev, "global");
> + phy_dev->rstc = devm_reset_control_get_shared(dev, "global");
> if (IS_ERR(phy_dev->rstc)) {
> dev_err(dev, "failed to ctrl picoPHY reset\n");
> return PTR_ERR(phy_dev->rstc);
> }
>
> - phy_dev->rstport = devm_reset_control_get(dev, "port");
> + phy_dev->rstport = devm_reset_control_get_exclusive(dev, "port");
> if (IS_ERR(phy_dev->rstport)) {
> dev_err(dev, "failed to ctrl picoPHY reset\n");
> return PTR_ERR(phy_dev->rstport);
>
[toc] | [prev] | [next] | [standalone]
| From | Peter Griffin <peter.griffin@linaro.org> |
|---|---|
| Date | 2016-06-07 10:50 +0200 |
| Subject | Re: [STLinux Kernel] [PATCH 7/7] usb: dwc3: st: Inform the reset framework that our reset line may be shared |
| Message-ID | <rHkRY-qE-11@gated-at.bofh.it> |
| In reply to | #1415243 |
Hi Lee, On Mon, 06 Jun 2016, Lee Jones wrote: > On the STiH410 B2120 development board the MiPHY28lp shares its reset > line with the Synopsys DWC3 SuperSpeed (SS) USB 3.0 Dual-Role-Device > (DRD). New functionality in the reset subsystems forces consumers to > be explicit when requesting shared/exclusive reset lines. > > Signed-off-by: Lee Jones <lee.jones@linaro.org> > --- > drivers/usb/dwc3/dwc3-st.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) Acked-by: Peter Griffin <peter.griffin@linaro.org>
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-06 18:00 +0200 |
| Subject | [PATCH 5/7] reset: TRIVIAL: Add line break at same place for similar APIs |
| Message-ID | <rH56y-6VJ-29@gated-at.bofh.it> |
| In reply to | #1415239 |
Standardise the way inline functions:
devm_reset_control_get_shared_by_index
devm_reset_control_get_exclusive_by_index
... are formatted.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
include/linux/reset.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/reset.h b/include/linux/reset.h
index c358106..45a4abe 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -310,8 +310,8 @@ devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
* this function, reset_control_put() is called automatically on driver detach.
* See reset_control_get_shared() for more information.
*/
-static inline struct reset_control *devm_reset_control_get_shared_by_index(
- struct device *dev, int index)
+static inline struct reset_control *
+devm_reset_control_get_shared_by_index(struct device *dev, int index)
{
return __devm_reset_control_get(dev, NULL, index, 1);
}
--
2.8.3
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-06 18:10 +0200 |
| Subject | [PATCH 1/7] reset: Reorder inline reset_control_get*() wrappers |
| Message-ID | <rH5gd-7ea-5@gated-at.bofh.it> |
| In reply to | #1415239 |
We're about to split the current API into two, where consumers will
be forced to be explicit when requesting reset lines. The choice
will be to either the call the *_exclusive or *_shared variant
depending on whether they can actually tolorate not being asserted
when that request is made.
The new API will look like this once reorded and complete:
reset_control_get_exclusive()
reset_control_get_shared()
reset_control_get_optional_exclusive()
reset_control_get_optional_shared()
of_reset_control_get_exclusive()
of_reset_control_get_shared()
of_reset_control_get_exclusive_by_index()
of_reset_control_get_shared_by_index()
devm_reset_control_get_exclusive()
devm_reset_control_get_shared()
devm_reset_control_get_optional_exclusive()
devm_reset_control_get_optional_shared()
devm_reset_control_get_exclusive_by_index()
devm_reset_control_get_shared_by_index()
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
include/linux/reset.h | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/include/linux/reset.h b/include/linux/reset.h
index ec0306ce..33eaf11 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -107,12 +107,6 @@ static inline struct reset_control *__must_check reset_control_get(
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
}
-static inline struct reset_control *reset_control_get_optional(
- struct device *dev, const char *id)
-{
- return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
-}
-
/**
* reset_control_get_shared - Lookup and obtain a shared reference to a
* reset controller.
@@ -141,6 +135,12 @@ static inline struct reset_control *reset_control_get_shared(
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
}
+static inline struct reset_control *reset_control_get_optional(
+ struct device *dev, const char *id)
+{
+ return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
+}
+
/**
* of_reset_control_get - Lookup and obtain an exclusive reference to a
* reset controller.
@@ -191,6 +191,21 @@ static inline struct reset_control *__must_check devm_reset_control_get(
return __devm_reset_control_get(dev, id, 0, 0);
}
+/**
+ * devm_reset_control_get_shared - resource managed reset_control_get_shared()
+ * @dev: device to be reset by the controller
+ * @id: reset line name
+ *
+ * Managed reset_control_get_shared(). For reset controllers returned from
+ * this function, reset_control_put() is called automatically on driver detach.
+ * See reset_control_get_shared() for more information.
+ */
+static inline struct reset_control *devm_reset_control_get_shared(
+ struct device *dev, const char *id)
+{
+ return __devm_reset_control_get(dev, id, 0, 1);
+}
+
static inline struct reset_control *devm_reset_control_get_optional(
struct device *dev, const char *id)
{
@@ -213,21 +228,6 @@ static inline struct reset_control *devm_reset_control_get_by_index(
}
/**
- * devm_reset_control_get_shared - resource managed reset_control_get_shared()
- * @dev: device to be reset by the controller
- * @id: reset line name
- *
- * Managed reset_control_get_shared(). For reset controllers returned from
- * this function, reset_control_put() is called automatically on driver detach.
- * See reset_control_get_shared() for more information.
- */
-static inline struct reset_control *devm_reset_control_get_shared(
- struct device *dev, const char *id)
-{
- return __devm_reset_control_get(dev, id, 0, 1);
-}
-
-/**
* devm_reset_control_get_shared_by_index - resource managed
* reset_control_get_shared
* @dev: device to be reset by the controller
--
2.8.3
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-06 18:10 +0200 |
| Subject | [PATCH 3/7] reset: Supply *_shared variant calls when using of_* API |
| Message-ID | <rH5gd-7ea-9@gated-at.bofh.it> |
| In reply to | #1415239 |
Consumers need to be able to specify whether they are requesting an
'exclusive' or 'shared' reset line no matter which API (of_*, devm_*,
etc) they are using. This change allows users of the of_* API in
particular to specify that their request is for a 'shared' line.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
include/linux/reset.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/include/linux/reset.h b/include/linux/reset.h
index 9cf4cf3..fd69240 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -158,6 +158,31 @@ static inline struct reset_control *of_reset_control_get_exclusive(
}
/**
+ * of_reset_control_get_shared - Lookup and obtain an shared reference
+ * to a reset controller.
+ * @node: device to be reset by the controller
+ * @id: reset line name
+ *
+ * When a reset-control is shared, the behavior of reset_control_assert /
+ * deassert is changed, the reset-core will keep track of a deassert_count
+ * and only (re-)assert the reset after reset_control_assert has been called
+ * as many times as reset_control_deassert was called. Also see the remark
+ * about shared reset-controls in the reset_control_assert docs.
+ *
+ * Calling reset_control_assert without first calling reset_control_deassert
+ * is not allowed on a shared reset control. Calling reset_control_reset is
+ * also not allowed on a shared reset control.
+ * Returns a struct reset_control or IS_ERR() condition containing errno.
+ *
+ * Use of id names is optional.
+ */
+static inline struct reset_control *of_reset_control_get_shared(
+ struct device_node *node, const char *id)
+{
+ return __of_reset_control_get(node, id, 0, 1);
+}
+
+/**
* of_reset_control_get_exclusive_by_index - Lookup and obtain an exclusive
* reference to a reset controller
* by index.
@@ -175,6 +200,34 @@ static inline struct reset_control *of_reset_control_get_exclusive_by_index(
}
/**
+ * of_reset_control_get_shared_by_index - Lookup and obtain an shared
+ * reference to a reset controller
+ * by index.
+ * @node: device to be reset by the controller
+ * @index: index of the reset controller
+ *
+ * When a reset-control is shared, the behavior of reset_control_assert /
+ * deassert is changed, the reset-core will keep track of a deassert_count
+ * and only (re-)assert the reset after reset_control_assert has been called
+ * as many times as reset_control_deassert was called. Also see the remark
+ * about shared reset-controls in the reset_control_assert docs.
+ *
+ * Calling reset_control_assert without first calling reset_control_deassert
+ * is not allowed on a shared reset control. Calling reset_control_reset is
+ * also not allowed on a shared reset control.
+ * Returns a struct reset_control or IS_ERR() condition containing errno.
+ *
+ * This is to be used to perform a list of resets for a device or power domain
+ * in whatever order. Returns a struct reset_control or IS_ERR() condition
+ * containing errno.
+ */
+static inline struct reset_control *of_reset_control_get_shared_by_index(
+ struct device_node *node, int index)
+{
+ return __of_reset_control_get(node, NULL, index, 1);
+}
+
+/**
* devm_reset_control_get_exclusive - resource managed
* reset_control_get_exclusive()
* @dev: device to be reset by the controller
--
2.8.3
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-06 18:10 +0200 |
| Subject | [PATCH 4/7] reset: Supply *_shared variant calls when using *_optional APIs |
| Message-ID | <rH5ge-7ea-29@gated-at.bofh.it> |
| In reply to | #1415239 |
Consumers need to be able to specify whether they are requesting an
'exclusive' or 'shared' reset line no matter which API (of_*, devm_*,
etc) they are using. This change allows users of the optional_* API
in particular to specify that their request is for a 'shared' line.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
include/linux/reset.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/linux/reset.h b/include/linux/reset.h
index fd69240..c358106 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -141,6 +141,12 @@ static inline struct reset_control *reset_control_get_optional_exclusive(
return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0);
}
+static inline struct reset_control *reset_control_get_optional_shared(
+ struct device *dev, const char *id)
+{
+ return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
+}
+
/**
* of_reset_control_get_exclusive - Lookup and obtain an exclusive reference
* to a reset controller.
@@ -270,6 +276,12 @@ static inline struct reset_control *devm_reset_control_get_optional_exclusive(
return __devm_reset_control_get(dev, id, 0, 0);
}
+static inline struct reset_control *devm_reset_control_get_optional_shared(
+ struct device *dev, const char *id)
+{
+ return __devm_reset_control_get(dev, id, 0, 1);
+}
+
/**
* devm_reset_control_get_exclusive_by_index - resource managed
* reset_control_get_exclusive()
--
2.8.3
[toc] | [prev] | [next] | [standalone]
| From | Peter Griffin <peter.griffin@linaro.org> |
|---|---|
| Date | 2016-06-07 10:50 +0200 |
| Subject | Re: [STLinux Kernel] [PATCH 0/7] reset: Consumers to explicitly request 'exclusive' or 'shared' lines |
| Message-ID | <rHkRY-qE-9@gated-at.bofh.it> |
| In reply to | #1415239 |
Hi, On Mon, 06 Jun 2016, Lee Jones wrote: > Phasing out generic reset line requests enables us to make some better > decisions on when and how to (de)assert said lines. If an 'exclusive' > line is requested, we know a device *requires* a reset and that it's > preferable to act upon a request right away. However, if a 'shared' > reset line is requested, we can reasonably assume sure that placing a > device into reset isn't a hard requirement, but probably a measure to > save power and is thus able to cope with not being asserted if another > device is still in use. > > In order allow gentle adoption and not to forcing all consumers to > move to the API immediately, causing administration headache between > subsystems, this patch adds some temporary stand-in shim-calls. This > will ease the burden at merge time and allow subsystems to migrate over > to the new API in a more realistic time-frame. Is the intention that this series will be taken into the next -rc? As the introduction of shared resets in reset subsystem has caused regressions on STi platforms. regards, Peter.
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-07 11:20 +0200 |
| Subject | Re: [STLinux Kernel] [PATCH 0/7] reset: Consumers to explicitly request 'exclusive' or 'shared' lines |
| Message-ID | <rHll0-PT-25@gated-at.bofh.it> |
| In reply to | #1415879 |
On Tue, 07 Jun 2016, Peter Griffin wrote: > Hi, > > On Mon, 06 Jun 2016, Lee Jones wrote: > > > Phasing out generic reset line requests enables us to make some better > > decisions on when and how to (de)assert said lines. If an 'exclusive' > > line is requested, we know a device *requires* a reset and that it's > > preferable to act upon a request right away. However, if a 'shared' > > reset line is requested, we can reasonably assume sure that placing a > > device into reset isn't a hard requirement, but probably a measure to > > save power and is thus able to cope with not being asserted if another > > device is still in use. > > > > In order allow gentle adoption and not to forcing all consumers to > > move to the API immediately, causing administration headache between > > subsystems, this patch adds some temporary stand-in shim-calls. This > > will ease the burden at merge time and allow subsystems to migrate over > > to the new API in a more realistic time-frame. > > Is the intention that this series will be taken into the next -rc? > > As the introduction of shared resets in reset subsystem has caused regressions > on STi platforms. Yes, which is why it has a Fixes: tag. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
[toc] | [prev] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-06-07 11:30 +0200 |
| Subject | Re: [STLinux Kernel] [PATCH 0/7] reset: Consumers to explicitly request 'exclusive' or 'shared' lines |
| Message-ID | <rHluG-Te-11@gated-at.bofh.it> |
| In reply to | #1415907 |
On Tue, 07 Jun 2016, Lee Jones wrote: > On Tue, 07 Jun 2016, Peter Griffin wrote: > > > Hi, > > > > On Mon, 06 Jun 2016, Lee Jones wrote: > > > > > Phasing out generic reset line requests enables us to make some better > > > decisions on when and how to (de)assert said lines. If an 'exclusive' > > > line is requested, we know a device *requires* a reset and that it's > > > preferable to act upon a request right away. However, if a 'shared' > > > reset line is requested, we can reasonably assume sure that placing a > > > device into reset isn't a hard requirement, but probably a measure to > > > save power and is thus able to cope with not being asserted if another > > > device is still in use. > > > > > > In order allow gentle adoption and not to forcing all consumers to > > > move to the API immediately, causing administration headache between > > > subsystems, this patch adds some temporary stand-in shim-calls. This > > > will ease the burden at merge time and allow subsystems to migrate over > > > to the new API in a more realistic time-frame. > > > > Is the intention that this series will be taken into the next -rc? > > > > As the introduction of shared resets in reset subsystem has caused regressions > > on STi platforms. > > Yes, which is why it has a Fixes: tag. Ah wait. I thought this was the shared-memory patch. More haste, less speed and all that. I guess it should really go into the -rcs, yes. Since Hans' patch actually breaks a lot of devices. I'm pretty surprised a patch capable of this much damage was actually accepted to be honest. A better approach would have been to issue a warning, but keep the semantics the same for at least a couple of releases. However, I guess the damage has been done now, so let's do what we can do fix it. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web