diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2009-08-20 03:53:49 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-09-05 10:36:13 -0400 |
commit | ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873 (patch) | |
tree | 61974bec8071cd483cd562bd465ed8a2adb09896 /drivers/scsi/mpt2sas | |
parent | 34a03bef2202d0c9983a8da0a8abaee37d285847 (diff) |
[SCSI] mpt2sas: Raid 10 Volume is showing as Raid 1E in dmesg
This patch modifies the slave_configure callback so the messages that get sent
to system log for RAID1E volumes contain the string "RAID10" instead of
"RAID1E". These messages contain information regarding what kind of scsi device
is being added. Certain OEMS can enable displaying the RAID10 string instead of
RAID1E via manufacturing page 10. The driver will read this config page at
driver load time, then determine from the GenericFlags0 bits whether display
the RAID10 or RAID1E string, also even drive count is taken into consideration.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <Eric.moore@lsi.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 7 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.h | 37 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_config.c | 61 | ||||
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 8 |
4 files changed, 109 insertions, 4 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 1cfb503125b6..2e4bc3d2b435 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
@@ -1542,6 +1542,8 @@ _base_display_ioc_capabilities(struct MPT2SAS_ADAPTER *ioc) | |||
1542 | (ioc->bios_pg3.BiosVersion & 0x0000FF00) >> 8, | 1542 | (ioc->bios_pg3.BiosVersion & 0x0000FF00) >> 8, |
1543 | ioc->bios_pg3.BiosVersion & 0x000000FF); | 1543 | ioc->bios_pg3.BiosVersion & 0x000000FF); |
1544 | 1544 | ||
1545 | _base_display_dell_branding(ioc); | ||
1546 | |||
1545 | printk(MPT2SAS_INFO_FMT "Protocol=(", ioc->name); | 1547 | printk(MPT2SAS_INFO_FMT "Protocol=(", ioc->name); |
1546 | 1548 | ||
1547 | if (ioc->facts.ProtocolFlags & MPI2_IOCFACTS_PROTOCOL_SCSI_INITIATOR) { | 1549 | if (ioc->facts.ProtocolFlags & MPI2_IOCFACTS_PROTOCOL_SCSI_INITIATOR) { |
@@ -1554,8 +1556,6 @@ _base_display_ioc_capabilities(struct MPT2SAS_ADAPTER *ioc) | |||
1554 | i++; | 1556 | i++; |
1555 | } | 1557 | } |
1556 | 1558 | ||
1557 | _base_display_dell_branding(ioc); | ||
1558 | |||
1559 | i = 0; | 1559 | i = 0; |
1560 | printk("), "); | 1560 | printk("), "); |
1561 | printk("Capabilities=("); | 1561 | printk("Capabilities=("); |
@@ -1627,6 +1627,9 @@ _base_static_config_pages(struct MPT2SAS_ADAPTER *ioc) | |||
1627 | u32 iounit_pg1_flags; | 1627 | u32 iounit_pg1_flags; |
1628 | 1628 | ||
1629 | mpt2sas_config_get_manufacturing_pg0(ioc, &mpi_reply, &ioc->manu_pg0); | 1629 | mpt2sas_config_get_manufacturing_pg0(ioc, &mpi_reply, &ioc->manu_pg0); |
1630 | if (ioc->ir_firmware) | ||
1631 | mpt2sas_config_get_manufacturing_pg10(ioc, &mpi_reply, | ||
1632 | &ioc->manu_pg10); | ||
1630 | mpt2sas_config_get_bios_pg2(ioc, &mpi_reply, &ioc->bios_pg2); | 1633 | mpt2sas_config_get_bios_pg2(ioc, &mpi_reply, &ioc->bios_pg2); |
1631 | mpt2sas_config_get_bios_pg3(ioc, &mpi_reply, &ioc->bios_pg3); | 1634 | mpt2sas_config_get_bios_pg3(ioc, &mpi_reply, &ioc->bios_pg3); |
1632 | mpt2sas_config_get_ioc_pg8(ioc, &mpi_reply, &ioc->ioc_pg8); | 1635 | mpt2sas_config_get_ioc_pg8(ioc, &mpi_reply, &ioc->ioc_pg8); |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h index 1f3efd6569d3..ff05ae1e43ba 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.h +++ b/drivers/scsi/mpt2sas/mpt2sas_base.h | |||
@@ -197,6 +197,38 @@ struct MPT2SAS_TARGET { | |||
197 | * @block: device is in SDEV_BLOCK state | 197 | * @block: device is in SDEV_BLOCK state |
198 | * @tlr_snoop_check: flag used in determining whether to disable TLR | 198 | * @tlr_snoop_check: flag used in determining whether to disable TLR |
199 | */ | 199 | */ |
200 | |||
201 | /* OEM Identifiers */ | ||
202 | #define MFG10_OEM_ID_INVALID (0x00000000) | ||
203 | #define MFG10_OEM_ID_DELL (0x00000001) | ||
204 | #define MFG10_OEM_ID_FSC (0x00000002) | ||
205 | #define MFG10_OEM_ID_SUN (0x00000003) | ||
206 | #define MFG10_OEM_ID_IBM (0x00000004) | ||
207 | |||
208 | /* GENERIC Flags 0*/ | ||
209 | #define MFG10_GF0_OCE_DISABLED (0x00000001) | ||
210 | #define MFG10_GF0_R1E_DRIVE_COUNT (0x00000002) | ||
211 | #define MFG10_GF0_R10_DISPLAY (0x00000004) | ||
212 | #define MFG10_GF0_SSD_DATA_SCRUB_DISABLE (0x00000008) | ||
213 | #define MFG10_GF0_SINGLE_DRIVE_R0 (0x00000010) | ||
214 | |||
215 | /* OEM Specific Flags will come from OEM specific header files */ | ||
216 | typedef struct _MPI2_CONFIG_PAGE_MAN_10 { | ||
217 | MPI2_CONFIG_PAGE_HEADER Header; /* 00h */ | ||
218 | U8 OEMIdentifier; /* 04h */ | ||
219 | U8 Reserved1; /* 05h */ | ||
220 | U16 Reserved2; /* 08h */ | ||
221 | U32 Reserved3; /* 0Ch */ | ||
222 | U32 GenericFlags0; /* 10h */ | ||
223 | U32 GenericFlags1; /* 14h */ | ||
224 | U32 Reserved4; /* 18h */ | ||
225 | U32 OEMSpecificFlags0; /* 1Ch */ | ||
226 | U32 OEMSpecificFlags1; /* 20h */ | ||
227 | U32 Reserved5[18]; /* 24h-60h*/ | ||
228 | } MPI2_CONFIG_PAGE_MAN_10, | ||
229 | MPI2_POINTER PTR_MPI2_CONFIG_PAGE_MAN_10, | ||
230 | Mpi2ManufacturingPage10_t, MPI2_POINTER pMpi2ManufacturingPage10_t; | ||
231 | |||
200 | struct MPT2SAS_DEVICE { | 232 | struct MPT2SAS_DEVICE { |
201 | struct MPT2SAS_TARGET *sas_target; | 233 | struct MPT2SAS_TARGET *sas_target; |
202 | unsigned int lun; | 234 | unsigned int lun; |
@@ -461,6 +493,7 @@ typedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr); | |||
461 | * @facts: static facts data | 493 | * @facts: static facts data |
462 | * @pfacts: static port facts data | 494 | * @pfacts: static port facts data |
463 | * @manu_pg0: static manufacturing page 0 | 495 | * @manu_pg0: static manufacturing page 0 |
496 | * @manu_pg10: static manufacturing page 10 | ||
464 | * @bios_pg2: static bios page 2 | 497 | * @bios_pg2: static bios page 2 |
465 | * @bios_pg3: static bios page 3 | 498 | * @bios_pg3: static bios page 3 |
466 | * @ioc_pg8: static ioc page 8 | 499 | * @ioc_pg8: static ioc page 8 |
@@ -663,6 +696,7 @@ struct MPT2SAS_ADAPTER { | |||
663 | dma_addr_t diag_buffer_dma[MPI2_DIAG_BUF_TYPE_COUNT]; | 696 | dma_addr_t diag_buffer_dma[MPI2_DIAG_BUF_TYPE_COUNT]; |
664 | u8 diag_buffer_status[MPI2_DIAG_BUF_TYPE_COUNT]; | 697 | u8 diag_buffer_status[MPI2_DIAG_BUF_TYPE_COUNT]; |
665 | u32 unique_id[MPI2_DIAG_BUF_TYPE_COUNT]; | 698 | u32 unique_id[MPI2_DIAG_BUF_TYPE_COUNT]; |
699 | Mpi2ManufacturingPage10_t manu_pg10; | ||
666 | u32 product_specific[MPI2_DIAG_BUF_TYPE_COUNT][23]; | 700 | u32 product_specific[MPI2_DIAG_BUF_TYPE_COUNT][23]; |
667 | u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; | 701 | u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; |
668 | }; | 702 | }; |
@@ -734,6 +768,8 @@ void mpt2sas_config_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 re | |||
734 | int mpt2sas_config_get_number_hba_phys(struct MPT2SAS_ADAPTER *ioc, u8 *num_phys); | 768 | int mpt2sas_config_get_number_hba_phys(struct MPT2SAS_ADAPTER *ioc, u8 *num_phys); |
735 | int mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, | 769 | int mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, |
736 | Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage0_t *config_page); | 770 | Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage0_t *config_page); |
771 | int mpt2sas_config_get_manufacturing_pg10(struct MPT2SAS_ADAPTER *ioc, | ||
772 | Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage10_t *config_page); | ||
737 | int mpt2sas_config_get_bios_pg2(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | 773 | int mpt2sas_config_get_bios_pg2(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t |
738 | *mpi_reply, Mpi2BiosPage2_t *config_page); | 774 | *mpi_reply, Mpi2BiosPage2_t *config_page); |
739 | int mpt2sas_config_get_bios_pg3(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | 775 | int mpt2sas_config_get_bios_pg3(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t |
@@ -776,7 +812,6 @@ int mpt2sas_config_get_volume_handle(struct MPT2SAS_ADAPTER *ioc, u16 pd_handle, | |||
776 | u16 *volume_handle); | 812 | u16 *volume_handle); |
777 | int mpt2sas_config_get_volume_wwid(struct MPT2SAS_ADAPTER *ioc, u16 volume_handle, | 813 | int mpt2sas_config_get_volume_wwid(struct MPT2SAS_ADAPTER *ioc, u16 volume_handle, |
778 | u64 *wwid); | 814 | u64 *wwid); |
779 | |||
780 | /* ctl shared API */ | 815 | /* ctl shared API */ |
781 | extern struct device_attribute *mpt2sas_host_attrs[]; | 816 | extern struct device_attribute *mpt2sas_host_attrs[]; |
782 | extern struct device_attribute *mpt2sas_dev_attrs[]; | 817 | extern struct device_attribute *mpt2sas_dev_attrs[]; |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_config.c b/drivers/scsi/mpt2sas/mpt2sas_config.c index 6ddee161beb3..b9f4d0f97e50 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_config.c +++ b/drivers/scsi/mpt2sas/mpt2sas_config.c | |||
@@ -426,6 +426,67 @@ mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, | |||
426 | } | 426 | } |
427 | 427 | ||
428 | /** | 428 | /** |
429 | * mpt2sas_config_get_manufacturing_pg10 - obtain manufacturing page 10 | ||
430 | * @ioc: per adapter object | ||
431 | * @mpi_reply: reply mf payload returned from firmware | ||
432 | * @config_page: contents of the config page | ||
433 | * Context: sleep. | ||
434 | * | ||
435 | * Returns 0 for success, non-zero for failure. | ||
436 | */ | ||
437 | int | ||
438 | mpt2sas_config_get_manufacturing_pg10(struct MPT2SAS_ADAPTER *ioc, | ||
439 | Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage10_t *config_page) | ||
440 | { | ||
441 | Mpi2ConfigRequest_t mpi_request; | ||
442 | int r; | ||
443 | struct config_request mem; | ||
444 | |||
445 | memset(config_page, 0, sizeof(Mpi2ManufacturingPage10_t)); | ||
446 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | ||
447 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | ||
448 | mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER; | ||
449 | mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_MANUFACTURING; | ||
450 | mpi_request.Header.PageNumber = 10; | ||
451 | mpi_request.Header.PageVersion = MPI2_MANUFACTURING0_PAGEVERSION; | ||
452 | mpt2sas_base_build_zero_len_sge(ioc, &mpi_request.PageBufferSGE); | ||
453 | r = _config_request(ioc, &mpi_request, mpi_reply, | ||
454 | MPT2_CONFIG_PAGE_DEFAULT_TIMEOUT); | ||
455 | if (r) | ||
456 | goto out; | ||
457 | |||
458 | mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; | ||
459 | mpi_request.Header.PageVersion = mpi_reply->Header.PageVersion; | ||
460 | mpi_request.Header.PageNumber = mpi_reply->Header.PageNumber; | ||
461 | mpi_request.Header.PageType = mpi_reply->Header.PageType; | ||
462 | mpi_request.Header.PageLength = mpi_reply->Header.PageLength; | ||
463 | mem.config_page_sz = le16_to_cpu(mpi_reply->Header.PageLength) * 4; | ||
464 | if (mem.config_page_sz > ioc->config_page_sz) { | ||
465 | r = _config_alloc_config_dma_memory(ioc, &mem); | ||
466 | if (r) | ||
467 | goto out; | ||
468 | } else { | ||
469 | mem.config_page_dma = ioc->config_page_dma; | ||
470 | mem.config_page = ioc->config_page; | ||
471 | } | ||
472 | ioc->base_add_sg_single(&mpi_request.PageBufferSGE, | ||
473 | MPT2_CONFIG_COMMON_SGLFLAGS | mem.config_page_sz, | ||
474 | mem.config_page_dma); | ||
475 | r = _config_request(ioc, &mpi_request, mpi_reply, | ||
476 | MPT2_CONFIG_PAGE_DEFAULT_TIMEOUT); | ||
477 | if (!r) | ||
478 | memcpy(config_page, mem.config_page, | ||
479 | min_t(u16, mem.config_page_sz, | ||
480 | sizeof(Mpi2ManufacturingPage10_t))); | ||
481 | |||
482 | if (mem.config_page_sz > ioc->config_page_sz) | ||
483 | _config_free_config_dma_memory(ioc, &mem); | ||
484 | |||
485 | out: | ||
486 | return r; | ||
487 | } | ||
488 | |||
489 | /** | ||
429 | * mpt2sas_config_get_bios_pg2 - obtain bios page 2 | 490 | * mpt2sas_config_get_bios_pg2 - obtain bios page 2 |
430 | * @ioc: per adapter object | 491 | * @ioc: per adapter object |
431 | * @mpi_reply: reply mf payload returned from firmware | 492 | * @mpi_reply: reply mf payload returned from firmware |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index 6e6d5af6b365..e71a6c04298b 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
@@ -1501,7 +1501,13 @@ _scsih_slave_configure(struct scsi_device *sdev) | |||
1501 | break; | 1501 | break; |
1502 | case MPI2_RAID_VOL_TYPE_RAID1E: | 1502 | case MPI2_RAID_VOL_TYPE_RAID1E: |
1503 | qdepth = MPT2SAS_RAID_QUEUE_DEPTH; | 1503 | qdepth = MPT2SAS_RAID_QUEUE_DEPTH; |
1504 | r_level = "RAID1E"; | 1504 | if (ioc->manu_pg10.OEMIdentifier && |
1505 | (ioc->manu_pg10.GenericFlags0 & | ||
1506 | MFG10_GF0_R10_DISPLAY) && | ||
1507 | !(raid_device->num_pds % 2)) | ||
1508 | r_level = "RAID10"; | ||
1509 | else | ||
1510 | r_level = "RAID1E"; | ||
1505 | break; | 1511 | break; |
1506 | case MPI2_RAID_VOL_TYPE_RAID1: | 1512 | case MPI2_RAID_VOL_TYPE_RAID1: |
1507 | qdepth = MPT2SAS_RAID_QUEUE_DEPTH; | 1513 | qdepth = MPT2SAS_RAID_QUEUE_DEPTH; |