Skip to contentSkip to conversation

cciss: firmware version is invalid

PATCH Applied Tim Gardner 5 participants 5 messages Nov 6, 2008 – Nov 11, 2008 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cciss: firmware version is invalid

Quoted 1 line

From b659b0b0e14f5e3c049bf5c8d2883587cdbfe344 Mon Sep 17 00:00:00 2001

From: Tim Gardner <[email protected]>
Date: Thu, 6 Nov 2008 12:34:25 -0700
Subject: [PATCH] cciss: Firmware Version is invalid
OriginalAuthor: [email protected]
OriginalLocation: http://launchpadlibrarian.net/18582511/cciss_firmware_version_fix.patch

Emit a CISS_INQUIRY command to read the firmware version.

---
 drivers/block/cciss.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
drivers/block/cciss.c +21 -0
index b73116e..844b806 100644
@@ -1631,6 +1631,7 @@ static int rebuild_lun_table(ctlr_info_t *h, int first_time)
 	int ctlr = h->ctlr;
 	int num_luns;
 	ReportLunData_struct *ld_buff = NULL;
+	InquiryData_struct *inq_buff = NULL;
 	int return_code;
 	int listlength = 0;
 	int i;
@@ -1651,6 +1652,26 @@ static int rebuild_lun_table(ctlr_info_t *h, int first_time)
 	h->busy_configuring = 1;
 	spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
 
+	inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL);
+	if (inq_buff == NULL) {
+		printk(KERN_ERR "cciss: out of memory\n");
+		return ENOMEM;
+	}
+
+	/* Get the firmware version */
+	return_code = sendcmd_withirq(CISS_INQUIRY, ctlr, inq_buff,
+		sizeof(InquiryData_struct), 0, 0 ,0, TYPE_CMD);
+	if (return_code == IO_OK) {
+		h->firm_ver[0] = inq_buff->data_byte[32];
+		h->firm_ver[1] = inq_buff->data_byte[33];
+		h->firm_ver[2] = inq_buff->data_byte[34];
+		h->firm_ver[3] = inq_buff->data_byte[35];
+	} else {         /* send command failed */
+		printk(KERN_WARNING "cciss: unable to determine firmware"
+			" version of controller\n");
+	}
+
+	/* Get the number of logical volumes */
 	ld_buff = kzalloc(sizeof(ReportLunData_struct), GFP_KERNEL);
 	if (ld_buff == NULL)
 		goto mem_msg;
Signature · 1 line
1.5.6.3
#1 lore raw

Tim,

Thanks for getting this merged, but I believe this patch is preferred over the original one I attached:

http://userweb.kernel.org/~akpm/mmotm/broken-out/cciss-fix-regression-firmware-not-displayed-in-procfs-again-and-again.patch

The reason for this according to Mike Miller is: "The first fix could be called anytime something changed on the controller such as number of logical volumes, etc. This patch will get called only once for each controller."

Thanks,
Bryan

Quoted 58 lines · Tim Gardner
Quoted 1 line

From b659b0b0e14f5e3c049bf5c8d2883587cdbfe344 Mon Sep 17 00:00:00 2001

From: Tim Gardner <[email protected]>
Date: Thu, 6 Nov 2008 12:34:25 -0700
Subject: [PATCH] cciss: Firmware Version is invalid
OriginalAuthor: [email protected]
OriginalLocation: http://launchpadlibrarian.net/18582511/cciss_firmware_version_fix.patch

Emit a CISS_INQUIRY command to read the firmware version.

---
 drivers/block/cciss.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
drivers/block/cciss.c +21 -1
index b73116e..844b806 100644
@@ -1631,6 +1631,7 @@ static int rebuild_lun_table(ctlr_info_t *h, int first_time)
        int ctlr = h->ctlr;
        int num_luns;
        ReportLunData_struct *ld_buff = NULL;
+       InquiryData_struct *inq_buff = NULL;
        int return_code;
        int listlength = 0;
        int i;
@@ -1651,6 +1652,26 @@ static int rebuild_lun_table(ctlr_info_t *h, int first_time)
        h->busy_configuring = 1;
        spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
 
+       inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL);
+       if (inq_buff == NULL) {
+               printk(KERN_ERR "cciss: out of memory\n");
+               return ENOMEM;
+       }
+
+       /* Get the firmware version */
+       return_code = sendcmd_withirq(CISS_INQUIRY, ctlr, inq_buff,
+               sizeof(InquiryData_struct), 0, 0 ,0, TYPE_CMD);
+       if (return_code == IO_OK) {
+               h->firm_ver[0] = inq_buff->data_byte[32];
+               h->firm_ver[1] = inq_buff->data_byte[33];
+               h->firm_ver[2] = inq_buff->data_byte[34];
+               h->firm_ver[3] = inq_buff->data_byte[35];
+       } else {         /* send command failed */
+               printk(KERN_WARNING "cciss: unable to determine firmware"
+                       " version of controller\n");
+       }
+
+       /* Get the number of logical volumes */
        ld_buff = kzalloc(sizeof(ReportLunData_struct), GFP_KERNEL);
        if (ld_buff == NULL)
                goto mem_msg;
--

1.5.6.3

Applied
#2 lore raw
Quoted 7 lines · Bryan

Tim,

Thanks for getting this merged, but I believe this patch is preferred over the original one I attached:

http://userweb.kernel.org/~akpm/mmotm/broken-out/cciss-fix-regression-firmware-not-displayed-in-procfs-again-and-again.patch

Quoted 7 lines

The reason for this according to Mike Miller is: "The first fix could be called anytime something changed on the controller such as number of logical volumes, etc. This patch will get called only once for each controller."

Thanks,
Bryan

applied

Signature · 1 line
Tim Gardner [email protected]
#3 lore raw
Quoted 13 lines · On Fri, 07 Nov 2008 07:12:08 -0700 Tim Gardner <[email protected]> wrote:
Quoted 12 lines · Bryan

Tim,

Thanks for getting this merged, but I believe this patch is preferred over the original one I attached:

http://userweb.kernel.org/~akpm/mmotm/broken-out/cciss-fix-regression-firmware-not-displayed-in-procfs-again-and-again.patch

The reason for this according to Mike Miller is: "The first fix could be called anytime something changed on the controller such as number of logical volumes, etc. This patch will get called only once for each controller."

Quoted 5 lines
Quoted 2 lines

Thanks,
Bryan

applied

I'm all confused here.

cciss-fix-regression-firmware-not-displayed-in-procfs-again-and-again.patch is now in mainline. Are you saying that "cciss: Firmware Version is invalid" is preferred? That "cciss: Firmware Version is invalid" should still be applied?

If so, "cciss: Firmware Version is invalid" will need a better title and changelog, please. The one you have there is pretty skimpy. reading between the lines, I'm guessing that the driver emits "Firmware Version is invalid" messages and that this patch somehow fixes that?

#4 lore raw
Quoted 28 lines · Andrew Morton
Quoted 8 lines · On Fri, 07 Nov 2008 07:12:08 -0700 Tim Gardner <[email protected]> wrote:
Quoted 7 lines · Bryan

Tim,

Thanks for getting this merged, but I believe this patch is preferred over the original one I attached:

http://userweb.kernel.org/~akpm/mmotm/broken-out/cciss-fix-regression-firmware-not-displayed-in-procfs-again-and-again.patch

Quoted 9 lines
Quoted 7 lines

The reason for this according to Mike Miller is: "The first fix could be called anytime something changed on the controller such as number of logical volumes, etc. This patch will get called only once for each controller."

Thanks,
Bryan

applied

I'm all confused here.

cciss-fix-regression-firmware-not-displayed-in-procfs-again-and-again.patch is now in mainline. Are you saying that "cciss: Firmware Version is invalid" is preferred? That "cciss: Firmware Version is invalid" should still be applied?

Quoted 5 lines

If so, "cciss: Firmware Version is invalid" will need a better title and changelog, please. The one you have there is pretty skimpy. reading between the lines, I'm guessing that the driver emits "Firmware Version is invalid" messages and that this patch somehow fixes that?

Andrew,

The patch in Linus' repo looks correct, so please drop this one. At the time I sent the original patch I didn't realize there was another version already staged for Linus.

rtg

Signature · 1 line
Tim Gardner [email protected]