streamline lpfc error handling
PATCH 1/1 streamline lpfc error handling
streamline the callchain in the lpdc EH functions, use sdev->hostdata in a few places instead of the lpfc-internal lookup, fix up return values (they seemd to be completely wrong before)
lpfc_crtn.h +1 -3
@@ -216,8 +216,6 @@ struct lpfc_iocbq *);int lpfc_sli_abort_iocb_ctx (struct lpfc_hba *,struct lpfc_sli_ring *,uint32_t ); -int lpfc_sli_abort_iocb_context1 (struct lpfc_hba *,struct lpfc_sli_ring *, -void *);int lpfc_sli_abort_iocb_lun (struct lpfc_hba *,struct lpfc_sli_ring *,uint16_t ,uint64_t ); int lpfc_sli_abort_iocb_tgt(struct lpfc_hba *, struct lpfc_sli_ring *,
@@ -228,7 +226,6 @@void lpfc_stop_timer (struct clk_data *); -LPFC_SCSI_BUF_t *lpfc_get_scsi_buf (struct lpfc_hba *,int );void lpfc_free_scsi_buf (LPFC_SCSI_BUF_t *);void lpfc_map_fcp_cmnd_to_bpl (struct lpfc_hba *,LPFC_SCSI_BUF_t *);void lpfc_free_scsi_cmd (LPFC_SCSI_BUF_t *);
@@ -277,6 +274,7 @@int lpfc_revoke (struct scsi_device *);int lpfc_queuecommand (struct scsi_cmnd *,void (*done) (struct scsi_cmnd *));int lpfc_abort_handler (struct scsi_cmnd *); +int lpfc_reset_bus_handler (struct scsi_cmnd *cmnd);int lpfc_reset_lun_handler (struct scsi_cmnd *);#define ScsiResult (host_code, scsi_code) (((host_code) << 16) | scsi_code)
lpfc_fcp.c +0 -33
@@ -83,7 +83,6 @@static int lpfc_device_queue_depth (struct lpfc_hba *,struct scsi_device *); -static int lpfc_reset_bus_handler (struct scsi_cmnd *cmnd);static int lpfc_memmap (struct lpfc_hba *);static int lpfc_unmemmap (struct lpfc_hba *);
@@ -994,38 +993,6 @@return (len); } -static int -lpfc_reset_bus_handler (struct scsi_cmnd *cmnd) -{ -struct lpfc_hba *phba; -LPFC_SCSI_BUF_t *lpfc_cmd; -unsigned long iflag; -int rc, tgt, lun; - - phba = (struct lpfc_hba *) cmnd->device->host->hostdata[0 ]; - tgt = cmnd->device->id; - lun = cmnd->device->lun; - - rc =0 ; -if ((lpfc_cmd =lpfc_get_scsi_buf (phba,GFP_ATOMIC ))) { - rc =lpfc_scsi_hba_reset (phba, lpfc_cmd); -spin_lock_irqsave (&(phba->drvrlock), iflag); -lpfc_free_scsi_buf (lpfc_cmd); -spin_unlock_irqrestore (&(phba->drvrlock), iflag); - } - -/* SCSI layer issued Bus Reset */ -lpfc_printf_log (phba, -KERN_ERR , -LOG_FCP , -"0714 SCSI layer issued Bus Reset Data: x%x x%x x%x" , - tgt, lun, rc); - - -return (SUCCESS ); - -}/* lpfc_reset_bus_handler */ -int lpfc_slave_alloc (struct scsi_device *scsi_devs) {
lpfc_scsi.h +0 -6
@@ -208,14 +208,8 @@#define LPFC_SCSI_INITIAL_BPL_SIZE 4/* Number of scsi buf BDEs in fcp_bpl */ -#define FAILURE -1#define LPFC_CMD_STATUS_ABORTED -1 -#define LPFC_INTERNAL_RESET 0/* internal reset */ -#define LPFC_EXTERNAL_RESET 1/* external reset, scsi layer */ -#define LPFC_ISSUE_LUN_RESET 2/* flag for reset routine to issue LUN_RESET */ -#define LPFC_ISSUE_ABORT_TSET 4/* flag for reset routine to issue ABORT_TSET */ -#define LPFC_SCSI_DMA_EXT_SIZE 264#define LPFC_BPL_SIZE 1024
lpfc_scsiport.c +132 -309
537 lines not on this page · raw message
lpfc_sli.c +48 -34
138 lines not on this page · raw message