Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1557687pxb; Thu, 28 Jan 2021 21:51:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpvuxzHbfEATRnii8rCXys8Ygbmpn7IOArGYXtGNxy5lDfRA/AYCx3vZHRlfTl1RzfIox7 X-Received: by 2002:aa7:db1a:: with SMTP id t26mr3484261eds.25.1611899506781; Thu, 28 Jan 2021 21:51:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611899506; cv=none; d=google.com; s=arc-20160816; b=G+IEdIl1gvm913qyIgn4Gw2x+K3TwDFhrr8UD9cqf1YORjAao8PGAEhLIJL/LhT5YF 4M+gfiomW2bhqkbrW5I2o4k+Obfz0KKz8lcclM+FlIf1PALVDV85T/CBYTh6gbcLV7i3 7h+UU+GY7oT2YoCLtU+cVJFFV9C4T68j0pdvpuiqwjTq9qJX+m5TYpJ9vE/xQTebQgmi 8ISZpTW7Ob6ZJiFpytTUeO/ggmGSZ6lH/OqNLVN15JmnMjrZYgU4Tc13/PqZTiKfVJBK MXxlwNJbvN3XW9X+OyMVWC0xH/R3kc6emmkMaO+zN8RLJo8ZU64wGatEHkxuJghlSwUc Lafw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=n2o6XDlbL/t7pa9ksIQ0MJIKQ1F8tE9oChxG/T+mGDY=; b=s2c/iYQfKbUs1B9c7kaecSznrr3xLdE/i0kk8z3b73YEseXVn8ccGiHSA+pqCutP9/ AeK2A6RE2CSdfGdUoOFDaltTfx8IUc3iit69oXyFtQ8qJlZBmw00lujSZPDNpGPD3+Yc /EWhDBsCmnrswkpaEUng0+9NIHcsppd80gPhQrAkWnpFSSvJmFjJaLlJ8ibE7oqBf1bG 0TVNXh+tnAMB/xPBCa4vTooOUQ3UzZQbQnYvYIj7BgGcdL7EvCq8sR2BrtNl57P1krq+ JL34Zgatl7mwshqUbojT4SespDhDj7gipJFo+dBOHH7lhXonNNO3EhIDprBAGz8XvnwK NzXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=kR9SSMWi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si4131260ejr.658.2021.01.28.21.51.14; Thu, 28 Jan 2021 21:51:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=kR9SSMWi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230367AbhA2Fri (ORCPT + 99 others); Fri, 29 Jan 2021 00:47:38 -0500 Received: from a1.mail.mailgun.net ([198.61.254.60]:43356 "EHLO a1.mail.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229656AbhA2Frh (ORCPT ); Fri, 29 Jan 2021 00:47:37 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1611899233; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=n2o6XDlbL/t7pa9ksIQ0MJIKQ1F8tE9oChxG/T+mGDY=; b=kR9SSMWizS5AcBdLCEDabEDHVh+V8FmngcITZ4zgDc/ZmClGx91K5TFHUN6UpXQe6RKqqRVK uwkp7KVGXUB2SqsYU2f31iqTvNxYzfS0LDo8BjJKaOzI3kaPhqYV8DJoy3uucx5qOZuC758V bem+km8EYN3T0nnrBjgd5m7v8QY= X-Mailgun-Sending-Ip: 198.61.254.60 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 6013a141d08556f4550f9127 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 29 Jan 2021 05:46:41 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B760EC43463; Fri, 29 Jan 2021 05:46:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: cang) by smtp.codeaurora.org (Postfix) with ESMTPSA id DF43BC433CA; Fri, 29 Jan 2021 05:46:39 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 29 Jan 2021 13:46:39 +0800 From: Can Guo To: Bart Van Assche Cc: jaegeuk@kernel.org, asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , open list Subject: Re: [PATCH v3 1/3] scsi: ufs: Fix task management request completion timeout In-Reply-To: References: <1611807365-35513-1-git-send-email-cang@codeaurora.org> <1611807365-35513-2-git-send-email-cang@codeaurora.org> Message-ID: <1bcdd48c6afb079aadc8464847295363@codeaurora.org> X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-01-29 11:22, Bart Van Assche wrote: > On 1/27/21 8:16 PM, Can Guo wrote: >> ufshcd_tmc_handler() calls blk_mq_tagset_busy_iter(fn = >> ufshcd_compl_tm()), >> but since blk_mq_tagset_busy_iter() only iterates over all reserved >> tags >> and requests which are not in IDLE state, ufshcd_compl_tm() never gets >> a >> chance to run. Thus, TMR always ends up with completion timeout. Fix >> it by >> calling blk_mq_start_request() in __ufshcd_issue_tm_cmd(). >> >> Fixes: 69a6c269c097 ("scsi: ufs: Use blk_{get,put}_request() to >> allocate and free TMFs") >> >> Signed-off-by: Can Guo >> --- >> drivers/scsi/ufs/ufshcd.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c >> index 8da75e6..c0c5925 100644 >> --- a/drivers/scsi/ufs/ufshcd.c >> +++ b/drivers/scsi/ufs/ufshcd.c >> @@ -6395,6 +6395,7 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba >> *hba, >> >> spin_lock_irqsave(host->host_lock, flags); >> task_tag = hba->nutrs + free_slot; >> + blk_mq_start_request(req); >> >> treq->req_header.dword_0 |= cpu_to_be32(task_tag); > > blk_mq_start_request() not only marks a request as in-flight but also > starts a timer. However, no timeout handler has been defined in > ufshcd_tmf_ops. Should a timeout handler be defined in that data > structure? > Block mq driver gives 30s as default timeout, TMR timeout is 100ms in UFS driver. So we don't need a timeout handler as of now. Thanks, Can Guo. > Thanks, > > Bart.