From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05888C43219 for ; Mon, 14 Nov 2022 07:48:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235695AbiKNHso (ORCPT ); Mon, 14 Nov 2022 02:48:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235924AbiKNHsn (ORCPT ); Mon, 14 Nov 2022 02:48:43 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 989A7226; Sun, 13 Nov 2022 23:48:42 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5FD71B80D38; Mon, 14 Nov 2022 07:48:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC9FDC433C1; Mon, 14 Nov 2022 07:48:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668412119; bh=Wty1q4Vw3osxbeKih7YgwVKV3K20oBfY1RvNlNBfyTc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XV2xyRy02RLWFX8vCuoAdVTHmGApf/7E3ZgGGyR0QpZUjMZ9OU5Rs/yxQku5rLCSm NgjR/XvqkY2RIpsV4MAw9bW/mBhN4UhQOZ4ARfwZKEeQZ9Cuf7IaGJ2ABifeAyHCvL XHgFXy8ZYCFk5ip148gjawUVwbBjTaVeUm+kC+i+tXo4IRTZzOUjpewr1hkkM6Tyot vYqPMaQ+Zz7gzDW8O/A8Sz6twLufWVt4r9st7jTyeY/qvrip+dqfggYy8+ixuLtuCe vVrakk4xzBEGLmmVAUyxzVaOxddw4OyggtHuEK2aoUgQDWTjhA7CRMe2ItBkSD79lH dvCFWzY9fCujQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1ouUCN-0000oU-6n; Mon, 14 Nov 2022 08:48:07 +0100 Date: Mon, 14 Nov 2022 08:48:07 +0100 From: Johan Hovold To: Dmitry Baryshkov Cc: Johan Hovold , Vinod Koul , Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 4/6] phy: qcom-qmp-combo: fix broken power on Message-ID: References: <20221111084255.8963-1-johan+linaro@kernel.org> <20221111084255.8963-5-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Sat, Nov 12, 2022 at 09:15:43AM +0300, Dmitry Baryshkov wrote: > On 11/11/2022 11:42, Johan Hovold wrote: > > The PHY is powered on during phy-init by setting the SW_PRWDN bit in the > > Nit: SW_PWRDN > > > COM_POWER_DOWN_CTRL register and then setting the same bit in the in the > > PCS_POWER_DOWN_CONTROL register that belongs to the USB part of the > > PHY. > > > > Currently, whether power on succeeds depends on probe order and having > > the USB part of the PHY be initialised first. In case the DP part of the > > PHY is instead initialised first, the intended power on of the USB block > > results in a corrupted DP_PHY register (e.g. DP_PHY_AUX_CFG8). > > > > Add a pointer to the USB part of the PHY to the driver data and use that > > to power on the PHY also if the DP part of the PHY is initialised first. > > > > Fixes: 52e013d0bffa ("phy: qcom-qmp: Add support for DP in USB3+DP combo phy") > > Cc: stable@vger.kernel.org # 5.10 > > Signed-off-by: Johan Hovold > > I can only hope that at some point in your cleanup this hack is going to > be removed. > Nevertheless, I don't see a good way to do this at this moment. Thus: Not sure why you're calling this a hack. This is how the hardware works and pretending that this PHY is some kind of MFD with completely independent components is partly what resulted in this mess. Accessing the USB registers by means of a hard-coded index in the PHY array as is done in the runtime PM callbacks is a hack (see patch 5/6), adding a dedicated pointer is not. > Reviewed-by: Dmitry Baryshkov Johan