Skip to contentSkip to conversation

osst upgrade to 0.99.3

PATCH In review Willem Riede 2 participants 2 messages Jan 2, 2005 – Jan 5, 2005 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 osst upgrade to 0.99.3

Here is patch 2 (see previous mail for context), providing osst error handling improvements.

home/wriede/SfOsstCVS/Driver26/osst.h renamed from osst.h +2 -1
@@ -70,7 +70,7 @@
 #define BLOCK_SIZE_PAGE_LENGTH     4
 
 #define BUFFER_FILLING_PAGE        0x33
-#define BUFFER_FILLING_PAGE_LENGTH 
+#define BUFFER_FILLING_PAGE_LENGTH 4
 
 #define VENDOR_IDENT_PAGE          0x36
 #define VENDOR_IDENT_PAGE_LENGTH   8
@@ -577,6 +577,7 @@
   int min_block;
   int max_block;
   int recover_count;            /* from tape opening */
+  int abort_count;
   int write_count;
   int read_count;
   int recover_erreg;            /* from last status call */
osst-2.c renamed from osst.c +131 -53

432 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Willem Riede

Here is patch 2 (see previous mail for context), providing osst error handling improvements.

<snip>

osst-2.c line 861

Quoted 10 lines
osst-2.c renamed from osst.c +10 -0
+               while (retval && time_before (jiffies, startwait + 5*60*HZ)) {
+
+                       if (STp->buffer->syscall_result && (SRpnt->sr_sense_buffer[2] & 0x0f) != 2) {
+
+                               /* some failure - not just not-ready */
+                               retval = osst_write_error_recovery(STp, aSRpnt, 0);
+                               break;
+                       }
+                       set_current_state(TASK_INTERRUPTIBLE);
+                       schedule_timeout (HZ / OSST_POLL_PER_SEC);

Are you sure you want to use TASK_INTERRUPTIBLE here? If you are sure, then you probably should add code which checks if schedule_timeout() returns early because of signals (signals_pending(current) will be true). Additionally, you may as well use msleep_interruptible(1000 / OSST_POLL_PER_SEC), since you are requesting a 10th of a second sleep (with OSST_POLL_PER_SEC #define'd to 10) (which is long & measurable in milliseconds), you are not checking the return value (so you don't seem to care how much time was left in the sleep) and msleep_interruptible() will return on the same conditions as the current code does. Seems like it should do what you want (still need some means of checking for signals, though, I think).

If, in fact, you did not intend to use TASK_INTERRUPTIBLE, but TASK_UNINTERRUPTIBLE, then you may want to consider using msleep(1000 / OSST_POLL_PER_SEC) [ignoring signals in addition to waitqueue events].

If, though, you want to keep the code as is, then please ignore the noise and I apologize :)

Thanks,
Nish