Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1494167pxb; Thu, 28 Jan 2021 19:25:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyI3kPJzwfnWvg1o2bsx1gBl0H3Gvhz4snjKAheUdQSp5zY6mPsEYHxAP70R27/VlJwr2cP X-Received: by 2002:a05:6402:d05:: with SMTP id eb5mr2862758edb.143.1611890704192; Thu, 28 Jan 2021 19:25:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611890704; cv=none; d=google.com; s=arc-20160816; b=o/kc8tA5iwVWIEJ+vQhaUmXx9DNJ4kttrtfEJM/iS6+NOKkCYGU0Y8rWLdhiP1RL6y YmQkbKZwIwxvi7jlFl4X7FrGDR9TRoraX54Lg683UIQ+n9bvFsR54/r3Yp9z9IDbFqQ5 iRfhgGjkq2svk6N+gOsrkhAaKkQMZXcFKA015e2QMdk94MU18UeNzyp5C+O1JmHiCqPb U/pqlDr1A4SNcmXUlvCqUky4KtfcvX3t1sp1Cm1/liemnGGj9JPZchoy6yvrNYMPimQn yJDVZrSLCJs1bG4b7FsBBM5UAFFaBVFXERumHyr3wdm2doy0N6nWLqAC3YcAYHHRF5eO Yq5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=d94CRsJCQF1Y+h4BwfepQS4bBLgA5tdBUPODOebZJXY=; b=D7a9c9g4loofPhY/V96aEuAy7oXAiaT9kGtL1UeNL7YvXpBtfHzR+PKfftq6kEniNn Nvcy36YvywoP2kbeRrJTP/zYLAbFrB2mbNnr4ZIfVAsp+iOvF4rMjt7YNAxbur4e60Yh oVsPanuplWp0RCYpOYQYeE5WnOuS6dT50pf9SeCMnsrBRD8qK72OdcAIIPlnH2ynULp0 SC1ArJLsZvWF7YD7qNdwG4mmQvpou8cYhlV4X5qH93gw5HgsjYRaOOWHgZL9e/PhjrsX BH7cXd2DZMDnzcW7VEEUGB57rysoT+p1IU86pEloCxD/7L89tlQFgx5Ikd9f1T0uFZTf RN3g== ARC-Authentication-Results: i=1; mx.google.com; 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 z24si3820200eja.111.2021.01.28.19.24.39; Thu, 28 Jan 2021 19:25:04 -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; 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 S229757AbhA2DXf (ORCPT + 99 others); Thu, 28 Jan 2021 22:23:35 -0500 Received: from mail-pl1-f170.google.com ([209.85.214.170]:33229 "EHLO mail-pl1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231513AbhA2DX3 (ORCPT ); Thu, 28 Jan 2021 22:23:29 -0500 Received: by mail-pl1-f170.google.com with SMTP id d13so4512060plg.0; Thu, 28 Jan 2021 19:23:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=d94CRsJCQF1Y+h4BwfepQS4bBLgA5tdBUPODOebZJXY=; b=Ndqlidps0iDgeyGOc4WTnnUIuJIxRCgYtWFKSHMS5460jJupV58XmdBn5nRhb8V7Hu CtVdjEOSVjj2P0lVUQMnF9Vp46klK6wLzybgnhfn9c736rc3iq+yG5xv1sgMUlpuSkW8 o35JA2RLNPMqxAfJE4Gs4a7mUYlg0RogOsX19LVqkgZGAwvI34C1ihU+6Y4vl0Z59oPz i8HT4XJCY+FvWTadHs80tzZJ3TPVynvwVDqs/kGPfXjRA9yp+sOobzpfiPB5djoCzyHR Mc9700TGujquw2i7OFRYRAzBkbkWDWdG4BmQtG0WDQkTaoKYUFUYoPW7R9plGj1F3Wk3 qSdg== X-Gm-Message-State: AOAM5325p24f4QMygXqK1ow6Gg4PmT1w0VIXnpdpKsQxcpQvLVnvtJxY zptCObP2r0Zt8/FmY+neMc2x0/+5W0M= X-Received: by 2002:a17:902:854b:b029:db:c725:edcd with SMTP id d11-20020a170902854bb02900dbc725edcdmr2207634plo.64.1611890567837; Thu, 28 Jan 2021 19:22:47 -0800 (PST) Received: from ?IPv6:2601:647:4000:d7:fd12:a590:9797:4acb? ([2601:647:4000:d7:fd12:a590:9797:4acb]) by smtp.gmail.com with ESMTPSA id z18sm7006201pfj.102.2021.01.28.19.22.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Jan 2021 19:22:47 -0800 (PST) Subject: Re: [PATCH v3 1/3] scsi: ufs: Fix task management request completion timeout To: Can Guo , jaegeuk@kernel.org, asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com Cc: Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , open list References: <1611807365-35513-1-git-send-email-cang@codeaurora.org> <1611807365-35513-2-git-send-email-cang@codeaurora.org> From: Bart Van Assche Message-ID: Date: Thu, 28 Jan 2021 19:22:45 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <1611807365-35513-2-git-send-email-cang@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks, Bart.