Re: [linux-usb-devel] question on flushing buffers and spinning down disk

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alan Stern
Date: Saturday, September 29, 2007 - 9:38 am

On Fri, 28 Sep 2007, Oliver Neukum wrote:

osition to
its own
 what
stood
ion.
he=20

I don't know what that's supposed to mean.  And whatever that means, it
must be equally true that usb-storage doesn't know CD drives.  Or disk
drives, or flash memories, or SCSI tape drives, or ...  On the whole,
I'd say that usb-storage's lack of knowledge about SCSI devices greatly
outweighs sr's lack of knowledge about hardware.


ed

You forget that the USB bus ends at the USB interface chip on the
device.  From there on it's a different sort of bus.  It might be ATA,
as in commonly-available USB-ATA converter boxes.  It might be a
genuine SCSI bus, as in some USB-SCSI bridges.  It might be an internal
flash-memory "bus".  It might be a full-blown Linux gadget.  And so on.

The suspend done by usb-storage suspends only the USB part of the link.=
 =20
It might or might not affect anything beyond the device's USB chip,=20
depending on how the device was designed.

Your (1) is correct, since all communication must take place over the
USB link.  Your (2) is wrong -- the _link_'s power consumption is
indeed limited, but the _device_ could be self-powered and so its power
consumption need not be affected by the link state.  For instance in
the case of a USB-ATA drive enclosure, power consumption is affected
more by whether or not the disk is spinning than anything else.

ge,=20

We're talking about conserving energy, not destroying chains.  :-)

y don't
hen=20

That's arguable, at least as regards START-STOP UNIT.  Spinning down a
disk is more than just preparation; it is itself a power-saving
measure.

And anyway, that's beside the point.  The SCSI drivers do what they can
or what they must -- it's none of usb-storage's business.  All
usb-storage cares about is whether the link will be needed, and the
only code that can tell it is the code that uses the link -- i.e., the=20
SCSI drivers.


d
r
vice

I don't understand that.

Suppose we have devices A1 and A2, where A1 is the parent and A2 is the=
=20
child.  In order to pass between the CPU and A2, data must flow through=
=20
A1.  Let D1 and D2 be the drivers for A1 and A2.

It may be that for D2 to communicate with A2, it has to ask D1 to send=20
or receive the data for it.  Or it may be that once D1 has configured=20
A1, data can flow automatically through A1 with no need for further=20
involvement on D1's part.  Would you say that in either case the flow=20
of information has diverged from the device tree?

Suppose D1 decides that it wants to suspend A1, thus breaking the data
link to A2.  Shouldn't it get D2's permission first?  Better yet,
shouldn't it wait until D2 tells it: "Okay, A2 is safely suspended and
I'm not going to talk to it for a while, you can suspend the link"?

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: question on flushing buffers and spinning down disk, Oliver Neukum, (Mon Sep 24, 3:33 am)
Re: question on flushing buffers and spinning down disk, Oliver Neukum, (Mon Sep 24, 8:21 am)
Re: question on flushing buffers and spinning down disk, Oliver Neukum, (Mon Sep 24, 9:47 am)
Re: question on flushing buffers and spinning down disk, Oliver Neukum, (Thu Sep 27, 11:12 am)
Re: question on flushing buffers and spinning down disk, Oliver Neukum, (Fri Sep 28, 2:47 pm)
Re: [linux-usb-devel] question on flushing buffers and spi ..., Alan Stern, (Sat Sep 29, 9:38 am)
Re: question on flushing buffers and spinning down disk, David Brownell, (Sat Sep 29, 2:03 pm)