From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932212AbVHKCSU (ORCPT ); Wed, 10 Aug 2005 22:18:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932213AbVHKCSU (ORCPT ); Wed, 10 Aug 2005 22:18:20 -0400 Received: from omx3-ext.sgi.com ([192.48.171.20]:57758 "EHLO omx3.sgi.com") by vger.kernel.org with ESMTP id S932212AbVHKCSU (ORCPT ); Wed, 10 Aug 2005 22:18:20 -0400 Date: Wed, 10 Aug 2005 19:18:00 -0700 (PDT) From: Christoph Lameter To: Linus Torvalds cc: Geert Uytterhoeven , Alan Cox , kiran@scalex86.org, BartlomiejZolnierkiewicz , Linux Kernel Development Subject: Re: [PATCH] Fix ide-disk.c oops caused by hwif == NULL In-Reply-To: <1123685998.28913.3.camel@localhost.localdomain> Message-ID: References: <200508100459.j7A4xTn7016128@hera.kernel.org> <1123685998.28913.3.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Just to make sure to avoid all confusion. The title of this thread should be "[PATCH] Fix ide-disk.c oops caused by hwif->pci_dev == NULL" And this is the patch that was acknowledged by Andrew and that fixes the issue AFAIK. This patch needs to be included in 2.6.13. Lets make sure that we are all on the same page on this patch now: --- From: Christoph Lameter There is one additional place where pcibus_to_node is used with the hwif that we did not cover. - Move hwif_to_node to ide.h - Use hwif_to_node in ide-disk.c Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton --- drivers/ide/ide-disk.c | 2 +- drivers/ide/ide-probe.c | 9 --------- include/linux/ide.h | 9 +++++++++ 3 files changed, 10 insertions(+), 10 deletions(-) diff -puN drivers/ide/ide-disk.c~fix-ide-diskc-oops-caused-by-hwif-==-null drivers/ide/ide-disk.c --- devel/drivers/ide/ide-disk.c~fix-ide-diskc-oops-caused-by-hwif-==-null 2005-08-09 20:16:45.000000000 -0700 +++ devel-akpm/drivers/ide/ide-disk.c 2005-08-09 20:16:45.000000000 -0700 @@ -1220,7 +1220,7 @@ static int ide_disk_probe(struct device goto failed; g = alloc_disk_node(1 << PARTN_BITS, - pcibus_to_node(drive->hwif->pci_dev->bus)); + hwif_to_node(drive->hwif)); if (!g) goto out_free_idkp; diff -puN drivers/ide/ide-probe.c~fix-ide-diskc-oops-caused-by-hwif-==-null drivers/ide/ide-probe.c --- devel/drivers/ide/ide-probe.c~fix-ide-diskc-oops-caused-by-hwif-==-null 2005-08-09 20:16:45.000000000 -0700 +++ devel-akpm/drivers/ide/ide-probe.c 2005-08-09 20:16:45.000000000 -0700 @@ -960,15 +960,6 @@ static void save_match(ide_hwif_t *hwif, } #endif /* MAX_HWIFS > 1 */ -static inline int hwif_to_node(ide_hwif_t *hwif) -{ - if (hwif->pci_dev) - return pcibus_to_node(hwif->pci_dev->bus); - else - /* Add ways to determine the node of other busses here */ - return -1; -} - /* * init request queue */ diff -puN include/linux/ide.h~fix-ide-diskc-oops-caused-by-hwif-==-null include/linux/ide.h --- devel/include/linux/ide.h~fix-ide-diskc-oops-caused-by-hwif-==-null 2005-08-09 20:16:45.000000000 -0700 +++ devel-akpm/include/linux/ide.h 2005-08-09 20:16:45.000000000 -0700 @@ -1501,4 +1501,13 @@ extern struct bus_type ide_bus_type; #define ide_id_has_flush_cache_ext(id) \ (((id)->cfs_enable_2 & 0x2400) == 0x2400) +static inline int hwif_to_node(ide_hwif_t *hwif) +{ + if (hwif->pci_dev) + return pcibus_to_node(hwif->pci_dev->bus); + else + /* Add ways to determine the node of other busses here */ + return -1; +} + #endif /* _IDE_H */ _