Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1716916

[PATCH 1/2] scsi: Move scsi_cmd->jiffies_at_alloc initialization to allocation time

From Brian King <brking@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] scsi: Move scsi_cmd->jiffies_at_alloc initialization to allocation time
Date 2017-08-22 00:20 +0200
Message-ID <uh3d7-1GC-15@gated-at.bofh.it> (permalink)
References (4 earlier) <ufWGK-zl-17@gated-at.bofh.it> <ufXjs-XC-13@gated-at.bofh.it> <ufXt7-10P-7@gated-at.bofh.it> <ufXMt-1mk-5@gated-at.bofh.it> <uh3d7-1GC-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Move the initialization of scsi_cmd->jiffies_at_alloc to allocation
time rather than prep time. Also ensure that jiffies_at_alloc
is preserved when we go through prep. This lets us send retries
through prep again and not break the overall retry timer logic
in scsi_softirq_done.

Suggested-by: Bart Van Assche <Bart.VanAssche@wdc.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---

Index: linux-2.6.git/drivers/scsi/scsi_lib.c
===================================================================
--- linux-2.6.git.orig/drivers/scsi/scsi_lib.c
+++ linux-2.6.git/drivers/scsi/scsi_lib.c
@@ -1154,6 +1154,7 @@ void scsi_init_command(struct scsi_devic
 	void *buf = cmd->sense_buffer;
 	void *prot = cmd->prot_sdb;
 	unsigned int unchecked_isa_dma = cmd->flags & SCMD_UNCHECKED_ISA_DMA;
+	unsigned long jiffies_at_alloc = cmd->jiffies_at_alloc;
 
 	/* zero out the cmd, except for the embedded scsi_request */
 	memset((char *)cmd + sizeof(cmd->req), 0,
@@ -1164,7 +1165,7 @@ void scsi_init_command(struct scsi_devic
 	cmd->prot_sdb = prot;
 	cmd->flags = unchecked_isa_dma;
 	INIT_DELAYED_WORK(&cmd->abort_work, scmd_eh_abort_handler);
-	cmd->jiffies_at_alloc = jiffies;
+	cmd->jiffies_at_alloc = jiffies_at_alloc;
 
 	scsi_add_cmd_to_list(cmd);
 }
@@ -2119,6 +2120,7 @@ static int scsi_init_rq(struct request_q
 	if (!cmd->sense_buffer)
 		goto fail;
 	cmd->req.sense = cmd->sense_buffer;
+	cmd->jiffies_at_alloc = jiffies;
 
 	if (scsi_host_get_prot(shost) >= SHOST_DIX_TYPE0_PROTECTION) {
 		cmd->prot_sdb = kmem_cache_zalloc(scsi_sdb_cache, gfp);

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [BUG][bisected 270065e] linux-next fails to boot on powerpc Bart Van Assche <Bart.VanAssche@wdc.com> - 2017-08-16 19:30 +0200
  Re: [BUG][bisected 270065e] linux-next fails to boot on powerpc Brian King <brking@linux.vnet.ibm.com> - 2017-08-17 01:20 +0200
    Re: [BUG][bisected 270065e] linux-next fails to boot on powerpc Bart Van Assche <Bart.VanAssche@wdc.com> - 2017-08-17 18:00 +0200
      Re: [BUG][bisected 270065e] linux-next fails to boot on powerpc Brian King <brking@linux.vnet.ibm.com> - 2017-08-18 23:10 +0200
        [PATCH] ipr: Set no_report_opcodes for RAID arrays Brian King <brking@linux.vnet.ibm.com> - 2017-08-18 23:20 +0200
          Re: [PATCH] ipr: Set no_report_opcodes for RAID arrays "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-08-21 22:30 +0200
        Re: [BUG][bisected 270065e] linux-next fails to boot on powerpc Bart Van Assche <Bart.VanAssche@wdc.com> - 2017-08-18 23:50 +0200
          Re: [BUG][bisected 270065e] linux-next fails to boot on powerpc Brian King <brking@linux.vnet.ibm.com> - 2017-08-19 00:00 +0200
            Re: [BUG][bisected 270065e] linux-next fails to boot on powerpc Bart Van Assche <Bart.VanAssche@wdc.com> - 2017-08-19 00:20 +0200
              [PATCH 2/2] scsi: Preserve retry counter through scsi_prep_fn Brian King <brking@linux.vnet.ibm.com> - 2017-08-22 00:20 +0200
                Re: [PATCH 2/2] scsi: Preserve retry counter through scsi_prep_fn "hch@lst.de" <hch@lst.de> - 2017-08-22 09:00 +0200
              [PATCH 0/2] Allow scsi_prep_fn to occur for retried commands Brian King <brking@linux.vnet.ibm.com> - 2017-08-22 00:20 +0200
                [PATCH 1/2] scsi: Move scsi_cmd->jiffies_at_alloc initialization to  allocation time Brian King <brking@linux.vnet.ibm.com> - 2017-08-22 00:20 +0200
                Re: [PATCH 1/2] scsi: Move scsi_cmd->jiffies_at_alloc initialization  to allocation time Brian King <brking@linux.vnet.ibm.com> - 2017-08-22 00:20 +0200
                [PATCHv2 1/2] scsi: Move scsi_cmd->jiffies_at_alloc initialization to  allocation time Brian King <brking@linux.vnet.ibm.com> - 2017-08-22 00:50 +0200
                Re: [PATCH 1/2] scsi: Move scsi_cmd->jiffies_at_alloc         initialization to allocation time "hch@lst.de" <hch@lst.de> - 2017-08-22 09:00 +0200
                Re: [PATCH 0/2] Allow scsi_prep_fn to occur for retried commands Abdul Haleem <abdhalee@linux.vnet.ibm.com> - 2017-08-22 08:50 +0200
            Re: [BUG][bisected 270065e] linux-next fails to boot on powerpc "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-08-21 22:30 +0200
  Re: [BUG][bisected 270065e] linux-next fails to boot on powerpc Michael Ellerman <mpe@ellerman.id.au> - 2017-08-17 03:40 +0200

csiph-web