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:	Thu, 03 Oct 2013 22:14:42 +0200
From:	Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>
To:	Jason Gunthorpe <jgunthorpe@...idianresearch.com>,
	Jason Cooper <jason@...edaemon.net>
CC:	Ezequiel Garcia <ezequiel.garcia@...e-electrons.com>,
	Andrew Lunn <andrew@...n.ch>,
	Russell King <linux@....linux.org.uk>,
	Grant Likely <grant.likely@...aro.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Mike Turquette <mturquette@...aro.org>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] ARM: kirkwood: retain MAC address for DT ethernet

On 10/03/2013 09:44 PM, Jason Gunthorpe wrote:
> On Thu, Oct 03, 2013 at 03:04:37PM -0400, Jason Cooper wrote:
>
>>> I'm wondering: is the clock really disabled if the device is not
>>> available (i.e. status == 'ok')? In other words: isn't the
>>> !of_device_is_available() test enough?
>>
>> Well, this stemmed from JasonG's scenario where the second iface is
>> shut off by the bootloader.  Although one could argue that the
>> bootloader should then update the dtb to mark that node as disabled...
>
> Right, that is what we do here, only the first eth is present in the
> dt, the second is gated and powered down (noting that Linux doesn't
> know how to power it up :()
>
> This check is only to prevent CPU lockup if the firmware has included
> a DT node for ethernet, not included the MAC address and turned off
> the clock.
>
> Sebastian, does __clk_enabled work properly for the mvebu clock
> provider? I don't see a clk_ops.is_enabled for mvebu.. (don't know
> much about clk)

(joint answer for all three above)

A node with status != "okay" means "hardware/board does not allow you
to use that port at all, i.e. no ethernet jack"; disabling the clock
just means "I don't expect _all_ users want to use this jack, but it
is connected". So there _is_ a difference here.

clk-gate, which is the underlying clk provider for our gates, does
provide .is_enabled and reads the register. I haven't tested this,
due to no KW hardware available right now, but it should test for
disabled clocks as expected.

> Also, I think you should move the pr_err above the clock test, or make
> a special pr_err for the clock test as well. Having the clock gated,
> no mac address and a dt node is still a fw bug.

Well, we have 4 cases here:
- status != "okay": skip
- of_get_mac_address() != NULL: skip (no registers read)
- !__clk_is_enabled(): skip and warn with FW_BUG about disabled
   clocks but no valid MAC address set.
- else, read registers, store MAC in DT, warn with FW_BUG about
   enabled clocks and no valid MAC address set.

Leaves missing public clk_is_enabled(), which I can provide a
patch for if Mike agrees (and I haven't missed anything without
really looking into CCF).

Sebastian

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ