public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jesper Krogh <jesper@krogh.cc>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: Linux 2.6.26-rc4
Date: Tue, 27 May 2008 03:16:11 +0200	[thread overview]
Message-ID: <483B60DB.7020402@gmx.net> (raw)
In-Reply-To: <alpine.LFD.1.10.0805261428140.2958@woody.linux-foundation.org>

On 26.05.2008 23:42, Linus Torvalds wrote:
> On Mon, 26 May 2008, Jesper Krogh wrote:
>   
>> I did get this one (which I didn't on 2.6.25.2)
>>
>> [42949399.810959] ck804xrom ck804xrom_init_one(): Unable to register resource
>> 0x0000000000000000-0x00000000ffffffff - kernel bug?
>>     
>
> Something is trying to register a 4GB resource. That sounds unlikely 
> (possible on a 64-bit PCI setup, but I think it's more likely to be some 
> overflow of 0 in "unsigned int").
>
> In fact, this seems to be due to some driver bug. It looks like we have
>
> 	window->size = 0xffffffffUL - window->phys + 1UL;
>
> and in order for window->size to be 0x100000000, that means that 
> window->phys has to be 0. Which looks impossible, or at least like 
> ent->driver_data is neither DEV_CK804 nor DEV_MCP55. Very odd.
>
> The warning:
>
>   
>> [42949399.979924] WARNING: at arch/x86/mm/ioremap.c:159 __ioremap_caller+0x299/0x330()
>>     
>
> is then just a result of the driver blindly continuing and trying to 
> "ioremap()" the resource even though it's bogus and the resource 
> allocation failed.
>
> In other words, that driver init routine is really bad about error 
> handling. Carl-Daniel? David?
>   

It hurts to look at this:

static struct pci_device_id ck804xrom_pci_tbl[] = {
	{ PCI_VENDOR_ID_NVIDIA, 0x0051, PCI_ANY_ID, PCI_ANY_ID, DEV_CK804 },
	{ PCI_VENDOR_ID_NVIDIA, 0x0360, PCI_ANY_ID, PCI_ANY_ID, DEV_MCP55 },
	{ PCI_VENDOR_ID_NVIDIA, 0x0361, PCI_ANY_ID, PCI_ANY_ID, DEV_MCP55 },
	{ PCI_VENDOR_ID_NVIDIA, 0x0362, PCI_ANY_ID, PCI_ANY_ID, DEV_MCP55 },
	{ PCI_VENDOR_ID_NVIDIA, 0x0363, PCI_ANY_ID, PCI_ANY_ID, DEV_MCP55 },
	{ PCI_VENDOR_ID_NVIDIA, 0x0364, PCI_ANY_ID, PCI_ANY_ID, DEV_MCP55 },
	{ PCI_VENDOR_ID_NVIDIA, 0x0365, PCI_ANY_ID, PCI_ANY_ID, DEV_MCP55 },
	{ PCI_VENDOR_ID_NVIDIA, 0x0366, PCI_ANY_ID, PCI_ANY_ID, DEV_MCP55 },
	{ PCI_VENDOR_ID_NVIDIA, 0x0367, PCI_ANY_ID, PCI_ANY_ID, DEV_MCP55 },
	{ 0, }
};

considering how struct pci_device_id looks like:

struct pci_device_id {
	__u32 vendor, device;		/* Vendor and device ID or PCI_ANY_ID*/
	__u32 subvendor, subdevice;	/* Subsystem ID's or PCI_ANY_ID */
	__u32 class, class_mask;	/* (class,subclass,prog-if) triplet */
	kernel_ulong_t driver_data;	/* Data private to the driver */
};



DEV_CK804 and DEV_MCP55 actually end up in class instead of driver_data.

I'd send a patch, but I'm traveling and my only code access is gitweb.

New code should look like
static struct pci_device_id ck804xrom_pci_tbl[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x0051), .driver_data = DEV_CK804 },
	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x0360), .driver_data = DEV_MCP55 },
	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x0361), .driver_data = DEV_MCP55 },
	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x0362), .driver_data = DEV_MCP55 },
	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x0363), .driver_data = DEV_MCP55 },
	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x0364), .driver_data = DEV_MCP55 },
	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x0365), .driver_data = DEV_MCP55 },
	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x0366), .driver_data = DEV_MCP55 },
	{ PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 0x0367), .driver_data = DEV_MCP55 },
	{ 0, }
};


Regards,
Carl-Daniel


  parent reply	other threads:[~2008-05-27  1:16 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-26 18:41 Linux 2.6.26-rc4 Linus Torvalds
2008-05-26 21:24 ` Jesper Krogh
2008-05-26 21:42   ` Linus Torvalds
2008-05-27  0:25     ` Arjan van de Ven
2008-05-27  0:31       ` Arjan van de Ven
2008-05-27  5:43       ` David Woodhouse
2008-05-27  6:00         ` Arjan van de Ven
2008-05-27  6:24           ` David Woodhouse
2008-05-27  1:16     ` Carl-Daniel Hailfinger [this message]
2008-05-27  1:23       ` Carl-Daniel Hailfinger
2008-05-27  1:52         ` Abhijit Menon-Sen
2008-05-27  5:19           ` Jesper Krogh
2008-05-27  5:31           ` [MTD] [MAPS] ck804rom: fix driver_data in probe table David Woodhouse
2008-05-27  5:31           ` Linux 2.6.26-rc4 David Woodhouse
2008-05-27 10:35       ` Jeff Garzik
2008-05-27 10:53         ` Carl-Daniel Hailfinger
2008-05-27 10:54           ` Jeff Garzik
2008-05-27 10:58             ` Carl-Daniel Hailfinger
2008-05-27  5:23 ` 2.6.26-rc4: RIP find_pid_ns+0x6b/0xa0 Alexey Dobriyan
2008-05-27  9:06   ` Oleg Nesterov
2008-05-27 15:03     ` Linus Torvalds
2008-05-27 15:40       ` Paul E. McKenney
2008-05-27 16:11         ` Linus Torvalds
2008-05-27 17:06           ` Paul E. McKenney
2008-05-28  5:01             ` Paul E. McKenney
2008-05-28  7:26               ` Paul E. McKenney
2008-05-27 16:45       ` Oleg Nesterov
2008-05-27 17:37         ` Oleg Nesterov
2008-05-27 21:26           ` Alexey Dobriyan
2008-05-27 10:01 ` Linux 2.6.26-rc4 J.A. Magallón
2008-05-28 23:59   ` Bill Davidsen
     [not found] ` <20080527124315.131b1343@Varda>
2008-05-28 20:10   ` Linus Torvalds
2008-05-28 20:17     ` Johannes Berg
2008-05-28 21:48       ` John W. Linville
2008-06-03  9:49 ` Jesper Krogh
2008-06-03  9:57   ` Al Viro
2008-06-03 10:04     ` Jesper Krogh
2008-06-03 10:13       ` Miklos Szeredi
2008-06-03 10:37         ` Miklos Szeredi
2008-06-03 10:48           ` Al Viro
2008-06-03 13:31             ` Ian Kent
2008-06-03 13:32               ` Ian Kent
2008-06-03 10:40         ` Al Viro
2008-06-03 10:45           ` Miklos Szeredi
2008-06-03 10:52             ` Al Viro
2008-06-03 13:27               ` Ian Kent
2008-06-03 15:01                 ` Linus Torvalds
2008-06-03 16:07                   ` Ian Kent
2008-06-03 16:35                     ` Linus Torvalds
2008-06-03 16:41                       ` Al Viro
2008-06-03 16:50                         ` Al Viro
2008-06-03 17:28                           ` Ian Kent
2008-06-03 17:41                             ` Al Viro
2008-06-03 17:41                               ` Ian Kent
2008-06-03 17:50                                 ` Al Viro
2008-06-03 17:49                                   ` Ian Kent
2008-06-03 16:59                         ` Linus Torvalds
2008-06-03 17:30                           ` Ian Kent
2008-06-03 17:13                       ` Ian Kent
2008-06-03 17:30                         ` Al Viro
2008-06-03 17:38                           ` Ian Kent
2008-06-03 17:46                           ` Jeff Moyer
2008-06-03 19:18                             ` Al Viro
2008-06-03 19:53                               ` Jeff Moyer
2008-06-03 23:00                                 ` Al Viro
2008-06-04  2:42                                   ` Ian Kent
2008-06-04  5:34                                     ` Miklos Szeredi
2008-06-04  5:41                                       ` Ian Kent
2008-06-10  4:57                                     ` Ian Kent
2008-06-10  6:28                                       ` Jesper Krogh
2008-06-10  6:40                                         ` Ian Kent
2008-06-10  9:09                                           ` Ian Kent
2008-06-12  3:03                                           ` Ian Kent
2008-06-12  7:02                                             ` Jesper Krogh
2008-06-12 11:21                                               ` Ian Kent
2008-06-12 11:19                                             ` Ian Kent
2008-06-04  1:36                               ` Ian Kent
2008-06-05  7:31                   ` Ian Kent
2008-06-05 21:29                     ` Linus Torvalds
2008-06-05 21:34                       ` Jesper Krogh
2008-06-06  2:39                       ` Ian Kent
2008-06-05 22:30                     ` Andrew Morton
2008-06-06  2:47                       ` Ian Kent
2008-06-27  4:18                       ` Ian Kent
2008-06-06  6:23                     ` Jesper Krogh
2008-06-06  8:21                       ` Ian Kent
2008-06-06  8:25                         ` Ian Kent
2008-06-03 10:35     ` Al Viro
2008-06-04 17:51 ` Jesper Krogh

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=483B60DB.7020402@gmx.net \
    --to=c-d.hailfinger.devel.2006@gmx.net \
    --cc=dwmw2@infradead.org \
    --cc=jesper@krogh.cc \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox