Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1497422rwb; Fri, 13 Jan 2023 13:10:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXs1cKUPmSfb7uPLAusXIY6wNCIa2jO4enybnXHQxlvSWKcF92SgY6FCr4qGv7nlxa6vaYH8 X-Received: by 2002:a05:6a21:599:b0:b5:b45a:656d with SMTP id lw25-20020a056a21059900b000b5b45a656dmr22994547pzb.18.1673644256123; Fri, 13 Jan 2023 13:10:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673644256; cv=none; d=google.com; s=arc-20160816; b=eXrL136QAOw3t5a6BAqTvqafq6EwlA9HylgWaYV03gJ0tXGCqdE4fshY/3dQ7KLunr r5rHv/oVECHz4+eZ4ixKU/yrN+SRpQOO1+e/bK0WKwHluunWS00MTONTmle1w51HRnHg K0ZpKfpSkGVpfekZsTwYkdM4zt4vOoBvJ9aIXlBN7VX3XVN5uRyikl5UzDiabJVOXFCd F19Ne6zj7oPfaqRZFwa5G2LlVF1i3yqtakgBeCSXqk1LIvK6f3LKcD1/35VyVBjJfe5D a77lTINj5IQzTwSiMLrN10HeFijJsKiVjEa+eT2ucMRtdggyPVOPockyWoQE2oXLv2yw sXGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=nTni+wbaNdoFxJZHjHSxguNsIMfXs1Dq60dhaD0O3/g=; b=iCGxc0BIMp5ltFNWgtfyPl+g7vi3HZpq7SiCFhoz7rKQfF4iQEPW6mOWtw3I+nP/4K QkuvKX1FusiH11EGhvtvYNozCgA2DB1cMRZCxkIhNOUOeV8rmOKD/Zd+3AcZ9444/lMF r1Ofdf0fsCbAXPEwSWyvy7FyubFoZRNeFRdnsPpfW5dNc5gqRomcXPnIfwixsHpr57Do qTFqc1dLPxUc92PXEanZpgiQUAb2Gq2JUFsc2aNce85+jSF5RWJusBVB/mGQwV74AUof B5zmzyW5q8ZnfYuyvMvxoWD2zyDSalanbTqRsvY0aRD5zPOHhunTaZ+sPES6LjQiXTEg kp9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XBIvg1iJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020a631605000000b004b399347544si14865288pgl.346.2023.01.13.13.10.49; Fri, 13 Jan 2023 13:10:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XBIvg1iJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231169AbjAMUDF (ORCPT + 52 others); Fri, 13 Jan 2023 15:03:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231201AbjAMUDD (ORCPT ); Fri, 13 Jan 2023 15:03:03 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79E9A3BE82 for ; Fri, 13 Jan 2023 12:03:02 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id g18so1724640lfh.0 for ; Fri, 13 Jan 2023 12:03:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:from:to:cc:subject:date:message-id :reply-to; bh=nTni+wbaNdoFxJZHjHSxguNsIMfXs1Dq60dhaD0O3/g=; b=XBIvg1iJ+x1OJifoSIqrot543YWkH97QSJZlttNqDQu9a+DFOOG6kHaDVk0UNii0oF Exc6whJ7JIn25/sJFFevIaQh50ZR82g2qY8jwPvNw5LuRFYdCg8564iZkrdSkib/AWhr 7JUc7Lz0+ujudO10B4cjRQfmL4ISt2RMHd5+k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nTni+wbaNdoFxJZHjHSxguNsIMfXs1Dq60dhaD0O3/g=; b=IVNSQPUxahMY/ihAzTSTXk37S/8AT8jgCntkUvGxyj4IzyDVqS6uNUhPqOSyzsPU5J X4+TRq6rpc1fybb+5xLNWEBNOyO91NChBFUGQfwN0GdPoRVLtz07t8FHN2AEUl+BtRet VRLqCRZU9e9uUDtzK+0AIDC/MJ8othcGnkrvqauNePs3QTUL/AZQlUD11oGsaTVVE2nd SWEFp/CvP8NGBtmEWjQJyEhyKArwy5TKBcUYCC8VoOPrTJclt1DUpwc0SFbcqWnz1p2Q sarc/KBoYSoWg1QRpuynyqyDWzizeWJUopIl6IuMinGvu8ecqZ4RJSSTY1lG63qYosix 3Lvg== X-Gm-Message-State: AFqh2kpj2s3wXsvR2HjeoEu7WbjJeiWhV1E4DzLWV2GZAGeAk5hbJwry m0CJi+i7U5jrETfKBckhyT3NnERGw/1YDWT9bMCzCw== X-Received: by 2002:ac2:4e50:0:b0:4ca:e48d:2b4b with SMTP id f16-20020ac24e50000000b004cae48d2b4bmr8290856lfr.511.1673640180795; Fri, 13 Jan 2023 12:03:00 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 13 Jan 2023 14:03:00 -0600 MIME-Version: 1.0 In-Reply-To: References: <20230113005405.3992011-1-swboyd@chromium.org> <20230113005405.3992011-4-swboyd@chromium.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Fri, 13 Jan 2023 14:03:00 -0600 Message-ID: Subject: Re: [PATCH 5.15.y 3/4] phy: qcom-qmp-combo: fix broken power on To: Johan Hovold Cc: stable@vger.kernel.org, Johan Hovold , linux-kernel@vger.kernel.org, patches@lists.linux.dev, Dmitry Baryshkov , Vinod Koul Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Johan Hovold (2023-01-13 00:07:32) > On Thu, Jan 12, 2023 at 04:54:04PM -0800, Stephen Boyd wrote: > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c > > index c6f860ce3d99..9fda6d283f20 100644 > > --- a/drivers/phy/qualcomm/phy-qcom-qmp.c > > +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c > > @@ -4620,13 +4621,13 @@ static int qcom_qmp_phy_com_init(struct qmp_phy *qphy) > > qphy_setbits(serdes, cfg->regs[QPHY_COM_POWER_DOWN_CONTROL], > > SW_PWRDN); > > } else { > > - if (cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL]) > > - qphy_setbits(pcs, > > - cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], > > - cfg->pwrdn_ctrl); > > + if (usb_phy->cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL]) > > + qphy_setbits(usb_phy->pcs, > > + usb_phy->cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], > > + usb_phy->cfg->pwrdn_ctrl); > > else > > - qphy_setbits(pcs, QPHY_POWER_DOWN_CONTROL, > > - cfg->pwrdn_ctrl); > > + qphy_setbits(usb_phy->pcs, QPHY_POWER_DOWN_CONTROL, > > + usb_phy->cfg->pwrdn_ctrl); > > This bit looks like it requires some more work in order not to break > PCIe and UFS PHYs, which lack the USB registers. Good point. I don't have PCIe or UFS PHYs so I missed this. > > > } > > > > mutex_unlock(&qmp->phy_mutex); > > @@ -5769,6 +5770,9 @@ static int qcom_qmp_phy_probe(struct platform_device *pdev) > > goto err_node_put; > > } > > > > + if (cfg->type == PHY_TYPE_USB3) I changed this to by 'cfg->type != PHY_TYPE_DP' > > + qmp->usb_phy = qmp->phys[id]; > > + > > /* > > * Register the pipe clock provided by phy. > > * See function description to see details of this pipe clock. > > @@ -5791,6 +5795,9 @@ static int qcom_qmp_phy_probe(struct platform_device *pdev) > > id++; > > } > > > > + if (!qmp->usb_phy) > > + return -EINVAL; > > + > > This will break probe of PCIe and UFS PHYs unless you only check this > for combo PHYs. > > Perhaps you can rename the usb_phy pointer to something more generic and > set it also for PCIe and UFS so that it always points to the register > block that should be used for QPHY_PCS_POWER_DOWN_CONTROL. I worry that future backports will be complicated if they use 'usb_phy'. Maybe I'll just leave this as is.