From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C719C3FCB3C; Mon, 18 May 2026 12:01:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779105669; cv=none; b=Xtr9VTq9uEGPWxhn2Rjc7x++O/x7A2JxfbyAaFt5urJHtgl+8Fg8jRu6o8afxIxFAw8oJFaANxuWL1+NRpUrlN4dyTSAzb+M89dMGfpi+9kPWvM2DD1AQV3yiJQedAfY02fww7DcUlXD621KQda7hGkyrCI64L9lzF6kHtc0XMM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779105669; c=relaxed/simple; bh=ZfdSCvmJheoZqbSwPXtauVF4UyINGQSXbG9sWcASG0A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ut6M34zK610rFZ4ikLvRbmShWRj7wIWSUA6rLPr/1cWHOXvz8lAdMEZdYiPYWx6XA5VJ8NSwp1EiJ2LuHGQ7CNIh7ATVAbFBFC09p+EBzrjmlKzfOj1H/uCDRdvsUDQTSr5mdOZm08ggrD3lc2CUfsjRQeuG3HAtBmzIh3gPjmw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=4b9VaJ/R; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="4b9VaJ/R" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=b2/B+UK9SKjleTI91bdumxJx4pLws3/L2OWSi73KWpo=; b=4b9VaJ/Rj7jWHjVeoleSI82alV i/fa0OYq2cR/HFqI84ON2qqx6lg+Z52dquD2DheuQgWIk08FqHqbdCeaqMKPwR4URL7aB/wZ06Mco kpXNj5eRS3bab8aGgot0zmNMWt86ifUTQ8cJpFYUILnsOb2unkg/AmbyFxHb31hgVnAQ=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1wOweP-003U3q-Kf; Mon, 18 May 2026 14:00:49 +0200 Date: Mon, 18 May 2026 14:00:49 +0200 From: Andrew Lunn To: Selvamani Rajagopal Cc: Piergiorgio Beruto , "andrew+netdev@lunn.ch" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH net-next v2 8/9] onsemi: s2500: Add driver support for TS2500 MAC-PHY Message-ID: <660d68f2-2e4a-4dad-a33b-9cbd1847c04e@lunn.ch> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, May 18, 2026 at 04:03:38AM +0000, Selvamani Rajagopal wrote: > > > > > > +static int s2500_hwtstamp_get(struct net_device *ndev, > > > + struct kernel_hwtstamp_config *cfg) > > > +{ > > > + struct s2500_info *priv = netdev_priv(ndev); > > > + > > > + if (!priv->ptp_clock) { > > > + cfg->tx_type = 0; > > > + cfg->rx_filter = 0; > > > + } else { > > > + oa_tc6_hwtstamp_get(priv->tc6, cfg); > > > + } > > > + return 0; > > > > What is actually specific to the s2500 here? Your aim should be to put > > everything you can into the core. > > I agree on this and the next comment as well. Nothing really vendor specific. > > Question is, > 1) Should we add the PTP code in oa_tc6.c? This PTP code add 200+ lines. My preference is to add a new file oa_tc6_ptp.c under the directory where oa_tc6.c resides. oa_tc6_ptp.c is good. Maybe create a directory oa_tc6 and move the code into there. Especially if you need to add a local header which is shared by oa_tc6.c and oa_tc6_ptp.c, but is not needed by the drivers. > 2) If we are adding a new file, should it be under same CONFIG_OA_TC6 or add a new CONFIG_OA_TC6_HW_TIMESTAMP or something similar? I would not bother with a new symbol. It adds build testing complexity having to build with and without it, to test the stubs are correct etc. Andrew