Re: [PATCH v2] usb: phy: move some error messages to dev_dbg
Hello. On 01/27/2014 10:23 PM, Josh Boyer wrote: the PHY layer is supposed to be optional, considering some PHY have no control bus for SW to poke around. After commit 1ae5799 (usb: hcd: Initialize USB phy if needed) any HCD which didn't provide a PHY driver would emit annoying error messages. In this patch we're decreasing those messages to dev_dbg for debugging only and so we know where they're coming from. Reported-by: Josh Boyer jwbo...@fedoraproject.org Signed-off-by: Felipe Balbi ba...@ti.com Signed-off-by: Josh Boyer jwbo...@fedoraproject.org --- v2: Switch to using dev_dbg drivers/usb/phy/phy.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index e6f61e4..db18011 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -130,7 +130,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type) phy = __usb_find_phy(phy_list, type); if (IS_ERR(phy) || !try_module_get(phy-dev-driver-owner)) { - pr_err(unable to find transceiver of type %s\n, + dev_dbg(phy-dev, unable to find transceiver of type %s\n, 'phy' is possibly invalid (error ptr) at this point, you cannot dereference it. usb_phy_type_string(type)); goto err0; } @@ -228,7 +228,7 @@ struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) phy = __usb_find_phy_dev(dev, phy_bind_list, index); if (IS_ERR(phy) || !try_module_get(phy-dev-driver-owner)) { - pr_err(unable to find transceiver\n); + dev_dbg(dev, unable to find transceiver\n); Same here. WBR, Sergei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] usb: phy: move some error messages to dev_dbg
On Mon, Jan 27, 2014 at 3:44 PM, Sergei Shtylyov sergei.shtyl...@cogentembedded.com wrote: Hello. On 01/27/2014 10:23 PM, Josh Boyer wrote: the PHY layer is supposed to be optional, considering some PHY have no control bus for SW to poke around. After commit 1ae5799 (usb: hcd: Initialize USB phy if needed) any HCD which didn't provide a PHY driver would emit annoying error messages. In this patch we're decreasing those messages to dev_dbg for debugging only and so we know where they're coming from. Reported-by: Josh Boyer jwbo...@fedoraproject.org Signed-off-by: Felipe Balbi ba...@ti.com Signed-off-by: Josh Boyer jwbo...@fedoraproject.org --- v2: Switch to using dev_dbg drivers/usb/phy/phy.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index e6f61e4..db18011 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -130,7 +130,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type) phy = __usb_find_phy(phy_list, type); if (IS_ERR(phy) || !try_module_get(phy-dev-driver-owner)) { - pr_err(unable to find transceiver of type %s\n, + dev_dbg(phy-dev, unable to find transceiver of type %s\n, 'phy' is possibly invalid (error ptr) at this point, you cannot dereference it. Oh, yes. Duh, I should have spotted that. Felipe, can we just go with your original patch? It avoids having to worry about the dev parameter to dev_dbg. josh -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] usb: phy: move some error messages to dev_dbg
On 01/27/2014 11:44 PM, Sergei Shtylyov wrote: the PHY layer is supposed to be optional, considering some PHY have no control bus for SW to poke around. After commit 1ae5799 (usb: hcd: Initialize USB phy if needed) any HCD which didn't provide a PHY driver would emit annoying error messages. In this patch we're decreasing those messages to dev_dbg for debugging only and so we know where they're coming from. Reported-by: Josh Boyer jwbo...@fedoraproject.org Signed-off-by: Felipe Balbi ba...@ti.com Signed-off-by: Josh Boyer jwbo...@fedoraproject.org --- v2: Switch to using dev_dbg drivers/usb/phy/phy.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index e6f61e4..db18011 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -130,7 +130,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type) phy = __usb_find_phy(phy_list, type); if (IS_ERR(phy) || !try_module_get(phy-dev-driver-owner)) { -pr_err(unable to find transceiver of type %s\n, +dev_dbg(phy-dev, unable to find transceiver of type %s\n, 'phy' is possibly invalid (error ptr) at this point, you cannot dereference it. usb_phy_type_string(type)); goto err0; } @@ -228,7 +228,7 @@ struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) phy = __usb_find_phy_dev(dev, phy_bind_list, index); if (IS_ERR(phy) || !try_module_get(phy-dev-driver-owner)) { -pr_err(unable to find transceiver\n); +dev_dbg(dev, unable to find transceiver\n); Same here. Oh, not at all the same, sorry about that. WBR, Sergei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] usb: phy: move some error messages to dev_dbg
Hi, On Mon, Jan 27, 2014 at 11:44:16PM +0300, Sergei Shtylyov wrote: diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index e6f61e4..db18011 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -130,7 +130,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type) phy = __usb_find_phy(phy_list, type); if (IS_ERR(phy) || !try_module_get(phy-dev-driver-owner)) { -pr_err(unable to find transceiver of type %s\n, +dev_dbg(phy-dev, unable to find transceiver of type %s\n, 'phy' is possibly invalid (error ptr) at this point, you cannot dereference it. right, this one can't be a dev_dbg(), unfortunately. @@ -228,7 +228,7 @@ struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) phy = __usb_find_phy_dev(dev, phy_bind_list, index); if (IS_ERR(phy) || !try_module_get(phy-dev-driver-owner)) { -pr_err(unable to find transceiver\n); +dev_dbg(dev, unable to find transceiver\n); Same here. here he's using the caller's dev pointer, which is just fine. -- balbi signature.asc Description: Digital signature
Re: [PATCH v2] usb: phy: move some error messages to dev_dbg
On Mon, Jan 27, 2014 at 02:46:40PM -0500, Josh Boyer wrote: On Mon, Jan 27, 2014 at 3:44 PM, Sergei Shtylyov sergei.shtyl...@cogentembedded.com wrote: Hello. On 01/27/2014 10:23 PM, Josh Boyer wrote: the PHY layer is supposed to be optional, considering some PHY have no control bus for SW to poke around. After commit 1ae5799 (usb: hcd: Initialize USB phy if needed) any HCD which didn't provide a PHY driver would emit annoying error messages. In this patch we're decreasing those messages to dev_dbg for debugging only and so we know where they're coming from. Reported-by: Josh Boyer jwbo...@fedoraproject.org Signed-off-by: Felipe Balbi ba...@ti.com Signed-off-by: Josh Boyer jwbo...@fedoraproject.org --- v2: Switch to using dev_dbg drivers/usb/phy/phy.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index e6f61e4..db18011 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -130,7 +130,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type) phy = __usb_find_phy(phy_list, type); if (IS_ERR(phy) || !try_module_get(phy-dev-driver-owner)) { - pr_err(unable to find transceiver of type %s\n, + dev_dbg(phy-dev, unable to find transceiver of type %s\n, 'phy' is possibly invalid (error ptr) at this point, you cannot dereference it. Oh, yes. Duh, I should have spotted that. Felipe, can we just go with your original patch? It avoids having to worry about the dev parameter to dev_dbg. fine by me, no problem. Can I get a Tested-by or Reviewed-by on that ? (Tested-by gets more points heh) -- balbi signature.asc Description: Digital signature
Re: [PATCH v2] usb: phy: move some error messages to dev_dbg
On Mon, 27 Jan 2014, Josh Boyer wrote: On Mon, Jan 27, 2014 at 3:44 PM, Sergei Shtylyov sergei.shtyl...@cogentembedded.com wrote: Hello. On 01/27/2014 10:23 PM, Josh Boyer wrote: the PHY layer is supposed to be optional, considering some PHY have no control bus for SW to poke around. After commit 1ae5799 (usb: hcd: Initialize USB phy if needed) any HCD which didn't provide a PHY driver would emit annoying error messages. In this patch we're decreasing those messages to dev_dbg for debugging only and so we know where they're coming from. Reported-by: Josh Boyer jwbo...@fedoraproject.org Signed-off-by: Felipe Balbi ba...@ti.com Signed-off-by: Josh Boyer jwbo...@fedoraproject.org --- v2: Switch to using dev_dbg drivers/usb/phy/phy.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index e6f61e4..db18011 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -130,7 +130,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type) phy = __usb_find_phy(phy_list, type); if (IS_ERR(phy) || !try_module_get(phy-dev-driver-owner)) { - pr_err(unable to find transceiver of type %s\n, + dev_dbg(phy-dev, unable to find transceiver of type %s\n, 'phy' is possibly invalid (error ptr) at this point, you cannot dereference it. Oh, yes. Duh, I should have spotted that. Felipe, can we just go with your original patch? It avoids having to worry about the dev parameter to dev_dbg. Josh, don't worry about it. Simply rewrite the patch using pr_debug here, but leave the second instance as dev_dbg. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] usb: phy: move some error messages to dev_dbg
On Mon, Jan 27, 2014 at 3:27 PM, Alan Stern st...@rowland.harvard.edu wrote: On Mon, 27 Jan 2014, Josh Boyer wrote: On Mon, Jan 27, 2014 at 3:44 PM, Sergei Shtylyov sergei.shtyl...@cogentembedded.com wrote: Hello. On 01/27/2014 10:23 PM, Josh Boyer wrote: the PHY layer is supposed to be optional, considering some PHY have no control bus for SW to poke around. After commit 1ae5799 (usb: hcd: Initialize USB phy if needed) any HCD which didn't provide a PHY driver would emit annoying error messages. In this patch we're decreasing those messages to dev_dbg for debugging only and so we know where they're coming from. Reported-by: Josh Boyer jwbo...@fedoraproject.org Signed-off-by: Felipe Balbi ba...@ti.com Signed-off-by: Josh Boyer jwbo...@fedoraproject.org --- v2: Switch to using dev_dbg drivers/usb/phy/phy.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index e6f61e4..db18011 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -130,7 +130,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type) phy = __usb_find_phy(phy_list, type); if (IS_ERR(phy) || !try_module_get(phy-dev-driver-owner)) { - pr_err(unable to find transceiver of type %s\n, + dev_dbg(phy-dev, unable to find transceiver of type %s\n, 'phy' is possibly invalid (error ptr) at this point, you cannot dereference it. Oh, yes. Duh, I should have spotted that. Felipe, can we just go with your original patch? It avoids having to worry about the dev parameter to dev_dbg. Josh, don't worry about it. Simply rewrite the patch using pr_debug here, but leave the second instance as dev_dbg. Yeah, not a big deal. I can send a fixed up patch, but it likely won't be until tomorrow. In the meantime, I tested Felipe's patch and replied accordingly. josh -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html