Skip to contentSkip to conversation

Dereferencing semaphores and atomic_t's

DISCUSSION Russell King 4 participants 4 messages Oct 2, 2002

lore
Share & tools
lore
#0 lore raw

drivers/scsi/scsi_error.c:

        SCSI_LOG_ERROR_RECOVERY(3, printk("Wake up parent %d\n",
                                          shost->eh_notify->count.counter));

        up(shost->eh_notify);

drivers/scsi/hosts.c:

                up(shost->eh_wait);
                SCSI_LOG_ERROR_RECOVERY(5, printk("Waking error handler"
                                          "thread (%d)\n",
                                          atomic_read(&shost->eh_wait->count)));


                up(shost->eh_wait);
                SCSI_LOG_ERROR_RECOVERY(5, printk("Waking error handler"
                                          "thread (%d)\n",
                                          atomic_read(&shost->eh_wait->count)));

Do we really allow this type of layering violation?

(There appear to be some circumstances when obtaining the semaphore count is useful, but shouldn't we provide an architecture helper function to do that since a semaphore structure _is_ an architecture-defined opaque structure.)

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#1 lore raw

From: Russell King <[email protected]>
Date: Wed, 2 Oct 2002 11:16:26 +0100

Do we really allow this type of layering violation?

No, it should be killed :-)

(There appear to be some circumstances when obtaining the semaphore count is useful, but shouldn't we provide an architecture helper function to do that since a semaphore structure _is_ an architecture-defined opaque structure.)

Feel free to make one.

#2 lore raw
In reply to Russell King
Quoted 5 lines · Russell King

drivers/scsi/scsi_error.c:

SCSI_LOG_ERROR_RECOVERY(3, printk("Wake up parent %d\n",
shost->eh_notify->count.counter));

This is already fixed in 2.4 - just forward port the fixes

#3 lore raw
Quoted 8 lines · Alan Cox [[email protected]] wrote:
Quoted 5 lines · Russell King

drivers/scsi/scsi_error.c:

SCSI_LOG_ERROR_RECOVERY(3, printk("Wake up parent %d\n",
shost->eh_notify->count.counter));

This is already fixed in 2.4 - just forward port the fixes

I added sem_getcount to my scsi_error.c update and my scsi_hosts update patch. I should have these out soon.

Sorry Russell that it has taken longer than I said to get the updated scsi_error patch out. I am still investigating an issue with getting door lock to work post fault insertion.

-andmike
--
Michael Anderson
[email protected]