Commit e664b42a authored by Russell King's avatar Russell King

[ARM] Update acorn scsi code wrt global irq and bitops

This cset removes the global irq handling in the AcornSCSI driver,
and makes the target type for bitops an unsigned long array rather
than an unsigned char array.
parent 4a08171d
...@@ -319,12 +319,12 @@ acornscsi_csdelay(unsigned int cs) ...@@ -319,12 +319,12 @@ acornscsi_csdelay(unsigned int cs)
target_jiffies = jiffies + 1 + cs * HZ / 100; target_jiffies = jiffies + 1 + cs * HZ / 100;
save_flags(flags); local_save_flags(flags);
sti(); local_irq_enable();
while (time_before(jiffies, target_jiffies)) barrier(); while (time_before(jiffies, target_jiffies)) barrier();
restore_flags(flags); local_irq_restore(flags);
} }
static static
...@@ -403,8 +403,9 @@ void acornscsi_resetcard(AS_Host *host) ...@@ -403,8 +403,9 @@ void acornscsi_resetcard(AS_Host *host)
host->scsi.phase = PHASE_IDLE; host->scsi.phase = PHASE_IDLE;
host->scsi.disconnectable = 0; host->scsi.disconnectable = 0;
memset(host->busyluns, 0, sizeof(host->busyluns));
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
host->busyluns[i] = 0;
host->device[i].sync_state = SYNC_NEGOCIATE; host->device[i].sync_state = SYNC_NEGOCIATE;
host->device[i].disconnect_ok = 1; host->device[i].disconnect_ok = 1;
} }
...@@ -1593,7 +1594,7 @@ void acornscsi_message(AS_Host *host) ...@@ -1593,7 +1594,7 @@ void acornscsi_message(AS_Host *host)
printk(KERN_NOTICE "scsi%d.%c: disabling tagged queueing\n", printk(KERN_NOTICE "scsi%d.%c: disabling tagged queueing\n",
host->host->host_no, acornscsi_target(host)); host->host->host_no, acornscsi_target(host));
host->SCpnt->device->tagged_queue = 0; host->SCpnt->device->tagged_queue = 0;
set_bit(host->SCpnt->target * 8 + host->SCpnt->lun, &host->busyluns); set_bit(host->SCpnt->target * 8 + host->SCpnt->lun, host->busyluns);
break; break;
#endif #endif
case EXTENDED_MESSAGE | (EXTENDED_SDTR << 8): case EXTENDED_MESSAGE | (EXTENDED_SDTR << 8):
...@@ -2637,8 +2638,7 @@ acornscsi_do_abort(AS_Host *host, Scsi_Cmnd *SCpnt) ...@@ -2637,8 +2638,7 @@ acornscsi_do_abort(AS_Host *host, Scsi_Cmnd *SCpnt)
printk("executing "); printk("executing ");
//#endif //#endif
save_flags(flags); local_irq_save(flags);
cli();
switch (host->scsi.phase) { switch (host->scsi.phase) {
/* /*
* If the interface is idle, and the command is 'disconnectable', * If the interface is idle, and the command is 'disconnectable',
...@@ -2671,7 +2671,7 @@ acornscsi_do_abort(AS_Host *host, Scsi_Cmnd *SCpnt) ...@@ -2671,7 +2671,7 @@ acornscsi_do_abort(AS_Host *host, Scsi_Cmnd *SCpnt)
acornscsi_abortcmd(host, host->SCpnt->tag); acornscsi_abortcmd(host, host->SCpnt->tag);
res = res_snooze; res = res_snooze;
} }
restore_flags(flags); local_irq_restore(flags);
} else if (host->origSCpnt == SCpnt) { } else if (host->origSCpnt == SCpnt) {
/* /*
* The command will be executed next, but a command * The command will be executed next, but a command
......
...@@ -326,7 +326,7 @@ typedef struct acornscsi_hostdata { ...@@ -326,7 +326,7 @@ typedef struct acornscsi_hostdata {
syncxfer_t sync_state; /* sync xfer negociation state */ syncxfer_t sync_state; /* sync xfer negociation state */
unsigned char disconnect_ok:1; /* device can disconnect */ unsigned char disconnect_ok:1; /* device can disconnect */
} device[8]; } device[8];
unsigned char busyluns[8]; /* array of bits indicating LUNs busy */ unsigned long busyluns[64 / sizeof(unsigned long)];/* array of bits indicating LUNs busy */
/* DMA info */ /* DMA info */
struct { struct {
......
...@@ -603,7 +603,7 @@ fas216_updateptrs(FAS216_Info *info, int bytes_transferred) ...@@ -603,7 +603,7 @@ fas216_updateptrs(FAS216_Info *info, int bytes_transferred)
* next buffer. * next buffer.
*/ */
bytes_transferred -= SCp->this_residual; bytes_transferred -= SCp->this_residual;
if (!next_SCp(&info->scsi.SCp)) { if (!next_SCp(&info->scsi.SCp) && bytes_transferred) {
printk(KERN_WARNING "scsi%d.%c: out of buffers\n", printk(KERN_WARNING "scsi%d.%c: out of buffers\n",
info->host->host_no, '0' + info->SCpnt->target); info->host->host_no, '0' + info->SCpnt->target);
return; return;
......
...@@ -288,7 +288,7 @@ typedef struct { ...@@ -288,7 +288,7 @@ typedef struct {
neg_t sync_state; /* synchronous transfer mode */ neg_t sync_state; /* synchronous transfer mode */
neg_t wide_state; /* wide transfer mode */ neg_t wide_state; /* wide transfer mode */
} device[8]; } device[8];
unsigned char busyluns[8]; /* array of bits indicating LUNs busy */ unsigned long busyluns[64/sizeof(unsigned long)];/* array of bits indicating LUNs busy */
/* dma */ /* dma */
struct { struct {
......
...@@ -161,7 +161,7 @@ static Scsi_Cmnd *__queue_remove(Queue_t *queue, struct list_head *ent) ...@@ -161,7 +161,7 @@ static Scsi_Cmnd *__queue_remove(Queue_t *queue, struct list_head *ent)
* exclude - bit array of target&lun which is busy * exclude - bit array of target&lun which is busy
* Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available * Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available
*/ */
Scsi_Cmnd *queue_remove_exclude(Queue_t *queue, void *exclude) Scsi_Cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
{ {
unsigned long flags; unsigned long flags;
struct list_head *l; struct list_head *l;
......
...@@ -46,7 +46,7 @@ extern Scsi_Cmnd *queue_remove (Queue_t *queue); ...@@ -46,7 +46,7 @@ extern Scsi_Cmnd *queue_remove (Queue_t *queue);
* exclude - array of busy LUNs * exclude - array of busy LUNs
* Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available * Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available
*/ */
extern Scsi_Cmnd *queue_remove_exclude (Queue_t *queue, void *exclude); extern Scsi_Cmnd *queue_remove_exclude (Queue_t *queue, unsigned long *exclude);
#define queue_add_cmd_ordered(queue,SCpnt) \ #define queue_add_cmd_ordered(queue,SCpnt) \
__queue_add(queue,SCpnt,(SCpnt)->cmnd[0] == REQUEST_SENSE) __queue_add(queue,SCpnt,(SCpnt)->cmnd[0] == REQUEST_SENSE)
......
...@@ -51,7 +51,7 @@ static inline int next_SCp(Scsi_Pointer *SCp) ...@@ -51,7 +51,7 @@ static inline int next_SCp(Scsi_Pointer *SCp)
static inline unsigned char get_next_SCp_byte(Scsi_Pointer *SCp) static inline unsigned char get_next_SCp_byte(Scsi_Pointer *SCp)
{ {
char c = SCp->ptr; char c = *SCp->ptr;
SCp->ptr += 1; SCp->ptr += 1;
SCp->this_residual -= 1; SCp->this_residual -= 1;
...@@ -63,7 +63,7 @@ static inline unsigned char get_next_SCp_byte(Scsi_Pointer *SCp) ...@@ -63,7 +63,7 @@ static inline unsigned char get_next_SCp_byte(Scsi_Pointer *SCp)
static inline void put_next_SCp_byte(Scsi_Pointer *SCp, unsigned char c) static inline void put_next_SCp_byte(Scsi_Pointer *SCp, unsigned char c)
{ {
SCp->ptr = c; *SCp->ptr = c;
SCp->ptr += 1; SCp->ptr += 1;
SCp->this_residual -= 1; SCp->this_residual -= 1;
if (SCp->this_residual == 0) if (SCp->this_residual == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment