1<html><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.78.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 bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><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"><div class="titlepage"><div><div><h1 class="title"><a name="libataEH"></a>Chapter 3. Error handling</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="libataEH.html#idp1120612852">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> 2 This chapter describes how errors are handled under libata. 3 Readers are advised to read SCSI EH 4 (Documentation/scsi/scsi_eh.txt) and ATA exceptions doc first. 5 </p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1120612852"></a>Origins of commands</h2></div></div></div><p> 6 In libata, a command is represented with struct ata_queued_cmd 7 or qc. qc's are preallocated during port initialization and 8 repetitively used for command executions. Currently only one 9 qc is allocated per port but yet-to-be-merged NCQ branch 10 allocates one for each tag and maps each qc to NCQ tag 1-to-1. 11 </p><p> 12 libata commands can originate from two sources - libata itself 13 and SCSI midlayer. libata internal commands are used for 14 initialization and error handling. All normal blk requests 15 and commands for SCSI emulation are passed as SCSI commands 16 through queuecommand callback of SCSI host template. 17 </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> 18