Received: by 2002:a05:7412:d002:b0:f9:9049:d2ea with SMTP id bd2csp47545rdb; Wed, 20 Dec 2023 03:41:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdl6t6Xfihmzi86cqUSPtShn808Kyc9Exuy4hjEIm6CUjhgbOph0H2y8b2MPmfEx2QgfZh X-Received: by 2002:a17:903:2281:b0:1d0:ae31:9202 with SMTP id b1-20020a170903228100b001d0ae319202mr13550976plh.39.1703072516996; Wed, 20 Dec 2023 03:41:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703072516; cv=none; d=google.com; s=arc-20160816; b=mpDBwbzjSezMCok7RoiX8kLiKJmd/EnizzpSJZifoEhdghlJrlnpny3RJ3Esukt/SV KU4UkvtVo3iC/hFs3MyWASyAmM1jX91Hc7AcLUNnYx3eT7CMIsFzVRBiI+g9YZj2w5qD ezCA5GR4SXab2jldaDDwSTi8Q0/st8TDmSi5TxjTeU6t07xHb7BM92j9frMrqk9D0l3V /iSofY/tmktLr/T+YiSVVOAU84hpTGwsTemV2rBwMHZw1xWXsOf76pzk0GmPWz9pK3TG 2RJ79pHvVTgF+kLYr2noLmb61eORznwdGmvn+dlcWC1y5xsQTzpnEdg2cvlGxjT+PsSR b8Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=SZWhqtv1uYgAtrEvWORH5Jkai5M2Z/ROl6KfWhfHkKU=; fh=Zs9heDXFvZV9HI2BdVOdlA7f+iIYUd31UrmGbPpJMGY=; b=dZzb1yHS1+bYJ7hsAXm0ceznTym4z6T8bBA/6Rx+Qq9VbkyA5iXG6GthWhan1FUTQZ Zxac302Clftk52Ey36nJO4rdP/4EUVCEjyVL0W/lzu4pFfGqv6522WkhI5EuVxnAYMP8 QpS/SsnzR6LjuxFmgimXUhLHgJzhwweJ286bb2lkL0S/jZqInqkZv1J1zQ7lJ+6AM7Ea w2dFuuwPLNv2ICtGLieQbzZvuw5j0U6f7+IzPB5R/6pRmoeXcGmmUUyL7ZHzhoSYkuzI QJCx/wB4+387JZ+bDn2KmwyJY03Ds+hulLhpbSmOHmKZHvAE5KBmDbo49erxOCrp+A7i HPrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=hCIQKu+V; spf=pass (google.com: domain of linux-kernel+bounces-6836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6836-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u4-20020a170902b28400b001d3e36edfe1si2374785plr.466.2023.12.20.03.41.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 03:41:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=hCIQKu+V; spf=pass (google.com: domain of linux-kernel+bounces-6836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6836-linux.lists.archive=gmail.com@vger.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 52971B241BE for ; Wed, 20 Dec 2023 11:41:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 50BA6219EE; Wed, 20 Dec 2023 11:41:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="hCIQKu+V" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 D1AA52230D for ; Wed, 20 Dec 2023 11:41:22 +0000 (UTC) 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 Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40d38f03712so1805305e9.2 for ; Wed, 20 Dec 2023 03:41:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1703072481; x=1703677281; darn=vger.kernel.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=SZWhqtv1uYgAtrEvWORH5Jkai5M2Z/ROl6KfWhfHkKU=; b=hCIQKu+Vbkex63tChfosUR/zvPPmw6Hgoz9w9dgx8GYL58b5wM6+5PhSZbIAqqxRE1 5e4t3mYaXvvLzC4MK3+Q70+hWDNmhtOU9dW0tNa97vMIwD/ymWvpzsEYW+ZhF3mYRwgt 33B4Icep/S83qd8FvEa7KJ6zwiflKWri63WZosr2J0ZmMnRSOCFPSk4J5hzVluiz6FP8 0il8U5fYQf+ZWV0r7sfBahOPWGtz9XAcBwN3fn4S/IIbM4WtXKWsnk+CgIfy2Gd7dF2K C806ZRENcOhTY2QP9iMfXJ/aOUzH/sV9SEtxdQy2GiuQO7cU/QmYgXQX9feCeOojev2c jZqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703072481; x=1703677281; 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=SZWhqtv1uYgAtrEvWORH5Jkai5M2Z/ROl6KfWhfHkKU=; b=VBr/JaLXaKWPKT3Rs2HoxbFhvlOGrtyvtNLU8g90eysvVfsLdsOqGeFLYaRcmrOOD0 A8KS3fj4Hprh6oFIXhlb9iy+ra3Y4l4VkddtHTsNZDuFwxqNdTkbFgNIXQEnIW8Nx08Q Rz6k5WmwHBfxvuM/TX0P1zYBorIIfJOq+m/LApvJVuM83SANwqhPWqLobNWbPfeyQT6v XNsw+ufuHFE8OL/oxquQb7455zglwsdTiQmY9XqPx6tOXq0Y2+qwt9NZpYjE1DcUn85R 4YCyuNAYp9PzxqDLUfCnFz76g+03xaJWUwwTyW9Xoa+Vl+puFHrnYMwImubNf+OPrQZh 7B/Q== X-Gm-Message-State: AOJu0YzX/qUeYWmd+u+Fo/wIxLRrzH7G9wgm50WTf0WUN4236N4BTnHh K8HiJIR2uMMZOuWOzxAnKZKrDw== X-Received: by 2002:a05:600c:1688:b0:40b:2a53:7913 with SMTP id k8-20020a05600c168800b0040b2a537913mr9715344wmn.13.1703072480998; Wed, 20 Dec 2023 03:41:20 -0800 (PST) Received: from [192.168.50.4] ([82.78.167.103]) by smtp.gmail.com with ESMTPSA id z5-20020a05600c0a0500b0040c2963e5f3sm7135141wmp.38.2023.12.20.03.41.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Dec 2023 03:41:20 -0800 (PST) Message-ID: <3d4511bd-fd96-4281-a5cb-ac1765bded31@tuxon.dev> Date: Wed, 20 Dec 2023 13:41:18 +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 Subject: Re: [PATCH net-next v2 11/21] net: ravb: Move DBAT configuration to the driver's ndo_open API Content-Language: en-US To: Sergey Shtylyov , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, p.zabel@pengutronix.de, yoshihiro.shimoda.uh@renesas.com, wsa+renesas@sang-engineering.com, geert+renesas@glider.be Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Claudiu Beznea References: <20231214114600.2451162-1-claudiu.beznea.uj@bp.renesas.com> <20231214114600.2451162-12-claudiu.beznea.uj@bp.renesas.com> <4721c4e6-cc0f-48bd-8b14-4a8217ada1fd@omp.ru> <59ba595a-ab79-cc5d-feff-dad60e80c44f@omp.ru> From: claudiu beznea In-Reply-To: <59ba595a-ab79-cc5d-feff-dad60e80c44f@omp.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 19.12.2023 20:54, Sergey Shtylyov wrote: > On 12/17/23 3:54 PM, claudiu beznea wrote: > > [...] > >>>>> From: Claudiu Beznea >>>>> >>>>> DBAT setup was done in the driver's probe API. As some IP variants switch >>>>> to reset mode (and thus registers' content is lost) when setting clocks >>>>> (due to module standby functionality) to be able to implement runtime PM >>>>> move the DBAT configuration in the driver's ndo_open API. >>>>> >>>>> This commit prepares the code for the addition of runtime PM. >>>>> >>>>> Signed-off-by: Claudiu Beznea >>>> >>>> Reviewed-by: Sergey Shtylyov >>>> >>>> [...] >>>>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c >>>>> index 04eaa1967651..6b8ca08be35e 100644 >>>>> --- a/drivers/net/ethernet/renesas/ravb_main.c >>>>> +++ b/drivers/net/ethernet/renesas/ravb_main.c >>>>> @@ -1822,6 +1822,7 @@ static int ravb_open(struct net_device *ndev) >>>>> napi_enable(&priv->napi[RAVB_NC]); >>>>> >>>>> ravb_set_delay_mode(ndev); >>>>> + ravb_write(ndev, priv->desc_bat_dma, DBAT); >>> >>> Looking at it again, I suspect this belong in ravb_dmac_init()... >> >> ravb_dmac_init() is called from multiple places in this driver, e.g., > > It's purpose is to configure AVB-DMAC and DBAT is the AVB-DMAC register, > right? It is. But it is pointless to configure it more than one time after ravb_open() has been called as the register content is not changed until IP enters reset mode (though ravb_close() now). > >> ravb_set_ringparam(), ravb_tx_timeout_work(). > > I know. Its value is only calculated once, in ravb_probe(), right? right > >> I'm afraid we may broke the behavior of these if DBAT setup is moved I was wrong here. DBAT is not changed by IP while TX/RX is working. > > Do not be afraid! :-) > >> in ravb_dmac_init(). This is also >> valid for setting delay (see patch 10/12). > > I don't think there will be a problem either... but maybe we > should call it in ravb_emac_init() indeed. > > [...] > > MBR, Sergey