remarkable-linux/drivers/ide
Elias Oltmanns 4abdc6ee7c ide: Implement disk shock protection support (v4)
On user request (through sysfs), the IDLE IMMEDIATE command with UNLOAD
FEATURE as specified in ATA-7 is issued to the device and processing of
the request queue is stopped thereafter until the specified timeout
expires or user space asks to resume normal operation. This is supposed
to prevent the heads of a hard drive from accidentally crashing onto the
platter when a heavy shock is anticipated (like a falling laptop expected
to hit the floor). Port resets are deferred whenever a device on that
port is in the parked state.

v3:
Elias Oltmanns <eo@nebensachen.de> wrote:
[...]
> >> 1. Make sure that no negative value is being passed to
> >>    jiffies_to_msecs() in ide_park_show().
> >> 2. Drop the superfluous variable hwif in ide_special_rq().
> >> 3. Skip initialisation of task and tf in ide_special_rq() if we are not
> >>    handling a (un)park request.
> >
> > Well, #3 should have been done differently because we donn't want to
> > check for REQ_(UN)?PARK_HEADS more often than is necessary.
> 
> While preparing the backport to 2.6.27, it has just occurred to me that
> we need to clear the IDE_DFLAG_PARKED flag in ide_disk_pre_reset()
> because this flag must not be set after *any* sort of access to the
> device.

v4:
Fix a memory leak due to a missing blk_put_request() in
issue_park_cmd(). Additionally, we should plug the queue when enqueueing
the unpark request because there is no guarantee that the park timeout
has not expired by then. Even though the chance for that to happen is
very slim, the request might end up hanging in the queue until the next
I/O operation is queued up. While at it, clean up the code a little:
- make issue_park_cmd() a function of type void since nobody cares for
  the return value anyway;
- use blk_start_queueing() instead of __blk_run_queue() since we don't
  have to worry about recursion;
- remove a superfluous pointer deference in task_no_data_intr().

Signed-off-by: Elias Oltmanns <eo@nebensachen.de>
Cc: Jeff Garzik <jeff@garzik.org>,
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13 21:39:50 +02:00
..
arm ide: make ide_dma_timeout() available also for CONFIG_BLK_DEV_IDEDMA_SFF=n 2008-10-13 21:39:46 +02:00
h8300 ide: remove [ata_]select_t 2008-10-13 21:39:40 +02:00
legacy ide: remove [ata_]select_t 2008-10-13 21:39:40 +02:00
mips ide: switch to DMA-mapping API part #2 2008-10-13 21:39:47 +02:00
pci piix: add Hercules EC-900 mini-notebook to ich_laptop short cable list 2008-10-13 21:39:50 +02:00
ppc pmac: remove needless pmac_ide_destroy_dmatable() wrapper 2008-10-13 21:39:45 +02:00
ide-acpi.c ide: add device flags 2008-10-13 21:39:36 +02:00
ide-atapi.c ide-atapi: assign taskfile flags per device type 2008-10-13 21:39:50 +02:00
ide-cd.c ide-cd: fix printk format warning 2008-10-13 21:39:50 +02:00
ide-cd.h ide-cd: move cdrom_info.dma to ide_drive_t.dma 2008-10-13 21:39:49 +02:00
ide-cd_ioctl.c ide: ide-cd_ioctl.c fix sparse integer as NULL pointer warnings 2008-07-23 19:56:02 +02:00
ide-cd_verbose.c
ide-disk.c ide-disk: move /proc handling to ide-disk_proc.c (take 3) 2008-10-13 21:39:45 +02:00
ide-disk.h ide-disk: move /proc handling to ide-disk_proc.c (take 3) 2008-10-13 21:39:45 +02:00
ide-disk_ioctl.c ide-disk: move all ioctl handling to ide-disk_ioctl.c 2008-10-13 21:39:45 +02:00
ide-disk_proc.c ide-disk: move /proc handling to ide-disk_proc.c (take 3) 2008-10-13 21:39:45 +02:00
ide-dma-sff.c ide: move SFF DMA code to ide-dma-sff.c 2008-10-13 21:39:47 +02:00
ide-dma.c ide: move SFF DMA code to ide-dma-sff.c 2008-10-13 21:39:47 +02:00
ide-floppy.c ide-floppy: move /proc handling to ide-floppy_proc.c (take 2) 2008-10-13 21:39:44 +02:00
ide-floppy.h ide-floppy: move /proc handling to ide-floppy_proc.c (take 2) 2008-10-13 21:39:44 +02:00
ide-floppy_ioctl.c ide-floppy: move all ioctl handling to ide-floppy_ioctl.c (take 2) 2008-10-13 21:39:44 +02:00
ide-floppy_proc.c ide-floppy: move /proc handling to ide-floppy_proc.c (take 2) 2008-10-13 21:39:44 +02:00
ide-generic.c ide-generic: remove no longer needed ide_probe_legacy() 2008-10-13 21:39:42 +02:00
ide-io.c ide: Implement disk shock protection support (v4) 2008-10-13 21:39:50 +02:00
ide-ioctls.c ide: add device flags 2008-10-13 21:39:36 +02:00
ide-iops.c ide: Implement disk shock protection support (v4) 2008-10-13 21:39:50 +02:00
ide-lib.c ide: add device flags 2008-10-13 21:39:36 +02:00
ide-park.c ide: Implement disk shock protection support (v4) 2008-10-13 21:39:50 +02:00
ide-pio-blacklist.c
ide-pnp.c ide: add ide_host_add() helper 2008-07-23 19:55:57 +02:00
ide-probe.c ide: Implement disk shock protection support (v4) 2008-10-13 21:39:50 +02:00
ide-proc.c ide: add device flags 2008-10-13 21:39:36 +02:00
ide-scan-pci.c
ide-tape.c ide: set IDE_AFLAG_DRQ_INTERRUPT in do_identify() 2008-10-13 21:39:43 +02:00
ide-taskfile.c ide: Implement disk shock protection support (v4) 2008-10-13 21:39:50 +02:00
ide-timings.c ide: include <linux/hdreg.h> only when needed 2008-10-10 22:39:27 +02:00
ide.c ide: Implement disk shock protection support (v4) 2008-10-13 21:39:50 +02:00
Kconfig ide: remove CONFIG_BLK_DEV_IDE config option (take 2) 2008-10-13 21:39:33 +02:00
Makefile ide: Implement disk shock protection support (v4) 2008-10-13 21:39:50 +02:00
setup-pci.c ide: add proper PCI PM support (v2) 2008-10-10 22:39:32 +02:00