Received: by 10.213.65.68 with SMTP id h4csp272620imn; Mon, 26 Mar 2018 21:28:50 -0700 (PDT) X-Google-Smtp-Source: AG47ELsIHvJAYCtsF3RCiyaXL8fEO4abBSMG443qBYxrq6vmBR4C1CPCTAnP94D/OBqiJxNi1M0X X-Received: by 2002:a17:902:64cf:: with SMTP id y15-v6mr20291161pli.49.1522124930079; Mon, 26 Mar 2018 21:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522124930; cv=none; d=google.com; s=arc-20160816; b=G9kxKBfZLXjEGQBiqLn6wCHdtrXWRvg50rYUyBDWT+33e/XgUqE3uOVm3u3Qqn0YjJ hBagB5xzOykI+ywym11BeXPsN/ykFFHk7VagCjYN6AjXKAqce14lhDGm73AET3mfkIGm tqMvtO5N+zFjSbRA5Ad6FC8mdIHZxQgWOQ6g5S8joDaucShAgut+6ikWHFR7wQUeBx9z /tA95+iXPrT0dpaaZAf+zT+qqljueDRbOdzvTY5TfJW5LaT0EYLri1MpXVbglVSpsEoU YqSeKSNrehSCL2SFGew3BxOv5jRnLeSqHc44GaatBDBQ8MDkTI9jYWUqFuG0OoZscpDI Vu3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=9eXvUX8fOP5LvaV80HWSNxM1ADZMUD+6AN0ZbEhfYT4=; b=g29BJFRwjdTEY5Api+wndqoKedavIbI3cnOp/eG6WCklFRxhI7GIUvoUrl+d3etdqN 0NBGEy7Ntt5/iTBJg/3REMgP967PT/1QDhpEvVO/9SSQ6mirV46cOJt9q6fFdepn6m5o /dOE9Y/xWeGL79yFkDGbVuEGbdgijarRa0TnBHRen7qSOufCxFswknPOKSzUgItDSWZJ pLX7fKjGWwFx68kb+xk2/VuxOHfsEtJEV3BmRXdWumsv3iISM371XTvR1UF1Tab/uJNI pndgXDMjMyG7PK5HhW4b2jdccgART/f5R1dANBcu8LaWcJIXJ1OgMQ3MRcTXpp1YFh/k zDKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=UQvrX577; dkim=fail header.i=@chromium.org header.s=google header.b=MM1xrV21; 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=fail (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 o69si268073pfj.329.2018.03.26.21.28.21; Mon, 26 Mar 2018 21:28:50 -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=fail header.i=@google.com header.s=20161025 header.b=UQvrX577; dkim=fail header.i=@chromium.org header.s=google header.b=MM1xrV21; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751054AbeC0E0x (ORCPT + 99 others); Tue, 27 Mar 2018 00:26:53 -0400 Received: from mail-vk0-f42.google.com ([209.85.213.42]:33312 "EHLO mail-vk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750881AbeC0E0v (ORCPT ); Tue, 27 Mar 2018 00:26:51 -0400 Received: by mail-vk0-f42.google.com with SMTP id j85so12480883vke.0 for ; Mon, 26 Mar 2018 21:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9eXvUX8fOP5LvaV80HWSNxM1ADZMUD+6AN0ZbEhfYT4=; b=UQvrX5778YfMw9ZxQ2NaWv+BiPCX4Qt5XEb9/8QQpuXBQUdpG0wureNwh7Re9VEFqK Tazq8VgiLsspUcKE22gM4o1Su4064ibchQ/aYiYobr5ELzXEfUtLK6erhTdI9SvcYxJy 1mVzMRVvirDi64+TyqfsIS+IXQkDvOJJNDqxBz8pmNkV/kjISU01zztaenRfnfKhp1fx ni6oDjkSkgWI8YEHn1RI1vGNQ5TGS1WdLYRAr40DLM4g/81s5Ji98Jl4fbuu5HvzzCNe 4A38PrWGFopNoLPPv+9e3fkvmtnoP7QC4yfRrUM3re1IcpvWPHtsIk5IOf0zjzHcCiwz B5mw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9eXvUX8fOP5LvaV80HWSNxM1ADZMUD+6AN0ZbEhfYT4=; b=MM1xrV21kvNVZExpcrItCUi9l8gr0+ESb5exFMhSbcnaf5tfJpUdtlh1d4VIfuNQ3O KMu3RHlxaxDOYNEt7e2O0yH+rOnWLyv35Vg8CJlmDVDasAKNUms++kjI1/65l1iiG2tE KJAkpLgi0HiC+tKzDi/Qv37VqVurz8R6ZNH5U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=9eXvUX8fOP5LvaV80HWSNxM1ADZMUD+6AN0ZbEhfYT4=; b=bayc3XwWG2OlwTCmbefkpvSA2dnhDXPtTG4yWdYko8riNYM3O4gwO6mpqdhWAqTCnD /LZHAKVOunwFUJZn27Syxhy/1w+yCGRTe/oYQlZq7/Iv9D8JsO4wYDjCqsG0NgBaGdoD aA005EYAM0Mp8HsCMlmu6fAAsYou2DR1DcaFNuhkjjdcq5x9MvVRFEEPJ3kBm1KqhEa7 Gsu5tfvNcbwJ/ILsOCYUOxeh3GY+YvP9BedoHlNzR4ONIxliLOdLfeF4dfJYy2y0sT6f uyCa0bcR6HjiL0glWlDgI47aOBiA6OmoHp1GAIM4aSKmOh/KD7p/OaVBGMEG0BbVg6q6 2S2A== X-Gm-Message-State: AElRT7HbGKTp1JQ7fY/G/oIeoVzJFRAV9R8go7usphjlDjcEjR1zCeLV +bxYpMHcM9eYhnBE8uOAuyQg9xHHtiIvfmeQ0zncvg== X-Received: by 10.31.167.18 with SMTP id q18mr26224585vke.10.1522124810182; Mon, 26 Mar 2018 21:26:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.180.195 with HTTP; Mon, 26 Mar 2018 21:26:49 -0700 (PDT) In-Reply-To: <1521785487-29866-2-git-send-email-mgautam@codeaurora.org> References: <1521785487-29866-1-git-send-email-mgautam@codeaurora.org> <1521785487-29866-2-git-send-email-mgautam@codeaurora.org> From: Doug Anderson Date: Mon, 26 Mar 2018 21:26:49 -0700 X-Google-Sender-Auth: GnUKBH3DQnGmcScjILUGGDOTHhY Message-ID: Subject: Re: [PATCH v3 1/6] phy: qcom-qmp: Enable pipe_clk before checking USB3 PHY_STATUS To: Manu Gautam Cc: Kishon Vijay Abraham I , LKML , devicetree@vger.kernel.org, Rob Herring , linux-arm-msm@vger.kernel.org, Vivek Gautam , Varadarajan Narayanan , Viresh Kumar , Wei Yongjun , Fengguang Wu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Manu On Thu, Mar 22, 2018 at 11:11 PM, Manu Gautam wrote: > QMP PHY for USB mode requires pipe_clk for calibration and PLL lock > to take place. This clock is output from PHY to GCC clock_ctl and then > fed back to QMP PHY and is available from PHY only after PHY is reset > and initialized, hence it can't be enabled too early in initialization > sequence. > > Signed-off-by: Manu Gautam > --- > drivers/phy/qualcomm/phy-qcom-qmp.c | 33 ++++++++++++++++++++++++++++++++- > 1 file changed, 32 insertions(+), 1 deletion(-) So it's now new with this patch, but it's more obvious with this patch. It seems like "UFS/PCIE" is kinda broken w/ respect to how it controls its clock. Specifically: * If you init the PHY but don't power it on, then you "exit" the PHY: you'll disable/unprepare "pipe_clk" even though you never prepare/enabled it. * If you init the PHY, power it on, power it off, power it on, and exit the PHY: you'll leave the clock prepared one extra time. Specifically I'd expect: for UFS/PCIE the disable/unprepare should be symmetric with the enable/prepare and should be in "power off", not in exit. ...or did I miss something? Interestingly, your patch fixes this problem for USB3 (where init/exit are now symmetric), but leaves the problem there for UFS/PCIE. -Doug