Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Feb 2012 20:56:41 +0530
From:      "Desai, Kashyap" <Kashyap.Desai@lsi.com>
To:        Jason Wolfe <nitroboost@gmail.com>
Cc:        "freebsd-scsi@freebsd.org" <freebsd-scsi@freebsd.org>, "McConnell, Stephen" <Stephen.McConnell@lsi.com>
Subject:   RE: LSI2008 controller clobbers first disk with new LSI mps driver
Message-ID:  <B2FD678A64EAAD45B089B123FDFC3ED72B96D34626@inbmail01.lsi.com>
References:  <CAAAm0r2NFhF=eh2bOPMnVN8E6e2o0KfaST0N-M_gWoJHpFOLmQ@mail.gmail.com> <CAAAm0r37H0Pf_HvFTqo%2B1RSCV%2BBkzD5EcXj5M40H9xGREr%2Bfow@mail.gmail.com> <B2FD678A64EAAD45B089B123FDFC3ED72B96D344CA@inbmail01.lsi.com> <CAAAm0r3MVHZixAKDF=ChD977PbNUC8dyiBFB=NzC30S8FeZ3Nw@mail.gmail.com> <B2FD678A64EAAD45B089B123FDFC3ED72B96D344F2@inbmail01.lsi.com> <CAAAm0r02bXNve6Do5C1m1RyzLhWA9xx97KKMeLhcHC66U2SF4g@mail.gmail.com> <B2FD678A64EAAD45B089B123FDFC3ED72B96D34500@inbmail01.lsi.com> <CAFPOs6pwb44oNabH5vabDPJyFutMKa5mhgvHY=HkQVpV20YiYw@mail.gmail.com> <CAAAm0r1pWN-F=madGdk7N%2BoRuZmSD5_MAYwLh6By126L0CTGuw@mail.gmail.com> <B2FD678A64EAAD45B089B123FDFC3ED72B96D34558@inbmail01.lsi.com> <CAAAm0r1x15_ho2MD0tX7Y7A6mnU2N6zihNOz_Qz=jpsyBkDCWQ@mail.gmail.com> <B2FD678A64EAAD45B089B123FDFC3ED72B96D3455B@inbmail01.lsi.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Alternative to below approach. You can better try applying attached patch.

This patch will dump necessary information from you test.
Please send me dmesg log (same as last time verbose mps debug log)

` Kashyap

> -----Original Message-----
> From: Desai, Kashyap
> Sent: Monday, February 20, 2012 3:55 PM
> To: Jason Wolfe
> Cc: freebsd-scsi@freebsd.org; McConnell, Stephen
> Subject: RE: LSI2008 controller clobbers first disk with new LSI mps
> driver
> 
> Jason,
> 
> I tried to reproduce similar issue using multiple h/w but not success in
> reproduction.
> Also code does not looks very obvious issues which can be identify
> through code review.
> 
> Can you send me the output of below command.
> 
> "lsiutil -a 0 100 > /tmp/a.out"
> 
> ` Kashyap
> 
> > -----Original Message-----
> > From: owner-freebsd-scsi@freebsd.org [mailto:owner-freebsd-
> > scsi@freebsd.org] On Behalf Of Desai, Kashyap
> > Sent: Saturday, February 18, 2012 1:28 AM
> > To: Jason Wolfe
> > Cc: freebsd-scsi@freebsd.org; McConnell, Stephen
> > Subject: RE: LSI2008 controller clobbers first disk with new LSI mps
> > driver
> >
> > Jason,
> >
> > Thanks for the data. Now, I am able to understand real issue.  See
> below
> > details from debug logs.
> > See my comment with << marks.
> >
> > mps0: SAS Address from SAS device page0 = 5000c50033f5cdb5
> > mps0: Found device <401<SspTarg>,End Device> <6.0Gbps> <0x000a> <2/0>
> > mps0: Target id 0x8 added
> > <<------------------------------------->>
> > Here suppose to be a boot device and it is device connected to slot-0,
> > detected
> > Very well as first device at driver. Assigned Target id = 8.
> > This is as expected.
> > <<------------------------------------->>
> > mps0: SAS Address from SAS device page0 = 5000c50033f49c01
> > mps0: Found device <401<SspTarg>,End Device> <6.0Gbps> <0x000b> <2/1>
> > mps0: Target id 0x9 added
> > mps0: SAS Address from SAS device page0 = 5000c50033f6c799
> > mps0: Found device <401<SspTarg>,End Device> <6.0Gbps> <0x000c> <2/2>
> > mps0: Target id 0xa added
> > mps0: SAS Address from SAS device page0 = 5000c50033e562f5
> > mps0: Found device <401<SspTarg>,End Device> <6.0Gbps> <0x000d> <2/3>
> > mps0: Target id 0xb added
> > mps0: SAS Address from SAS device page0 = 5000c50033f49a41
> > mps0: Found device <401<SspTarg>,End Device> <6.0Gbps> <0x000e> <2/4>
> > mps0: Target id 0xc added
> > mps0: SAS Address from SAS device page0 = 5000c50033f5efe9
> > mps0: Found device <401<SspTarg>,End Device> <6.0Gbps> <0x000f> <2/5>
> > mps0: Target id 0xd added
> > mps0: SAS Address from SAS device page0 = 5000c50033f49a11
> > mps0: Found device <401<SspTarg>,End Device> <6.0Gbps> <0x0010> <2/6>
> > mps0: Target id 0xe added
> > mps0: SAS Address from SAS device page0 = 5000c50033f49c71
> > mps0: Found device <401<SspTarg>,End Device> <6.0Gbps> <0x0011> <2/7>
> > mps0: Target id 0xf added
> > mps0: SAS Address from SAS device page0 = 5000c50033f40fb1
> > mps0: Found device <401<SspTarg>,End Device> <6.0Gbps> <0x0012> <2/8>
> > mps0: Target id 0x10 added
> > mps0: SAS Address from SAS device page0 = 5000c50033f6cba9
> > mps0: Found device <401<SspTarg>,End Device> <6.0Gbps> <0x0013> <2/9>
> > mps0: Target id 0x11 added
> > mps0: (13)->(mpssas_fw_work) Event Free: [1c]
> > mps0: (13)->(mpssas_fw_work) Working on  Event: [1c]
> > mps0: SAS Address from SAS device page0 = 5000c50033f650cd
> > mps0: Found device <401<SspTarg>,End Device> <6.0Gbps> <0x0014> <2/10>
> > mps0: Target id 0x12 added
> > mps0: SAS Address from SAS device page0 = 5000c50033f29109
> > mps0: Found device <401<SspTarg>,End Device> <6.0Gbps> <0x0015> <2/11>
> > mps0: Target id 0x13 added
> > <<-- Now Driver detects SES devices. -->>
> > _But_ unfortunetly driver assign Target-id = 8 to the SES device.
> > This will override device mapping table of Drive and Target-id = 8 is
> no
> > more your boot device which was detected very first.
> > This needs to be fix in driver. I am currently not in office. (Working
> > at Asia pacific time zone)
> > I will have a look of this and provide you some solution.
> > <<------------------------------------->>
> > mps0: SAS Address from SAS device page0 = 500304800126e3fd
> > mps0: Found device <4451<SmpInit,SspInit,SspTarg,SepDev>,End Device>
> > <6.0Gbps> <0x0016> <2/0>
> > mps0: Target id 0x8 added
> > mps0: mpssas_startup_decrement releasing simq
> > mps0: Queueing rescan for (xpt0:mps0:0:-1:-1):
> >
> >
> > ~ Kashyap
> >
> > > -----Original Message-----
> > > From: Jason Wolfe [mailto:nitroboost@gmail.com]
> > > Sent: Saturday, February 18, 2012 1:00 AM
> > > To: Desai, Kashyap
> > > Cc: Maksim Yevmenkin; freebsd-scsi@freebsd.org
> > > Subject: Re: LSI2008 controller clobbers first disk with new LSI mps
> > > driver
> > >
> > > Kashyap,
> > >
> > > The boot drive is always the first disk, enclosure 0, and should be
> > da0.
> > > It is the same model as the other 11 disks also.
> > >
> > > PCI  ENCL LUN VENDOR   PRODUCT          PRODUCT     SIZE \
> > > SLOT SLOT NUM NAME     IDENTIFIER       REVISION    NVDATA
> > > ---- ---- --- -------- ---------------- ----------- ---------
> > >   5           LSI      SAS2008-IT       10.00.02.00  0A:02:00:04
> > >   5    0   0  SEAGATE  ST91000640SS     0001           953 GB
> > > <-------- boot drive/wanted da0/masked by ses device
> > >   5    1   0  SEAGATE  ST91000640SS     0001           953 GB
> > >   5    2   0  SEAGATE  ST91000640SS     0001           953 GB
> > >   5    3   0  SEAGATE  ST91000640SS     0001           953 GB
> > >   5    4   0  SEAGATE  ST91000640SS     0001           953 GB
> > >   5    5   0  SEAGATE  ST91000640SS     0001           953 GB
> > >   5    6   0  SEAGATE  ST91000640SS     0001           953 GB
> > >   5    7   0  SEAGATE  ST91000640SS     0001           953 GB
> > >   5    8   0  SEAGATE  ST91000640SS     0001           953 GB
> > >   5    9   0  SEAGATE  ST91000640SS     0001           953 GB
> > >   5   10   0  SEAGATE  ST91000640SS     0001           953 GB
> > >   5   11   0  SEAGATE  ST91000640SS     0001           953 GB
> > >
> > > Attached is the verbose dmesg with the mps.debuglevel set.
> > >
> > > Jason
> > >
> > > On Fri, Feb 17, 2012 at 11:54 AM, Desai, Kashyap
> > <Kashyap.Desai@lsi.com>
> > > wrote:
> > > >
> > > >
> > > > OK, So you have your / partion on da0. (this drive is attached to
> > > > which phy ?) Since all Drive are from same manufacture and Same
> > > variant, it is difficult to collect data from this dmesg log.
> > > >
> > > > Can you put the following in /boot/loader.conf:
> > > >
> > > > hw.mps.debug_level=0xd
> > > >
> > > > Here is some context of the target id generation logic in <mps>
> > > >
> > > > Older driver available in FreeBSD-8 Stable, will not have any
> logic
> > in
> > > driver to generate Target id mapping.
> > > > So it will give da0 device name to the drive which is detected
> First
> > > by FW.
> > > >
> > > > With newer driver story is little different. Drive will find the
> DPM
> > > > page in FW for particular drive detected by FW and it will do
> > mapping
> > > Either by Enclosure slot mapping / Device mapping.
> > > >
> > > > I am trying to see how best I can solve your issue.
> > > >
> > > > Also, In this case which device has actually you wants to be da0 ?
> (
> > I
> > > > mean boot driver has got which device name ? )
> > > >
> > > > Let me see your another dmesg output.
> > > >
> > > > ` Kashyap
> > _______________________________________________
> > freebsd-scsi@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-scsi
> > To unsubscribe, send any mail to "freebsd-scsi-
> unsubscribe@freebsd.org"

[-- Attachment #2 --]
Index: mps_mapping.c
===================================================================
--- mps_mapping.c	(revision 231936)
+++ mps_mapping.c	(working copy)
@@ -1458,7 +1458,35 @@
 	free(sc->dpm_pg0, M_MPT2);
 }
 
+static void dump_all_fw_dpm_pg0(struct mps_softc *sc) 
+{
+		Mpi2DriverMap0Entry_t *dpm_entry;
+		u16 entry_num;
+		// Skip the header
+		dpm_entry = (Mpi2DriverMap0Entry_t *) ((uint8_t *) sc->dpm_pg0 +
+	    sizeof(MPI2_CONFIG_EXTENDED_PAGE_HEADER));
+		printf("Dump Complete DPM FW Pages...........!\n");
+		printf("#############################################\n");
+		printf("(Entry)  physical_id \t : Mapping Info:\t DeviceIndex:\t PhysicalBitsMapping\n");
+		for (entry_num = 0; entry_num < sc->max_dpm_entries; entry_num++, 
+	    		dpm_entry++) {
+				printf(" (%x)   %08x", entry_num, dpm_entry->PhysicalIdentifier.High);
+				printf(" %08x \t", dpm_entry->PhysicalIdentifier.Low);
+				printf(" %08x \t", dpm_entry->MappingInformation);
+				printf(" %08x \t", dpm_entry->DeviceIndex);
+				printf(" %08x \n", dpm_entry->PhysicalBitsMapping);
+		}
+		printf("#############################################\n");
+}	
 
+static void dump_fw_dpm_pg0(Mpi2DriverMap0Entry_t *dpm_entry)
+{
+		printf("       %08x", dpm_entry->PhysicalIdentifier.High);
+		printf(" %08x \t", dpm_entry->PhysicalIdentifier.Low);
+		printf(" %08x \t", dpm_entry->MappingInformation);
+		printf(" %08x \t", dpm_entry->DeviceIndex);
+		printf(" %08x \n", dpm_entry->PhysicalBitsMapping);
+}	
 static void
 _mapping_process_dpm_pg0(struct mps_softc *sc)
 {
@@ -1472,6 +1500,9 @@
 	struct enc_mapping_table *et_entry;
 	u64 physical_id;
 	u32 phy_bits = 0;
+	
+	// Dump All dpm entry to debug
+	dump_all_fw_dpm_pg0(sc);	
 
 	if (sc->ir_firmware)
 		_mapping_get_ir_maprange(sc, &start_idx, &end_idx);
@@ -1487,6 +1518,8 @@
 			sc->dpm_entry_used[entry_num] = 0;
 			continue;
 		}
+		// Dump dpm entry to debug
+		dump_fw_dpm_pg0(dpm_entry);	
 		sc->dpm_entry_used[entry_num] = 1;
 		dpm_entry->MappingInformation = le16toh(dpm_entry->
 		    MappingInformation);
@@ -1834,6 +1867,31 @@
 }
 
 /**
+ * mps_dump_dev_mapping_table - Dump Device mpapping table
+ * @sc: per adapter object
+ *
+ */
+void mps_dump_dev_mapping_table(struct mps_softc *sc)
+{
+	u32 map_idx;
+	struct dev_mapping_table *mt_entry;
+
+	printf("Index \t physical_id \t : phy_bits:\t dpm_entry_num:\t  dev_handle:\t   id:\t    missing_count\n");
+	for (map_idx = 0; map_idx < sc->max_devices; map_idx++) {
+		mt_entry = &sc->mapping_table[map_idx];
+		if(mt_entry->physical_id == 0)
+			continue;
+
+		printf("(%x) %016lx:\t", map_idx, mt_entry->physical_id);
+		printf(" %08x:\t", mt_entry->phy_bits);
+		printf(" %08x:\t", mt_entry->dpm_entry_num);
+		printf(" %08x:\t", mt_entry->dev_handle);
+		printf(" %08x:\t", mt_entry->id);
+		printf(" %08x:\n", mt_entry->missing_count);
+	}
+
+}
+/**
  * mps_mapping_get_sas_id_from_handle - find a target id in mapping table using
  * only the dev handle.  This is just a wrapper function for the local function
  * _mapping_get_mt_idx_from_handle.
Index: mps_sas_lsi.c
===================================================================
--- mps_sas_lsi.c	(revision 231936)
+++ mps_sas_lsi.c	(working copy)
@@ -625,6 +625,8 @@
 	sas_address = (sas_address << 32) | 
 	    config_page.SASAddress.Low;
 
+	mps_dump_dev_mapping_table(sc);
+
 	if ((ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_MASK_MAPPING_MODE)
 		    == MPI2_IOCPAGE8_FLAGS_DEVICE_PERSISTENCE_MAPPING) {
 		if (device_info & MPI2_SAS_DEVICE_INFO_SATA_DEVICE) {
Index: mpsvar.h
===================================================================
--- mpsvar.h	(revision 231936)
+++ mpsvar.h	(working copy)
@@ -742,6 +742,7 @@
 void mps_mapping_check_devices(struct mps_softc *, int);
 int mps_mapping_allocate_memory(struct mps_softc *sc);
 unsigned int mps_mapping_get_sas_id(struct mps_softc *, uint64_t , u16);
+void mps_dump_dev_mapping_table(struct mps_softc *);
 unsigned int mps_mapping_get_sas_id_from_handle(struct mps_softc *sc,
     u16 handle);
 unsigned int mps_mapping_get_raid_id(struct mps_softc *sc, u64 wwid,

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B2FD678A64EAAD45B089B123FDFC3ED72B96D34626>