linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available
@ 2018-08-23 21:35 Alexandre Belloni
  2018-08-23 21:36 ` [PATCH 2/2] soc: fsl: qbman: qman: avoid allocating from non existing gen_pool Alexandre Belloni
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Alexandre Belloni @ 2018-08-23 21:35 UTC (permalink / raw)
  To: Li Yang
  Cc: Roy Pledge, linuxppc-dev, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

If the qman driver (qman_ccsr) doesn't probe or fail to probe before
qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an
unmapped page.

This leads to a crash when probing  qman_portal as the init_pcfg function
calls qman_liodn_fixup that tries to read qman registers.

Assume that qman didn't probe when the pool mask is 0.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/soc/fsl/qbman/qman_portal.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
index a120002b630e..4fc80d2c8feb 100644
--- a/drivers/soc/fsl/qbman/qman_portal.c
+++ b/drivers/soc/fsl/qbman/qman_portal.c
@@ -277,6 +277,8 @@ static int qman_portal_probe(struct platform_device *pdev)
 	}
 
 	pcfg->pools = qm_get_pools_sdqcr();
+	if (pcfg->pools == 0)
+		return -EPROBE_DEFER;
 
 	spin_lock(&qman_lock);
 	cpu = cpumask_next_zero(-1, &portal_cpus);
-- 
2.18.0


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

* [PATCH 2/2] soc: fsl: qbman: qman: avoid allocating from non existing gen_pool
  2018-08-23 21:35 [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available Alexandre Belloni
@ 2018-08-23 21:36 ` Alexandre Belloni
  2018-08-24 14:53   ` Roy Pledge
  2018-08-24 14:52 ` [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available Roy Pledge
  2018-09-25 19:45 ` Olof Johansson
  2 siblings, 1 reply; 10+ messages in thread
From: Alexandre Belloni @ 2018-08-23 21:36 UTC (permalink / raw)
  To: Li Yang
  Cc: Roy Pledge, linuxppc-dev, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

If the qman driver didn't probe, calling qman_alloc_fqid_range,
qman_alloc_pool_range or qman_alloc_cgrid_range (as done in dpaa_eth) will
pass a NULL pointer to gen_pool_alloc, leading to a NULL pointer
dereference.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/soc/fsl/qbman/qman.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c
index ecb22749df0b..8cc015183043 100644
--- a/drivers/soc/fsl/qbman/qman.c
+++ b/drivers/soc/fsl/qbman/qman.c
@@ -2729,6 +2729,9 @@ static int qman_alloc_range(struct gen_pool *p, u32 *result, u32 cnt)
 {
 	unsigned long addr;
 
+	if (!p)
+		return -ENODEV;
+
 	addr = gen_pool_alloc(p, cnt);
 	if (!addr)
 		return -ENOMEM;
-- 
2.18.0


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

* Re: [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available
  2018-08-23 21:35 [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available Alexandre Belloni
  2018-08-23 21:36 ` [PATCH 2/2] soc: fsl: qbman: qman: avoid allocating from non existing gen_pool Alexandre Belloni
@ 2018-08-24 14:52 ` Roy Pledge
  2018-08-28 22:49   ` Li Yang
  2018-09-25 19:45 ` Olof Johansson
  2 siblings, 1 reply; 10+ messages in thread
From: Roy Pledge @ 2018-08-24 14:52 UTC (permalink / raw)
  To: Alexandre Belloni, Leo Li; +Cc: linuxppc-dev, linux-arm-kernel, linux-kernel

On 8/23/2018 5:36 PM, Alexandre Belloni wrote:
> If the qman driver (qman_ccsr) doesn't probe or fail to probe before
> qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an
> unmapped page.
>
> This leads to a crash when probing  qman_portal as the init_pcfg function
> calls qman_liodn_fixup that tries to read qman registers.
>
> Assume that qman didn't probe when the pool mask is 0.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
>  drivers/soc/fsl/qbman/qman_portal.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
> index a120002b630e..4fc80d2c8feb 100644
> --- a/drivers/soc/fsl/qbman/qman_portal.c
> +++ b/drivers/soc/fsl/qbman/qman_portal.c
> @@ -277,6 +277,8 @@ static int qman_portal_probe(struct platform_device *pdev)
>  	}
>  
>  	pcfg->pools = qm_get_pools_sdqcr();
> +	if (pcfg->pools == 0)
> +		return -EPROBE_DEFER;
>  
>  	spin_lock(&qman_lock);
>  	cpu = cpumask_next_zero(-1, &portal_cpus);

Reviewed-by: Roy Pledge <roy.pledge@nxp.com>



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

* Re: [PATCH 2/2] soc: fsl: qbman: qman: avoid allocating from non existing gen_pool
  2018-08-23 21:36 ` [PATCH 2/2] soc: fsl: qbman: qman: avoid allocating from non existing gen_pool Alexandre Belloni
@ 2018-08-24 14:53   ` Roy Pledge
  0 siblings, 0 replies; 10+ messages in thread
From: Roy Pledge @ 2018-08-24 14:53 UTC (permalink / raw)
  To: Alexandre Belloni, Leo Li; +Cc: linuxppc-dev, linux-arm-kernel, linux-kernel

On 8/23/2018 5:36 PM, Alexandre Belloni wrote:
> If the qman driver didn't probe, calling qman_alloc_fqid_range,
> qman_alloc_pool_range or qman_alloc_cgrid_range (as done in dpaa_eth) will
> pass a NULL pointer to gen_pool_alloc, leading to a NULL pointer
> dereference.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
>  drivers/soc/fsl/qbman/qman.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c
> index ecb22749df0b..8cc015183043 100644
> --- a/drivers/soc/fsl/qbman/qman.c
> +++ b/drivers/soc/fsl/qbman/qman.c
> @@ -2729,6 +2729,9 @@ static int qman_alloc_range(struct gen_pool *p, u32 *result, u32 cnt)
>  {
>  	unsigned long addr;
>  
> +	if (!p)
> +		return -ENODEV;
> +
>  	addr = gen_pool_alloc(p, cnt);
>  	if (!addr)
>  		return -ENOMEM;

Reviewed-by: Roy Pledge <roy.pledge@nxp.com>


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

* Re: [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available
  2018-08-24 14:52 ` [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available Roy Pledge
@ 2018-08-28 22:49   ` Li Yang
  0 siblings, 0 replies; 10+ messages in thread
From: Li Yang @ 2018-08-28 22:49 UTC (permalink / raw)
  To: Roy Pledge
  Cc: alexandre.belloni, linuxppc-dev,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE, lkml

On Fri, Aug 24, 2018 at 9:54 AM Roy Pledge <roy.pledge@nxp.com> wrote:
>
> On 8/23/2018 5:36 PM, Alexandre Belloni wrote:
> > If the qman driver (qman_ccsr) doesn't probe or fail to probe before
> > qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an
> > unmapped page.
> >
> > This leads to a crash when probing  qman_portal as the init_pcfg function
> > calls qman_liodn_fixup that tries to read qman registers.
> >
> > Assume that qman didn't probe when the pool mask is 0.
> >
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

Series applied to the fix branch of soc/fsl.

> > ---
> >  drivers/soc/fsl/qbman/qman_portal.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
> > index a120002b630e..4fc80d2c8feb 100644
> > --- a/drivers/soc/fsl/qbman/qman_portal.c
> > +++ b/drivers/soc/fsl/qbman/qman_portal.c
> > @@ -277,6 +277,8 @@ static int qman_portal_probe(struct platform_device *pdev)
> >       }
> >
> >       pcfg->pools = qm_get_pools_sdqcr();
> > +     if (pcfg->pools == 0)
> > +             return -EPROBE_DEFER;
> >
> >       spin_lock(&qman_lock);
> >       cpu = cpumask_next_zero(-1, &portal_cpus);
>
> Reviewed-by: Roy Pledge <roy.pledge@nxp.com>
>
>

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

* Re: [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available
  2018-08-23 21:35 [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available Alexandre Belloni
  2018-08-23 21:36 ` [PATCH 2/2] soc: fsl: qbman: qman: avoid allocating from non existing gen_pool Alexandre Belloni
  2018-08-24 14:52 ` [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available Roy Pledge
@ 2018-09-25 19:45 ` Olof Johansson
  2018-09-25 22:11   ` Li Yang
  2018-09-26  9:27   ` Alexandre Belloni
  2 siblings, 2 replies; 10+ messages in thread
From: Olof Johansson @ 2018-09-25 19:45 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Li Yang, Roy Pledge, linuxppc-dev, Linux ARM Mailing List,
	Linux Kernel Mailing List

Hi,


On Thu, Aug 23, 2018 at 11:36 PM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> If the qman driver (qman_ccsr) doesn't probe or fail to probe before
> qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an
> unmapped page.
>
> This leads to a crash when probing  qman_portal as the init_pcfg function
> calls qman_liodn_fixup that tries to read qman registers.
>
> Assume that qman didn't probe when the pool mask is 0.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
>  drivers/soc/fsl/qbman/qman_portal.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
> index a120002b630e..4fc80d2c8feb 100644
> --- a/drivers/soc/fsl/qbman/qman_portal.c
> +++ b/drivers/soc/fsl/qbman/qman_portal.c
> @@ -277,6 +277,8 @@ static int qman_portal_probe(struct platform_device *pdev)
>         }
>
>         pcfg->pools = qm_get_pools_sdqcr();
> +       if (pcfg->pools == 0)
> +               return -EPROBE_DEFER;

This is quite late in the probe, after a bunch of resources have been claimed.

Note that the ioremaps above this are doing unwinds, and you'll end up
doing duplicate ioremaps if you come in and probe again.

You should probably unwind those allocations, or move them to devm_*
or do this check earlier in the function.


-Olof

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

* Re: [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available
  2018-09-25 19:45 ` Olof Johansson
@ 2018-09-25 22:11   ` Li Yang
  2018-09-26  9:27   ` Alexandre Belloni
  1 sibling, 0 replies; 10+ messages in thread
From: Li Yang @ 2018-09-25 22:11 UTC (permalink / raw)
  To: Olof Johansson
  Cc: alexandre.belloni, Roy Pledge, linuxppc-dev,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE, lkml

On Tue, Sep 25, 2018 at 2:47 PM Olof Johansson <olof@lixom.net> wrote:
>
> Hi,
>
>
> On Thu, Aug 23, 2018 at 11:36 PM Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
> >
> > If the qman driver (qman_ccsr) doesn't probe or fail to probe before
> > qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an
> > unmapped page.
> >
> > This leads to a crash when probing  qman_portal as the init_pcfg function
> > calls qman_liodn_fixup that tries to read qman registers.
> >
> > Assume that qman didn't probe when the pool mask is 0.
> >
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > ---
> >  drivers/soc/fsl/qbman/qman_portal.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
> > index a120002b630e..4fc80d2c8feb 100644
> > --- a/drivers/soc/fsl/qbman/qman_portal.c
> > +++ b/drivers/soc/fsl/qbman/qman_portal.c
> > @@ -277,6 +277,8 @@ static int qman_portal_probe(struct platform_device *pdev)
> >         }
> >
> >         pcfg->pools = qm_get_pools_sdqcr();
> > +       if (pcfg->pools == 0)
> > +               return -EPROBE_DEFER;
>
> This is quite late in the probe, after a bunch of resources have been claimed.
>
> Note that the ioremaps above this are doing unwinds, and you'll end up
> doing duplicate ioremaps if you come in and probe again.
>
> You should probably unwind those allocations, or move them to devm_*
> or do this check earlier in the function.

Hi Roy,

Is there any more straightforward indicator on if qman has been
probed?  So that we can check it at the begining of the probe?

Regards,
Leo

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

* Re: [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available
  2018-09-25 19:45 ` Olof Johansson
  2018-09-25 22:11   ` Li Yang
@ 2018-09-26  9:27   ` Alexandre Belloni
  2018-09-26 18:15     ` Li Yang
  1 sibling, 1 reply; 10+ messages in thread
From: Alexandre Belloni @ 2018-09-26  9:27 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Li Yang, Roy Pledge, linuxppc-dev, Linux ARM Mailing List,
	Linux Kernel Mailing List

On 25/09/2018 21:45:56+0200, Olof Johansson wrote:
> Hi,
> 
> 
> On Thu, Aug 23, 2018 at 11:36 PM Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
> >
> > If the qman driver (qman_ccsr) doesn't probe or fail to probe before
> > qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an
> > unmapped page.
> >
> > This leads to a crash when probing  qman_portal as the init_pcfg function
> > calls qman_liodn_fixup that tries to read qman registers.
> >
> > Assume that qman didn't probe when the pool mask is 0.
> >
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > ---
> >  drivers/soc/fsl/qbman/qman_portal.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
> > index a120002b630e..4fc80d2c8feb 100644
> > --- a/drivers/soc/fsl/qbman/qman_portal.c
> > +++ b/drivers/soc/fsl/qbman/qman_portal.c
> > @@ -277,6 +277,8 @@ static int qman_portal_probe(struct platform_device *pdev)
> >         }
> >
> >         pcfg->pools = qm_get_pools_sdqcr();
> > +       if (pcfg->pools == 0)
> > +               return -EPROBE_DEFER;
> 
> This is quite late in the probe, after a bunch of resources have been claimed.
> 
> Note that the ioremaps above this are doing unwinds, and you'll end up
> doing duplicate ioremaps if you come in and probe again.
> 
> You should probably unwind those allocations, or move them to devm_*
> or do this check earlier in the function.
> 

The actual chance of having that happen is quite small (this was coming
from a non working DT) and I mainly wanted to avoid a crash so the
platform could still boot. I would think moving to devm_ would be the
right thing to do.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available
  2018-09-26  9:27   ` Alexandre Belloni
@ 2018-09-26 18:15     ` Li Yang
  2018-09-27 19:24       ` Li Yang
  0 siblings, 1 reply; 10+ messages in thread
From: Li Yang @ 2018-09-26 18:15 UTC (permalink / raw)
  To: alexandre.belloni
  Cc: Olof Johansson, Roy Pledge, linuxppc-dev,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE, lkml

On Wed, Sep 26, 2018 at 4:28 AM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> On 25/09/2018 21:45:56+0200, Olof Johansson wrote:
> > Hi,
> >
> >
> > On Thu, Aug 23, 2018 at 11:36 PM Alexandre Belloni
> > <alexandre.belloni@bootlin.com> wrote:
> > >
> > > If the qman driver (qman_ccsr) doesn't probe or fail to probe before
> > > qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an
> > > unmapped page.
> > >
> > > This leads to a crash when probing  qman_portal as the init_pcfg function
> > > calls qman_liodn_fixup that tries to read qman registers.
> > >
> > > Assume that qman didn't probe when the pool mask is 0.
> > >
> > > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > > ---
> > >  drivers/soc/fsl/qbman/qman_portal.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
> > > index a120002b630e..4fc80d2c8feb 100644
> > > --- a/drivers/soc/fsl/qbman/qman_portal.c
> > > +++ b/drivers/soc/fsl/qbman/qman_portal.c
> > > @@ -277,6 +277,8 @@ static int qman_portal_probe(struct platform_device *pdev)
> > >         }
> > >
> > >         pcfg->pools = qm_get_pools_sdqcr();
> > > +       if (pcfg->pools == 0)
> > > +               return -EPROBE_DEFER;
> >
> > This is quite late in the probe, after a bunch of resources have been claimed.
> >
> > Note that the ioremaps above this are doing unwinds, and you'll end up
> > doing duplicate ioremaps if you come in and probe again.
> >
> > You should probably unwind those allocations, or move them to devm_*
> > or do this check earlier in the function.
> >
>
> The actual chance of having that happen is quite small (this was coming
> from a non working DT) and I mainly wanted to avoid a crash so the
> platform could still boot. I would think moving to devm_ would be the
> right thing to do.

Even if it is not failing with the upstreamed device trees, it is
still good to harden the driver for possible issues.  Moving to devm_
is definitely a right thing to do.  But I also think checking if the
qman is already probed should be the first thing to do before starting
to allocate resources and etc and rolling back later.  Probably we can
move the qm_get_pools_sdqcr() to the begining of the probe to
determine if qman is probed as it doesn't seem to depend on any of the
setups done right now.

Regards,
Leo

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

* Re: [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available
  2018-09-26 18:15     ` Li Yang
@ 2018-09-27 19:24       ` Li Yang
  0 siblings, 0 replies; 10+ messages in thread
From: Li Yang @ 2018-09-27 19:24 UTC (permalink / raw)
  To: alexandre.belloni, Laurentiu Tudor
  Cc: Olof Johansson, Roy Pledge, linuxppc-dev,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE, lkml

On Wed, Sep 26, 2018 at 1:15 PM Li Yang <leoyang.li@nxp.com> wrote:
>
> On Wed, Sep 26, 2018 at 4:28 AM Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
> >
> > On 25/09/2018 21:45:56+0200, Olof Johansson wrote:
> > > Hi,
> > >
> > >
> > > On Thu, Aug 23, 2018 at 11:36 PM Alexandre Belloni
> > > <alexandre.belloni@bootlin.com> wrote:
> > > >
> > > > If the qman driver (qman_ccsr) doesn't probe or fail to probe before
> > > > qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an
> > > > unmapped page.
> > > >
> > > > This leads to a crash when probing  qman_portal as the init_pcfg function
> > > > calls qman_liodn_fixup that tries to read qman registers.
> > > >
> > > > Assume that qman didn't probe when the pool mask is 0.
> > > >
> > > > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > > > ---
> > > >  drivers/soc/fsl/qbman/qman_portal.c | 2 ++
> > > >  1 file changed, 2 insertions(+)
> > > >
> > > > diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
> > > > index a120002b630e..4fc80d2c8feb 100644
> > > > --- a/drivers/soc/fsl/qbman/qman_portal.c
> > > > +++ b/drivers/soc/fsl/qbman/qman_portal.c
> > > > @@ -277,6 +277,8 @@ static int qman_portal_probe(struct platform_device *pdev)
> > > >         }
> > > >
> > > >         pcfg->pools = qm_get_pools_sdqcr();
> > > > +       if (pcfg->pools == 0)
> > > > +               return -EPROBE_DEFER;
> > >
> > > This is quite late in the probe, after a bunch of resources have been claimed.
> > >
> > > Note that the ioremaps above this are doing unwinds, and you'll end up
> > > doing duplicate ioremaps if you come in and probe again.
> > >
> > > You should probably unwind those allocations, or move them to devm_*
> > > or do this check earlier in the function.
> > >
> >
> > The actual chance of having that happen is quite small (this was coming
> > from a non working DT) and I mainly wanted to avoid a crash so the
> > platform could still boot. I would think moving to devm_ would be the
> > right thing to do.
>
> Even if it is not failing with the upstreamed device trees, it is
> still good to harden the driver for possible issues.  Moving to devm_
> is definitely a right thing to do.  But I also think checking if the
> qman is already probed should be the first thing to do before starting
> to allocate resources and etc and rolling back later.  Probably we can
> move the qm_get_pools_sdqcr() to the begining of the probe to
> determine if qman is probed as it doesn't seem to depend on any of the
> setups done right now.

I just find out Laurentiu also included the following patches in his
SMMU patch series (although not neccessarily related to SMMU) which
also fix the same problem.  I think they are more straightforward and
can deal with the case that qman failed to probe.  So we can take
these to fix this problem instead in 4.19.

https://patchwork.kernel.org/patch/10616021/
https://patchwork.kernel.org/patch/10616019/
https://patchwork.kernel.org/patch/10615971/

Regards,
Leo

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

end of thread, other threads:[~2018-09-27 19:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-23 21:35 [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available Alexandre Belloni
2018-08-23 21:36 ` [PATCH 2/2] soc: fsl: qbman: qman: avoid allocating from non existing gen_pool Alexandre Belloni
2018-08-24 14:53   ` Roy Pledge
2018-08-24 14:52 ` [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available Roy Pledge
2018-08-28 22:49   ` Li Yang
2018-09-25 19:45 ` Olof Johansson
2018-09-25 22:11   ` Li Yang
2018-09-26  9:27   ` Alexandre Belloni
2018-09-26 18:15     ` Li Yang
2018-09-27 19:24       ` Li Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).