From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 C1F062BDC0F for ; Sat, 15 Aug 2026 18:30:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786818646; cv=none; b=tZ79PDI5ITrITpKkizZe+YqUxA/OzYW1J9sjVV9vORNI1E1Q2jWUBxFLOGZTG61hKtIo/ZVCrG1BFifdV8J5/B021QwgE4LEe8jdAUhuk1/sW5D8qWmJBTzfKy6lNO1nHqapXH3Kof6fFePFvW9e1DQewSVs/+sxtGzkFSGD+Zg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786818646; c=relaxed/simple; bh=kZTfO3uBKI57NTDJR2ykmTrRfYE0b0gP3rPTwHiWlDg=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=aj9kDM+saAHxAUg1w5uODlvUpD1rPiw26rCvFhGq0GSXTeuE+mgMrbOk6/SAMz8p3fncbAZtcHFYsaYY8chCdU07PAdJtMj/vxo78QbKg4bJIVmKAavfXVjcDGObcgxQFDe2mc0KazgTN7SWQBOPSJVbmWVKik1YB1ySbBO9xa8= 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=QUMcL5WN; arc=none smtp.client-ip=209.85.208.47 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="QUMcL5WN" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-6a0a4a8d251so2654498a12.1 for ; Sat, 15 Aug 2026 11:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786818642; x=1787423442; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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:content-type; bh=bX0B/tvx/xNY4Z8oanBlKNjZDRWTCp9mIncsBbd3D3s=; b=QUMcL5WNZ97vXsab3wHFE9ktnGN5ocPotQL03Lov80XfdxfQfkSGgzTAgXtIVNqxJ9 vvNf/Nf0t5YPAdQbeE4n74iJjrTM1bMw7P6sX+0rznkVcAz2/2pMMr5LI/+VHr4rmllf Fb50UADBBG+fqAUpv93RECRm7ju86fML9PLtmYhj0DBW4i7j2J11aq8fuW4t2nlnLz4W gPHlyWzoHvYHE3tgm0Tp5jnkpr4hTiFvxOexnDcTKUHZtdPvbjbchh5iyu0JTuMxtqq8 57rpzb3j5uwHTQTnkUtyeUwKh0NYWXjzt4YHLPAOqxmpPpyyQKfgxD6gZvXApAcmoyRT Q+CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786818642; x=1787423442; h=content-transfer-encoding:content-type: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:content-type; bh=bX0B/tvx/xNY4Z8oanBlKNjZDRWTCp9mIncsBbd3D3s=; b=WU8COgNCqoYEyIBo8zbnZvMB/N+3c1qsKjJwXHtlRGkj92xKzhrzBCGwG8o8OkoXNB +1zcriFF+6H7F+YhO82cwkNZIKJg0UAOeESKFq6o2B2X1OoawtgKSiB8bu9KQ/vpZWcb R3IKRWlaDPdXPqZnebwZgb8JE8iJlDXNjbIhxYFbVfCv2gdDC63OQLezmFeQ+vk11DjT B3U7CW9Y7S9yQIRG8E3LuQDQ8Q7i8h0YWw2pNmA04/EnLWpWbUmlzSDCMP3HvMJzOWUx uU8wCwW/J6YorWMecy9+mC84xpBjV5jzAhDz0gqspR7xSnG23eUdBneqgO+T/Ov3oV1a 5KCw== X-Forwarded-Encrypted: i=1; AHgh+RqBuUcNAAfJOpXD+VMOa46rHvbtADQ3kvHMwOfgcTqR/N/cggRdgu6vU59N/Nmh48DU0g/9JdLEvC0hvmI=@vger.kernel.org X-Gm-Message-State: AOJu0YxVQi3cbldgIf7/ocjsueAre5NSAjEMPhpG8ne8Cr7u2LWUegBf p+7I+cgQMnkziAlRiOorw0TSKNmUfxMaccqNwkQDlb6ZVw2sDa+RMLQR X-Gm-Gg: AR+sD11fSu/Wu25y6vut3UNY+1Me77laU5dpuaMNga9Yj/38RAbnUKPLdZGJzdjtBtC a3rmdodyMgYjqZ8IkKwB7gzdIXOGE8M62YZt7rJti67C1FPuwaWDzUeuspra5PBtGD/22uiIGWj Nc7mnmOKx/vI3ymYMwM9hwberYggjdWFasZnU1D0pddN7gjdbkI+kDEzATikl7QD5x7Eo5k1m3R DzgLoIC+OfQjj3QsS/iDHmkao9hdaPn+gZSHoN4nxav59sr1apM56WWf9aWVzvnwifKZmD7hCEr 50bCZVA8mwZfZ/NWUu+siTuo4Dp4759fWvapVNePcDwzWJUurBejrgeQ7lD1umqGZq0/QxDDup2 sUV7hcSDwXNKsOCIZq/HvteSVfAnLj/J9MIiuRAGWzw00ulBlv+6y7ApknxSaNVF1vh3IJjrjmF W6R0hPTziP8IVAX8tkEFrQyoiG0mJMxc2F9QHN/vyDp14tfCJm/nkD97/S7s+eohqzbdJlym32k 53uI/2sxye4n/fTvKKRoHkPtwpDlnjp8qXtmHdjCQ== X-Received: by 2002:a05:6402:504f:b0:6a3:6943:d64f with SMTP id 4fb4d7f45d1cf-6a38a8bef76mr5798579a12.2.1786818640952; Sat, 15 Aug 2026 11:30:40 -0700 (PDT) Received: from ?IPV6:2a00:1fa0:28f:426f:2aa1:8f7:f8a6:4f89? ([2a00:1fa0:28f:426f:2aa1:8f7:f8a6:4f89]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6a38d7698d8sm2205357a12.14.2026.08.15.11.30.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Aug 2026 11:30:39 -0700 (PDT) Message-ID: <592ff228-2887-4ff9-b110-9f3c0e73a02a@gmail.com> Date: Sat, 15 Aug 2026 21:30:35 +0300 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 03/10] net: ethernet: ravb: Simplify gPTP start and stop To: =?UTF-8?Q?Niklas_S=C3=B6derlund?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Richard Cochran , Andrew Lunn , "DavidS. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vadim Fedorenko , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <20260811160200.2049987-1-niklas.soderlund+renesas@ragnatech.se> <20260811160200.2049987-4-niklas.soderlund+renesas@ragnatech.se> Content-Language: en-US From: Sergey Shtylyov In-Reply-To: <20260811160200.2049987-4-niklas.soderlund+renesas@ragnatech.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 8/11/26 7:01 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 stop the AVB-DMAC. There are no > functional change as all call sites to the construct: > > if (info->gptp) > ravb_ptp_init(ndev, priv->pdev); > > are always just after a call to into ravb_dmac_init() and all call sites > to the construct: > > if (info->gptp) > ravb_ptp_stop(ndev); > > are always directly followed by a call to ravb_stop_dma(). > > 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 Reviewed-by: Sergey Shtylyov [...] MBR, Sergey