Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1443930ybj; Fri, 8 May 2020 01:14:24 -0700 (PDT) X-Google-Smtp-Source: APiQypLv2Ra2S4mvs7GdbvfWkL+wCwehTFFluAaG11VhLpPOyE6cRla0xQBC0BGr97sEa2cmMJoV X-Received: by 2002:a05:6402:6c4:: with SMTP id n4mr1142759edy.368.1588925664182; Fri, 08 May 2020 01:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588925664; cv=none; d=google.com; s=arc-20160816; b=OP5CApXzyRqvmi0uLlBPJ6SPPunsxAt6nJ+U4a2A9byghZSRtKOHJnjegLkI0HvR7I l1ZGFycBzqNlSu2tvyGybIcRBopc8jGXDeHEGCW6Aq7NMP7wSCRhkkU51a0WbgiHOUiM dcD9PMnWxovhXBBgY8ZEke2+SI3Q3xyNl3rkNlbnNUtnMJPo+EuImr66KFQN3OPtZXqD V2CJreRcwcnu3izsrDVDwPTNnJ897FkbM0cWWaEGsrcuOQ6GWNoGsUduJzvy+PHqTv/X PlRZ4+H2GkVQaFOJyHKNbq58XFlhcGQb5uF3MV1Kd4wv+BnAD6sqd15hm44fVlfcdT3i wkJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ZWwTq3jHgl0vF+73+HcJrJHO5r6wPiuEt3hWYFmGy1s=; b=EO1gSOFV0qnYKLKLsHyou9WBPCa36Y3w/0dit4yDkChcYazd6Uhvx+VrDvKEgGFHCA GthO4BtI8NaMCYC1pZtNc8eNEf8swjxX6NDgy0eAa+gBK3If/4UDxVaihAA9S65nR0m3 vKh/FR5vbZ7qpSd2lVSZ4bUWSQUwEOa7/LL102GCHdY/cHkkAMEld4B7Z3TRBUSGiKFd a7VEWnL5TQi46jHbLjq0Y0tbW7J2A2UKVKDRcUeXFiY3TLqn1GgPH7Q2BKx+75a78NtQ yJlxPTBfBb5wo/by0CWPrG6YQV4UvoenWBXQ23U2i12R1J3O4joy8MRlKzn68bGAiaA4 UM3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MFDfKpxP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m18si568891eja.298.2020.05.08.01.14.01; Fri, 08 May 2020 01:14:24 -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; dkim=pass header.i=@linaro.org header.s=google header.b=MFDfKpxP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726873AbgEHIMj (ORCPT + 99 others); Fri, 8 May 2020 04:12:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbgEHIMi (ORCPT ); Fri, 8 May 2020 04:12:38 -0400 Received: from mail-ua1-x944.google.com (mail-ua1-x944.google.com [IPv6:2607:f8b0:4864:20::944]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62ABEC05BD0A for ; Fri, 8 May 2020 01:12:38 -0700 (PDT) Received: by mail-ua1-x944.google.com with SMTP id z16so342629uae.11 for ; Fri, 08 May 2020 01:12:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZWwTq3jHgl0vF+73+HcJrJHO5r6wPiuEt3hWYFmGy1s=; b=MFDfKpxPwGsj8xTnETNOiIP+xhjHs/bQFbn69qKF1+HzOOwBZFODhnJN2quiwfekXx Kys+dq0GQgoVpit/riusVb0+s/xZ85m5lorNpLqOTdA1PEm/OO0liOG2TUWKIvDWXTry V8jXdk7ZZYqJy9G6BaSzPi9rzCcnz2cxUoQDKwLTFL2iIhWIrM1cI3v0yUE5W6pGLwOW HZruxyg48j0ztKttfSHufyK/4KcfPsiRFNmOkYU7oK+ui/HkQKZkN0x/zTPQ6HDuFk7+ +WyMfSYgt4y85fBKqLJ35BFKrNbu3ho2tJcPyeXb/DD0G/Rb7DdG1b09SICIJ/rb13rB h7XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZWwTq3jHgl0vF+73+HcJrJHO5r6wPiuEt3hWYFmGy1s=; b=YJ/8Bh+GqL9WBqS+CKfOrJXczjv+fxdYb5V4y6OkC1gok1pBJSoZhkSgKrLT8c4kZL C7mthCHYu5JIlSt14ooRQXVccYYVRHCN46WvDqBYNSPROuAlxLc8XiHZpqrjJ9K4mCZe SVlQDaOX3pswamMw5Zk5ISF2i5qRnTkJpTrs1PxdSXW0SFH7YiqaA6QgPN7EJjdsqjxR 769hxEE3aDuSi4gxRep7xfAidpHvJJVT0ngtrr4HXWlSmJ3E+JNvP43G4IL88hWYsuBT ueRE6J2YiUFWd+pZz03WW3WsiLgN7KSP5c/BuPJvQXicBRrPCSc7eL10FywVfQlUkQIy B5Dw== X-Gm-Message-State: AGi0Pua8V3NiFHRahXReHIRHLNchAWCc3lIqTSojwJwWId4kTuZsvcjG qNJTz/u8t9h53TyDagjzxSEFAsfaCLh3ZLM/1sJ7YA== X-Received: by 2002:ab0:5ca:: with SMTP id e68mr886565uae.19.1588925557511; Fri, 08 May 2020 01:12:37 -0700 (PDT) MIME-Version: 1.0 References: <1588775643-18037-1-git-send-email-vbadigan@codeaurora.org> <1588775643-18037-2-git-send-email-vbadigan@codeaurora.org> In-Reply-To: <1588775643-18037-2-git-send-email-vbadigan@codeaurora.org> From: Ulf Hansson Date: Fri, 8 May 2020 10:12:01 +0200 Message-ID: Subject: Re: [PATCH V1 1/2] mmc: core: Check request type before completing the request To: Veerabhadrarao Badiganti Cc: Adrian Hunter , Sahitya Tummala , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , linux-arm-msm , "# 4.0+" , Baolin Wang , Avri Altman , Chaotian Jing , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 May 2020 at 16:34, Veerabhadrarao Badiganti wrote: > > In the request completion path with CQE, request type is being checked > after the request is getting completed. This is resulting in returning > the wrong request type and leading to the IO hang issue. > > ASYNC request type is getting returned for DCMD type requests. > Because of this mismatch, mq->cqe_busy flag is never getting cleared > and the driver is not invoking blk_mq_hw_run_queue. So requests are not > getting dispatched to the LLD from the block layer. > > All these eventually leading to IO hang issues. > So, get the request type before completing the request. > > Cc: # v4.19+ > Signed-off-by: Veerabhadrarao Badiganti Applied for fixes, and by updating the tags that were provided by Adrian, thanks! Kind regards Uffe > --- > drivers/mmc/core/block.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c > index 8499b56..c5367e2 100644 > --- a/drivers/mmc/core/block.c > +++ b/drivers/mmc/core/block.c > @@ -1370,6 +1370,7 @@ static void mmc_blk_cqe_complete_rq(struct mmc_queue *mq, struct request *req) > struct mmc_request *mrq = &mqrq->brq.mrq; > struct request_queue *q = req->q; > struct mmc_host *host = mq->card->host; > + enum mmc_issue_type issue_type = mmc_issue_type(mq, req); > unsigned long flags; > bool put_card; > int err; > @@ -1399,7 +1400,7 @@ static void mmc_blk_cqe_complete_rq(struct mmc_queue *mq, struct request *req) > > spin_lock_irqsave(&mq->lock, flags); > > - mq->in_flight[mmc_issue_type(mq, req)] -= 1; > + mq->in_flight[issue_type] -= 1; > > put_card = (mmc_tot_in_flight(mq) == 0); > > -- > Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project