Commit b02d735b authored by Haren Myneni's avatar Haren Myneni Committed by Eric W. Biederman
Browse files

ppc64 kdump device_tree sort



Mohan Kumar M wrote:

>Hi,
>
>I am testing kexec/kdump functionality on a POWER5 box with 2.6.16-rc2 kernel.
>
>POWER5 box has 4 Mylex SCSI RAID controllers. But only 2 host controllers have
>SCSI disks connected. First controller [A] has one scsi disk and next
>controller [B] has three scsi disks.
>
>When I boot the kernel from yaboot, controller A becomes scsi0. controller B
>becomes scsi1. SCSI disk attached to controller A(scsi0) is sda.
>
>When I do kexec boot, the order of SCSI host controllers change. Controller B
>becomes scsi0 and controller A becomes scsi1 and hence disk attached to
>controller A becomes sdd and disks attached to controller B become sda, sdb and
>sdc. This results in mounting problem and kernel panics.
>
>I am attaching the partial diff between yaboot and kexec IPR initialization
>messages during boot for your reference.
>
>Why when we are doing kexec boot, the SCSI host controllers order get changed?
>It is related to device-tree ordering?
>
>Regards,
>Mohan.
>
>
>------------------------------------------------------------------------
>
>--- 2616rc2.ipr	2006-02-16 19:13:45.000000000 +0530
>+++ 2616rc2-kexec.ipr	2006-02-16 19:14:12.000000000 +0530
>@@ -1,98 +1,87 @@
> ipr: IBM Power RAID SCSI Device Driver version: 2.1.1 (November 15, 2005)
>-ipr 0000:c0:01.0: Found IOA with IRQ: 99
>-ipr 0000:c0:01.0: Starting IOA initialization sequence.
>-ipr 0000:c0:01.0: Adapter firmware version: 020A005E
>-ipr 0000:c0:01.0: IOA initialized.
>+ipr 0000:c8:01.0: Found IOA with IRQ: 103
>+ipr 0000:c8:01.0: Initializing IOA.
>+ipr 0000:c8:01.0: Starting IOA initialization sequence.
>+ipr 0000:c8:01.0: Adapter firmware version: 020A005E
>+ipr 0000:c8:01.0: IOA initialized.
> scsi0 : IBM 570B Storage Adapter
>-  Vendor: IBM       Model: HUS103014FL3800   Rev: RPQF
>-  Type:   Direct-Access                      ANSI SCSI revision: 04
>   Vendor: IBM       Model: VSBPD3E   U4SCSI  Rev: 4812
>   Type:   Enclosure                          ANSI SCSI revision: 02
> scsi: unknown device type 31
>   Vendor: IBM       Model: 570B001           Rev: 0150
>   Type:   Unknown                            ANSI SCSI revision: 00
>-PCI: Enabling device: (0002:c8:01.0), cmd 142
>-ipr 0002:c8:01.0: Found IOA with IRQ: 133
>-ipr 0002:c8:01.0: Initializing IOA.
>-ipr 0002:c8:01.0: Starting IOA initialization sequence.
>-ipr 0002:c8:01.0: Adapter firmware version: 020A005E
>-ipr 0002:c8:01.0: IOA initialized.
>+ipr 0002:c0:01.0: Found IOA with IRQ: 69
>+ipr 0002:c0:01.0: Initializing IOA.
>+ipr 0002:c0:01.0: Starting IOA initialization sequence.
>+ipr 0002:c0:01.0: Adapter firmware version: 020A005E
>+ipr 0002:c0:01.0: IOA initialized.
> scsi1 : IBM 570B Storage Adapter
>-  Vendor: IBM       Model: HUS103014FL3800   Rev: RPQF
>-  Type:   Direct-Access                      ANSI SCSI revision: 04
>-  Vendor: IBM       Model: HUS103014FL3800   Rev: RPQF
>-  Type:   Direct-Access                      ANSI SCSI revision: 04
>-  Vendor: IBM       Model: HUS103014FL3800   Rev: RPQF
>-  Type:   Direct-Access                      ANSI SCSI revision: 04
>   Vendor: IBM       Model: VSBPD3E   U4SCSI  Rev: 4812
>   Type:   Enclosure                          ANSI SCSI revision: 02
> scsi: unknown device type 31
>   Vendor: IBM       Model: 570B001           Rev: 0150
>   Type:   Unknown                            ANSI SCSI revision: 00
>-PCI: Enabling device: (0003:c0:01.0), cmd 142
>-ipr 0003:c0:01.0: Found IOA with IRQ: 69
>-ipr 0003:c0:01.0: Initializing IOA.
>-ipr 0003:c0:01.0: Starting IOA initialization sequence.
>-ipr 0003:c0:01.0: Adapter firmware version: 020A005E
>-ipr 0003:c0:01.0: IOA initialized.
>+ipr 0003:c8:01.0: Found IOA with IRQ: 133
>+ipr 0003:c8:01.0: Initializing IOA.
>+ipr 0003:c8:01.0: Starting IOA initialization sequence.
>+ipr 0003:c8:01.0: Adapter firmware version: 020A005E
>+ipr 0003:c8:01.0: IOA initialized.
> scsi2 : IBM 570B Storage Adapter
>+  Vendor: IBM       Model: HUS103014FL3800   Rev: RPQF
>+  Type:   Direct-Access                      ANSI SCSI revision: 04
>+  Vendor: IBM       Model: HUS103014FL3800   Rev: RPQF
>+  Type:   Direct-Access                      ANSI SCSI revision: 04
>+  Vendor: IBM       Model: HUS103014FL3800   Rev: RPQF
>+  Type:   Direct-Access                      ANSI SCSI revision: 04
>   Vendor: IBM       Model: VSBPD3E   U4SCSI  Rev: 4812
>   Type:   Enclosure                          ANSI SCSI revision: 02
> scsi: unknown device type 31
>   Vendor: IBM       Model: 570B001           Rev: 0150
>   Type:   Unknown                            ANSI SCSI revision: 00
>-PCI: Enabling device: (0005:c8:01.0), cmd 142
>-ipr 0005:c8:01.0: Found IOA with IRQ: 105
>-ipr 0005:c8:01.0: Initializing IOA.
>-ipr 0005:c8:01.0: Starting IOA initialization sequence.
>-ipr 0005:c8:01.0: Adapter firmware version: 020A005E
>-ipr 0005:c8:01.0: IOA initialized.
>+ipr 0005:c0:01.0: Found IOA with IRQ: 99
>+ipr 0005:c0:01.0: Initializing IOA.
>+ipr 0005:c0:01.0: Starting IOA initialization sequence.
>+ipr 0005:c0:01.0: Adapter firmware version: 020A005E
>+ipr 0005:c0:01.0: IOA initialized.
> scsi3 : IBM 570B Storage Adapter
>+  Vendor: IBM       Model: HUS103014FL3800   Rev: RPQF
>+  Type:   Direct-Access                      ANSI SCSI revision: 04
>   Vendor: IBM       Model: VSBPD3E   U4SCSI  Rev: 4812
>   Type:   Enclosure                          ANSI SCSI revision: 02
> scsi: unknown device type 31
>   Vendor: IBM       Model: 570B001           Rev: 0150
>   Type:   Unknown                            ANSI SCSI revision: 00
>-vio_register_driver: driver ibmvscsi registering
> st: Version 20050830, fixed bufsize 32768, s/g segs 256
> SCSI device sda: 286748000 512-byte hdwr sectors (146815 MB)
> sda: Write Protect is off
>-sda: Mode Sense: d3 00 10 08
> SCSI device sda: drive cache: write through w/ FUA
> SCSI device sda: 286748000 512-byte hdwr sectors (146815 MB)
> sda: Write Protect is off
>-sda: Mode Sense: d3 00 10 08
> SCSI device sda: drive cache: write through w/ FUA
>- sda: sda1 sda2 sda3 sda4 < sda5 >
>-sd 0:0:5:0: Attached scsi disk sda
>+ sda: unknown partition table
>+sd 2:0:3:0: Attached scsi disk sda
> SCSI device sdb: 286748000 512-byte hdwr sectors (146815 MB)
> sdb: Write Protect is off
>-sdb: Mode Sense: d3 00 10 08
> SCSI device sdb: drive cache: write through w/ FUA
> SCSI device sdb: 286748000 512-byte hdwr sectors (146815 MB)
> sdb: Write Protect is off
>-sdb: Mode Sense: d3 00 10 08
> SCSI device sdb: drive cache: write through w/ FUA
>  sdb: unknown partition table
>-sd 1:0:3:0: Attached scsi disk sdb
>+sd 2:0:4:0: Attached scsi disk sdb
> SCSI device sdc: 286748000 512-byte hdwr sectors (146815 MB)
> sdc: Write Protect is off
>-sdc: Mode Sense: d3 00 10 08
> SCSI device sdc: drive cache: write through w/ FUA
> SCSI device sdc: 286748000 512-byte hdwr sectors (146815 MB)
> sdc: Write Protect is off
>-sdc: Mode Sense: d3 00 10 08
> SCSI device sdc: drive cache: write through w/ FUA
>- sdc: unknown partition table
>-sd 1:0:4:0: Attached scsi disk sdc
>+ sdc: sdc1 sdc2 sdc3 sdc4
>+sd 2:0:5:0: Attached scsi disk sdc
> SCSI device sdd: 286748000 512-byte hdwr sectors (146815 MB)
> sdd: Write Protect is off
>-sdd: Mode Sense: d3 00 10 08
> SCSI device sdd: drive cache: write through w/ FUA
> SCSI device sdd: 286748000 512-byte hdwr sectors (146815 MB)
> sdd: Write Protect is off
>-sdd: Mode Sense: d3 00 10 08
> SCSI device sdd: drive cache: write through w/ FUA
>- sdd: sdd1 sdd2 sdd3 sdd4
>-sd 1:0:5:0: Attached scsi disk sdd
>+ sdd: sdd1 sdd2 sdd3 sdd4 < sdd5 >
>+sd 3:0:5:0: Attached scsi disk sdd
>
>
>
Mohan,

Attaching a patch  which should fix your device ordering issue.

In kexec-tools, the device-tree directory entries will be sorted in the
ascending order (assuming, even in the first kernel, PCI device entries
in /proc/device-tree are created in the same order when PCI probe
happens. I will confirm later). Also added set_proper_root_device_name()
to get the proper device name from /dev/disk/by_id such that persistent
partition name will be passed. But, kdump boot is not successful and
failed when the mount root partition happens (mount -o ro /dev/<name>).
Hence commented the code at this moment and will be looking into it
later. However, this patch should fix your issue since we are
rearranging the device-tree entries. This patch needs some more testing
and let me know if it works.

I tested on JS20 where ethernet device names getting changed in kdump
boot due to the device-tree ordering issue. With this fix, getting same
ethernet names even in the kdump boot.  However, I could not test the
SCSI issue the you found since my system is having only one disk.
However, tested on my P5 box to make sure that it does not break on my
P5 box.

Thanks
Haren

Signed-off-by: default avatarManeesh Soni <maneesh@in.ibm.com>
parent 8e8a420d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment