<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>Chapter 3. Error handling</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="libATA Developer's Guide" /><link rel="up" href="index.html" title="libATA Developer's Guide" /><link rel="prev" href="libataDriverApi.html" title="Chapter 2. libata Driver API" /><link rel="next" href="ch03s02.html" title="How commands are issued" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Error handling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="libataDriverApi.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch03s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 3. Error handling"><div class="titlepage"><div><div><h2 class="title"><a id="libataEH"></a>Chapter 3. Error handling</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="libataEH.html#id3023877">Origins of commands</a></span></dt><dt><span class="sect1"><a href="ch03s02.html">How commands are issued</a></span></dt><dt><span class="sect1"><a href="ch03s03.html">How commands are processed</a></span></dt><dt><span class="sect1"><a href="ch03s04.html">How commands are completed</a></span></dt><dt><span class="sect1"><a href="ch03s05.html">ata_scsi_error()</a></span></dt><dt><span class="sect1"><a href="ch03s06.html">Problems with the current EH</a></span></dt></dl></div><p> This chapter describes how errors are handled under libata. Readers are advised to read SCSI EH (Documentation/scsi/scsi_eh.txt) and ATA exceptions doc first. </p><div class="sect1" title="Origins of commands"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3023877"></a>Origins of commands</h2></div></div></div><p> In libata, a command is represented with struct ata_queued_cmd or qc. qc's are preallocated during port initialization and repetitively used for command executions. Currently only one qc is allocated per port but yet-to-be-merged NCQ branch allocates one for each tag and maps each qc to NCQ tag 1-to-1. </p><p> libata commands can originate from two sources - libata itself and SCSI midlayer. libata internal commands are used for initialization and error handling. All normal blk requests and commands for SCSI emulation are passed as SCSI commands through queuecommand callback of SCSI host template. </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="libataDriverApi.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch03s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. libata Driver API </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> How commands are issued</td></tr></table></div></body></html>