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 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 67A20CD3420 for ; Tue, 3 Sep 2024 10:21:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iJS4mKwDt71f+czvCGcc6KmwF1qHOE0EcsdjnmVJivo=; b=R3ClzvHA476dE42q36owx4m2/L udXGKJtNqs+QNje6e8vX0gXA2DCYChybaicoNfAalwPSIsGg72uWmQpbuDRX2vYSymNzmUiFwZ3z1 Ju6fPyvYVIB4ATWym1AohWOOSfo7PITZ9KHbpGXG9yNTA2Wuezn4iczKlsdOLNY0EpOzWkoIz9UGl pdrXhejhf1gstDAqGSthaX02PcHjkRtInB7pbzo0y34e+PnZhiS6brf/y8jke+Crb53OnbrbR2N2v BrYOS/Q2I7VTqJR0TfqgfiarAWs+U1GK/ZNVhgNGkEIgEA0tuF/BffuMaSlYybhRCrdY0O0XpaaHJ 0GIkHnUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slQeq-0000000HJoM-0GBo; Tue, 03 Sep 2024 10:21:08 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slQdZ-0000000HJQf-03mR for linux-arm-kernel@lists.infradead.org; Tue, 03 Sep 2024 10:19:51 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-53345604960so5923616e87.3 for ; Tue, 03 Sep 2024 03:19:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1725358787; x=1725963587; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=iJS4mKwDt71f+czvCGcc6KmwF1qHOE0EcsdjnmVJivo=; b=N/McP+7NMUyXs2v01Of7mJyGOuPH5I9UdfxnnYERHQkIVEUPS4P4jAJhO5Jder8i0L QBbpCRBvRG9YcVoFwzNpfSF4y/VHPm8R/EAUI30onTy151xv+y/ujNERJH9VjYDi4bet THooh5KEUqWb2IIq2i52tM6UgcBX6/Y3mXddw3TvgG5nFhLeSNsAinhyiPLTz4RTQtIj 3NqTAc0UYsAjTVjbTHrX0O1mREKTrYjysztcAn/mrvFezwH2OunTvIvvz+AbPPkfq7hF fkJ8GEZRqdwMB9UdOUT5t8zZDXLWY9oBdrqHA9sSzedYPdnikTRCj02THZHaeudHbMV7 vgaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725358787; x=1725963587; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iJS4mKwDt71f+czvCGcc6KmwF1qHOE0EcsdjnmVJivo=; b=og2XDexdEECW90jqPwaCEKdbCMQ4ViXViLLkAvsT6dXF7yz7p5r52SfR2JYLg3DELD Yt8UycNT7ddmGilyk8M83q2rot7yiG/irGDLP0cOO+mkRCS8ClTuFTo7ocpBZ1yJTVMJ gRkmI8fSHb7PgHmQKwSikzPBTR4ZqAvfhlpH7uVFPWvO83t+MzolCVnoI8+Xrk6cpq5T SdeuIesO1yFG4FZIwXnPVC0RSi+9567U/iLGYMRALTghTp1rCLOZ5yBLiKuwBPm1ozE+ SdiFozJZwRgtEuK84G4ZsECvtZo0E+sqwsPov/uht85B+7wUviHpauJwev48hQa8bdqh hjRA== X-Forwarded-Encrypted: i=1; AJvYcCUCthTGytCzqghb2gcaV9XoEDmUE0MTHu5iY02BugZxU6RaFuX9qfcNy8uOFluVJFec6vCSX0u0DHrs0+bEb2Vr@lists.infradead.org X-Gm-Message-State: AOJu0YxPCovt4WM8d8YZeSBG6wAZcS7Pw2qOmAYAqsq6IfKGvns4afEC CrqynqjUxg2Aij/Gms+X8B5e0bze6VXUO1U0gC6nWWdzG7WQJQUCykpwMaVmBdQ= X-Google-Smtp-Source: AGHT+IEls7cIQ+6hQSbZxyc8bV5YfWpE5Og0ZDGcEK0Z3VxswtkW6lt0WU0csWHFdZCyWxXy9FAPkw== X-Received: by 2002:a05:6512:108c:b0:52e:7125:c70a with SMTP id 2adb3069b0e04-53546b93fd9mr8417306e87.47.1725358786595; Tue, 03 Sep 2024 03:19:46 -0700 (PDT) Received: from [192.168.50.4] ([82.78.167.144]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8988feb0e5sm675067666b.12.2024.09.03.03.19.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Sep 2024 03:19:46 -0700 (PDT) Message-ID: <4cb2f788-1ba6-40f6-a48d-1fd2e5293aa8@tuxon.dev> Date: Tue, 3 Sep 2024 13:19:44 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/16] Add initial USB support for the Renesas RZ/G3S SoC Content-Language: en-US To: Biju Das , Ulf Hansson Cc: "vkoul@kernel.org" , "kishon@kernel.org" , "robh@kernel.org" , "krzk+dt@kernel.org" , "conor+dt@kernel.org" , "p.zabel@pengutronix.de" , "geert+renesas@glider.be" , "magnus.damm@gmail.com" , "gregkh@linuxfoundation.org" , "mturquette@baylibre.com" , "sboyd@kernel.org" , Yoshihiro Shimoda , "linux-phy@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-clk@vger.kernel.org" , "linux-pm@vger.kernel.org" , Claudiu Beznea References: <20240822152801.602318-1-claudiu.beznea.uj@bp.renesas.com> <99bef301-9f6c-4797-b47e-c83e56dfbda9@tuxon.dev> <5556d176-cca7-492c-ba21-48256d5d6338@tuxon.dev> <590a4fb2-24b2-432b-92db-534c5a52ed0b@tuxon.dev> <35dc7414-f5bd-4ed4-bfa1-f723f4f0078c@tuxon.dev> From: claudiu beznea In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240903_031949_113120_F479DDF4 X-CRM114-Status: GOOD ( 27.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 02.09.2024 13:47, Biju Das wrote: > Hi Claudiu, > >> -----Original Message----- >> From: claudiu beznea >> Sent: Monday, September 2, 2024 11:41 AM >> Subject: Re: [PATCH 00/16] Add initial USB support for the Renesas RZ/G3S SoC >> >> >> >> On 02.09.2024 12:18, Biju Das wrote: >>>>>>> Do you have any plan to control this power transitions(ALL_ON to AWO and vice versa) in linux? >>>>>> As you know, the RZ/G3S USB PM code is already prepared. This is >>>>>> also configuring these signals when going to suspend/exiting from resume. >>>>>> W/o configuring properly these signals the USB is not working after a suspend/resume cycle. >>>>> One option is to handle SYSC USB PWRRDY signal in TF-A, if you plan >>>>> to handle system transitions >>>> there?? >>>> >>>> As I mentioned, the settings in these registers may be changed by intermediary booting >> applications. >>>> Depending on that, Linux need to control it also on probe for USB to >>>> work (it should be the same with PCIe, these signals seems similar from HW manual description). >>> You mean system transition settings will be override by U-boot, so Linux needs to restore it back?? >> >> It was talking about booting... > > I am also referring to boot. Boot starts with TF-A and it has a system state. > >> >> You proposed to handle SYSC signals from TF-A in a discussion about system power transitions: >> >> "One option is to handle SYSC USB PWRRDY signal in TF-A, if you plan to handle system transitions" >> >> (I was guessing the "system transition" statement there refers to power states transitions, ALL_ON <-> >> AWO/VBAT) > > That is correct. > >> >> and I gave the booting process as a counter example: if we handle it in TF-A it may not be enough as >> these signals might be changed by intermediary booting applications (e.g., U-Boot). > > Why should U-boot override, system state signals such as USB PWRREADY? Can you please give an example. I didn't say *should* but *might* and I was referring to a hypothetical situation where any used application (bootloader) might trigger this signal for whatever reason. My point was to let Linux to handle all the settings that it can do for a particular functionality. The resisters in SYSC address space controlling these signals are accessible to normal world compared to others in the SYSC address spaces. > >> >> To conclude, there are 3 scenarios I see where these signals need to be >> handled: >> 1/ booting >> 2/ suspend to RAM >> 3/ driver unbind/bind > > --> It should be OK as linux is not handling USB PWRREADY signal. > >> >> In case of booting: if we have TF-A to set signals there might be intermediary booting applications >> (e.g. U-Boot) that set these signals also. If it leaves it in improper state and Linux wants to use >> USB then the USB will not work (if Linux doesn't handle it). > > That is the problem of U-boot. U-boot should not override system state signals such as USB PWRREADY. U-Boot can also use USB as well. > >> >> In case of suspend to RAM: as TF-A is the only application in the suspend to RAM chain, it should work >> handling it in TF-A. > > That is correct, TF-A should handle based on system state. > >> >> In case of unbind/bind: currently we don't know if these signals introduces any kind of power saving >> so asserting/de-asserting them in Linux may be useful from this perspective, if any. > > These are system signals, according to me should not be used in unbind/bind. It can be done whatever way. I would just prefer to work for all scenarios. Thank you, Claudiu Beznea > > I may be wrong. > > Cheers, > Biju