Linux Documentation
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Dong Yibo <dong100@mucse.com>
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, horms@kernel.org, corbet@lwn.net,
	gur.stavi@huawei.com, maddy@linux.ibm.com, mpe@ellerman.id.au,
	danishanwar@ti.com, lee@trager.us, gongfan1@huawei.com,
	lorenzo@kernel.org, geert+renesas@glider.be,
	Parthiban.Veerasooran@microchip.com, lukas.bulwahn@redhat.com,
	alexanderduyck@fb.com, richardcochran@gmail.com, kees@kernel.org,
	gustavoars@kernel.org, rdunlap@infradead.org,
	vadim.fedorenko@linux.dev, joerg@jo-so.de,
	netdev@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH net-next v13 5/5] net: rnpgbe: Add register_netdev
Date: Tue, 23 Sep 2025 18:16:39 -0700	[thread overview]
Message-ID: <20250923181639.6755cca4@kernel.org> (raw)
In-Reply-To: <20250922014111.225155-6-dong100@mucse.com>

On Mon, 22 Sep 2025 09:41:11 +0800 Dong Yibo wrote:
> +static const struct mucse_hw_operations rnpgbe_hw_ops = {
> +	.reset_hw = rnpgbe_reset,
> +	.get_perm_mac = rnpgbe_get_permanent_mac,
> +	.mbx_send_notify = rnpgbe_mbx_send_notify,

Please don't add abstraction layers, you only have one set of ops right
now call them directly. The abstractions layers make the code harder to
follow.

> +static netdev_tx_t rnpgbe_xmit_frame(struct sk_buff *skb,
> +				     struct net_device *netdev)
> +{
> +	dev_kfree_skb_any(skb);
> +	netdev->stats.tx_dropped++;

Please add your own stats, the stats in struct net_device
are deprecated and should not be used by new drivers.

>  	err = rnpgbe_init_hw(hw, board_type);
>  	if (err) {
>  		dev_err(&pdev->dev, "Init hw err %d\n", err);
>  		goto err_free_net;
>  	}
> +	/* Step 1: Send power-up notification to firmware (no response expected)
> +	 * This informs firmware to initialize hardware power state, but
> +	 * firmware only acknowledges receipt without returning data. Must be
> +	 * done before synchronization as firmware may be in low-power idle
> +	 * state initially.
> +	 */
> +	err = hw->ops->mbx_send_notify(hw, true, mucse_fw_powerup);
> +	if (err) {

Don't you have to power it down on errors later in this function?
-- 
pw-bot: cr

  reply	other threads:[~2025-09-24  1:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22  1:41 [PATCH net-next v13 0/5] Add driver for 1Gbe network chips from MUCSE Dong Yibo
2025-09-22  1:41 ` [PATCH net-next v13 1/5] net: rnpgbe: Add build support for rnpgbe Dong Yibo
2025-09-24  1:08   ` Jakub Kicinski
2025-09-24  2:44     ` Yibo Dong
2025-09-22  1:41 ` [PATCH net-next v13 2/5] net: rnpgbe: Add n500/n210 chip support with BAR2 mapping Dong Yibo
2025-09-22  1:41 ` [PATCH net-next v13 3/5] net: rnpgbe: Add basic mbx ops support Dong Yibo
2025-09-22  1:41 ` [PATCH net-next v13 4/5] net: rnpgbe: Add basic mbx_fw support Dong Yibo
2025-09-22  1:41 ` [PATCH net-next v13 5/5] net: rnpgbe: Add register_netdev Dong Yibo
2025-09-24  1:16   ` Jakub Kicinski [this message]
2025-09-24  2:50     ` Yibo Dong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250923181639.6755cca4@kernel.org \
    --to=kuba@kernel.org \
    --cc=Parthiban.Veerasooran@microchip.com \
    --cc=alexanderduyck@fb.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=dong100@mucse.com \
    --cc=edumazet@google.com \
    --cc=geert+renesas@glider.be \
    --cc=gongfan1@huawei.com \
    --cc=gur.stavi@huawei.com \
    --cc=gustavoars@kernel.org \
    --cc=horms@kernel.org \
    --cc=joerg@jo-so.de \
    --cc=kees@kernel.org \
    --cc=lee@trager.us \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=lukas.bulwahn@redhat.com \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=richardcochran@gmail.com \
    --cc=vadim.fedorenko@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox