Skip to content

Commit

Permalink
[SCSI] mpt fusion: rewrite of all internal generated functions
Browse files Browse the repository at this point in the history
Rewrite of all internal generated functions that issue commands to firmware,
porting them to be single threaded using the generic MPT_MGMT
struct. Implemented using completion Queue.

Signed-off-by: Kashyap Desai <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
Kashyap, Desai authored and James Bottomley committed Jun 9, 2009
1 parent f0f09d3 commit 37c60f3
Show file tree
Hide file tree
Showing 7 changed files with 248 additions and 330 deletions.
2 changes: 2 additions & 0 deletions drivers/message/fusion/mptbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
spin_lock_init(&ioc->diagLock);
spin_lock_init(&ioc->initializing_hba_lock);

mutex_init(&ioc->internal_cmds.mutex);
init_completion(&ioc->internal_cmds.done);
mutex_init(&ioc->mptbase_cmds.mutex);
init_completion(&ioc->mptbase_cmds.done);

Expand Down
5 changes: 3 additions & 2 deletions drivers/message/fusion/mptbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,9 @@ typedef struct _MPT_MGMT {
struct mutex mutex;
struct completion done;
u8 reply[MPT_DEFAULT_FRAME_SIZE]; /* reply frame data */
u8 sense[MPT_SENSE_BUFFER_ALLOC];
u8 status; /* current command status */
int completion_code;
} MPT_MGMT;

/*
Expand Down Expand Up @@ -709,6 +711,7 @@ typedef struct _MPT_ADAPTER
int sas_index; /* index refrencing */
MPT_MGMT sas_mgmt;
MPT_MGMT mptbase_cmds; /* for sending config pages */
MPT_MGMT internal_cmds;
struct work_struct sas_persist_task;

struct work_struct fc_setup_reset_work;
Expand Down Expand Up @@ -863,8 +866,6 @@ typedef struct _MPT_SCSI_HOST {
unsigned long timeouts; /* cmd timeouts */
ushort sel_timeout[MPT_MAX_FC_DEVICES];
char *info_kbuf;
wait_queue_head_t scandv_waitq;
int scandv_wait_done;
long last_queue_full;
u16 tm_iocstatus;
u16 spi_pending;
Expand Down
2 changes: 0 additions & 2 deletions drivers/message/fusion/mptfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1310,8 +1310,6 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
hd->timer.data = (unsigned long) hd;
hd->timer.function = mptscsih_timer_expired;

init_waitqueue_head(&hd->scandv_waitq);
hd->scandv_wait_done = 0;
hd->last_queue_full = 0;

sh->transportt = mptfc_transport_template;
Expand Down
2 changes: 0 additions & 2 deletions drivers/message/fusion/mptsas.c
Original file line number Diff line number Diff line change
Expand Up @@ -3282,8 +3282,6 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)

ioc->sas_data.ptClear = mpt_pt_clear;

init_waitqueue_head(&hd->scandv_waitq);
hd->scandv_wait_done = 0;
hd->last_queue_full = 0;
INIT_LIST_HEAD(&hd->target_reset_list);
spin_unlock_irqrestore(&ioc->FreeQlock, flags);
Expand Down
Loading

0 comments on commit 37c60f3

Please sign in to comment.