Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp765411qtx; Mon, 31 Oct 2022 13:21:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6OCu2A5PSaY3kTe5noZAJX20GCd8MH+CpJso6w3zIFxm4zIGMunhOum33JVQ0ugsbVg62q X-Received: by 2002:a17:902:e88e:b0:187:27a7:c8a9 with SMTP id w14-20020a170902e88e00b0018727a7c8a9mr4889642plg.169.1667247669886; Mon, 31 Oct 2022 13:21:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667247669; cv=none; d=google.com; s=arc-20160816; b=FFUXNlTu8x2/hB69o5f2LvJaJV6v3LZuZ1dTl8d7brN+ANWSm8pPkG1bhOjeVqJOsU 0saoRSpQISpBMJuT+qb5s1IEJUhQROKzNhorCL/BDfItQCKTcexUO3dQEZ3MOdF7WWJh pdDtE8N38XQ7JUIFaX6xZuiO8VrxMKS/F+ftIP5GbPuWdVZYmYadMG42tut+AC9mPDgB vUbOSj+ooiTLiaRguwDleGd6JVLOuWyLp+hAuTV+vNxRoCEZh0KNxGgtUaCAU9XyKvHZ BLWRsgLkVm/bj1AWki0jWMuUmZ5546V/sXqiAG1fy1J042vvYhG2cQ+ZuGvQmwt0apC8 t3Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Pc5EVDHtm6VBnIfyigRm+fWGfdtfPod7VeY/RMb84xE=; b=XyJ8qQygiobuZwMt5ZQRHBx6ySfXGjp7SjJNTrlvTuta3Bb7pfiTKY13o2BYkyydNf OUnDAmaJA6wmpFxQRU6aQ6NvrMFPcPMCdJiYa9JcmJDtB0plAs8HKUa7+EHqcU7hx6E7 sgpp6OGHa2gKg9zhPMkyfB012pBsfdVTQNomdlvLu6ucAt5T9+k4d35IJMJRdgGv+RMY o5vcKZr4e1qiD7S3SijQ+79Yina3KNk0czBsdvaKFpuRoBQbnTxHggu8mPF+l395l4tj HJFuL0qIsk9uDmn1P7LOTyBICT0w3eAoAViSL8MP3pAl9poBTEBaAOcJqXoloITIW73L ZU0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=F0t1bGMh; 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 k6-20020a17090a39c600b0021305bbcb6bsi8724742pjf.90.2022.10.31.13.20.56; Mon, 31 Oct 2022 13:21:09 -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=qcppdkim1 header.b=F0t1bGMh; 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 S230047AbiJaTZH (ORCPT + 98 others); Mon, 31 Oct 2022 15:25:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbiJaTZF (ORCPT ); Mon, 31 Oct 2022 15:25:05 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6578D13DF1; Mon, 31 Oct 2022 12:25:04 -0700 (PDT) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 29VIsrZV003836; Mon, 31 Oct 2022 19:24:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=Pc5EVDHtm6VBnIfyigRm+fWGfdtfPod7VeY/RMb84xE=; b=F0t1bGMh6JtUc3m13A5ca3En/svens7pzbZFwWpUCIGDUiOxTs+Oo4ZW4qDu0lqmHbFg PRft0fto0ZI1KJVxEG8Q3oR/2eIlnyraKC5u+P7qVn7UJP6V02vF4plkxllhCLf5wNeh ifQVOjQhUDIy9kZZLu+MZjYXGF9x5PzE9ZPCSwTymWFy8UFzCuq6DlEPq+8DNQVTMdMQ 7aCNJmQBLFUBip5iWKBfjbnXqWcLdaWX9Dt/m+2EYChcPvu/B5lnPahQd5UkTPKTJz6+ 9ZnsMiibpD7pUtAr5hjDouXQvN7d3pwNCDIKnkCnS4n5lo8OvL8/FGNYPfrY1sTr6UJb RA== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3kj7tx2k17-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Oct 2022 19:24:37 +0000 Received: from nasanex01a.na.qualcomm.com ([10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 29VJOaZD015939 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Oct 2022 19:24:36 GMT Received: from asutoshd-linux1.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 31 Oct 2022 12:24:35 -0700 Date: Mon, 31 Oct 2022 12:24:35 -0700 From: Asutosh Das To: Bart Van Assche CC: , , , , , , , , , , , , , Alim Akhtar , "James E.J. Bottomley" , "Andy Gross" , Bjorn Andersson , Krzysztof Kozlowski , Jinyoung Choi , Kiwoong Kim , open list Subject: Re: [PATCH v3 07/17] ufs: core: mcq: Calculate queue depth Message-ID: <20221031192435.GD9077@asutoshd-linux1.qualcomm.com> References: <1987fbada1d33c04c9598614ef712e0a48fe065e.1666288432.git.quic_asutoshd@quicinc.com> <0fb3f8ae-5ed7-9057-0d2b-8866f36c2441@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Content-Disposition: inline In-Reply-To: <0fb3f8ae-5ed7-9057-0d2b-8866f36c2441@acm.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: eoCIszkxZxLc1tUxvwMHzAOSyAR5E8eE X-Proofpoint-GUID: eoCIszkxZxLc1tUxvwMHzAOSyAR5E8eE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-31_20,2022-10-31_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 malwarescore=0 mlxlogscore=999 impostorscore=0 suspectscore=0 mlxscore=0 spamscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2210310120 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 On Thu, Oct 27 2022 at 14:52 -0700, Bart Van Assche wrote: >On 10/20/22 11:03, Asutosh Das wrote: >>+u32 ufshcd_mcq_decide_queue_depth(struct ufs_hba *hba) >>+{ >>+ u32 qd, val; >>+ int mac; >>+ >>+ mac = ufshcd_mcq_vops_get_hba_mac(hba); >>+ if (mac < 0) { >>+ val = ufshcd_readl(hba, REG_UFS_MCQ_CFG); >>+ mac = FIELD_GET(MCQ_CFG_MAC_MASK, val); >>+ } > >According to the UFSHCI 4.0 specification the MAC value is set by the >host. Can the above code read the MAC value from the host controller >before it has been set by the host? If so, how about leaving out the >code that reads the MAC value from the controller and making it >mandatory to implement the new get_hba_mac vop? > The reason it is not mandatory to define get_hba_mac vop is UFSHCI 4.0 specification mentions that the default value of MAC is 32. So even if a vendor HC doesn't override the MAC, it'd be 32. Hence, the current code first checks for an override, and if there's none uses the default value defined in the HC. -asd