I'm sorry, I don't know you, and you don't know me, but I've been paid to work on, with and in computer operating systems since 1983, and worked on computers and programmable devices since the 1970s. This information is misleading.
I've been working in operating systems for more than a decade, and have done a fair amount of block-storage driver development in that time.
An application writes data to files, and in rare cases, devices. No application writes data to USB.
You must have misread what I said. I never suggested that an application did anything of the sort. An application writes data to a file. The operating system's VFS layer translates that into a series of block operations. Down one layer further, the block storage driver stack translates that into a USB mass storage request. Next, somewhere way out on the USB bus, a bridge chip translates a USB mass storage request into a SATA request.
What I said was that the OS doesn't know that it's an ATA disk hanging off the USB bus. As far as the OS is concerned, it is talking to a USB device, not a SATA device. It has to trust that the USB-to-ATA bridge chip is translating requests sanely. The problem is that the translation step is very complex. USB mass storage packets don't even resemble ATA packets. As a result, there's significant potential for bugs, some of them rather severe.
If it were simple encapsulation of ATA packets, it wouldn't be a problem. But it isn't. USB mass storage is an unholy nightmare of a protocol (just like pretty much all the USB protocols, IMO). ATA is a very simple protocol (relatively speaking). Talking to a SATA drive using USB mass storage requests is a bit like having a conversation in which you say "I'm about to say a word. Hello. Did you hear that word?" followed by "I'm about to say a word. My. Did you hear that word?" and then having the person on the other end putting the words back together into a sentence and translating it into French before speaking it to somebody else....
In the case of storage devices, files reside on those storage devices. Yes, the actual hardware is not exposed to the file system, and hence application, but the file system "talks to" a storage device driver, which is designed to communicate with the actual storage device.
The actual hardware (meaning the SATA drive) is not exposed to the drivers, either. The OS sees a completely opaque USB-SATA bridge, which translates USB mass storage requests from the drivers and turns them into SATA requests, or translates them into addresses and writes them to a flash chip, or translates them into any number of other things.
Just because that device is connected to a USB hub does not mean that USB has anything to do with the processing of the data being transported over it, except insuring that both ends of the communication (driver and device) use USB properly.
That is misleading. First, I never said anything about USB hubs. Those are passive devices that just pass packets. I said USB-to-SATA
bridges, which are active devices that take a USB mass storage request from the OS and translate it into an ATA request that they then send to the actual device (the hard drive), and translate the responses from the actual device and send then over USB to the OS.
It's like having a wall wart power transformer plugged into the end of an extension cord. Although the power cord is a passive component that just passes power on, the transformer isn't.
It's the device driver that decides whether to cache data in system memory, or send it to the device
Yes and no. The device driver decides whether to cache data in system memory, but there can be multiple levels of cache between there and the actual magnetic medium. A typical hard drive has its own cache, called a track cache, that caches reads and writes in whole-track increments. The reason for this is that if the drive handled every single-block request in order, performance would suck horribly because each request would, on average, have to wait for the disk to spin halfway around. That track cache, when dirty, must be properly flushed to disk before the drive is powered down. If that doesn't happen, you get data loss.
USB does not participate in that communication, except to pass the data back and forth.
If by USB, you mean the USB controller on the motherboard, you're correct. However, the USB endpoint (the hard drive enclosure) most certainly does participate in the communication.
Notice that in that photo, the actual device—the ATA hard drive—is not visible in the device tree. The only thing you see is "ST315005 41AS USB device". In this particular case, the device name happens to be similar to the name of the SATA drive beyond it, but what you're seeing there is the USB-to-SATA bridge. If you use some other bridges, such as an Oxford 912 with the stock firmware, you'll typically see "Oxford Semiconductor" there, and the OS will have no idea of what the hard drive beyond it is. The only reason you see anything Seagate-specific at all is because Seagate provided a custom firmware image for its USB-SATA bridge that was programmed to call itself a "ST315005 41AS USB device".
Edit: Let me clarify this a bit - each piece in the I/O chain can "complete" the I/O. So, if at the point the data packet passes down the cable to the USB interface that's part of your external drive, that interface/chip, which is the last physical device seen says "done," then the result is the I/O completes. However, this is no different from FireWire, or anything else for that matter, since there's always a terminating device behind which the hardware & firmware do some magic.
That's true for FireWire. It's not true for eSATA because AFAIK, there is absolutely no translation being performed in the enclosure—only signal amplification and pulse reshaping. There's basically no way for an eSATA enclosure to lie because they're dumb as a brick.
And that was what I was trying to convey.