From patchwork Fri Oct 7 15:05:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meelis Roos X-Patchwork-Id: 118328 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5C7FEB70ED for ; Sat, 8 Oct 2011 02:05:13 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752964Ab1JGPFL (ORCPT ); Fri, 7 Oct 2011 11:05:11 -0400 Received: from smtp1.it.da.ut.ee ([193.40.5.66]:40157 "EHLO smtp1.it.da.ut.ee" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752707Ab1JGPFK (ORCPT ); Fri, 7 Oct 2011 11:05:10 -0400 Received: from math.ut.ee (math.ut.ee [193.40.36.2]) by smtp1.it.da.ut.ee (Postfix) with ESMTP id C58796E51B3; Fri, 7 Oct 2011 18:05:08 +0300 (EEST) Received: by math.ut.ee (Postfix, from userid 1014) id BFFA4DAF81; Fri, 7 Oct 2011 18:05:08 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by math.ut.ee (Postfix) with ESMTP id AC62FDAF80; Fri, 7 Oct 2011 18:05:08 +0300 (EEST) Date: Fri, 7 Oct 2011 18:05:08 +0300 (EEST) From: Meelis Roos To: James Bottomley cc: linux-scsi@vger.kernel.org, sparclinux@vger.kernel.org Subject: [PATCH v2] qlogicpti: fix timeout In-Reply-To: Message-ID: References: User-Agent: Alpine 1.00 (SOC 882 2007-12-20) MIME-Version: 1.0 Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org qlogicpti times out for some tape library operations (like mtx inventory). It seems SCSI command timeout is hardcoded into the driver. Fix it by propagating the timeout from scsi request to the controller as suggested by James Bottomley. Tested on Sun Ultra 1 with Sun StorEdge L8 Autoloader. Signed-off-by: Meelis Roos Acked-by: David S. Miller diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c index 9689d41c..e40dc1c 100644 --- a/drivers/scsi/qlogicpti.c +++ b/drivers/scsi/qlogicpti.c @@ -880,7 +880,7 @@ static inline void cmd_frob(struct Command_Entry *cmd, struct scsi_cmnd *Cmnd, cmd->control_flags |= CFLAG_WRITE; else cmd->control_flags |= CFLAG_READ; - cmd->time_out = 30; + cmd->time_out = Cmnd->request->timeout/HZ; memcpy(cmd->cdb, Cmnd->cmnd, Cmnd->cmd_len); }