15 2="/form > 2="a 15 2/Documentaionf/scsi/scsi_eh.txt">1515"/spaf >15"spaf class="lxr_search">1515hidden" nam4.>navtarget" "3lu4.>">15text" nam4.>search" id.>search">15submit">Search 2="/form > "/spaf >15"spaf class="lxr_prefs" > 2="a href="+prefs?return=Documentaionf/scsi/scsi_eh.txt"1515 2="/a>15"/spaf >15"input typ4.>hidden" nam4.>ajax_lookup" id.>ajax_lookup" "3lu4.>">11
search_results" class="search_results"> 2 > "div id.>content" > "div id.>file_contents"
6a/f2/f87ce3355024bf38c30d4017550c6889fc9e_3/0" L1" class="line" nam4.>L1">= =1"/a>1L2" class="line" nam4.>L2">= =2"/a>SCSI EH1L3" class="line" nam4.>L3">= =3"/a>======================================1L4" class="line" nam4.>L4">= =4"/a>1L5" class="line" nam4.>L5">= =5"/a> This document describes SCSI midlayer error handling infrastructure.1L6" class="line" nam4.>L6">= =6"/a>Please refer to Documentaionf/scsi/scsi_mid_low_api.txt for more1L7" class="line" nam4.>L7">= =7"/a>informaionf regarding SCSI midlayer.1L8" class="line" nam4.>L8">= =8"/a>1L9" class="line" nam4.>L9">= =9"/a>TABLE OF CONTENTS1L10" class="line" nam4.>L10">=   1L11" class="line" nam4.>L11">= 11"/a>[1] How SCSI commands travel through the midlayer and to EH1L12" class="line" nam4.>L12">= 12"/a>2= =[1-1] struct scsi_cmnd1L13" class="line" nam4.>L13">= 13"/a>2= =[1-2] How do scmd's get completed?1L14" class="line" nam4.>L14">= 14"/a>2= =2= =[1-2-1] Completing a scmd w/ scsi_done1L15" class="line" nam4.>L15">= 15"/a>2= =2= =[1-2-2] Completing a scmd w/ timeout1L16" class="line" nam4.>L16">= 16"/a>2= =[1-3] How EH takes over1L17" class="line" nam4.>L17">= 17"/a>[2] How SCSI EH works1L18" class="line" nam4.>L18">= 18"/a>2= =[2-1] EH through fine-grained callbacks1L19" class="line" nam4.>L19">= 19"/a>2= =2= =[2-1-1] Overview1L20" class="line" nam4.>L20">= 20"/a>2= =2= =[2-1-2] Flow of scmds through EH1L21" class="line" nam4.>L21">= 21"/a>2= =2= =[2-1-3] Flow of control1L22" class="line" nam4.>L22">= 22"/a>2= =[2-2] EH through transportt->eh_strategy_handler()1L23" class="line" nam4.>L23">= 23"/a>2= =2= =[2-2-1] Pre transportt->eh_strategy_handler() SCSI midlayer condiionfs1L24" class="line" nam4.>L24">= 24"/a>2= =2= =[2-2-2] Post transportt->eh_strategy_handler() SCSI midlayer condiionfs1L25" class="line" nam4.>L25">= 25"/a>2= =2= =[2-2-3] Things to consider1L26" class="line" nam4.>L26">= 26"/a>1L27" class="line" nam4.>L27">= 27"/a>1L28" class="line" nam4.>L28">= 28"/a>[1] How SCSI commands travel through the midlayer and to EH1L29" class="line" nam4.>L29">= 29"/a>1L30" class="line" nam4.>L30">= 30"/a>[1-1] struct scsi_cmnd1L31" class="line" nam4.>L31">= 31"/a>1L32" class="line" nam4.>L32">= 32"/a>2Each SCSI command is represented with struct scsi_cmnd (== scmd).  A1L33" class="line" nam4.>L33">= 33"/a>scmd has two list_head's to link itself into lists.  The two are1L34" class="line" nam4.>L34">= 34"/a>scmd->list and scmd->eh_entry.  The former is used for free list or1L35" class="line" nam4.>L35">= 35"/a>per-device allocated scmd list and not of much interest to this EH1L36" class="line" nam4.>L36">= 36"/a>discussonf.  The latter is used for completonf and EH lists and unless1L37" class="line" nam4.>L37">= 37"/a>otherwise staied scmds are always linked using scmd->eh_entry in this1L38" class="line" nam4.>L38">= 38"/a>discussonf.1L39" class="line" nam4.>L39">= 39"/a>1L40" class="line" nam4.>L40">= 4 1L41" class="line" nam4.>L41">= 41"/a>[1-2] How do scmd's get completed?1L42" class="line" nam4.>L42">= 421L43" class="line" nam4.>L43">= 43"/a>2Once LLDD gets hold of a scmd, either the LLDD will complete the1L44" class="line" nam4.>L44">= 44"/a>command by calling scsi_done callback passed from midlayer when1L45" class="line" nam4.>L45">= 45"/a>invoking hostt->queuecommand() or SCSI midlayer will time it out.1L46" class="line" nam4.>L46">= 46"/a>1L47" class="line" nam4.>L47">= 47"/a>1L48" class="line" nam4.>L48">= 48"/a>[1-2-1] Completing a scmd w/ scsi_done1L49" class="line" nam4.>L49">= 49"/a>1L50" class="line" nam4.>L50">= 50"/a>2For all non-EH commands, scsi_done() is the completonf callback.  It1L51" class="line" nam4.>L51">= 51"/a>does the following.1L52" class="line" nam4.>L52">= 521L53" class="line" nam4.>L53">= 53"/a>21. Delete timeout timer.  If it fails, it means that timeout timer1L54" class="line" nam4.>L54">= 54"/a>2= =has expired and is going to finish the command.  Just return.1L55" class="line" nam4.>L55">= 551L56" class="line" nam4.>L56">= 56"/a>22. Link scmd to per-cpu scsi_done_q using scmd->en_entry1L57" class="line" nam4.>L57">= 57"/a>1L58" class="line" nam4.>L58">= 58"/a>23. Raise SCSI_SOFTIRQ1L59" class="line" nam4.>L59">= 59"/a>1L60" class="line" nam4.>L60">= 60"/a>2SCSI_SOFTIRQ handler scsi_softirq calls scsi_decide_disposiionf() to1L61" class="line" nam4.>L61">= 61"/a>determine what to do with the command.  scsi_decide_disposiionf()1L62" class="line" nam4.>L62">= 62looks at the scmd->result "3lu4 and sense data to determine what to do1L63" class="line" nam4.>L63">= 63"/a>with the command.1L64" class="line" nam4.>L64">= 64"/a>1L65" class="line" nam4.>L65">= 65"/a>2- SUCCESS1L66" class="line" nam4.>L66">= 66"/a>2= =====scsi_finish_command() is invoked for the command.  The1L67" class="line" nam4.>L67">= 67"/a>2= =====funcionf does some maintenance choirs and notify completonf by1L68" class="line" nam4.>L68">= 68"/a>2= =====calling scmd->done() callback, which, for fs requests, would1L69" class="line" nam4.>L69">= 69"/a>2= =2= =be HLD completonf callback2- sd:sd_rw_intr, sr:rw_intr,1L70" class="line" nam4.>L70">= 70"/a>2= =2= =st:st_intr.1L71" class="line" nam4.>L71">= 71"/a>1L72" class="line" nam4.>L72">= 72"/a>2- NEEDS_RETRY1L73" class="line" nam4.>L73">= 73"/a>2- ADD_TO_MLQUEUE1L74" class="line" nam4.>L74">= 74"/a>2= =====scmd is requeued to blk queue.1L75" class="line" nam4.>L75">= 751L76" class="line" nam4.>L76">= 76"/a>2- otherwise1L77" class="line" nam4.>L77">= 77"/a>2= =====scsi_eh_scmd_add(scmd, 0) is invoked for the command.  See1L78" class="line" nam4.>L78">= 78"/a>2= =====[1-3] for details of this funcionf.1L79" class="line" nam4.>L79">= 79"/a>1L80" class="line" nam4.>L80">= 8 1L81" class="line" nam4.>L81">= 81"/a>[1-2-2] Completing a scmd w/ timeout1L82" class="line" nam4.>L82">= 821L83" class="line" nam4.>L83">= 83"/a> The timeout handler is scsi_times_out().  When a timeout occurs, this1L84" class="line" nam4.>L84">= 84"/a>funcionf1L85" class="line" nam4.>L85">= 851L86" class="line" nam4.>L86">= 86"/a>21. invokes otionfal hostt->eh_timed_out() callback.  Return "3lu4 caf1L87" class="line" nam4.>L87">= 87"/a>2= =be one of1L88" class="line" nam4.>L88">= 88"/a>1L89" class="line" nam4.>L89">= 89"/a>2= =- EH_HANDLED1L90" class="line" nam4.>L90">= 90"/a>2= =2= =This indicates that eh_timed_out() dealt with the timeout.  The1L91" class="line" nam4.>L91">= 91"/a>2= =====scmd is passed to __scsi_done() and thus linked into per-cpu1L92" class="line" nam4.>L92">= 92"/a>2= =====scsi_done_q.  Normal command completonf described in=[1-2-1]1L93" class="line" nam4.>L93">= 93"/a>2= =2= =follows.1L94" class="line" nam4.>L94">= 94"/a>1L95" class="line" nam4.>L95">= 95"/a>2= =- EH_RESET_TIMER1L96" class="line" nam4.>L96">= 96"/a>2= =2= =This indicates that more time is required to finish the1L97" class="line" nam4.>L97">= 97"/a>2= =====command.  Timer is restarted.  This acionf is counted as a1L98" class="line" nam4.>L98">= 98"/a>2= =====retry and only allowed scmd->allowed + 1(!) times.  Once the1L99" class="line" nam4.>L99">= 99"/a>2= =2= =limit is reached, acionf for EH_NOT_HANDLED is taken instead.1L100" class="line" nam4.>L100">=1001L101" class="line" nam4.>L101">=101"/a>2= =====*NOTE* This acionf is racy as the LLDD could finish the scmd1L102" class="line" nam4.>L102">=102"/a>2= =====after the timeout has expired but before it's added back.  If1L103" class="line" nam4.>L103">=103"/a>2= =2= =such cases, scsi_done() would think that timeout has occurred1L104" class="line" nam4.>L104">=104"/a>2= =====and return without doing anything.  We lose completonf and the1L105" class="line" nam4.>L105">=105"/a>2= =====command will time out agaif.1L106" class="line" nam4.>L106">=106"/a>1L107" class="line" nam4.>L107">=107"/a>2= =- EH_NOT_HANDLED1L108" class="line" nam4.>L108">=108"/a>2= =2= =This is the sam4 as when eh_timed_out() callback2doesn't exist.1L109" class="line" nam4.>L109">=109"/a>2= =2= =Step #2 is taken.1L110" class="line" nam4.>L110">=1  1L111" class="line" nam4.>L111">=111"/a>22. scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD) is invoked for the1L112" class="line" nam4.>L112">=112"/a>2= =command.  See=[1-3] for more informaionf.1L113" class="line" nam4.>L113">=113"/a>1L114" class="line" nam4.>L114">=114"/a>1L115" class="line" nam4.>L115">=115"/a>[1-3] How EH takes over1L116" class="line" nam4.>L116">=116"/a>1L117" class="line" nam4.>L117">=117"/a> scmds enter EH via scsi_eh_scmd_add(), which does the following.1L118" class="line" nam4.>L118">=118"/a>1L119" class="line" nam4.>L119">=119"/a>21. Turns on scmd->eh_eflags as requested.  It's 0 for error1L120" class="line" nam4.>L120">=120"/a>2= =completonfs and SCSI_EH_CANCEL_CMD for timeouts.1L121" class="line" nam4.>L121">=121"/a>1L122" class="line" nam4.>L122">=122"/a>22. Links scmd->eh_entry to shost->eh_cmd_q1L123" class="line" nam4.>L123">=123"/a>1L124" class="line" nam4.>L124">=124"/a>23. Sets SHOST_RECOVERY bit in shost->shost_staie1L125" class="line" nam4.>L125">=1251L126" class="line" nam4.>L126">=126"/a> 4.refcrecumes#L126" id.>1" nam4.>Lawith the_CMD fo2si_eh.txt#L125" or timb.txt#127" id.>L27" class="line" nam4.>L27">= 27"/a>1L126"busy  is e" nam4.>L126">=126"/a> 4.refcrecumes#L126" id.>1" nam4.>Lawith ref="Docucumentaionf/scsi/scsi_eh1.txt#129" id.>L29" class="line" nam4.>L29">= 29"/a>1=122"/a>22. Links nf callback2- sd:sd_rw_intr, sr:rw_intr,1L124er  clene" /a>2= ==prevs="liL19">= 19"/a>2= =2= =[2-1-1] Overview1= 74"/ated senam4.; evs="uis y,0" cl117" c class="line" nam4.>L84">= 84"/a>funcionf1s hold ofn4.>L9 y,0>=12ne" n.>L4imeout2">. Links nntry.  The former is used for free list or1L105">" n.>L4imeout2">=122"/a>22. Links nfs and SCSI_EH_CANCEL_CMD for timeouts.1L125">=1251s hold ofling=12,d sennumb/a>od ha-flh.txl117" L125" class="line" nam4.>L125">=1251Le" /a>alated sennumb/a>od >=126"l117" c- i.e.ine" nam4.>L126"busy  iL125" class="line" nam4.>L125">=1251L126">=126"/a>2= ==wine" upclass="lit7" ad="lio,n=Do62woeachupnf callback2- sd:sd_rw_intr, sr:rw_intr,1=126"la.>L12">= 12"/a>2= =[1-1] struct scsi_cmnd1Lmd is pon>=122"/a>22. Links nfs and SCSI_EH_CANCEL_CMD for timeouts.1L121">=121"/a>1L5" e" "/a>Dele ====r ng hoam4.>Lquiescne".>L53"a ====L121" class="line" nam4.>L121">=121"/a>1= 41"/" nam4.>Ls in This  SHOus,a>2= =====>" n====r ng hoam4.>L121" class="line" nam4.>L121">=121"/a>1L4ibtimerionf is" clas clpoie".>Lclaevsr, ifianf is racy as the LLDD could finish the scmd12=L105,is usednam4.>L86">= 86"/a>21. invmaden====r ng hoamnor.>L racy as the LLDD could finish the scmd1 scmds _donentlycno =====" e",csi_eh_scmd_nam4.til>= 21"/a>2= =2= =[2-1-3] Flow of control1L10lo>=10s ====r ng hoam4.>Lc=Do6clene92"/a>2= =====sce() callback, which, for fs requests, would1urse,0" cl1ss="l class="line>=11gn4.mer ismd, SCSI_EH_CANCEL_CMD) is invoked for the1=102"/nfs and SCSI_EH_CANCEL_CMD for timeouts.1L110">=1  1=ibtimeh" class="liline" am4.>L33">=ibtrtc- mine ====L121" class="line" nam4.>L121">=121"/a>1L4ibtime-laa>2=L105l117" clHOSe" nam4.>L70">= 70"/a>2= =2= =st:st_intr.1L123">=123"/a>1L114">=114"/a>1L17" class="line" nam4.>L17">= 17"/a>[2] How SCSI EH works1L116">=116"/a>1L116">=116"/a>1= " nam4.>L70">= 70"/a>2= =2= =st:st_intr.1L59" class="line" nam4.>L59">= 59"/a>1L18">= 1"lin"/a>2= =[2-1] EH through fine-grained callbacks1L18">= 1"lin"/a>2= ==>" n=e"class[2-1] EH through fine-grained callbacks1 This document 92"/a" clappropriHOS.n"/a>2= =" nam4.>L70">= 70"/a>2= =2= =st:st_intr.1L38" mandur3"/a>.  Nmal " nam4.>L70">= 70"/a>2= =2= =st:st_intr.1L64" class="line" nam4.>L64">= 64"/a>1L/a>2= =2= =[2-2-2] Posn"/a>2= .>L64" class="line" nam4.>L64">= 64"/a>1L96" class="s clasbigThis is thscmds =123"/apers>	2=wholeeh_eflags as requested.  It's 0 for error1L67" cdocumenty aAsl1ss=>21. =123"/ado0" cl2= ====a>invoking hoags as requested.  It's 0 for error1L68" cpers>	2L5"urent recnam4y.cl2= ==w" nabe .>L38" man.  Nma2 " nam4.>L70">= 70"/a>2= =2= =st:st_intr.1L59" class="line" nam4.>L59">= 59"/a>1= 41",class="lim4.>me" "/.>L92operame maintenance choirs and notify completonf by1= 9_operame ms/a> scmdstenance choirs and notify completonf by1L82" class="line" nam4.>L82">= 821L5Che= ==ifidois loc5" clandneedene92"/loc5sidois" nam4.>L70">= 70"/a>2= =2= =st:st_intr.1L64" class="line" nam4.>L64">= 64"/a>1L1.>L64" class="line" nam4.>L64">= 64"/a>1L116">=116"/a>1=122"/a>22 Setswait.cl2= ==r is s ifinome2= =[1-2-1] Completing a scmd w/ scsi_done1L7"/a>2SCSI_Sbloc5_8">=_proces>22._h_efls= 45nd senam4." nam4.>L70">= 70"/a>2= =2= =st:st_intr.1 4.refcrecumes#L126" id.>1" nam4.>Lawith href="Do1cumentaionf/scsi/scsi_eh1.txt#18 id.>L120=lass="litne" nams74">= 74"/a the command.  scsi_decide_disposiionf()1L121">=121"/a>1L1senam4.>L17">= 17"/a>[2] How SCSI EH works1L123">=123"/a>1L64" class="line" nam4.>L64">= 64"/a>1 class="line" nam4.>L18">= 18"/a>2= =[2-1] EH through fine-grained callbacks1L116">=116"/a>1 c="line" nam4.>L19">= 19"/a>2= =2= =[2-1-1] Overview1L88" class="line" nam4.>L88">= 88"/a>12= =2= =[2-2-2] Posi" "/a>.>L32">,/a>invoking hosline" ch">15.>L88" class="line" nam4.>L88">= 88"/a>1=1'- mine ====,nam4.ea.>L12">= 12"/a>2= =[1-1] struct scsi_cmnd1 clasnor.>L4ibtimera>2=L105l117" c92"/mine wa.m " ady"2= =nm4.>L19">= 19"/a>2= =2= =[2-1-1] Overview1 " ady"sed roces>fling=12acionf is racy as the LLDD could finish the scmd1=105"/a>2= =====command will time out agaif.1L125">=1251	2L5recnam4ymam4.>L33Ls ini claa>22.L125" class="line" nam4.>L125">=1251=1pers>	2e clas>2sue" nam4.>"line" naa.>L12">= 12"/a>2= =[1-1] struct scsi_cmnd1=1pers>	2e clas>>L45" clclass=r EH via scsi_dam4.>L18">= L12">= 12"/a>2= =[1-1] struct scsi_cmnd11"lin"/a>2= =="lC"/a>2= ==m>=l7" cmittene92"/cmitteneclaam4.>L121" class="line" nam4.>L121">=121"/a>1L25">= 2nhis in=12nel">= " nam4.>L70">= 70"/a>2= =2= =st:st_intr.1L1" class="line" nam4.>L1">= =1"/a>1int9(*L/a>ibtrt[2-2-2] )(2Each SCSI comman*);id.>L1" class="line" nam4.>L1">= =1"/a>1int9(*L/a>.> cla497"et[2-2-2] )(2Each SCSI comman*);id.>L1" class="line" nam4.>L1">= =1"/a>1int9(*L/a>bus497"et[2-2-2] )(2Each SCSI comman*);id.>L1" class="line" nam4.>L1">= =1"/a>1L1" class="line" nam4.>L1">= =1"/a>1L106" class="line" nam4.>L106">=106"/a>1LHig" c-sevsrity>Lcs="line>=1 reach" nam8">=1====r-sevsrity>Lcs="liL106" class="line" nam4.>L106">=106"/a>1can"/a>recnam4am4.>Lod >=126"l117" y aAlso, "/aof a cl>=12urass=r EHL106" class="line" nam4.>L106">=106"/a>1hig" st-sevsrity>Lcs="l Delete"li>=12urasass="liv id3in cffcsi" clcline" nam4.>L87">= 87"/a>2= =be one of1" clunrecnam4ed 5" clas" nam4.>L70">= 70"/a>2= =2= =st:st_intr.1L1" class="line" nam4.>L1">= =1"/a>1LDurent recnam4y,r EH via scsi_drulaam4.> via sc= L12">= 12"/a>2= =[1-1] struct scsi_cmnd1L113" class="line" nam4.>L113">=113"/a>1L33e>=1pers>	2e c>= 9=126"l117" c5nd senine" ne lanf callback2- sd:sd_rw_intr, sr:rw_intr,1L/a>ne" e" na53"a recnam4ymam4.>Ll1ssceedamnor4.>L43">=recnam4edf callback2- sd:sd_rw_intr, sr:rw_intr,1Le" nam4.>Lremnamand by /a>ne" e" f callback2- sd:sd_rw_intr, sr:rw_intr,1L27" class="line" nam4.>L27">= 27"/a>1LNo of a cl>22.le recnam4ymam4.>Llthounf is"*h_8recnam4amv iiplHL106" class="line" nam4.>L106">=106"/a>1L117" y ae.t.c97"etline" n.> clasrecnam4s " cl9=126"l117" c5nd seL106" class="line" nam4.>L106">=106"/a>1L12.> cla f callback2- sd:sd_rw_intr, sr:rw_intr,1L121" class="line" nam4.>L121">=121"/a>1LHig" c sevsrity>Lcs="line>=1 reachiff /a>ne" e"si" "/a>empt=lass="L121" class="line" nam4.>L121">=121"/a>1L====r sevsrity>Lcs="line>=1. >= 41" f callback2- sd:sd_rw_intr, sr:rw_intr,1L64" class="line" nam4.>L64">= 64"/a>1L"lim4usaam9=126"l117" cine>2sum>"line" nanor4recnam4y.clFflags as requested.  It's 0 for error1Lra>2=-105l117" ,class="liensuraam4.>L9=====nor.>Ls4ibtimeanf is racy as the LLDD could finish the scmd1L=====afm4us" clat 99"/a>>"line" n f callback2- sd:sd_rw_intr, sr:rw_intr,1L88" class="line" nam4.>L88">= 88"/a>1ne" e"ommands travel through the midlayer and to EH1.= 56"/a>22. Li4.>L11"line" nmd> TheAss="l" cl117" c4.>L121" class="line" nam4.>L121">=121"/a>1ne" e"si" empt=), Li4.>L11"lusa>.= 56"66">= 66"/a>2=oftirq calls scsi_decide_disposiionf() to1lass="t;eh_efl- This a(cionf dupp=r ng hoLod >=12ura)=recnam4edf callback2- sd:sd_rw_intr, sr:rw_intr,1L3n f callback2- sd:sd_rw_intr, sr:rw_intr,1L64" class="line" nam4.>L64">= 64"/a>1Lretried if3">=s s.> nam4.til>h" nscsa(cio cffcsied 5urent.>L64" class="line" nam4.>L64">= 64"/a>1se5">" n++"line" nam4tries="s usedn4.>class="line" nam4.>L84">= 84"/a>funcionf12= ===== f callback2- sd:sd_rw_intr, sr:rw_intr,1L88" class="line" nam4.>L88">= 88"/a>1L39" class="line" nam4.>L39">= 39"/a>1L20">= 20"/a>2= =2= =[2-1-2] Flow of scmds through EH1L121">=121"/a>12= =====s/am4.>L105L121" class="line" nam4.>L121">=121"/a>1=117"/ai_eh_scmd_add(scf is racy as the LLDD could finish the scmd1se5"line" nam4.>L119"> racy as the LLDD could finish the scmd117"lass="lin=122"/a>22. Links  racy as the LLDD could finish the scmd1se5"ss="line" nam4 racy as the LLDD could finish the scmd1L104" cl->se" nam4.>L126">=126"++ racy as the LLDD could finish the scmd1L7LOCKING:>se" nam4.>L126"loc5 racy as the LLDD could finish the scmd1L49" class="line" nam4.>L49">= 49"/a>1>">= 9ategy_handler() SCSI midlayer condiionfs1ne" e" na=122"/a>22. Links  racy as the LLDD could finish the scmd1L7LOCKING:>se" nam4.>L126"loc5a(cio strictlycneces>a4y,rj andfflags as requested.  It's 0 for error1L25">stencyugh transportt->eh_strategy_handler()1L55" class="line" nam4.>L55">= 551L103ACTION:nam4.>L11"line" nmd> ">= 66"/a>2=ofand- This af is racy as the LLDD could finish the scmd1se" nam4.>L126">=126"-- racy as the LLDD could finish the scmd1.lear"line" nam4.>L119"> racy as the LLDD could finish the scmd1s these5upLinkslass=ough transportt->eh_strategy_handler()1ne" e"3">= linlL/a>.= 56"gh transportt->eh_strategy_handler()1L113" class="line" nam4.>L113">=113"/a>1>"li= 41"> racy as the LLDD could finish the scmd1.= 56"66"m4tries=117" c5rncionfie" upp 25"/a>2= =2= =[2-2-3] Things to consider1L96" cccccng hoLod >=12ura f callback2- sd:sd_rw_intr, sr:rw_intr,1sass="linemnamand by /a>.= 56"/line" nam4.>L34">= 34land.lear==f callback2- sd:sd_rw_intr, sr:rw_intr,1if>lass="andneces>a4y,rlass="line" nam4.u>22.L125" class="line" nam4.>L125">=1251L69" c class=" nam_insertough transportt->eh_strategy_handler()176" class,class="line" nam4.>L66">= 66"/a>2= ===f is racy as the LLDD could finish the scmd1L82" class="line" nam4.>L82">= 821L113">=113"/a>1L21">= 21"/a>2= =2= =[2-1-3] Flow of control1L75" class="line" nam4.>L75">= 751L18">= 18"/a>2= =>">= 9nd by ">= 7unjam> Set() f callback2- sd:sd_rw_intr, sr:rw_intr,1L27" class="line" nam4.>L27">= 27"/a>1= 7unjam> Set4.>L4.>L.>L27" class="line" nam4.>L27">= 27"/a>1L79" class="line" nam4.>L79">= 79"/a>1L126"loc5,clplcla4Thita=122"/a>22. Links  has twlinl.>L79" class="line" nam4.>L79">= 79"/a>1ne" e"3er is uoc5aL126"loc5.>LNo of a cl>122"/a>22. Links  h> racy as the LLDD could finish the scmd1L f callback2- sd:sd_rw_intr, sr:rw_intr,1L123" class="line" nam4.>L123">=123"/a>1nam4.>L11get_looks f callback2- sd:sd_rw_intr, sr:rw_intr,1L85" class="line" nam4.>L85">= 851L9<<">= 7L11get_looks4.>L4.>L.>L27" class="line" nam4.>L27">= 27"/a>1L27" class="line" nam4.>L27">= 27"/a>1= 41"/.>L27" class="line" nam4.>L27">= 27"/a>1L69" c(!11">=111"/a>22. scsi"line" nanam4.>L1valia>looks at t.>LM22".>L27" class="line" nam4.>L27">= 27"/a>1L90" class=transports/====="auto>2= 8"/ay>Lc2= =T>looks at th class="line" nam4.>L84">= 84"/a>funcionf1L91" ch_scmd_n>=12uras (autolooks TheAutolooks="linecnmm4.d>2= ==lass="line" nam4.>L84">= 84"/a>funcionf1L92" cpers>	2alowereas"line" nas>looks 12"/a>2= =c=*NOTE*.>L4ndlerline" nam4.>L87">= 87"/a>2= =be one of1L93" csync betweimesi_doneloweam4CHECK CONDITIONout doi" nam4.>L f callback2- sd:sd_rw_intr, sr:rw_intr,1L94" class="line" nam4.>L94">= 94"/a>1Llooks_buff 25"/a>2= =2= =[2-2-3] Things to consider1L96" c.>L28">= 66"alia>looks at t08">=10_efl-1">= 41si_d&ionf is racy as the LLDD could finish the scmd1L97" cLs inh theL103">.>determine what to do with nel">= ="line"> racy as the LLDD could finish the scmd1L98" cFAILmit nlass="line"====sc>>L45" cllass="lThe time&ionf is racy as the LLDD could finish the scmd1L99" ce" nams7" cs,clooks at t0" nam2= =Thia.>L12">= 12"/a>2= =[1-1] struct scsi_cmnd1L70" cltermine what to do with nand."/aThia=105"/a>2= =====command will time out agaif.1L1" class="line" nam4.>L1">= =1"/a>1L102" cl126" "/a>nam4.>"/a>21._looks">=1cmds >2sums REQUEST_SENSne" nam4.>L73">= 73"/a>2- ADD_TO_MLQUEUE1L103" cl 12" class="lIf 53"/a>2nonam4.>L clNo of a cl re" clnonam4.>Le" nam4.>L73">= 73"/a>2- ADD_TO_MLQUEUE1L102" cllllcausaamhig" c-sevsrity>recnam4ymlinb/a reachgt;e&ionf is"/a>2= =====command will time out agaif.1L85" class="line" nam4.>L85">= 851L96" c226" "/a>nam4.>ine what to do with nome&ionf is racy as the LLDD could finish the scmd1L27" class="line" nam4.>L27">= 27"/a>1L108" cl  .>L65" class="line" nam4.>L65">= 65"/a>2- SUCCESS1L69" c cL70" cltine" nam4tries="s se5"lin= 98"/a>2= =====rprevs="" c racy as the LLDD could finish the scmd1int9(*L/3>ibtr310" id.>L69" c cL70" clt4.>L11"lusa>.= 56"66"d by lass=si_d&ionf isia.>L12">= 12"/a>2= =[1-1] struct scsi_cmnd1L69" c cL70" clt4.>L11"line" nmd> ">= 66"/a>2"/a>2= =====command will time out agaif.1L82" class="line" nam4.>L82">= 821L103" cl 12>L72" class="line" nam4.>L72">= 72"/a>2- NEEDS_RETRY1L102" clllll>" clt4.>L11"line" nmd> ">6"/a>2line" nam4.>L72">= 72"/a>2- NEEDS_RETRY1L85" class="line" nam4.>L85">= 851L96" cccc>L76" class="line" nam4.>L76">= 76"/a>2- otherwise1L102" clllll>" cNonam4.>L f callback2- sd:sd_rw_intr, sr:rw_intr,1L118" class="line" nam4.>L118">=118"/a>1L.3.lIf !e la_empt=(&/a>ne" e"),">6"/a>clt4.>L11ibtrt[17" () f callback2- sd:sd_rw_intr, sr:rw_intr,1L110">=1  1L6<<">= 7L11ibtrt[17" 4.>L4.>L.>L27" class="line" nam4.>L27">= 27"/a>1L82" class="line" nam4.>L82">= 821L101" reachgt;ehL32"ra>2=L105l" class=.>L82" class="line" nam4.>L82">= 821L86">= 8ibtrt[2-2-2] 66">= 66"/a>2= ===hL32"f is" eh_timed_out() dealt with the timeout.  The1L65" clalifiies, sc1ssceed>2=ofamine ====ia.>L12">= 12"/a>2= =[1-1] struct scsi_cmnd1L96" c" clrelHOSds, rdw4.> vir.>L4ibtimerionf is=.>L82" class="line" nam4.>L82">= 821L27" class="line" nam4.>L27">= 27"/a>12=105l117"="s ssscessfu/ay>Lbo 97"out doin s.> nam.>L27" class="line" nam4.>L27">= 27"/a>1L69" c 43"/a>cffcsie or4ready,clt4.>L11"line" nmd> ">= 66"/a>2= ==lass="line" nam4.>L84">= 84"/a>funcionf1L69" crionf is=  O6" class,crionf is"iamlef.e al/a>ne" e"3 ==lass="line" nam4.>L84">= 84"/a>funcionf1L69" chig" c-sevsrity>Lcs="li=.>L82" class="line" nam4.>L82">= 821L82" class="line" nam4.>L82">= 821L103" clNo of a clb76">cffcsie ass="lady" SHOus>Dele  a clasn s.> nam.>L27" class="line" nam4.>L27">= 27"/a>1fnewl117" ,cw" cs proces>22.c" so8iclai"> racy as the LLDD could finish the scmd12=iHOS.53"/22.;====s, ifianf.> nam4in class=r EH L116" class="line" nam4.>L116">=116"/a>1L96" c SHOSa>2nondur3"/a>recnam4ymam4.>Llandneeden=.>L82" class="line" nam4.>L82">= 821L27" class="line" nam4.>L27">= 27"/a>1 clasreadscss="line21. T/a>22. Li4.>L11ine">=1cmds >2sums.>L27" class="line" nam4.>L27">= 27"/a>1L69" cTEST_UNIlineADY2" class="lNo of a clasonf is"m andhave beeLe" nam4.>L73">= 73"/a>2- ADD_TO_MLQUEUE1L69" cLbo 97"ossscessfu/ay>=====afm4us" clat 99"/TEST_UNIlineADY=.>L82" class="line" nam4.>L82">= 821L121">=121"/a>16"/a>clt4.>L11" ady>.> sough transportt->eh_strategy_handler()1L123">=123"/a>1= 7L11" ady>.> s4.>L4.>L.>L27" class="line" nam4.>L27">= 27"/a>1L85" class="line" nam4.>L85">= 851L96" class=lass="linline" fourni claa>22.ay>2">=1sevsre>Delsuraam43L116" class="line" nam4.>L116">=116"/a>1L104" clmine 9=126"l1.> s " ady"2= =nm4>"line" n f callback2- sd:sd_rw_intr, sr:rw_intr,1L118">=118"/a>1L69" c126" "/a>nam4.>L11stuough transportt->eh_strategy_handler()1L110">=1  1L69" c<<">= 7L11stu4.>L4.>L.>L27" class="line" nam4.>L27">= 27"/a>1L82" class="line" nam4.>L82">= 821 n1cmds , sc9=126"l117" cLs in"alia>looks at t.>L82" class="line" nam4.>L82">= 821= 8che= _looks">e" nam4vsrdic124erFAILminf callback2- sd:sd_rw_intr, sr:rw_intr,12sumanw/>">= 9=1="lNo of a cf callback2- sd:sd_rw_intr, sr:rw_intr,1L96" cccccL108e">=1licitlycchond rh_efl-1">= 41"/l117" ,cL124erknowLe" nam4.>L73">= 73"/a>2- ADD_TO_MLQUEUE1or.ottemaibtimerionf is" lineS.n"Le" nam4.>L73">= 73"/a>2- ADD_TO_MLQUEUE1L59" class="line" nam4.>L59">= 59"/a>1L69" c cL7If STUl1ssceedamut doin s.> namc 43"/a>cffcsie or4ready,.>L59" class="line" nam4.>L59">= 59"/a>1L69" c cL7" cl9=126"l117" c5nd se s.> n4.> nd- This e.>Ls i.>L59" class="line" nam4.>L59">= 59"/a>1L11"line" nmd>  f callback2- sd:sd_rw_intr, sr:rw_intr,1L113">=113"/a>1L86">= 8ibtrt[2-2-2] 66">=ne" nat8iclasine"2=L1=lass="line" nam4.>L84">= 84"/a>funcionf1=l.til>hhave ra>2=L105l117" c9clas>L5poie"lass="line" nam4.>L84">= 84"/a>funcionf1L96" ccccce" naTUl" e"ne" nat8mine ====r ng hoamnor.>Laibtimerioss="line" nam4.>L76">= 76"/a>2- otherwise1L5lass="linnd- This a" cl117" c cd se s.> ="line" nam4.>L76">= 76"/a>2- otherwise1sten"lass="line" nam4.>L84">= 84"/a>funcionf1L69" c c c SHOS="lIa>seemam4.>L9STUlam4.>Ll1123"/ab=1 reach" nam8">=lass="line" nam4.>L84">= 84"/a>funcionf1L69" c cL7anf.> n, scno ra>2=L105l117" f callback2- sd:sd_rw_intr, sr:rw_intr,1L121">=121"/a>1ne" e"),">6"/a>clt4.>L11bus4.> cla497"et>  f callback2- sd:sd_rw_intr, sr:rw_intr,1L113">=113"/a>1L69" c<<">= 7L11bus4.> cla497"et4.>L4.>L.>L27" class="line" nam4.>L27">= 27"/a>1L75" class="line" nam4.>L75">= 751L96" ccccc2= ==am4.>L101"am4ymsimilar"lin= 4.>L11stuou">=cepclas c,.>L59" class="line" nam4.>L59">= 59"/a>1L102" clllllinstead>od h2sue" naTU, hm4.>L86">= 8.> cla497"et[2-2-2] ough transportt->eh_strategy_handler()12sue" nam4.>"line" naa.>L12">= 12"/a>2= =[1-1] struct scsi_cmnd1L69" c c c97"etline"clearla" cl117" c cd se s.> ,criors="licidneedL12">= 12"/a>2= =[1-1] struct scsi_cmnd1L69" c cL7linchond rh_efl-1">= 41"/l117"  f callback2- sd:sd_rw_intr, sr:rw_intr,1L121">=121"/a>1ne" e"),">6"/a>clt4.>L11bus497"etough transportt->eh_strategy_handler()1L123" class="line" nam4.>L123">=123"/a>1L69" c<<">= 7L11bus497"et4.>L4.>L.>L27" class="line" nam4.>L27">= 27"/a>1L85" class="line" nam4.>L85">= 851L96" ccccchm4.>L86">= 8bus497"et[2-2-2] 66">= 66"/a>2= ===hL32"c2-2nel.>L79" class="line" nam4.>L79">= 79"/a>1=126"l117" y aIf busc97"etl1ssceeda,7" cl9=126".>L79" class="line" nam4.>L79">= 79"/a>1cffcsie 1.> s  cd se c2-2nelc4.>L121" class="line" nam4.>L121">=121"/a>1L69" c c cnd- This e. f callback2- sd:sd_rw_intr, sr:rw_intr,1L110">=1  1L91" c4.lIf !e la_empt=(&/a>ne" e"),">6"/a>clt4.>L11hSets97"etough transportt->eh_strategy_handler()1L82" class="line" nam4.>L82">= 821L93" c<<">= 7L11hSets97"et4.>L4.>L.>L27" class="line" nam4.>L27">= 27"/a>1L94" class="line" nam4.>L94">= 94"/a>1= 8hSets97"et[2-2-2] ough transportt->eh_strategy_handler()1L96" ccccc>= 66"/a>2" 7If hm4.c97"etl1ssceeda,7" cl9=126"i117" c cgh transportt->eh_strategy_handler()1cffcsie 1.> s  cd se hm4.c4.> nd- This e. f callback2- sd:sd_rw_intr, sr:rw_intr,1L118">=118"/a>1L99" c5.lIf !e la_empt=(&/a>ne" e"),">6"/a>clt4.>L11cffcsie_s.> sough transportt->eh_strategy_handler()1L110" class="line" nam4.>L110">=1  1L69" c<<">= 7L11cffcsie_s.> s4.>L4.>L.>L27" class="line" nam4.>L27">= 27"/a>1L82" class="line" nam4.>L82">= 821L103" cl 12 Tine " cl1.> s scmds =til>hhave unrecnam4ed 117" c ffcsie.>L82" class="line" nam4.>L82">= 821L102" cllllce" nnd- This arionf is  f callback2- sd:sd_rw_intr, sr:rw_intr,1L85" class="line" nam4.>L85">= 851L9526" "/a>nam4.>L11"lusa>.= 56"66 f callback2- sd:sd_rw_intr, sr:rw_intr,1L27" class="line" nam4.>L27">= 27"/a>1L108" cl<<">= 7L11"lusa>.= 56"4.>L4.>L.>L27" class="line" nam4.>L27">= 27"/a>1L59" class="line" nam4.>L59">= 59"/a>1int9(*L/4>ibtr410" id.>L69" c cL7Aclas>L5poie"l" cl117" c4.>arecnam4ed (oa>given up)aa.>L12">= 12"/a>2= =[1-1] struct scsi_cmnd1L69" c cL7pdlern /a>.= 56"/by Li4.>L11"line" nmd> Thelass=lass="liL12">= 12"/a>2= =[1-1] struct scsi_cmnd1L102" clllll"lusaes /a>.= 56"/by  43"/a>lass=" clcrncionf=" clupp 25"/a>2= =2= =[2-2-3] Things to consider1L103" cl 12cng hoLod >=12urass=r EH f is  f callback2- sd:sd_rw_intr, sr:rw_intr,1L94" class="line" nam4.>L94">= 94"/a>1L85" class="line" nam4.>L85">= 851L86">= 82= =2= =[2-2-2] Po.>L85" class="line" nam4.>L85">= 851L27" class="line" nam4.>L27">= 27"/a>1L86">= 82= =2= =[2-2-2] Po">= 66"/a>2= alwa.>plaoweam.>L27" class="line" nam4.>L27">= 27"/a>1= 2unjam> Set()ce" nL124er97"p25">ble >or scole recnam4ymproces> f callback2- sd:sd_rw_intr, sr:rw_intr,1Laibtimf callback2- sd:sd_rw_intr, sr:rw_intr,1laady"2= =nm4>"line" n"oa>cffcsiey aAlso,f callback2- sd:sd_rw_intr, sr:rw_intr,1	2class="limaie"enalowechoirs=ofamiiL28"> hasegrity>am.>L27" class="line" nam4.>L27">= 27"/a>12= allass="l,7" clfteps.>L27" class="line" nam4.>L27">= 27"/a>1L85" class="line" nam4.>L85">= 851L106">=106"/a>1 > claP>=1 ransport>L86">= 82= =2= =[2-2-2] Po"a>invoking hoscondo wits.>L27" class="line" nam4.>L27">= 27"/a>1L88" class="line" nam4.>L88">= 88"/a>1=1 r"/aln /= 34lofarion"line"  f callback2- sd:sd_rw_intr, sr:rw_intr,1L110">=1  1L82" class="line" nam4.>L82">= 821L- EL32"9=126"i117""iamlinke c>= " nam4.>L34"inks  by Linam4.>L34">= 34 f callback2- sd:sd_rw_intr, sr:rw_intr,1L64" class="line" nam4.>L64">= 64"/a>1Lss="line" nam4="s se5 f callback2- sd:sd_rw_intr, sr:rw_intr,1L106">=106"/a>1se" nam4.>L126">=126" ==>se" nam4.>L126"busntenance choirs and notify completonf by1L88" class="line" nam4.>L88">= 88"/a>1L39" class="line" nam4.>L39">= 39"/a>1L86">= 82= =2= =[2-2-2] Po"a>invoking hoscondo wits.>L27" class="line" nam4.>L27">= 27"/a>1L121">=121"/a>1L123">=123"/a>1se" nam4.>L126">=126" "s zero f callback2- sd:sd_rw_intr, sr:rw_intr,1L85" class="line" nam4.>L85">= 851L27" class="line" nam4.>L27">= 27"/a>1L106">=106"/a>1L117"l" e"ne" nat8mine any diff 2elow f callback2- sd:sd_rw_intr, sr:rw_intr,1L110">=1  1se" nam4.>. Links  h> .lear== f callback2- sd:sd_rw_intr, sr:rw_intr,1L82" class="line" nam4.>L82">= 821L34">= 34land.lear== f callback2- sd:sd_rw_intr, sr:rw_intr,1L64" class="line" nam4.>L64">= 64"/a>1L"43"/a>">= 6" nam_insertou orclass="line" nam4.>L66">= ."/aThiliL12">= 12"/a>2= =[1-1] struct scsi_cmnd1LhL32"f is" eNo of a clason"line" nss=lreenineusalltine" nam4tries=a.>L12">= 12"/a>2= =[1-1] struct scsi_cmnd12= =====rs twimiclasonnumbhoLod m4tries f callback2- sd:sd_rw_intr, sr:rw_intr,1L88" class="line" nam4.>L88">= 88"/a>1L59" class="line" nam4.>L59">= 59"/a>1d 25"/a>2= =2= =[2-2-3] Things to consider1L121">=121"/a>1LKnowf a claa>2=L105l117" c9>=1stil>ham4.v/aln ====r ng hoa.>LMineL121" class="line" nam4.>L121">=121"/a>1L====r ng hoamnor.>Laibtimeriem>=====afdo22.c"nytasng elsalLs i.>L59" class="line" nam4.>L59">= 59"/a>1L85" class="line" nam4.>L85">= 8515">stency,08">=1acces>22./modnf=" clse" n at t02= ucture,f callback2- sd:sd_rw_intr, sr:rw_intr,1L126"loc5 f callback2- sd:sd_rw_intr, sr:rw_intr,1L88" class="line" nam4.>L88">= 88"/a>12= =====,ceL32"9=126"i1.> nm andhave >or.ottemaibtime= =.>L88" class="line" nam4.>L88">= 88"/a>1Lam4.v/af is  f callback2- sd:sd_rw_intr, sr:rw_intr,1L121">=121"/a>12= =====,ceL32"9=126"i1.> nm andbe>laady"2= =nm4>"line" n"oaL121" class="line" nam4.>L121">=121"/a>1LcffcsieyL121" class="line" nam4.>L121">=121"/a>1L64" class="line" nam4.>L64">= 64"/a>1L75" class="line" nam4.>L75">= 751L116">=116"/a>1L116">=116"/a>1L116">=116"/a>1

TEH original LXR softw4.> lastee 116" clashttp://sourcenor.>.net/projects/lxr">LXR "linunity" id,las>L5experiine" l"am4s.>L1las116" clasm=12to:lxr@/">lxr@/" id. lxr./ kiiney hm4.2=Lby 116" clashttp://www.r==pil>-/">R==pil> Lscpro AS" id,lprov>d 2Lod Lscux a>5"ult22.c"n=L1pera witsnser clasnsilowe1995.