From owner-freebsd-scsi@FreeBSD.ORG Tue Mar 3 08:11:03 2015 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D51C610A; Tue, 3 Mar 2015 08:11:03 +0000 (UTC) Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [IPv6:2607:f8b0:4001:c03::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92DF91A8; Tue, 3 Mar 2015 08:11:03 +0000 (UTC) Received: by iebtr6 with SMTP id tr6so55001665ieb.10; Tue, 03 Mar 2015 00:11:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=g5up8QA6toF4z9WLk1PslGBKOG1ed+qnzTao04+cIb8=; b=pk8dqc1D3//QYNfHQnccjXsGKXgrHhdZA0+2SU43O0PzBT0qWeJCdWe4FJk07yueUI MniNwWGTpqBmIUSvhdE/0QTu6OjF2ojKTa68EeYQybSDpnmdnH43B2iaChu1ePvn7Chk sF4YtB7mtA2fSogPjzW24tfitmKCcyGNzm/pf/moHNOZ1CF8cMynupalZF7ZAHxHAt2W d394niVMsqH8d1zQXXNmSp6liWnN6MbXHIM1OA3P2b87TtGLYYBPEUMnvUwoomo3fvB2 ovuemhRQKkEQyW5mPf70J7is2jJHyAC5E8KJQ7PBuQHQ708cxDAwZBD4e54vhfFX9dk8 rW9Q== MIME-Version: 1.0 X-Received: by 10.107.40.2 with SMTP id o2mr187203ioo.68.1425370262948; Tue, 03 Mar 2015 00:11:02 -0800 (PST) Received: by 10.36.23.133 with HTTP; Tue, 3 Mar 2015 00:11:02 -0800 (PST) In-Reply-To: References: <20150303065052.GA98687@mithlond.kdm.org> Date: Tue, 3 Mar 2015 16:11:02 +0800 Message-ID: Subject: Re: What does the error code 82 mean? From: fengyd To: "Kenneth D. Merry" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-scsi@freebsd.org X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 08:11:04 -0000 Hi, I also added some log in the procedure sym_int_sir: case SIR_DATA_OVERRUN: if (cp) { OUTONB (HF_PRT, HF_EXT_ERR); cp->xerr_status |= XE_EXTRA_DATA; cp->extra_bytes += INL (nc_scratcha); xpt_print_path(cp->cam_ccb->ccb_h.path); printf("SIR_DATA_OVERRUN flag = %d, extra_bytes = %d\n", cp->cam_ccb->ccb_h.flags, INL (nc_scratcha)); } goto out; Here's the printout: (pass0:sym0:0:0:0): SIR_DATA_OVERRUN flag = 32832, extra_bytes = 64 (pass0:sym0:0:0:0): COMMAND FAILED (87 0 1). Thanks for your help. Br. Yafeng On Tue, Mar 3, 2015 at 3:50 PM, fengyd wrote: > Hi, > > Thanks very much for your reply. > > -How are you sending the INQUIRY command? > Yes. > -Are you sending it via the pass(4) driver? > Yes > -How many bytes are you asking for in the CDB? > 64 > -How many bytes are you setting in the dxfer_len field in the CCB? > 64, but it seems the device wants to transfer 128 bytes. > > -What kind of device are you talking to? > Some kernel log: > da3 at sym1 bus 0 target 0 lun 0 > da3: Fixed Direct Access SCSI-3 device > da3: 40.000MB/s transfers (20.000MHz, offset 31, 16bit), Tagged Queueing > Enabled > da3: 70136MB (143638992 512 byte sectors: 255H 63S/T 8941C) > > > [image: Inline image 2] > > The brief connections as above: > UNIT0 can access DISK0 and DISK1 by IOC0. > UNIT1 can access DISK0 and DISK1 by IOC1. > > The problem happens when UNIT0 sends XPT_RESET_DEV to reset one disk, > UNIT1 sends INQUIRY to get the basic information from the target, but fails > to get the correct information. > > And I added some log. > > > > The right information got from device: > > 00 00 03 12 5B 00 01 3A 46 55 4A 49 54 53 55 20 > > 4D 42 41 33 30 37 33 4E 50 20 20 20 20 20 20 20 > > 34 37 30 32 42 42 53 32 50 41 41 30 31 31 46 34 > > 00 00 00 00 00 00 00 00 0F 00 00 40 0B 54 01 3C > > > > The wrong information got from device: > > 00 00 00 00 03 00 12 00 5B 00 00 00 01 00 3A 00 > > 46 00 55 00 4A 00 49 00 54 00 53 00 55 00 20 00 > > 4D 00 42 00 41 00 33 00 30 00 37 00 33 00 4E 00 > > 50 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 > > > > Compared to the right log, it seems one extra byte *00* is added after > every byte. > > > > Thanks for your help. > > Br. > Yafeng > > > On Tue, Mar 3, 2015 at 2:50 PM, Kenneth D. Merry wrote: > >> >> An overrun is exactly what the comment below indicates. It is when the >> target sends back more data than you asked for. You will generally see it >> on commands that receive data from a target. >> >> How are you sending the INQUIRY command? Are you sending it via the >> pass(4) driver? How many bytes are you asking for in the CDB? How many >> bytes are you setting in the dxfer_len field in the CCB? >> >> What kind of device are you talking to? Obviously, you're using the >> sym(4) >> driver, so I'm guessing this is a parallel SCSI device (unless there is a >> virtualization stack that emulates the sym(4) hardware). >> >> Ken >> >> On Mon, Mar 02, 2015 at 15:49:57 +0800, fengyd wrote: >> > Hi, >> > >> > I found the related code in the function sym_int_sir: >> > /* >> > * The device wants us to tranfer more data than >> > * expected or in the wrong direction. >> > * The number of extra bytes is in scratcha. >> > * It is a data overrun condition. >> > */ >> > case *SIR_DATA_OVERRUN*: >> > if (cp) { >> > OUTONB (HF_PRT, HF_EXT_ERR); >> > * cp->xerr_status |= XE_EXTRA_DATA;* >> > cp->extra_bytes += INL (nc_scratcha); >> > } >> > goto out; >> > >> > I'm not familiar with SCSI. >> > What does DATA_OVERRUN actually mean? >> > How can it be triggered? >> > Could you give more details about it? >> > >> > Thanks for your help. >> > >> > Br. >> > Yafeng >> > >> > >> > >> > On Sat, Feb 28, 2015 at 4:50 PM, fengyd wrote: >> > >> > > Hi, >> > > >> > > It seems the error code 82 & 3F is 0x12. >> > > And the definition of the error code in the file cam.h: >> > > CAM_AUTOSENSE_FAIL = 0x10,/* Autosense: request sense cmd >> fail */ >> > > CAM_NO_HBA, /* No HBA Detected error */ >> > > CAM_DATA_RUN_ERR, /* Data Overrun error */ >> > > >> > > So, it means data overrun error? >> > > >> > > Thanks. >> > > >> > > Br. >> > > Yafeng >> > > >> > > On Sat, Feb 28, 2015 at 4:32 PM, fengyd wrote: >> > > >> > >> Hi, >> > >> >> > >> INQUIRY command is sent to the target, but error code 82 is returned. >> > >> I added some log in the driver: >> > >> SIR_COMPLETE_ERROR >> > >> (pass0:sym0:0:0:0): sym_complete_error status = 18 >> > >> (pass0:sym0:0:0:0): status = 82 >> > >> >> > >> Do you know what does the error code 82 mean? >> > >> >> > >> Thanks in advance. >> > >> >> > >> Br. >> > >> Yafeng >> > >> >> > > >> > > >> > _______________________________________________ >> > freebsd-scsi@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-scsi >> > To unsubscribe, send any mail to "freebsd-scsi-unsubscribe@freebsd.org" >> >> -- >> Kenneth Merry >> ken@FreeBSD.ORG >> > >