From: AMEET M. PARANJAPE <aparanja@redhat.com> Date: Mon, 18 May 2009 17:15:32 -0400 Subject: [ppc] cell: make ptcal more reliable Message-id: 20090518211237.32358.19641.sendpatchset@squad5-lp1.lab.bos.redhat.com O-Subject: [PATCH RHEL5.4 BZ501356] powerpc/cell: make ptcal more reliable Bugzilla: 501356 RH-Acked-by: David Howells <dhowells@redhat.com> RHBZ#: ====== https://bugzilla.redhat.com/show_bug.cgi?id=501356 Description: =========== The following patch allocates pages only from the specified node, moves the ptcal area into the middle of the allocated page to avoid potential prefetch problems and prints the address of the ptcal area to facilitate diagnostics. RHEL Version Found: ================ RHEL 5.3 kABI Status: ============ No symbols were harmed. Brew: ===== Built on all platforms. http://brewweb.devel.redhat.com/brew/taskinfo?taskID=1803011 Upstream Status: ================ git. Commit id is: 37cd8ed90fc5b11941110d2d0cea6807f86d4787 Test Status: ============ The testcase to re-create the bug is provided in the Bugzilla. With the patch the system will reboot and successfully generate the kdump previously the QS21 would just reboot. =============================================================== Ameet Paranjape 978-392-3903 ext 23903 IBM on-site partner Proposed Patch: =============== diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c index 6d916b3..2cdcc72 100644 --- a/arch/powerpc/platforms/cell/ras.c +++ b/arch/powerpc/platforms/cell/ras.c @@ -113,12 +113,22 @@ static int __init cbe_ptcal_enable_on_node(int nid, int order) area->nid = nid; area->order = order; - area->pages = alloc_pages_node(area->nid, GFP_KERNEL, area->order); + area->pages = alloc_pages_thisnode(area->nid, GFP_KERNEL, area->order); - if (!area->pages) + if (!area->pages) { + printk(KERN_WARNING "%s: no page on node %d\n", + __FUNCTION__, area->nid); goto out_free_area; + } - addr = __pa(page_address(area->pages)); + /* + * We move the ptcal area to the middle of the allocated + * page, in order to avoid prefetches in memcpy and similar + * functions stepping on it. + */ + addr = __pa(page_address(area->pages)) + (PAGE_SIZE >> 1); + printk(KERN_DEBUG "%s: enabling PTCAL on node %d address=0x%016lx\n", + __FUNCTION__, area->nid, addr); ret = -EIO; if (rtas_call(ptcal_start_tok, 3, 1, NULL, area->nid,