Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1802644pxa; Sun, 2 Aug 2020 22:14:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvXhV/mOUYOV+iIdylcGclIMassPe2sXOmPVs28qKBb6Gf1+SVofL105QDw/JOko9QRmMl X-Received: by 2002:a50:e719:: with SMTP id a25mr13481718edn.15.1596431698182; Sun, 02 Aug 2020 22:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596431698; cv=none; d=google.com; s=arc-20160816; b=hdLMVM7w4asDt0nApeDu/uxGiBWMQ132TLR0diRp+g399vxnN8R/jrjVr/4HjVQhk9 TcPCBXrIEeL1xQRb0ZlVRxyWvNvO3mLqLLICXOB5Q8ebmROpB2yOoLaa/QvVSLOlI2xB xcmjsHuuu2g9MRi23507B3HSqY4zsCexjlwMoi9pSLOpylMwpd1gfeKq7rLYWNXVj465 m895Y0IEkyp4GYV65PV2mgnlegsJ16G0Ur0FOChZ5tzOsOYxyB2zt0iUWtsSU3tXKxsZ zDqmNyC9zl9p3nknKkWTTCYChYogleVuHb7gatcFqD+YuWOBkHyglOsFzmp1zLR5PWVX V8vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=xH2GNNEeKA5M2HSxLn3DvMsbHNeHZZGIVLaa9prWnN0=; b=aYMZpCTtDLBfiO8fEw2fVVLFlZcBCqtclT7iwfLT5l02IiDF6Jcf+Gye7upfm+J2mc 4NIeCO7IDMVQN2OzS2v5dD5BT/TuYJ4HmkLnf5j+Q7UZnqk13psHT6r6kTys+cbV+i7f 4OwnjS3kK3BK0YaMiD3NYtf7qLzEGBRrQ7az1l5ms/fzAFm8dx2qUn6F5ibY1MNhR8HI gI2nT33VBR8tc/VDQGYzz7pbT9vy2bcoOAH7K4gRsKArOVq/TBATzdlUEs48st3pzfd1 /Th1Mvq2kYiSqjw86C0ZdGIlJyqlz4wb/e0VSYMU9ZQnaEsag7+sr4IVuVC460xTO58g 0ayw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=lwzvhZsO; 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 a5si9056740ejb.582.2020.08.02.22.14.35; Sun, 02 Aug 2020 22:14:58 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=lwzvhZsO; 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 S1727062AbgHCFKU (ORCPT + 99 others); Mon, 3 Aug 2020 01:10:20 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:44606 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726799AbgHCFKU (ORCPT ); Mon, 3 Aug 2020 01:10:20 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1596431419; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=xH2GNNEeKA5M2HSxLn3DvMsbHNeHZZGIVLaa9prWnN0=; b=lwzvhZsOB/tv+pnlpPaZt7PR3bQTpKQyQ6nYf3IF3quDAh5XsnEkaFI11PqxIe4UJ3aGAlw+ E6gGgCCqZFcCpP635YBhE/FfpqJ4XyMXwcMf/5Y8ejtl1QP7IsxHAZXtwpo90r7pbe2h6ecY gTvs+AFiCzN0q/FfYA2kWoopFF8= X-Mailgun-Sending-Ip: 104.130.122.29 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-n16.prod.us-west-2.postgun.com with SMTP id 5f279b9c2dfc1b5cc2467d2e (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 03 Aug 2020 05:07:40 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 25F26C4339C; Mon, 3 Aug 2020 05:07: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=-1.0 required=2.0 tests=ALL_TRUSTED 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 77B7BC433C6; Mon, 3 Aug 2020 05:07:39 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 03 Aug 2020 13:07:39 +0800 From: Can Guo To: Bart Van Assche Cc: Stanley Chu , Avri Altman , linux-scsi@vger.kernel.org, martin.petersen@oracle.com, alim.akhtar@samsung.com, jejb@linux.ibm.com, beanhuo@micron.com, asutoshd@codeaurora.org, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kuohong.wang@mediatek.com, peter.wang@mediatek.com, chun-hung.wu@mediatek.com, andy.teng@mediatek.com, chaotian.jing@mediatek.com, cc.chou@mediatek.com Subject: Re: [PATCH v4] scsi: ufs: Cleanup completed request without interrupt notification In-Reply-To: <80f5e213-502b-3532-e782-6f26a778274e@acm.org> References: <20200724140246.19434-1-stanley.chu@mediatek.com> <1596159018.17247.53.camel@mtkswgap22> <97f1dfb0-41b6-0249-3e82-cae480b0efb6@acm.org> <8b0a158a7c3ee2165e09290996521ffc@codeaurora.org> <548b602daa1e15415625cb8d1f81a208@codeaurora.org> <80f5e213-502b-3532-e782-6f26a778274e@acm.org> Message-ID: <7002ce0c5c84409cae6910675f7fe4c0@codeaurora.org> X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bart, On 2020-08-03 11:12, Bart Van Assche wrote: > On 2020-07-31 16:17, Can Guo wrote: >> For scsi_dma_unmap() part, that is true - we should make it serialized >> with >> any other completion paths. I've found it during my fault injection >> test, so >> I've made a patch to fix it, but it only comes in my next error >> recovery >> enhancement patch series. Please check the attachment. > > Hi Can, > > It is not clear to me how that patch serializes scsi_dma_unmap() > against > other completion paths? Doesn't the regular completion path call > __ufshcd_transfer_req_compl() without holding the host lock? > > Thanks, > > Bart. FYI, ufshcd_intr() holds the host spin lock the whole time. So, to your question, the regular completion path from IRQ handler has the host lock held. Thanks, Can Guo.