public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.6.14-rt15 IDE compat_semaphore to completion
@ 2005-11-25 12:56 Aleksey Makarov
  2005-11-25 14:54 ` Ingo Molnar
       [not found] ` <1132929218.11915.2.camel@localhost.localdomain>
  0 siblings, 2 replies; 9+ messages in thread
From: Aleksey Makarov @ 2005-11-25 12:56 UTC (permalink / raw)
  To: mingo; +Cc: linux-kernel, sdietrich

Hi Ingo,

Please consider if this patch could be included into
the next realtime patch.

Aleksey Makarov

Index: linux-2.6.14-rt15/include/linux/ide.h
===================================================================
--- linux-2.6.14-rt15.orig/include/linux/ide.h
+++ linux-2.6.14-rt15/include/linux/ide.h
@@ -18,6 +18,7 @@
  #include <linux/bio.h>
  #include <linux/device.h>
  #include <linux/pci.h>
+#include <linux/completion.h>
  #include <asm/byteorder.h>
  #include <asm/system.h>
  #include <asm/io.h>
@@ -754,7 +755,7 @@ typedef struct ide_drive_s {
  	int		crc_count;	/* crc counter to reduce drive speed */
  	struct list_head list;
  	struct device	gendev;
-	struct compat_semaphore gendev_rel_sem;	/* to deal with device 
release() */
+	struct completion gendev_rel_sem;	/* to deal with device release() */
  } ide_drive_t;

  #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev)
@@ -910,7 +911,7 @@ typedef struct hwif_s {
  	unsigned	sg_mapped  : 1;	/* sg_table and sg_nents are ready */

  	struct device	gendev;
-	struct compat_semaphore gendev_rel_sem; /* To deal with device 
release() */
+	struct completion gendev_rel_sem; /* To deal with device release() */

  	void		*hwif_data;	/* extra hwif data */

Index: linux-2.6.14-rt15/drivers/ide/ide.c
===================================================================
--- linux-2.6.14-rt15.orig/drivers/ide/ide.c
+++ linux-2.6.14-rt15/drivers/ide/ide.c
@@ -222,7 +222,7 @@ static void init_hwif_data(ide_hwif_t *h
  	hwif->mwdma_mask = 0x80;	/* disable all mwdma */
  	hwif->swdma_mask = 0x80;	/* disable all swdma */

-	sema_init(&hwif->gendev_rel_sem, 0);
+	init_completion(&hwif->gendev_rel_sem);

  	default_hwif_iops(hwif);
  	default_hwif_transport(hwif);
@@ -245,7 +245,7 @@ static void init_hwif_data(ide_hwif_t *h
  		drive->is_flash			= 0;
  		drive->vdma			= 0;
  		INIT_LIST_HEAD(&drive->list);
-		sema_init(&drive->gendev_rel_sem, 0);
+		init_completion(&drive->gendev_rel_sem);
  	}
  }

@@ -602,7 +602,7 @@ void ide_unregister(unsigned int index)
  		}
  		spin_unlock_irq(&ide_lock);
  		device_unregister(&drive->gendev);
-		down(&drive->gendev_rel_sem);
+		wait_for_completion(&drive->gendev_rel_sem);
  		spin_lock_irq(&ide_lock);
  	}
  	hwif->present = 0;
@@ -662,7 +662,7 @@ void ide_unregister(unsigned int index)
  	/* More messed up locking ... */
  	spin_unlock_irq(&ide_lock);
  	device_unregister(&hwif->gendev);
-	down(&hwif->gendev_rel_sem);
+	wait_for_completion(&hwif->gendev_rel_sem);

  	/*
  	 * Remove us from the kernel's knowledge
Index: linux-2.6.14-rt15/drivers/ide/ide-probe.c
===================================================================
--- linux-2.6.14-rt15.orig/drivers/ide/ide-probe.c
+++ linux-2.6.14-rt15/drivers/ide/ide-probe.c
@@ -656,7 +656,7 @@ static void hwif_release_dev (struct dev
  {
  	ide_hwif_t *hwif = container_of(dev, ide_hwif_t, gendev);

-	up(&hwif->gendev_rel_sem);
+	complete(&hwif->gendev_rel_sem);
  }

  static void hwif_register (ide_hwif_t *hwif)
@@ -1328,7 +1328,7 @@ static void drive_release_dev (struct de
  	drive->queue = NULL;
  	spin_unlock_irq(&ide_lock);

-	up(&drive->gendev_rel_sem);
+	complete(&drive->gendev_rel_sem);
  }

  /*

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-11-26 12:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-25 12:56 [PATCH] 2.6.14-rt15 IDE compat_semaphore to completion Aleksey Makarov
2005-11-25 14:54 ` Ingo Molnar
     [not found] ` <1132929218.11915.2.camel@localhost.localdomain>
2005-11-25 21:40   ` [PATCH] " Steven Rostedt
2005-11-25 22:46   ` [PATCH] 2.6.14-rt15 " Steven Rostedt
2005-11-25 22:50   ` [PATCH -rt] convert compat sem in block device sx8 Steven Rostedt
2005-11-25 22:57     ` Steven Rostedt
2005-11-26 12:33       ` Ingo Molnar
2005-11-25 22:53   ` [PATCH -rt] convert watchdog cpu5wdt from compat_sem to completion Steven Rostedt
2005-11-26 12:35     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox