From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 F274536A35A for ; Fri, 12 Jun 2026 17:49:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781286598; cv=none; b=tr/C3mH3nMBB2fiJrPCx5iopq2uve0ujbMO5xV892ZIt4zUVo9GsBkivNzdzvjeHEgC1nwLStZ36WXWaIvU2eI0mqiF9aKRS8i+rQZVYA7CDhjWx62p5hBmd+eku7cNpSOEJ9xQP6la9VmGnt2rKjbt1cGd0qcDa1UwvY+I3mf0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781286598; c=relaxed/simple; bh=h115VTK6dungfQ4qIdCxA3kCKtoEZBfHb83D7Vo31gU=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=gMyqML6Vb8F6YvxENOR3+YlLoiTWhZ9AlOtDfHFR7NeD9qRBXNZQpKZZHz71XwyzxyRgDcgnBgNF8TB63AwUq7ZbjSLDNod+nODM76hFvqk+3j/961IN2/iIhcADucEE8KCbq38VWxEOAKtJJfmc3R6dDbpSHOd0KsM0wmX7Ziw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NO29Eynd; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NO29Eynd" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-490bb83a3f6so10276765e9.0 for ; Fri, 12 Jun 2026 10:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781286595; x=1781891395; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=C85wBIXdmOAkbGAX37TSwTaJxl8p7p/GigMbGhAuSmc=; b=NO29EyndaZTP4L9bwqRYnxiwYwu3iC3bkQTJe8JVl/jCSqZDwSLYVhxRAxAAlsZnGq z8ovA9kxiRPX3uNCAtCQQk/40+Vi6nSJYfNxnTHyn0BNUkMogapVhueSRGrJfmlWkluu 70Hv+BtE2YYQexNE03azSY4wCAmx8xs/khlZlG7yrX2zCOxYfp1PcbpXYhcH3pVxu8hE 1DBjU81toTHYhFse6lhVRyRKCjP4ZBwNZrmUtSNlAUItk9V8115ndCndbEM0uR8d0LFW wom8KKabJYaS0GivkOV0K4ZgeDirCDMp4OqtqGEJSDg1kbnLQrYsMmpIhisaLIjwv5fU hQRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781286595; x=1781891395; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=C85wBIXdmOAkbGAX37TSwTaJxl8p7p/GigMbGhAuSmc=; b=REXh9XefCse/59P1pUDl3oxtTYwtQ8NzAp2U6z7qQvkaoPDq4TuCzWDTJplydVmhDY i0eGoiUhk/nkiIRBIykydrn9wGBHLLJzuBczVpHVzvPLEZy8IT2eXSmYjwpQCP/d4Ltd Qm95AEE44TqUVBL1OSdbaH8cnJShb2EGPA7HhsiOXxupbjIdnQ65fKzSX0PEzSse1+mG dYa2Vsnip7zXLK0sm/4A4ArAGrpce539Ai7kfrnk9NHUZ50XOvML3regYF57FK/V2zce Y36Yvrny8buQRfkfJOUuVwpyxJfFuf2AC4qLcQr+j8HfdhiPbjeICrvNu15PnrzXqvHo 1BIw== X-Forwarded-Encrypted: i=1; AFNElJ8GT/6hCbXjfJnTnlFVGTaABmgzstyuOkMMcEq+RIep0ZZKVzo3ylqIfEjVhLQFPG0Gwojl8zQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzR3gtmkUxBVmff4+reOMSrFp/JM19J7tl+6NDv7Ll8JBL7YYoZ 4jihnIOnNM7Op7tbV2fgBHJ6A/jW4lViy/M+s+fsSLoSB9YRcdPjg20O X-Gm-Gg: Acq92OH3tLeCsL+jKuT8vZ/Lorw1W9A3O80ZcKUsfgoaQK30uomEcy1NTvnkvVu9VEN C4aUF83laplTTNju3MYVR6PK6C+kA2D1OmVzi0Dp3P4sMfIgcQxH6/MlvPrtGDQ8HmZKvyx7c4l kVq1X4J4BXlcyFO34aReiPHcci2XzIoU2j+ToGm5h61XS7hwEeDpXIVeCl0375Tpa2Opx5vp5Dg q6mZQ8f2NNJmxF1gbjoq0CZn52FZAN4/6szqI/GbO6IvorcAxZDV5RV8/0tyRqt5kJt/31hO9Lw UbuvO0bE16IbKXixaHDQlynt8Pv0ETapYRZ3LPksbLrjOEFcbAKlg0zTbtJQXATgTEIbnzay6kY c/OWX5I4epFMbbLShJbGp6hI2rWxnrVQpZmij/g9jl1AlOeR3r+WoVfXV0fbFTl4gFvb6pazV2d fWWpXI/k2/I7vSoAt2o4wC7vwR2p1ecMe84ljJ59mIH9JGeN4E+Ncc9LOGKVyWv2kqEen+59CJ0 N4= X-Received: by 2002:a05:600c:820c:b0:48e:5d91:cfe3 with SMTP id 5b1f17b1804b1-490ec4cd08fmr53203395e9.1.1781286595100; Fri, 12 Jun 2026 10:49:55 -0700 (PDT) Received: from ?IPV6:2a00:1fa0:742:25a:e03e:6c9c:49d8:2fee? ([2a00:1fa0:742:25a:e03e:6c9c:49d8:2fee]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4606f26f3basm7395809f8f.12.2026.06.12.10.49.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Jun 2026 10:49:54 -0700 (PDT) Message-ID: <31cb54ac-8cf7-45fe-9167-becc4cd2aea9@gmail.com> Date: Fri, 12 Jun 2026 20:49:51 +0300 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [net-next 3/9] net: ethernet: ravb: Simplify gPTP start and stop To: =?UTF-8?Q?Niklas_S=C3=B6derlund?= , Paul Barker , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Cochran , Geert Uytterhoeven , Magnus Damm , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260610102432.3538432-1-niklas.soderlund+renesas@ragnatech.se> <20260610102432.3538432-4-niklas.soderlund+renesas@ragnatech.se> Content-Language: en-US From: Sergey Shtylyov In-Reply-To: <20260610102432.3538432-4-niklas.soderlund+renesas@ragnatech.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 6/10/26 1:24 PM, Niklas Söderlund wrote: > For devices that do not support the gPTP clock in config mode the > somewhat oddly named flag gptp is set, compared to devices that do > support the gPTP clock in config and operation mode where the flag > ccc_gac is set instead. The two flags are mutually exclusive. > > For the gptp-flag devices (Gen2) the clock is tied to the AVB-DMAC, when > it is stopped so is the gPTP clock. For ccc_gac-flag devices (Gen3) the > gPTP clock is available whenever the ndev is open. > > Prepare to add Gen4 support which will add a third way by cleaning the > Gen2 and Gen3 cases up a bit. > > Fold the gptp-flag start and stop calls into ravb_dmac_init() and > ravb_stop_dma(), which start and stops the AVB-DMAC. There are no s/stops/stop/. > functional change as all call sites to the construct, s/,/:/? > > if (info->gptp) > ravb_ptp_init(ndev, priv->pdev); > > Are always just after a call to into ravb_dmac_init() and all call sites s/Are/are/. > to the to the construct, "to the" repeated... And s/,/:/? > > if (info->gptp) > ravb_ptp_stop(ndev); > > Are always directly followed by a call to ravb_stop_dma(). s/Are/are/. > > There are two special cases where the calling construct covers both the > gptp-flag and info->ccc_gac devices, one for start and one for stop. The > condition that it is preceded by a call to ravb_dmac_init(), or followed > by a call to ravb_stop_dma() are however true for them too. Reworked the > two special cases to drop the check of info->gptp. > > The end result is that the gPTP clock will be started or stopped for the > gptp-flag devices in tandem with the AVB-DMAC, while the info->ccc_gac > devices will be controlled, as before, when the ndev is opened or > closed. > > Signed-off-by: Niklas Söderlund [...] MBR, Sergey