From patchwork Wed Apr 26 06:25:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geetha sowjanya X-Patchwork-Id: 87628 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp41314vqo; Tue, 25 Apr 2023 23:34:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ40/75/mpj3CEr0GRzHUpO+i6ZUNe1CM512D8u+jQalrmeVvn/F5N5va3UK0DZbIAMlV1Mu X-Received: by 2002:a05:6a20:7f8c:b0:f5:cf7d:fcc4 with SMTP id d12-20020a056a207f8c00b000f5cf7dfcc4mr1884741pzj.11.1682490878621; Tue, 25 Apr 2023 23:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682490878; cv=none; d=google.com; s=arc-20160816; b=UJB05XAZRJMzUhcF6PuGrzcwy+NLSbIrbFb1fm/3b2UYDRvcTp70ueLjs7Jbdz3nSQ OzdYv6VsozsGiqa8klWUmcarcSes36bpY+68yXwfhiWpuMlFfHeq9muzCqIY6/dKK89X sBAJvJ+tALiFfMs92voDRAly7l96G/zjezHvpCd9QqkZ9Myt4urY6EKLfx45ohOfxrow d1dRynn5E6QvDCHinFbn/04yKvnd1E6F4BqCowLtuVfNdB3nSoRGlBlPpc5oBTkECl6T pH70AeHPk5VmQ0VvEhrReCQuTj8A+RlJzAgZgdzgyE+F7nTAuAC1RyGEMCqpDo+Z+YdJ 1aZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zeIeryuOiIUBXeGJD+J23mt64xIQ8+8w7Mz6CIqAYR4=; b=CzcxqrRLHRLsephegZhR8x5TdndHOmxXnUZlC7IeJgQ3oj4Ed8+P2IAYHZKgBzWQ1+ Esw36vO0l53sRqFzcMb0rRZ5CidoNFGxbvA2i+NeoD8Xcb5ZMf7P3ss2xKEdinl+tT4Q v4Axm3fVHakwJ2/nOFZ0BQnSVGTp5oj8wKbZFECY5Wee87FzwWh64DQ1X1ST8iJYLkvy pcewBumtDcVxe7Zsv8fO3DUWeEu8lwbj6ZA3AQr1NheP8hDluhusfSQiDpwKW+3cAEG3 /NmfIh/pXTLM18JnFqbIlz8WPRRCRe7Hs7DuPNE0n3OHw1A0XQ/o/UHY8C4OaWEIbqWl ay7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=kOwwt0ha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u190-20020a6385c7000000b00525037a363asi8997763pgd.328.2023.04.25.23.34.24; Tue, 25 Apr 2023 23:34:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=kOwwt0ha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239567AbjDZGZz (ORCPT + 99 others); Wed, 26 Apr 2023 02:25:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239553AbjDZGZu (ORCPT ); Wed, 26 Apr 2023 02:25:50 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3A0C30E0; Tue, 25 Apr 2023 23:25:48 -0700 (PDT) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33Q64EO3000793; Tue, 25 Apr 2023 23:25:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=zeIeryuOiIUBXeGJD+J23mt64xIQ8+8w7Mz6CIqAYR4=; b=kOwwt0haqH8/GePWXfhj53H29FHEvKnI2GZartZIDIxIpbxHYV1Gw4gRNWZIu/JLrkKe jdGmUjJQ025IEWtb5n2PPwMzv78RJrOs6oSyHyYHUWAKvavRjd5HDC9ChU11OL1SaYRz 9N1YPiCgAa1lDj5w13/DgT9YMuCUmRD99Xr1Oqgrmmj8rvWDt5usCdOlGYaBTckPVGSC 8Up9DwiMrRorbqSsJ/UGDqn5Q+IF8mycMv7Lp2+a7yAItVllFdHb49knkETjrm5DVhkR WOz7ssoH0kq1mQiO6J2a0azHFqDWLHhjhxB1Oy10yY/gUw27W+WUvR9VzTVV5SbCIn2F 6A== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q4f3pdcw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 25 Apr 2023 23:25:41 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 25 Apr 2023 23:25:39 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 25 Apr 2023 23:25:39 -0700 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id A119C3F706D; Tue, 25 Apr 2023 23:25:36 -0700 (PDT) From: Geetha sowjanya To: , CC: , , , , , , , , Subject: [net PATCH v2 2/9] octeontx2-af: mcs: Write TCAM_DATA and TCAM_MASK registers at once Date: Wed, 26 Apr 2023 11:55:21 +0530 Message-ID: <20230426062528.20575-3-gakula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230426062528.20575-1-gakula@marvell.com> References: <20230426062528.20575-1-gakula@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: -FrAiUvODiWLm1JW16WFlHi1dnVxQxKB X-Proofpoint-GUID: -FrAiUvODiWLm1JW16WFlHi1dnVxQxKB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-26_02,2023-04-25_01,2023-02-09_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764219555784830363?= X-GMAIL-MSGID: =?utf-8?q?1764219555784830363?= From: Subbaraya Sundeep As per hardware errata on CN10KB, all the four TCAM_DATA and TCAM_MASK registers has to be written at once otherwise write to individual registers will fail. Hence write to all TCAM_DATA registers and then to all TCAM_MASK registers. Fixes: cfc14181d497 ("octeontx2-af: cn10k: mcs: Manage the MCS block hardware resources") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Geetha sowjanya Reviewed-by: Leon Romanovsky --- drivers/net/ethernet/marvell/octeontx2/af/mcs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mcs.c b/drivers/net/ethernet/marvell/octeontx2/af/mcs.c index 492baa0b594c..148417d633a5 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/mcs.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/mcs.c @@ -473,6 +473,8 @@ void mcs_flowid_entry_write(struct mcs *mcs, u64 *data, u64 *mask, int flow_id, for (reg_id = 0; reg_id < 4; reg_id++) { reg = MCSX_CPM_RX_SLAVE_FLOWID_TCAM_DATAX(reg_id, flow_id); mcs_reg_write(mcs, reg, data[reg_id]); + } + for (reg_id = 0; reg_id < 4; reg_id++) { reg = MCSX_CPM_RX_SLAVE_FLOWID_TCAM_MASKX(reg_id, flow_id); mcs_reg_write(mcs, reg, mask[reg_id]); } @@ -480,6 +482,8 @@ void mcs_flowid_entry_write(struct mcs *mcs, u64 *data, u64 *mask, int flow_id, for (reg_id = 0; reg_id < 4; reg_id++) { reg = MCSX_CPM_TX_SLAVE_FLOWID_TCAM_DATAX(reg_id, flow_id); mcs_reg_write(mcs, reg, data[reg_id]); + } + for (reg_id = 0; reg_id < 4; reg_id++) { reg = MCSX_CPM_TX_SLAVE_FLOWID_TCAM_MASKX(reg_id, flow_id); mcs_reg_write(mcs, reg, mask[reg_id]); }