From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 E37CE367B99 for ; Fri, 12 Jun 2026 17:49:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781286598; cv=none; b=XADs+ibveGWrUh71ET14jh/kyzKBR5adfOosoYq8tt1AQ1F4Wwr5vuQHBP6Fl8KGvvrh5gjPkVhvZ+d4a5wOaLleUcESL4+u1QRCrK9AdtyDECtiQtEmVjfsTJfbZEDaganUwZXrBcM0Fn7/1wky4g78TNvnGuoka5JCG51wU4U= 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.41 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-f41.google.com with SMTP id 5b1f17b1804b1-490b1bbcf3aso10518115e9.1 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=OWiCh1fg0Z82K1LNJ6zKsJg2vmUpsAELnRRwBuPFfOpctbjgA+KBydLn+gO1NDpNzN 3I9d6iJun7wF8QbN4kP810TPbeauxsO5P8+t2n53hjyO0k2MGJPgH5QCkyL3BllJE+B1 SF4CBwLLKHZ1/kR8yeVw5B8CWoJeRU5IiNdyaNTHLcohyC47WCADaYKKrkW80HetcJCw +lY3TealEy61R7Iy6mnxRxymKCW2JJfNWPGFxxgIqrr6pTvjLNvIASHWRMJjtKiyL/Wo fdXRS2MAOyjmkSKiDodGvPK12RBvTYR7XDCHUZI2QeIaODgEzVYEg+dQPynyoCsvTdk6 TVEw== X-Forwarded-Encrypted: i=1; AFNElJ+ZRqZMs4laDFBopiV2AokQqL3hg52IEo+VWUWXitMuCLl7HZV4JIm5nIdNPU1/u7ygCRnmu0dchjKSpYA=@vger.kernel.org X-Gm-Message-State: AOJu0YxV+bPwpYWdtqvixdgMlteR5mqCYVvPi4L4pu+t28kptYJc3XLV qT/I9Af3HfzdrE5tyY4gI+if5P0IZTlb6rWIKzGR6Bbhc0vPGt0Fccnq X-Gm-Gg: Acq92OGur8l/oDkq2aLx3Etv9V8u/8AAC/51Tg63GIQOlediTZ8byZp6FAxxZr4DfMx OBaIQKdh0lXAEhmIMdzVUGO2okyBBcsOlFn73pbvPlX4AJPLBS0MwXFqYWRCOcI5Fn/fEPJ/ZvG 858VAOrTaipAYzCZ41XrShRzyO+XiyVz+nzshHrpJfnuKsOuNMsGxQK1rzqlVnqB5gUaySSnbet 36tkTGk1Q87HTPoDqbEXTbTwFcMdcy1pnu2xCxAWYAhm4fYST47iH5AY/XJR/8ToAVNnPgEvJhC othviWaDJtuuCM2CuUD8geHEYsnRp/I1MkpUiIvRsvjLqxHGVJk2fSGyRiXxdlBNHBqxuEotNoO ycI5fNxwU0rTNCNalSdsg4ISeGaI7vPc6J/mZVK98QErzpkUce5sKbzarGGLIzIKE+Dg3/3+jUi 9JBPRWOaqStKGgrEBxQN86uFYxrXkVhStw4JFf6HChzgEjTIGGXCtQGRfrg+Gkr2CH1ZuHyzMW8 xQ= 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: linux-kernel@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