diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-25 17:29:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-25 17:29:53 -0400 |
commit | bfffa1cc9db8a950dd4b1a09999f8a20e69a6652 (patch) | |
tree | 01b046072ca9105b7852f790762f7b00b72e6ff7 /drivers/ide | |
parent | cc8a0a943948d1b1bc803b37486831af7b04dd38 (diff) | |
parent | ae994ea972473c0ace9d55f718b60f0727af1381 (diff) |
Merge branch 'for-4.2/core' of git://git.kernel.dk/linux-block
Pull core block IO update from Jens Axboe:
"Nothing really major in here, mostly a collection of smaller
optimizations and cleanups, mixed with various fixes. In more detail,
this contains:
- Addition of policy specific data to blkcg for block cgroups. From
Arianna Avanzini.
- Various cleanups around command types from Christoph.
- Cleanup of the suspend block I/O path from Christoph.
- Plugging updates from Shaohua and Jeff Moyer, for blk-mq.
- Eliminating atomic inc/dec of both remaining IO count and reference
count in a bio. From me.
- Fixes for SG gap and chunk size support for data-less (discards)
IO, so we can merge these better. From me.
- Small restructuring of blk-mq shared tag support, freeing drivers
from iterating hardware queues. From Keith Busch.
- A few cfq-iosched tweaks, from Tahsin Erdogan and me. Makes the
IOPS mode the default for non-rotational storage"
* 'for-4.2/core' of git://git.kernel.dk/linux-block: (35 commits)
cfq-iosched: fix other locations where blkcg_to_cfqgd() can return NULL
cfq-iosched: fix sysfs oops when attempting to read unconfigured weights
cfq-iosched: move group scheduling functions under ifdef
cfq-iosched: fix the setting of IOPS mode on SSDs
blktrace: Add blktrace.c to BLOCK LAYER in MAINTAINERS file
block, cgroup: implement policy-specific per-blkcg data
block: Make CFQ default to IOPS mode on SSDs
block: add blk_set_queue_dying() to blkdev.h
blk-mq: Shared tag enhancements
block: don't honor chunk sizes for data-less IO
block: only honor SG gap prevention for merges that contain data
block: fix returnvar.cocci warnings
block, dm: don't copy bios for request clones
block: remove management of bi_remaining when restoring original bi_end_io
block: replace trylock with mutex_lock in blkdev_reread_part()
block: export blkdev_reread_part() and __blkdev_reread_part()
suspend: simplify block I/O handling
block: collapse bio bit space
block: remove unused BIO_RW_BLOCK and BIO_EOF flags
block: remove BIO_EOPNOTSUPP
...
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-atapi.c | 10 | ||||
-rw-r--r-- | drivers/ide/ide-cd.c | 10 | ||||
-rw-r--r-- | drivers/ide/ide-cd_ioctl.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-devsets.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-eh.c | 4 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 8 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 12 | ||||
-rw-r--r-- | drivers/ide/ide-ioctls.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-park.c | 4 | ||||
-rw-r--r-- | drivers/ide/ide-pm.c | 56 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 6 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 2 |
12 files changed, 74 insertions, 44 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index fac3d9da2e07..1362ad80a76c 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -93,7 +93,7 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk, | |||
93 | int error; | 93 | int error; |
94 | 94 | ||
95 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); | 95 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
96 | rq->cmd_type = REQ_TYPE_SPECIAL; | 96 | rq->cmd_type = REQ_TYPE_DRV_PRIV; |
97 | rq->special = (char *)pc; | 97 | rq->special = (char *)pc; |
98 | 98 | ||
99 | if (buf && bufflen) { | 99 | if (buf && bufflen) { |
@@ -191,7 +191,7 @@ void ide_prep_sense(ide_drive_t *drive, struct request *rq) | |||
191 | 191 | ||
192 | BUG_ON(sense_len > sizeof(*sense)); | 192 | BUG_ON(sense_len > sizeof(*sense)); |
193 | 193 | ||
194 | if (rq->cmd_type == REQ_TYPE_SENSE || drive->sense_rq_armed) | 194 | if (rq->cmd_type == REQ_TYPE_ATA_SENSE || drive->sense_rq_armed) |
195 | return; | 195 | return; |
196 | 196 | ||
197 | memset(sense, 0, sizeof(*sense)); | 197 | memset(sense, 0, sizeof(*sense)); |
@@ -210,7 +210,7 @@ void ide_prep_sense(ide_drive_t *drive, struct request *rq) | |||
210 | sense_rq->rq_disk = rq->rq_disk; | 210 | sense_rq->rq_disk = rq->rq_disk; |
211 | sense_rq->cmd[0] = GPCMD_REQUEST_SENSE; | 211 | sense_rq->cmd[0] = GPCMD_REQUEST_SENSE; |
212 | sense_rq->cmd[4] = cmd_len; | 212 | sense_rq->cmd[4] = cmd_len; |
213 | sense_rq->cmd_type = REQ_TYPE_SENSE; | 213 | sense_rq->cmd_type = REQ_TYPE_ATA_SENSE; |
214 | sense_rq->cmd_flags |= REQ_PREEMPT; | 214 | sense_rq->cmd_flags |= REQ_PREEMPT; |
215 | 215 | ||
216 | if (drive->media == ide_tape) | 216 | if (drive->media == ide_tape) |
@@ -310,7 +310,7 @@ int ide_cd_get_xferlen(struct request *rq) | |||
310 | switch (rq->cmd_type) { | 310 | switch (rq->cmd_type) { |
311 | case REQ_TYPE_FS: | 311 | case REQ_TYPE_FS: |
312 | return 32768; | 312 | return 32768; |
313 | case REQ_TYPE_SENSE: | 313 | case REQ_TYPE_ATA_SENSE: |
314 | case REQ_TYPE_BLOCK_PC: | 314 | case REQ_TYPE_BLOCK_PC: |
315 | case REQ_TYPE_ATA_PC: | 315 | case REQ_TYPE_ATA_PC: |
316 | return blk_rq_bytes(rq); | 316 | return blk_rq_bytes(rq); |
@@ -477,7 +477,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive) | |||
477 | if (uptodate == 0) | 477 | if (uptodate == 0) |
478 | drive->failed_pc = NULL; | 478 | drive->failed_pc = NULL; |
479 | 479 | ||
480 | if (rq->cmd_type == REQ_TYPE_SPECIAL) { | 480 | if (rq->cmd_type == REQ_TYPE_DRV_PRIV) { |
481 | rq->errors = 0; | 481 | rq->errors = 0; |
482 | error = 0; | 482 | error = 0; |
483 | } else { | 483 | } else { |
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 0b510bafd90e..64a6b827b3dd 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -210,7 +210,7 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive, | |||
210 | static void ide_cd_complete_failed_rq(ide_drive_t *drive, struct request *rq) | 210 | static void ide_cd_complete_failed_rq(ide_drive_t *drive, struct request *rq) |
211 | { | 211 | { |
212 | /* | 212 | /* |
213 | * For REQ_TYPE_SENSE, "rq->special" points to the original | 213 | * For REQ_TYPE_ATA_SENSE, "rq->special" points to the original |
214 | * failed request. Also, the sense data should be read | 214 | * failed request. Also, the sense data should be read |
215 | * directly from rq which might be different from the original | 215 | * directly from rq which might be different from the original |
216 | * sense buffer if it got copied during mapping. | 216 | * sense buffer if it got copied during mapping. |
@@ -285,7 +285,7 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat) | |||
285 | "stat 0x%x", | 285 | "stat 0x%x", |
286 | rq->cmd[0], rq->cmd_type, err, stat); | 286 | rq->cmd[0], rq->cmd_type, err, stat); |
287 | 287 | ||
288 | if (rq->cmd_type == REQ_TYPE_SENSE) { | 288 | if (rq->cmd_type == REQ_TYPE_ATA_SENSE) { |
289 | /* | 289 | /* |
290 | * We got an error trying to get sense info from the drive | 290 | * We got an error trying to get sense info from the drive |
291 | * (probably while trying to recover from a former error). | 291 | * (probably while trying to recover from a former error). |
@@ -526,7 +526,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
526 | ide_expiry_t *expiry = NULL; | 526 | ide_expiry_t *expiry = NULL; |
527 | int dma_error = 0, dma, thislen, uptodate = 0; | 527 | int dma_error = 0, dma, thislen, uptodate = 0; |
528 | int write = (rq_data_dir(rq) == WRITE) ? 1 : 0, rc = 0; | 528 | int write = (rq_data_dir(rq) == WRITE) ? 1 : 0, rc = 0; |
529 | int sense = (rq->cmd_type == REQ_TYPE_SENSE); | 529 | int sense = (rq->cmd_type == REQ_TYPE_ATA_SENSE); |
530 | unsigned int timeout; | 530 | unsigned int timeout; |
531 | u16 len; | 531 | u16 len; |
532 | u8 ireason, stat; | 532 | u8 ireason, stat; |
@@ -791,7 +791,7 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | |||
791 | if (cdrom_start_rw(drive, rq) == ide_stopped) | 791 | if (cdrom_start_rw(drive, rq) == ide_stopped) |
792 | goto out_end; | 792 | goto out_end; |
793 | break; | 793 | break; |
794 | case REQ_TYPE_SENSE: | 794 | case REQ_TYPE_ATA_SENSE: |
795 | case REQ_TYPE_BLOCK_PC: | 795 | case REQ_TYPE_BLOCK_PC: |
796 | case REQ_TYPE_ATA_PC: | 796 | case REQ_TYPE_ATA_PC: |
797 | if (!rq->timeout) | 797 | if (!rq->timeout) |
@@ -799,7 +799,7 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | |||
799 | 799 | ||
800 | cdrom_do_block_pc(drive, rq); | 800 | cdrom_do_block_pc(drive, rq); |
801 | break; | 801 | break; |
802 | case REQ_TYPE_SPECIAL: | 802 | case REQ_TYPE_DRV_PRIV: |
803 | /* right now this can only be a reset... */ | 803 | /* right now this can only be a reset... */ |
804 | uptodate = 1; | 804 | uptodate = 1; |
805 | goto out_end; | 805 | goto out_end; |
diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c index 02caa7dd51c8..066e39036518 100644 --- a/drivers/ide/ide-cd_ioctl.c +++ b/drivers/ide/ide-cd_ioctl.c | |||
@@ -304,7 +304,7 @@ int ide_cdrom_reset(struct cdrom_device_info *cdi) | |||
304 | int ret; | 304 | int ret; |
305 | 305 | ||
306 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); | 306 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
307 | rq->cmd_type = REQ_TYPE_SPECIAL; | 307 | rq->cmd_type = REQ_TYPE_DRV_PRIV; |
308 | rq->cmd_flags = REQ_QUIET; | 308 | rq->cmd_flags = REQ_QUIET; |
309 | ret = blk_execute_rq(drive->queue, cd->disk, rq, 0); | 309 | ret = blk_execute_rq(drive->queue, cd->disk, rq, 0); |
310 | blk_put_request(rq); | 310 | blk_put_request(rq); |
diff --git a/drivers/ide/ide-devsets.c b/drivers/ide/ide-devsets.c index 9e98122f646e..b05a74d78ef5 100644 --- a/drivers/ide/ide-devsets.c +++ b/drivers/ide/ide-devsets.c | |||
@@ -166,7 +166,7 @@ int ide_devset_execute(ide_drive_t *drive, const struct ide_devset *setting, | |||
166 | return setting->set(drive, arg); | 166 | return setting->set(drive, arg); |
167 | 167 | ||
168 | rq = blk_get_request(q, READ, __GFP_WAIT); | 168 | rq = blk_get_request(q, READ, __GFP_WAIT); |
169 | rq->cmd_type = REQ_TYPE_SPECIAL; | 169 | rq->cmd_type = REQ_TYPE_DRV_PRIV; |
170 | rq->cmd_len = 5; | 170 | rq->cmd_len = 5; |
171 | rq->cmd[0] = REQ_DEVSET_EXEC; | 171 | rq->cmd[0] = REQ_DEVSET_EXEC; |
172 | *(int *)&rq->cmd[1] = arg; | 172 | *(int *)&rq->cmd[1] = arg; |
diff --git a/drivers/ide/ide-eh.c b/drivers/ide/ide-eh.c index 32970664c275..d6da011299f5 100644 --- a/drivers/ide/ide-eh.c +++ b/drivers/ide/ide-eh.c | |||
@@ -129,7 +129,7 @@ ide_startstop_t ide_error(ide_drive_t *drive, const char *msg, u8 stat) | |||
129 | 129 | ||
130 | if (cmd) | 130 | if (cmd) |
131 | ide_complete_cmd(drive, cmd, stat, err); | 131 | ide_complete_cmd(drive, cmd, stat, err); |
132 | } else if (blk_pm_request(rq)) { | 132 | } else if (ata_pm_request(rq)) { |
133 | rq->errors = 1; | 133 | rq->errors = 1; |
134 | ide_complete_pm_rq(drive, rq); | 134 | ide_complete_pm_rq(drive, rq); |
135 | return ide_stopped; | 135 | return ide_stopped; |
@@ -147,7 +147,7 @@ static inline void ide_complete_drive_reset(ide_drive_t *drive, int err) | |||
147 | { | 147 | { |
148 | struct request *rq = drive->hwif->rq; | 148 | struct request *rq = drive->hwif->rq; |
149 | 149 | ||
150 | if (rq && rq->cmd_type == REQ_TYPE_SPECIAL && | 150 | if (rq && rq->cmd_type == REQ_TYPE_DRV_PRIV && |
151 | rq->cmd[0] == REQ_DRIVE_RESET) { | 151 | rq->cmd[0] == REQ_DRIVE_RESET) { |
152 | if (err <= 0 && rq->errors == 0) | 152 | if (err <= 0 && rq->errors == 0) |
153 | rq->errors = -EIO; | 153 | rq->errors = -EIO; |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 8c6363cdd208..2fb5350c5410 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -97,7 +97,7 @@ static int ide_floppy_callback(ide_drive_t *drive, int dsc) | |||
97 | "Aborting request!\n"); | 97 | "Aborting request!\n"); |
98 | } | 98 | } |
99 | 99 | ||
100 | if (rq->cmd_type == REQ_TYPE_SPECIAL) | 100 | if (rq->cmd_type == REQ_TYPE_DRV_PRIV) |
101 | rq->errors = uptodate ? 0 : IDE_DRV_ERROR_GENERAL; | 101 | rq->errors = uptodate ? 0 : IDE_DRV_ERROR_GENERAL; |
102 | 102 | ||
103 | return uptodate; | 103 | return uptodate; |
@@ -246,7 +246,7 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive, | |||
246 | } else | 246 | } else |
247 | printk(KERN_ERR PFX "%s: I/O error\n", drive->name); | 247 | printk(KERN_ERR PFX "%s: I/O error\n", drive->name); |
248 | 248 | ||
249 | if (rq->cmd_type == REQ_TYPE_SPECIAL) { | 249 | if (rq->cmd_type == REQ_TYPE_DRV_PRIV) { |
250 | rq->errors = 0; | 250 | rq->errors = 0; |
251 | ide_complete_rq(drive, 0, blk_rq_bytes(rq)); | 251 | ide_complete_rq(drive, 0, blk_rq_bytes(rq)); |
252 | return ide_stopped; | 252 | return ide_stopped; |
@@ -265,8 +265,8 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive, | |||
265 | pc = &floppy->queued_pc; | 265 | pc = &floppy->queued_pc; |
266 | idefloppy_create_rw_cmd(drive, pc, rq, (unsigned long)block); | 266 | idefloppy_create_rw_cmd(drive, pc, rq, (unsigned long)block); |
267 | break; | 267 | break; |
268 | case REQ_TYPE_SPECIAL: | 268 | case REQ_TYPE_DRV_PRIV: |
269 | case REQ_TYPE_SENSE: | 269 | case REQ_TYPE_ATA_SENSE: |
270 | pc = (struct ide_atapi_pc *)rq->special; | 270 | pc = (struct ide_atapi_pc *)rq->special; |
271 | break; | 271 | break; |
272 | case REQ_TYPE_BLOCK_PC: | 272 | case REQ_TYPE_BLOCK_PC: |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 177db6d5b2f5..669ea1e45795 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -135,7 +135,7 @@ EXPORT_SYMBOL(ide_complete_rq); | |||
135 | 135 | ||
136 | void ide_kill_rq(ide_drive_t *drive, struct request *rq) | 136 | void ide_kill_rq(ide_drive_t *drive, struct request *rq) |
137 | { | 137 | { |
138 | u8 drv_req = (rq->cmd_type == REQ_TYPE_SPECIAL) && rq->rq_disk; | 138 | u8 drv_req = (rq->cmd_type == REQ_TYPE_DRV_PRIV) && rq->rq_disk; |
139 | u8 media = drive->media; | 139 | u8 media = drive->media; |
140 | 140 | ||
141 | drive->failed_pc = NULL; | 141 | drive->failed_pc = NULL; |
@@ -320,7 +320,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) | |||
320 | goto kill_rq; | 320 | goto kill_rq; |
321 | } | 321 | } |
322 | 322 | ||
323 | if (blk_pm_request(rq)) | 323 | if (ata_pm_request(rq)) |
324 | ide_check_pm_state(drive, rq); | 324 | ide_check_pm_state(drive, rq); |
325 | 325 | ||
326 | drive->hwif->tp_ops->dev_select(drive); | 326 | drive->hwif->tp_ops->dev_select(drive); |
@@ -342,8 +342,8 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) | |||
342 | 342 | ||
343 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) | 343 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) |
344 | return execute_drive_cmd(drive, rq); | 344 | return execute_drive_cmd(drive, rq); |
345 | else if (blk_pm_request(rq)) { | 345 | else if (ata_pm_request(rq)) { |
346 | struct request_pm_state *pm = rq->special; | 346 | struct ide_pm_state *pm = rq->special; |
347 | #ifdef DEBUG_PM | 347 | #ifdef DEBUG_PM |
348 | printk("%s: start_power_step(step: %d)\n", | 348 | printk("%s: start_power_step(step: %d)\n", |
349 | drive->name, pm->pm_step); | 349 | drive->name, pm->pm_step); |
@@ -353,7 +353,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) | |||
353 | pm->pm_step == IDE_PM_COMPLETED) | 353 | pm->pm_step == IDE_PM_COMPLETED) |
354 | ide_complete_pm_rq(drive, rq); | 354 | ide_complete_pm_rq(drive, rq); |
355 | return startstop; | 355 | return startstop; |
356 | } else if (!rq->rq_disk && rq->cmd_type == REQ_TYPE_SPECIAL) | 356 | } else if (!rq->rq_disk && rq->cmd_type == REQ_TYPE_DRV_PRIV) |
357 | /* | 357 | /* |
358 | * TODO: Once all ULDs have been modified to | 358 | * TODO: Once all ULDs have been modified to |
359 | * check for specific op codes rather than | 359 | * check for specific op codes rather than |
@@ -538,7 +538,7 @@ repeat: | |||
538 | * state machine. | 538 | * state machine. |
539 | */ | 539 | */ |
540 | if ((drive->dev_flags & IDE_DFLAG_BLOCKED) && | 540 | if ((drive->dev_flags & IDE_DFLAG_BLOCKED) && |
541 | blk_pm_request(rq) == 0 && | 541 | ata_pm_request(rq) == 0 && |
542 | (rq->cmd_flags & REQ_PREEMPT) == 0) { | 542 | (rq->cmd_flags & REQ_PREEMPT) == 0) { |
543 | /* there should be no pending command at this point */ | 543 | /* there should be no pending command at this point */ |
544 | ide_unlock_port(hwif); | 544 | ide_unlock_port(hwif); |
diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c index 6233fa2cb8a9..aa2e9b77b20d 100644 --- a/drivers/ide/ide-ioctls.c +++ b/drivers/ide/ide-ioctls.c | |||
@@ -222,7 +222,7 @@ static int generic_drive_reset(ide_drive_t *drive) | |||
222 | int ret = 0; | 222 | int ret = 0; |
223 | 223 | ||
224 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); | 224 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
225 | rq->cmd_type = REQ_TYPE_SPECIAL; | 225 | rq->cmd_type = REQ_TYPE_DRV_PRIV; |
226 | rq->cmd_len = 1; | 226 | rq->cmd_len = 1; |
227 | rq->cmd[0] = REQ_DRIVE_RESET; | 227 | rq->cmd[0] = REQ_DRIVE_RESET; |
228 | if (blk_execute_rq(drive->queue, NULL, rq, 1)) | 228 | if (blk_execute_rq(drive->queue, NULL, rq, 1)) |
diff --git a/drivers/ide/ide-park.c b/drivers/ide/ide-park.c index ca958604cda2..c80868520488 100644 --- a/drivers/ide/ide-park.c +++ b/drivers/ide/ide-park.c | |||
@@ -34,7 +34,7 @@ static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout) | |||
34 | rq = blk_get_request(q, READ, __GFP_WAIT); | 34 | rq = blk_get_request(q, READ, __GFP_WAIT); |
35 | rq->cmd[0] = REQ_PARK_HEADS; | 35 | rq->cmd[0] = REQ_PARK_HEADS; |
36 | rq->cmd_len = 1; | 36 | rq->cmd_len = 1; |
37 | rq->cmd_type = REQ_TYPE_SPECIAL; | 37 | rq->cmd_type = REQ_TYPE_DRV_PRIV; |
38 | rq->special = &timeout; | 38 | rq->special = &timeout; |
39 | rc = blk_execute_rq(q, NULL, rq, 1); | 39 | rc = blk_execute_rq(q, NULL, rq, 1); |
40 | blk_put_request(rq); | 40 | blk_put_request(rq); |
@@ -51,7 +51,7 @@ static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout) | |||
51 | 51 | ||
52 | rq->cmd[0] = REQ_UNPARK_HEADS; | 52 | rq->cmd[0] = REQ_UNPARK_HEADS; |
53 | rq->cmd_len = 1; | 53 | rq->cmd_len = 1; |
54 | rq->cmd_type = REQ_TYPE_SPECIAL; | 54 | rq->cmd_type = REQ_TYPE_DRV_PRIV; |
55 | elv_add_request(q, rq, ELEVATOR_INSERT_FRONT); | 55 | elv_add_request(q, rq, ELEVATOR_INSERT_FRONT); |
56 | 56 | ||
57 | out: | 57 | out: |
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c index 8d1e32d7cd97..081e43458d50 100644 --- a/drivers/ide/ide-pm.c +++ b/drivers/ide/ide-pm.c | |||
@@ -8,7 +8,7 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg) | |||
8 | ide_drive_t *pair = ide_get_pair_dev(drive); | 8 | ide_drive_t *pair = ide_get_pair_dev(drive); |
9 | ide_hwif_t *hwif = drive->hwif; | 9 | ide_hwif_t *hwif = drive->hwif; |
10 | struct request *rq; | 10 | struct request *rq; |
11 | struct request_pm_state rqpm; | 11 | struct ide_pm_state rqpm; |
12 | int ret; | 12 | int ret; |
13 | 13 | ||
14 | if (ide_port_acpi(hwif)) { | 14 | if (ide_port_acpi(hwif)) { |
@@ -19,7 +19,7 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg) | |||
19 | 19 | ||
20 | memset(&rqpm, 0, sizeof(rqpm)); | 20 | memset(&rqpm, 0, sizeof(rqpm)); |
21 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); | 21 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
22 | rq->cmd_type = REQ_TYPE_PM_SUSPEND; | 22 | rq->cmd_type = REQ_TYPE_ATA_PM_SUSPEND; |
23 | rq->special = &rqpm; | 23 | rq->special = &rqpm; |
24 | rqpm.pm_step = IDE_PM_START_SUSPEND; | 24 | rqpm.pm_step = IDE_PM_START_SUSPEND; |
25 | if (mesg.event == PM_EVENT_PRETHAW) | 25 | if (mesg.event == PM_EVENT_PRETHAW) |
@@ -38,13 +38,43 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg) | |||
38 | return ret; | 38 | return ret; |
39 | } | 39 | } |
40 | 40 | ||
41 | static void ide_end_sync_rq(struct request *rq, int error) | ||
42 | { | ||
43 | complete(rq->end_io_data); | ||
44 | } | ||
45 | |||
46 | static int ide_pm_execute_rq(struct request *rq) | ||
47 | { | ||
48 | struct request_queue *q = rq->q; | ||
49 | DECLARE_COMPLETION_ONSTACK(wait); | ||
50 | |||
51 | rq->end_io_data = &wait; | ||
52 | rq->end_io = ide_end_sync_rq; | ||
53 | |||
54 | spin_lock_irq(q->queue_lock); | ||
55 | if (unlikely(blk_queue_dying(q))) { | ||
56 | rq->cmd_flags |= REQ_QUIET; | ||
57 | rq->errors = -ENXIO; | ||
58 | __blk_end_request_all(rq, rq->errors); | ||
59 | spin_unlock_irq(q->queue_lock); | ||
60 | return -ENXIO; | ||
61 | } | ||
62 | __elv_add_request(q, rq, ELEVATOR_INSERT_FRONT); | ||
63 | __blk_run_queue_uncond(q); | ||
64 | spin_unlock_irq(q->queue_lock); | ||
65 | |||
66 | wait_for_completion_io(&wait); | ||
67 | |||
68 | return rq->errors ? -EIO : 0; | ||
69 | } | ||
70 | |||
41 | int generic_ide_resume(struct device *dev) | 71 | int generic_ide_resume(struct device *dev) |
42 | { | 72 | { |
43 | ide_drive_t *drive = to_ide_device(dev); | 73 | ide_drive_t *drive = to_ide_device(dev); |
44 | ide_drive_t *pair = ide_get_pair_dev(drive); | 74 | ide_drive_t *pair = ide_get_pair_dev(drive); |
45 | ide_hwif_t *hwif = drive->hwif; | 75 | ide_hwif_t *hwif = drive->hwif; |
46 | struct request *rq; | 76 | struct request *rq; |
47 | struct request_pm_state rqpm; | 77 | struct ide_pm_state rqpm; |
48 | int err; | 78 | int err; |
49 | 79 | ||
50 | if (ide_port_acpi(hwif)) { | 80 | if (ide_port_acpi(hwif)) { |
@@ -59,13 +89,13 @@ int generic_ide_resume(struct device *dev) | |||
59 | 89 | ||
60 | memset(&rqpm, 0, sizeof(rqpm)); | 90 | memset(&rqpm, 0, sizeof(rqpm)); |
61 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); | 91 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
62 | rq->cmd_type = REQ_TYPE_PM_RESUME; | 92 | rq->cmd_type = REQ_TYPE_ATA_PM_RESUME; |
63 | rq->cmd_flags |= REQ_PREEMPT; | 93 | rq->cmd_flags |= REQ_PREEMPT; |
64 | rq->special = &rqpm; | 94 | rq->special = &rqpm; |
65 | rqpm.pm_step = IDE_PM_START_RESUME; | 95 | rqpm.pm_step = IDE_PM_START_RESUME; |
66 | rqpm.pm_state = PM_EVENT_ON; | 96 | rqpm.pm_state = PM_EVENT_ON; |
67 | 97 | ||
68 | err = blk_execute_rq(drive->queue, NULL, rq, 1); | 98 | err = ide_pm_execute_rq(rq); |
69 | blk_put_request(rq); | 99 | blk_put_request(rq); |
70 | 100 | ||
71 | if (err == 0 && dev->driver) { | 101 | if (err == 0 && dev->driver) { |
@@ -80,7 +110,7 @@ int generic_ide_resume(struct device *dev) | |||
80 | 110 | ||
81 | void ide_complete_power_step(ide_drive_t *drive, struct request *rq) | 111 | void ide_complete_power_step(ide_drive_t *drive, struct request *rq) |
82 | { | 112 | { |
83 | struct request_pm_state *pm = rq->special; | 113 | struct ide_pm_state *pm = rq->special; |
84 | 114 | ||
85 | #ifdef DEBUG_PM | 115 | #ifdef DEBUG_PM |
86 | printk(KERN_INFO "%s: complete_power_step(step: %d)\n", | 116 | printk(KERN_INFO "%s: complete_power_step(step: %d)\n", |
@@ -110,7 +140,7 @@ void ide_complete_power_step(ide_drive_t *drive, struct request *rq) | |||
110 | 140 | ||
111 | ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq) | 141 | ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq) |
112 | { | 142 | { |
113 | struct request_pm_state *pm = rq->special; | 143 | struct ide_pm_state *pm = rq->special; |
114 | struct ide_cmd cmd = { }; | 144 | struct ide_cmd cmd = { }; |
115 | 145 | ||
116 | switch (pm->pm_step) { | 146 | switch (pm->pm_step) { |
@@ -182,7 +212,7 @@ out_do_tf: | |||
182 | void ide_complete_pm_rq(ide_drive_t *drive, struct request *rq) | 212 | void ide_complete_pm_rq(ide_drive_t *drive, struct request *rq) |
183 | { | 213 | { |
184 | struct request_queue *q = drive->queue; | 214 | struct request_queue *q = drive->queue; |
185 | struct request_pm_state *pm = rq->special; | 215 | struct ide_pm_state *pm = rq->special; |
186 | unsigned long flags; | 216 | unsigned long flags; |
187 | 217 | ||
188 | ide_complete_power_step(drive, rq); | 218 | ide_complete_power_step(drive, rq); |
@@ -191,10 +221,10 @@ void ide_complete_pm_rq(ide_drive_t *drive, struct request *rq) | |||
191 | 221 | ||
192 | #ifdef DEBUG_PM | 222 | #ifdef DEBUG_PM |
193 | printk("%s: completing PM request, %s\n", drive->name, | 223 | printk("%s: completing PM request, %s\n", drive->name, |
194 | (rq->cmd_type == REQ_TYPE_PM_SUSPEND) ? "suspend" : "resume"); | 224 | (rq->cmd_type == REQ_TYPE_ATA_PM_SUSPEND) ? "suspend" : "resume"); |
195 | #endif | 225 | #endif |
196 | spin_lock_irqsave(q->queue_lock, flags); | 226 | spin_lock_irqsave(q->queue_lock, flags); |
197 | if (rq->cmd_type == REQ_TYPE_PM_SUSPEND) | 227 | if (rq->cmd_type == REQ_TYPE_ATA_PM_SUSPEND) |
198 | blk_stop_queue(q); | 228 | blk_stop_queue(q); |
199 | else | 229 | else |
200 | drive->dev_flags &= ~IDE_DFLAG_BLOCKED; | 230 | drive->dev_flags &= ~IDE_DFLAG_BLOCKED; |
@@ -208,13 +238,13 @@ void ide_complete_pm_rq(ide_drive_t *drive, struct request *rq) | |||
208 | 238 | ||
209 | void ide_check_pm_state(ide_drive_t *drive, struct request *rq) | 239 | void ide_check_pm_state(ide_drive_t *drive, struct request *rq) |
210 | { | 240 | { |
211 | struct request_pm_state *pm = rq->special; | 241 | struct ide_pm_state *pm = rq->special; |
212 | 242 | ||
213 | if (rq->cmd_type == REQ_TYPE_PM_SUSPEND && | 243 | if (rq->cmd_type == REQ_TYPE_ATA_PM_SUSPEND && |
214 | pm->pm_step == IDE_PM_START_SUSPEND) | 244 | pm->pm_step == IDE_PM_START_SUSPEND) |
215 | /* Mark drive blocked when starting the suspend sequence. */ | 245 | /* Mark drive blocked when starting the suspend sequence. */ |
216 | drive->dev_flags |= IDE_DFLAG_BLOCKED; | 246 | drive->dev_flags |= IDE_DFLAG_BLOCKED; |
217 | else if (rq->cmd_type == REQ_TYPE_PM_RESUME && | 247 | else if (rq->cmd_type == REQ_TYPE_ATA_PM_RESUME && |
218 | pm->pm_step == IDE_PM_START_RESUME) { | 248 | pm->pm_step == IDE_PM_START_RESUME) { |
219 | /* | 249 | /* |
220 | * The first thing we do on wakeup is to wait for BSY bit to | 250 | * The first thing we do on wakeup is to wait for BSY bit to |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 6eb738ca6d2f..f5d51d1d09ee 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -576,8 +576,8 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, | |||
576 | rq->cmd[0], (unsigned long long)blk_rq_pos(rq), | 576 | rq->cmd[0], (unsigned long long)blk_rq_pos(rq), |
577 | blk_rq_sectors(rq)); | 577 | blk_rq_sectors(rq)); |
578 | 578 | ||
579 | BUG_ON(!(rq->cmd_type == REQ_TYPE_SPECIAL || | 579 | BUG_ON(!(rq->cmd_type == REQ_TYPE_DRV_PRIV || |
580 | rq->cmd_type == REQ_TYPE_SENSE)); | 580 | rq->cmd_type == REQ_TYPE_ATA_SENSE)); |
581 | 581 | ||
582 | /* Retry a failed packet command */ | 582 | /* Retry a failed packet command */ |
583 | if (drive->failed_pc && drive->pc->c[0] == REQUEST_SENSE) { | 583 | if (drive->failed_pc && drive->pc->c[0] == REQUEST_SENSE) { |
@@ -853,7 +853,7 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int size) | |||
853 | BUG_ON(size < 0 || size % tape->blk_size); | 853 | BUG_ON(size < 0 || size % tape->blk_size); |
854 | 854 | ||
855 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); | 855 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
856 | rq->cmd_type = REQ_TYPE_SPECIAL; | 856 | rq->cmd_type = REQ_TYPE_DRV_PRIV; |
857 | rq->cmd[13] = cmd; | 857 | rq->cmd[13] = cmd; |
858 | rq->rq_disk = tape->disk; | 858 | rq->rq_disk = tape->disk; |
859 | rq->__sector = tape->first_frame; | 859 | rq->__sector = tape->first_frame; |
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index dabb88b1cbec..0979e126fff1 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -186,7 +186,7 @@ static ide_startstop_t task_no_data_intr(ide_drive_t *drive) | |||
186 | tf->command == ATA_CMD_CHK_POWER) { | 186 | tf->command == ATA_CMD_CHK_POWER) { |
187 | struct request *rq = hwif->rq; | 187 | struct request *rq = hwif->rq; |
188 | 188 | ||
189 | if (blk_pm_request(rq)) | 189 | if (ata_pm_request(rq)) |
190 | ide_complete_pm_rq(drive, rq); | 190 | ide_complete_pm_rq(drive, rq); |
191 | else | 191 | else |
192 | ide_finish_cmd(drive, cmd, stat); | 192 | ide_finish_cmd(drive, cmd, stat); |