Re: Bug: audio playing broke with my SCSI CD and DVD drives in2.6.11-rc2-bk7 and beyond.

From: James Bottomley
Date: Mon Jan 31 2005 - 18:43:03 EST


On Tue, 2005-02-01 at 00:22 +0100, Jesper Juhl wrote:
> audio

Could you try the attached?

James

--- Begin Message --- Jens Axboe wrote:
On Mon, Jan 31 2005, Douglas Gilbert wrote:

Jens Axboe wrote:

On Mon, Jan 31 2005, Fabio Coatti wrote:


Alle 09:00, lunedì 31 gennaio 2005, Jens Axboe ha scritto:


At this point k3b is stuck in D stat, needs reboot.

I was able to replicate this with a USB burner.
My system didn't need a reboot. The "D" state was locked
on "blk_execute_rq". The burner was still accessible via
sg.

The most likely suspect is the REQ_BLOCK_PC scsi changes. Can you try
2.6.11-rc2-mm1 with bk-scsi backed out? (attached)

just tried, right guess :)
backing out that patch the problem disappears.
Let me know if you need to narrow further that issue.


Doug, it looks like your REQ_BLOCK_PC changes are buggy. Let me know if
you cannot find the full post and I'll forward it to you.

Jens,
Hmm. Found the thread on lkml. I got an almost identical
lock up in k3b with a USB external cd/dvd drive recently.
My laptop didn't need rebooting (probably since the root
fs is one an ide disk).

That is a quite large patch that you referenced. I'll
try and replicate and report back.


My guess would be the scsi_lib changes, I would suggest you start there.

Indeed. I'm not sure what I was thinking in
scsi_io_completion(). This small reversion
fixes my k3b problem; tested with a USB external
burner.

Signed-off-by: Douglas Gilbert <dougg@xxxxxxxxxx>




--- linux/drivers/scsi/scsi_lib.c 2005-01-31 17:46:31.000000000 +1000
+++ linux/drivers/scsi/scsi_lib.c2611r2b8_k3b 2005-01-31 22:46:04.000000000 +1000
@@ -692,6 +692,7 @@
int this_count = cmd->bufflen;
request_queue_t *q = cmd->device->request_queue;
struct request *req = cmd->request;
+ int clear_errors = 1;
struct scsi_sense_hdr sshdr;
int sense_valid = 0;
int sense_deferred = 0;
@@ -721,6 +722,7 @@
if (blk_pc_request(req)) { /* SG_IO ioctl from block level */
req->errors = result;
if (result) {
+ clear_errors = 0;
if (sense_valid) {
/*
* SG_IO wants current and deferred errors
@@ -745,11 +747,6 @@
cmd->request_buffer = NULL;
cmd->request_bufflen = 0;

- if (blk_pc_request(req)) { /* SG_IO ioctl from block level */
- scsi_end_request(cmd, 1, good_bytes, 0);
- return;
- }
-
/*
* Next deal with any sectors which we were able to correctly
* handle.
@@ -759,7 +756,8 @@
req->nr_sectors, good_bytes));
SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n", cmd->use_sg));

- req->errors = 0;
+ if (clear_errors)
+ req->errors = 0;
/*
* If multiple sectors are requested in one buffer, then
* they will have been finished off by the first command.

--- End Message ---