Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5461741ima; Tue, 5 Feb 2019 12:10:23 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia/nV/ICy053UjOy/QYcrnUSUAddx+jkclB5oycAy+8jvCFadtk+wOEYZOXcHzxHOENwCbC X-Received: by 2002:a63:101:: with SMTP id 1mr6208070pgb.152.1549397423652; Tue, 05 Feb 2019 12:10:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549397423; cv=none; d=google.com; s=arc-20160816; b=fRcLhpRsHGgddaV3LGwEleE6gNmCuHA8lN+SVERaCIQl8S3zulnuzlTsw5i3h2toCO c6BoUCEeyM5Fyp3EC36TAfKTDHCjScPfLYM7DmLwi4yJTMVw+c3tD1M8eF85esf9DqzJ hC6gmIPnf9iRyc8zwu/KaQWOuthEBiBYL4aMRlTu8ysy2EnPT5/ZKwU7TOdn1nk0ufcH mRkeStwqkbkbeKfkD9B5tXyo8YlzIs9d3mJmSh17CQwdgZDcgeTosMPHdh/fUc0CmGIZ 21UIQmoEpjGEZc0DRWx5m2HGuRpHwMEWynqsBZn6/s46IXA+uOJG2LpH5794/PKvkMgL AsxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=6VgbUB8ZM6MfvDoNC5LiPdW24yZI7k5BGa3KWIKrRzk=; b=rGUk6fh6CWJilRDNEfToD5JGz0uPEtJx771ZkrOwLK8pzpIRsxpYPCFU305hgC5dIl gCFobV8HCMelf6Njs+55BBhnoNsdWyEaG5bPzOyHMjwqgNTFiahjZSsmgxzWoqot7j7B e7DIcqElSjK5GpHkTjxPgmX0YTvadSaqFdnGXmzwi0C584CYOY8jD5uWTwIFbl26u2uZ PpJEfB46m3rkSQ33MZZoiJgEMLA2rD8wQ2h/sUmGINeUMQDVeVfuj4u+5G1Nui0nVczT JVMQHyfXmQB8IANIgov6YdfXQWaavuMpPJM4GortuqVkFsUFYFKn5IvdJW0lZJXaEGSY 77gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=PhtepKyq; dkim=pass header.i=@codeaurora.org header.s=default header.b=V08Plt83; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3si3853968pgi.388.2019.02.05.12.10.07; Tue, 05 Feb 2019 12:10:23 -0800 (PST) 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=@codeaurora.org header.s=default header.b=PhtepKyq; dkim=pass header.i=@codeaurora.org header.s=default header.b=V08Plt83; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729347AbfBEThd (ORCPT + 99 others); Tue, 5 Feb 2019 14:37:33 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:37012 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726422AbfBEThc (ORCPT ); Tue, 5 Feb 2019 14:37:32 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5E125608EA; Tue, 5 Feb 2019 19:37:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1549395451; bh=lHUU7rfue+fhxGnZ888AaeOr54QaA+8syQuGbk+mSsU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=PhtepKyq70hYJ+RCUV7lENVSWXv2+SWM1Lwq5WZ/av2mX9M8jb3clc+ZnbhF7ONKG B2Ye1S1Qnw3Iswr2+kg26WUs5xRaUUMrXplo9ebAvFoGW/JUjJe0f570PplglYeAsr ubzVBPcrDzdbGYWmFDjUVSBnhJI2f6xLpubu98V0= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.226.60.81] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jhugo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id F20036047C; Tue, 5 Feb 2019 19:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1549395450; bh=lHUU7rfue+fhxGnZ888AaeOr54QaA+8syQuGbk+mSsU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=V08Plt830pp7cI9qQqd8A1b78a9ohBFjdggtq2T3UsSKwF3KmWiQgl6G1kolHINak N+AuNIEPEoPrWC3aF9ik4OUcjU7ZiM5pnZg2dK3TjvTjxfGCVAYeFf1T/GaT6mm6cY d5nSJ7MJrZVt+NtfFIY+9Uu6ld/eEM9yCCW0+TK4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org F20036047C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jhugo@codeaurora.org Subject: Re: [PATCH v3 5/5] Revert "scsi: ufs: disable vccq if it's not needed by UFS device" To: Evan Green , Marc Gonzalez Cc: Alim Akhtar , MSM , LKML , Bjorn Andersson , Andy Gross , David Brown , Douglas Anderson , Avri Altman , Pedro Sousa , Subhash Jadavani , Bart Van Assche , SCSI References: <70618c25-83f0-b9db-51a3-c1d74b605a45@free.fr> <5f2a8378-1f22-6a52-356d-56d3b393ab1d@samsung.com> <05d2d193-4181-12ce-b4fb-4e8dec5aef27@free.fr> <7610c262-1451-9bb2-48a6-4daf6f534f6c@free.fr> From: Jeffrey Hugo Message-ID: Date: Tue, 5 Feb 2019 12:37:26 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/5/2019 11:19 AM, Evan Green wrote: > On Tue, Feb 5, 2019 at 9:52 AM Marc Gonzalez wrote: >> >> On 05/02/2019 18:24, Marc Gonzalez wrote: >> >>> /*** system hangs here for several seconds, then reboots ***/ >> >> Silly me. The system crashes in ufshcd_dump_regs() which is a bug >> I fixed myself. Once I cherry-pick the appropriate fix, the board >> no longer reboots, but UFS init does fail. >> >> Full boot log here: >> https://pastebin.ubuntu.com/p/KwpRnWMFw5/ >> >> In any case, it's obvious that disabling vccq on this system is >> a mistake. How would you solve the problem? (A quirk on top of a >> quirk sounds silly.) >> > > I think Bjorn is right that this whole quirk seems to be compensating > for an incorrectly specified device tree (one that specifies > vccq-supply but that doesn't go anywhere).... though maybe this was > made to support boards with footprint-compatible UFS parts from > different vendors? Like the same DT is used for two different SKUs, > one which stamps down a UFS part that uses VCCQ, and another that > doesn't use it, though the wire is there. This doesn't make sense from a DT perspective, as I understand it. If some board has different configurations (say different display panels), FW is supposed to somehow detect that, and edit the DT before passing the DT off to Linux. In your example, if SKU1 has a UFS part that needs VCCQ, and SKU2 does not, then FW should somehow query the HW, determine which SKU the device is, and patch vccq in or out of the DT as necessary. > > But the revert itself shouldn't really fix anything for you Marc, > should it? It looks like this quirk turns on for Samsung and SKHynix > parts, which presumably just don't use VCCQ. So maybe your device tree > doesn't match your schematics, where the DT's vccq supply is actually > the vccq2 supply going into the UFS chip? I see the same issue on the reference device, the MSM8998 MTP. The schematics for that indicate there is both vccq and vccq2, at different voltages. vccq goes to both the UFS block, and the phy. Digging into things, the problem doesn't seem to be that vccq is off - the phy will keep it on. However, the load from the phy is minimal. What really loads the regulator is the UFS block. Without the load from the UFS block, the regulator is likely in a low power mode. I cannot tell if vccq is routed to the actual storage chip based on the documentation I see, however I can tell that it powers blocks within the host controller block which assist the controller in communicating with the storage chip. These blocks consume quite a bit of power, so likely, if the regulator load is not properly accounted for, these blocks brownout, and communication with the storage chip is broken. The schematics do refer to this input to the UFS block as "vccq". So, at a minimum, the host controller itself consumes vccq, and therefore it is unfair to disable vccq solely based on the UFS storage chip that happens to be connected to the controller. So, we've got two boards that are actually harmed by this quirk. I've not seen anything indicating what harm happens without this quirk. Can someone indicate what that is? -- Jeffrey Hugo Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.