Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp121494ybh; Tue, 10 Mar 2020 20:53:17 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtgBN1F55Je5yuDqQbCZKAtyV+cU2SIHhHQJvS24fkbSDvDnKzo9oNVMvUxaF2LK4Z4yOEh X-Received: by 2002:aca:bac1:: with SMTP id k184mr581734oif.157.1583898797596; Tue, 10 Mar 2020 20:53:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583898797; cv=none; d=google.com; s=arc-20160816; b=ScRLhAdZPmfrDPMvtMpyO+rhNmgDvTC3cW31WUYVLspo+LCp4thfBWMSWWLQp7AU+y osv9SYJWLu8xrjtmi8uKSSCiQwn4TyHfhBvkjp64MW0OGVVwS0FlMjn7JYRuMock9BnI W52UxIqciEsgdlXyf9RCGedvvxW4FAKgRkzDZVG5EdzUtJG9GhRSPXseiAzWbfYsIT/s MLxkMbdk7ErASUXVRBJUSLYNSWJgPjVzoQF4IbGrfHRN+qqtAMhN6vY+yGbkZQJyVqxb OpeyZm6iWZ2Ro7jGpIZHWFh2IQ49nwUf67S7JRjZhlDnSFhKzKGIKRA0dL7a73LC5hhn XcCw== 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=4jWgXx47//lwhsK545GCcf8+J7kzYJPs216sdqcaw9s=; b=OFL+i8xbPbndPaCtJg44NnfKl7L8GMg0JMULQc1m02BfkWZ4IimS1OwEs+7aySfvYD 5gSd46csG80VkdIYBzGEn7bTonzOsGAaTjBk9yCz2hQXKTMnisjY2IZHz2lH8M7Wwtlg IBJ0ExDPZwUAK4Jq/jyRM7tsXl9eQDEN9XW8c8cyfBw26xIBQ2lxskk7/JjvZ3C/G95E hld+I4CaZ1ltRAvJtOfvvQhwxygnuUDa8GYdfHu9JsS7lrQjsWiSCS7RdEn4kOZU2KvA 4XrgUvZ2XHebuSnGKHcqrlSEdovF+rR+zBa/wyhEsCeYdQ5BLFNUsYWm/G+79VTtdc7L Nmqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t144si451060oie.129.2020.03.10.20.53.04; Tue, 10 Mar 2020 20:53:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727986AbgCKDwE (ORCPT + 99 others); Tue, 10 Mar 2020 23:52:04 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:32883 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727685AbgCKDwE (ORCPT ); Tue, 10 Mar 2020 23:52:04 -0400 Received: by mail-pf1-f194.google.com with SMTP id n7so519856pfn.0; Tue, 10 Mar 2020 20:52:03 -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=4jWgXx47//lwhsK545GCcf8+J7kzYJPs216sdqcaw9s=; b=TW+0cTiFtTEVo4Tv7RTH10WLCdTdyFE/bpVL1Od7GanN4NbkkSEOqbyWJHiwiXRZFc /yinK0PrikS3BmS1SAS2s5ZX8meLUAWOIrWsjtF07x10DUpxl3FlnS5hUX/lh5Ryw+sn DzszxHO2r4V7S3AbJxwcmj9X/cCbge9CMqhSDr7tI6YnsozpGrgmNqlN2hJm7KxlP6/W o0WJXH/GaY7plIOF0BrBZLxZWUNcFBLt1CIWEZvfLdnJyC8uVGuSDWHlJDqMh8pOK/ir /Km30cAIUDlB3Qv9ksGj2Pux+/D3ufO2673rACqDi+34cwDKyor7shLwFwz91k/oflhJ imew== X-Gm-Message-State: ANhLgQ2+F/lkgZlQTRX3m0ksRsgHIScmA6YoX4S9iFAJRbiDotZoycel vB0OIpPDB+5fcyqwCYfhBnyWDvmk X-Received: by 2002:a65:5688:: with SMTP id v8mr850865pgs.403.1583898722629; Tue, 10 Mar 2020 20:52:02 -0700 (PDT) Received: from [192.168.3.217] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id g11sm20680768pfo.184.2020.03.10.20.52.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Mar 2020 20:52:01 -0700 (PDT) Subject: Re: [EXT] Re: [PATCH v3 1/1] scsi: ufs: fix LRB pointer incorrect initialization issue To: "Bean Huo (beanhuo)" , "huobean@gmail.com" , "alim.akhtar@samsung.com" , "avri.altman@wdc.com" , "asutoshd@codeaurora.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "stanley.chu@mediatek.com" , "tomas.winkler@intel.com" , "cang@codeaurora.org" Cc: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20200309161057.9897-1-beanhuo@micron.com> <20200309161057.9897-2-beanhuo@micron.com> From: Bart Van Assche Autocrypt: addr=bvanassche@acm.org; prefer-encrypt=mutual; keydata= mQENBFSOu4oBCADcRWxVUvkkvRmmwTwIjIJvZOu6wNm+dz5AF4z0FHW2KNZL3oheO3P8UZWr LQOrCfRcK8e/sIs2Y2D3Lg/SL7qqbMehGEYcJptu6mKkywBfoYbtBkVoJ/jQsi2H0vBiiCOy fmxMHIPcYxaJdXxrOG2UO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4dB/0QrnEasxjM0PGeXK5hcZMT9Eo998alUfn5XU0RQDYdwp6/kMEXMdmT oH0F0xB3SQ8WVSXA9rrc4EBvZruWQ+5/zjVrhhfUAx12CzL4oQ9Ro2k45daYaonKTANYG22y //x8dLe2Fv1By4SKGhmzwH87uXxbTJAUxiWIi1np0z3/RDnoVyfmfbbL1DY7zf2hYXLLzsJR mSsED/1nlJ9Oq5fALdNEPgDyPUerqHxcmIub+pF0AzJoYHK5punqpqfGmqPbjxrJLPJfHVKy goMj5DlBMoYqEgpbwdUYkH6QdizJJCur4icy8GUNbisFYABeoJ91pnD4IGei3MTdvINSZI5e Message-ID: <00b4f8d0-32d3-58c7-6361-6177ed8aaaed@acm.org> Date: Tue, 10 Mar 2020 20:49:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: 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-03-10 00:53, Bean Huo (beanhuo) wrote: > Hi, Bart > >> Subject: [EXT] Re: [PATCH v3 1/1] scsi: ufs: fix LRB pointer incorrect initialization >> issue >> >> On 2020-03-09 09:10, huobean@gmail.com wrote: >>> @@ -4834,6 +4829,7 @@ static void __ufshcd_transfer_req_compl(struct >> ufs_hba *hba, >>> continue; >>> cmd = blk_mq_rq_to_pdu(req); >>> lrbp = scsi_cmd_priv(cmd); >>> + ufshcd_init_lrb(hba, lrbp, index); >>> if (ufshcd_is_scsi(req)) { >>> ufshcd_add_command_trace(hba, req, "complete"); >>> result = ufshcd_transfer_rsp_status(hba, lrbp); >> >> This ufshcd_init_lrb() call looks incorrect to me. I think that >> ufshcd_init_lrb() should only be called before a request is submitted to the UFS >> controller and also that ufshcd_init_lrb() should not be called from the >> completion path. > > __ufshcd_transfer_req_compl() > ufshcd_transfer_rsp_status() will access lrbp->ucd_rsp_ptr. > Without calling ufshcd_init_lrb() here, there will be an error. Hi Bean, I think that ufshcd_init_lrb() should only be called from the code that prepares a command before it is submitted and not from the command completion path. Because v5.6-rc5 has already been released, there is not that much time left until the merge window opens. I think it is less risky to revert commit 34656dda81ac ("scsi: ufs: Let the SCSI core allocate per-command UFS data") than to proceed with the above patch. Do you want to submit a revert or do you perhaps want me to do that? Thanks, Bart.