Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp183539ybg; Thu, 11 Jun 2020 21:30:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzEbrRv54nqOBObMM8N68LTIu/Kfk2I1zEx+t4lDr3Af2PYEUaLiEGLgBeGu3EKrsBN1A3 X-Received: by 2002:a17:906:f74a:: with SMTP id jp10mr11536337ejb.43.1591936248300; Thu, 11 Jun 2020 21:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591936248; cv=none; d=google.com; s=arc-20160816; b=nM7vhyUy9aGZUDwS1tiw+xSzTPtmAA8KlqYDVX0xIB0w1aT8bCiU/JLzp5GXpPD05O l/RBP1sJEH1udC8thcTz50+HGaYegJHC05Vw0WwYWDxnyTUKxtPzMGJ6Ibbcbas+8dsr d7Mlkp16/SOVPVD/zeIf3QRcDQLf/6osUSsrvCWNniemQJZ0H2mFHz0kqtzyaOPqz2hL +eS3m/5OgYiNkcXsEp49E5fZpqd/0mqNJO85+PpZ3u71lTS5i7F+2YnsyWMBqLcAaoCr cat/8QWYupMaIaPAa+3K6pPS8LHunaozPM9OMS9iAr/zMsdJKnWhb3LoVaTyta53Gcvi tO0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=7FHd7ZEofWmIKV3Vjvxv3qh2Z1UvkaKjplL+2txj47M=; b=MdUhPJmRRXohjEsH/Z0VInA80SWo4j8lGdVlrmHQ/83q42uGenulbzEKxhwR9khvPm 6ef6kYa4nZ32KX9OAK8NYv+MP9viU6IoTnvzqhoflVBufT5xPJcO76j91PTJgXshVw8+ FkpqnFDOOnw8Dt8qYRVvbSo2cxN9RAuANaGgaq/+ZOKsf+xe72wS4W85RCVNyHLsw5RW kO2WqvlGUwSyixZpRmN1AQCu58WXCyW+JuXWP7bw5UXwrWvILxxLGR5ZtrO1IoM+9QCI d9Ijhkx7SYZ4ItE19SMirFr64Hv48WW+Mm6G3KQeqCDtkO6IrfiT4LtPSgXvyK4mUGLw P2BA== 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 w18si3383698ejn.727.2020.06.11.21.30.24; Thu, 11 Jun 2020 21:30: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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726369AbgFLE2i (ORCPT + 99 others); Fri, 12 Jun 2020 00:28:38 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:40545 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725809AbgFLE2i (ORCPT ); Fri, 12 Jun 2020 00:28:38 -0400 Received: by mail-pf1-f195.google.com with SMTP id s23so3713707pfh.7; Thu, 11 Jun 2020 21:28:37 -0700 (PDT) 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:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=7FHd7ZEofWmIKV3Vjvxv3qh2Z1UvkaKjplL+2txj47M=; b=WkaYAghFoDyfthQ27QZVpctLKNZw6ENkEPdDNodUUx4ccvX4gBX1scuAn8rRClYcWb srNhjWzFhAAByFSnZm8o+LVX4npJ2iK0GPYl6ogVtHAlfgQCqBcCYjTZMpMADH/7bX+P 9c+JGeHAKFXWEwC5GUCPlKpnPAXGFP6/Hn20pAXnAcjjDNVIkIlf0YkcM/PDUVo1JIER KuwgFn9gtSfhmFzAnzPEcUT8s296THbZNXpxRJ4KX2aHBBF+mNZvWfx4Y9ZG85YqeTzj Gdan8Ej8mnj/TGF9DrStNZUa4cJadFiZKMAS/B2jzzOf4JJN9HoSZEECSyJ7FvP6ndf+ +7YA== X-Gm-Message-State: AOAM531oCD4KRGvA3TM2R3WF6L8CzIprmFA72TsV3rECZ5aHfk54JOxy Y3Hg7cNrYzycPW/R/F7eYXM2WCmc X-Received: by 2002:a62:3785:: with SMTP id e127mr10235922pfa.210.1591936117373; Thu, 11 Jun 2020 21:28:37 -0700 (PDT) Received: from [192.168.50.147] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id i5sm4549593pfd.5.2020.06.11.21.28.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Jun 2020 21:28:36 -0700 (PDT) Subject: Re: [RFC PATCH 2/5] scsi: ufs: Add UFS-feature layer To: daejun7.park@samsung.com, ALIM AKHTAR , "avri.altman@wdc.com" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "asutoshd@codeaurora.org" , "beanhuo@micron.com" , "stanley.chu@mediatek.com" , "cang@codeaurora.org" , "tomas.winkler@intel.com" Cc: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Sang-yoon Oh , Sung-Jun Park , yongmyung lee , Jinyoung CHOI , Adel Choi , BoRam Shin References: <1319810e-a323-c022-5e27-902f88cefe8f@acm.org> <963815509.21591320301642.JavaMail.epsvc@epcpadp1> <231786897.01591320001492.JavaMail.epsvc@epcpadp1> <336371513.41591320902369.JavaMail.epsvc@epcpadp1> <20200612022759epcms2p47929b76eb2e809240f415c19f9383f92@epcms2p4> From: Bart Van Assche Autocrypt: addr=bvanassche@acm.org; prefer-encrypt=mutual; keydata= mQENBFSOu4oBCADcRWxVU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PknS6d+BETMhTkbGzoyS+sywEsQAgA+BMCxBH4LvUmHYhpS+W6CiZ3ZMxjO8Hgc ++w1mLeRUvda3i4/U8wDT3SWuHcB3DWlcppECLkAEQEAAYkBHwQYAQIACQUCVI67igIbDAAK CRBxXD01xc4QCZ4dB/0QrnEasxjM0PGeXK5hcZMT9Eo998alUfn5XU0RQDYdwp6/kMEXMdmT oH0F0xB3SQ8WVSXA9rrc4EBvZruWQ+5/zjVrhhfUAx12CzL4oQ9Ro2k45daYaonKTANYG22y //x8dLe2Fv1By4SKGhmzwH87uXxbTJAUxiWIi1np0z3/RDnoVyfmfbbL1DY7zf2hYXLLzsJR mSsED/1nlJ9Oq5fALdNEPgDyPUerqHxcmIub+pF0AzJoYHK5punqpqfGmqPbjxrJLPJfHVKy goMj5DlBMoYqEgpbwdUYkH6QdizJJCur4icy8GUNbisFYABeoJ91pnD4IGei3MTdvINSZI5e Message-ID: Date: Thu, 11 Jun 2020 21:28:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200612022759epcms2p47929b76eb2e809240f415c19f9383f92@epcms2p4> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-06-11 19:27, Daejun Park wrote: >>> @@ -2525,6 +2525,8 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) >>> >>> ufshcd_comp_scsi_upiu(hba, lrbp); >>> >>> + ufsf_ops_prep_fn(hba, lrbp); >>> + >>> err = ufshcd_map_sg(hba, lrbp); >>> if (err) { >>> lrbp->cmd = NULL; > >> What happens if a SCSI command is retried and hence ufsf_ops_prep_fn() >> is called multiple times for the same SCSI command? > > Developers of UFS features should implement it so that prep_fn does not have > any problems even if it processes the same SCSI command multiple times. > In HPB feature, prep_fn modifies only upiu structure. So it is ok to call > it multiple times because the upiu is rebuilt from ufshcd_comp_scsi_upiu(). Please make sure that this expectation is documented somewhere. Thanks, Bart.