Re: [PATCH 1/4] dpt_i2o: remove serial number usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/26/19 3:35 PM, Christoph Hellwig wrote:
  static u32 adpt_cmd_to_context(struct scsi_cmnd *cmd)
  {
-	return (u32)cmd->serial_number;
+	return (u32)cmd->request->tag + 1;

Why the +1 (with the corresponding -1 later)?  Also why keep
this rather confusing helper?

Because the original driver always checked for a non-zero serial number, and it might well be a firmware limitation (treating commands with a zero identifier as invalid commands).
So to keep the original behaviour I've added the '+ 1' to the tag number.

  }
/*
@@ -604,28 +604,12 @@ static struct scsi_cmnd *
  	adpt_cmd_from_context(adpt_hba * pHba, u32 context)
  {
  	struct scsi_cmnd * cmd;
spin_unlock(pHba->host->host_lock);
+	cmd = scsi_host_find_tag(pHba->host, context - 1);
  	spin_lock(pHba->host->host_lock);
- return NULL;
+	return cmd;

No need to take the host_lock around scsi_host_find_tag.
Also we cant probably drop this helper.

Okay, will be doing so.

Cheers,

Hannes




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux