netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Kalderon <michal.kalderon@marvell.com>
To: <michal.kalderon@marvell.com>, <ariel.elior@marvell.com>,
	<davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-rdma@vger.kernel.org>,
	<linux-scsi@vger.kernel.org>
Subject: [PATCH net-next 12/14] qed: rt init valid initialization changed
Date: Wed, 22 Jan 2020 17:26:25 +0200	[thread overview]
Message-ID: <20200122152627.14903-13-michal.kalderon@marvell.com> (raw)
In-Reply-To: <20200122152627.14903-1-michal.kalderon@marvell.com>

The QM phase init tool can be invoked multiple times during
the driver lifetime. Part of the init comes from the runtime array.
The logic for setting the values did not init all values, basically
assuming the runtime array was all zeroes. But if it was invoked
multiple times, nobody was zeroing it after the first time.

In this change we zero the runtime array right after using it.

Signed-off-by: Ariel Elior <ariel.elior@marvell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dev.c      |  3 ---
 drivers/net/ethernet/qlogic/qed/qed_init_ops.c | 16 ++++++----------
 drivers/net/ethernet/qlogic/qed/qed_init_ops.h |  8 --------
 3 files changed, 6 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c
index df97810b09b9..3fb73ce8c1d6 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c
@@ -2106,9 +2106,6 @@ int qed_qm_reconf(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
 	if (!b_rc)
 		return -EINVAL;
 
-	/* clear the QM_PF runtime phase leftovers from previous init */
-	qed_init_clear_rt_data(p_hwfn);
-
 	/* prepare QM portion of runtime array */
 	qed_qm_init_pf(p_hwfn, p_ptt, false);
 
diff --git a/drivers/net/ethernet/qlogic/qed/qed_init_ops.c b/drivers/net/ethernet/qlogic/qed/qed_init_ops.c
index 36f998c89e74..5a6e4ac4fef4 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_init_ops.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_init_ops.c
@@ -74,15 +74,6 @@ void qed_init_iro_array(struct qed_dev *cdev)
 	cdev->iro_arr = iro_arr;
 }
 
-/* Runtime configuration helpers */
-void qed_init_clear_rt_data(struct qed_hwfn *p_hwfn)
-{
-	int i;
-
-	for (i = 0; i < RUNTIME_ARRAY_SIZE; i++)
-		p_hwfn->rt_data.b_valid[i] = false;
-}
-
 void qed_init_store_rt_reg(struct qed_hwfn *p_hwfn, u32 rt_offset, u32 val)
 {
 	p_hwfn->rt_data.init_val[rt_offset] = val;
@@ -106,7 +97,7 @@ static int qed_init_rt(struct qed_hwfn	*p_hwfn,
 {
 	u32 *p_init_val = &p_hwfn->rt_data.init_val[rt_offset];
 	bool *p_valid = &p_hwfn->rt_data.b_valid[rt_offset];
-	u16 i, segment;
+	u16 i, j, segment;
 	int rc = 0;
 
 	/* Since not all RT entries are initialized, go over the RT and
@@ -121,6 +112,7 @@ static int qed_init_rt(struct qed_hwfn	*p_hwfn,
 		 */
 		if (!b_must_dmae) {
 			qed_wr(p_hwfn, p_ptt, addr + (i << 2), p_init_val[i]);
+			p_valid[i] = false;
 			continue;
 		}
 
@@ -135,6 +127,10 @@ static int qed_init_rt(struct qed_hwfn	*p_hwfn,
 		if (rc)
 			return rc;
 
+		/* invalidate after writing */
+		for (j = i; j < i + segment; j++)
+			p_valid[j] = false;
+
 		/* Jump over the entire segment, including invalid entry */
 		i += segment;
 	}
diff --git a/drivers/net/ethernet/qlogic/qed/qed_init_ops.h b/drivers/net/ethernet/qlogic/qed/qed_init_ops.h
index 555dd086796d..e9e8ade50ed3 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_init_ops.h
+++ b/drivers/net/ethernet/qlogic/qed/qed_init_ops.h
@@ -80,14 +80,6 @@ int qed_init_alloc(struct qed_hwfn *p_hwfn);
  */
 void qed_init_free(struct qed_hwfn *p_hwfn);
 
-/**
- * @brief qed_init_clear_rt_data - Clears the runtime init array.
- *
- *
- * @param p_hwfn
- */
-void qed_init_clear_rt_data(struct qed_hwfn *p_hwfn);
-
 /**
  * @brief qed_init_store_rt_reg - Store a configuration value in the RT array.
  *
-- 
2.14.5


  parent reply	other threads:[~2020-01-22 15:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22 15:26 [PATCH net-next 00/14] qed*: Utilize FW 8.42.2.0 Michal Kalderon
2020-01-22 15:26 ` [PATCH net-next 01/14] qed: FW 8.42.2.0 Internal ram offsets modifications Michal Kalderon
2020-01-22 15:45   ` Jakub Kicinski
2020-01-22 16:02     ` Michal Kalderon
2020-01-23 14:26       ` Jakub Kicinski
2020-01-22 15:26 ` [PATCH net-next 02/14] qed: FW 8.42.2.0 Expose new registers and change windows Michal Kalderon
2020-01-22 15:26 ` [PATCH net-next 03/14] qed: FW 8.42.2.0 Queue Manager changes Michal Kalderon
2020-01-24 19:09   ` kbuild test robot
2020-01-22 15:26 ` [PATCH net-next 04/14] qed: FW 8.42.2.0 Parser offsets modified Michal Kalderon
2020-01-22 15:26 ` [PATCH net-next 05/14] qed: Use dmae to write to widebus registers in fw_funcs Michal Kalderon
2020-01-22 15:26 ` [PATCH net-next 06/14] qed: FW 8.42.2.0 Additional ll2 type Michal Kalderon
2020-01-22 15:26 ` [PATCH net-next 07/14] qed: Add abstraction for different hsi values per chip Michal Kalderon
2020-01-22 15:26 ` [PATCH net-next 08/14] qed: FW 8.42.2.0 iscsi/fcoe changes Michal Kalderon
2020-01-22 15:26 ` [PATCH net-next 09/14] qed: FW 8.42.2.0 HSI changes Michal Kalderon
2020-01-22 15:26 ` [PATCH net-next 10/14] qed: FW 8.42.2.0 Add fw overlay feature Michal Kalderon
2020-01-22 15:26 ` [PATCH net-next 11/14] qed: Debug feature: ilt and mdump Michal Kalderon
2020-01-22 15:26 ` Michal Kalderon [this message]
2020-01-22 15:26 ` [PATCH net-next 13/14] qed: FW 8.42.2.0 debug features Michal Kalderon
2020-01-22 15:54   ` Jakub Kicinski
2020-01-22 16:03     ` Michal Kalderon
2020-01-22 16:14       ` Leon Romanovsky
2020-01-22 16:41         ` [EXT] " Michal Kalderon
2020-01-22 18:22           ` Leon Romanovsky
2020-01-22 19:12     ` David Miller
2020-01-22 15:26 ` [PATCH net-next 14/14] qed: bump driver version Michal Kalderon
2020-01-22 16:13   ` Leon Romanovsky
2020-01-22 16:39     ` [EXT] " Michal Kalderon
2020-01-22 18:21       ` Leon Romanovsky
2020-01-23  8:18         ` Michal Kalderon
2020-01-23 12:12           ` Leon Romanovsky
2020-01-23 13:10             ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200122152627.14903-13-michal.kalderon@marvell.com \
    --to=michal.kalderon@marvell.com \
    --cc=ariel.elior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).