All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Sanman Pradhan <sanman.p211993@gmail.com>
Cc: netdev@vger.kernel.org, alexanderduyck@fb.com, kuba@kernel.org,
	kernel-team@meta.com, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, jdelvare@suse.com, linux@roeck-us.net,
	mohsin.bashr@gmail.com, sanmanpradhan@meta.com, andrew@lunn.ch,
	linux-hwmon@vger.kernel.org
Subject: Re: [PATCH net-next v4] eth: fbnic: Add hardware monitoring support via HWMON interface
Date: Wed, 9 Oct 2024 13:31:07 +0100	[thread overview]
Message-ID: <20241009123107.GQ99782@kernel.org> (raw)
In-Reply-To: <20241008143212.2354554-1-sanman.p211993@gmail.com>

On Tue, Oct 08, 2024 at 07:32:12AM -0700, Sanman Pradhan wrote:
> From: Sanman Pradhan <sanmanpradhan@meta.com>
> 
> This patch adds support for hardware monitoring to the fbnic driver,
> allowing for temperature and voltage sensor data to be exposed to
> userspace via the HWMON interface. The driver registers a HWMON device
> and provides callbacks for reading sensor data, enabling system
> admins to monitor the health and operating conditions of fbnic.
> 
> Signed-off-by: Sanman Pradhan <sanmanpradhan@meta.com>

...

> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_pci.c b/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
> index a4809fe0fc24..10b9573d829e 100644
> --- a/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
> @@ -289,9 +289,11 @@ static int fbnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> 
>  	fbnic_devlink_register(fbd);
> 
> +	fbnic_hwmon_register(fbd);
> +
>  	if (!fbd->dsn) {
>  		dev_warn(&pdev->dev, "Reading serial number failed\n");
> -		goto init_failure_mode;
> +		goto hwmon_unregister;
>  	}
> 
>  	netdev = fbnic_netdev_alloc(fbd);

Hi Sanman,

The code immediately after the hunk above is:

	if (!netdev) {
		dev_err(&pdev->dev, "Netdev allocation failed\n");
		goto init_failure_mode;
	}

I think it's error-path needs to be update to goto hwmon_unregister
rather than init_failure_mode.

> @@ -310,6 +312,8 @@ static int fbnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> 
>  ifm_free_netdev:
>  	fbnic_netdev_free(fbd);
> +hwmon_unregister:
> +	fbnic_hwmon_unregister(fbd);
>  init_failure_mode:
>  	dev_init_failure_modewarn(&pdev->dev, "Probe error encountered, entering init failure mode. Normal networking functionality will not be available.\n");
>  	 /* Always return 0 even on error so devlink is registered to allow

...

-- 
pw-bot: cr

  reply	other threads:[~2024-10-09 12:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 14:32 [PATCH net-next v4] eth: fbnic: Add hardware monitoring support via HWMON interface Sanman Pradhan
2024-10-09 12:31 ` Simon Horman [this message]
2024-10-09 13:26 ` Jakub Kicinski

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=20241009123107.GQ99782@kernel.org \
    --to=horms@kernel.org \
    --cc=alexanderduyck@fb.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jdelvare@suse.com \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mohsin.bashr@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sanman.p211993@gmail.com \
    --cc=sanmanpradhan@meta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.