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]
Message-ID: <20210601034430.0b69c05e@thinkpad>
Date:   Tue, 1 Jun 2021 03:44:30 +0200
From:   Marek BehĂșn <kabel@...nel.org>
To:     linux-leds@...r.kernel.org
Cc:     netdev@...r.kernel.org, Pavel Machek <pavel@....cz>,
        Russell King <linux@...linux.org.uk>,
        Andrew Lunn <andrew@...n.ch>,
        Matthias Schiffer <matthias.schiffer@...tq-group.com>,
        Jacek Anaszewski <jacek.anaszewski@...il.com>,
        Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Subject: Re: [PATCH leds v2 10/10] leds: turris-omnia: support offloading
 netdev trigger for WAN LED

> +static int omnia_led_trig_offload_off(struct omnia_leds *leds,
> +				      struct omnia_led *led)
> +{
> +	int ret;
> +
> +	if (!led->phydev)
> +		return 0;
> +
> +	mutex_lock(&leds->lock);
> +
> +	/* set PHY's LED[0] pin to default values */
> +	ret = phy_modify_paged(led->phydev, MII_MARVELL_LED_PAGE,
> +			       MII_PHY_LED_TCR,
> +			       MII_PHY_LED_TCR_PULSESTR_MASK |
> +			       MII_PHY_LED_TCR_BLINKRATE_MASK,
> +			       (4 << MII_PHY_LED_TCR_PULSESTR_SHIFT) |
> +			       (1 << MII_PHY_LED_TCR_BLINKRATE_SHIFT));
> +
> +	ret = phy_modify_paged(led->phydev, MII_MARVELL_LED_PAGE,
> +			       MII_PHY_LED_CTRL, 0xf, 0xe);
> +

I forgot to add warnings here if ret < 0, since offload disabling must
return 0.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ