Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp344335pxb; Wed, 29 Sep 2021 00:02:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8DtO2u+rRre1fI4ulCQHEs4myWADkj9wxS9yG84J9+QogB2Cyrwu1/EiiQoS58ycrgT/n X-Received: by 2002:a63:790b:: with SMTP id u11mr8195868pgc.71.1632898968876; Wed, 29 Sep 2021 00:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632898968; cv=none; d=google.com; s=arc-20160816; b=X6BFbcfJE50LUjCQ7x7r7DbKcn5dcFU5quZcf3P6qhQbfc6hV07RiDxPNJbruG0Eeu DUKHdmoBZCGf9KDuDuMQTvzL/v7TabdLg99YpiZ0Z773+k7UW/ZhffF1VCXVqJ77tasc b3oRf4CM1t1DWnrZbUUGAgxjK/vPwNO8R49dfq8sux3k7lQQgCyRv4WV/mAcoVH1a5+b 74PsfJBYUvpCsJH9heY9/OSw7b2SbqA/c+YToKsNhl0fB+6nrsVdY/uy4QxT6FFCqV3i OwZf+UByqFC5oOai64stXXG54OdUxYcdfuGZ80x5GRfmG0vaGcJ9a74pmpQGnMvs8cK4 GK3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=CukMTT7BhRZOn5G5T6tRmM/8uPHfJJ1GJKjlAViMji8=; b=HpblWjTGGzri3IAKndThieQTjKXtDXIqULm5MrYnG6sLW2J7gZwt13p1IAhoOorUDT ltDDxn+JyqbisGWSIz2wFcOvEv7xe48M8QPo32szrtUjX8Jj3bYZEAqneTcr+41hsBXl sUGnx5LAM+GS4Q1LlTnVX0tLvC5K+AWsOPe94oih7aTPcoyx9H4bWh4V9pxoSfXwmYww YtadmveLOUI3xPmxUYo8DLAL6Sp1QgBdlSKYMbhmXJsPxcn3vxbcDEfEvDDDgQDS3s75 SLNkq6Iq/cok/m3nRJY2L0PZJR7LUk6Gez/SH7zSdfisEte1Y7iUN+n8jjqqP0JvYz1C cIeg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e3si764272pjm.101.2021.09.29.00.02.32; Wed, 29 Sep 2021 00:02:48 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244381AbhI2HC4 (ORCPT + 99 others); Wed, 29 Sep 2021 03:02:56 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:34276 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229536AbhI2HCz (ORCPT ); Wed, 29 Sep 2021 03:02:55 -0400 X-UUID: 565c1f70ef764a769e0909e9db7ccfee-20210929 X-UUID: 565c1f70ef764a769e0909e9db7ccfee-20210929 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1605795204; Wed, 29 Sep 2021 15:01:10 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Wed, 29 Sep 2021 15:01:09 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 29 Sep 2021 15:01:09 +0800 From: Po-Wen Kao To: , , , , , , , , CC: , , , , , , , , , Subject: [PATCH 0/2] Fix UFS task management command timeout Date: Wed, 29 Sep 2021 15:00:45 +0800 Message-ID: <20210929070047.4223-1-powen.kao@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On UTP_TASK_REQ_COMPL interrupt, ufshcd_tmc_handler() iterates through busy requests in tags->rqs and complete request if corresponding doorbell flag is reset. However, ufshcd_issue_tm_cmd() allocates requests from tags->static_rqs and trigger doorbell directly without dispatching request through block layer, thus requests can never be found in tags->rqs and completed properly. Any TM command issued by ufshcd_issue_tm_cmd() inevitably timeout and further leads to recovery flow failure when LU Reset or Abort Task is issued. In this patch, blk_mq_tagset_busy_iter() call in ufshcd_tmc_handler() is replaced with new interface, blk_mq_drv_tagset_busy_iter(), to allow completion of request allocted by driver. The new interface is introduced for driver to iterate through requests in static_rqs. Po-Wen Kao (2): blk-mq: new busy request iterator for driver scsi: ufs: fix TM request timeout block/blk-mq-tag.c | 36 ++++++++++++++++++++++++++++++------ drivers/scsi/ufs/ufshcd.c | 2 +- include/linux/blk-mq.h | 4 ++++ 3 files changed, 35 insertions(+), 7 deletions(-) -- 2.18.0