From patchwork Thu Aug 11 20:12:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaun Tancheff X-Patchwork-Id: 9275921 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EFE47600CB for ; Thu, 11 Aug 2016 20:12:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD1DC28775 for ; Thu, 11 Aug 2016 20:12:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1DF628789; Thu, 11 Aug 2016 20:12:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8441728775 for ; Thu, 11 Aug 2016 20:12:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752100AbcHKUMn (ORCPT ); Thu, 11 Aug 2016 16:12:43 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:36796 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752054AbcHKUMm (ORCPT ); Thu, 11 Aug 2016 16:12:42 -0400 Received: by mail-io0-f193.google.com with SMTP id y34so414786ioi.3; Thu, 11 Aug 2016 13:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=fLcbibLktsP/w1eTuQ0PJfmvFgZe6BsTOrm8yAkOV0Y=; b=NWIw7T9bMdPlJBEBD+ZWqPJzCRRWKJyvtuBRK6ZahrBw+EPbloVgumxgPI6Ocvspeb 2nyzgBedPSjY1OgwXNdnBmOmIBUzUJNzs6asiDrN9hBQfl8nt9Z8ua0zJMRQ/EB1bqBZ pnNMHKAwLB1ppd9E/jfvuXVS7v9GcIOzYk4pehcy0IoflIi7RDfBLSogAi3Jw9vJT/l0 Rdj3RejyU0BSH0JcNK9Ua6Y/yqbnupYzc9FfsoqjzzT0tTUDfh1+/Bwqe9BxfasiSXNq ngWMP3aNXbuCSGiqBWiIST11wOVNICgz4qAnyaJBBMOCCw+mRXdUHWYSFGMofwe4dOfE +x8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=fLcbibLktsP/w1eTuQ0PJfmvFgZe6BsTOrm8yAkOV0Y=; b=NzV6a2RdQksvuR+yYCqGiNe9GUTiBdkvkoDGFGJT7KoQMwEtxYEYBMlJK0fBFPCBSG lhEsI93zEv2d7QaR5hyWPLGGwUE1+waPayhBn0WwXEW630XSZR9DFT4oCznhWfce9F24 3vB4ER5SPotJbaQ8BhJAGkpYSEq362/CFBdl9rsJD1DyhyZGqY6rGeZRZLUbLK0nvcU2 ED9N1VJkPxzelPUCF3P1ObGVMDzydrVGSmUgdH7YZ13Qy3jQ2vRXXcTnFTX7lJuT/Hqy suQNuN2CArI2AIw3jyVqXcFkGMjtC8q2E2G0Kir1BNOVuc7Ppyly2klRwLOm9K7L6sAK txTg== X-Gm-Message-State: AEkoouvpWPnMPMthGCFbR2UfVpRJkZGfHGNYArNAlwm8N5mw5xkkYG+ZYbXk7XAwoo7koQ== X-Received: by 10.107.138.102 with SMTP id m99mr14195636iod.91.1470946361495; Thu, 11 Aug 2016 13:12:41 -0700 (PDT) Received: from helios.aeonazure.com (173-23-249-37.client.mchsi.com. [173.23.249.37]) by smtp.gmail.com with ESMTPSA id j12sm2008835ioi.36.2016.08.11.13.12.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Aug 2016 13:12:41 -0700 (PDT) From: Shaun Tancheff To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Shaun Tancheff , "James E . J . Bottomley" , "Martin K . Petersen" , Josh Bingaman , Shaun Tancheff Subject: [PATCH] Update WRITE_SAME timeout in sd_setup_discard_cmnd Date: Thu, 11 Aug 2016 15:12:38 -0500 Message-Id: <1470946358-6744-1-git-send-email-shaun@tancheff.com> X-Mailer: git-send-email 2.8.1 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In sd_setup_discard_cmnd() there are a some discard methods that fall back to using WRITE_SAME. It appears that those paths using WRITE_SAME should also use the SD_WRITE_SAME_TIMEOUT instead of the default SD_TIMEOUT. Signed-off-by: Shaun Tancheff --- I don't have a use case that breaks the current code. It just seems to me that setups for discard and write same should be consistent. --- drivers/scsi/sd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index d3e852a..3c15f3a 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -722,6 +722,8 @@ static int sd_setup_discard_cmnd(struct scsi_cmnd *cmd) if (!page) return BLKPREP_DEFER; + rq->timeout = SD_TIMEOUT; + switch (sdkp->provisioning_mode) { case SD_LBP_UNMAP: buf = page_address(page); @@ -746,6 +748,7 @@ static int sd_setup_discard_cmnd(struct scsi_cmnd *cmd) put_unaligned_be32(nr_sectors, &cmd->cmnd[10]); len = sdkp->device->sector_size; + rq->timeout = SD_WRITE_SAME_TIMEOUT; break; case SD_LBP_WS10: @@ -758,6 +761,7 @@ static int sd_setup_discard_cmnd(struct scsi_cmnd *cmd) put_unaligned_be16(nr_sectors, &cmd->cmnd[7]); len = sdkp->device->sector_size; + rq->timeout = SD_WRITE_SAME_TIMEOUT; break; default: @@ -766,8 +770,6 @@ static int sd_setup_discard_cmnd(struct scsi_cmnd *cmd) } rq->completion_data = page; - rq->timeout = SD_TIMEOUT; - cmd->transfersize = len; cmd->allowed = SD_MAX_RETRIES;