From patchwork Thu Dec 5 10:22:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13894943 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32F58E77170 for ; Thu, 5 Dec 2024 10:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:MIME-Version:Subject: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=NCG9ppJ65ZW1EkiFhmBms8xBi+sSNxHOEke85QKlKdQ=; b=0ClI/3s6O4Ges2 LHWOm3TYOrmr89Oi7Bg24Xkq5z9bS035w31zSJOQBIRWvckmvWNoqKixrPCvnQne5I0Ai/OB7wLuO N6zrXGnVEXhCe1sM3vQcvucOJcgSmjO1zQ0rbgI9U+0Br/9mp4Gcnexo+bjiCD21AgdFJK/+DxXMr urrUY9Uzs85PhUTEm2Bjmj3lYcSjEw77/hMCifY+Xi2s8O/x9U/nnTkQj5AA9MY0ycUnEgcL/eAqy rs29Gte7nrsA6VmmC/TMUK7eJpN33PnsoHZADCHxfR9ZSfnO6+JN0PQ/wBvw2b6XVoZcbL643py9E yhZrO/h60qEger9MFhgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tJ8zl-0000000FUfW-3jjK; Thu, 05 Dec 2024 10:22:05 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tJ8zi-0000000FUeR-1Ulm for linux-phy@lists.infradead.org; Thu, 05 Dec 2024 10:22:04 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-aa530a94c0eso143842666b.2 for ; Thu, 05 Dec 2024 02:22:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733394121; x=1733998921; darn=lists.infradead.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=C2qCz2oyAWXcySnvC/YTGdboyjGwCf8uvEh34M5NQ1w=; b=wF17t4K4IftoUAXPknb5x8rNCjdBBerbbAuNenYo5VxXXsDpy7sJT6WCl4vnbh7VGj mYHOfBx9AR5kPs61CjA75Mk0JAMjvRXPG0ZGpWmnLYHUeHgk1vt+gwqyPKtUZeNYOOJ3 IpHcuQ+HJTnfPrkw2b3rdJNwb98ME/YSSZwrZjSGlI3e0LkNdWtQ2EBKbu4lvnuA0UHA 2uVMpdV/u5bt/YqcY/cfct8EJ6lvmEA10Weel5Xc7Psaqs0NEPvMo1hZK6hi6Fh5WlUp /+HT+KFkEhGSFy3mpgEu3hbCzQ/V8WTTJONJqWEwOlJeAv2ulHiQaG9Vs6OollyC4wHf c3gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733394121; x=1733998921; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=C2qCz2oyAWXcySnvC/YTGdboyjGwCf8uvEh34M5NQ1w=; b=AgNzvMaArf9oemF1u1bEIqsxl4+yOmKllakKvzElS3ZGmFbiBso32ogmRdBw+IvW6u wgIRzl7PtQWHJDhfHcHqdUdcwSrH/u3fi55o+VKoeG460qeEilR0m34rvFMZLsnjmpAJ 7B1KBRB/4mhxa4p0gIgiI8599oSC2ig863TW3MqpngSUYrvtb4Fl0JBJhmK1Mn4kS3gN 65+pHBrSReohI32hKUEn6jfUt03Gcd8fpXwUVhcjz4KdcQ26/p1dnHFscQBptirKAVli Sigcte52hC1G5ZBAgy6IgPDjDEfpjFRvP0y1kL7fFUp4xIx0YbeEe5p58bJoVu17KXFs 05Kg== X-Forwarded-Encrypted: i=1; AJvYcCX3OGjBF6eKWCbkn49CiW5p1rcxOm/3kmcDyRAMQ4aFXX+KPl6hiehI239vnuae+k7MB8c6vCFNF8E=@lists.infradead.org X-Gm-Message-State: AOJu0Yz4f0DM2r/9kNcvJfYnYMWIHqAUP3YWHFFBhIAT/trxK6ClUwLc AJKByy0c1KIWHmTyhp7pfm55V86CF6MHXjgSWjsZIjIQEowFDO7OPW1J+Rdgp94= X-Gm-Gg: ASbGnctMC7ZQHdUKcDI36MY9j28N+lcbkTAt9k/+2lNvvaTxl3mwyIaxs1oirkUAwPd NPsqtNk4sSyY4cof6Ybd/P3KSrWvRBhRX5cbx/5wqW+tWuPNoysSSoKy/yvtTh2nlp2dt9+rgOU G5IxhJXw2tCZ1Y0JO/Lbz66svt+On9o1FCHUXNz7bIjkBZypFPGht9NUx7E9s6EQZgWwQXHmwm9 Htb860vXMK0uF3UDqzfN2TwxMgnV7b15fGKfHVXegvfTe969oZ/Lhext3RKRYDGCDdKBLv5qVep FmAanr7kVNsEoSjsMgcZcHpjNkNYyXGPdA== X-Google-Smtp-Source: AGHT+IGIzS6w8nmzLwTehZGRCWLb5o+CLPa7VmxDEuLmOqo4b1mzG0cAAJu2wok4wnlPx8fiTWLtkA== X-Received: by 2002:a17:906:3d31:b0:aa5:41b2:e23e with SMTP id a640c23a62f3a-aa5f7da9717mr766598566b.30.1733394120780; Thu, 05 Dec 2024 02:22:00 -0800 (PST) Received: from puffmais.c.googlers.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa62608f57fsm71606166b.146.2024.12.05.02.22.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 02:22:00 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Thu, 05 Dec 2024 10:22:00 +0000 Subject: [PATCH v4] phy: exynos5-usbdrd: gs101: ensure power is gated to SS phy in phy_exit() MIME-Version: 1.0 Message-Id: <20241205-gs101-usb-phy-fix-v4-1-0278809fb810@linaro.org> X-B4-Tracking: v=1; b=H4sIAMd+UWcC/x2MQQqAMAzAviI9W9iqA/Ur4mFq3XpRWVEU8e8Oj wkkDygnYYWueCDxKSrbmqEuC5iiXwOjzJmBDNWWjMOg1lg8dMQ93rjIhTQ513hvqpY85G5PnPX /7If3/QBAd16DYwAAAA== To: Vinod Koul , Kishon Vijay Abraham I , Krzysztof Kozlowski , Alim Akhtar , Peter Griffin Cc: Will McVicker , Tudor Ambarus , kernel-team@android.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Krzysztof Kozlowski , =?utf-8?q?Andr=C3=A9?= =?utf-8?q?_Draszik?= X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241205_022202_403001_35D8F854 X-CRM114-Status: GOOD ( 11.16 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org We currently don't gate the power to the SS phy in phy_exit(). Shuffle the code slightly to ensure the power is gated to the SS phy as well. Fixes: 32267c29bc7d ("phy: exynos5-usbdrd: support Exynos USBDRD 3.1 combo phy (HS & SS)") CC: stable@vger.kernel.org # 6.11+ Reviewed-by: Krzysztof Kozlowski Reviewed-by: Peter Griffin Signed-off-by: André Draszik --- Changes in v4: - separate this patch out from original series - Link to v3: https://lore.kernel.org/all/20241205-gs101-phy-lanes-orientation-phy-v3-5-32f721bed219@linaro.org/ Changes in v3: - none - Link to v2: https://lore.kernel.org/all/20241203-gs101-phy-lanes-orientation-phy-v2-5-40dcf1b7670d@linaro.org/ Changes in v2: - add cc-stable and fixes tags to power gating patch (Krzysztof) - Link to v1: https://lore.kernel.org/all/20241127-gs101-phy-lanes-orientation-phy-v1-6-1b7fce24960b@linaro.org/ --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) --- base-commit: c245a7a79602ccbee780c004c1e4abcda66aec32 change-id: 20241205-gs101-usb-phy-fix-2c558aa0392a Best regards, diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c index c421b495eb0f..e4699d4e8075 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -1296,14 +1296,17 @@ static int exynos5_usbdrd_gs101_phy_exit(struct phy *phy) struct exynos5_usbdrd_phy *phy_drd = to_usbdrd_phy(inst); int ret; + if (inst->phy_cfg->id == EXYNOS5_DRDPHY_UTMI) { + ret = exynos850_usbdrd_phy_exit(phy); + if (ret) + return ret; + } + + exynos5_usbdrd_phy_isol(inst, true); + if (inst->phy_cfg->id != EXYNOS5_DRDPHY_UTMI) return 0; - ret = exynos850_usbdrd_phy_exit(phy); - if (ret) - return ret; - - exynos5_usbdrd_phy_isol(inst, true); return regulator_bulk_disable(phy_drd->drv_data->n_regulators, phy_drd->regulators); }