All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@kernel.org>
To: Arnaud Lacombe <lacombar@gmail.com>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	greg@kroah.com, akpm@linux-foundation.org,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [3.0-git16] Oops at driver_uevent_store().
Date: Thu, 4 Aug 2011 11:40:15 +0300	[thread overview]
Message-ID: <20110804084015.GG29013@localhost.pp.htv.fi> (raw)
In-Reply-To: <CACqU3MVbHPuOjg9cY_GWdBGz3HPw3u7R3S14OOObN8-CFXGVaw@mail.gmail.com>

On Thu, Aug 04, 2011 at 01:47:11AM -0400, Arnaud Lacombe wrote:
> Hi,
> 
> [Added Adrian Bunk to the Cc: list]

Thanks.

> 2011/8/3 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>:
>...
> commit 74b9a297866d0416edd0be5014cb0810de049c6a
> Author: Adrian Bunk <bunk@stusta.de>
> Date:   Mon Mar 26 21:32:27 2007 -0800
> 
>     [PATCH] drivers/eisa/pci_eisa.c:pci_eisa_init() should be init
> 
>       WARNING: drivers/built-in.o - Section mismatch: reference to
> .init.text:eisa_root_register from .text between 'pci_eisa_init' (at
> offset 0xabf670) and 'virtual_eisa_release'
> 
>     AFAIK a PCI to EISA bridge isn't anything hotpluggable, so
>     pci_eisa_init() can become __init.
> 
>     Signed-off-by: Adrian Bunk <bunk@stusta.de>
>     Cc: Greg KH <greg@kroah.com>
>     Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>     Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> 
> 
> To gain a few bytes, 'pci_eisa_init' is freed, but its reference is
> kept in `pci_eisa_driver' which triggers the warning. The commit log
> points out that PCI to EISA should not be hotpluggable, so it is not
> expected to be ever executed again (which would trigger a crash).

This was not for gaining a few bytes, and I'm not exactly seeing why I'm 
to blame here, since my patch is invariant to what your patch does:

Calling pci_eisa_init outside of __init:
- might have crashed before my patch and
- after my patch and
- after your patch
since eisa_root_register() is __init.

> Marking `pci_eisa_driver' as __refdata fix the warning and leave the
> struct untouched:
> 
> diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c
> index 30da70d..cdae207 100644
> --- a/drivers/eisa/pci_eisa.c
> +++ b/drivers/eisa/pci_eisa.c
> @@ -45,13 +45,13 @@ static int __init pci_eisa_init(struct pci_dev *pdev,
>         return 0;
>  }
> 
> -static struct pci_device_id __initdata pci_eisa_pci_tbl[] = {
> +static struct pci_device_id pci_eisa_pci_tbl[] = {
>         { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
>           PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 },
>         { 0, }
>  };
> 
> -static struct pci_driver __initdata pci_eisa_driver = {
> +static struct pci_driver __refdata pci_eisa_driver = {
>         .name           = "pci_eisa",
>         .id_table       = pci_eisa_pci_tbl,
>         .probe          = pci_eisa_init,

So the commit that broke it was not mine, but

commit 005bdad7b80ac017ca21d795639d4214b9844a84
Author: Arnaud Lacombe <lacombar@gmail.com>
Date:   Mon Jul 25 17:13:04 2011 -0700

    eisa/pci_eisa.c: fix section mismatch
    
    Fixes
    
      WARNING: vmlinux.o(.data+0x15d3ac): Section mismatch in reference from the
      The variable pci_eisa_driver references the function __init pci_eisa_init(
      If the reference is valid then annotate the variable with __init* or __ref
      *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
    
    Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
    Cc: Greg KH <greg@kroah.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>



Please don't blame me for bugs you introduced.


>  - Arnaud

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


  parent reply	other threads:[~2011-08-04  8:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04  2:21 [3.0-git16] Oops at driver_uevent_store() Tetsuo Handa
2011-08-04  2:48 ` Arnaud Lacombe
2011-08-04  3:55   ` Tetsuo Handa
2011-08-04  5:47     ` Arnaud Lacombe
2011-08-04  7:15       ` Tetsuo Handa
2011-08-04  7:41         ` Linus Torvalds
2011-08-04 14:41           ` Arnaud Lacombe
2011-08-04  8:40       ` Adrian Bunk [this message]
2011-08-04 14:36         ` Arnaud Lacombe
  -- strict thread matches above, loose matches on Subject: below --
2011-08-02  2:25 Tetsuo Handa

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=20110804084015.GG29013@localhost.pp.htv.fi \
    --to=bunk@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=greg@kroah.com \
    --cc=lacombar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=torvalds@linux-foundation.org \
    /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.