2008-12-05 13:26:27

by cheng renquan

[permalink] [raw]
Subject: [PATCH 1/2] mpt fusion: updated mpt drivers from lsi upstream "4.00.43.00"

From: Cheng Renquan <[email protected]>

Occasionally I'm working with LSI SAS 1068E controllers on 2.6.26.2 kernel,
it has a nasty bug that some hotplugged disks cannot be auto discovered,
the detailed description is on bugzilla.kernel:

http://bugzilla.kernel.org/show_bug.cgi?id=12163

After some inspecting the vendor's website, I found there are "4.00.43.00"
drivers for RHEL5.1, but the drivers in main stream kernel are still "3.04.07",
and the changelogs of "4.00.43.00" have records on solving that BUG,

but the default "4.00.43.00" downloaded from lsi.com cannot even build on
kernel-2.6.26.2, and after some work, I get it run on 2.6.26.2, then can build
with mainstream git kernel (the HEAD currently),

http://www.lsi.com/storage_home/products_home/standard_product_ics/sas_ics/lsisas1068e/index.html

-#define MPT_LINUX_VERSION_COMMON "3.04.07"
+#define MPT_LINUX_VERSION_COMMON "4.00.43.00"

This patch is just the upstream "4.00.43.00", it's very big, about 130K after
bzip2'ed, so I upload it to bugzilla.kernel, can now be downloaded from

http://bugzilla.kernel.org/attachment.cgi?id=19155

You can also download the tarball from the vendor's website and
extract them into drivers/, instead of applying this patch.

the next one is the adjusting for mainstream git kernel.

Signed-off-by: LSI Corparation <[email protected]>
Signed-off-by: Cheng Renquan <[email protected]>


2008-12-05 13:26:40

by cheng renquan

[permalink] [raw]
Subject: [PATCH 2/2] mpt fusion: port "4.00.43.00" to mainstream git kernel

From: Cheng Renquan <[email protected]>

this one just can build with mainstream git kernel, I did not even test it.

I just have tested it with kernel 2.6.26.2, that patch is very similar to
this, and it did work well with 2.6.26.2.

Signed-off-by: Cheng Renquan <[email protected]>
---
drivers/message/fusion/linux_compat.h | 3 +-
drivers/message/fusion/mptbase.c | 10 +-
drivers/message/fusion/mptbase.h | 6 +-
drivers/message/fusion/mptfc.c | 4 +-
drivers/message/fusion/mptsas.c | 14 +---
drivers/message/fusion/mptscsih.c | 169 +++++++++++++--------------------
drivers/message/fusion/mptscsih.h | 2 +-
7 files changed, 79 insertions(+), 129 deletions(-)

diff --git a/drivers/message/fusion/linux_compat.h b/drivers/message/fusion/linux_compat.h
index 24ad3f1..92e9797 100644
--- a/drivers/message/fusion/linux_compat.h
+++ b/drivers/message/fusion/linux_compat.h
@@ -31,7 +31,6 @@ static inline void *shost_private(struct Scsi_Host *shost)
#define spi_dv_pending(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_pending)
#endif

-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
/**
* mpt_scsilun_to_int: convert a scsi_lun to an int
* @scsilun: struct scsi_lun to be converted.
@@ -62,7 +61,7 @@ static inline int mpt_scsilun_to_int(struct scsi_lun *scsilun)
scsilun->scsi_lun[i + 1]) << (i * 8));
return lun;
}
-#endif
+
#if (defined(CONFIG_SUSE_KERNEL) && !defined(scsi_is_sas_phy_local))
#define SUSE_KERNEL_BASE 1
#endif
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 2979b63..36dd62a 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1618,7 +1618,7 @@ mpt_mapresources(MPT_ADAPTER *ioc)
}
#else
ioc->bars = pci_select_bars(pdev, IORESOURCE_MEM);
- if (pci_enable_device_bars(pdev, ioc->bars)) {
+ if (pci_enable_device(pdev)) {
printk(MYIOC_s_ERR_FMT "pci_enable_device_bars() with MEM "
"failed\n",ioc->name);
return r;
@@ -1826,7 +1826,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
#endif

/* Initialize workqueue */
- snprintf(ioc->reset_work_q_name, KOBJ_NAME_LEN, "mpt_poll_%d", ioc->id);
+ snprintf(ioc->reset_work_q_name, sizeof(ioc->reset_work_q_name),
+ "mpt_poll_%d", ioc->id);
ioc->reset_work_q =
create_singlethread_workqueue(ioc->reset_work_q_name);
if (!ioc->reset_work_q) {
@@ -1949,7 +1950,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)

INIT_LIST_HEAD(&ioc->fw_event_list);
spin_lock_init(&ioc->fw_event_lock);
- snprintf(ioc->fw_event_q_name, KOBJ_NAME_LEN, "mpt/%d", ioc->id);
+ snprintf(ioc->fw_event_q_name, sizeof(ioc->fw_event_q_name),
+ "mpt/%d", ioc->id);
ioc->fw_event_q = create_singlethread_workqueue(ioc->fw_event_q_name);

if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,
@@ -2303,7 +2305,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
pci_release_selected_regions(ioc->pcidev, ioc->bars);
ioc->bars = pci_select_bars(ioc->pcidev, IORESOURCE_MEM |
IORESOURCE_IO);
- if (pci_enable_device_bars(ioc->pcidev, ioc->bars))
+ if (pci_enable_device(ioc->pcidev))
return -5;
if (pci_request_selected_regions(ioc->pcidev, ioc->bars,
"mpt"))
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index 73b326d..63f74be 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -711,7 +711,7 @@ typedef struct _MPT_ADAPTER
struct list_head fw_event_list;
spinlock_t fw_event_lock;
u8 fw_events_off; /* if '1', then ignore events */
- char fw_event_q_name[KOBJ_NAME_LEN];
+ char fw_event_q_name[20];

struct mptsas_portinfo *hba_port_info; /* port_info object for the host */
u64 hba_port_sas_addr;
@@ -734,7 +734,7 @@ typedef struct _MPT_ADAPTER
u8 num_ports;
#endif

- char reset_work_q_name[KOBJ_NAME_LEN];
+ char reset_work_q_name[20];
struct workqueue_struct *reset_work_q;
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19))
struct delayed_work fault_reset_work;
@@ -747,7 +747,7 @@ typedef struct _MPT_ADAPTER
u8 fc_link_speed[2];
spinlock_t fc_rescan_work_lock;
struct work_struct fc_rescan_work;
- char fc_rescan_work_q_name[KOBJ_NAME_LEN];
+ char fc_rescan_work_q_name[20];
struct workqueue_struct *fc_rescan_work_q;
unsigned long hard_resets; /* driver forced bus resets count */
unsigned long soft_resets; /* fw/external bus resets count */
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index 0e943ba..bfb18c8 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -1398,8 +1398,8 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)

/* initialize workqueue */

- snprintf(ioc->fc_rescan_work_q_name, KOBJ_NAME_LEN, "mptfc_wq_%d",
- sh->host_no);
+ snprintf(ioc->fc_rescan_work_q_name, sizeof(ioc->fc_rescan_work_q_name),
+ "mptfc_wq_%d", sh->host_no);
ioc->fc_rescan_work_q =
create_singlethread_workqueue(ioc->fc_rescan_work_q_name);
if (!ioc->fc_rescan_work_q)
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index ee1edaf..4218686 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -147,11 +147,7 @@ static int mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *por
static void mptsas_scan_sas_topology(MPT_ADAPTER *ioc);
static void mptsas_not_responding_devices(MPT_ADAPTER *ioc);

-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19))
static void mptsas_firmware_event_work(struct work_struct *work);
-#else
-static void mptsas_firmware_event_work(void *arg);
-#endif

/**
* mptsas_set_sdev_queue_depth - global setting of the mpt_sdev_queue_depth
@@ -4847,16 +4843,10 @@ mptsas_handle_queue_full_event(struct fw_event_work *fw_event)
*
*/
static void
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19))
mptsas_firmware_event_work(struct work_struct *work)
{
- struct mptsas_hotplug_event *ev =
- container_of(work, struct fw_event_work, fw_event.work);
-#else
-mptsas_firmware_event_work(void *arg)
-{
- struct fw_event_work *fw_event = (struct fw_event_work *)arg;
-#endif
+ struct fw_event_work *fw_event =
+ container_of(work, struct fw_event_work, work.work);
MPT_ADAPTER *ioc = fw_event->ioc;

/* special rescan topology handling */
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 9f0106e..e358f72 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -199,30 +199,13 @@ mptscsih_AddSGE(MPT_ADAPTER *ioc, struct scsi_cmnd *SCpnt,
/* Map the data portion, if any.
* sges_left = 0 if no data transfer.
*/
- if ( (sges_left = SCpnt->use_sg) ) {
- sges_left = pci_map_sg(ioc->pcidev,
- (struct scatterlist *) SCpnt->request_buffer,
- SCpnt->use_sg,
- SCpnt->sc_data_direction);
- if (sges_left == 0)
- return FAILED;
- } else if (SCpnt->request_bufflen) {
- SCpnt->SCp.dma_handle = pci_map_single(ioc->pcidev,
- SCpnt->request_buffer,
- SCpnt->request_bufflen,
- SCpnt->sc_data_direction);
- dsgprintk(ioc, printk(MYIOC_s_DEBUG_FMT "SG: non-SG for %p, len=%d\n",
- ioc->name, SCpnt, SCpnt->request_bufflen));
- ioc->add_sge((char *) &pReq->SGL,
- 0xD1000000|sgdir|SCpnt->request_bufflen,
- SCpnt->SCp.dma_handle);
-
- return SUCCESS;
- }
+ sges_left = scsi_dma_map(SCpnt);
+ if (sges_left < 0)
+ return FAILED;

/* Handle the SG case.
*/
- sg = (struct scatterlist *) SCpnt->request_buffer;
+ sg = scsi_sglist(SCpnt);
sg_done = 0;
sgeOffset = sizeof(SCSIIORequest_t) - sizeof(SGE_IO_UNION);
chainSge = NULL;
@@ -246,7 +229,7 @@ nextSGEset:
for (ii=0; ii < (numSgeThisFrame-1); ii++) {
thisxfer = sg_dma_len(sg);
if (thisxfer == 0) {
- sg ++; /* Get next SG element from the OS */
+ sg = sg_next(sg); /* Get next SG element from the OS */
sg_done++;
continue;
}
@@ -254,7 +237,7 @@ nextSGEset:
v2 = sg_dma_address(sg);
ioc->add_sge(psge, sgflags | thisxfer, v2);

- sg++; /* Get next SG element from the OS */
+ sg = sg_next(sg); /* Get next SG element from the OS */
psge += ioc->SGE_size;
sgeOffset += ioc->SGE_size;
sg_done++;
@@ -544,7 +527,7 @@ mptscsih_info_scsiio(MPT_ADAPTER *ioc, struct scsi_cmnd *sc, SCSIIOReply_t * pSc
printk(MYIOC_s_DEBUG_FMT "\tfw_channel = %d, fw_id = %d, lun = %d\n",
ioc->name, pScsiReply->Bus, pScsiReply->TargetID, sc->device->lun);
printk(MYIOC_s_DEBUG_FMT "\trequest_len = %d, underflow = %d, resid = %d\n",
- ioc->name, sc->request_bufflen, sc->underflow, sc->resid);
+ ioc->name, scsi_bufflen(sc), sc->underflow, scsi_get_resid(sc));
printk(MYIOC_s_DEBUG_FMT "\ttag = %d, transfer_count = %d, sc->result = %08X\n",
ioc->name, le16_to_cpu(pScsiReply->TaskTag),
le32_to_cpu(pScsiReply->TransferCount), sc->result);
@@ -665,7 +648,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
scsi_state = pScsiReply->SCSIState;
scsi_status = pScsiReply->SCSIStatus;
xfer_cnt = le32_to_cpu(pScsiReply->TransferCount);
- sc->resid = sc->request_bufflen - xfer_cnt;
+ scsi_set_resid(sc, scsi_bufflen(sc) - xfer_cnt);
log_info = le32_to_cpu(pScsiReply->IOCLogInfo);
vdevice = sc->device->hostdata;

@@ -760,7 +743,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
break;

case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: /* 0x0049 */
- sc->resid = sc->request_bufflen - xfer_cnt;
+ scsi_set_resid(sc, scsi_bufflen(sc) - xfer_cnt);
if((xfer_cnt==0)||(sc->underflow > xfer_cnt))
sc->result=DID_SOFT_ERROR << 16;
else /* Sufficient data transfer occurred */
@@ -791,12 +774,12 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
pScsiReq->CDB[0] == READ_16 ||
pScsiReq->CDB[0] == VERIFY ||
pScsiReq->CDB[0] == VERIFY_16) {
- if (sc->request_bufflen !=
+ if (scsi_bufflen(sc) !=
xfer_cnt) {
sc->result = DID_SOFT_ERROR << 16;
printk(MYIOC_s_WARN_FMT "Errata"
"on LSI53C1030 occurred. sc->request_bufflen=0x%02x, "
- "xfer_cnt=0x%02x\n", ioc->name, sc->request_bufflen, xfer_cnt);
+ "xfer_cnt=0x%02x\n", ioc->name, scsi_bufflen(sc), xfer_cnt);
}
}
}
@@ -826,7 +809,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
break;

case MPI_IOCSTATUS_SCSI_DATA_OVERRUN: /* 0x0044 */
- sc->resid=0;
+ scsi_set_resid(sc, 0);
case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */
case MPI_IOCSTATUS_SUCCESS: /* 0x0000 */
sc->result = (DID_OK << 16) | scsi_status;
@@ -849,23 +832,23 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
sc->sense_buffer[5] << 8 |
sc->sense_buffer[6];
if ((sc->sense_buffer[3] & 0x80) == 0x80) {
- if (sc->request_bufflen != xfer_cnt) {
+ if (scsi_bufflen(sc) != xfer_cnt) {
sc->sense_buffer[2] = MEDIUM_ERROR;
sc->sense_buffer[12] = 0xff;
sc->sense_buffer[13] = 0xff;
printk(MYIOC_s_WARN_FMT "Errata on "
"LSI53C1030 occurred. sc->request_bufflen=0x%02x,"
- "xfer_cnt=0x%02x\n", ioc->name, sc->request_bufflen, xfer_cnt);
+ "xfer_cnt=0x%02x\n", ioc->name, scsi_bufflen(sc), xfer_cnt);
}
} else {
- if (sc->request_bufflen != xfer_cnt + difftransfer) {
+ if (scsi_bufflen(sc) != xfer_cnt + difftransfer) {
sc->sense_buffer[2] = MEDIUM_ERROR;
sc->sense_buffer[12] = 0xff;
sc->sense_buffer[13] = 0xff;
printk(MYIOC_s_WARN_FMT "Errata on "
"LSI53C1030 occurred. sc->request_bufflen=0x%02x,"
" xfer_cnt=0x%02x, difftransfer=0x%02x\n",
- ioc->name, sc->request_bufflen , xfer_cnt, difftransfer);
+ ioc->name, scsi_bufflen(sc) , xfer_cnt, difftransfer);
}
}
}
@@ -939,13 +922,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
} /* end of address reply case */

/* Unmap the DMA buffers, if any. */
- if (sc->use_sg) {
- pci_unmap_sg(ioc->pcidev, (struct scatterlist *) sc->request_buffer,
- sc->use_sg, sc->sc_data_direction);
- } else if (sc->request_bufflen) {
- pci_unmap_single(ioc->pcidev, sc->SCp.dma_handle,
- sc->request_bufflen, sc->sc_data_direction);
- }
+ scsi_dma_unmap(sc);

sc->scsi_done(sc); /* Issue the command callback */

@@ -986,15 +963,7 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
mpt_free_msg_frame(ioc, (MPT_FRAME_HDR *)mf);
if ((unsigned char *)mf != sc->host_scribble)
continue;
- if (sc->use_sg) {
- pci_unmap_sg(ioc->pcidev,
- (struct scatterlist *) sc->request_buffer,
- sc->use_sg, sc->sc_data_direction);
- } else if (sc->request_bufflen) {
- pci_unmap_single(ioc->pcidev,
- sc->SCp.dma_handle, sc->request_bufflen,
- sc->sc_data_direction);
- }
+ scsi_dma_unmap(sc);
sc->result = DID_RESET << 16;
sc->host_scribble = NULL;
dtmprintk(ioc, sdev_printk(KERN_INFO, sc->device, MYIOC_s_FMT
@@ -1058,17 +1027,7 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags);
mptscsih_freeChainBuffers(ioc, ii);
mpt_free_msg_frame(ioc, (MPT_FRAME_HDR *)mf);
- if (sc->use_sg) {
- pci_unmap_sg(ioc->pcidev,
- (struct scatterlist *) sc->request_buffer,
- sc->use_sg,
- sc->sc_data_direction);
- } else if (sc->request_bufflen) {
- pci_unmap_single(ioc->pcidev,
- sc->SCp.dma_handle,
- sc->request_bufflen,
- sc->sc_data_direction);
- }
+ scsi_dma_unmap(sc);
sc->host_scribble = NULL;
sc->result = DID_NO_CONNECT << 16;
dtmprintk(ioc, sdev_printk(KERN_INFO, sc->device,
@@ -1404,10 +1363,10 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
* will be no data transfer! GRRRRR...
*/
if (SCpnt->sc_data_direction == DMA_FROM_DEVICE) {
- datalen = SCpnt->request_bufflen;
+ datalen = scsi_bufflen(SCpnt);
scsidir = MPI_SCSIIO_CONTROL_READ; /* DATA IN (host<--ioc<--dev) */
} else if (SCpnt->sc_data_direction == DMA_TO_DEVICE) {
- datalen = SCpnt->request_bufflen;
+ datalen = scsi_bufflen(SCpnt);
scsidir = MPI_SCSIIO_CONTROL_WRITE; /* DATA OUT (host-->ioc-->dev) */
} else {
datalen = 0;
@@ -1851,7 +1810,7 @@ mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *m
int
mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, int ctx2abort, ulong timeout)
{
- MPT_FRAME_HDR *mf;
+ MPT_FRAME_HDR *uninitialized_var(mf);
SCSITaskMgmt_t *pScsiTm;
int ii;
int retval;
@@ -3270,7 +3229,7 @@ mptscsih_synchronize_cache(struct scsi_device *sdev, MPT_SCSI_HOST *hd, VirtDevi
* shost attributes
*/
static ssize_t
-mptscsih_version_fw_show(struct class_device *cdev, char *buf)
+mptscsih_version_fw_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3282,10 +3241,10 @@ mptscsih_version_fw_show(struct class_device *cdev, char *buf)
(ioc->facts.FWVersion.Word & 0x0000FF00) >> 8,
ioc->facts.FWVersion.Word & 0x000000FF);
}
-static CLASS_DEVICE_ATTR(version_fw, S_IRUGO, mptscsih_version_fw_show, NULL);
+static DEVICE_ATTR(version_fw, S_IRUGO, mptscsih_version_fw_show, NULL);

static ssize_t
-mptscsih_version_bios_show(struct class_device *cdev, char *buf)
+mptscsih_version_bios_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3297,10 +3256,10 @@ mptscsih_version_bios_show(struct class_device *cdev, char *buf)
(ioc->biosVersion & 0x0000FF00) >> 8,
ioc->biosVersion & 0x000000FF);
}
-static CLASS_DEVICE_ATTR(version_bios, S_IRUGO, mptscsih_version_bios_show, NULL);
+static DEVICE_ATTR(version_bios, S_IRUGO, mptscsih_version_bios_show, NULL);

static ssize_t
-mptscsih_version_mpi_show(struct class_device *cdev, char *buf)
+mptscsih_version_mpi_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3313,10 +3272,10 @@ mptscsih_version_mpi_show(struct class_device *cdev, char *buf)
return snprintf(buf, PAGE_SIZE, "%03x\n",
ioc->facts.MsgVersion);
}
-static CLASS_DEVICE_ATTR(version_mpi, S_IRUGO, mptscsih_version_mpi_show, NULL);
+static DEVICE_ATTR(version_mpi, S_IRUGO, mptscsih_version_mpi_show, NULL);

static ssize_t
-mptscsih_version_product_show(struct class_device *cdev, char *buf)
+mptscsih_version_product_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3324,11 +3283,11 @@ mptscsih_version_product_show(struct class_device *cdev, char *buf)

return snprintf(buf, PAGE_SIZE, "%s\n", ioc->prod_name);
}
-static CLASS_DEVICE_ATTR(version_product, S_IRUGO,
+static DEVICE_ATTR(version_product, S_IRUGO,
mptscsih_version_product_show, NULL);

static ssize_t
-mptscsih_version_nvdata_persistent_show(struct class_device *cdev, char *buf)
+mptscsih_version_nvdata_persistent_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3337,11 +3296,11 @@ mptscsih_version_nvdata_persistent_show(struct class_device *cdev, char *buf)
return snprintf(buf, PAGE_SIZE, "%02xh\n",
ioc->nvdata_version_persistent);
}
-static CLASS_DEVICE_ATTR(version_nvdata_persistent, S_IRUGO,
+static DEVICE_ATTR(version_nvdata_persistent, S_IRUGO,
mptscsih_version_nvdata_persistent_show, NULL);

static ssize_t
-mptscsih_version_nvdata_default_show(struct class_device *cdev, char *buf)
+mptscsih_version_nvdata_default_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3349,11 +3308,11 @@ mptscsih_version_nvdata_default_show(struct class_device *cdev, char *buf)

return snprintf(buf, PAGE_SIZE, "%02xh\n",ioc->nvdata_version_default);
}
-static CLASS_DEVICE_ATTR(version_nvdata_default, S_IRUGO,
+static DEVICE_ATTR(version_nvdata_default, S_IRUGO,
mptscsih_version_nvdata_default_show, NULL);

static ssize_t
-mptscsih_board_name_show(struct class_device *cdev, char *buf)
+mptscsih_board_name_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3361,10 +3320,10 @@ mptscsih_board_name_show(struct class_device *cdev, char *buf)

return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_name);
}
-static CLASS_DEVICE_ATTR(board_name, S_IRUGO, mptscsih_board_name_show, NULL);
+static DEVICE_ATTR(board_name, S_IRUGO, mptscsih_board_name_show, NULL);

static ssize_t
-mptscsih_board_assembly_show(struct class_device *cdev, char *buf)
+mptscsih_board_assembly_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3372,11 +3331,11 @@ mptscsih_board_assembly_show(struct class_device *cdev, char *buf)

return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_assembly);
}
-static CLASS_DEVICE_ATTR(board_assembly, S_IRUGO,
+static DEVICE_ATTR(board_assembly, S_IRUGO,
mptscsih_board_assembly_show, NULL);

static ssize_t
-mptscsih_board_tracer_show(struct class_device *cdev, char *buf)
+mptscsih_board_tracer_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3384,11 +3343,11 @@ mptscsih_board_tracer_show(struct class_device *cdev, char *buf)

return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_tracer);
}
-static CLASS_DEVICE_ATTR(board_tracer, S_IRUGO,
+static DEVICE_ATTR(board_tracer, S_IRUGO,
mptscsih_board_tracer_show, NULL);

static ssize_t
-mptscsih_io_delay_show(struct class_device *cdev, char *buf)
+mptscsih_io_delay_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3396,11 +3355,11 @@ mptscsih_io_delay_show(struct class_device *cdev, char *buf)

return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->io_missing_delay);
}
-static CLASS_DEVICE_ATTR(io_delay, S_IRUGO,
+static DEVICE_ATTR(io_delay, S_IRUGO,
mptscsih_io_delay_show, NULL);

static ssize_t
-mptscsih_device_delay_show(struct class_device *cdev, char *buf)
+mptscsih_device_delay_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3408,11 +3367,11 @@ mptscsih_device_delay_show(struct class_device *cdev, char *buf)

return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->device_missing_delay);
}
-static CLASS_DEVICE_ATTR(device_delay, S_IRUGO,
+static DEVICE_ATTR(device_delay, S_IRUGO,
mptscsih_device_delay_show, NULL);

static ssize_t
-mptscsih_debug_level_show(struct class_device *cdev, char *buf)
+mptscsih_debug_level_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3421,7 +3380,7 @@ mptscsih_debug_level_show(struct class_device *cdev, char *buf)
return snprintf(buf, PAGE_SIZE, "%08xh\n", ioc->debug_level);
}
static ssize_t
-mptscsih_debug_level_store(struct class_device *cdev, const char *buf, size_t count)
+mptscsih_debug_level_store(struct device *cdev, struct device_attribute *attr, const char *buf, size_t count)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3436,11 +3395,11 @@ mptscsih_debug_level_store(struct class_device *cdev, const char *buf, size_t co
ioc->debug_level);
return strlen(buf);
}
-static CLASS_DEVICE_ATTR(debug_level, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(debug_level, S_IRUGO | S_IWUSR,
mptscsih_debug_level_show, mptscsih_debug_level_store);

static ssize_t
-mptscsih_disable_hotplug_remove_show(struct class_device *cdev, char *buf)
+mptscsih_disable_hotplug_remove_show(struct device *cdev, struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3449,7 +3408,7 @@ mptscsih_disable_hotplug_remove_show(struct class_device *cdev, char *buf)
return snprintf(buf, PAGE_SIZE, "%02xh\n", ioc->disable_hotplug_remove);
}
static ssize_t
-mptscsih_disable_hotplug_remove_store(struct class_device *cdev, const char *buf, size_t count)
+mptscsih_disable_hotplug_remove_store(struct device *cdev, struct device_attribute *attr, const char *buf, size_t count)
{
struct Scsi_Host *host = class_to_shost(cdev);
MPT_SCSI_HOST *hd = shost_private(host);
@@ -3467,23 +3426,23 @@ mptscsih_disable_hotplug_remove_store(struct class_device *cdev, const char *buf
printk(MYIOC_s_INFO_FMT "eanbling hotplug remove\n", ioc->name);
return strlen(buf);
}
-static CLASS_DEVICE_ATTR(disable_hotplug_remove, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(disable_hotplug_remove, S_IRUGO | S_IWUSR,
mptscsih_disable_hotplug_remove_show, mptscsih_disable_hotplug_remove_store);

-struct class_device_attribute *mptscsih_host_attrs[] = {
- &class_device_attr_version_fw,
- &class_device_attr_version_bios,
- &class_device_attr_version_mpi,
- &class_device_attr_version_product,
- &class_device_attr_version_nvdata_persistent,
- &class_device_attr_version_nvdata_default,
- &class_device_attr_board_name,
- &class_device_attr_board_assembly,
- &class_device_attr_board_tracer,
- &class_device_attr_io_delay,
- &class_device_attr_device_delay,
- &class_device_attr_debug_level,
- &class_device_attr_disable_hotplug_remove,
+struct device_attribute *mptscsih_host_attrs[] = {
+ &dev_attr_version_fw,
+ &dev_attr_version_bios,
+ &dev_attr_version_mpi,
+ &dev_attr_version_product,
+ &dev_attr_version_nvdata_persistent,
+ &dev_attr_version_nvdata_default,
+ &dev_attr_board_name,
+ &dev_attr_board_assembly,
+ &dev_attr_board_tracer,
+ &dev_attr_io_delay,
+ &dev_attr_device_delay,
+ &dev_attr_debug_level,
+ &dev_attr_disable_hotplug_remove,
NULL,
};
EXPORT_SYMBOL(mptscsih_host_attrs);
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h
index 9b0b0b0..c199843 100644
--- a/drivers/message/fusion/mptscsih.h
+++ b/drivers/message/fusion/mptscsih.h
@@ -133,7 +133,7 @@ extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id,
extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id);
extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id);
extern int mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd);
-extern struct class_device_attribute *mptscsih_host_attrs[];
+extern struct device_attribute *mptscsih_host_attrs[];
extern int mptscsih_quiesce_raid(MPT_SCSI_HOST *hd, int quiesce, u8 channel, u8 id);
extern struct scsi_cmnd * mptscsih_get_scsi_lookup(MPT_ADAPTER *ioc, int i);
extern void mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code);
--
1.6.0.3

2008-12-08 02:52:01

by cheng renquan

[permalink] [raw]
Subject: Re: [PATCH 2/2] mpt fusion: port "4.00.43.00" to mainstream git kernel

Hi, all,

I have tested and verified that these two patches can let my LSI-SAS-1068E
controllers work well with 2.6.26.2 kernels, perfect,

Tested-by: Cheng Renquan <[email protected]>

but the latest git kernel has not yet been tested. just buildable. I
personally suggest these patches integrated into Greg KH's staging
tree. It seems meet staging's purpose well?

The bugzilla page has been updated,

http://bugzilla.kernel.org/show_bug.cgi?id=12163


And the first patch, it's just integrating the vendor driver "4.00.43.00":

Subject: [PATCH 1/2] mpt fusion: updated mpt drivers from lsi
upstream "4.00.43.00"

http://marc.info/?l=linux-scsi&m=122848357611653&w=2


To LSI staff:
Please test it as soon, you have the resources. Please maintain your
driver update in latest git kernel besides and not only major
distrition kernels,
We customers need to run your mpt controllers not only on major
distribution kernels but also the latest git kernel, you should at
least maintain an updated driver for some major later kernels, like
one for 2.6.24, one for 2.6.27, and one for the latest git tree. At
least the driver in the git tree should be always updated, this would
always keep your driver current.
I'm your customer located in Shenzhen, China. Please know it and
keep co-operative with your customers and the Linux Kernel Development
Community. Thank you.



On Fri, Dec 5, 2008 at 9:26 PM, <[email protected]> wrote:
> From: Cheng Renquan <[email protected]>
>
> this one just can build with mainstream git kernel, I did not even test it.
>
> I just have tested it with kernel 2.6.26.2, that patch is very similar to
> this, and it did work well with 2.6.26.2.
>
> Signed-off-by: Cheng Renquan <[email protected]>
> ---
> drivers/message/fusion/linux_compat.h | 3 +-
> drivers/message/fusion/mptbase.c | 10 +-
> drivers/message/fusion/mptbase.h | 6 +-
> drivers/message/fusion/mptfc.c | 4 +-
> drivers/message/fusion/mptsas.c | 14 +---
> drivers/message/fusion/mptscsih.c | 169 +++++++++++++--------------------
> drivers/message/fusion/mptscsih.h | 2 +-
> 7 files changed, 79 insertions(+), 129 deletions(-)
>
[...]
> --
> 1.6.0.3

--
Cheng Renquan, Shenzhen, China
Steve Martin - "I've got to keep breathing. It'll be my worst
business mistake if I don't."

2008-12-08 05:03:24

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 2/2] mpt fusion: port "4.00.43.00" to mainstream git kernel

On Mon, Dec 08, 2008 at 10:51:48AM +0800, Cheng Renquan wrote:
> Hi, all,
>
> I have tested and verified that these two patches can let my LSI-SAS-1068E
> controllers work well with 2.6.26.2 kernels, perfect,
>
> Tested-by: Cheng Renquan <[email protected]>
>
> but the latest git kernel has not yet been tested. just buildable. I
> personally suggest these patches integrated into Greg KH's staging
> tree. It seems meet staging's purpose well?

The staging tree is for new drivers that are not already included in the
kernel tree. Not for patches to existing drivers, that wouldn't really
work out.

thanks,

greg k-h

2008-12-08 15:17:42

by James Bottomley

[permalink] [raw]
Subject: Re: [PATCH 2/2] mpt fusion: port "4.00.43.00" to mainstream git kernel

On Fri, 2008-12-05 at 21:26 +0800, [email protected] wrote:
> From: Cheng Renquan <[email protected]>
>
> this one just can build with mainstream git kernel, I did not even test it.
>
> I just have tested it with kernel 2.6.26.2, that patch is very similar to
> this, and it did work well with 2.6.26.2.
>
> Signed-off-by: Cheng Renquan <[email protected]>
> ---
> drivers/message/fusion/linux_compat.h | 3 +-

I don't quite understand what this patch is about. This file isn't in
the upstream and hasn't been for a while if I recall, so what is this
patch actually patching?

> drivers/message/fusion/mptbase.c | 10 +-
> drivers/message/fusion/mptbase.h | 6 +-
> drivers/message/fusion/mptfc.c | 4 +-
> drivers/message/fusion/mptsas.c | 14 +---
> drivers/message/fusion/mptscsih.c | 169 +++++++++++++--------------------
> drivers/message/fusion/mptscsih.h | 2 +-
> 7 files changed, 79 insertions(+), 129 deletions(-)
>
> diff --git a/drivers/message/fusion/linux_compat.h b/drivers/message/fusion/linux_compat.h
> index 24ad3f1..92e9797 100644
> --- a/drivers/message/fusion/linux_compat.h
> +++ b/drivers/message/fusion/linux_compat.h
> @@ -31,7 +31,6 @@ static inline void *shost_private(struct Scsi_Host *shost)
> #define spi_dv_pending(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_pending)
> #endif
>
> -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
> /**
> * mpt_scsilun_to_int: convert a scsi_lun to an int
> * @scsilun: struct scsi_lun to be converted.
> @@ -62,7 +61,7 @@ static inline int mpt_scsilun_to_int(struct scsi_lun *scsilun)
> scsilun->scsi_lun[i + 1]) << (i * 8));
> return lun;
> }
> -#endif
> +
> #if (defined(CONFIG_SUSE_KERNEL) && !defined(scsi_is_sas_phy_local))
> #define SUSE_KERNEL_BASE 1
> #endif
> diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
> index 2979b63..36dd62a 100644
> --- a/drivers/message/fusion/mptbase.c
> +++ b/drivers/message/fusion/mptbase.c
> @@ -1618,7 +1618,7 @@ mpt_mapresources(MPT_ADAPTER *ioc)
> }
> #else
> ioc->bars = pci_select_bars(pdev, IORESOURCE_MEM);
> - if (pci_enable_device_bars(pdev, ioc->bars)) {
> + if (pci_enable_device(pdev)) {

API reversal.

> printk(MYIOC_s_ERR_FMT "pci_enable_device_bars() with MEM "
> "failed\n",ioc->name);
> return r;
> @@ -1826,7 +1826,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
> #endif
>
> /* Initialize workqueue */
> - snprintf(ioc->reset_work_q_name, KOBJ_NAME_LEN, "mpt_poll_%d", ioc->id);
> + snprintf(ioc->reset_work_q_name, sizeof(ioc->reset_work_q_name),
> + "mpt_poll_%d", ioc->id);
> ioc->reset_work_q =
> create_singlethread_workqueue(ioc->reset_work_q_name);
> if (!ioc->reset_work_q) {
> @@ -1949,7 +1950,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
>
> INIT_LIST_HEAD(&ioc->fw_event_list);
> spin_lock_init(&ioc->fw_event_lock);
> - snprintf(ioc->fw_event_q_name, KOBJ_NAME_LEN, "mpt/%d", ioc->id);
> + snprintf(ioc->fw_event_q_name, sizeof(ioc->fw_event_q_name),
> + "mpt/%d", ioc->id);
> ioc->fw_event_q = create_singlethread_workqueue(ioc->fw_event_q_name);
>
> if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,
> @@ -2303,7 +2305,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
> pci_release_selected_regions(ioc->pcidev, ioc->bars);
> ioc->bars = pci_select_bars(ioc->pcidev, IORESOURCE_MEM |
> IORESOURCE_IO);
> - if (pci_enable_device_bars(ioc->pcidev, ioc->bars))
> + if (pci_enable_device(ioc->pcidev))

Things like this are reversing kernel API changes and can't go in.

What you need to do is isolate the necessary changes to current git head
(or scsi-misc) and then send it to the LSI maintainers. The route to
inclusion is via them.

Alternatively, we can just continue on with debugging the actual problem
you have rather than trying to upport some vendor driver.

James

2008-12-09 03:36:17

by cheng renquan

[permalink] [raw]
Subject: Re: [PATCH 1/2] mpt fusion: updated mpt drivers from lsi upstream "4.00.43.00"

On Mon, Dec 8, 2008 at 11:17 PM, James Bottomley
<[email protected]> wrote:
> On Fri, 2008-12-05 at 21:26 +0800, [email protected] wrote:
>> From: Cheng Renquan <[email protected]>
>>
>> this one just can build with mainstream git kernel, I did not even test it.
>>
>> I just have tested it with kernel 2.6.26.2, that patch is very similar to
>> this, and it did work well with 2.6.26.2.
>>
>> Signed-off-by: Cheng Renquan <[email protected]>
>> ---
>> drivers/message/fusion/linux_compat.h | 3 +-
>
> I don't quite understand what this patch is about. This file isn't in
> the upstream and hasn't been for a while if I recall, so what is this
> patch actually patching?

James, please notice the first patch, it's about the mpt vendor
driver, the upstream device vendor maintained three series of mpt
drivers, specially for RHEL3,4,5/SLES8,9,10
but they didn't maintain one for the latest mainstream git kernel,

the first patch (130KB after bzip2'ed) is just replace
drivers/message/fusion/ with code "4.00.43.00" from vendor. You can
extracting the source from vendor into drivers/message/fusion/ instead
of applying this patch.

>> drivers/message/fusion/mptbase.c | 10 +-
>> drivers/message/fusion/mptbase.h | 6 +-
>> drivers/message/fusion/mptfc.c | 4 +-
>> drivers/message/fusion/mptsas.c | 14 +---
>> drivers/message/fusion/mptscsih.c | 169 +++++++++++++--------------------
>> drivers/message/fusion/mptscsih.h | 2 +-
>> 7 files changed, 79 insertions(+), 129 deletions(-)
>>
>> diff --git a/drivers/message/fusion/linux_compat.h b/drivers/message/fusion/linux_compat.h
>> index 24ad3f1..92e9797 100644
>> --- a/drivers/message/fusion/linux_compat.h
>> +++ b/drivers/message/fusion/linux_compat.h
>> @@ -31,7 +31,6 @@ static inline void *shost_private(struct Scsi_Host *shost)
>> #define spi_dv_pending(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_pending)
>> #endif
>>
>> -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
>> /**
>> * mpt_scsilun_to_int: convert a scsi_lun to an int
>> * @scsilun: struct scsi_lun to be converted.
>> @@ -62,7 +61,7 @@ static inline int mpt_scsilun_to_int(struct scsi_lun *scsilun)
>> scsilun->scsi_lun[i + 1]) << (i * 8));
>> return lun;
>> }
>> -#endif
>> +
>> #if (defined(CONFIG_SUSE_KERNEL) && !defined(scsi_is_sas_phy_local))
>> #define SUSE_KERNEL_BASE 1
>> #endif
>> diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
>> index 2979b63..36dd62a 100644
>> --- a/drivers/message/fusion/mptbase.c
>> +++ b/drivers/message/fusion/mptbase.c
>> @@ -1618,7 +1618,7 @@ mpt_mapresources(MPT_ADAPTER *ioc)
>> }
>> #else
>> ioc->bars = pci_select_bars(pdev, IORESOURCE_MEM);
>> - if (pci_enable_device_bars(pdev, ioc->bars)) {
>> + if (pci_enable_device(pdev)) {
>
> API reversal.
>
>> printk(MYIOC_s_ERR_FMT "pci_enable_device_bars() with MEM "
>> "failed\n",ioc->name);
>> return r;
>> @@ -1826,7 +1826,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
>> #endif
>>
>> /* Initialize workqueue */
>> - snprintf(ioc->reset_work_q_name, KOBJ_NAME_LEN, "mpt_poll_%d", ioc->id);
>> + snprintf(ioc->reset_work_q_name, sizeof(ioc->reset_work_q_name),
>> + "mpt_poll_%d", ioc->id);
>> ioc->reset_work_q =
>> create_singlethread_workqueue(ioc->reset_work_q_name);
>> if (!ioc->reset_work_q) {
>> @@ -1949,7 +1950,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
>>
>> INIT_LIST_HEAD(&ioc->fw_event_list);
>> spin_lock_init(&ioc->fw_event_lock);
>> - snprintf(ioc->fw_event_q_name, KOBJ_NAME_LEN, "mpt/%d", ioc->id);
>> + snprintf(ioc->fw_event_q_name, sizeof(ioc->fw_event_q_name),
>> + "mpt/%d", ioc->id);
>> ioc->fw_event_q = create_singlethread_workqueue(ioc->fw_event_q_name);
>>
>> if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,
>> @@ -2303,7 +2305,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
>> pci_release_selected_regions(ioc->pcidev, ioc->bars);
>> ioc->bars = pci_select_bars(ioc->pcidev, IORESOURCE_MEM |
>> IORESOURCE_IO);
>> - if (pci_enable_device_bars(ioc->pcidev, ioc->bars))
>> + if (pci_enable_device(ioc->pcidev))
>
> Things like this are reversing kernel API changes and can't go in.

All the work in the second patch is just let it can build.

The vendor driver "4.00.43.00" is for RHEL5.1 (2.6.18-53.el5), and
cannot build on 2.6.26 and latest git kernel,

with applying the second patch, it can build. I have tested it, and
verified that it fixed the bug described on:

http://bugzilla.kernel.org/show_bug.cgi?id=12163


>
> What you need to do is isolate the necessary changes to current git head
> (or scsi-misc) and then send it to the LSI maintainers. The route to
> inclusion is via them.

Yes, I have tried, but the vendor LSI people just ignored, they were
not co-operative, then how we can deal?

Again, I hope LSI people in the Cc'ed list can read this mail and give replies.

>
> Alternatively, we can just continue on with debugging the actual problem
> you have rather than trying to upport some vendor driver.

That approach almost cannot solve the bug, we don't have the
card/firmware specification, the debugging will be very hard.

>
> James

On Tue, Dec 9, 2008 at 6:07 AM, Andrew Morton <[email protected]> wrote:
> (off-list)
>
> On Fri, 5 Dec 2008 21:26:49 +0800
> [email protected] wrote:
>
>> Occasionally I'm working with LSI SAS 1068E controllers on 2.6.26.2 kernel,
>> it has a nasty bug that some hotplugged disks cannot be auto discovered,
>> the detailed description is on bugzilla.kernel:
>>
>> http://bugzilla.kernel.org/show_bug.cgi?id=12163
>>
>> After some inspecting the vendor's website, I found there are "4.00.43.00"
>> drivers for RHEL5.1, but the drivers in main stream kernel are still "3.04.07",
>> and the changelogs of "4.00.43.00" have records on solving that BUG,
>>
>> but the default "4.00.43.00" downloaded from lsi.com cannot even build on
>> kernel-2.6.26.2, and after some work, I get it run on 2.6.26.2, then can build
>> with mainstream git kernel (the HEAD currently),
>>
>> http://www.lsi.com/storage_home/products_home/standard_product_ics/sas_ics/lsisas1068e/index.html
>>

>> -#define MPT_LINUX_VERSION_COMMON "3.04.07"
>> +#define MPT_LINUX_VERSION_COMMON "4.00.43.00"

Please James notice this, the major version difference, but the mpt in
the mainstream is "3.04.07", outdated.

>> This patch is just the upstream "4.00.43.00", it's very big, about 130K after
>> bzip2'ed
>
> Eric, is this as bad as it looks? LSI's driver is 130kbytes and a
> major version increment ahead of the mainline driver?
>
> If so, is there anything we can do to bring the mainline driver more
> up-to-date and to keep it there? Should we (ie: me, James, distros,
> etc) be seeking additional developers to help make all this happen?

Cool, if Eric can read this, I'm willing to help make all this happen.


>
> Thanks.
>


Thanks.

--
Cheng Renquan, Shenzhen, China
Marie von Ebner-Eschenbach - "Even a stopped clock is right twice a day."