All of lore.kernel.org
 help / color / mirror / Atom feed
* How to assess PMP register
@ 2009-04-30  1:49 s ticket
  2009-04-30 16:08 ` Grant Grundler
  2009-04-30 22:34 ` Mark Lord
  0 siblings, 2 replies; 10+ messages in thread
From: s ticket @ 2009-04-30  1:49 UTC (permalink / raw)
  To: linux-ide, jgarzik

Is there any way to read PMP registers after hardreset/softreset?
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?

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-05-09  8:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-30  1:49 How to assess PMP register s ticket
2009-04-30 16:08 ` Grant Grundler
2009-04-30 22:34 ` Mark Lord
2009-05-04  5:04   ` s ticket
2009-05-04 23:37     ` Mark Lord
2009-05-06  7:03       ` Gwendal Grignou
2009-05-09  5:12         ` s ticket
2009-05-09  5:18           ` Tejun Heo
2009-05-09  6:23             ` s ticket
2009-05-09  8:09               ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.