Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
libata: fix translation for START STOP UNIT
libata-scsi: ata_task_ioctl should return ATA registers from sense data
pata_platform: set_mode fix
ata_if_xfermask() word 51 fix
pata_sil680: PIO1 taskfile transfers overclocking fix (repost)
libata: fix ata_eh_suspend() return value
ahci: port_no should be used when clearing IRQ in ahci_thaw()

Fix trivial conflict in drivers/ata/pata_platform.c manually

+54 -16
+1 -1
drivers/ata/ahci.c
··· 1282 1282 /* clear IRQ */ 1283 1283 tmp = readl(port_mmio + PORT_IRQ_STAT); 1284 1284 writel(tmp, port_mmio + PORT_IRQ_STAT); 1285 - writel(1 << ap->id, mmio + HOST_IRQ_STAT); 1285 + writel(1 << ap->port_no, mmio + HOST_IRQ_STAT); 1286 1286 1287 1287 /* turn IRQ back on */ 1288 1288 writel(DEF_PORT_IRQ, port_mmio + PORT_IRQ_MASK);
+1 -1
drivers/ata/libata-core.c
··· 1037 1037 * the PIO timing number for the maximum. Turn it into 1038 1038 * a mask. 1039 1039 */ 1040 - u8 mode = id[ATA_ID_OLD_PIO_MODES] & 0xFF; 1040 + u8 mode = (id[ATA_ID_OLD_PIO_MODES] >> 8) & 0xFF; 1041 1041 if (mode < 5) /* Valid PIO range */ 1042 1042 pio_mask = (2 << mode) - 1; 1043 1043 else
+1 -1
drivers/ata/libata-eh.c
··· 1796 1796 *r_failed_dev = dev; 1797 1797 1798 1798 DPRINTK("EXIT\n"); 1799 - return 0; 1799 + return rc; 1800 1800 } 1801 1801 1802 1802 /**
+50 -12
drivers/ata/libata-scsi.c
··· 273 273 { 274 274 int rc = 0; 275 275 u8 scsi_cmd[MAX_COMMAND_SIZE]; 276 - u8 args[7]; 277 - struct scsi_sense_hdr sshdr; 276 + u8 args[7], *sensebuf = NULL; 277 + int cmd_result; 278 278 279 279 if (arg == NULL) 280 280 return -EINVAL; ··· 282 282 if (copy_from_user(args, arg, sizeof(args))) 283 283 return -EFAULT; 284 284 285 + sensebuf = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_NOIO); 286 + if (!sensebuf) 287 + return -ENOMEM; 288 + 285 289 memset(scsi_cmd, 0, sizeof(scsi_cmd)); 286 290 scsi_cmd[0] = ATA_16; 287 291 scsi_cmd[1] = (3 << 1); /* Non-data */ 288 - /* scsi_cmd[2] is already 0 -- no off.line, cc, or data xfer */ 292 + scsi_cmd[2] = 0x20; /* cc but no off.line or data xfer */ 289 293 scsi_cmd[4] = args[1]; 290 294 scsi_cmd[6] = args[2]; 291 295 scsi_cmd[8] = args[3]; ··· 299 295 300 296 /* Good values for timeout and retries? Values below 301 297 from scsi_ioctl_send_command() for default case... */ 302 - if (scsi_execute_req(scsidev, scsi_cmd, DMA_NONE, NULL, 0, &sshdr, 303 - (10*HZ), 5)) 304 - rc = -EIO; 298 + cmd_result = scsi_execute(scsidev, scsi_cmd, DMA_NONE, NULL, 0, 299 + sensebuf, (10*HZ), 5, 0); 305 300 306 - /* Need code to retrieve data from check condition? */ 301 + if (driver_byte(cmd_result) == DRIVER_SENSE) {/* sense data available */ 302 + u8 *desc = sensebuf + 8; 303 + cmd_result &= ~(0xFF<<24); /* DRIVER_SENSE is not an error */ 304 + 305 + /* If we set cc then ATA pass-through will cause a 306 + * check condition even if no error. Filter that. */ 307 + if (cmd_result & SAM_STAT_CHECK_CONDITION) { 308 + struct scsi_sense_hdr sshdr; 309 + scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE, 310 + &sshdr); 311 + if (sshdr.sense_key==0 && 312 + sshdr.asc==0 && sshdr.ascq==0) 313 + cmd_result &= ~SAM_STAT_CHECK_CONDITION; 314 + } 315 + 316 + /* Send userspace ATA registers */ 317 + if (sensebuf[0] == 0x72 && /* format is "descriptor" */ 318 + desc[0] == 0x09) {/* code is "ATA Descriptor" */ 319 + args[0] = desc[13]; /* status */ 320 + args[1] = desc[3]; /* error */ 321 + args[2] = desc[5]; /* sector count (0:7) */ 322 + args[3] = desc[7]; /* lbal */ 323 + args[4] = desc[9]; /* lbam */ 324 + args[5] = desc[11]; /* lbah */ 325 + args[6] = desc[12]; /* select */ 326 + if (copy_to_user(arg, args, sizeof(args))) 327 + rc = -EFAULT; 328 + } 329 + } 330 + 331 + if (cmd_result) { 332 + rc = -EIO; 333 + goto error; 334 + } 335 + 336 + error: 337 + kfree(sensebuf); 307 338 return rc; 308 339 } 309 340 ··· 1022 983 } 1023 984 1024 985 tf->command = ATA_CMD_VERIFY; /* READ VERIFY */ 1025 - } else { 1026 - tf->nsect = 0; /* time period value (0 implies now) */ 1027 - tf->command = ATA_CMD_STANDBY; 1028 - /* Consider: ATA STANDBY IMMEDIATE command */ 1029 - } 986 + } else 987 + /* Issue ATA STANDBY IMMEDIATE command */ 988 + tf->command = ATA_CMD_STANDBYNOW1; 989 + 1030 990 /* 1031 991 * Standby and Idle condition timers could be implemented but that 1032 992 * would require libata to implement the Power condition mode page
+1 -1
drivers/ata/pata_sil680.c
··· 135 135 static void sil680_set_piomode(struct ata_port *ap, struct ata_device *adev) 136 136 { 137 137 static u16 speed_p[5] = { 0x328A, 0x2283, 0x1104, 0x10C3, 0x10C1 }; 138 - static u16 speed_t[5] = { 0x328A, 0x1281, 0x1281, 0x10C3, 0x10C1 }; 138 + static u16 speed_t[5] = { 0x328A, 0x2283, 0x1281, 0x10C3, 0x10C1 }; 139 139 140 140 unsigned long tfaddr = sil680_selreg(ap, 0x02); 141 141 unsigned long addr = sil680_seldev(ap, adev, 0x04);