Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 28 Nov 2001 18:52:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 28 Nov 2001 18:52:07 -0500 Received: from mailf.telia.com ([194.22.194.25]:18159 "EHLO mailf.telia.com") by vger.kernel.org with ESMTP id ; Wed, 28 Nov 2001 18:51:54 -0500 To: Ron Lawrence Cc: , Jens Axboe Subject: Re: CDROM ioctl bug (fwd) In-Reply-To: From: Peter Osterlund Date: 29 Nov 2001 00:51:46 +0100 In-Reply-To: Message-ID: Lines: 39 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Ron Lawrence writes: > busy. Here are the symptoms of my problem : doing reads from a CDROM > device intermingled with CDROM_MEDIA_CHANGED ioctls causes long pauses > during the ioctl. This behavior started in 2.4.10. The ioctl can take a > very long time to return, especially if reading large chunks. This patch fixes the problem for my USB CDROM device. Maybe a similar patch is needed for the IDE case, I haven't looked yet. In general, who is responsible for unplugging the request queue after queuing an ioctl command? --- linux/drivers/scsi/scsi.c.old Thu Nov 29 00:42:16 2001 +++ linux/drivers/scsi/scsi.c Thu Nov 29 00:32:28 2001 @@ -767,14 +767,17 @@ void scsi_wait_req (Scsi_Request * SRpnt, const void *cmnd , void *buffer, unsigned bufflen, int timeout, int retries) { + request_queue_t *q; DECLARE_COMPLETION(wait); SRpnt->sr_request.waiting = &wait; SRpnt->sr_request.rq_status = RQ_SCSI_BUSY; scsi_do_req (SRpnt, (void *) cmnd, buffer, bufflen, scsi_wait_done, timeout, retries); + q = &SRpnt->sr_device->request_queue; + generic_unplug_device(q); wait_for_completion(&wait); SRpnt->sr_request.waiting = NULL; if( SRpnt->sr_command != NULL ) { -- Peter ?sterlund petero2@telia.com Sk?ndalsv?gen 35 http://w1.894.telia.com/~u89404340 S-128 66 Sk?ndal +46 8 942647 Sweden - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/