Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2302139pxk; Mon, 14 Sep 2020 09:38:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVBImk3JN/2W4R6V5crCJ0NPH0KhEA25oxrsNxk9yiC8BhrC3TqBisaIeh5y8WVwGX4PVz X-Received: by 2002:aa7:ce19:: with SMTP id d25mr18223579edv.189.1600101529898; Mon, 14 Sep 2020 09:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600101529; cv=none; d=google.com; s=arc-20160816; b=XnjOi58TtaRv2S0tn4RK/kcKa6LObWp1vX0JEao+/mqjRhsOF+2rWq5rzsXEPzlQ2e NCB9PM91HvXOIN6NUFy3dj4eUyTLgEuL/FCyPWNPyQcP83iN1e/+UZHnPH++7BTG8pCL GhnhflGVPFKxQo7pMUb2L3TGpyLRKFpCiNV/nieEs4cUlL6GNm5UEa7sWIYe3edY4KO7 8caZSfZtWNER8qfpS9VZ8cAtwzdE0ALq9gy1S66ZQF1PZFKkTvw7rj74nNiOF7I4/t1l +13aHqhqpHay5PfneU8Odih5DVmyqeT2/VO0NFKYqhV0hkXO7uhWF5fXr5/oQoNufJnx VP2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=ObHJxhWnQ6Id1CMXMXxijV0dvfRIEHq6RwO9EgQfuVY=; b=JjnVFWQ9OAI1yMjqxfGiws95Bf3QaGA/GTUDn5kMOfVpNQD9Z+mbmc/WWGlcV3yelR gYFs10pJLs+uo/XN1SpD7GJh5W+wSUg9wh1qMhkILYDvVJFwaz8QI+oyPgPM7usZWjAP 7sUOoRrQBVQwyawqjkIHZ87UPNKPKrc7Z7Pu9ZIeFXQZBCC+HJnhX/iKdZDSbJDeZBjn 5+52vQu0TC2K7JKDDHGnht+OY1OXtk/mI4yer11TEW/fXRvQ7opMLB4u2VZhdd4pDa0Q fUhcyR+1Uz8ZqpR5errFrDnZTxWmD9YxNB9wJsqb/a0KJNW81UWH05SSMQdodD2C3139 T/0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=oKIphcYV; 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 q17si7850691ejn.24.2020.09.14.09.38.26; Mon, 14 Sep 2020 09:38:49 -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; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=oKIphcYV; 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 S1725957AbgINQfk (ORCPT + 99 others); Mon, 14 Sep 2020 12:35:40 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:36196 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbgINQez (ORCPT ); Mon, 14 Sep 2020 12:34:55 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1600101294; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=ObHJxhWnQ6Id1CMXMXxijV0dvfRIEHq6RwO9EgQfuVY=; b=oKIphcYV0NliUt8T6UoTTw0fXbfmUGsLuARMeLY9LJnbmbr8hmVdL5f5AJ/ETIW1Udmgqv0J lTaanG5r+mf2nC2RbmjLyE9wjSzi+zrHuivrAwuSOb4G8MyaMaJacgRrYb4ZbYltKCgkR2a8 di03CQKfT/M18ivZuV7HAICgQFE= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-west-2.postgun.com with SMTP id 5f5f9ba44ba82a82fdbafb38 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 14 Sep 2020 16:34:44 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 2DA8DC43382; Mon, 14 Sep 2020 16:34:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: nguyenb) by smtp.codeaurora.org (Postfix) with ESMTPSA id 613BAC433C8; Mon, 14 Sep 2020 16:34:43 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 14 Sep 2020 09:34:43 -0700 From: nguyenb@codeaurora.org To: Avri Altman Cc: cang@codeaurora.org, asutoshd@codeaurora.org, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org, Alim Akhtar , "James E.J. Bottomley" , Stanley Chu , Bean Huo , Bart Van Assche , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/1] scsi: ufshcd: Properly set the device Icc Level In-Reply-To: References: <5c9d6f76303bbe5188bf839b2ea5e5bf530e7281.1598923023.git.nguyenb@codeaurora.org> <0101017475a11d00-6def34a7-db5d-472c-9dcc-215a80510402-000000@us-west-2.amazonses.com> Message-ID: X-Sender: nguyenb@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-09-10 03:02, Avri Altman wrote: >> >> On 2020-08-31 18:19, Bao D. Nguyen wrote: >> > UFS version 3.0 and later devices require Vcc and Vccq power supplies >> > with Vccq2 being optional. While earlier UFS version 2.0 and 2.1 >> > devices, the Vcc and Vccq2 are required with Vccq being optional. >> > Check the required power supplies used by the device >> > and set the device's supported Icc level properly. > Practically you are correct - most flash vendors moved in UFS3.1 to > 1.2 supply instead of 1.8. > However, the host should provide all 3 supplies to the device because - > a) A flash vendor might want to still use 1.8 in its UFS3.1 device, and > b) We should allow a degenerated configurations, e.g. 3.1 devices, > that are degenerated to 2.1 or 2.2 Thank you for your comment. The host can provide all 3 power supplies. However, the change is to ensure we do not exit early and fail to properly set the Icc level because the optional power supply is not provided. > > That said, I think we can entirely remove the check in the beginning > of the function, > But not because the spec allows it, but because each supply is > explicitly checked later on, > before reading its applicable max current entry in the power > descriptor. We need these checks to prevent NULL pointer access subsequently in this function. > Thanks, > Avri