two more fixes for block/for-linus
Subsystems (2)
Fix two regressions with the timer/blk_mq_start_request changes found when using scsi-mq on an ATA device.
Note that given how late we are in the cycle I wonder if we really should push the changes in block/for-linus to Linus in this cycle. The race part of the timer fixes is extremly narrow, and the reserved request part of it requires an out of tree driver update to trigger it, so it doesn't sound super criticial.
PATCH 1/2 block: fix blk_abort_request on blk-mq
--- block/blk-mq.c | 2 +- block/blk-timeout.c | 5 ++++- block/blk.h | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-)
block/blk-mq.c +1 -1
@@ -531,7 +531,7 @@ struct blk_mq_timeout_data {unsigned int next_set; }; -static void blk_mq_rq_timed_out (struct request *req,bool reserved) +void blk_mq_rq_timed_out (struct request *req,bool reserved) {struct blk_mq_ops *ops = req->q->mq_ops;enum blk_eh_timer_return ret =BLK_EH_RESET_TIMER ;
block/blk-timeout.c +4 -1
@@ -158,7 +158,10 @@ void blk_abort_request(struct request *req)if (blk_mark_rq_complete (req))return ;blk_delete_timer (req); -blk_rq_timed_out (req); +if (req->q->mq_ops) +blk_mq_rq_timed_out (req, false); +else +blk_rq_timed_out (req); }EXPORT_SYMBOL_GPL (blk_abort_request);
block/blk.h +2 -0
@@ -250,4 +250,6 @@ static inline int blk_throtl_init(struct request_queue *q) { return 0; }static inline void blk_throtl_exit (struct request_queue *q) { }#endif /* CONFIG_BLK_DEV_THROTTLING */ +extern void blk_mq_rq_timed_out (struct request *req,bool reserved); +#endif /* BLK_INTERNAL_H */
Signature · 1 line
1.9.1
Re: [PATCH 1/2] block: fix blk_abort_request on blk-mq
Quoted 12 lines · Christoph Hellwig
Signed-off-by Christoph Hellwig <[email protected]>--- block/blk-mq.c | 2 +- block/blk-timeout.c | 5 ++++- block/blk.h | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-)block/blk.h +0
-0
block/blk.h static inline int blk_throtl_init(struct request_queue *q) { return 0; } · line 253
Quoted 4 lines
block/blk.h +1
-0@@ -250,4 +250,6 @@ static inline int blk_throtl_init(struct request_queue *q) { return 0; }static inline void blk_throtl_exit (struct request_queue *q) { }#endif /* CONFIG_BLK_DEV_THROTTLING */ +extern void blk_mq_rq_timed_out (struct request *req,bool reserved);
Moving this to blk-mq.h.
Applied.
Signature · 1 line
Jens Axboe
PATCH 2/2 scsi: move blk_mq_start_request call earlier
In reply to Christoph HellwigSome ATA drivers need the dma drain size workaround, and thus need to call blk_mq_start_request before the S/G mapping.
--- drivers/scsi/scsi_lib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/scsi/scsi_lib.c +5 -1
@@ -1846,6 +1846,8 @@ static int scsi_mq_prep_fn(struct request *req) next_rq->special = bidi_sdb; } +blk_mq_start_request (req); +return scsi_setup_cmnd (sdev, req); }
@@ -1880,17 +1882,19 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx, struct request *req,if (!scsi_host_queue_ready (q, shost, sdev)) goto out_dec_target_busy; +if (!(req->cmd_flags &REQ_DONTPREP )) { ret =prep_to_mq (scsi_mq_prep_fn (req));if (ret) goto out_dec_host_busy; req->cmd_flags |=REQ_DONTPREP ; + }else { +blk_mq_start_request (req); }scsi_init_cmd_errh (cmd); cmd->scsi_done = scsi_mq_done; -blk_mq_start_request (req); reason =scsi_dispatch_cmd (cmd);if (reason) {scsi_set_blocked (cmd, reason);
Signature · 1 line
1.9.1
Jens Axboe
maintainerQuoted 8 lines · Christoph Hellwig
Fix two regressions with the timer/blk_mq_start_request changes found when using scsi-mq on an ATA device.
Note that given how late we are in the cycle I wonder if we really should push the changes in
block/for-linusto Linus in this cycle. The race part of the timer fixes is extremly narrow, and the reserved request part of it requires an out of tree driver update to trigger it, so it doesn't sound super criticial.
I was planning on pushing it out today, I've run a lot of testing on it internally last week. Ho hum, let me think about it...
Signature · 1 line
Jens Axboe
Quoted 4 lines · Jens Axboe
Quoted 3 lines · Christoph Hellwig
Fix two regressions with the timer/blk_mq_start_request changes found when using scsi-mq on an ATA device.
Quoted 8 lines
Quoted 5 lines
Note that given how late we are in the cycle I wonder if we really should push the changes in
block/for-linusto Linus in this cycle. The race part of the timer fixes is extremly narrow, and the reserved request part of it requires an out of tree driver update to trigger it, so it doesn't sound super criticial.I was planning on pushing it out today, I've run a lot of testing on it internally last week. Ho hum, let me think about it...
With these patches applied (actually a resync an hour ago with the for-linus tree which includes them), the freeze-during-boot-up problem that I have been seeing with an old SATA boot disk (perhaps 1.5 Gbps) for the last two weeks, has gone away.
That SATA disk is connected to the motherboard (Gigabyte Z97M-D3H/Z97M-D3H, BIOS F5 05/30/2014) and has a standard AHCI interface as far as I can tell. dmesg confirms that.
Please add "Tested-by: Douglas Gilbert <[email protected]>" to Christoph's "two more fixes for block/for-linus" series.
Doug Gilbert
Quoted 9 lines · Douglas Gilbert
With these patches applied (actually a resync an hour ago with the for-linus tree which includes them), the freeze-during-boot-up problem that I have been seeing with an old SATA boot disk (perhaps 1.5 Gbps) for the last two weeks, has gone away.
That SATA disk is connected to the motherboard (Gigabyte Z97M-D3H/Z97M-D3H, BIOS F5 05/30/2014) and has a standard AHCI interface as far as I can tell. dmesg confirms that.
Should have thought of the weird ATA error handling earlier. Sorry Doug!