lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 04 Jun 2021 11:28:06 +0200
From:   Philipp Zabel <p.zabel@...gutronix.de>
To:     Steen Hegelund <steen.hegelund@...rochip.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>
Cc:     Andrew Lunn <andrew@...n.ch>, Russell King <linux@...linux.org.uk>,
        Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Madalin Bucur <madalin.bucur@....nxp.com>,
        Mark Einon <mark.einon@...il.com>,
        Masahiro Yamada <masahiroy@...nel.org>,
        Arnd Bergmann <arnd@...db.de>,
        Simon Horman <simon.horman@...ronome.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        Bjarni Jonasson <bjarni.jonasson@...rochip.com>,
        Lars Povlsen <lars.povlsen@...rochip.com>
Subject: Re: [PATCH net-next v3 02/10] net: sparx5: add the basic sparx5
 driver

Hi Steen,

On Fri, 2021-06-04 at 10:55 +0200, Steen Hegelund wrote:
> This adds the Sparx5 basic SwitchDev driver framework with IO range
> mapping, switch device detection and core clock configuration.
> 
> Support for ports, phylink, netdev, mactable etc. are in the following
> patches.
> 
> Signed-off-by: Steen Hegelund <steen.hegelund@...rochip.com>
> Signed-off-by: Bjarni Jonasson <bjarni.jonasson@...rochip.com>
> Signed-off-by: Lars Povlsen <lars.povlsen@...rochip.com>
> ---
>  drivers/net/ethernet/microchip/Kconfig        |    2 +
>  drivers/net/ethernet/microchip/Makefile       |    2 +
>  drivers/net/ethernet/microchip/sparx5/Kconfig |    9 +
>  .../net/ethernet/microchip/sparx5/Makefile    |    8 +
>  .../ethernet/microchip/sparx5/sparx5_main.c   |  746 +++
>  .../ethernet/microchip/sparx5/sparx5_main.h   |  273 +
>  .../microchip/sparx5/sparx5_main_regs.h       | 4642 +++++++++++++++++
>  7 files changed, 5682 insertions(+)
>  create mode 100644 drivers/net/ethernet/microchip/sparx5/Kconfig
>  create mode 100644 drivers/net/ethernet/microchip/sparx5/Makefile
>  create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_main.c
>  create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_main.h
>  create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_main_regs.h
> 
[...]
> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> new file mode 100644
> index 000000000000..73beb85bc52d
> --- /dev/null
> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> @@ -0,0 +1,746 @@
[...]
> +static int mchp_sparx5_probe(struct platform_device *pdev)
> +{
[...]
> +
> +	sparx5->reset = devm_reset_control_get_shared(&pdev->dev, "switch");
> +	if (IS_ERR(sparx5->reset)) {

Could you use devm_reset_control_get_optional_shared() instead of
ignoring this error? That would just return NULL if there's no "switch"
reset specified in the device tree.

> +		dev_warn(sparx5->dev, "Could not obtain reset control: %ld\n",
> +			 PTR_ERR(sparx5->reset));
> +		sparx5->reset = NULL;
> +	} else {
> +		reset_control_reset(sparx5->reset);
> +	}

If this is the only place the reset is used, I'd remove it from struct
sparx5 and use a local variable instead.

regards
Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ