megaraid_{mm,mbox}: fix a bug in reset handler
Subsystems (3)
PATCH 14/20 megaraid_{mm,mbox}: fix a bug in reset handler
From: "Ju, Seokmann" <[email protected]>
When abort failed, the driver gets reset handleer called. In the reset handler, driver calls 'scsi_done()' callback for same SCSI command packet (struct scsi_cmnd) multiple times if there are multiple SCSI command packet in the pend_list. More over, if there are entry in the pend_lsit with IOCTL packet associated, the driver returns it to wrong free_list so that, in turn, the driver could end up with 'NULL pointer dereference..' during I/O command building with incorrect resource.
Also, the patch contains several minor/cosmetic changes besides this.
Signed-off-by Seokmann Ju <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
Documentation/scsi/ChangeLog.megaraid | 25 ++++++++++ drivers/scsi/megaraid/megaraid_mbox.c | 59 ++++++++++++++++-------- drivers/scsi/megaraid/megaraid_mbox.h | 7 ++ 3 files changed, 71 insertions(+), 20 deletions(-)
Documentation/scsi/ChangeLog.megaraid renamed from Documentation/scsi/ChangeLog.megaraid~megaraid_mmmbox-fix-a-bug-in-reset-handler +25 -0
@@ -1,3 +1,28 @@ +Release Date : Mon Apr 11 12:27:22 EST 2006 - Seokmann Ju <[email protected]> +Current Version : 2.20.4.8 (scsi module), 2.20.2.6 (cmm module) +Older Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module) + +1. Fixed a bug in megaraid_reset_handler(). + Customer reported "Unable to handle kernel NULL pointer dereference + at virtual address 00000000" when system goes to reset condition + for some reason. It happened randomly. + Root Cause: in the megaraid_reset_handler(), there is possibility not + returning pending packets in the pend_list if there are multiple + pending packets. + Fix: Made the change in the driver so that it will return all packets + in the pend_list. + +2. Added change request. + As found in the following URL, rmb() only didn't help the + problem. I had to increase the loop counter to 0xFFFFFF. (6 F's) + http://marc.theaimsgroup.com/?l=linux-scsi&m=110971060502497&w=2 + + I attached a patch for your reference, too. + Could you check and get this fix in your driver? + + Best Regards, + Jun'ichi Nomura + Release Date : Fri Nov 11 12:27:22 EST 2005 - Seokmann Ju <[email protected]> Current Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module) Older Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module)
drivers/scsi/megaraid/megaraid_mbox.c renamed from drivers/scsi/megaraid/megaraid_mbox.c~megaraid_mmmbox-fix-a-bug-in-reset-handler +41 -18
136 lines not on this page · raw message
drivers/scsi/megaraid/megaraid_mbox.h renamed from drivers/scsi/megaraid/megaraid_mbox.h~megaraid_mmmbox-fix-a-bug-in-reset-handler +5 -2
@@ -21,8 +21,8 @@#include "megaraid_ioctl.h" -#define MEGARAID_VERSION "2.20.4.7" -#define MEGARAID_EXT_VERSION "(Release Date: Mon Nov 14 12:27:22 EST 2005)" +#define MEGARAID_VERSION "2.20.4.8" +#define MEGARAID_EXT_VERSION "(Release Date: Mon Apr 11 12:27:22 EST 2006)"/*
@@ -100,6 +100,9 @@#define MBOX_BUSY_WAIT 10 // max usec to wait for busy mailbox#define MBOX_RESET_WAIT 180 // wait these many seconds in reset#define MBOX_RESET_EXT_WAIT 120 // extended wait reset +#define MBOX_SYNC_WAIT_CNT 0xFFFF // wait loop index for synchronous mode + +#define MBOX_SYNC_DELAY_200 200 // 200 micro-seconds/* * maximum transfer that can happen through the firmware commands issued
_