From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE177132C17; Wed, 24 Jan 2024 20:18:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.154.21.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706127530; cv=none; b=oTms3oBYxSN/p+F/vHKd68EYWi+gP6Rd7c84H+KNLw1jpjJDd+AMFQwk76alYiei1e/mQO7ynF9FVHG32oioXUcCH1h0xV6/nxI5yIr6AtriRvH/AUEZRhdZJDOAxKAtJqg0NHXm5ZD74qZ1vxzT9qkx4RxbCv8qLsF/Y4hrEdY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706127530; c=relaxed/simple; bh=RZpp6IHx31AhesQ6a89N4n47chb3EOWzqHq8eqcwoqM=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=XeBrwM81nEfjiQ/Ak9/M5Zo3j0rV44sOE1wfl5ra1yf9oS/qzznEgNH/NYqTmqsUg1iZaOFwhm8tN4JnUePgPRxEUFXbwWSKaw9837JsoEnZZYBt5wAcp4vlwOzfigFKmYaxIUJWu5x02F1sdEcOJylQARBHFz3r12YPtfrsC9U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru; spf=pass smtp.mailfrom=omp.ru; arc=none smtp.client-ip=90.154.21.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=omp.ru Received: from [192.168.1.105] (178.176.73.201) by msexch01.omp.ru (10.188.4.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Wed, 24 Jan 2024 23:18:32 +0300 Subject: Re: [PATCH net-next v4 10/15] net: ravb: Move delay mode set in the driver's ndo_open API To: Claudiu , , , , , , , CC: , , , Claudiu Beznea References: <20240123125829.3970325-1-claudiu.beznea.uj@bp.renesas.com> <20240123125829.3970325-11-claudiu.beznea.uj@bp.renesas.com> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: Date: Wed, 24 Jan 2024 23:18:31 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20240123125829.3970325-11-claudiu.beznea.uj@bp.renesas.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: msexch01.omp.ru (10.188.4.12) To msexch01.omp.ru (10.188.4.12) X-KSE-ServerInfo: msexch01.omp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 6.1.0, Database issued on: 01/24/2024 20:03:06 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 59 X-KSE-AntiSpam-Info: Lua profiles 182912 [Jan 24 2024] X-KSE-AntiSpam-Info: Version: 6.1.0.3 X-KSE-AntiSpam-Info: Envelope from: s.shtylyov@omp.ru X-KSE-AntiSpam-Info: LuaCore: 7 0.3.7 6d6bf5bd8eea7373134f756a2fd73e9456bb7d1a X-KSE-AntiSpam-Info: {rep_avail} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: {relay has no DNS name} X-KSE-AntiSpam-Info: {SMTP from is not routable} X-KSE-AntiSpam-Info: {Found in DNSBL: 178.176.73.201 in (user) b.barracudacentral.org} X-KSE-AntiSpam-Info: {Found in DNSBL: 178.176.73.201 in (user) dbl.spamhaus.org} X-KSE-AntiSpam-Info: 127.0.0.199:7.1.2;omp.ru:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.73.201 X-KSE-AntiSpam-Info: {DNS response errors} X-KSE-AntiSpam-Info: Rate: 59 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror smtp.mailfrom=omp.ru;dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 01/24/2024 20:07:00 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 1/24/2024 5:13:00 PM X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit On 1/23/24 3:58 PM, Claudiu wrote: > From: Claudiu Beznea > > Delay parsing and setting were done in the driver's probe API. As some IP > variants switch to reset mode (and thus registers content is lost) when s/registers content/the register contents/, perhaps? > setting clocks (due to module standby functionality) to be able to > implement runtime PM keep the delay parsing in the driver's probe function > and move the delay applying function to the driver's ndo_open API. > > Along with it, both delay specific functions were kept together. > > Reviewed-by: Sergey Shtylyov > Signed-off-by: Claudiu Beznea [...] > diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c > index 8956c33c60e2..69d4854d6738 100644 > --- a/drivers/net/ethernet/renesas/ravb_main.c > +++ b/drivers/net/ethernet/renesas/ravb_main.c > @@ -1800,6 +1800,59 @@ static int ravb_compute_gti(struct net_device *ndev) > return 0; > } > > +/* Set tx and rx clock internal delay modes */ > +static void ravb_parse_delay_mode(struct device_node *np, struct net_device *ndev) Wait, why are you moving this? Its call site didn't move -- it's still down in the probe() method... [...] > @@ -2785,10 +2793,7 @@ static int ravb_probe(struct platform_device *pdev) > if (error) > goto out_rpm_put; > > - if (info->internal_delay) { > - ravb_parse_delay_mode(np, ndev); > - ravb_set_delay_mode(ndev); > - } > + ravb_parse_delay_mode(np, ndev); > > /* Allocate descriptor base address table */ > priv->desc_bat_size = sizeof(struct ravb_desc) * DBAT_ENTRY_NUM; > MBR, Sergey