From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751535AbdFHMLK (ORCPT ); Thu, 8 Jun 2017 08:11:10 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:7393 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751092AbdFHMLG (ORCPT ); Thu, 8 Jun 2017 08:11:06 -0400 Subject: Re: [PATCH v3 14/23] scsi: hisi_sas: add v3 cq interrupt handler To: Christoph Hellwig References: <1496241195-217678-1-git-send-email-john.garry@huawei.com> <1496241195-217678-15-git-send-email-john.garry@huawei.com> <20170601054147.GB4743@infradead.org> <04821e06-7541-1861-d52b-4df869570ca7@huawei.com> <20170608073400.GA9292@infradead.org> CC: , , , , , , , Xiang Chen From: John Garry Message-ID: <0336e738-e5a7-889a-2ee2-f1a951492067@huawei.com> Date: Thu, 8 Jun 2017 13:09:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20170608073400.GA9292@infradead.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.203.181.152] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.59393E93.01CA,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: cf3dcd4f118727ba3d093abf5d9a5ecb Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/06/2017 08:34, Christoph Hellwig wrote: > Hi John, > > sorry for dropping the ball, but your repost reminded me. > > On Thu, Jun 01, 2017 at 11:36:55AM +0100, John Garry wrote: >> In the command completion code we need to check for abnormal completion due >> to underflow, but ignore it when it occurs in some commands, like inquiry. >> This is why we check for rw command - it is equivalent to !inquiry. >> >> I'll see if we can change the check to explicitly ignore certain commands >> which complete abnormally with underflow. > > In general it should be up to the higher level and not the driver > to detect underflow, and that's how most (hopefully all, but I won't > bet on some older ones) of our drivers operate. > Hi Christoph, Right, I see most LLDDs will not check for underflow; but, FWIW, I do see scsi_cmnd.underflow referenced in some... However, for drivers using libsas, we detect underflow for the reason just so libsas knows the sas_task status (SAS_DATA_UNDERRUN) and sets the scsi cmd result properly (and also the residual) in sas_end_task(). We used this method for the predecessor hw driver, and I think that we can revert to it. Much appreciated, John >> >>> What about 32-byte CDs or things like Write Same? >>> >> >> You're talking about VARIABLE_LENGTH_CMD (opcode 0x7f) for 32-byte CDs, >> right? > > Yes. > > . >