public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: "christophe barbé" <christophe.barbe.ml@online.fr>
Cc: Marcelo Tosatti <marcelo@conectiva.com.br>,
	lkml <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@zip.com.au>
Subject: Re: [PATCH] 3c59x and resume
Date: Mon, 25 Mar 2002 23:10:27 -0500	[thread overview]
Message-ID: <3C9FF4B3.3070408@mandrakesoft.com> (raw)
In-Reply-To: <20020323161647.GA11471@ufies.org> <3C9FC76F.6050900@mandrakesoft.com> <20020326014050.GP1853@ufies.org>

christophe barbé wrote:

>On Mon, Mar 25, 2002 at 07:57:19PM -0500, Jeff Garzik wrote:
>
>>This patch causes module defaults to be reused -- potentially incorrectly.
>>
>
>Wrong. How can the fact that a suspend/resume cycle increment the id be
>worst than the fact that the same cycle return idx to the previous
>state?
>
>The argument you have against this patch is WRONG.
>
>You think about NICs in a PCI slot. 
>That's changed the day the cardbus support was moved from pcmcia to the
>today implementation.
>You can't expect cardbus user to stop using the suspend mode because you
>expect your id to be attributed one time (that doesn't even make sense).
>
>I agree that this patch is not a full fix (I said it in my original
>post) but I disagree that it does any bad things. I would be interested
>to learn about a real case ?
>

Just exactly what I described.

The current system increments the card id on each ->probe, and does not 
decrement on ->remove, which makes sense if you are hotplugging one card 
and then another -- you don't want to reuse the same module options for 
a different card.  Your patch changes this logic to, "oh wait, let's 
stop doing this and have a special case once we reach MAX_UNITS"  Thus, 
you could potentially reuse the final slot when that was not the desired 
action.

Note that I am not defending this method of card_idx usage, because 
different use cases have different requirements (as indeed you do).  But 
your patch fixes one thing at the expense of another.

I just had another idea.  Create a new module option 'default_options', 
a single integer value.  Instead of assigning "-1" to options when we 
run out of MAX_UNITS ids, assign the default_options value.



>>This is a personal solution, that might live on temporary as an 
>>outside-the-tree patch... but we cannot apply this to the stable kernel.
>>
>>I agree the card idx is wrong on remove.  Insert and remove a 3c59x 
>>cardbus card several times, and you will lose your module options too. 
>>
>
>NO -- If I can remove/insert suspend/remove my card as I want I ever get
>the same ID. 
>
"same id" is vague.  Same PCI id?  Sure, but that doesn't mean it's the 
same card, from the driver's point of view. The driver really needs to 
keep track of whether or not a new ->probe indicates a card whose MAC 
address we have seen before.

To reiterate another issue, however, suspend/resume should _not_ be 
calling the code added in your patch.  That's a non-3c59x bug somewhere.

    Jeff





  reply	other threads:[~2002-03-26  4:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-23 16:16 [PATCH] 3c59x and resume christophe barbé
2002-03-23 18:39 ` Andrew Morton
2002-03-23 20:06   ` Robert Love
2002-03-23 22:44     ` christophe barbé
2002-03-24  8:07       ` Greg KH
2002-03-24 14:25         ` christophe barbé
2002-03-25 18:01           ` Greg KH
2002-03-25 18:19             ` christophe barbé
2002-03-25 19:11               ` Greg KH
2002-03-25 20:27                 ` christophe barbé
2002-03-25 20:58                 ` christophe barbé
2002-03-25 11:34     ` Joachim Breuer
2002-03-25 11:53       ` Xavier Bestel
2002-03-25 21:31         ` Joachim Breuer
2002-03-25 19:44     ` Bill Davidsen
2002-03-25 20:16       ` christophe barbé
2002-03-26  0:57 ` Jeff Garzik
2002-03-26  1:40   ` christophe barbé
2002-03-26  4:10     ` Jeff Garzik [this message]
2002-03-26  4:39       ` christophe barbé
2002-03-26  4:50         ` Andrew Morton
2002-03-26 16:56           ` christophe barbé
2002-03-26 16:57             ` Jeff Garzik

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=3C9FF4B3.3070408@mandrakesoft.com \
    --to=jgarzik@mandrakesoft.com \
    --cc=akpm@zip.com.au \
    --cc=christophe.barbe.ml@online.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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