From patchwork Fri Jun 12 14:13:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 6599021 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9A8C0C0433 for ; Fri, 12 Jun 2015 14:13:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC52320673 for ; Fri, 12 Jun 2015 14:13:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D59DB2065D for ; Fri, 12 Jun 2015 14:13:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755567AbbFLON1 (ORCPT ); Fri, 12 Jun 2015 10:13:27 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38785 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754640AbbFLONX (ORCPT ); Fri, 12 Jun 2015 10:13:23 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 79F77AD52; Fri, 12 Jun 2015 14:13:22 +0000 (UTC) From: Hannes Reinecke To: James Bottomley Cc: linux-scsi@vger.kernel.org, Christoph Hellwig , Nic Bellinger , Ewan Milne , Hannes Reinecke Subject: [PATCH] scsi: Increase number of retries for scsi_mode_sense() Date: Fri, 12 Jun 2015 16:13:21 +0200 Message-Id: <1434118401-100652-1-git-send-email-hare@suse.de> X-Mailer: git-send-email 1.8.5.2 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As scsi_mode_sense() is now retrying for any UAs it needs potentially several retries to clear any UA status. So increase the number of retries to at least 5. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_transport_sas.c | 2 +- drivers/scsi/sr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 9a05819..a02ed82 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c @@ -1280,7 +1280,7 @@ int sas_read_port_mode_page(struct scsi_device *sdev) if (!buffer) return -ENOMEM; - res = scsi_mode_sense(sdev, 1, 0x19, buffer, BUF_SIZE, 30*HZ, 3, + res = scsi_mode_sense(sdev, 1, 0x19, buffer, BUF_SIZE, 30*HZ, 5, &mode_data, NULL); error = -EINVAL; diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 8bd54a6..9733452 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -858,7 +858,7 @@ static void get_capabilities(struct scsi_cd *cd) /* ask for mode page 0x2a */ rc = scsi_mode_sense(cd->device, 0, 0x2a, buffer, 128, - SR_TIMEOUT, 3, &data, NULL); + SR_TIMEOUT, 5, &data, NULL); if (!scsi_status_is_good(rc)) { /* failed, drive doesn't have capabilities mode page */