[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4F34D7F9.1090501@st.com>
Date: Fri, 10 Feb 2012 09:40:25 +0100
From: Giuseppe CAVALLARO <peppe.cavallaro@...com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] stmmac: fix driver features
On 2/10/2012 8:40 AM, David Miller wrote:
> From: Giuseppe CAVALLARO <peppe.cavallaro@...com>
> Date: Fri, 10 Feb 2012 08:08:54 +0100
>
>> Hello David
>>
>> On 2/9/2012 9:35 PM, David Miller wrote:
>>> This is not the purpose of the fix_features method, it's meant to
>>> ensure that the settings are valid.
>>>
>>> It's not meant to "catch up" with settings you store in the internal
>>> datastructures of your driver.
>>>
>>> You need to do this at probe time, where the initial ->hw_features
>>> and ->features values are set.
>>
>> Initially the driver HW features are indeed set in the probe but in the
>> stmmac_open function, after looking at the HW cap reg, some parameters,
>> for example the HW csum, can be overridden and the
>> netdev_update_features is called. IIUC the netdev_update_features calls
>> the driver's ndo_fix_features. For this reason I improved the
>> stmmac_fix_feature function to cover more setting. Anyway, if I cannot
>> use this function I should move from the open to the probe the logic to
>> manage the MAC identification and HW cap register. What do you suggest?
>
> You should not be determining chip features in your open method,
> such work belongs in your device probe.
>
ok, I'll rework this and send you all the patches again in a bundle.
peppe
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists