Re: [PATCH v1 20/43] x86: pinctrl: Set up itss in the probe() method

2020-07-02 Thread Simon Glass
Hi Bin,

On Tue, 30 Jun 2020 at 00:43, Bin Meng  wrote:
>
> Hi Simon,
>
> On Mon, Jun 15, 2020 at 11:58 AM Simon Glass  wrote:
> >
> > At present the itss is probed in the ofdata_to_platdata() method. This is
> > incorrect since itss is a child of p2sb which itself needs to probe the
> > pinctrl device. This means that p2sb is effectively not probed when the
> > itss is probed, so we get the wrong register address from p2sb.
> >
>
> I wonder how this ever worked?
>

I think it worked before the change to separate ofdata_to_platdata()
and probe() properly, and also if the p2sb has already been probed for
a different reason.

> > Fix this by moving the itss probe to the correct place.
> >
> > Signed-off-by: Simon Glass 
> > ---
> >
> >  drivers/pinctrl/intel/pinctrl.c | 8 
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
>
> Reviewed-by: Bin Meng 
>
> Regards,
> Bin

Regards,
Simon


Re: [PATCH v1 20/43] x86: pinctrl: Set up itss in the probe() method

2020-06-30 Thread Bin Meng
Hi Simon,

On Mon, Jun 15, 2020 at 11:58 AM Simon Glass  wrote:
>
> At present the itss is probed in the ofdata_to_platdata() method. This is
> incorrect since itss is a child of p2sb which itself needs to probe the
> pinctrl device. This means that p2sb is effectively not probed when the
> itss is probed, so we get the wrong register address from p2sb.
>

I wonder how this ever worked?

> Fix this by moving the itss probe to the correct place.
>
> Signed-off-by: Simon Glass 
> ---
>
>  drivers/pinctrl/intel/pinctrl.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>

Reviewed-by: Bin Meng 

Regards,
Bin


[PATCH v1 20/43] x86: pinctrl: Set up itss in the probe() method

2020-06-14 Thread Simon Glass
At present the itss is probed in the ofdata_to_platdata() method. This is
incorrect since itss is a child of p2sb which itself needs to probe the
pinctrl device. This means that p2sb is effectively not probed when the
itss is probed, so we get the wrong register address from p2sb.

Fix this by moving the itss probe to the correct place.

Signed-off-by: Simon Glass 
---

 drivers/pinctrl/intel/pinctrl.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/intel/pinctrl.c b/drivers/pinctrl/intel/pinctrl.c
index 32ca303b27..ba21c9dcc2 100644
--- a/drivers/pinctrl/intel/pinctrl.c
+++ b/drivers/pinctrl/intel/pinctrl.c
@@ -619,15 +619,11 @@ int intel_pinctrl_ofdata_to_platdata(struct udevice *dev,
 {
struct p2sb_child_platdata *pplat = dev_get_parent_platdata(dev);
struct intel_pinctrl_priv *priv = dev_get_priv(dev);
-   int ret;
 
if (!comm) {
log_err("Cannot find community for pid %d\n", pplat->pid);
return -EDOM;
}
-   ret = irq_first_device_type(X86_IRQT_ITSS, >itss);
-   if (ret)
-   return log_msg_ret("Cannot find ITSS", ret);
priv->comm = comm;
priv->num_cfgs = num_cfgs;
 
@@ -637,8 +633,12 @@ int intel_pinctrl_ofdata_to_platdata(struct udevice *dev,
 int intel_pinctrl_probe(struct udevice *dev)
 {
struct intel_pinctrl_priv *priv = dev_get_priv(dev);
+   int ret;
 
priv->itss_pol_cfg = true;
+   ret = irq_first_device_type(X86_IRQT_ITSS, >itss);
+   if (ret)
+   return log_msg_ret("Cannot find ITSS", ret);
 
return 0;
 }
-- 
2.27.0.290.gba653c62da-goog