Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262419AbUKQRbs (ORCPT ); Wed, 17 Nov 2004 12:31:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262425AbUKQR3a (ORCPT ); Wed, 17 Nov 2004 12:29:30 -0500 Received: from clock-tower.bc.nu ([81.2.110.250]:43493 "EHLO localhost.localdomain") by vger.kernel.org with ESMTP id S262456AbUKQR2i (ORCPT ); Wed, 17 Nov 2004 12:28:38 -0500 Subject: Re: PATCH (for comment): ide-cd possible race in PIO mode From: Alan Cox To: Jens Axboe Cc: linux-ide@vger.kernel.org, Linux Kernel Mailing List In-Reply-To: <20041117153706.GH26240@suse.de> References: <1100697589.32677.3.camel@localhost.localdomain> <20041117153706.GH26240@suse.de> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1100708728.420.68.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 17 Nov 2004 16:25:30 +0000 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 842 Lines: 23 On Mer, 2004-11-17 at 15:37, Jens Axboe wrote: > > - HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG); > > + spin_lock_irqsave(&ide_lock, flags); > > + HWIF(drive)->OUTBSYNC(WIN_PACKETCMD, IDE_COMMAND_REG); > > + ndelay(400); > > + spin_unlock_irqsave(&ide_lock, flags); > > return (*handler) (drive); > > } > > } > > What good does the lock do? The same as in ide_execute_command - make sure we don't take an IDE interrupt that tries to read the state during the delay. That is the old 2.4 "may drives shared IRQ random fails" fix and why the lock is taken in ide_execute_command. - 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/