From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBAE52F3622 for ; Tue, 16 Dec 2025 09:03:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765875840; cv=none; b=uioxy0p0KaTvufBMl7VfcINyTaIb5Gjrqnwf9Nok35ctEp2jsvaZV2gU0JwmTMtdlW3JqWZous51+RsgpMrvFY0Tz1iujzPlflar3RbL8FBuGsqxJ50s9T6EoiQmpH/1uPS/o3iHVYRS6XdjTDM4OQ5DQWcwprpyH2t24pvjlPc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765875840; c=relaxed/simple; bh=i9mu82VmE04PfNnD/qysnyH2w0m8QZb6icO8PtkEWY0=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=AnMQ7ldTGx1OcfX116kFrPUWDfafqKNQWNaGkjFbGNf/94r4W62OseFQdKH902xzqCbVpyEa3tAyqYPC13Ywoe4XY7ERtmySd7n8Ny52r8MSf1azTgCoC9Up0lDNusNe+np3Ll8rMLO+ybcqER9H8QO7WfSLPLoq7xJ5sJQg0OI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=e6Ae6j8V; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="e6Ae6j8V" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-430fbb6012bso1531239f8f.1 for ; Tue, 16 Dec 2025 01:03:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1765875836; x=1766480636; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=eEqpMcb6cgS7Ln6t+LliR4h4opbfD57z16EbPlvJgKU=; b=e6Ae6j8VY+a5MvetBoOPGPXMDSPqiI8XdQoRZ4ybNIG/SfiTCb6nJA09xH/kAFxcSy SoELfAY4PHYzjt6CF1sO/0rDQx3m92UU7NlbzYmLLsGB2zt7wvfYubAal4caK8HhkOaP vu5vTJVDNaLulN7MhDIBoHtamHdsUhSXtoiq7gbocHG7kqGGCHqdijqfCunETuX+Ah5n poDZFDfdn8SZi6bUFkHTdVh1aJ01ia2Zr4kOrP3m/xspoGC89Y+JM8GPgN8GgwKtekgR /5eIWyYpr6rbWdOyheEQwCRPlb9kzBEd5fMv9Rtht+LVb4ScOb/IvvJUoHN3cR3Qyf4M Az8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765875836; x=1766480636; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eEqpMcb6cgS7Ln6t+LliR4h4opbfD57z16EbPlvJgKU=; b=WX4sFZnV/dNrpvq0OaSmtVdWzYDi2+K8zndLEdS/20cNNsrhUN0dv4R2mMC+Oba902 5anHTV+00e/xbnsA0t6wkoMz8c3AcCUbmg0EAzgaVnClpwjjJ2N2RcN6fAwUWX3mesu4 yu5LmAX7fethTXKVWST434p10BkVaUeE2nic4iqJOmgn2hgyIkL5mHNX6XKC9dRT1mZ+ bI2d29EPthBXVtfNFYOu9Ilr+ON4377PMPY46fG7rCD6vwIoY1MRObk7FguieoGo7t55 QQRKMWq8VD0hV7IIadLria/c37iOdoPy4aBjj14jtwQMjr/lCrgAOoWiLdJc2u/PjGsJ fcQw== X-Gm-Message-State: AOJu0YyIWObDM53xOKDHz8aTEAIQyZi842of0KhRPkVuNUydhMNs2gkm njAaU8d0UPBPZCt04nE9WYf+PVjasurU0GWrqmX/cjGheQ+KcFJzqBlMrbJwpN12gaI= X-Gm-Gg: AY/fxX4mF4wBkHRIU1AUYqTrhO8I+LVYTFNIjcpyAKR8utfUaUebBZLCoDk8qbvGv6H AxO2pQSYpxHoWLRE45R1ZUfcmdhzsHuJxCQ5cMCfiPAeBVp+SlsHm3hi64X0I/Hr8vKHlpuoEcx DJXhuZQwZhA+A0xgaFaaEFiS4SrKiGQwwXJuRWQgf4l6pmhbZEdDDrkbc1d3o4iSYeWL/8Ti1zy 4WN/2qoBKM+8ZimAmc1e77k5B5srwTP3PmbW2frcDCqIKWUOJKYMlNFWlyHh4IOnKP6aY2UciHb BCaNlJAwWVVdJqBd2dr7Wf1/jVaHOYjtz9A7/h9eRWchD11LEdaadccmY8tpWmMTGwKT+VQX2VN 7AK72gqdQ+UbiQ5rJzwC4O4EYFd32HMXHm9+lF754L7nw37CcKKyJtmNf0j5Z8uxFFK8UYHNYJs eJheQ7sICTndqWJXpBBNM= X-Google-Smtp-Source: AGHT+IGvVbwc1Eu7YoUxDT3wnjEfax+tXv3FU38gBaWbleBqN1eUAIUnZs+hZhE6/kmwuoCwhjCwzQ== X-Received: by 2002:a05:6000:d82:b0:42f:b9c6:c89b with SMTP id ffacd0b85a97d-42fb9c6caccmr12457455f8f.50.1765875835567; Tue, 16 Dec 2025 01:03:55 -0800 (PST) Received: from [192.168.50.4] ([82.78.167.134]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42fb7118267sm26928277f8f.27.2025.12.16.01.03.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Dec 2025 01:03:55 -0800 (PST) Message-ID: <3d8896c7-9ba8-43f2-8464-a94acdf82ba3@tuxon.dev> Date: Tue, 16 Dec 2025 11:03:54 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Claudiu Beznea Subject: Re: [PATCH v2 0/2] reset: rzg2l-usbphy-ctrl: Add suspend to RAM support To: Biju Das , "p.zabel@pengutronix.de" Cc: "linux-kernel@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , Claudiu Beznea References: <20251110132715.724084-1-claudiu.beznea.uj@bp.renesas.com> <19fda177-6c11-45d6-9dab-3f75edceda4e@tuxon.dev> <50937606-46fd-4202-ad4b-9ede5bff76fc@tuxon.dev> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, Biju, On 12/7/25 13:02, Biju Das wrote: > Hi Claudiu, > >> -----Original Message----- >> From: Claudiu Beznea >> Sent: 05 December 2025 10:00 >> Subject: Re: [PATCH v2 0/2] reset: rzg2l-usbphy-ctrl: Add suspend to RAM support >> >> Hi, Biju, >> >> On 12/5/25 10:53, Biju Das wrote: >>> >>> >>> Hi Claudiu, >>> >>>> -----Original Message----- >>>> From: Claudiu Beznea >>>> Sent: 04 December 2025 18:26 >>>> Subject: Re: [PATCH v2 0/2] reset: rzg2l-usbphy-ctrl: Add suspend to >>>> RAM support >>>> >>>> Hi, Philipp, >>>> >>>> Could you please let me know if there's anything I should do for this series? >>> >>> If rzg2l_usbphy_ctrl_suspend() fails, What is the probability that it >>> will suspend again without any issue >> >> How can I measure this? >> >> The idea with this code was the following: if any instruction of suspend fails, the suspend is >> aborted, thus code in rzg2l_usbphy_ctrl_suspend() is trying to restore the runtime state of the HW so >> that no runtime users of it to be affected. This is also how core suspend code is doing, e.g. >> suspend_devices_and_enter(). > > After rechecking, the cleanup() in the suspend code making usage count unbalanced. > > Eg: > Suspend returns error with the following usage count incremented > > static int rzg2l_usbphy_ctrl_suspend(struct device *dev) > { > reset_deassert: > + reset_control_deassert(priv->rstc); > +rpm_resume: > + pm_runtime_resume_and_get(dev); > + return ret; > } > > > The suspend error code invokes device resume[1] and in that you are again calling > reset_control_deassert() and pm_runtime_resume_and_get() which makes the usage > count unbalanced forever. > > So, looks like the current logic in the Add suspend to RAM support patch is wrong. Seeing [1], [2], [3] being posted by you, and [2] following the same pattern as proposed in this patch, are you still considering the approach in this patch being wrong ? Thank you, Claudiu [1] https://lore.kernel.org/all/20251207124742.96526-1-biju.das.jz@bp.renesas.com [2] https://lore.kernel.org/all/20251208152133.269316-8-biju.das.jz@bp.renesas.com [3] https://lore.kernel.org/all/20251208101356.101379-1-biju.das.jz@bp.renesas.com