Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp375153rdb; Thu, 30 Nov 2023 07:09:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IEs4lrTRpaYuAqZu1mxctNJhyW9Id7nM9vdMUMlNSIDvtU4GA4kRL/nalh6Qw53uR0/Tjn5 X-Received: by 2002:a05:6870:f78f:b0:1f9:574c:b5ec with SMTP id fs15-20020a056870f78f00b001f9574cb5ecmr30022663oab.27.1701356964944; Thu, 30 Nov 2023 07:09:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701356964; cv=none; d=google.com; s=arc-20160816; b=muIYJdVJD4J138WrW2/7waXAKzO1kNNeZTttjcVXF7u88YSiB6Uqx7vGCk2Xf5xaQS ypNW6RbnOs0zX1sXDfs0dccvYgn7FkyTr5SJYLYaJwL4jww/RphuIKQT7vhDj8sOZHJ2 9Hrv2oWpOvhX0b6EJ3wHK9p+uuSLq5F2zsNNulyQ5LYzIy5pbzVdS6SE3zwM1QD1d3+Y 4aX3c+20bPG+ETLnNL1CcmHYGuNzK9KtVyCRz7ckAHVExMzetDEi+k8sKm1xIpqir6dM NKcx9xusv/U6pnJDt5Xm5WO+WUpGtBoD3QlFtoms9XxvSKjcJJs64YiU+MBHindUcX3h ixww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=D+LmC+1/RYTLpkFTwI8yb/n8Ew6AV+Cl7nqaIiFwlPs=; fh=plG+UOTDgiXW4347QLSMGIFwEdGEv3gFyVPMnT9Yfog=; b=s3pV0GSGdCHo31oLvRdN9ji/W69ER1THI1ttPLnQ0v1AqMYCp4Snwt/V7a14ATVW2e ZM5kC/nSZMZEbbJJM4IDSbT4GqT3pQOKc04Rr6IXFxOnUq1+oaKoXfNslY+lKYf+U7IL hi2I0qpGVpTx/PKU765fEVY6d7Tf0teBC9leeTB/6+XJ8bZzpfF20uBeiLH1CKw+DnEG +VK+gSD9qjDoDQHovoCHf26gufl9/hfTtf5Kqperiuz1SNHafg0ku/kj9WJ016SdxcGl TzeFoqYB1ArBugey52ClmFvY48eFG7/2B/SgI3q6t+GZ3LQLyO0PtAubCA55N9A0d6xo 9zEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="Yn/Jk19t"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id gz13-20020a056870280d00b001f5ae4e06b4si489795oab.140.2023.11.30.07.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 07:09:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="Yn/Jk19t"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 994DB80CE7EE; Thu, 30 Nov 2023 07:09:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346125AbjK3PJI (ORCPT + 99 others); Thu, 30 Nov 2023 10:09:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346053AbjK3PJG (ORCPT ); Thu, 30 Nov 2023 10:09:06 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61AC21B4; Thu, 30 Nov 2023 07:09:13 -0800 (PST) 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=D+LmC+1/RYTLpkFTwI8yb/n8Ew6AV+Cl7nqaIiFwlPs=; b=Yn/Jk19thhlWMIUF0bplu8nx6s 4dc/ABz2PL5pQvTaKMGJP1xvVlD4KvnF7JdUyWac08oNceGczk3W2qFILgO/KM7Nv0cYtdeERRG62 Xkd+8k6dlp12GXHbG+EN2bUzGEV3XuaYgkP0bYypD/sc9F7gdvZLyeZJSxTBQnf26qMc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r8iez-001fvP-Fe; Thu, 30 Nov 2023 16:09:01 +0100 Date: Thu, 30 Nov 2023 16:09:01 +0100 From: Andrew Lunn To: Christian Marangi Cc: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [net-next PATCH 04/14] net: phy: at803x: move qca83xx stats out of generic at803x_priv struct Message-ID: <987fe800-ea6c-44a0-9895-57feb6731b08@lunn.ch> References: <20231129021219.20914-1-ansuelsmth@gmail.com> <20231129021219.20914-5-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231129021219.20914-5-ansuelsmth@gmail.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 30 Nov 2023 07:09:22 -0800 (PST) On Wed, Nov 29, 2023 at 03:12:09AM +0100, Christian Marangi wrote: > Introduce a specific priv struct for qca83xx PHYs to store hw stats > data and a specific probe to allocate this alternative priv struct. > > This also have the benefits of reducing memory allocated for every other > at803x PHY since only qca83xx currently supports storing hw stats. > > Signed-off-by: Christian Marangi > --- > drivers/net/phy/at803x.c | 27 ++++++++++++++++++++++----- > 1 file changed, 22 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c > index 4ff41d70fc47..3b7baa4bb637 100644 > --- a/drivers/net/phy/at803x.c > +++ b/drivers/net/phy/at803x.c > @@ -301,6 +301,10 @@ static struct at803x_hw_stat qca83xx_hw_stats[] = { > { "eee_wake_errors", 0x16, GENMASK(15, 0), MMD}, > }; > > +struct qca83xx_priv { > + u64 stats[ARRAY_SIZE(qca83xx_hw_stats)]; > +}; > + > struct at803x_priv { > int flags; > u16 clk_25m_reg; > @@ -311,7 +315,6 @@ struct at803x_priv { > bool is_1000basex; > struct regulator_dev *vddio_rdev; > struct regulator_dev *vddh_rdev; > - u64 stats[ARRAY_SIZE(qca83xx_hw_stats)]; > }; I agree with Russell here, this is the wrong way to go. Maybe keep at803x_priv for all the common private members which are shared by all variants. Add a qca83xx_priv which includes this: struct qca83xx_priv { struct at803x_priv at803_priv; u64 stats[ARRAY_SIZE(qca83xx_hw_stats)]; }; Andrew