On Wed, Apr 29, 2009 at 6:49 PM, s ticket <smticket@xxxxxxxxx> wrote: > Is there any way to read PMP registers after hardreset/softreset? hard or soft reset of the port behind 88SX7042 or the port behind the PMP? After a 88SX7042 port hard reset, will anything interesting remain on the PMP to read? Have you looked at sata_pmp_read_gscr() andsata_pmp_scr_read() in drivers/ata/libata-pmp.c? sorry, just more questions. grant > SATA Controller is marvell 88SX7042 and driver is sata_mv. > I try to send 0xE4 and 0xE6 command to read/write PMP registers: > > struct sg_io_hdr io_hdr; > unsigned char cdb[SG_ATA_16_LEN]; > unsigned char sb[32]; > unsigned char data[4096]; > > memset(&io_hdr, 0, sizeof(io_hdr)); > memset(&cdb, 0, sizeof(cdb)); > memset(&sb, 0, sizeof(sb)); > memset(&data, 0, sizeof(data)); > > cdb[0] = SG_ATA_16; > cdb[1] = SG_ATA_PROTO_NON_DATA; > > cdb[2] = SG_CDB2_CHECK_COND; > cdb[4] = (unsigned char)reg; > cdb[13] = 0xF; > cdb[14] = 0xe8; > > io_hdr.interface_id = 'S'; > io_hdr.mx_sb_len = sizeof(sb); > io_hdr.dxfer_direction = SG_DXFER_NONE; > io_hdr.dxfer_len = 0; > io_hdr.dxferp = NULL; > io_hdr.cmdp = cdb; > io_hdr.cmd_len = SG_ATA_16_LEN; > io_hdr.sbp = sb; > > io_hdr.pack_id = 0; > io_hdr.timeout = 16000; > if (ioctl(fd, SG_IO, &io_hdr) == -1) { > perror("ioctl(fd, SG_IO)"); > return -1; > } > > But after 'ioctl', the SATA link fails to read SCR1 and start resetting: > > ata1.00: failed to read SCR 1 (Emask=0x40) > ata1.01: failed to read SCR 1 (Emask=0x40) > ata1.02: failed to read SCR 1 (Emask=0x40) > ata1.03: failed to read SCR 1 (Emask=0x40) > ata1.00: exception Emask 0x100 SAct 0x0 SErr 0x0 action 0x6 frozen > ata1.01: exception Emask 0x100 SAct 0x0 SErr 0x0 action 0x6 frozen > ata1.01: cmd e8/00:00:00:00:00/00:00:00:00:00/0f tag 0 > res 58/00:00:00:00:00/00:00:00:00:00/0f Emask 0x2 (HSM violation) > ata1.01: status: { DRDY DRQ } > ata1.02: exception Emask 0x100 SAct 0x0 SErr 0x0 action 0x6 frozen > ata1.03: exception Emask 0x100 SAct 0x0 SErr 0x0 action 0x6 frozen > ata1.15: hard resetting link > > Is there any suggestion? > -- > To unsubscribe from this list: send the line "unsubscribe linux-ide" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html