mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
megaraid_sas : Host lock less mode to enabled asynchronous IO submission
Resending the patch. Addressed the review comments from Tomas Henzl. Megaraid_sas driver can now work in host lock less mode. Remove host lock less as megaraid_sas driver will have safer access to raid map as described in earlier patch. We now keep Driver Raid map copy, which will make sure that driver will always have old or new map Driver raid map will be replaced safely in MR_PopulateDrvRaidMap(), so there is no issue even if IO is continue from the scsi mid layer. There is a plan to remove "host_lock" and "hba_lock" usage from megaraid_sas in future. Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com> Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
51087a8617
commit
fb1a24ff65
1 changed files with 4 additions and 7 deletions
|
@ -1536,7 +1536,7 @@ megasas_build_and_issue_cmd(struct megasas_instance *instance,
|
||||||
* @done: Callback entry point
|
* @done: Callback entry point
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
megasas_queue_command_lck(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *))
|
megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
|
||||||
{
|
{
|
||||||
struct megasas_instance *instance;
|
struct megasas_instance *instance;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
@ -1558,7 +1558,7 @@ megasas_queue_command_lck(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd
|
||||||
} else {
|
} else {
|
||||||
spin_unlock_irqrestore(&instance->hba_lock, flags);
|
spin_unlock_irqrestore(&instance->hba_lock, flags);
|
||||||
scmd->result = DID_NO_CONNECT << 16;
|
scmd->result = DID_NO_CONNECT << 16;
|
||||||
done(scmd);
|
scmd->scsi_done(scmd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1566,7 +1566,7 @@ megasas_queue_command_lck(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd
|
||||||
if (instance->adprecovery == MEGASAS_HW_CRITICAL_ERROR) {
|
if (instance->adprecovery == MEGASAS_HW_CRITICAL_ERROR) {
|
||||||
spin_unlock_irqrestore(&instance->hba_lock, flags);
|
spin_unlock_irqrestore(&instance->hba_lock, flags);
|
||||||
scmd->result = DID_NO_CONNECT << 16;
|
scmd->result = DID_NO_CONNECT << 16;
|
||||||
done(scmd);
|
scmd->scsi_done(scmd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1577,7 +1577,6 @@ megasas_queue_command_lck(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd
|
||||||
|
|
||||||
spin_unlock_irqrestore(&instance->hba_lock, flags);
|
spin_unlock_irqrestore(&instance->hba_lock, flags);
|
||||||
|
|
||||||
scmd->scsi_done = done;
|
|
||||||
scmd->result = 0;
|
scmd->result = 0;
|
||||||
|
|
||||||
if (MEGASAS_IS_LOGICAL(scmd) &&
|
if (MEGASAS_IS_LOGICAL(scmd) &&
|
||||||
|
@ -1607,12 +1606,10 @@ megasas_queue_command_lck(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_done:
|
out_done:
|
||||||
done(scmd);
|
scmd->scsi_done(scmd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEF_SCSI_QCMD(megasas_queue_command)
|
|
||||||
|
|
||||||
static struct megasas_instance *megasas_lookup_instance(u16 host_no)
|
static struct megasas_instance *megasas_lookup_instance(u16 host_no)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
Loading…
Reference in a new issue