From patchwork Mon Jan 11 06:19:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandru X-Patchwork-Id: 72099 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0B6JRxg002900 for ; Mon, 11 Jan 2010 06:19:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751498Ab0AKGT1 (ORCPT ); Mon, 11 Jan 2010 01:19:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751249Ab0AKGT1 (ORCPT ); Mon, 11 Jan 2010 01:19:27 -0500 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:35144 "EHLO e23smtp09.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751498Ab0AKGT0 (ORCPT ); Mon, 11 Jan 2010 01:19:26 -0500 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp09.au.ibm.com (8.14.3/8.13.1) with ESMTP id o0B6JOEx000988 for ; Mon, 11 Jan 2010 17:19:24 +1100 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o0B6Eqgt1609764 for ; Mon, 11 Jan 2010 17:14:52 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o0B6JO1c031471 for ; Mon, 11 Jan 2010 17:19:24 +1100 Received: from guara.in.ibm.com ([9.124.35.30]) by d23av03.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o0B6JNmc031467; Mon, 11 Jan 2010 17:19:23 +1100 From: Chandru Organization: ibm To: linux-pci@vger.kernel.org Subject: [PATCH] ibmphp : read the length of ebda and map entire ebda region Date: Mon, 11 Jan 2010 11:49:21 +0530 User-Agent: KMail/1.11.2 (Linux/2.6.30.9-90.fc11.x86_64; KDE/4.2.2; x86_64; ; ) Cc: Jesse Barnes MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201001111149.22056.chandru@in.ibm.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org --- linux-2.6.33-rc2/drivers/pci/hotplug/ibmphp_ebda.c.orig 2010-01-09 15:23:54.000000000 +0530 +++ linux-2.6.33-rc2/drivers/pci/hotplug/ibmphp_ebda.c 2010-01-09 17:01:06.000000000 +0530 @@ -245,7 +245,7 @@ static void __init print_ebda_hpc (void) int __init ibmphp_access_ebda (void) { - u8 format, num_ctlrs, rio_complete, hs_complete; + u8 format, num_ctlrs, rio_complete, hs_complete, ebda_sz; u16 ebda_seg, num_entries, next_offset, offset, blk_id, sub_addr, re, rc_id, re_id, base; int rc = 0; @@ -260,7 +260,14 @@ int __init ibmphp_access_ebda (void) iounmap (io_mem); debug ("returned ebda segment: %x\n", ebda_seg); - io_mem = ioremap(ebda_seg<<4, 1024); + io_mem = ioremap(ebda_seg<<4, 1); + ebda_sz = readb(io_mem); + iounmap(io_mem); + debug("ebda size: %d(KiB)\n", ebda_sz); + if (ebda_sz == 0) + return -ENOMEM; + + io_mem = ioremap(ebda_seg<<4, (ebda_sz * 1024)); if (!io_mem ) return -ENOMEM; next_offset = 0x180;