All of lore.kernel.org
 help / color / mirror / Atom feed
* r2074 broke ata module
@ 2009-04-15 21:34 Ward Vandewege
  2009-04-15 21:50 ` Pavel Roskin
  0 siblings, 1 reply; 4+ messages in thread
From: Ward Vandewege @ 2009-04-15 21:34 UTC (permalink / raw)
  To: The development of GRUB 2

Hi there,

I tried to use the ata module today in combination with grub2's coreboot
code, but found that it broke in r2074, specifically by this hunk:

------------------------------------------------------------------------
--- include/grub/pci.h	(revision 2073)
+++ include/grub/pci.h	(working copy)
@@ -36,8 +36,8 @@
 #define  GRUB_PCI_ADDR_IO_MASK		~0x03
 
 typedef grub_uint32_t grub_pci_id_t;
-typedef int (*grub_pci_iteratefunc_t) (int bus, int device, int func,
-				       grub_pci_id_t pciid);
+typedef int NESTED_FUNC_ATTR (*grub_pci_iteratefunc_t)
+     (int bus, int device, int func, grub_pci_id_t pciid);
 typedef grub_uint32_t grub_pci_address_t;
 
 grub_pci_address_t EXPORT_FUNC(grub_pci_make_address) (int bus, int device,
------------------------------------------------------------------------

Reverting that hunk fixes ata for me. The symptom of a broken ata module is
that it does not see any ATA disks.

I'm testing on qemu, and start qemu like this:

  qemu -m 1024 -serial stdio -L qemu-cbv2-grub2/ -hda path-to-image

Up to r2073, that image shows up as ata0, from r2074 it's simply not
detected.

Thoughts?

Thanks,
Ward.






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

* Re: r2074 broke ata module
  2009-04-15 21:34 r2074 broke ata module Ward Vandewege
@ 2009-04-15 21:50 ` Pavel Roskin
  2009-04-17 14:39   ` Ward Vandewege
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Roskin @ 2009-04-15 21:50 UTC (permalink / raw)
  To: The development of GRUB 2

On Wed, 2009-04-15 at 17:34 -0400, Ward Vandewege wrote:
> Hi there,
> 
> I tried to use the ata module today in combination with grub2's coreboot
> code, but found that it broke in r2074, specifically by this hunk:

Actually, I was looking at the warnings, and it looks like the warnings
about grub_pci_iterate() are directly related to this problem.

This patch should help.

Index: disk/ata.c
===================================================================
--- disk/ata.c	(revision 2120)
+++ disk/ata.c	(working copy)
@@ -375,7 +375,7 @@
   return 0;
 }
 
-static int
+static int NESTED_FUNC_ATTR
 grub_ata_pciinit (int bus, int device, int func,
 		  grub_pci_id_t pciid __attribute__((unused)))
 {
Index: bus/usb/ohci.c
===================================================================
--- bus/usb/ohci.c	(revision 2120)
+++ bus/usb/ohci.c	(working copy)
@@ -112,8 +112,9 @@
 
 /* Iterate over all PCI devices.  Determine if a device is an OHCI
    controller.  If this is the case, initialize it.  */
-static int grub_ohci_pci_iter (int bus, int device, int func,
-			       grub_pci_id_t pciid __attribute__((unused)))
+static int NESTED_FUNC_ATTR
+grub_ohci_pci_iter (int bus, int device, int func,
+		    grub_pci_id_t pciid __attribute__((unused)))
 {
   grub_uint32_t class;
   grub_uint32_t subclass;
Index: bus/usb/uhci.c
===================================================================
--- bus/usb/uhci.c	(revision 2120)
+++ bus/usb/uhci.c	(working copy)
@@ -137,8 +137,9 @@
 
 /* Iterate over all PCI devices.  Determine if a device is an UHCI
    controller.  If this is the case, initialize it.  */
-static int grub_uhci_pci_iter (int bus, int device, int func,
-			       grub_pci_id_t pciid __attribute__((unused)))
+static int NESTED_FUNC_ATTR
+grub_uhci_pci_iter (int bus, int device, int func,
+		    grub_pci_id_t pciid __attribute__((unused)))
 {
   grub_uint32_t class;
   grub_uint32_t subclass;
Index: commands/lspci.c
===================================================================
--- commands/lspci.c	(revision 2120)
+++ commands/lspci.c	(working copy)
@@ -114,7 +114,7 @@
   return 0;
 }
 
-static int
+static int NESTED_FUNC_ATTR
 grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid)
 {
   grub_uint32_t class;


-- 
Regards,
Pavel Roskin



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

* Re: r2074 broke ata module
  2009-04-15 21:50 ` Pavel Roskin
@ 2009-04-17 14:39   ` Ward Vandewege
  2009-04-17 15:37     ` Pavel Roskin
  0 siblings, 1 reply; 4+ messages in thread
From: Ward Vandewege @ 2009-04-17 14:39 UTC (permalink / raw)
  To: The development of GRUB 2

On Wed, Apr 15, 2009 at 05:50:42PM -0400, Pavel Roskin wrote:
> On Wed, 2009-04-15 at 17:34 -0400, Ward Vandewege wrote:
> > Hi there,
> > 
> > I tried to use the ata module today in combination with grub2's coreboot
> > code, but found that it broke in r2074, specifically by this hunk:
> 
> Actually, I was looking at the warnings, and it looks like the warnings
> about grub_pci_iterate() are directly related to this problem.
> 
> This patch should help.

Confirmed, this fixes ata for me.

Thanks!
Ward.




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

* Re: r2074 broke ata module
  2009-04-17 14:39   ` Ward Vandewege
@ 2009-04-17 15:37     ` Pavel Roskin
  0 siblings, 0 replies; 4+ messages in thread
From: Pavel Roskin @ 2009-04-17 15:37 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, 2009-04-17 at 10:39 -0400, Ward Vandewege wrote:
> On Wed, Apr 15, 2009 at 05:50:42PM -0400, Pavel Roskin wrote:
> > On Wed, 2009-04-15 at 17:34 -0400, Ward Vandewege wrote:
> > > Hi there,
> > > 
> > > I tried to use the ata module today in combination with grub2's coreboot
> > > code, but found that it broke in r2074, specifically by this hunk:
> > 
> > Actually, I was looking at the warnings, and it looks like the warnings
> > about grub_pci_iterate() are directly related to this problem.
> > 
> > This patch should help.
> 
> Confirmed, this fixes ata for me.

Committed.

-- 
Regards,
Pavel Roskin



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

end of thread, other threads:[~2009-04-17 15:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-15 21:34 r2074 broke ata module Ward Vandewege
2009-04-15 21:50 ` Pavel Roskin
2009-04-17 14:39   ` Ward Vandewege
2009-04-17 15:37     ` Pavel Roskin

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.