Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp466713imn; Tue, 26 Jul 2022 00:00:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u5dESEiBn79C8r3OM4b8U1uzZY+2QDUNcJSsnvbuhYouaK5DbVKUvtEdpTGSjwO0+GDsNr X-Received: by 2002:a05:6402:2756:b0:43b:fda4:abc6 with SMTP id z22-20020a056402275600b0043bfda4abc6mr8699765edd.274.1658818828498; Tue, 26 Jul 2022 00:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658818828; cv=none; d=google.com; s=arc-20160816; b=sv7QiQSrr8YgYr3I5KtMgbnYvKWTj629QTkpy3OvesutWvBjWtSnxaJzh+lBsApctW PTx+/5smgx7Tzx61ubwJDVHWyIkEF+S9a/1E43LEYTlIlaQunUMYwl6ncn6hoOB16QxS ugn9ifD9o6WPmfEsJjL6pgk/35pWam1VYI6/z62R2wEG8bUW2oqjQ6WZ1pwQVXraT8PG mjXpkTs91Fsa7OCIihBIM8wSZf6OJDN0IAVEoGuT9j0a0i/KuNC/V3kTGqhC1DJwHn0l nKpdUT39NxSqKhSlyU/tFs4FqKoXI+KY/o9esgH5Zd3aoVxLxyIf1PlrymPamHhD/2Im cuMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Dzh+1CSSIH6C14edPRoY7J2NHub9uUBWlrGKu3JDw6E=; b=PpzfMfrZIhY9PX8kjBdVqZUxEX0v/N4RXDEk15eUhbvhzYtAlbYqvnCJFFxRi98qxC 4fqyX317QdB5YILHAP9BvxcG0/iVJneHPuGfvl/OILGxN56czmnWrltaKS8d8dIjI/JF 0j21B16kZKeyz22AS/Leq8lKaaCSQRyAfWCk+yLpmhPlG1mKSYGYh6eZmtIuiOgk9gHA lmbJMXFP6m305DUncEqQTUUP682N1DTHj0mqFp/Pa27Zf/GSyIVyBUorOk7prRW6EYRA 80oNHZr7/GCxLUm9Y5F/vUO0BSq0a+3owG6ude6sXCw9acjKBi190pW6/ZI/X0zLBtac QfEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=Rrr3mKjH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t13-20020a056402524d00b0043c233945f4si3488263edd.477.2022.07.26.00.00.01; Tue, 26 Jul 2022 00:00:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=Rrr3mKjH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238010AbiGZG0n (ORCPT + 99 others); Tue, 26 Jul 2022 02:26:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237998AbiGZG0Z (ORCPT ); Tue, 26 Jul 2022 02:26:25 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C15AA31358; Mon, 25 Jul 2022 23:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1658816532; x=1690352532; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Dzh+1CSSIH6C14edPRoY7J2NHub9uUBWlrGKu3JDw6E=; b=Rrr3mKjHZoInyfZ482hBlsNEH4K5YcLW5sQIiwSD4x1vCzdJdb9cHBWw 9E3CpTseh5fkcNcawMnNbeP91wAsdTvtwpitqBPy8ySIlJu87hwjXctdL 3ghpd+RZbxQz776Y3u0QUwbIadBoL9daG0EIcamivnz9P9ixR6BVnG9Jj c=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 25 Jul 2022 23:21:50 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2022 23:21:49 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 25 Jul 2022 23:21:49 -0700 Received: from [10.253.34.146] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 25 Jul 2022 23:21:45 -0700 Message-ID: Date: Tue, 26 Jul 2022 14:21:42 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 1/2] scsi: ufs: Add Multi-Circular Queue support Content-Language: en-US To: Avri Altman , "bvanassche@acm.org" , "stanley.chu@mediatek.com" , "adrian.hunter@intel.com" , "alim.akhtar@samsung.com" , "beanhuo@micron.com" , "quic_asutoshd@quicinc.com" , "quic_nguyenb@quicinc.com" , "quic_ziqichen@quicinc.com" , "linux-scsi@vger.kernel.org" , "kernel-team@android.com" CC: "James E.J. Bottomley" , "Martin K. Petersen" , Daejun Park , Jinyoung Choi , Kiwoong Kim , open list References: <1658214120-22772-1-git-send-email-quic_cang@quicinc.com> <1658214120-22772-2-git-send-email-quic_cang@quicinc.com> From: Can Guo In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Avri, On 7/24/2022 12:32 PM, Avri Altman wrote: >> + >> +/** >> + * @ucdl_base_addr: UFS Command Descriptor base address >> + * @sqe_base_addr: submission queue entry base address >> + * @sqe_shadow_addr: submission queue entry shadow address > When you are editing your commit log, could you please also say something about the shadow queues concept? Sure, we will add comments in next version. > And why it is a good idea to maintain 2 sets of addresses, which basically points to the same place? When block layer chooses one task tag for one command, that tag will be used to link these pre-allocated data structs - ucdl[tag]<->lrpb[tag]<->utrd[tag], and the tag chosen by block layer is random (it does not increase from 0 to n and goes back to 0 in a circular way). But, in MCQ mode, when we submit the command to UFSHCI, we need to make sure the SQTP get increased one slot by one slot (we cannot skip slots). Hence by keeping shadow utrds (or shadow SQEs), the data struct linkage ucdl[tag]<->lrpb[tag]<->shadow_sqe[tag] remains same, and we copy the shadow sqe to the sqe[sq_tp_slot] only when we finally decide the very sq_tp_slot used to submit this command in SQTP. The benefit is that we can 100% leverage the existing initialization logic of lrbp in ufshcd_queuecommand path without changing a line. Otherwise, considerable changes would be required to implement the idea of dynamical SQE assignment (to lrbp). Thanks, Can Guo. > > Thanks, > Avri