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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6827FC433F5 for ; Sat, 15 Jan 2022 12:39:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 64C37835D4; Sat, 15 Jan 2022 13:38:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="klPg/oqR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4E1D6835AE; Sat, 15 Jan 2022 13:38:44 +0100 (CET) Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1014E835AE for ; Sat, 15 Jan 2022 13:38:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf2b.google.com with SMTP id u26so282127qva.7 for ; Sat, 15 Jan 2022 04:38:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=CP9IB4QjBnjWOEzSZZUKoEncWJn62p/V3l8N1uN20Eg=; b=klPg/oqRFPaTJSNdKuMdOG3X44+lLL0mmYu77ShoyPliBH5kInGHmblQJbLTps0A26 2yuahC90ODju9IopZQSO51ZtansSB2AOJcJVF3rjIG/i2yVHJ10D3LbgFJaA2zv2tJOh o8qWg3cTQQvlqkCKX49T8xb4WZCUFapDuYAvI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=CP9IB4QjBnjWOEzSZZUKoEncWJn62p/V3l8N1uN20Eg=; b=m8MdhLjNCDhk7jnemQn80cPARl42YP1EaOXYJDJ0xE777s2XrRG5WN+nBvcAn2aKzi QXX7TETOjQGfGbZd0dR9iub7en0099XuMtEOIqt0UHh0js5jrUjt0UEu4kqhdgMh6IEA Lt2TRH3bPMEFFdSey+A1gGPxJ+LP5jIjYNkDskWVTeg+q4H5I6mJLLzwMFeYAPqnaaGa GtWXhhJsAgL8VJzuIgvh+trjDeKi4e5QIEUoGKi/9KBLVo79ogxHM4FolJPcxoz9YZlq DZ5RM/Obmtk7RRSmSC9FStfz+bcd+262deeiT7enIsotSPYAOUHT5rkzrPii7pMH9qsa O+zA== X-Gm-Message-State: AOAM530pvju3JKRbw4ewcQ5FAZTbsAjkVw54Nq3p7c+F1kpauZYEQKQy rmt8I9xlkV8UkdaMY27dqyoH8w== X-Google-Smtp-Source: ABdhPJwm2IZ0saNRuAUtyEYO9OP5xWjSNHTBag4W6q2xwt21DVCGP0TL5GbFn+WrwyjKkbIhR5xQBg== X-Received: by 2002:a05:6214:27e6:: with SMTP id jt6mr11787306qvb.18.1642250318888; Sat, 15 Jan 2022 04:38:38 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-9533-0c51-a891-732b.res6.spectrum.com. [2603:6081:7b01:cbda:9533:c51:a891:732b]) by smtp.gmail.com with ESMTPSA id d6sm5977043qty.79.2022.01.15.04.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jan 2022 04:38:38 -0800 (PST) Date: Sat, 15 Jan 2022 07:38:36 -0500 From: Tom Rini To: Alper Nebi Yasak Cc: u-boot@lists.denx.de, Frank Wang , Andre Przywara , Simon Glass , Neil Armstrong , Grant Likely , Joe Hershberger , Peter Robinson , Jagan Teki , Patrick Delaunay , Grant Likely , Icenowy Zheng Subject: Re: [PATCH v3] phy: Track power-on and init counts in uclass Message-ID: <20220115123836.GG9207@bill-the-cat> References: <20211230193652.33514-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gjXco3g9RI0hBWgc" Content-Disposition: inline In-Reply-To: <20211230193652.33514-1-alpernebiyasak@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --gjXco3g9RI0hBWgc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 30, 2021 at 10:36:51PM +0300, Alper Nebi Yasak wrote: > On boards using the RK3399 SoC, the USB OHCI and EHCI controllers share > the same PHY device instance. While these controllers are being stopped > they both attempt to power-off and deinitialize it, but trying to > power-off the deinitialized PHY device results in a hang. This usually > happens just before booting an OS, and can be explicitly triggered by > running "usb start; usb stop" in the U-Boot shell. >=20 > Implement a uclass-wide counting mechanism for PHY initialization and > power state change requests, so that we don't power-off/deinitialize a > PHY instance until all of its users want it done. The Allwinner A10 USB > PHY driver does this counting in-driver, remove those parts in favour of > this in-uclass implementation. >=20 > The sandbox PHY operations test needs some changes since the uclass will > no longer call into the drivers for actions matching its tracked state > (e.g. powering-off a powered-off PHY). Update that test, and add a new > one which simulates multiple users of a single PHY. >=20 > The major complication here is that PHY handles aren't deduplicated per > instance, so the obvious idea of putting the counts in the PHY handles > don't immediately work. It seems possible to bind a child udevice per > PHY instance to the PHY provider and deduplicate the handles in each > child's uclass-private areas, like in the CLK framework. An alternative > approach could be to use those bound child udevices themselves as the > PHY handles. Instead, to avoid the architectural changes those would > require, this patch solves things by dynamically allocating a list of > structs (one per instance) in the provider's uclass-private area. >=20 > Signed-off-by: Alper Nebi Yasak > Reviewed-by: Simon Glass > Tested-by: Peter Robinson - Rock960 Applied to u-boot/master, thanks! --=20 Tom --gjXco3g9RI0hBWgc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmHiwEwACgkQFHw5/5Y0 tywkTAwAhzjNiMssdfxGREi1cgrqKyQ9IDNquH+XMY52MyvG9J4LrcEBnRJTn29j QZc3ZqlKUiyEBUeo1qqUYQKknaxHyek3as54FWJZ5t7iB/lCdLu/bEdVDGUrHrMK eGR9qDHwuib2FoaE57CVWGMrYaj/Iz6sdIQ8zbK45tmhzwb4X7l9SpZ/i8tIQm+y 6mvDSOnCQB52GNh83SgoaKx/HOtMNQ6Bs0C3RNDkHSHbxHLBhETW4O4i5MPX71t5 u21C1Kg6Ir2cOwvDPwCY6a+k7iNOWQ3ZijRlUXrKLseOw2Sg+V9XSQm7K59pJP3+ 7mS0jABWZDK4HeIXZbivwGizs8q5pYJZbkaJCF8fWocjg5PNr7BufQL98cmD3Qfi 6TvBnn/L30vmRP7rBrnUEIXl8cdrwo6U0gY8lNnv9eHL8yuz7Spc+FcEKqAjJszA AaGyXUqx0OQpQ7+bByHSmPZjKCbkKqzN/ratv44aG8meMywCYDXt+h3LHQprv9Lm 6mFhfRI3 =g51e -----END PGP SIGNATURE----- --gjXco3g9RI0hBWgc--