Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1719173lqg; Mon, 4 Mar 2024 01:19:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVb2dvsy8VIVD9x+8FM9clFkAFfSsBMjHSD3DJkVpnYZJE2JhRGsj8/tFyROpbsLDUdqh1+xF6s5QVjG8t5lhSLwdDMgEJuqcvZpy6tog== X-Google-Smtp-Source: AGHT+IExbBMe3ilV+ORfv29oaJ4RXznrh2CJAv4C1nP6pRa4eI2GUzgMLB7N6hNjPEs+U33wSlHZ X-Received: by 2002:a17:903:18f:b0:1dc:b7d2:d22e with SMTP id z15-20020a170903018f00b001dcb7d2d22emr10665699plg.18.1709543998502; Mon, 04 Mar 2024 01:19:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709543998; cv=pass; d=google.com; s=arc-20160816; b=Pmdwe6HmeGX27qsLvkTdiAvzyxyFGj51/oB+xXE/YDDluKEu1tLK34VBqSIEqpCyt9 dZpY04p4Slkk6B976Xbz/EDUJvgDnGMEd8dJRMpcYQ/Y6cqvtUAfz5jSEaFtEaR5lkG0 te0Q6buEZI5OWlQj0pg/r5H6BJ1vfPXklQDcmDEI3/b6SxnKNCG2ah4GHuXru2LQFW2j v2sbU4yUGJ5utiCEo1J2l0zP7t7aPi3ARUNAQreqiRytaT+sIGQLmGtN1Mt/MwOUtwQ3 NK1Q1AZq60s6tGB4FJIvqO7ICzTRpAnzn2C3qhahOZt06d+m5uE7H/xj7GLjouKcaQ+o +j+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FuwL+TMTYDKi4jfrJ8a6ACoib84TIF4JSzLdxvxrTgE=; fh=KXqGbIPO11bL3yyEHiu6mwxOlQ4kWz8KGhjea87T3FU=; b=J8KcpV1TMLi0Xg9RrWxE+oQvEns9nculC0UJPQgJzVNxbSefrK+4w6iUlF6h0sy93k FvNx9ka8Mf2wWMFnrWT4kliQfpkQgN6nVps/zVabjsaGglSpXzlvNFS4tAdykM5A93BS VKBdD0dlL5kiTeZNN3jJ72leaFkfRkAn684oBS096iawr4AGe2LcUoXzz+Z/8E4QH6P9 ppeVQSgEt+7HRpNb17Ku0vTBONJy2OhpXe+v2UIDiDAbjIUxHrfSovSrIVeg0ZImHrBl hIsjtv3dPJg/VM6GEOy/JgPVKh5uDw/RXNSyv/itdDKMV+qRbXmeal3bR7zob/kqj1xl 7WTg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NenlFay1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-90296-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90296-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l19-20020a170902f69300b001d8ecf3d0fbsi8419361plg.511.2024.03.04.01.19.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 01:19:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90296-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NenlFay1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-90296-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90296-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1AAA3283AD6 for ; Mon, 4 Mar 2024 09:19:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16223364C2; Mon, 4 Mar 2024 09:18:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NenlFay1" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2D9D72C840; Mon, 4 Mar 2024 09:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709543890; cv=none; b=skcJo4YL/R1QVzgEx+RAdYzDP0Qk4ZVUJagCGEVvCDPYDfauHLZ8mV2j5XynV9+vVPVFkr9FFKNG/yZZWtiHHiXf4dJBMS0HWhfRdds3ndtTO2FJVw5ts/6ojjOuWUDxGCpVcOriqKpr3/IbCspMi/w1BFUPuyfefFGYUKFl4X8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709543890; c=relaxed/simple; bh=2NE8g2addB4JbRzGr5d4FEp+f0iHBWz+jrXCpfZtwJQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=k0FxgjCGnlFgbTG9jcAZceqfS0zVnyzXJpnD+Z2GZSrLkDtBbVId0rQohZkvEEG46JkZoCdpuehEB81/8qqyVI2ch3N/YjXK86Fot6DUEEvoQCHdN1DHq23xrLeV9vfzqk4ZvdT0kSC7IKFECeeWSSArk3D0CxeFcvQqcL+g3XQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NenlFay1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C45EC433C7; Mon, 4 Mar 2024 09:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709543890; bh=2NE8g2addB4JbRzGr5d4FEp+f0iHBWz+jrXCpfZtwJQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NenlFay1MbxbJPHgLYvsg7O47VtPF6kw4AwX5TmQ7vPryNVNrM6qgfGylZQ5wUm1N p6sfyIKOmo039RTOvDQ7vXCjHVZkkNTOwRN0IVYd9X8CZVdLe6OOECVH/S8AwKn01p 1QELIvxo01dt4xoBTs2omBSR0DifRalsLaieDKNzL6PgG7oTGY6kOJp3zcnOXtztdp 3G3WLpDN6MyeWctiEL+6cKCCasoJIkcCpizPNjcn0QeqlVO3pT5wGVQkUWNGrY8ZcG d9fbzWOe/pmdiPBGVZDSHR3cyHkM+PRx1KD5IzzETy1OFnDP0pAMvQPDxZGp1YrZK8 XsizSg3llGdsw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rh4Sf-000000006L4-3Ei2; Mon, 04 Mar 2024 10:18:17 +0100 Date: Mon, 4 Mar 2024 10:18:17 +0100 From: Johan Hovold To: Anand Moon Cc: Christophe JAILLET , Alan Stern , Greg Kroah-Hartman , Krzysztof Kozlowski , Alim Akhtar , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/4] usb: ehci-exynos: Use devm_clk_get_enabled() helpers Message-ID: References: <20240301193831.3346-1-linux.amoon@gmail.com> <20240301193831.3346-2-linux.amoon@gmail.com> <3d1c7682-d163-4bcf-bd41-d7db0c8f61d1@wanadoo.fr> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sat, Mar 02, 2024 at 10:05:46PM +0530, Anand Moon wrote: > On Sat, 2 Mar 2024 at 21:19, Christophe JAILLET > wrote: > > Le 01/03/2024 à 20:38, Anand Moon a écrit : > > > The devm_clk_get_enabled() helpers: > > > - call devm_clk_get() > > > - call clk_prepare_enable() and register what is needed in order to > > > call clk_disable_unprepare() when needed, as a managed resource. > > > > > > This simplifies the code and avoids the calls to clk_disable_unprepare(). > > > > > > While at it, use dev_err_probe consistently, and use its return value > > > to return the error code. > > > @@ -260,25 +248,17 @@ static int exynos_ehci_suspend(struct device *dev) > > > > > > exynos_ehci_phy_disable(dev); > > > > > > - clk_disable_unprepare(exynos_ehci->clk); > > I don't think that removing clk_[en|dis]abble from the suspend and > > resume function is correct. > > > > The goal is to stop some hardware when the system is suspended, in order > > to save some power. > Yes correct, > > > > Why did you removed it? > devm_clk_get_enabled function register callback for clk_prepare_enable > and clk_disable_unprepare, so when the clock resource is not used it should get > disabled. > > [0] https://elixir.bootlin.com/linux/latest/source/drivers/clk/clk-devres.c#L75 > > I have also tested with rtc suspend & resume and did not find any issue. You seem to be totally confused about how devres works, and arguing back after Christophe points this out to you instead of going back and doing the homework you should have done before posting these patches is really not OK (e.g. as you're wasting other people's time). And you clearly did not test these patches enough to confirm that you didn't break the driver. Johan