8cd77865 | 23-Dec-2021 |
Kelvin Cao <kelvin.cao@microchip.com> |
ntb_hw_switchtec: Fix a minor issue in config_req_id_table()
The req_id_table_size field is 16-bit wide, use ioread16() to read the value.
Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com> Signe
ntb_hw_switchtec: Fix a minor issue in config_req_id_table()
The req_id_table_size field is 16-bit wide, use ioread16() to read the value.
Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
show more ...
|
1d3cfc28 | 23-Dec-2021 |
Kelvin Cao <kelvin.cao@microchip.com> |
ntb_hw_switchtec: Remove code for disabling ID protection
ID protection is a firmware setting for NT window access control. With it enabled, only the posted requests with requester IDs in the reques
ntb_hw_switchtec: Remove code for disabling ID protection
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>
show more ...
|
2f58265e | 23-Dec-2021 |
Kelvin Cao <kelvin.cao@microchip.com> |
ntb_hw_switchtec: Update the way of getting VEP instance ID
Gen4 firmware adds DMA VEP and NVMe VEP support in VEP (virtual EP) instance ID register in addtion to management EP. Update the way of ge
ntb_hw_switchtec: Update the way of getting VEP instance ID
Gen4 firmware adds DMA VEP and NVMe VEP support in VEP (virtual EP) instance ID register in addtion to management EP. Update the way of getting management VEP instance ID.
Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
show more ...
|
857e239c | 23-Dec-2021 |
Jeremy Pallotta <jmpallotta@gmail.com> |
ntb_hw_switchtec: AND with the part_map for a valid tpart_vec
Some firmware versions return 1 in the target partition vector for undefined partitions. AND with the part_map to give a valid tpart_vec
ntb_hw_switchtec: AND with the part_map for a valid tpart_vec
Some firmware versions return 1 in the target partition vector for undefined partitions. AND with the part_map to give a valid tpart_vec.
Signed-off-by: Jeremy Pallotta <jmpallotta@gmail.com> Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
show more ...
|
7ff351c8 | 23-Dec-2021 |
Wesley Sheng <wesley.sheng@microchip.com> |
ntb_hw_switchtec: Fix bug with more than 32 partitions
Switchtec could support as mush as 48 partitions, but ffs & fls are for 32 bit argument, in case of partition index larger than 31, the current
ntb_hw_switchtec: Fix bug with more than 32 partitions
Switchtec could support as mush as 48 partitions, but ffs & fls are for 32 bit argument, in case of partition index larger than 31, the current code could not parse the peer partition index correctly. Change to the 64 bit version __ffs64 & fls64 accordingly to fix this bug.
Fixes: 3df54c870f52 ("ntb_hw_switchtec: Allow using Switchtec NTB in multi-partition setups") Signed-off-by: Wesley Sheng <wesley.sheng@microchip.com> Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
show more ...
|
32c3d375 | 23-Dec-2021 |
Jeremy Pallotta <jmpallotta@gmail.com> |
ntb_hw_switchtec: Fix pff ioread to read into mmio_part_cfg_all
Array mmio_part_cfg_all holds the partition configuration of all partitions, with partition number as index. Fix this by reading into
ntb_hw_switchtec: Fix pff ioread to read into mmio_part_cfg_all
Array mmio_part_cfg_all holds the partition configuration of all partitions, with partition number as index. Fix this by reading into mmio_part_cfg_all for pff.
Fixes: 0ee28f26f378 ("NTB: switchtec_ntb: Add link management") Signed-off-by: Jeremy Pallotta <jmpallotta@gmail.com> Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
show more ...
|
a944ccc3 | 06-Jun-2019 |
Joey Zhang <joey.zhang@microchip.com> |
ntb_hw_switchtec: Fix setup MW with failure bug
Switchtec does not support setting multiple MWs simultaneously. The driver takes a hardware lock to ensure that two peers are not doing this simultane
ntb_hw_switchtec: Fix setup MW with failure bug
Switchtec does not support setting multiple MWs simultaneously. The driver takes a hardware lock to ensure that two peers are not doing this simultaneously and it fails if someone else takes the lock. In most cases, this is fine as clients only setup the MWs once on one side of the link.
However, there's a race condition when a re-initialization is caused by a link event. The driver will re-setup the shared memory window asynchronously and this races with the client setting up it's memory windows on the link up event.
To fix this we ensure do the entire initialization in a work queue and signal the client once it's done.
Signed-off-by: Joey Zhang <joey.zhang@microchip.com> Signed-off-by: Wesley Sheng <wesley.sheng@microchip.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
show more ...
|
f0f43e76 | 06-Jun-2019 |
Wesley Sheng <wesley.sheng@microchip.com> |
ntb_hw_switchtec: Skip unnecessary re-setup of shared memory window for crosslink case
In case of NTB crosslink topology, the setting of shared memory window in the virtual partition doesn't reset o
ntb_hw_switchtec: Skip unnecessary re-setup of shared memory window for crosslink case
In case of NTB crosslink topology, the setting of shared memory window in the virtual partition doesn't reset on peer's reboot. So skip the unnecessary re-setup of shared memory window for that case.
Signed-off-by: Wesley Sheng <wesley.sheng@microchip.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
show more ...
|
28e339f1 | 06-Jun-2019 |
Joey Zhang <joey.zhang@microchip.com> |
ntb_hw_switchtec: Remove redundant steps of switchtec_ntb_reinit_peer() function
When a re-initialization is caused by a link event, the driver will re-setup the shared memory window. But at that ti
ntb_hw_switchtec: Remove redundant steps of switchtec_ntb_reinit_peer() function
When a re-initialization is caused by a link event, the driver will re-setup the shared memory window. But at that time, the shared memory is still valid, and it's unnecessary to free, reallocate and then initialize it again. We only need to reconfigure the hardware registers. Remove the redundant steps from switchtec_ntb_reinit_peer() function.
Signed-off-by: Joey Zhang <joey.zhang@microchip.com> Signed-off-by: Wesley Sheng <wesley.sheng@microchip.com> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
show more ...
|
ebb09b33 | 12-Feb-2019 |
Leonid Ravich <lravich@gmail.com> |
NTB: add new parameter to peer_db_addr() db_bit and db_data
NTB door bell usage depends on NTB hardware.
ex: intel NTB gen1 has one peer door bell register which can be controlled by the bitmap wri
NTB: add new parameter to peer_db_addr() db_bit and db_data
NTB door bell usage depends on NTB hardware.
ex: intel NTB gen1 has one peer door bell register which can be controlled by the bitmap writen to it, while Intel NTB gen3 has a registers per door bell and the data trigering the each door bell is always 1.
therefore exposing only peer door bell address forcing the user to be aware of such low level details
Signed-off-by: Leonid Ravich <Leonid.Ravich@emc.com> Acked-by: Logan Gunthorpe <logang@deltatee.com> Acked-by: Dave Jiang <dave.jiang@intel.com> Acked-by: Allen Hubbe <allenbh@gmail.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
show more ...
|
a2585cdc | 06-Dec-2018 |
Paul Selles <paul.selles@microchip.com> |
ntb_hw_switchtec: Added support of >=4G memory windows
Current Switchtec's BAR setup registers are limited to 32bits, corresponding to the maximum MW (memory window) size is <4G.
Increase the MW si
ntb_hw_switchtec: Added support of >=4G memory windows
Current Switchtec's BAR setup registers are limited to 32bits, corresponding to the maximum MW (memory window) size is <4G.
Increase the MW sizes with the addition of the BAR Setup Extension Register for the upper 32bits of a 64bits MW size. This increases the MW range to between 4K and 2^63.
Reported-by: Boris Glimcher <boris.glimcher@emc.com> Signed-off-by: Paul Selles <paul.selles@microchip.com> Signed-off-by: Wesley Sheng <wesley.sheng@microchip.com> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
show more ...
|
c6fad21a | 16-Jan-2018 |
Arnd Bergmann <arnd@arndb.de> |
ntb_hw_switchtec: fix logic error
Newer gcc (version 7 and 8 presumably) warn about a statement mixing the << operator with logical and:
drivers/ntb/hw/mscc/ntb_hw_switchtec.c: In function 'switcht
ntb_hw_switchtec: fix logic error
Newer gcc (version 7 and 8 presumably) warn about a statement mixing the << operator with logical and:
drivers/ntb/hw/mscc/ntb_hw_switchtec.c: In function 'switchtec_ntb_init_sndev': drivers/ntb/hw/mscc/ntb_hw_switchtec.c:888:24: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context]
My interpretation here is that the author must have intended a bitmask rather than a comparison, so I'm changing the '&&' to '&', which makes a lot more sense in the context.
Fixes: 1b249475275d ("ntb_hw_switchtec: Allow using Switchtec NTB in multi-partition setups") Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jon Mason <jdmason@kudzu.us>
show more ...
|