All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <Peter.Chen@freescale.com>
To: Antoine Tenart <antoine.tenart@free-electrons.com>
Cc: "sebastian.hesselbarth@gmail.com"
	<sebastian.hesselbarth@gmail.com>, "balbi@ti.com" <balbi@ti.com>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"alexandre.belloni@free-electrons.com" 
	<alexandre.belloni@free-electrons.com>,
	"thomas.petazzoni@free-electrons.com" 
	<thomas.petazzoni@free-electrons.com>,
	"zmxu@marvell.com" <zmxu@marvell.com>,
	"jszhang@marvell.com" <jszhang@marvell.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v4 07/12] usb: chipidea: add a usb2 driver for ci13xxx
Date: Fri, 12 Sep 2014 00:05:55 +0000	[thread overview]
Message-ID: <600c4437f5d14520931aabc242fd69f4@BN1PR0301MB0772.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20140911153119.GA11275@kwain>


 
> On Thu, Sep 11, 2014 at 09:07:10AM +0800, Peter Chen wrote:
> > On Wed, Sep 03, 2014 at 09:48:26AM +0200, Antoine Tenart wrote:
> > > +
> > > +static int ci_hdrc_usb2_dt_probe(struct device *dev,
> > > +				 struct ci_hdrc_platform_data *ci_pdata) {
> > > +	ci_pdata->phy = of_phy_get(dev->of_node, 0);
> > > +	if (IS_ERR(ci_pdata->phy)) {
> > > +		if (PTR_ERR(ci_pdata->phy) == -EPROBE_DEFER)
> > > +			return -EPROBE_DEFER;
> > > +
> > > +		/* PHY is optional */
> > > +		ci_pdata->phy = NULL;
> > > +	}
> > > +
> > > +	return 0;
> > > +}
> >
> > You may also need to consider usb_phy case.
> 
> Don't we try using the generic PHY framework for new drivers?
> 
> Since there is no need for supporting an usb_phy case I don't think we have to
> consider this case yet. And no doing so could encourage people to add PHY
> drivers to the common PHY framework.
> 

If the common PHY framework is the only right way in future, you don't
need to change it.

> > > +
> > > +	if (dev->of_node) {
> > > +		ret = ci_hdrc_usb2_dt_probe(dev, ci_pdata);
> > > +		if (ret)
> > > +			return ret;
> > > +	} else {
> > > +		ret = dma_set_mask_and_coherent(&pdev->dev,
> DMA_BIT_MASK(32));
> > > +		if (ret)
> > > +			return ret;
> > > +	}
> >
> > You may need to do clk_disable_unprepare for above error cases.
> 
> Sure, I'll fix that.
> 
> > > +
> > > +	ci_pdata->name = dev_name(&pdev->dev);
> > > +
> > > +	priv->ci_pdev = ci_hdrc_add_device(dev, pdev->resource,
> > > +					   pdev->num_resources, ci_pdata);
> > > +	if (IS_ERR(priv->ci_pdev)) {
> > > +		ret = PTR_ERR(priv->ci_pdev);
> > > +		if (ret != -EPROBE_DEFER)
> > > +			dev_err(dev,
> > > +				"failed to register ci_hdrc platform
> device: %d\n",
> > > +				ret);
> >
> > Why you don't want the error message for deferral probe?
> 
> A driver can return an EPROBE_DEFER error and still probe successfully later.
> This would be confusing to have this kind of error message in this case. And
> when a driver returns -EPROBE_DEFER, there is an error message already.
> 

OK, agree.

Peter

WARNING: multiple messages have this Message-ID (diff)
From: Peter Chen <Peter.Chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: Antoine Tenart
	<antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: "sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"balbi-l0cyMroinI0@public.gmane.org"
	<balbi-l0cyMroinI0@public.gmane.org>,
	"p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org"
	<p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	"alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org"
	<alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	"thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org"
	<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	"zmxu-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org"
	<zmxu-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>,
	"jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org"
	<jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: RE: [PATCH v4 07/12] usb: chipidea: add a usb2 driver for ci13xxx
Date: Fri, 12 Sep 2014 00:05:55 +0000	[thread overview]
Message-ID: <600c4437f5d14520931aabc242fd69f4@BN1PR0301MB0772.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20140911153119.GA11275@kwain>


 
> On Thu, Sep 11, 2014 at 09:07:10AM +0800, Peter Chen wrote:
> > On Wed, Sep 03, 2014 at 09:48:26AM +0200, Antoine Tenart wrote:
> > > +
> > > +static int ci_hdrc_usb2_dt_probe(struct device *dev,
> > > +				 struct ci_hdrc_platform_data *ci_pdata) {
> > > +	ci_pdata->phy = of_phy_get(dev->of_node, 0);
> > > +	if (IS_ERR(ci_pdata->phy)) {
> > > +		if (PTR_ERR(ci_pdata->phy) == -EPROBE_DEFER)
> > > +			return -EPROBE_DEFER;
> > > +
> > > +		/* PHY is optional */
> > > +		ci_pdata->phy = NULL;
> > > +	}
> > > +
> > > +	return 0;
> > > +}
> >
> > You may also need to consider usb_phy case.
> 
> Don't we try using the generic PHY framework for new drivers?
> 
> Since there is no need for supporting an usb_phy case I don't think we have to
> consider this case yet. And no doing so could encourage people to add PHY
> drivers to the common PHY framework.
> 

If the common PHY framework is the only right way in future, you don't
need to change it.

> > > +
> > > +	if (dev->of_node) {
> > > +		ret = ci_hdrc_usb2_dt_probe(dev, ci_pdata);
> > > +		if (ret)
> > > +			return ret;
> > > +	} else {
> > > +		ret = dma_set_mask_and_coherent(&pdev->dev,
> DMA_BIT_MASK(32));
> > > +		if (ret)
> > > +			return ret;
> > > +	}
> >
> > You may need to do clk_disable_unprepare for above error cases.
> 
> Sure, I'll fix that.
> 
> > > +
> > > +	ci_pdata->name = dev_name(&pdev->dev);
> > > +
> > > +	priv->ci_pdev = ci_hdrc_add_device(dev, pdev->resource,
> > > +					   pdev->num_resources, ci_pdata);
> > > +	if (IS_ERR(priv->ci_pdev)) {
> > > +		ret = PTR_ERR(priv->ci_pdev);
> > > +		if (ret != -EPROBE_DEFER)
> > > +			dev_err(dev,
> > > +				"failed to register ci_hdrc platform
> device: %d\n",
> > > +				ret);
> >
> > Why you don't want the error message for deferral probe?
> 
> A driver can return an EPROBE_DEFER error and still probe successfully later.
> This would be confusing to have this kind of error message in this case. And
> when a driver returns -EPROBE_DEFER, there is an error message already.
> 

OK, agree.

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

WARNING: multiple messages have this Message-ID (diff)
From: Peter.Chen@freescale.com (Peter Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 07/12] usb: chipidea: add a usb2 driver for ci13xxx
Date: Fri, 12 Sep 2014 00:05:55 +0000	[thread overview]
Message-ID: <600c4437f5d14520931aabc242fd69f4@BN1PR0301MB0772.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20140911153119.GA11275@kwain>


 
> On Thu, Sep 11, 2014 at 09:07:10AM +0800, Peter Chen wrote:
> > On Wed, Sep 03, 2014 at 09:48:26AM +0200, Antoine Tenart wrote:
> > > +
> > > +static int ci_hdrc_usb2_dt_probe(struct device *dev,
> > > +				 struct ci_hdrc_platform_data *ci_pdata) {
> > > +	ci_pdata->phy = of_phy_get(dev->of_node, 0);
> > > +	if (IS_ERR(ci_pdata->phy)) {
> > > +		if (PTR_ERR(ci_pdata->phy) == -EPROBE_DEFER)
> > > +			return -EPROBE_DEFER;
> > > +
> > > +		/* PHY is optional */
> > > +		ci_pdata->phy = NULL;
> > > +	}
> > > +
> > > +	return 0;
> > > +}
> >
> > You may also need to consider usb_phy case.
> 
> Don't we try using the generic PHY framework for new drivers?
> 
> Since there is no need for supporting an usb_phy case I don't think we have to
> consider this case yet. And no doing so could encourage people to add PHY
> drivers to the common PHY framework.
> 

If the common PHY framework is the only right way in future, you don't
need to change it.

> > > +
> > > +	if (dev->of_node) {
> > > +		ret = ci_hdrc_usb2_dt_probe(dev, ci_pdata);
> > > +		if (ret)
> > > +			return ret;
> > > +	} else {
> > > +		ret = dma_set_mask_and_coherent(&pdev->dev,
> DMA_BIT_MASK(32));
> > > +		if (ret)
> > > +			return ret;
> > > +	}
> >
> > You may need to do clk_disable_unprepare for above error cases.
> 
> Sure, I'll fix that.
> 
> > > +
> > > +	ci_pdata->name = dev_name(&pdev->dev);
> > > +
> > > +	priv->ci_pdev = ci_hdrc_add_device(dev, pdev->resource,
> > > +					   pdev->num_resources, ci_pdata);
> > > +	if (IS_ERR(priv->ci_pdev)) {
> > > +		ret = PTR_ERR(priv->ci_pdev);
> > > +		if (ret != -EPROBE_DEFER)
> > > +			dev_err(dev,
> > > +				"failed to register ci_hdrc platform
> device: %d\n",
> > > +				ret);
> >
> > Why you don't want the error message for deferral probe?
> 
> A driver can return an EPROBE_DEFER error and still probe successfully later.
> This would be confusing to have this kind of error message in this case. And
> when a driver returns -EPROBE_DEFER, there is an error message already.
> 

OK, agree.

Peter

  reply	other threads:[~2014-09-12  0:06 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03  7:48 [PATCH v4 00/12] ARM: berlin: USB support Antoine Tenart
2014-09-03  7:48 ` Antoine Tenart
2014-09-03  7:48 ` Antoine Tenart
2014-09-03  7:48 ` [PATCH v4 01/12] reset: add the Berlin reset controller driver Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03 21:01   ` Sebastian Hesselbarth
2014-09-03 21:01     ` Sebastian Hesselbarth
2014-09-03 21:01     ` Sebastian Hesselbarth
2014-09-03  7:48 ` [PATCH v4 02/12] Documentation: bindings: add reset bindings docs for Marvell Berlin SoCs Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48 ` [PATCH v4 03/12] ARM: Berlin: select the reset controller Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48 ` [PATCH v4 04/12] ARM: dts: berlin: add a required reset property in the chip controller node Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48 ` [PATCH v4 05/12] phy: add the Berlin USB PHY driver Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48 ` [PATCH v4 06/12] Documentation: bindings: add doc for the Berlin USB PHY Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48 ` [PATCH v4 07/12] usb: chipidea: add a usb2 driver for ci13xxx Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-11  1:07   ` Peter Chen
2014-09-11  1:07     ` Peter Chen
2014-09-11  1:07     ` Peter Chen
2014-09-11 15:31     ` Antoine Tenart
2014-09-11 15:31       ` Antoine Tenart
2014-09-11 15:31       ` Antoine Tenart
2014-09-12  0:05       ` Peter Chen [this message]
2014-09-12  0:05         ` Peter Chen
2014-09-12  0:05         ` Peter Chen
2014-09-03  7:48 ` [PATCH v4 08/12] Documentation: bindings: add doc for the USB2 ChipIdea USB driver Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-11  1:09   ` Peter Chen
2014-09-11  1:09     ` Peter Chen
2014-09-11  1:09     ` Peter Chen
2014-09-03  7:48 ` [PATCH v4 09/12] ARM: dts: berlin: add BG2Q nodes for USB support Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48 ` [PATCH v4 10/12] ARM: dts: Berlin: enable USB on the BG2Q DMP Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48 ` [PATCH v4 11/12] ARM: dts: berlin: add BG2CD nodes for USB support Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48 ` [PATCH v4 12/12] ARM: dts: berlin: enable USB on the Google Chromecast Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart
2014-09-03  7:48   ` Antoine Tenart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=600c4437f5d14520931aabc242fd69f4@BN1PR0301MB0772.namprd03.prod.outlook.com \
    --to=peter.chen@freescale.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=antoine.tenart@free-electrons.com \
    --cc=balbi@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jszhang@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=zmxu@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.