From: James Bottomley Date: Tue, 6 Sep 2005 22:52:54 +0000 (-0500) Subject: Merge by hand (conflicts in sd.c) X-Git-Tag: firefly_0821_release~41676^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=17fa53da1239b8712c5cebbd72a74c713b6c2db9;p=firefly-linux-kernel-4.4.55.git Merge by hand (conflicts in sd.c) --- 17fa53da1239b8712c5cebbd72a74c713b6c2db9 diff --cc drivers/scsi/sd.c index 611ccde84778,41ba0809f791..de564b386052 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@@ -969,10 -981,10 +969,10 @@@ static int media_not_present(struct scs * spinup disk - called only in sd_revalidate_disk() */ static void -sd_spinup_disk(struct scsi_disk *sdkp, char *diskname, - struct scsi_request *SRpnt, unsigned char *buffer) { +sd_spinup_disk(struct scsi_disk *sdkp, char *diskname) +{ unsigned char cmd[10]; - unsigned long spintime_value = 0; + unsigned long spintime_expire = 0; int retries, spintime; unsigned int the_result; struct scsi_sense_hdr sshdr; @@@ -1046,12 -1063,17 +1046,12 @@@ cmd[1] = 1; /* Return immediately */ memset((void *) &cmd[2], 0, 8); cmd[4] = 1; /* Start spin cycle */ - SRpnt->sr_cmd_len = 0; - memset(SRpnt->sr_sense_buffer, 0, - SCSI_SENSE_BUFFERSIZE); - - SRpnt->sr_data_direction = DMA_NONE; - scsi_wait_req(SRpnt, (void *)cmd, - (void *) buffer, 0/*512*/, - SD_TIMEOUT, SD_MAX_RETRIES); + scsi_execute_req(sdkp->device, cmd, DMA_NONE, + NULL, 0, &sshdr, + SD_TIMEOUT, SD_MAX_RETRIES); - spintime_value = jiffies; + spintime_expire = jiffies + 100 * HZ; + spintime = 1; } - spintime = 1; /* Wait 1 second for next try */ msleep(1000); printk("."); diff --cc include/scsi/scsi_eh.h index b24d224281bd,4b71095be681..fabd879c2f2e --- a/include/scsi/scsi_eh.h +++ b/include/scsi/scsi_eh.h @@@ -26,18 -26,7 +26,15 @@@ struct scsi_sense_hdr { /* See SPC-3 s u8 additional_length; /* always 0 for fixed sense format */ }; +static inline int scsi_sense_valid(struct scsi_sense_hdr *sshdr) +{ + if (!sshdr) + return 0; + + return (sshdr->response_code & 0x70) == 0x70; +} + - extern void scsi_add_timer(struct scsi_cmnd *, int, - void (*)(struct scsi_cmnd *)); - extern int scsi_delete_timer(struct scsi_cmnd *); extern void scsi_report_bus_reset(struct Scsi_Host *, int); extern void scsi_report_device_reset(struct Scsi_Host *, int, int); extern int scsi_block_when_processing_errors(struct scsi_device *);