From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754508AbcHVHvD (ORCPT ); Mon, 22 Aug 2016 03:51:03 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:43570 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750839AbcHVHvB (ORCPT ); Mon, 22 Aug 2016 03:51:01 -0400 Subject: Re: [PATCH 1/8] hisi_sas: add internal abort core code To: zhangfei , , References: <1470835205-65684-1-git-send-email-john.garry@huawei.com> <1470835205-65684-2-git-send-email-john.garry@huawei.com> <7a5a91f3-51bc-52ff-ded4-418133a67b4b@linaro.org> CC: , , , , From: John Garry Message-ID: Date: Mon, 22 Aug 2016 08:50:12 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <7a5a91f3-51bc-52ff-ded4-418133a67b4b@linaro.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.203.181.152] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.57BAAEC6.00FE,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 3b4b9af2d001e681b046fc43f047b74e Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/08/2016 01:44, zhangfei wrote: > > > On 2016年08月10日 21:19, John Garry wrote: >> Add core code for internal abort functionality. >> >> The internal abort features allows the host controller >> to abort commands which are still active in the >> controller but have not yet been sent to the slave >> device. >> >> Typically a command only spends a relatively >> short time in the controller when compared to the >> amount of the time after it is sent to the slave >> device. >> Two modes of internal abort are supported: >> - device >> - individual command >> >> For device, when the internal abort is issued all >> commands in the host for that device are aborted. >> For a single command, only that command is aborted >> if it is still in the host. >> >> In HW the internal abort command is executed >> similar to any other sort of command, like SSP. >> >> Signed-off-by: John Garry >> --- >> drivers/scsi/hisi_sas/hisi_sas.h | 3 + >> drivers/scsi/hisi_sas/hisi_sas_main.c | 154 >> ++++++++++++++++++++++++++++++++++ >> 2 files changed, 157 insertions(+) >> >> diff --git a/drivers/scsi/hisi_sas/hisi_sas.h >> b/drivers/scsi/hisi_sas/hisi_sas.h >> index 4731d32..4ae864d 100644 >> --- a/drivers/scsi/hisi_sas/hisi_sas.h >> +++ b/drivers/scsi/hisi_sas/hisi_sas.h >> @@ -146,6 +146,9 @@ struct hisi_sas_hw { >> struct hisi_sas_slot *slot); >> int (*prep_stp)(struct hisi_hba *hisi_hba, >> struct hisi_sas_slot *slot); >> + int (*prep_abort)(struct hisi_hba *hisi_hba, >> + struct hisi_sas_slot *slot, >> + int device_id, int abort_flag, int tag_to_abort); > > How about add comments to abort_flag and tag_to_abort. > As a result, not sure why differently calling in hisi_sas_abort_task > hisi_sas_internal_task_abort(hisi_hba, device, 1, tag); > hisi_sas_internal_task_abort(hisi_hba, device, 0, tag); > > Thanks > > > . > OK, I can do. I will add a MACRO for the abort flag, whether device abort or single IO abort modes. I will also mention for device abort mode that the tag is unused. Thanks, John