Michael,

In case you missed Frank's signature,

Look at the attached message 

Moshe 

____________________________________________________________
Moshe Katzir   |  +972-9971-8639 (o)   |   +972-52-860-6042  (m)
 
Voltaire - The Grid Backbone
 
 www.voltaire.com

  


-----Original Message-----
From: Michael S. Tsirkin [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 04, 2006 10:44 PM
To: Moshe Kazir
Cc: Tseng-hui Lin; [EMAIL PROTECTED]; [email protected]
Subject: Re: FW: [openib-general] FW: Mstflint - not working on ppc64
andwhendriver is not loaded on AMD


Quoting r. Michael S. Tsirkin <[EMAIL PROTECTED]>:
> Subject: Re: FW: [openib-general] FW: Mstflint - not working on ppc64 
> andwhendriver is not loaded on AMD
> 
> Quoting r. Moshe Kazir <[EMAIL PROTECTED]>:
> > Subject: FW: [openib-general] FW: Mstflint - not working on ppc64 
> > andwhendriver is not loaded on AMD
> > 
> > Michael,
> >  
> > I received the attached files from Frank. they look small , easy to 
> > understand, and change almost nothing in the code.
> >  
> > The patch solves the ppc64 problems.
> >  
> > Please approve the patch and integrate it into OFED-1.1-rc7.
> >  
> > I  tested it  . it's working o.k. on on JS21 ppc64 sles 10, JS21 
> > ppc64 sles9, redhat as4 u3 x86_64, redhat as4 u3 i386.
> > Frank also tested it on AMD and JS21 PPC and MAC PPC64 .
> >  
> >  
> >  
> > Best regards,
> >  
> > Moshe
> 
> OK, not sure what's in a tarball, but the patch looks small and safe 
> enough to go in. But, we need the Signed-off-by like from the patch 
> author, certifying to the Developer's Certificate of Origin 1.1:

Please note RC7 is closing tomorrow, so we need to get the signature
stuff out of the way by then if the patch's to make it in OFED 1.1.

-- 
MST
--- Begin Message ---
mmap() does not work on ppc64. The 64-bit machines with 32-bit I/O need
ioremap in device driver to allow mmap access to the I/O memory. This
patch checks the above situations and try to use PCI config to do the
firmware update when mmap() failed.

Signed-off-by: Tseng-Hui (Frank) Lin <[EMAIL PROTECTED]>

=======

diff -uPr mstflint.ofed-1.1r6/mtcr.h mstflint/mtcr.h
--- mstflint.ofed-1.1r6/mtcr.h  2006-09-17 10:46:21.000000000 -0500
+++ mstflint/mtcr.h     2006-10-03 10:29:38.000000000 -0500
@@ -294,6 +294,9 @@
   int err;
   char buf[]="0000:00:00.0";
   char path[]="/sys/bus/pci/devices/0000:00:00.0/resource0";
+  unsigned domain, bus, dev, func;
+  struct stat dummybuf;
+  char file_name[]="/proc/bus/pci/0000:00/00.0";
 
   mf=(mfile*)malloc(sizeof(mfile));
   if (!mf) return 0;
@@ -338,13 +341,14 @@
     mf->ptr = mmap(NULL, 0x100000, PROT_READ | PROT_WRITE,
         MAP_SHARED, mf->fd, 0);
 
-    if ( (! mf->ptr) || (mf->ptr == MAP_FAILED) ) goto map_failed;
+    if ( (! mf->ptr) || (mf->ptr == MAP_FAILED) || 
+        (__be32_to_cpu(*((u_int32_t *) ((char *) mf->ptr + 0xF0014))) == 
0xFFFFFFFF) )
+        goto map_failed_try_pciconf;
   }
 #endif
   else
   {
 #if CONFIG_ENABLE_MMAP
-    unsigned bus, dev, func;
     if (mfind(name,&offset,&bus,&dev,&func)) goto find_failed;
 
 #if CONFIG_USE_DEV_MEM
@@ -352,8 +356,6 @@
     if (mf->fd<0) goto open_failed;
 #else
     {
-           struct stat dummybuf;
-           char file_name[]="/proc/bus/pci/0000:00/00.0";
            sprintf(file_name,"/proc/bus/pci/%2.2x/%2.2x.%1.1x",
                            bus,dev,func);
            if (stat(file_name,&dummybuf))
@@ -369,7 +371,9 @@
     mf->ptr = mmap(NULL, 0x100000, PROT_READ | PROT_WRITE,
         MAP_SHARED, mf->fd, offset);
 
-    if ( (! mf->ptr) || (mf->ptr == MAP_FAILED) ) goto map_failed;
+    if ( (! mf->ptr) || (mf->ptr == MAP_FAILED) || 
+        (__be32_to_cpu(*((u_int32_t *) ((char *) mf->ptr + 0xF0014))) == 
0xFFFFFFFF) )
+        goto map_failed_try_pciconf;
 
 #else
     goto open_failed;
@@ -379,6 +383,20 @@
 
 
 #if CONFIG_ENABLE_MMAP
+map_failed_try_pciconf:
+#if CONFIG_ENABLE_PCICONF
+       mf->ptr = NULL;
+       close(mf->fd);
+       if (sscanf(name, "%x:%x:%x.%x", &domain, &bus, &dev, &func) != 4) {
+               domain = 0;
+               if (sscanf(name, "%x:%x.%x", &bus, &dev, &func) != 3) goto 
map_failed;
+       }
+       snprintf(file_name, sizeof file_name, 
"/proc/bus/pci/%2.2x/%2.2x.%1.1x", bus, dev, func);
+       if (stat(file_name,&dummybuf))
+               snprintf(file_name, sizeof file_name, 
"/proc/bus/pci/%4.4x:%2.2x/%2.2x.%1.1x", domain, bus,dev,func);
+       if ((mf->fd = open(file_name, O_RDWR | O_SYNC)) >= 0) return mf;
+#endif
+
 map_failed:
 #if !CONFIG_USE_DEV_MEM
 ioctl_failed:
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

--- End Message ---
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to