I hope someone can help me on the follwing issue:

In aic7xxx.c code (also qla1280.h), driver locking is being used as needed
for critical section protection.  It is defined as DRIVER_LOCK and
DRIVER_UNLOCK pair.  However, the lock is only being used for LInux 2.1.95
below.  Questions:

1, Why the driver does not do locking for Linux 2.1.95 beyond (except
spinlock in ISR)?
2, Does Linux version beyond 2.1.95 will do the locking automatically by
just including two header files (spinlock.h, smp.h)?
3, If like most linux scsi drivers which not handling lock (except ISR) is
accepted, does that mean either mutex lock is altomatically handled by Linux
2.1.95 and beyond, or simply include "smp.h" and :spinlock.h" will be
enough?

Many thanks!

Following is the part of code: 

#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0)
#  include <asm/spinlock.h>
#  include <linux/smp.h>
#  define cpuid smp_processor_id()
#  if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
#    define DRIVER_LOCK_INIT \
       spin_lock_init(&p->spin_lock);
#    define DRIVER_LOCK \
       if(!p->cpu_lock_count[cpuid]) { \
         spin_lock_irqsave(&p->spin_lock, cpu_flags); \
         p->cpu_lock_count[cpuid]++; \
       } else { \
         p->cpu_lock_count[cpuid]++; \
       }
#    define DRIVER_UNLOCK \
       if(--p->cpu_lock_count[cpuid] == 0) \
         spin_unlock_irqrestore(&p->spin_lock, cpu_flags);
#  else
#    define DRIVER_LOCK_INIT
#    define DRIVER_LOCK
#    define DRIVER_UNLOCK
#  endif
#else
#  define cpuid 0
#  define DRIVER_LOCK_INIT
#  define DRIVER_LOCK \
       save_flags(cpu_flags); \
       cli();
#  define DRIVER_UNLOCK \
       restore_flags(cpu_flags);
#  define le32_to_cpu(x) (x)
#  define cpu_to_le32(x) (x)
#endif

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to