From patchwork Tue Dec 13 10:25:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jitendra Bhivare X-Patchwork-Id: 9472023 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 D91DB607EE for ; Tue, 13 Dec 2016 10:26:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE7422858C for ; Tue, 13 Dec 2016 10:26:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B35272858E; Tue, 13 Dec 2016 10:26:53 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 010DB2858C for ; Tue, 13 Dec 2016 10:26:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932555AbcLMK0u (ORCPT ); Tue, 13 Dec 2016 05:26:50 -0500 Received: from mail-qt0-f181.google.com ([209.85.216.181]:32833 "EHLO mail-qt0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932220AbcLMK0t (ORCPT ); Tue, 13 Dec 2016 05:26:49 -0500 Received: by mail-qt0-f181.google.com with SMTP id p16so102138242qta.0 for ; Tue, 13 Dec 2016 02:26:49 -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=bZms1hILhIHdB6QRAzH+QFeO7ucIKZnxEXfjip0VJvM=; b=UtqhwN8xu3+RZC9jBIZHVNEZhSfSyVFKpX0R/4khLE/Y5nyd7llUNYpixlxlQfu9t5 Zd/W4i1y5aeT3qRl4cQI/DdcqNTmG4BfXbRgEuOd50n17C+24WjAyKUq8H2qIXT81OgP X/HUnaRhPG8KAhdNFziq83JstC8Y9xnKJS7UU= 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=bZms1hILhIHdB6QRAzH+QFeO7ucIKZnxEXfjip0VJvM=; b=KAYC5AQp5iFDvE3RuD1ohE2Yu1Y0GVCWJfYcRMXIPj5GuidZ2zGkQ+hS9YzBzzvPxQ DVRUbgNsgvl419kDXPVI0DkM6afvqAPe400Uyt81phq8osGz6SV7Ul/2xqCKAMLl+Swx FPLCY6dT81RIrgQ9B3iDAiDM2gN/yJkTulEV7fn+uXUCsqykArPG68NYlcFElEk/byKG e7A+s3PZmYRn+4hYaC3dhkk2BBWgeqCACEanDs++eOB6eQS1yZbnYLKFLogG+xYHzEBv bWNn7F+Z1KF+Yk9+X91naDfezmAOG4/Qo7qmKpGjn0Wxum7htgShQHqSFKpubTd0ISSS EQtQ== X-Gm-Message-State: AKaTC01ofdQ3XxHYXaMr9yNdovMkHcVPKdqIuCzW4rV6MBIJOWp9yxJBl5uWUW/uN3KNhTzP X-Received: by 10.200.57.89 with SMTP id t25mr96974169qtb.196.1481624808736; Tue, 13 Dec 2016 02:26:48 -0800 (PST) Received: from android.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id t124sm28606864qke.3.2016.12.13.02.26.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Dec 2016 02:26:48 -0800 (PST) From: Jitendra Bhivare To: cleech@redhat.com, lduncan@suse.com Cc: linux-scsi@vger.kernel.org, Jitendra Bhivare Subject: [PATCH v2 04/13] be2iscsi: Set WRB invalid bit for SkyHawk Date: Tue, 13 Dec 2016 15:55:57 +0530 Message-Id: <1481624766-13846-5-git-send-email-jitendra.bhivare@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481624766-13846-1-git-send-email-jitendra.bhivare@broadcom.com> References: <1481624766-13846-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 Reviewed-by: Hannes Reinecke --- 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 260842a..b509acd 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 */