netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: peppe.cavallaro@st.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] stmmac: fix driver features
Date: Fri, 10 Feb 2012 02:40:33 -0500 (EST)	[thread overview]
Message-ID: <20120210.024033.1496479783120497956.davem@davemloft.net> (raw)
In-Reply-To: <4F34C286.2070304@st.com>

From: Giuseppe CAVALLARO <peppe.cavallaro@st.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.

  reply	other threads:[~2012-02-10  7:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09 10:56 [PATCH] stmmac: fix driver features Giuseppe CAVALLARO
2012-02-09 20:35 ` David Miller
2012-02-10  7:08   ` Giuseppe CAVALLARO
2012-02-10  7:40     ` David Miller [this message]
2012-02-10  8:40       ` Giuseppe CAVALLARO

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120210.024033.1496479783120497956.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).