mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Michal Gorlas <michal.gorlas@9elements.com>
Cc: Jean-Marie Verdun <verdun@hpe.com>,
	Nick Hawkins <nick.hawkins@hpe.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Marcello Sylvester Bauer <marcello.bauer@9elements.com>,
	Russell King <linux@armlinux.org.uk>,
	Tan Siewert <tan.siewert@9elements.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, Georg Hackel <georg.hackel@9elements.com>
Subject: Re: [PATCH net-next 4/5] net: ethernet: add HPE GXP UMAC driver
Date: Sun, 6 Dec 2026 04:26:45 +0100	[thread overview]
Message-ID: <d5596001-c5b5-4862-b42a-4e5abd3d8a02@lunn.ch> (raw)
In-Reply-To: <20261205-umac-v1-4-0796aa6e51c7@9elements.com>

> +	/* For phylink ops */
> +	struct mutex cfg_lock;

phylink does its own locking. What is this actually protecting.

> +static int umac_alloc_rings(struct net_device *ndev)
> +{
> +	struct umac_priv *umac = netdev_priv(ndev);
> +	struct platform_device *pdev = umac->pdev;
> +	int err;
> +
> +	err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> +	if (err) {
> +		dev_warn(&pdev->dev, "No suitable DMA available\n");

Is this a warning, or is it a fatal error? dev_err()?

> +static void umac_drop_tx(struct umac_priv *umac)
> +{
> +	int ret;
> +
> +	umac_wait_idle(umac, UMAC_STS2_IDLE_MASK);
> +
> +	/*
> +	 * Disabling MAC when a transfer is in progress can leave it in a
> +	 * state where the first frame after re-enabling is lost. Thus reset
> +	 * here.
> +	 */
> +	mutex_lock(&umac->reset_lock);
> +	ret = reset_control_assert(umac->rst);
> +	if (!ret) {
> +		usleep_range(10000, 20000);
> +		ret = reset_control_deassert(umac->rst);
> +	}
> +	mutex_unlock(&umac->reset_lock);
> +
> +	if (ret)
> +		netdev_err(umac->ndev, "MAC reset failed: %d\n", ret);
> +
> +	umac_free_tx_skbs(umac);


If you cannot get the device out of reset, isn't it dead? Not
returning an error here seems odd.

> +static int umac_init_hw(struct net_device *ndev)
> +{
> +	struct umac_priv *umac = netdev_priv(ndev);
> +	unsigned long flags;
> +	unsigned int value;
> +
> +	umac_channel_disable(umac);
> +	if (umac_wait_idle(umac, UMAC_STS2_IDLE_MASK)) {
> +		netdev_warn(ndev, "MAC failed to stop\n");
> +		return -EBUSY;
> +	}

umac_wait_idle() returns ETIMEDOUT. You should not replace one error
with another, it makes it harder to work backwards to the source.

Also, if you cannot stop the make, is that a fatal error?
netdev_err()?

Please check all your warnings and see if they should actually be
errors.

> +static void umac_mac_link_up(struct phylink_config *config,
> +			     struct phy_device *phy, unsigned int mode,
> +			     phy_interface_t interface, int speed, int duplex,
> +			     bool tx_pause, bool rx_pause)
> +{
> +	struct net_device *ndev = to_net_dev(config->dev);
> +	struct umac_priv *umac = netdev_priv(ndev);
> +	int err;
> +
> +	mutex_lock(&umac->cfg_lock);
> +	umac->speed = speed;
> +	umac->duplex = duplex;
> +	umac->link = true;

Does the MAC support flow control. rx_pause and tx_pause are ignored
here.

	Andrew

  reply	other threads:[~2026-12-06  3:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 22:51 [PATCH net-next 0/5] net: add HPE GXP UMAC support Michal Gorlas
2026-12-05 22:51 ` [PATCH net-next 1/5] dt-bindings: reset: add HPE GXP reset controller Michal Gorlas
2026-12-05 22:51 ` [PATCH net-next 2/5] reset: simple: add HPE GXP support Michal Gorlas
2026-12-05 22:51 ` [PATCH net-next 3/5] dt-bindings: net: add HPE GXP UMAC Ethernet controller Michal Gorlas
2026-12-05 22:51 ` [PATCH net-next 4/5] net: ethernet: add HPE GXP UMAC driver Michal Gorlas
2026-12-06  3:26   ` Andrew Lunn [this message]
2026-12-05 22:51 ` [PATCH net-next 5/5] MAINTAINERS: Add HPE GXP UMAC entry Michal Gorlas

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=d5596001-c5b5-4862-b42a-4e5abd3d8a02@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=georg.hackel@9elements.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=marcello.bauer@9elements.com \
    --cc=michal.gorlas@9elements.com \
    --cc=netdev@vger.kernel.org \
    --cc=nick.hawkins@hpe.com \
    --cc=p.zabel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=tan.siewert@9elements.com \
    --cc=verdun@hpe.com \
    /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

all inboxes | Powered by JetHome®