Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7731207ybi; Thu, 6 Jun 2019 00:11:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEOrU7iJf01ZcIboMLA7CNCYlt3314+NKeYO0z68qqHO2u+UZxZiu5YvcR/TsreI/W/lUn X-Received: by 2002:a17:902:bb89:: with SMTP id m9mr45582614pls.188.1559805109860; Thu, 06 Jun 2019 00:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559805109; cv=none; d=google.com; s=arc-20160816; b=EfztE2gpBmUI/soI0kBacEFpUVGvS7WYO2QA2cqedpf3Zw9UJvDsZRleg0KdYutXGq DyM8kGm34MMrqe7bJ77iBcQv2iu+fMShHXCLzy7H28+Pjfp5Q8z3CQIBnjIqw2NiL26H i1EE6QMTw4Ie0p+Cjhx3laQ7uGKbyC4ruaTQTv6HNhvbITEeNmdzwYH7OnGh4aK9GwkD egTWFRNVsPtKZHQ47oj7w6uxeItDe23UYpRPpRWpBBE6ppDrxOaO2umnygQ2YkagvpCC FVG4z9CJ4nn7lkBTdd3BC7ICGIS0scMuLYJ7mAk9rkcFlbPK/4GGzzKOMro0H9j+lVnV 7Dug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=puIXzR2Own0cbDgtZ/rESXOOL8scU6F9mL+QrFjp0g8=; b=hLzJDy19APuyAIKfRSc65FneaoTAW/GlQ43jPtHSkE/LgFf2UOxXbVrD1erMCQAVOw txbeqbn+jcENj3iINPGA2z+aV9D/NWkgsAQx25TdB1RKoaYjBxYdyouj2AT2Bv8hBV7h 8qrf+Bts3S2FPBXJ/RPwu5qElaIAt5L1qZYgpdcoLso51AA0UEGfw3cYgI2Y+eBzOMBq gS+P9MetPHQ/n/UVGMOwbCpFcsRzxIB13pDdyfidhu5mHjlyfYcTgAcQuhXR26l+zISK hG7iIonegwthYZBa45ezRI7Ji78V1PBEMHi40c9vBc86NElSlD1efwbpdGf8aUlvDl18 WSXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cVgCr6vn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 64si1167794pfd.278.2019.06.06.00.11.33; Thu, 06 Jun 2019 00:11:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cVgCr6vn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726685AbfFFHJM (ORCPT + 99 others); Thu, 6 Jun 2019 03:09:12 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:37872 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbfFFHJL (ORCPT ); Thu, 6 Jun 2019 03:09:11 -0400 Received: by mail-pg1-f195.google.com with SMTP id 20so820739pgr.4 for ; Thu, 06 Jun 2019 00:09:11 -0700 (PDT) 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:user-agent; bh=puIXzR2Own0cbDgtZ/rESXOOL8scU6F9mL+QrFjp0g8=; b=cVgCr6vnkGfjbhGXEObW1I3eyaTZzs4e6YbdY6IpyHvoRC/cyQjHSlt0gxIth7Hdeu eN5d1Xq7g1lwpP9OqdHss8u059osQZKuNhLLZQDMfVeXEnwdfWXX/9x5wMPNmTf8vdMp edojQQ/rLLAz+Ma+B+VExLG44vHl79i9L+21ZSA3+/M+XhdLiyrhJh7bfmceA5yyn+O5 F5U1b3PO/PE12bohPtUqnSdgMu8VX6VQP1ZbADi89a+bsmYX1ZeVg1c7YZy4XHTXQyR+ K85N7Y+nqqCSKG8JWtn16z8k9ZHBXM5Z3X6Q26+9a4Pz7Z+zIOWyj13pD8cU9hReymQe EVpQ== 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:user-agent; bh=puIXzR2Own0cbDgtZ/rESXOOL8scU6F9mL+QrFjp0g8=; b=KP8/rYX7yu3TOWbUQlLbPOydExiSKS4udInbELtvwpGR5VOuwFVOIiYP5L7+OMxqAx nkM9YINImBAAZ2lgX1MbBL+LwKlYNs0GK9OoYgyChygWsVtCZ4m/NbRkA0Pp/PclRPwh wLYezN95yycLzDPWf1G+H0v8FtP/uKzfY5AmjL9IAu9LqulLaDE1iYCOKUQL/J4D9MQ6 8naZ/rxK7FvEPm9O3kWuWCu7R1j1DF+eZPM7RSq054mMf1aV7KMIgYFiYgtke0y7Lw9H 48+URPEAZsupPagMXgU1pq+fRqX682gkaIzzVe4AbHdNCTatJE+G++V+x5xqU56+h1Hp SPFw== X-Gm-Message-State: APjAAAWHwuvRDSh/KUPvJuvnjcinpFQeVKW70YsVbJZ8qNMirOc3oqyJ /pgimpQeqj8nlsMDI5PMb4UX8Q== X-Received: by 2002:a62:63c6:: with SMTP id x189mr39479895pfb.31.1559804950625; Thu, 06 Jun 2019 00:09:10 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id x128sm1376557pfd.186.2019.06.06.00.09.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jun 2019 00:09:10 -0700 (PDT) Date: Thu, 6 Jun 2019 00:09:55 -0700 From: Bjorn Andersson To: Avri Altman Cc: John Stultz , Andy Gross , Linus Walleij , Rob Herring , Mark Rutland , Pedro Sousa , "James E.J. Bottomley" , "Martin K. Petersen" , "linux-arm-msm@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , Linux Kernel Mailing List , "linux-scsi@vger.kernel.org" Subject: Re: [PATCH 0/3] (Qualcomm) UFS device reset support Message-ID: <20190606070955.GR22737@tuxbook-pro> References: <20190604072001.9288-1-bjorn.andersson@linaro.org> <20190605060154.GJ22737@tuxbook-pro> <20190606003959.GM4814@minitux> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 05 Jun 23:32 PDT 2019, Avri Altman wrote: > > > > On Wed 05 Jun 02:32 PDT 2019, Avri Altman wrote: > > > > > > > > > > On Tue 04 Jun 22:50 PDT 2019, Avri Altman wrote: > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > On Tue, Jun 4, 2019 at 12:22 AM Bjorn Andersson > > > > > > wrote: > > > > > > > > > > > > > > This series exposes the ufs_reset line as a gpio, adds support for ufshcd > > to > > > > > > > acquire and toggle this and then adds this to SDM845 MTP. > > > > > > > > > > > > > > Bjorn Andersson (3): > > > > > > > pinctrl: qcom: sdm845: Expose ufs_reset as gpio > > > > > > > scsi: ufs: Allow resetting the UFS device > > > > > > > arm64: dts: qcom: sdm845-mtp: Specify UFS device-reset GPIO > > > > > > > > > > > > Adding similar change as in sdm845-mtp to the not yet upstream > > > > > > blueline dts, I validated this allows my micron UFS pixel3 to boot. > > > > > > > > > > > > Tested-by: John Stultz > > > > > Maybe ufs_hba_variant_ops would be the proper place to add this? > > > > > > > > > > > > > Are you saying that these memories only need a reset when they are > > > > paired with the Qualcomm host controller? > > > ufs_hba_variant_ops is for vendors to implement their own vops, > > > and as you can see, many of them do. > > > Adding hw_reset to that template seems like the proper way > > > to do what you are doing. > > > > > > > Right, but the vops is operations related to the UFS controller, this > > property relates to the memory connected. > This is not entirely accurate. Those are vendor/board specific, > As the original commit log indicates: > " vendor/board specific and hence determined with > the help of compatible property in device tree." > > I would rather have this new vop: > void (*device_reset)(struct ufs_hba *), Or whatever, > actively set in ufs_hba_variant_ops, rather than ufshcd_init_device_reset > failing as part of the default init flow. > But such an vops would allow me to provide a Qualcomm-specific way of toggling the GPIO that is connected to the UFS_RESET pin on the Hynix/Micron memory. But acquiring and toggling GPIOs is not a Qualcomm thing, it's a completely generic thing, and as it's not a chip-internal line it is a GPIO and not a reset - regardless of SoC vendor. Further more, it's optional so boards that does not have this pin connected will just omit the property in their hardware description (DeviceTree). So I think the halting part here is that we don't have a representation of the memory device's resources, because this is really a matter of toggling the reset pin on the memory device. Regards, Bjorn