From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753172AbbC3HeD (ORCPT ); Mon, 30 Mar 2015 03:34:03 -0400 Received: from eusmtp01.atmel.com ([212.144.249.242]:41720 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752563AbbC3HeA (ORCPT ); Mon, 30 Mar 2015 03:34:00 -0400 Message-ID: <5518EE57.8050808@atmel.com> Date: Mon, 30 Mar 2015 08:33:59 +0200 From: Nicolas Ferre Organization: atmel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Boris Brezillon CC: , , , , Cyrille Pitchen , , , Subject: Re: [PATCH 3/4] net/macb: fix capabilities configuration References: <20150328000235.30337361@bbrezillon> In-Reply-To: <20150328000235.30337361@bbrezillon> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.161.30.18] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 28/03/2015 00:02, Boris Brezillon a écrit : > Hi Nicolas, > > On Fri, 27 Mar 2015 16:34:11 +0100 > Nicolas Ferre wrote: > >> Capabilities configuration by macb_configure_caps() was moved far too late by >> 421d9df0628b (net/macb: merge at91_ether driver into macb driver) which would >> lead to badly configured hardware. > > Indeed, the macb_configure_caps function is called a bit too late, > but ... > >> So, move this function to early probe and modify its prototype to re-gain its >> original behavior. >> DT data retrieval is also moved to simplify the probe code flow. > > ... I'm not happy with these changes. > I tried to keep specific init steps of macb and at91_ether separated > and you're moving macb_configure_caps call (not required on at91_ether > HW) into macb_probe (the common probe part). Well, this function is about configuring the capabilities of the hardware both from the configuration registers and the device tree entries (this last source applies to all flavors of hardware). I only see advantages to set these flags early (Cf. above). > How about moving macb_configure_caps a bit earlier in the macb_init > function [1] ? No, it won't be sufficient. The very first function needing the capabilities set is macb_get_hwaddr() which is pretty early in macb_probe(). Bye, > Best Regards, > > Boris > > [1]http://code.bulix.org/8gyi6b-88141 > -- Nicolas Ferre