public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Manuel Estrada Sainz <ranty@debian.org>
Cc: Greg KH <greg@kroah.com>, Oliver Neukum <oliver@neukum.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Simon Kelley <simon@thekelleys.org.uk>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	"Downing, Thomas" <Thomas.Downing@ipc.com>,
	jt@hpl.hp.com, Pavel Roskin <proski@gnu.org>
Subject: Re: request_firmware() hotplug interface, third round.
Date: Tue, 20 May 2003 15:21:58 +1000	[thread overview]
Message-ID: <20030520052158.GD5248@zax> (raw)
In-Reply-To: <20030517103037.GA17576@ranty.ddts.net>

On Sat, May 17, 2003 at 12:30:37PM +0200, Manuel Estrada Sainz wrote:
> On Sat, May 17, 2003 at 07:07:05PM +1000, David Gibson wrote:
> > On Sat, May 17, 2003 at 10:46:12AM +0200, Manuel Estrada Sainz wrote:
> > > On Sat, May 17, 2003 at 02:44:59PM +1000, David Gibson wrote:
> > > > On Fri, May 16, 2003 at 05:03:38PM -0700, Greg Kroah-Hartman wrote:
> > > > > On Sat, May 17, 2003 at 01:55:15AM +0200, Oliver Neukum wrote:
> > > > > > 
> [snip]
> > >  But in case you are doing things by hand, how about:
> > >  
> > > 	$ echo cancel > .../loading
> > > 
> > > 	or if you want to keep the content numeric:
> > > 
> > > 	$ echo -1 > .../loading
> > > 
> > >  This will also allow the regular script to just cancel the load in case
> > >  of error, like if the firmware image is not available or a read error
> > >  happened while reading it.
> > > 
> > >  I'll implement that and the other stuff that came out of Oliver's
> > >  comments later today and post the new code.
> > >  
> > > > Better to catch the close, check the length, then return the firmware
> > > > or throw the junk image away as appropriate.
> > > 
> > >  If 'loading' stays the above should fix your timeout issue, and if it
> > >  goes, yes, that is probably the way to go.
> > 
> > How about combining these two ideas: instead of "loading" and "data"
> > we have "size" and "data".  First you write the size, then the data -
> > the driver accepts it once it gets the expected number of bytes.
> > Writing a new size throws away any partial image that's there, and
> > restarts the upload.  Writing 0 cancels the upload entirely, and the
> > driver will presumably fail to initialize (or maybe use a default
> > image if it has one).
> 
>  I just thought this over. This makes more requirements for the userspace
>  scripts, they will need some way to get the size of the image: stat, or
>  ls and some crude regex.
> 
>  And we can have the same effect with loading/data:
> 
>  echo 1 > .../loading:
>  	Will start a load, discarding any previous partial load.
>  echo 0 > .../loading:
>  	Will conclude the load and handle the data to the driver code.
>  echo -1 > .../loading:
> 	Will conclude the load with an error and the driver won't get
> 	any firmware, failing or using firmware in some flash if
> 	available.
> 
>  This way, the script also won't have to check the value of 'loading'.
> 
>  How does that sound?

Hrm... it still seems a bit icky to me, but I'm not really sure why.
I think it would be a bit better if you called it "control" or
something instead of "loading".  "loading" seems to imply a boolean,
which this isn't anymore.

-- 
David Gibson			| For every complex problem there is a
david@gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson

  reply	other threads:[~2003-05-20  5:13 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-15 20:03 request_firmware() hotplug interface, third round Manuel Estrada Sainz
2003-05-16  8:07 ` Oliver Neukum
2003-05-16  9:56   ` Manuel Estrada Sainz
2003-05-16 15:53     ` Oliver Neukum
2003-05-16 18:31       ` Manuel Estrada Sainz
2003-05-16 22:22         ` Oliver Neukum
2003-05-17  0:59           ` Manuel Estrada Sainz
2003-05-17  4:00             ` Robert White
2003-05-17 13:23           ` Alan Cox
2003-05-17 14:57             ` Manuel Estrada Sainz
2003-05-16 18:49       ` Jean Tourrilhes
2003-05-16 22:24         ` Oliver Neukum
2003-05-16 23:21         ` Greg KH
2003-05-16 16:09   ` Alan Cox
2003-05-16 22:13     ` Oliver Neukum
2003-05-17  4:50       ` David Gibson
2003-05-17  7:02         ` Oliver Neukum
2003-05-17  8:21           ` David Gibson
2003-05-16 13:13 ` Ingo Oeser
2003-05-16 17:07   ` Manuel Estrada Sainz
2003-05-16 22:36 ` Greg KH
2003-05-16 23:37   ` Manuel Estrada Sainz
2003-05-16 23:59     ` Greg KH
2003-05-17  4:47       ` David Gibson
2003-05-17  8:54         ` Manuel Estrada Sainz
2003-05-16 23:55   ` Oliver Neukum
2003-05-17  0:03     ` Greg KH
2003-05-17  2:42       ` Robert White
2003-05-17  4:44       ` David Gibson
2003-05-17  8:46         ` Manuel Estrada Sainz
2003-05-17  9:07           ` David Gibson
2003-05-17  9:50             ` Manuel Estrada Sainz
2003-05-17 10:30             ` Manuel Estrada Sainz
2003-05-20  5:21               ` David Gibson [this message]
2003-05-20  8:07                 ` Manuel Estrada Sainz
2003-05-21  4:21                   ` Greg KH
2003-05-21  7:06                     ` Manuel Estrada Sainz
2003-05-17 10:51   ` Manuel Estrada Sainz
2003-05-17 13:21   ` Ingo Oeser
2003-05-17 15:15     ` Manuel Estrada Sainz
     [not found] ` <Pine.LNX.4.55.0305151623520.2885@marabou.research.att.com>
2003-05-16  9:27   ` Manuel Estrada Sainz
2003-05-16 22:39   ` Greg KH

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=20030520052158.GD5248@zax \
    --to=david@gibson.dropbear.id.au \
    --cc=Thomas.Downing@ipc.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=jt@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver@neukum.org \
    --cc=proski@gnu.org \
    --cc=ranty@debian.org \
    --cc=simon@thekelleys.org.uk \
    /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