Commit 56d46dd5 authored by Tom Coughlan's avatar Tom Coughlan Committed by James Bottomley

[PATCH] aacraid: remove aac_handle_aif

When aac_command_thread detects an adapter event (AifCmdDriverNotify or
AifCmdEventNotify) it calls aac_handle_aif. This routine sets a flag,
calls fib_adapter_complete, and returns. The bad news is that after the
return, aac_command_thread continues to process the command and calls
fib_adapter_complete again.

Under some circumstances this causes the driver to take the device
offline. In my case, it happens with a Dell CERC SATA with a RAID 5 in
the "building" state:

aacraid: Host adapter reset request. SCSI hang ?
aacraid: Host adapter appears dead
scsi: Device offlined - not ready after error recovery: host 0 channel 0
id 0 lun 0
SCSI error : <0 0 0 0> return code = 0x6000000
end_request: I/O error, dev sda, sector 976537592

Mark Salyzyn says the intent is for aac_handle_aif to perform some
plug-n-play actions based on the adapter event, and return, leaving the
command completion to the caller.

The attached patch solves the problem by removing aac_handle_aif
entirely, since it is wrong, and there is currently no code in the
driver to actually do anything with these events.
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent e22ccab2
...@@ -768,28 +768,6 @@ void aac_printf(struct aac_dev *dev, u32 val) ...@@ -768,28 +768,6 @@ void aac_printf(struct aac_dev *dev, u32 val)
memset(cp, 0, 256); memset(cp, 0, 256);
} }
/**
* aac_handle_aif - Handle a message from the firmware
* @dev: Which adapter this fib is from
* @fibptr: Pointer to fibptr from adapter
*
* This routine handles a driver notify fib from the adapter and
* dispatches it to the appropriate routine for handling.
*/
static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
{
struct hw_fib * hw_fib = fibptr->hw_fib;
/*
* Set the status of this FIB to be Invalid parameter.
*
* *(u32 *)fib->data = ST_INVAL;
*/
*(u32 *)hw_fib->data = cpu_to_le32(ST_OK);
fib_adapter_complete(fibptr, sizeof(u32));
}
/** /**
* aac_command_thread - command processing thread * aac_command_thread - command processing thread
* @dev: Adapter to monitor * @dev: Adapter to monitor
...@@ -859,7 +837,6 @@ int aac_command_thread(struct aac_dev * dev) ...@@ -859,7 +837,6 @@ int aac_command_thread(struct aac_dev * dev)
aifcmd = (struct aac_aifcmd *) hw_fib->data; aifcmd = (struct aac_aifcmd *) hw_fib->data;
if (aifcmd->command == cpu_to_le32(AifCmdDriverNotify)) { if (aifcmd->command == cpu_to_le32(AifCmdDriverNotify)) {
/* Handle Driver Notify Events */ /* Handle Driver Notify Events */
aac_handle_aif(dev, fib);
*(u32 *)hw_fib->data = cpu_to_le32(ST_OK); *(u32 *)hw_fib->data = cpu_to_le32(ST_OK);
fib_adapter_complete(fib, sizeof(u32)); fib_adapter_complete(fib, sizeof(u32));
} else { } else {
...@@ -870,10 +847,6 @@ int aac_command_thread(struct aac_dev * dev) ...@@ -870,10 +847,6 @@ int aac_command_thread(struct aac_dev * dev)
u32 time_now, time_last; u32 time_now, time_last;
unsigned long flagv; unsigned long flagv;
/* Sniff events */
if (aifcmd->command == cpu_to_le32(AifCmdEventNotify))
aac_handle_aif(dev, fib);
time_now = jiffies/HZ; time_now = jiffies/HZ;
spin_lock_irqsave(&dev->fib_lock, flagv); spin_lock_irqsave(&dev->fib_lock, flagv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment