Skip to content

Commit 4a7bbe7

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Three small driver fixes and one core fix. The core fix being a fixup to the one in the last pull request which didn't entirely move checking of scsi_host_busy() out from under the host lock" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: core: Remove the ufshcd_release() in ufshcd_err_handling_prepare() scsi: ufs: core: Fix shift issue in ufshcd_clear_cmd() scsi: lpfc: Use unsigned type for num_sge scsi: core: Move scsi_host_busy() out of host lock if it is for per-command
2 parents ca00c70 + 17e94b2 commit 4a7bbe7

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

drivers/scsi/lpfc/lpfc_scsi.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,16 +1918,16 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
19181918
*
19191919
* Returns the number of SGEs added to the SGL.
19201920
**/
1921-
static int
1921+
static uint32_t
19221922
lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
19231923
struct sli4_sge *sgl, int datasegcnt,
19241924
struct lpfc_io_buf *lpfc_cmd)
19251925
{
19261926
struct scatterlist *sgde = NULL; /* s/g data entry */
19271927
struct sli4_sge_diseed *diseed = NULL;
19281928
dma_addr_t physaddr;
1929-
int i = 0, num_sge = 0, status;
1930-
uint32_t reftag;
1929+
int i = 0, status;
1930+
uint32_t reftag, num_sge = 0;
19311931
uint8_t txop, rxop;
19321932
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
19331933
uint32_t rc;
@@ -2099,7 +2099,7 @@ lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc,
20992099
*
21002100
* Returns the number of SGEs added to the SGL.
21012101
**/
2102-
static int
2102+
static uint32_t
21032103
lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
21042104
struct sli4_sge *sgl, int datacnt, int protcnt,
21052105
struct lpfc_io_buf *lpfc_cmd)
@@ -2123,8 +2123,8 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,
21232123
uint32_t rc;
21242124
#endif
21252125
uint32_t checking = 1;
2126-
uint32_t dma_offset = 0;
2127-
int num_sge = 0, j = 2;
2126+
uint32_t dma_offset = 0, num_sge = 0;
2127+
int j = 2;
21282128
struct sli4_hybrid_sgl *sgl_xtra = NULL;
21292129

21302130
sgpe = scsi_prot_sglist(sc);

drivers/scsi/scsi_error.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,12 @@ static void scsi_eh_inc_host_failed(struct rcu_head *head)
282282
{
283283
struct scsi_cmnd *scmd = container_of(head, typeof(*scmd), rcu);
284284
struct Scsi_Host *shost = scmd->device->host;
285+
unsigned int busy = scsi_host_busy(shost);
285286
unsigned long flags;
286287

287288
spin_lock_irqsave(shost->host_lock, flags);
288289
shost->host_failed++;
289-
scsi_eh_wakeup(shost, scsi_host_busy(shost));
290+
scsi_eh_wakeup(shost, busy);
290291
spin_unlock_irqrestore(shost->host_lock, flags);
291292
}
292293

drivers/scsi/scsi_lib.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,11 @@ static void scsi_dec_host_busy(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
278278
rcu_read_lock();
279279
__clear_bit(SCMD_STATE_INFLIGHT, &cmd->state);
280280
if (unlikely(scsi_host_in_recovery(shost))) {
281+
unsigned int busy = scsi_host_busy(shost);
282+
281283
spin_lock_irqsave(shost->host_lock, flags);
282284
if (shost->host_failed || shost->host_eh_scheduled)
283-
scsi_eh_wakeup(shost, scsi_host_busy(shost));
285+
scsi_eh_wakeup(shost, busy);
284286
spin_unlock_irqrestore(shost->host_lock, flags);
285287
}
286288
rcu_read_unlock();

drivers/ufs/core/ufshcd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3057,7 +3057,7 @@ bool ufshcd_cmd_inflight(struct scsi_cmnd *cmd)
30573057
*/
30583058
static int ufshcd_clear_cmd(struct ufs_hba *hba, u32 task_tag)
30593059
{
3060-
u32 mask = 1U << task_tag;
3060+
u32 mask;
30613061
unsigned long flags;
30623062
int err;
30633063

@@ -3075,6 +3075,8 @@ static int ufshcd_clear_cmd(struct ufs_hba *hba, u32 task_tag)
30753075
return 0;
30763076
}
30773077

3078+
mask = 1U << task_tag;
3079+
30783080
/* clear outstanding transaction before retry */
30793081
spin_lock_irqsave(hba->host->host_lock, flags);
30803082
ufshcd_utrl_clear(hba, mask);
@@ -6352,7 +6354,6 @@ static void ufshcd_err_handling_prepare(struct ufs_hba *hba)
63526354
ufshcd_hold(hba);
63536355
if (!ufshcd_is_clkgating_allowed(hba))
63546356
ufshcd_setup_clocks(hba, true);
6355-
ufshcd_release(hba);
63566357
pm_op = hba->is_sys_suspended ? UFS_SYSTEM_PM : UFS_RUNTIME_PM;
63576358
ufshcd_vops_resume(hba, pm_op);
63586359
} else {

0 commit comments

Comments
 (0)