ntb.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Kelvin Cao <kelvin.cao@microchip.com>
To: Kurt Schwemmer <kurt.schwemmer@microsemi.com>,
	Logan Gunthorpe <logang@deltatee.com>,
	Jon Mason <jdmason@kudzu.us>, Dave Jiang <dave.jiang@intel.com>,
	Allen Hubbe <allenbh@gmail.com>,
	linux-pci@vger.kernel.org, linux-ntb@googlegroups.com,
	linux-kernel@vger.kernel.org
Cc: Kelvin Cao <kelvin.cao@microchip.com>,
	kelvincao@outlook.com, Jeremy Pallotta <jmpallotta@gmail.com>
Subject: [PATCH 5/6] ntb_hw_switchtec: Remove code for disabling ID protection
Date: Thu, 23 Dec 2021 17:23:33 -0800	[thread overview]
Message-ID: <20211224012334.89173-6-kelvin.cao@microchip.com> (raw)
In-Reply-To: <20211224012334.89173-1-kelvin.cao@microchip.com>

ID protection is a firmware setting for NT window access control. With
it enabled, only the posted requests with requester IDs in the requester
ID table will be allowed to access the NT windows. Otherwise all posted
requests are allowed. Normally user will configure it statically via the
Switchtec config file, and it will take effect when the firmware boots
up. The driver can also toggle the ID protection setting dynamically,
which will overwrite the static setting in the Switchtec config file as
a side effect.

Currently, the driver disables the ID protection. However, it's not
necessary to disable the ID protection at the driver level as the driver
has already configured the proper requester IDs in the requester ID
table to allow the corresponding posted requests to hit the NT windows.
Remove the code that disables the ID protection to make the static
setting prevail.

Note: ID protection is not applicable to non-posted requests.

Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com>
---
 drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 3 ---
 include/linux/switchtec.h              | 2 --
 2 files changed, 5 deletions(-)

diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
index 03839346233d..0e33eef64ec6 100644
--- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
+++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
@@ -967,9 +967,6 @@ static int config_req_id_table(struct switchtec_ntb *sndev,
 	if (rc)
 		return rc;
 
-	iowrite32(NTB_PART_CTRL_ID_PROT_DIS,
-		  &mmio_ctrl->partition_ctrl);
-
 	for (i = 0; i < count; i++) {
 		iowrite32(req_ids[i] << 16 | NTB_CTRL_REQ_ID_EN,
 			  &mmio_ctrl->req_id_table[i]);
diff --git a/include/linux/switchtec.h b/include/linux/switchtec.h
index be24056ac00f..48fabe36509e 100644
--- a/include/linux/switchtec.h
+++ b/include/linux/switchtec.h
@@ -337,8 +337,6 @@ enum {
 	NTB_CTRL_REQ_ID_EN = 1 << 0,
 
 	NTB_CTRL_LUT_EN = 1 << 0,
-
-	NTB_PART_CTRL_ID_PROT_DIS = 1 << 0,
 };
 
 struct ntb_ctrl_regs {
-- 
2.25.1


  parent reply	other threads:[~2021-12-24  1:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-24  1:23 [PATCH 0/6] Switchtec NTB Fixes and Improvements Kelvin Cao
2021-12-24  1:23 ` [PATCH 1/6] ntb_hw_switchtec: Fix pff ioread to read into mmio_part_cfg_all Kelvin Cao
2021-12-24  1:23 ` [PATCH 2/6] ntb_hw_switchtec: Fix bug with more than 32 partitions Kelvin Cao
2021-12-24  1:23 ` [PATCH 3/6] ntb_hw_switchtec: AND with the part_map for a valid tpart_vec Kelvin Cao
2021-12-24  1:23 ` [PATCH 4/6] ntb_hw_switchtec: Update the way of getting VEP instance ID Kelvin Cao
2021-12-24  1:23 ` Kelvin Cao [this message]
2021-12-24  1:23 ` [PATCH 6/6] ntb_hw_switchtec: Fix a minor issue in config_req_id_table() Kelvin Cao
2022-01-04 16:55 ` [PATCH 0/6] Switchtec NTB Fixes and Improvements Logan Gunthorpe
2022-01-04 21:28   ` Kelvin.Cao

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=20211224012334.89173-6-kelvin.cao@microchip.com \
    --to=kelvin.cao@microchip.com \
    --cc=allenbh@gmail.com \
    --cc=dave.jiang@intel.com \
    --cc=jdmason@kudzu.us \
    --cc=jmpallotta@gmail.com \
    --cc=kelvincao@outlook.com \
    --cc=kurt.schwemmer@microsemi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntb@googlegroups.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=logang@deltatee.com \
    --subject='Re: [PATCH 5/6] ntb_hw_switchtec: Remove code for disabling ID protection' \
    /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

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).