Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp874506lqb; Wed, 29 May 2024 13:14:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVTG93LmrOq8uAzowk1n+5/StOtX1PRavpffZCUFVJqvhfpXY3rLXAGJd19jCwiePmtiaCbEJiP9Rx3U6YAr4aVZ4iZLPAV5l6FTfWc0A== X-Google-Smtp-Source: AGHT+IHN/0idnB1DgeWrI1bg3+GHua8kOPnOE1a+wd78fUmEL8fr/Td+5O5Rxcgud35SaU2QXa23 X-Received: by 2002:a50:8e58:0:b0:578:5cf2:93eb with SMTP id 4fb4d7f45d1cf-57a177ab3cbmr96945a12.16.1717013645439; Wed, 29 May 2024 13:14:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717013645; cv=pass; d=google.com; s=arc-20160816; b=Zn1AMUkIAnx4/7KiSokaTnc1/PYGipzQYLgLtSGMph92o38k2aMIc2k0a3uro4vyGu XqJ8YQ24TKCaRfgK/aEg/P5qClnPvSk0tzSN7TpdSVHoeQHRg6nTyHoveEt5ZM9f2Bt4 pC9YKy66TCVisbYJnCZuMPva9WkCKgex3fKdewK/MUqli7I3om7h2fpJ1U1T86JclYoa JkYWAwPC84UFn5uUD3DAb50GUZYjiE1Dsv0/MYdt9YZudenmJMGg2pIvAa3NBqhQQ5kQ NmsuowJs+jo53ABLteWXZgv2nKlYMG+sTqltBRjiktAQLC39cZ/hWRMwv9Jh84eTjNzQ b6dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=sYFO1Oabf5gp0E80FPASdVqPHBMAvbLEasvnOxSrWEA=; fh=K+Tg+GhtIqZfvlhfGR7M/+sET2hfDDyZF+hArCUWMWo=; b=oyrvvDdqGdLt+3qaAb9mbQjor9RgyPxXS84vQct39uWEav+BmKbx8xAwg6j+1oVsJC Ckqlsnq/amDgKhWm274Kc+h1kpwqYUFFcCMwjNrQ5a1WpV/C0r15twnYyjC/wdwrjOQI WFiSeHSVHPL+C+eAvTgmWaI0HomCuWZX2IikZ49MQTs6tuFK35r8ninyNfYvkMlEV7+7 YrwNtyBDQgAFbx4A8o8hhE50Aaj4StrW2NG8OPXfE2T1Uhz7dPcpyq82HGYZFMmo+RYb 2MKtQSTvRK0wTglLI8/MUOACovTMsxJS4EwWBw5OI4V2j2yuhLhv/D52JxI1rMLbqYK1 l4ww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b=wpN4y1a9; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-194645-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194645-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=acm.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5785245fc84si6485225a12.208.2024.05.29.13.14.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 13:14:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194645-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@acm.org header.s=mr01 header.b=wpN4y1a9; arc=pass (i=1 spf=pass spfdomain=acm.org dkim=pass dkdomain=acm.org dmarc=pass fromdomain=acm.org); spf=pass (google.com: domain of linux-kernel+bounces-194645-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194645-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=acm.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 308311F2562C for ; Wed, 29 May 2024 20:13:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 384611C8FA5; Wed, 29 May 2024 20:12:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b="wpN4y1a9" Received: from 008.lax.mailroute.net (008.lax.mailroute.net [199.89.1.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBE7126AD3; Wed, 29 May 2024 20:12:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=199.89.1.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717013566; cv=none; b=b8CSKJ6u0oDNp9G+pUtmuGZbVTe2Dk/W4tybCI4H2MjaPJSJ4yNkfaPr5a1bZyW3w8MtiAWe0gABrgI+upYeUlR1OjSFvPnS38iZxCyunI2VDGY1grmLAssYLstcet0P+UkhAnsPV0c/dRjM9nRVmneR7ObjrLIt55Bx2P6PFkY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717013566; c=relaxed/simple; bh=1bhLZpjpBAAkJRT8AqeZYTCxTGjw//XFZbioD/g1dEA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oiNh0ehgusKgysMdMKadPLj4+jlxfUTaCERY5J9s6DT7V+rH4+QOhzQW5Qt3D+6RMjhx+EJQ1D/k+HnBpWWbiKd3z0N809OXupt7/uU6/OC9bqGV56rSQ8UUFOEb1+X8U7iHAc0+GburpNY41UijajQkB9LP6ibYkf4j4ti6e6M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass (2048-bit key) header.d=acm.org header.i=@acm.org header.b=wpN4y1a9; arc=none smtp.client-ip=199.89.1.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Received: from localhost (localhost [127.0.0.1]) by 008.lax.mailroute.net (Postfix) with ESMTP id 4VqLCc2DZvz6Cnk98; Wed, 29 May 2024 20:12:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :user-agent:mime-version:date:date:message-id:received:received; s=mr01; t=1717013562; x=1719605563; bh=sYFO1Oabf5gp0E80FPASdVqP HBMAvbLEasvnOxSrWEA=; b=wpN4y1a9SYlb8ekZfZy9MDBShPQRKTgmXkXP1Yyk SNLcg8KCd9ZHOyxvSEylU9UDX9E0l361iFZtdv2xbtsnaFzNUaiMCvZPr4VFseGg WtAMo01W8TW0h4uZnI2Ck3jnePIOlNq8WKi57YMl905CDoEO1WiyJdmJbMizI1Ph ESYNdEEwRaumSSeK5r9XsPSIiGDxQ/46stnrUhr38jzJPLRwRJW1JZHdgQRs2+Qy pGSm6bQe3I932PYbshEG6MW4/UPtT3Y/DqZryigKjvhfLk62pwG9ZI89d46hVJpP bMLc8Wcl/QgzI8ioWuJMllrYiBLLJHR6vT8sWMU+hCslUg== X-Virus-Scanned: by MailRoute Received: from 008.lax.mailroute.net ([127.0.0.1]) by localhost (008.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id yqIE7em82E3h; Wed, 29 May 2024 20:12:42 +0000 (UTC) Received: from [100.96.154.26] (unknown [104.132.0.90]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 008.lax.mailroute.net (Postfix) with ESMTPSA id 4VqLCX5zTyz6Cnk97; Wed, 29 May 2024 20:12:40 +0000 (UTC) Message-ID: <0555169e-2552-41d8-a515-8c394118cec7@acm.org> Date: Wed, 29 May 2024 13:12:39 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 2/3] scsi: ufs: Maximum RTT supported by the host driver To: Avri Altman , "Martin K . Petersen" Cc: Bean Huo , Peter Wang , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240526081636.2064-1-avri.altman@wdc.com> <20240526081636.2064-3-avri.altman@wdc.com> Content-Language: en-US From: Bart Van Assche In-Reply-To: <20240526081636.2064-3-avri.altman@wdc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/26/24 01:16, Avri Altman wrote: > - rtt = min_t(int, dev_info->rtt_cap, hba->nortt); > + if (hba->vops && hba->vops->max_num_rtt) > + rtt = hba->vops->max_num_rtt; > + else > + rtt = min_t(int, dev_info->rtt_cap, hba->nortt); > + Shouldn't what the controller supports be compared with what the device supports, e.g. as follows? min_t(int, dev_info->rtt_cap, hba->vops->max_num_rtt ? : hba->nortt); > struct ufs_hba_variant_ops { > const char *name; > + int max_num_rtt; Hmm ... why 'int' instead of an unsigned type? If the type would be changed into 'u8' (the type of rtt_cap) then the above min_t() can be changed into min(). Thanks, Bart.