Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14031314pxu; Mon, 4 Jan 2021 10:57:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBKtrI1SZZgEN3DOVjOQQKgMyZLtyfSfzXN1kTFmOic/wZvOCqPsGQu5751Iu0hsI57kCJ X-Received: by 2002:a17:906:1916:: with SMTP id a22mr67502324eje.536.1609786678073; Mon, 04 Jan 2021 10:57:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609786678; cv=none; d=google.com; s=arc-20160816; b=PR+h29FESIf0MaR4tvUFtMidoRlmHHC3OmKJQb4iHvYP854OXQwmk7RTmKHVJgXfuj zVVlYixUye8jeENqTOSjXa/cii+QHTE3S7b5k8KYiEe2qrsuenuIVpDPDmODPhvsrttt pKpH6WJTqeU9IBnqsHikdzlaXG2wY0a7BWLk6QsUtV4iJ6S3t97Z5Ra9EjSqb+1EDPyy RuuWgu0NBjrNKkg2x0K0n8JVH82f8rM0Oba7tavVg9hTcD1Us8pSW+fm3WFSClzncUYG ayHVTQxm2W1BajnaaWZZrjpLGyxGXGw0ojakKmSE4Ob+FNXa+sqqz1ueIGLpXUlL9Hn3 CK0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HCHUr50eCN2Mq1BFEjsYp3XRTEkB08z4GhkrFu84N5o=; b=StF1RCXLWSEJhax6WfqgkdI+d0fYroMH/KwCn3rBsMOJXLwc2IyoAZaXxa1m/dzljJ /DDvDYZNrGXXTFEYxO4QKtJZKL9k5xIc5oJL7TM7WgKWVjT5WytKARTEHInA/Q0tyMos Cpt/G9JkIc3GAuA5H6pRJnOt7K/uCWWX8ZE+Y/ITTEtuvYPurx2RO6sY4kelzS6UfXOO OoexopJqmP25mNliaKdHWYIpX6rCRKtIobezTF0w9tybLRWe5NFbo/nyJs5uLfoMwLpA UNoqE0RrzsPpqb1uw8Xwm5qN+rQVj4xsIL1q+IAWlI72NOOxrkDeU7RQgeLB5p3neADI e3pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MjK0591S; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f24si31160944edq.247.2021.01.04.10.57.35; Mon, 04 Jan 2021 10:57:58 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=MjK0591S; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727785AbhADS4B (ORCPT + 99 others); Mon, 4 Jan 2021 13:56:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727434AbhADSz6 (ORCPT ); Mon, 4 Jan 2021 13:55:58 -0500 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A172C061793 for ; Mon, 4 Jan 2021 10:55:18 -0800 (PST) Received: by mail-ot1-x32a.google.com with SMTP id b24so27032322otj.0 for ; Mon, 04 Jan 2021 10:55:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=HCHUr50eCN2Mq1BFEjsYp3XRTEkB08z4GhkrFu84N5o=; b=MjK0591SdWSZ9DLSVpf0BxQENcnVdirWQsQ7aDl6SyoT5QHmyA95wA785FtmQXb4eS kalXUkp+oEIy1oKVvEwQb747gpJ/vNJAP/sksy9Q7KnNyGNmzOlvCGW5cXwd4sbfJ8U5 N+0Nc5AFrEkuxtm0bCRm3uB1KbagVWrJ1d+uH4o95u0HT3CAa7V0Tbapga2pBgY1KNNn PGnZiHKUt+CiQUzoZugw3/kBILSrkuo3avoJyYzLtjZggUou0EAVDUKaxyAyU6KwjlRn ofG3WBujQoLydHQJZtcYadoIeYkN7X7nzm0JducjXJZwBdo9J9PyEcVL2nfk16HgQr1q ragQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=HCHUr50eCN2Mq1BFEjsYp3XRTEkB08z4GhkrFu84N5o=; b=GHbQwQonYe7rFcdA1UBsZy8/N/M3HsN8LGM6M3RM3qFiSc6G4geRbklhZZtY1N1+2G FNtyM9AvrL0DeOrmLywbA1t/J3X4CwfFnFeOelt+W9xvT7+RmxpUjnfAKDl9rm177Ndw dQvax4oz9nbSbE4Z+b7R+R+UzXPvNMWqATVOBLbiaoGCiLzuiR4gSgCzrmpEK7hcfE9O RjzJHvlBlLuHXL30UMT+mJQcbhQq/rpiT+SkWVY36QItsRwuYzWtZyvRLvnQYkekWfkY rEnLZ8L7SY2hexM/2aZZX7skt4WmO+Et0k9nDK69E1fcAqSWN0pHO6gwieAHg37Y+fJV nvkQ== X-Gm-Message-State: AOAM531kOmT5+uuTB2hgwDckH5NhosnmYUxvL+cdAkYPu+0YXhr2FTVm r4NMOjZgmadvX12oFGMk+cGmkA== X-Received: by 2002:a05:6830:1e41:: with SMTP id e1mr54050557otj.143.1609786517769; Mon, 04 Jan 2021 10:55:17 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id t19sm14625846otp.36.2021.01.04.10.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jan 2021 10:55:16 -0800 (PST) Date: Mon, 4 Jan 2021 12:55:14 -0600 From: Bjorn Andersson To: Adrian Hunter Cc: Ziqi Chen , asutoshd@codeaurora.org, nguyenb@codeaurora.org, cang@codeaurora.org, hongwus@codeaurora.org, rnayak@codeaurora.org, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, kwmad.kim@samsung.com, stanley.chu@mediatek.com, Alim Akhtar , Avri Altman , "James E.J. Bottomley" , Andy Gross , Matthias Brugger , Bean Huo , Bart Van Assche , Satya Tangirala , "moderated list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER..." , open list , "open list:ARM/QUALCOMM SUPPORT" , "moderated list:ARM/Mediatek SoC support" Subject: Re: [PATCH RFC v4 1/1] scsi: ufs: Fix ufs power down/on specs violation Message-ID: References: <1608644981-46267-1-git-send-email-ziqichen@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 04 Jan 03:15 CST 2021, Adrian Hunter wrote: > On 22/12/20 3:49 pm, Ziqi Chen wrote: > > As per specs, e.g, JESD220E chapter 7.2, while powering > > off/on the ufs device, RST_N signal and REF_CLK signal > > should be between VSS(Ground) and VCCQ/VCCQ2. > > > > To flexibly control device reset line, refactor the function > > ufschd_vops_device_reset(sturct ufs_hba *hba) to ufshcd_ > > vops_device_reset(sturct ufs_hba *hba, bool asserted). The > > new parameter "bool asserted" is used to separate device reset > > line pulling down from pulling up. > > This patch assumes the power is controlled by voltage regulators, but for us > it is controlled by firmware (ACPI), so it is not correct to change RST_n > for all host controllers as you are doing. > > Also we might need to use a firmware interface for device reset, in which > case the 'asserted' value doe not make sense. > Are you saying that the entire flip-flop-the-reset is a single firmware operation in your case? If you look at the Mediatek driver, the implementation of ufs_mtk_device_reset_ctrl() is a jump to firmware. But perhaps "asserted" isn't the appropriate English word for saying "the reset is in the resetting state"? I just wanted to avoid the use of "high"/"lo" as if you look at the Mediatek code they pass the expected line-level to the firmware, while in the Qualcomm code we pass the logical state to the GPIO code which is setup up as "active low" and thereby flip the meaning before hitting the pad. > Can we leave the device reset callback alone, and instead introduce a new > variant operation for setting RST_n to match voltage regulator power changes? Wouldn't this new function just have to look like the proposed patches? In which case for existing platforms we'd have both? How would you implement this, or would you simply skip implementing this? Regards, Bjorn