Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932078AbVJFXfH (ORCPT ); Thu, 6 Oct 2005 19:35:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932079AbVJFXfH (ORCPT ); Thu, 6 Oct 2005 19:35:07 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:50150 "EHLO e32.co.us.ibm.com") by vger.kernel.org with ESMTP id S932078AbVJFXfE (ORCPT ); Thu, 6 Oct 2005 19:35:04 -0400 Date: Thu, 6 Oct 2005 18:35:02 -0500 To: paulus@samba.org Cc: linuxppc64-dev@ozlabs.org, linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz Subject: [PATCH 9/22] ppc64: DLPAR slot add and remove bugfixes Message-ID: <20051006233502.GJ29826@austin.ibm.com> References: <20051006232032.GA29826@austin.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051006232032.GA29826@austin.ibm.com> User-Agent: Mutt/1.5.6+20040907i From: linas Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2488 Lines: 69 09-crash-on-pci-slot-remove.patch This patch fixes two bugs related to dlpar slot removal and add. -- Both crashes are due to the fact the some children of pci nodes are not pci nodes themselves, and thus do not have pci_dn structures. For example: /pci@800000020000002/pci@2,3/usb@1/hub@1 /pci@800000020000002/pci@2,3/usb@1,1/hub@1 Strangely, though, sometimes the following appears, and I don't quite understand why. /interrupt-controller@3fe0000a400 A typical stack trace: Vector: 300 (Data Access) at [c0000000555637d0] pc: c000000000202a50: .dlpar_add_slot+0x108/0x410 c000000000202e78 .add_slot_store+0x7c/0xac c000000000202da0 .dlpar_attr_store+0x48/0x64 c0000000000f8ee4 .sysfs_write_file+0x100/0x1a0 A similar stack trace is involved for the slot remove. This code survived testing, of adding and removing different slots, 23 times each, so far, as of this writing. Signed-off-by: Linas Vepstas Index: linux-2.6.14-rc2-git6/arch/ppc64/kernel/pSeries_iommu.c =================================================================== --- linux-2.6.14-rc2-git6.orig/arch/ppc64/kernel/pSeries_iommu.c 2005-10-06 17:50:28.197206873 -0500 +++ linux-2.6.14-rc2-git6/arch/ppc64/kernel/pSeries_iommu.c 2005-10-06 17:53:46.650361968 -0500 @@ -478,10 +478,13 @@ { int err = NOTIFY_OK; struct device_node *np = node; - struct pci_dn *pci = np->data; + struct pci_dn *pci; switch (action) { case PSERIES_RECONFIG_REMOVE: + pci = PCI_DN(np); + if (!pci) + return NOTIFY_OK; if (pci->iommu_table && get_property(np, "ibm,dma-window", NULL)) iommu_free_table(np); Index: linux-2.6.14-rc2-git6/arch/ppc64/kernel/pci_dn.c =================================================================== --- linux-2.6.14-rc2-git6.orig/arch/ppc64/kernel/pci_dn.c 2005-10-06 17:50:28.198206733 -0500 +++ linux-2.6.14-rc2-git6/arch/ppc64/kernel/pci_dn.c 2005-10-06 17:53:46.660360565 -0500 @@ -195,7 +195,10 @@ switch (action) { case PSERIES_RECONFIG_ADD: - pci = np->parent->data; + pci = PCI_DN(np->parent); + if (!pci) + return NOTIFY_OK; + update_dn_pci_info(np, pci->phb); break; default: - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/