netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: richardcochran@gmail.com
Cc: afleming@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH] phylib: Add support for the LXT973 phy.
Date: Wed, 02 Jun 2010 06:50:17 -0700 (PDT)	[thread overview]
Message-ID: <20100602.065017.139108801.davem@davemloft.net> (raw)
In-Reply-To: <20100602125527.GA20396@riccoc20.at.omicron.at>

From: Richard Cochran <richardcochran@gmail.com>
Date: Wed, 2 Jun 2010 14:55:27 +0200

> On Tue, Jun 01, 2010 at 05:39:22PM -0500, Andy Fleming wrote:
>> That's a bit hacky.  There is a dev_flags field, which could be used
>> for this.  Probably, we should add a more general way of saying what
>> sort of port this is.  But don't use the presence and absence of
>> "priv", as it could one day get used for a different purpose, and this
>> seems like it would leave us open to strange bugs.
> 
> Okay, I changed it.
> 
> At first, I was worried about using 'dev_flags' because I couldn't
> tell exactly who may write to this field. Looking at tg.c and
> broadcom.c, it appears that the MAC drivers may also write this
> field. In contrast, the 'priv' field is surely private.

No, I think using dev_flags is absolutely the wrong way to do about
this.

phy_device->priv "could one day get used for a different purpose"?
What in the world are you smoking Andy?

It's clearly a private state pointer for the PHY driver to use,
full stop.  There is absolutely no ambiguity of what this value
is and what it is used for and who owns it.  The comments in the
layout of struct phy_device state this clearly as well.

On the other hand, ->dev_flags is an entirely different matter.  It's
set based upon arguments passed into PHY driver interface attach calls
and used in other various ways by the generic PHY library code.

This is entirely different from ->priv which is not touched at all
by the generic PHY code, and thus ->priv is much safer to use for
private purposes like Richard's case here.

Richard, please respin your patch so that you're using the ->priv
field like in your original patch.

Thanks.

  parent reply	other threads:[~2010-06-02 13:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-31 13:09 [PATCH] phylib: Add support for the LXT973 phy Richard Cochran
2010-06-01 22:39 ` Andy Fleming
2010-06-02 12:55   ` Richard Cochran
2010-06-02 13:07     ` Richard Cochran
2010-06-02 13:50     ` David Miller [this message]
2010-06-02 15:08       ` Richard Cochran
2010-06-02 15:15         ` David Miller
2010-06-03 11:28           ` Richard Cochran
2010-06-02 19:32       ` Andy Fleming
2010-06-05 14:00         ` Richard Cochran
2010-06-07  8:18           ` David Miller
2010-06-07 15:39             ` Andy Fleming
2010-06-07 15:39             ` Richard Cochran
2010-06-09 23:17               ` David Miller
2010-06-22 12:38 ` [PATCH] phylib: Add autoload " David Woodhouse
2010-06-23  5:37   ` Richard Cochran
2010-06-23  9:00     ` David Woodhouse
2010-06-27  5:16   ` David Miller

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=20100602.065017.139108801.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=afleming@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.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).