Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp1856194imc; Fri, 22 Feb 2019 12:30:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IbhYimY5NVT7dDjoX3gKo6o5CMWvWeYEd0xIaNtaEgW8lpU91aO3lq8ZIJ/Zaw7BuV7laa7 X-Received: by 2002:a17:902:7293:: with SMTP id d19mr5788691pll.29.1550867445686; Fri, 22 Feb 2019 12:30:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550867445; cv=none; d=google.com; s=arc-20160816; b=adDG7ed3o89BCZHJkgXVJJGgCiWAgvC/PDHzVznetMI4WF+UGkSQ9xCSG4UpErHZHI zsCASkKyMf31K2QRJV/b7zPb2vcTgf6LeWCBCsqj90aUusvORGKySnWYFuSgRoYNwJfa GLBsP0Q8CskvxSUQ7mp/NSOYgFxR+lzioBQP7tdr0CDurt69tsq1OWcR+O9405/466Nl 5Z8LmFcsPUqG8PwfgZ4VCqCCUn2f0cAqB8jwWANHvuVSyGQTzDgGFUemG/3xD1NUi/CK hRKq5Fc3FSmi2GuUU9jEuEnelTyPgse1i2tg5gE7MwYOM3cvQlxnKOSbuUyIampB53vq dZYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:in-reply-to:from:references :user-agent:message-id:subject:content-transfer-encoding :mime-version:dkim-signature; bh=JGrmt3K/7C9d4lSIXEU8F7kSqd+ILecKJ2eiGA/K+dg=; b=FhAlGg1pBk2rWal0FuuMe9zlvJ+0A8gxn6b8Ofs3c7k28q69qPjAIUoLcwZQctk8v7 VhjPyh8iiKQWqwGy5gBTorWFdw8RITJRNgOHKJfDFOT136qUNa5svH1jBPWWaVQd9JIL QsUl5JrkpCCwGPGDovkD8s598Smi8PUc0pEw3C2skHZAml9JVglmFTL83Hn+/LO8NTWD b+j0t8MdbakhFdHLXXI9ZMPtG4tS0Zfhh/QswHlV1ikvo/qpAnXZXUb1PV0PW/5Kw6Qd CIKepCs6Srfkl9o3cArxGYAkSR1ddbsV3muFsnLM1dy3aa8HQMvQdrn9VYj5Qs8JOkPt sxJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PlMJmX62; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si2179011pgh.540.2019.02.22.12.30.30; Fri, 22 Feb 2019 12:30:45 -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=@chromium.org header.s=google header.b=PlMJmX62; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727432AbfBVU22 (ORCPT + 99 others); Fri, 22 Feb 2019 15:28:28 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:32803 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbfBVU22 (ORCPT ); Fri, 22 Feb 2019 15:28:28 -0500 Received: by mail-pg1-f193.google.com with SMTP id h11so1635489pgl.0 for ; Fri, 22 Feb 2019 12:28:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:subject:message-id :user-agent:references:from:in-reply-to:to:cc:date; bh=JGrmt3K/7C9d4lSIXEU8F7kSqd+ILecKJ2eiGA/K+dg=; b=PlMJmX62oaqBjeQvBF4tuOXleGUxjouBehmvZqRREBhPp/vAVNK31M9Vy/TTGO8Nz+ 44AIvTYvlSmaGSw24p21GR7eIimwk8NhcE7ZKL09lwxeVhOe8T7vjworxijnxYcSGXPN N/vzobJbr1ne0GoL3KJc8SdXAg9B+5mA46/ck= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding:subject :message-id:user-agent:references:from:in-reply-to:to:cc:date; bh=JGrmt3K/7C9d4lSIXEU8F7kSqd+ILecKJ2eiGA/K+dg=; b=Asr9W3Tb2p9aTB4uxI2u0icnRXgQ03+L45HgDYR4l8WpE9uN5ga7lJkWBm9hCkfeEN sy6nBy9Scu4Ou9uX8bWTivAcz55uG1tub05wwiFd33Oip9/KQlDJnHMPrGiBGOTTPjkv dqsRxpaos+PK35oijkaVoAuC5gR2M9gl3h2qljFw7hg0unfqOtWQoHCzvL4hY8owvxNY QzRfiaTEMZeEfWVAPhqM0UJYoSo3tKlrvJznc0VhkHdphdtFm89YefLztJM3D48iJ5oa EAKWgPZKXko5gauNxgN82vmqeUBEZo3MCo7pLLW9VGQTemHMLISLSXllH9Hel8vwJ5Z9 Kcgg== X-Gm-Message-State: AHQUAua/9ix3FuoeJYNGMs8FrfSqhzuRYX9WT4hRpnfYvMUBBpD1vM/q 7tXQkYGoImjZ2e+iC7t9RFcsvw== X-Received: by 2002:a63:94:: with SMTP id 142mr5633941pga.74.1550867307515; Fri, 22 Feb 2019 12:28:27 -0800 (PST) Received: from localhost ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id u127sm3154621pfu.165.2019.02.22.12.28.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Feb 2019 12:28:26 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v4 8/8] phy: ufs-qcom: Refactor all init steps into phy_poweron Message-ID: <155086730616.77512.8822375378896358546@swboyd.mtv.corp.google.com> User-Agent: alot/0.8 References: <20190213232526.26995-1-evgreen@chromium.org> <20190213232526.26995-9-evgreen@chromium.org> From: Stephen Boyd In-Reply-To: <20190213232526.26995-9-evgreen@chromium.org> To: Andy Gross , Evan Green , Kishon Vijay Abraham I Cc: Marc Gonzalez , Can Guo , Vivek Gautam , Douglas Anderson , Asutosh Das , Evan Green , Jeffrey Hugo , Arnd Bergmann , linux-scsi@vger.kernel.org, Grygorii Strashko , Bjorn Andersson , linux-kernel@vger.kernel.org, Manu Gautam , "Martin K. Petersen" , "James E.J. Bottomley" , Vinayak Holikatti Date: Fri, 22 Feb 2019 12:28:26 -0800 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Evan Green (2019-02-13 15:25:26) > The phy code was using implicit sequencing between the PHY driver > and the UFS driver to implement certain hardware requirements. > Specifically, the PHY reset register in the UFS controller needs > to be deasserted before serdes start occurs in the PHY. >=20 > Before this change, the code was doing this by utilizing the two > phy callbacks, phy_init() and phy_poweron(), as "init step 1" and > "init step 2", where the UFS driver would deassert reset between > these two steps. >=20 > This makes it challenging to power off the regulators in suspend, > as regulators are initialized in init, not in poweron(), but only > poweroff() is called during suspend, not exit(). >=20 > For UFS, move the actual firing up of the PHY to phy_poweron() and > phy_poweroff() callbacks, rather than init()/exit(). UFS calls > phy_poweroff() during suspend, so now all clocks and regulators for > the phy can be powered down during suspend. >=20 > QMP is a little tricky because the PHY is also shared with PCIe and > USB3, which have their own definitions for init() and poweron(). Rename > the meaty functions to _enable() and _disable() to disentangle from the > PHY core names, and then create two different ops structures: one for > UFS and one for the other PHY types. >=20 > In phy-qcom-ufs, remove the 'is_powered_on' and 'is_started' guards, > as the generic PHY code does the reference counting. The > 14/20nm-specific init functions get collapsed into the generic power_on() > function, with the addition of a calibrate() callback specific to 14/20nm. >=20 > Signed-off-by: Evan Green > --- Reviewed-by: Stephen Boyd