From patchwork Tue Jan 15 01:09:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satish Kharat X-Patchwork-Id: 10763685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3253913B5 for ; Tue, 15 Jan 2019 01:25:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 218A72BAC8 for ; Tue, 15 Jan 2019 01:25:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 157C42BAD1; Tue, 15 Jan 2019 01:25:20 +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=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL 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 A859E2BAC8 for ; Tue, 15 Jan 2019 01:25:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727756AbfAOBZT (ORCPT ); Mon, 14 Jan 2019 20:25:19 -0500 Received: from rcdn-iport-2.cisco.com ([173.37.86.73]:37696 "EHLO rcdn-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727203AbfAOBZT (ORCPT ); Mon, 14 Jan 2019 20:25:19 -0500 X-Greylist: delayed 556 seconds by postgrey-1.27 at vger.kernel.org; Mon, 14 Jan 2019 20:25:19 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2060; q=dns/txt; s=iport; t=1547515519; x=1548725119; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=3m5sL6CJRXnoB3YtvSkinQ3gVuybftxTQ/4VglTw+MA=; b=bJTMzOhlTAwPkkRTC8bq+Cl58XMj88liMnwhDZrD1S8RY3aopktqpE9q lDNwGOa07AQGYLA4CVYsJXMEbxmtpDeiET57TBmaMYCp9yyfGwxATNRkD vTEx38BGnuNJBxx3jGLegLijgfkUKxeBbLfQQbWN+xIkGT88NLZvQKXY9 o=; X-IronPort-AV: E=Sophos;i="5.56,479,1539648000"; d="scan'208";a="508764567" Received: from alln-core-11.cisco.com ([173.36.13.133]) by rcdn-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2019 01:16:07 +0000 Received: from satish-ini-cisco-com.cisco.com (satish-ini.cisco.com [10.193.101.67]) by alln-core-11.cisco.com (8.15.2/8.15.2) with ESMTP id x0F1G2Bt016303; Tue, 15 Jan 2019 01:16:06 GMT From: Satish Kharat To: satishkh@cisco.com, martin.petersen@oracle.com, jejb@linux.vnet.ibm.com Cc: linux-scsi@vger.kernel.org Subject: [PATCH v2 09/10] scsi: fnic: RQ enable and then post descriptors Date: Mon, 14 Jan 2019 17:09:28 -0800 Message-Id: <20190115010929.15347-10-satishkh@cisco.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190115010929.15347-1-satishkh@cisco.com> References: <20190115010929.15347-1-satishkh@cisco.com> X-Outbound-SMTP-Client: 10.193.101.67, satish-ini.cisco.com X-Outbound-Node: alln-core-11.cisco.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 This change is the do RQ enable before positing descriptor. This is needed for later hw revisions. Signed-off-by: Satish Kharat --- drivers/scsi/fnic/fnic_main.c | 5 ++--- drivers/scsi/fnic/vnic_devcmd.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index 7a5665acf280..25e0414b6cb0 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c @@ -654,7 +654,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } err = fnic_dev_wait(fnic->vdev, vnic_dev_open, - vnic_dev_open_done, 0); + vnic_dev_open_done, CMD_OPENF_RQ_ENABLE_THEN_POST); if (err) { shost_printk(KERN_ERR, fnic->lport->host, "vNIC dev open failed, aborting.\n"); @@ -799,6 +799,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* allocate RQ buffers and post them to RQ*/ for (i = 0; i < fnic->rq_count; i++) { + vnic_rq_enable(&fnic->rq[i]); err = vnic_rq_fill(&fnic->rq[i], fnic_alloc_rq_frame); if (err) { shost_printk(KERN_ERR, fnic->lport->host, @@ -873,8 +874,6 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* Enable all queues */ for (i = 0; i < fnic->raw_wq_count; i++) vnic_wq_enable(&fnic->wq[i]); - for (i = 0; i < fnic->rq_count; i++) - vnic_rq_enable(&fnic->rq[i]); for (i = 0; i < fnic->wq_copy_count; i++) vnic_wq_copy_enable(&fnic->wq_copy[i]); diff --git a/drivers/scsi/fnic/vnic_devcmd.h b/drivers/scsi/fnic/vnic_devcmd.h index 3e2fcbda6aed..1a2a13bd6442 100644 --- a/drivers/scsi/fnic/vnic_devcmd.h +++ b/drivers/scsi/fnic/vnic_devcmd.h @@ -268,6 +268,8 @@ enum vnic_devcmd_cmd { /* flags for CMD_OPEN */ #define CMD_OPENF_OPROM 0x1 /* open coming from option rom */ +#define CMD_OPENF_RQ_ENABLE_THEN_POST 0x2 + /* flags for CMD_INIT */ #define CMD_INITF_DEFAULT_MAC 0x1 /* init with default mac addr */