From patchwork Mon Dec 5 08:06:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jitendra Bhivare X-Patchwork-Id: 9460579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A37176071F for ; Mon, 5 Dec 2016 08:07:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94BC124B5B for ; Mon, 5 Dec 2016 08:07:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 899CC24DA2; Mon, 5 Dec 2016 08:07:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 673D024B5B for ; Mon, 5 Dec 2016 08:07:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751340AbcLEIHP (ORCPT ); Mon, 5 Dec 2016 03:07:15 -0500 Received: from mail-qk0-f182.google.com ([209.85.220.182]:33175 "EHLO mail-qk0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbcLEIHO (ORCPT ); Mon, 5 Dec 2016 03:07:14 -0500 Received: by mail-qk0-f182.google.com with SMTP id x190so338335997qkb.0 for ; Mon, 05 Dec 2016 00:07:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kojhF0YwUTBPccD+9yqRckP2Wmwxk2JiVbd29j2K7kk=; b=b7SbV14TYabGEISCmUzOniSfizahkH5CfSPAi7ffYhX029aZ8nRQUdjcn3sIPVxm60 wzvx3Woo5bz9wZxBfLnSBx5JDeAMSO85gZHISj92+evSOjEMG8hzTnC+XE/YaXnetqtZ 9ljczZE7YLa1ldtf9axTAY3LxpFnXcopt3Ly4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kojhF0YwUTBPccD+9yqRckP2Wmwxk2JiVbd29j2K7kk=; b=TE8a0ZIkByqOGl5of5FNKgrVapAGgaUR40nRIHvmnrONcwegGxmEWwIIMAtfPDbDPg HIuAyHBnZ/fkR9gQkiEoMrBxScZ/Gr77fE42FEA0pIEm6+ICMNS3qS5GAx4peVi8rzEg twFtcuW1jVnOCqzifnvgtpN46Ui1lksPdDxMP+SK+d7yeayWgwjEIozrBLiuGavWirWv qN48+p4BVZ5Ho5TcT9iOc1FwBA7vX1jXyyGLXMmn+9EXFFAwMxEWmR9jaVCoH9A99DEM JHpO0JqBlAh9agm67FElrJYPgz1Y8Q8DIg5GcPXFmddm/I0cRO1xivye3rRmAo0WRq0y 9Z/w== X-Gm-Message-State: AKaTC00t2Hzut023T0q9OBYPSZhUkrKNW6yFL3srQJSbLuuCtcHcuEn7ZDakl+V6w242RAoI X-Received: by 10.55.128.3 with SMTP id b3mr47810959qkd.130.1480925233117; Mon, 05 Dec 2016 00:07:13 -0800 (PST) Received: from android.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id i19sm8890519qte.8.2016.12.05.00.07.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Dec 2016 00:07:12 -0800 (PST) From: Jitendra Bhivare To: cleech@redhat.com, lduncan@suse.com Cc: linux-scsi@vger.kernel.org, Jitendra Bhivare Subject: [PATCH 04/12] be2iscsi: Set WRB invalid bit for SkyHawk Date: Mon, 5 Dec 2016 13:36:43 +0530 Message-Id: <1480925211-13223-5-git-send-email-jitendra.bhivare@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480925211-13223-1-git-send-email-jitendra.bhivare@broadcom.com> References: <1480925211-13223-1-git-send-email-jitendra.bhivare@broadcom.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP invalid bit in WRB indicates to FW that IO was invalidated before WRB was fetched from host memory. For SkyHawk, this invalid bit in WRB is at a different offset. Use amap_iscsi_wrb_v2 to mark invalid bit for SkyHawk. Signed-off-by: Jitendra Bhivare --- drivers/scsi/be2iscsi/be_main.c | 19 ++++++++++++++----- drivers/scsi/be2iscsi/be_main.h | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 6eaa78bd..948384c 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -244,8 +244,13 @@ static int beiscsi_eh_abort(struct scsi_cmnd *sc) beiscsi_conn = conn->dd_data; phba = beiscsi_conn->phba; /* mark WRB invalid which have been not processed by FW yet */ - AMAP_SET_BITS(struct amap_iscsi_wrb, invld, - abrt_io_task->pwrb_handle->pwrb, 1); + if (is_chip_be2_be3r(phba)) { + AMAP_SET_BITS(struct amap_iscsi_wrb, invld, + abrt_io_task->pwrb_handle->pwrb, 1); + } else { + AMAP_SET_BITS(struct amap_iscsi_wrb_v2, invld, + abrt_io_task->pwrb_handle->pwrb, 1); + } inv_tbl.cid = beiscsi_conn->beiscsi_conn_cid; inv_tbl.icd = abrt_io_task->psgl_handle->sgl_index; spin_unlock_bh(&session->back_lock); @@ -321,9 +326,13 @@ static int beiscsi_eh_device_reset(struct scsi_cmnd *sc) __iscsi_get_task(task); io_task = task->dd_data; /* mark WRB invalid which have been not processed by FW yet */ - AMAP_SET_BITS(struct amap_iscsi_wrb, invld, - io_task->pwrb_handle->pwrb, - 1); + if (is_chip_be2_be3r(phba)) { + AMAP_SET_BITS(struct amap_iscsi_wrb, invld, + io_task->pwrb_handle->pwrb, 1); + } else { + AMAP_SET_BITS(struct amap_iscsi_wrb_v2, invld, + io_task->pwrb_handle->pwrb, 1); + } inv_tbl->tbl[nents].cid = beiscsi_conn->beiscsi_conn_cid; inv_tbl->tbl[nents].icd = io_task->psgl_handle->sgl_index; diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h index f869e37..8ba8c12 100644 --- a/drivers/scsi/be2iscsi/be_main.h +++ b/drivers/scsi/be2iscsi/be_main.h @@ -840,7 +840,7 @@ struct amap_iscsi_wrb_v2 { u8 diff_enbl; /* DWORD 11 */ u8 u_run; /* DWORD 11 */ u8 o_run; /* DWORD 11 */ - u8 invalid; /* DWORD 11 */ + u8 invld; /* DWORD 11 */ u8 dsp; /* DWORD 11 */ u8 dmsg; /* DWORD 11 */ u8 rsvd4; /* DWORD 11 */