linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* About boot time Tux logo with -EPROBE_DEFER
       [not found] ` <redmine.journal-935021.20170228120819.2026321c0ca0beea@dm.renesas.com>
@ 2017-03-07  1:24   ` Kuninori Morimoto
  2017-03-08  9:11     ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Kuninori Morimoto @ 2017-03-07  1:24 UTC (permalink / raw)
  To: Laurent, Bartlomiej Zolnierkiewicz, Fabian Frederick, Andrew Morton
  Cc: shimoda, koji.matsuoka.xm, shiiba, sakato, Hosoya, Fukawa,
	hien.dang.eb, khiem.nguyen.xt, kouei.abe.cp,
	harunobu.kurokawa.dn, hiroyuki.yokoyama.vx, takeshi.kihara.df,
	linux-fbdev, linux-kernel


Hi

I want to ask you about boot time Tux logo.

For some reasons, current our video driver returns -EPROBE_DEFER when
probe timing, but logo init function doesn't care it.
Thus, our kernel can't have logo when boot time.

I think this is not only our issue, but general issue ?

Thus, I think logo init function should care about -EPROBE_DEFER
or something. In our quick hack, this issue was solved by below patch,
but I don't know this is OK.

So, how to solve this issue ? do you have nice idea ?
or can maintainer accept below patch ?

-------------------
diff --git a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c
index b6bc4a0bda2a..4d50bfd13e7c 100644
--- a/drivers/video/logo/logo.c
+++ b/drivers/video/logo/logo.c
@@ -34,7 +34,7 @@ static int __init fb_logo_late_init(void)
     return 0;
 }

-late_initcall(fb_logo_late_init);
+late_initcall_sync(fb_logo_late_init);

 /* logo's are marked __initdata. Use __ref to tell
  * modpost that it is intended that this function uses data
-------------------

Best regards
---
Kuninori Morimoto

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

* Re: About boot time Tux logo with -EPROBE_DEFER
  2017-03-07  1:24   ` About boot time Tux logo with -EPROBE_DEFER Kuninori Morimoto
@ 2017-03-08  9:11     ` Geert Uytterhoeven
  2017-03-08  9:58       ` Kuninori Morimoto
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2017-03-08  9:11 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Laurent, Bartlomiej Zolnierkiewicz, Fabian Frederick,
	Andrew Morton, shimoda, Koji Matsuoka, shiiba, sakato, Hosoya,
	Fukawa, Hien Dang, Khiem Nguyen, Kouei Abe, Harunobu Kurokawa,
	Hiroyuki Yokoyama, Takeshi Kihara, Linux Fbdev development list,
	linux-kernel

Hi Morimoto-san,

On Tue, Mar 7, 2017 at 2:24 AM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> I want to ask you about boot time Tux logo.
>
> For some reasons, current our video driver returns -EPROBE_DEFER when
> probe timing, but logo init function doesn't care it.
> Thus, our kernel can't have logo when boot time.
>
> I think this is not only our issue, but general issue ?
>
> Thus, I think logo init function should care about -EPROBE_DEFER
> or something. In our quick hack, this issue was solved by below patch,
> but I don't know this is OK.

The important part is that fb_logo_late_init() is called
  - as late as possible, to allow to draw the logo as late as possible,
  - but before free_initmem(), to avoid using freed memory.

kernel_init()
{
    kernel_init_freeable()
    {
        ...
        do_basic_setup()
        {
            ...
            do_initcalls();
            ...
        }
        ...
    }
    /* need to finish all async __init code before freeing the memory */
    async_synchronize_full();
    free_initmem();
    ...
}

According to the call graph above, the latest initcall() should be OK.

> So, how to solve this issue ? do you have nice idea ?
> or can maintainer accept below patch ?
>
> -------------------
> diff --git a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c
> index b6bc4a0bda2a..4d50bfd13e7c 100644
> --- a/drivers/video/logo/logo.c
> +++ b/drivers/video/logo/logo.c
> @@ -34,7 +34,7 @@ static int __init fb_logo_late_init(void)
>      return 0;
>  }
>
> -late_initcall(fb_logo_late_init);
> +late_initcall_sync(fb_logo_late_init);
>
>  /* logo's are marked __initdata. Use __ref to tell
>   * modpost that it is intended that this function uses data

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: About boot time Tux logo with -EPROBE_DEFER
  2017-03-08  9:11     ` Geert Uytterhoeven
@ 2017-03-08  9:58       ` Kuninori Morimoto
  0 siblings, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2017-03-08  9:58 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Laurent, Bartlomiej Zolnierkiewicz, Fabian Frederick,
	Andrew Morton, shimoda, Koji Matsuoka, shiiba, sakato, Hosoya,
	Fukawa, Hien Dang, Khiem Nguyen, Kouei Abe, Harunobu Kurokawa,
	Hiroyuki Yokoyama, Takeshi Kihara, Linux Fbdev development list,
	linux-kernel


Hi Geert

Thanks.
I asked this because some maintainer doesn't accept the patch which
exchanges xxx_initcall.
But, I will try it with your Reviewed-by.

> > I want to ask you about boot time Tux logo.
> >
> > For some reasons, current our video driver returns -EPROBE_DEFER when
> > probe timing, but logo init function doesn't care it.
> > Thus, our kernel can't have logo when boot time.
> >
> > I think this is not only our issue, but general issue ?
> >
> > Thus, I think logo init function should care about -EPROBE_DEFER
> > or something. In our quick hack, this issue was solved by below patch,
> > but I don't know this is OK.
> 
> The important part is that fb_logo_late_init() is called
>   - as late as possible, to allow to draw the logo as late as possible,
>   - but before free_initmem(), to avoid using freed memory.
> 
> kernel_init()
> {
>     kernel_init_freeable()
>     {
>         ...
>         do_basic_setup()
>         {
>             ...
>             do_initcalls();
>             ...
>         }
>         ...
>     }
>     /* need to finish all async __init code before freeing the memory */
>     async_synchronize_full();
>     free_initmem();
>     ...
> }
> 
> According to the call graph above, the latest initcall() should be OK.
> 
> > So, how to solve this issue ? do you have nice idea ?
> > or can maintainer accept below patch ?
> >
> > -------------------
> > diff --git a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c
> > index b6bc4a0bda2a..4d50bfd13e7c 100644
> > --- a/drivers/video/logo/logo.c
> > +++ b/drivers/video/logo/logo.c
> > @@ -34,7 +34,7 @@ static int __init fb_logo_late_init(void)
> >      return 0;
> >  }
> >
> > -late_initcall(fb_logo_late_init);
> > +late_initcall_sync(fb_logo_late_init);
> >
> >  /* logo's are marked __initdata. Use __ref to tell
> >   * modpost that it is intended that this function uses data
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

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

end of thread, other threads:[~2017-03-08 11:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-116282.20170227003040@dm.renesas.com>
     [not found] ` <redmine.journal-935021.20170228120819.2026321c0ca0beea@dm.renesas.com>
2017-03-07  1:24   ` About boot time Tux logo with -EPROBE_DEFER Kuninori Morimoto
2017-03-08  9:11     ` Geert Uytterhoeven
2017-03-08  9:58       ` Kuninori Morimoto

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).