ntb_hw_switchtec: Remove code for disabling ID protection
authorKelvin Cao <kelvin.cao@microchip.com>
Fri, 24 Dec 2021 01:23:33 +0000 (17:23 -0800)
committerJon Mason <jdmason@kudzu.us>
Tue, 11 Jan 2022 20:38:59 +0000 (15:38 -0500)
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>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/hw/mscc/ntb_hw_switchtec.c
include/linux/switchtec.h

index ba6a9670c681be5dcb92836bde6a43eb4eecc749..e79a355bafbf36860ddc8c50732a6e891a2ce8cd 100644 (file)
@@ -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]);
index be24056ac00fd131feace26b7cb8a7d3b5dd3bea..48fabe36509ee787756e094201d307ab4d33be83 100644 (file)
@@ -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 {