# Re: \[PATCH v4 1/5\] fsl-diu-fb: fix issue with re-enabling DIU area

- From: Anatolij Gustschin \<agust@denx.de\>
- Date: 2010-07-28 07:56:55 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2010/07/8051288
- Thread: https://ratatoskr.run/linux-devicetree/2010/07/8051288/t.md

```text
On Wed, 28 Jul 2010 01:02:59 -0600
Grant Likely [ref] wrote:
...
> >  drivers/video/fsl-diu-fb.c |   38 +++++++++++++++++++++++---------------
> >  1 files changed, 23 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
> > index 27455ce..9b8c991 100644
> > --- a/drivers/video/fsl-diu-fb.c
> > +++ b/drivers/video/fsl-diu-fb.c
> > @@ -317,6 +317,17 @@ static void fsl_diu_free(void *virt, size_t size)
> >                free_pages_exact(virt, size);
> >  }
> >
> > +/*
> > + * Workaround for failed writing desc register of planes.
> > + * Needed with MPC5121 DIU rev 2.0 silicon.
> > + */
> > +void wr_reg_wa(u32 *reg, u32 val)
> > +{
> > +       do {
> > +               out_be32(reg, val);
> > +       } while (in_be32(reg) != val);
> > +}
> 
> I'll apply this one, but it looks like a potential problem.  What
> happens if the write never succeeds?  The kernel then gets stuck in a
> forever busy loop.  You should look at reworking it.

I'll submit an incremental patch that prevents looping forever in
the case if the write never succeeds. Thanks!

Anatolij
```
