public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* MTD_CK804XROM warning (Was: Linux 2.6.29-rc6)
       [not found] ` <49A679E8.1010301@krogh.cc>
@ 2009-02-26 17:17   ` Marcin Slusarz
  2009-02-26 17:53   ` Linux 2.6.29-rc6 Linus Torvalds
  1 sibling, 0 replies; 9+ messages in thread
From: Marcin Slusarz @ 2009-02-26 17:17 UTC (permalink / raw)
  To: Jesper Krogh
  Cc: David.Woodhouse, Ryan Jackson, linux-kernel, linux-mtd,
	Dave Olsen, Linus Torvalds

On Thu, Feb 26, 2009 at 12:15:52PM +0100, Jesper Krogh wrote:
>
> Booting up 2.6.29-rc6 gave me this one in dmesg...
>
> [   21.136149] ck804xrom ck804xrom_init_one(): Unable to register resource 
> 0x00000000ff000000-0x00000000ffffffff - kernel bug?
> [   21.136258] resource map sanity check conflict: 0xff000000 0xffffffff 
> 0xff700000 0xffffffff reserved
> [   21.136267] ------------[ cut here ]------------
> [   21.136269] WARNING: at arch/x86/mm/ioremap.c:208 
> __ioremap_caller+0x359/0x390()
> [   21.136271] Hardware name: Sun Fire X2200 M2 with Quad Core Processor
> [   21.136273] Info: mapping multiple BARs. Your kernel is fine.Modules 
> linked in: ck804xrom(+) mtd chipreg pcspkr(+) shpchp button pci_hotplug 
> i2c_nforce2 i2c_core map_funcs evdev ext3 jbd mbcache sg sd_mod usbhid hid 
> amd74xx sata_nv tg3 ata_generic libphy ehci_hcd libata ohci_hcd forcedeth 
> scsi_mod usbcore thermal processor fan thermal_sys fuse
> [   21.136289] Pid: 3843, comm: modprobe Not tainted 2.6.29-rc6 #2
> [   21.136291] Call Trace:
> [   21.136298]  [<ffffffff8023d352>] warn_slowpath+0xf2/0x130
> [   21.136301]  [<ffffffff8023d62a>] __call_console_drivers+0x6a/0x90
> [   21.136304]  [<ffffffff8023e1fe>] printk+0x4e/0x60
> [   21.136306]  [<ffffffff8023e1fe>] printk+0x4e/0x60
> [   21.136309]  [<ffffffff8036b520>] match_pci_dev_by_id+0x0/0x60
> [   21.136313]  [<ffffffff8024360e>] iomem_map_sanity_check+0xbe/0xd0
> [   21.136316]  [<ffffffff80229799>] __ioremap_caller+0x359/0x390
> [   21.136320]  [<ffffffffa01eb1f6>] init_ck804xrom+0x1f6/0x62c [ck804xrom]
> [   21.136322]  [<ffffffffa01eb1f6>] init_ck804xrom+0x1f6/0x62c [ck804xrom]
> [   21.136326]  [<ffffffff80275eac>] 
> tracepoint_update_probe_range+0x1c/0xb0
> [   21.136329]  [<ffffffffa01eb000>] init_ck804xrom+0x0/0x62c [ck804xrom]
> [   21.136332]  [<ffffffff8020903b>] _stext+0x3b/0x160
> [   21.136335]  [<ffffffff80359141>] __up_read+0x21/0xb0
> [   21.136340]  [<ffffffff80256495>] 
> __blocking_notifier_call_chain+0x65/0x90
> [   21.136343]  [<ffffffff80265604>] sys_init_module+0xb4/0x200
> [   21.136346]  [<ffffffff8020c35b>] system_call_fastpath+0x16/0x1b
> [   21.136348] ---[ end trace f807e12658961c2d ]---
>
>
> System is fully operational, but I didnt get it in 2.6.26.8 (most recent 
> kernel tried on this hardware).

This message comes from this code in drivers/mtd/maps/ck804xrom.c:
        /*
         * Try to reserve the window mem region.  If this fails then
         * it is likely due to a fragment of the window being
         * "reserved" by the BIOS.  In the case that the
         * request_mem_region() fails then once the rom size is
         * discovered we will try to reserve the unreserved fragment.
         */
        window->rsrc.name = MOD_NAME;
        window->rsrc.start = window->phys;
        window->rsrc.end   = window->phys + window->size - 1;
        window->rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
        if (request_resource(&iomem_resource, &window->rsrc)) {
                window->rsrc.parent = NULL;
                printk(KERN_ERR MOD_NAME
                        " %s(): Unable to register resource"
                        " 0x%.016llx-0x%.016llx - kernel bug?\n",
                        __func__,
                        (unsigned long long)window->rsrc.start,
                        (unsigned long long)window->rsrc.end);
        }

So it's probably harmless.
Adding CC's.

Marcin

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

* Re: Linux 2.6.29-rc6
       [not found] ` <49A679E8.1010301@krogh.cc>
  2009-02-26 17:17   ` MTD_CK804XROM warning (Was: Linux 2.6.29-rc6) Marcin Slusarz
@ 2009-02-26 17:53   ` Linus Torvalds
  2009-02-26 19:22     ` David Woodhouse
  2009-02-26 19:31     ` Jesper Krogh
  1 sibling, 2 replies; 9+ messages in thread
From: Linus Torvalds @ 2009-02-26 17:53 UTC (permalink / raw)
  To: Jesper Krogh, David Woodhouse, Dave Olsen, Ryan Jackson,
	linux-mtd
  Cc: Linux Kernel Mailing List

Dave Olsen <dolsen@lnxi.com>,
    Ryan Jackson <rjackson@lnxi.com>, David.Woodhouse@intel.com, 
linux-mtd@lists.infradead.org


On Thu, 26 Feb 2009, Jesper Krogh wrote:
>
> 
> Booting up 2.6.29-rc6 gave me this one in dmesg...
> 
> [   21.136149] ck804xrom ck804xrom_init_one(): Unable to register resource 0x00000000ff000000-0x00000000ffffffff - kernel bug?

Well, it _is_ a kernel bug, but it's in that stupid driver. It does 
everything wrong, including printing out a scary message.

Piece of sh*t driver, in other words.

I mean, it even has a _comment_ about how the request_region is likely to 
not succeed, and then it prints out that scary message when it 
then doesn't do so.

Not to mention that the driver is likely _wrong_ to just unconditionally 
try to enable that resource without *first* checking whether the resource 
can actually be enabled or whether there are other resources in that same 
window.

Quite frankly, I find that whole thing scary. The driver should be deleted 
or at least marked EXPERIMENTAL or BROKEN.

It has a "BE VERY CAREFUL" in the Kconfig _help_ text, but is not marked 
as being dangerous any other way.

That said, I really don't see why you would get this message _now_. The 
total braindamage of that driver in no way seems new. Did you perhaps not 
notice before, or did you just not enable it before?

> [   21.136269] WARNING: at arch/x86/mm/ioremap.c:208 __ioremap_caller+0x359/0x390()

This is a different, but related warning, since the driver is doing an 
ioremap across different resources. The warning is directly related to the 
fact that the resource wasn't actually valid to begin with.

What does "cat /proc/iomem" say?

> System is fully operational, but I didnt get it in 2.6.26.8 (most recent
> kernel tried on this hardware).

The ioremap() warning is newish, and may be what made you notice the 
previous (just one-line) crappy warning.

Quite frankly, having looked at that horrible driver, I would seriously 
consider disabling it. Stuff like that should not be allowed to exist.

		Linus

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

* Re: Linux 2.6.29-rc6
  2009-02-26 17:53   ` Linux 2.6.29-rc6 Linus Torvalds
@ 2009-02-26 19:22     ` David Woodhouse
  2009-02-26 19:31     ` Jesper Krogh
  1 sibling, 0 replies; 9+ messages in thread
From: David Woodhouse @ 2009-02-26 19:22 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ryan Jackson, Dave Olsen, linux-mtd@lists.infradead.org,
	Linux Kernel Mailing List, Jesper Krogh

On Thu, 2009-02-26 at 17:53 +0000, Linus Torvalds wrote:
> Dave Olsen <dolsen@lnxi.com>,
>     Ryan Jackson <rjackson@lnxi.com>, David.Woodhouse@intel.com, 
> linux-mtd@lists.infradead.org
> 
> 
> On Thu, 26 Feb 2009, Jesper Krogh wrote:
> >
> > 
> > Booting up 2.6.29-rc6 gave me this one in dmesg...
> > 
> > [   21.136149] ck804xrom ck804xrom_init_one(): Unable to register resource 0x00000000ff000000-0x00000000ffffffff - kernel bug?
> 
> Well, it _is_ a kernel bug, but it's in that stupid driver. It does 
> everything wrong, including printing out a scary message.
> 
> Piece of sh*t driver, in other words.
> 
> I mean, it even has a _comment_ about how the request_region is likely to 
> not succeed, and then it prints out that scary message when it 
> then doesn't do so.
> 
> Not to mention that the driver is likely _wrong_ to just unconditionally 
> try to enable that resource without *first* checking whether the resource 
> can actually be enabled or whether there are other resources in that same 
> window.
>
> Quite frankly, I find that whole thing scary. The driver should be deleted 
> or at least marked EXPERIMENTAL or BROKEN.

It's giving you access to your BIOS flash so that you can overwrite it
from within Linux. It's _supposed_ to be scary :)

It's also always going to be a hack -- it's a PITA getting direct access
to that flash on most PeeCee chipsets. The driver operates on the
principle that it knows the hardware, and it can _make_ the flash appear
at the appropriate physical addresses. The theory, at least, is that it
knows better than the kernel does.

But yeah, it should probably at least look for other things which
already overlap with the region that it's trying to 'create'. Although
the comment leads me to believe that sometimes that's _expected_ and
shouldn't cause the driver to abort.

Dave, Ryan, are you still actively using this?

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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

* Re: Linux 2.6.29-rc6
  2009-02-26 17:53   ` Linux 2.6.29-rc6 Linus Torvalds
  2009-02-26 19:22     ` David Woodhouse
@ 2009-02-26 19:31     ` Jesper Krogh
  2009-02-26 19:36       ` David Woodhouse
  2009-02-26 20:32       ` Linus Torvalds
  1 sibling, 2 replies; 9+ messages in thread
From: Jesper Krogh @ 2009-02-26 19:31 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ryan Jackson, Dave Olsen, linux-mtd, David Woodhouse,
	Linux Kernel Mailing List

Linus Torvalds wrote:
> Dave Olsen <dolsen@lnxi.com>,
>     Ryan Jackson <rjackson@lnxi.com>, David.Woodhouse@intel.com, 
> linux-mtd@lists.infradead.org
> 
> 
> On Thu, 26 Feb 2009, Jesper Krogh wrote:
>>
>> Booting up 2.6.29-rc6 gave me this one in dmesg...
>>
>> [   21.136149] ck804xrom ck804xrom_init_one(): Unable to register resource 0x00000000ff000000-0x00000000ffffffff - kernel bug?
> 
> Well, it _is_ a kernel bug, but it's in that stupid driver. It does 
> everything wrong, including printing out a scary message.

I've seen that before.. (even reported it before). It just "slipped" 
into the cut'n'paste It was the following stuff that I intended to report.

>> [   21.136269] WARNING: at arch/x86/mm/ioremap.c:208 __ioremap_caller+0x359/0x390()
> 
> This is a different, but related warning, since the driver is doing an 
> ioremap across different resources. The warning is directly related to the 
> fact that the resource wasn't actually valid to begin with.
> 
> What does "cat /proc/iomem" say?

http://krogh.cc/~jesper/iomem.txt

>> System is fully operational, but I didnt get it in 2.6.26.8 (most recent
>> kernel tried on this hardware).
> 
> The ioremap() warning is newish, and may be what made you notice the 
> previous (just one-line) crappy warning.
> 
> Quite frankly, having looked at that horrible driver, I would seriously 
> consider disabling it. Stuff like that should not be allowed to exist.

Being a "stupid" user, I pick the easy way to build a fresh kernel:
1) pick the distro .config
2) make oldconfig
3) Let the kernel load what it think it needs.
4) Report if I see and strange stuff (warnings / bugs / oops) or 
misbehaviour.

So I dont know if I need that driver for anything vital. Should I care? 
Or shouldn't it "just work"?

-- 
Jesper

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

* Re: Linux 2.6.29-rc6
  2009-02-26 19:31     ` Jesper Krogh
@ 2009-02-26 19:36       ` David Woodhouse
  2009-02-26 19:46         ` Jesper Krogh
  2009-02-26 20:53         ` Carl-Daniel Hailfinger
  2009-02-26 20:32       ` Linus Torvalds
  1 sibling, 2 replies; 9+ messages in thread
From: David Woodhouse @ 2009-02-26 19:36 UTC (permalink / raw)
  To: Jesper Krogh
  Cc: Ryan Jackson, linux-mtd@lists.infradead.org, Dave Olsen,
	Linus Torvalds, Linux Kernel Mailing List

On Thu, 2009-02-26 at 19:31 +0000, Jesper Krogh wrote:
> 1) pick the distro .config
> 2) make oldconfig

So it should have been a module, not built-in?

> 3) Let the kernel load what it think it needs.

That part at least ought to be disabled -- we don't let this driver
autoload, because unless you _know_ you need it, you don't need it.

It's for overwriting your BIOS.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

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

* Re: Linux 2.6.29-rc6
  2009-02-26 19:36       ` David Woodhouse
@ 2009-02-26 19:46         ` Jesper Krogh
  2009-02-26 19:49           ` David Woodhouse
  2009-02-26 20:53         ` Carl-Daniel Hailfinger
  1 sibling, 1 reply; 9+ messages in thread
From: Jesper Krogh @ 2009-02-26 19:46 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Ryan Jackson, linux-mtd@lists.infradead.org, Dave Olsen,
	Linus Torvalds, Linux Kernel Mailing List

David Woodhouse wrote:
> On Thu, 2009-02-26 at 19:31 +0000, Jesper Krogh wrote:
>> 1) pick the distro .config
>> 2) make oldconfig
> 
> So it should have been a module, not built-in?

It is a module.. and it somehow gets auto-loaded on my system. (not 
listed in /etc/modules).

$ grep -i ck804xrom /boot/config-2.6.29-rc6
CONFIG_MTD_CK804XROM=m

Same in the distro .config
$ grep -i ck804xrom /boot/config-2.6.24-23-server
CONFIG_MTD_CK804XROM=m


>> 3) Let the kernel load what it think it needs.
> 
> That part at least ought to be disabled -- we don't let this driver
> autoload, because unless you _know_ you need it, you don't need it.
> 
> It's for overwriting your BIOS.

Oh. Thanks for your time... I'll just make sure to disable it from now on.

-- 
Jesper

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

* Re: Linux 2.6.29-rc6
  2009-02-26 19:46         ` Jesper Krogh
@ 2009-02-26 19:49           ` David Woodhouse
  0 siblings, 0 replies; 9+ messages in thread
From: David Woodhouse @ 2009-02-26 19:49 UTC (permalink / raw)
  To: Jesper Krogh
  Cc: Ryan Jackson, linux-mtd@lists.infradead.org, Dave Olsen,
	Linus Torvalds, Linux Kernel Mailing List

On Thu, 2009-02-26 at 20:46 +0100, Jesper Krogh wrote:
> It is a module.. and it somehow gets auto-loaded on my system. (not 
> listed in /etc/modules).

Oops, we should have disabled that, but it still has a
MODULE_DEVICE_TABLE(). I'll remove that, for a start...

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

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

* Re: Linux 2.6.29-rc6
  2009-02-26 19:31     ` Jesper Krogh
  2009-02-26 19:36       ` David Woodhouse
@ 2009-02-26 20:32       ` Linus Torvalds
  1 sibling, 0 replies; 9+ messages in thread
From: Linus Torvalds @ 2009-02-26 20:32 UTC (permalink / raw)
  To: Jesper Krogh
  Cc: Ryan Jackson, Dave Olsen, linux-mtd, David Woodhouse,
	Linux Kernel Mailing List



On Thu, 26 Feb 2009, Jesper Krogh wrote:

> Linus Torvalds wrote:
> > On Thu, 26 Feb 2009, Jesper Krogh wrote:
> > > 
> > > Booting up 2.6.29-rc6 gave me this one in dmesg...
> > > 
> > > [   21.136149] ck804xrom ck804xrom_init_one(): Unable to register resource
> > > 0x00000000ff000000-0x00000000ffffffff - kernel bug?
> > 
> > Well, it _is_ a kernel bug, but it's in that stupid driver. It does
> > everything wrong, including printing out a scary message.
> 
> I've seen that before.. (even reported it before). It just "slipped" into the
> cut'n'paste It was the following stuff that I intended to report.

Ok. They very much are related. The new warning is just that - a new 
warning.

> > > [   21.136269] WARNING: at arch/x86/mm/ioremap.c:208
> > > __ioremap_caller+0x359/0x390()
> > 
> > This is a different, but related warning, since the driver is doing an
> > ioremap across different resources. The warning is directly related to the
> > fact that the resource wasn't actually valid to begin with.
> > 
> > What does "cat /proc/iomem" say?
> 
> http://krogh.cc/~jesper/iomem.txt

Ok, so the thing conflicts with

	ff700000-ffffffff : reserved
	  ff700000-ffffffff : pnp 00:0b

and that probably _is_ somehow related to the whole flash thing. 

I guess the driver could use "insert_resource()" and the problem would go 
away. Except I do think it should be marked very dangerous some way, so 
that you can't even enable it unless you really really know you want to 
(eg something like EXPERIMENTAL). Because I don't think this driver is 
appropriate in any other case..

> Being a "stupid" user, I pick the easy way to build a fresh kernel: 1) 
> pick the distro .config 2) make oldconfig 3) Let the kernel load what it 
> think it needs. 4) Report if I see and strange stuff (warnings / bugs / 
> oops) or misbehaviour.
> 
> So I dont know if I need that driver for anything vital. Should I care? 
> Or shouldn't it "just work"?

You definitely don't need it, and everything will work without it. 

			Linus

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

* Re: Linux 2.6.29-rc6
  2009-02-26 19:36       ` David Woodhouse
  2009-02-26 19:46         ` Jesper Krogh
@ 2009-02-26 20:53         ` Carl-Daniel Hailfinger
  1 sibling, 0 replies; 9+ messages in thread
From: Carl-Daniel Hailfinger @ 2009-02-26 20:53 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Jesper Krogh, Ryan Jackson, Linux Kernel Mailing List,
	linux-mtd@lists.infradead.org, Dave Olsen, Linus Torvalds

On 26.02.2009 20:36, David Woodhouse wrote:
> It's for overwriting your BIOS.
>   

There's a pure userspace replacement for it. That replacement is even
packaged in most distros. See http://www.coreboot.org/Flashrom .


Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/

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

end of thread, other threads:[~2009-02-26 20:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <alpine.LFD.2.00.0902222023520.3111@localhost.localdomain>
     [not found] ` <49A679E8.1010301@krogh.cc>
2009-02-26 17:17   ` MTD_CK804XROM warning (Was: Linux 2.6.29-rc6) Marcin Slusarz
2009-02-26 17:53   ` Linux 2.6.29-rc6 Linus Torvalds
2009-02-26 19:22     ` David Woodhouse
2009-02-26 19:31     ` Jesper Krogh
2009-02-26 19:36       ` David Woodhouse
2009-02-26 19:46         ` Jesper Krogh
2009-02-26 19:49           ` David Woodhouse
2009-02-26 20:53         ` Carl-Daniel Hailfinger
2009-02-26 20:32       ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox