From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpbgau2.qq.com (smtpbgau2.qq.com [54.206.34.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B06EF1B3925 for ; Tue, 7 Jul 2026 03:21:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.206.34.216 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783394490; cv=none; b=c7rWJmFvbeivhiRn0dxwSeik+9+JblpE/7I5gY3Gq6WmcblXASe6r9l+opn4ucssyldeTgaPNvkLH/ujamkRqbh45YFMKJXlEW2BxatHzsmt7GFNpapN8xVyeOYqIVv6MGMhUwWnRLftEbo4qi60gdhi4IO9VhGXGH8oI7URzCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783394490; c=relaxed/simple; bh=Joa5f766kFQG+VDx1xi0qljvrOXZ8cpEpg2lZW0VgAE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YLYaHzE8Aa0WwVDodrkoeVg2TyyY7f2cqCCX+xmQYGVDPBrIP80nP3Tji26sXBS83wSKLDnwpB7M8HMsMH5X2W4Nt05G/7WTtPPOG5mnZuWX5ui6gEmjS1++es/C1FHI6FA+wtXZB0hO8YZYyUmbdTqE6zaAy1Ccy3Z3djIEq8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com; spf=pass smtp.mailfrom=uniontech.com; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b=iiejvXl4; arc=none smtp.client-ip=54.206.34.216 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniontech.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b="iiejvXl4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1783394483; bh=Joa5f766kFQG+VDx1xi0qljvrOXZ8cpEpg2lZW0VgAE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=iiejvXl4DKgBaR6AqV+mRHHzs0Z3z6lB3fMjifUB328c427Xu0IL+QFRZcRKWGj8C /6cmekrdJ6FmTUy7O33mfeWMn8zfhD/hL/pZtk0r8jy13NhEeOCmnSs/CyXycV/H0C Ab8LBiUylHPr0JV7CXOkCLIMpyAxTQnelyA6kASo= X-QQ-mid: esmtpsz18t1783394468ta66ff50c X-QQ-Originating-IP: OHa2ywK7nMDSursBl1DEWqW1dmcItOyUIsCyNfbG/H0= Received: from PEN202512010004 ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 07 Jul 2026 11:21:06 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 12717493362023860116 EX-QQ-RecipientCnt: 12 From: Xu Rao To: andre.przywara@arm.com Cc: jernej.skrabec@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-sunxi@lists.linux.dev, marco.crivellari@suse.com, neil.armstrong@linaro.org, raoxu@uniontech.com, samuel@sholland.org, vkoul@kernel.org, wens@kernel.org Subject: Re: [PATCH] phy: allwinner: sun4i-usb: disable the PHY2 PMU clock after SIDDQ setup Date: Tue, 7 Jul 2026 11:21:06 +0800 Message-ID: <8976A02CE2417DF2+20260707032106.985208-1-raoxu@uniontech.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: esmtpsz:uniontech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wakE6NasK7aOln/kZ2BZ2Zg/D05z/OI7 lw2hyMqMDbgWO8SzKy X-QQ-XMRINFO: NS+P29fieYNwqS3WCnRCOn9D1NpZuCnCRA== X-QQ-RECHKSPAM: 0 Hi Andre, > > - clk_disable_unprepare(phy->clk2); > > + clk_disable_unprepare(phy2->clk2); > > Interesting, this looks about right, and matches the comment above, > noting that phy2->clk2 is just temporarily needed. I don't remember > further details, only that this workaround was quite annoying and messy ;-) > > However I am wondering how this worked so far: This should sabotage the > access to the local REG_HCI_PHY_CTL access in the next few lines ... > Any idea why this worked nevertheless? Yes, the current code is wrong, but the visible effect is limited. In sun4i_usb_phy_init(), the auxiliary SIDDQ path explicitly enables phy2->clk2 and then accesses phy2->pmu + REG_HCI_PHY_CTL. So the clock that has to be disabled at the end of that block is phy2->clk2. The current code disables phy->clk2 instead, which is a different object. That does not undo the temporary phy2->clk2 enable. The reason this has not shown up as an obvious functional failure is that phy->clk2 is an optional PMU clock. On systems where the non-PHY2 PMU clock is not provided, the wrong clk_disable_unprepare(phy->clk2) does not actually disable a local PMU clock. In that case, the practical visible issue is simply that the temporary phy2->clk2 enable is not matched by a corresponding disable. So the failure is not that the following local REG_HCI_PHY_CTL access is known to break today. The concrete bug is that the auxiliary path enables one clock and disables another one. Thanks, Xu Rao