[openib-general] FW: Mstflint - not working on ppc64 andwhendriver is notloaded on AMD

Michael S. Tsirkin mst at mellanox.co.il
Sun Oct 1 00:50:48 PDT 2006


Quoting r. Tseng-Hui (Frank) Lin <thlin at us.ibm.com>:
> Subject: RE: FW: Mstflint - not working on ppc64 andwhendriver is notloaded on AMD
> 
> The ppc64 problem is actually in pci_64.c. Here is the patch:
> 
> ============ cut here =============
> diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
> index 4c4449b..490403c 100644
> --- a/arch/powerpc/kernel/pci_64.c
> +++ b/arch/powerpc/kernel/pci_64.c
> @@ -734,9 +734,7 @@ static struct resource *__pci_mmap_make_
>  	if (hose == 0)
>  		return NULL;		/* should never happen */
>  
> -	/* If memory, add on the PCI bridge address offset */
>  	if (mmap_state == pci_mmap_mem) {
> -		*offset += hose->pci_mem_offset;
>  		res_bit = IORESOURCE_MEM;
>  	} else {
>  		io_offset = (unsigned long)hose->io_base_virt - pci_io_base;
> ============= end cut =============
> 
> The mmap() system call on resource0 does not work on ppc64 without this
> patch. PowerMAC G5 got away with this because its hose->pci_mem_offset
> was set to 0.
> 
> The fix is made on 8/21. It may be able to make it into 2.6.19. But it
> certainly won't get into SLES10, SLES9-SP3, or REHL4-U4 which have
> already been released. 
> 
> To cover both cases with and without the fix, my patch try to
> mmap /sys/bus/pci/..../resource0 first. It it failed it tries
> mmap /proc/bus/pci/.... If it failed again, we have no choice but fall
> back to use PCI config space.

OK, so for OFED just mmap from /proc/bus/pci/ should be sufficient 
work-around - it will make things work when driver is loaded.
Correct?

-- 
MST




More information about the general mailing list