Monday, 21 June 2010

The Git Community Book

The Git Community Book (maintained by Scott Chacon) is an excellent resource to help one learn how to use the Git version control system quickly and with minimal pain. The book includes a Git introduction, First Time use instructions, Basic Usage tutorial through to Advanced Git usage and also describes the internals and plumbing of Git too.

The book is available as browsable web pages or as a PDF too. Most excellent!

Wednesday, 16 June 2010

Figuring Out SATA SErr codes

Today I had to cast my eye over a SATA error message:

ata1: exception Emask 0x10 SAct 0x0 SErr 0xd0000 action 0xe frozen
ata1: irq_stat 0x00400000, PHY RDY changed
ata1: SError: { PHYRdyChg CommWake 10B8B }
ata1: hard resetting link

So how does one interpret the cryptic SErr magic? Pages 269-270 of the SATA ATA spec explains the SError register fields in fine detail.

Well, "SErr 0xd0000" relates to the SError bits 16, 18 and 19 which are the SERR_PHYRDY_CHG, SERR_COMM_WAKE and SERR_10B_8B_ERR bits as defined in include/linux/ata.h. The kernel decodes these and dumps out the error state in the "ata1: SError: { PHYRdyChg CommWake 10B8B }" line above - so that's helpful.

Anyhow, the spec describes these error codes in the DIAG field (page 270) - they are the top 16 bits of the SError register. Armed with the spec one can then decode these error bits. It's not rocket science, one just needs to know where to look this information up.