Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756002AbbGGBIP (ORCPT ); Mon, 6 Jul 2015 21:08:15 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:42577 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755544AbbGGBIH (ORCPT ); Mon, 6 Jul 2015 21:08:07 -0400 Message-ID: <1436231285.6297.1.camel@haakon3.risingtidesystems.com> Subject: Re: [PATCH] tcm_qla2xxx: pass timeout as HZ independent value From: "Nicholas A. Bellinger" To: Nicholas Mc Guire Cc: Christoph Hellwig , Saurav Kashyap , Bart Van Assche , Himanshu Madhani , linux-kernel@vger.kernel.org Date: Mon, 06 Jul 2015 18:08:05 -0700 In-Reply-To: <1436198680-8303-1-git-send-email-hofrat@osadl.org> References: <1436198680-8303-1-git-send-email-hofrat@osadl.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2212 Lines: 58 Hi Nicholas, On Mon, 2015-07-06 at 18:04 +0200, Nicholas Mc Guire wrote: > API compliance scanning with coccinelle flagged: > ./drivers/scsi/qla2xxx/tcm_qla2xxx.c:407:2-29: > WARNING: timeout is HZ dependent > > This was introduced in 'commit 75f8c1f693ee ("[SCSI] tcm_qla2xxx: Add >= > 24xx series fabric module for target-core")'. wait_for_completion_timeout() > expects a timeout in jiffies so the numeric constant makes the effective > timeout HZ dependent. Resolved by converting it to CONST * HZ. > > Signed-off-by: Nicholas Mc Guire > --- > > As the intended timeout is not documented I'm guessing that it should be > 3000 milliseconds but someone that knows the driver needs to check if that > is a reasonable guess. > > Further its not clear why the timeout event if it were to occure does not > produce some debug message and/or pass it up through the return value. > > Patch was compile tested with x86_64_defconfig + CONFIG_SCSI_LOWLEVEL=y, > CONFIG_SCSI_FC_ATTRS=y, CONFIG_TARGET_CORE=m, CONFIG_LIBFC=m, > CONFIG_SCSI_QLA_FC=m, CONFIG_TCM_QLA2XXX=m > > Patch is against 4.2-rc1 (localversion-next is -next-20150706) > > drivers/scsi/qla2xxx/tcm_qla2xxx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c > index d9a8c60..33364b6 100644 > --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c > +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c > @@ -405,7 +405,7 @@ static int tcm_qla2xxx_write_pending_status(struct se_cmd *se_cmd) > se_cmd->t_state == TRANSPORT_COMPLETE_QF_WP) { > spin_unlock_irqrestore(&se_cmd->t_state_lock, flags); > wait_for_completion_timeout(&se_cmd->t_transport_stop_comp, > - 3000); > + 3 * HZ); > return 0; > } > spin_unlock_irqrestore(&se_cmd->t_state_lock, flags); Applied to target-pending/master, and will include in the next v4.2-rc fixes PULL request. Thanks! --nab -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/