History

Merge tag 'ntb-5.17' of git://github.com/jonmason/ntb

Pull NTB updates from Jon Mason: "New AMD PCI ID for NTB, and a number of bug fixes for ntb_hw_switchtec for Linux v5.17" * tag 'ntb-5.17' of git://github.com/jonmason/ntb: ntb_hw_switchtec: Fix a minor issue in config_req_id_table() ntb_hw_switchtec: Remove code for disabling ID protection ntb_hw_switchtec: Update the way of getting VEP instance ID ntb_hw_switchtec: AND with the part_map for a valid tpart_vec ntb_hw_switchtec: Fix bug with more than 32 partitions ntb_hw_switchtec: Fix pff ioread to read into mmio_part_cfg_all ntb_hw_switchtec: fix the spelling of "its" NTB/msi: Fix ntbm_msi_request_threaded_irq() kernel-doc comment ntb_hw_amd: Add NTB PCI ID for new gen CPU

Linus Torvalds committed 4 years ago

Commit 96000bc2 parents 2225acc 8cd77864 files · +16 −17Browse files

Unified · Split

4 files
  1. drivers/ntb/hw/amd/ntb_hw_amd.c +2 −0
  2. drivers/ntb/hw/mscc/ntb_hw_switchtec.c +12 −14
  3. drivers/ntb/msi.c +2 −1
  4. include/linux/switchtec.h +0 −2
drivers/ntb/hw/amd/ntb_hw_amd.c+2−0
@@ -1321,6 +1321,8 @@ static const struct ntb_dev_data dev_data[] = { · 1320 unmodified lines
1321static const struct pci_device_id amd_ntb_pci_tbl[] = {1321static const struct pci_device_id amd_ntb_pci_tbl[] = {
1322 { PCI_VDEVICE(AMD, 0x145b), (kernel_ulong_t)&dev_data[0] },1322 { PCI_VDEVICE(AMD, 0x145b), (kernel_ulong_t)&dev_data[0] },
1323 { PCI_VDEVICE(AMD, 0x148b), (kernel_ulong_t)&dev_data[1] },1323 { PCI_VDEVICE(AMD, 0x148b), (kernel_ulong_t)&dev_data[1] },
1324 { PCI_VDEVICE(AMD, 0x14c0), (kernel_ulong_t)&dev_data[1] },
1325 { PCI_VDEVICE(AMD, 0x14c3), (kernel_ulong_t)&dev_data[1] },
1324 { PCI_VDEVICE(HYGON, 0x145b), (kernel_ulong_t)&dev_data[0] },1326 { PCI_VDEVICE(HYGON, 0x145b), (kernel_ulong_t)&dev_data[0] },
1325 { 0, }1327 { 0, }
1326};1328};
drivers/ntb/hw/mscc/ntb_hw_switchtec.c+12−14
@@ -297,7 +297,7 @@ static int switchtec_ntb_mw_set_trans(struct ntb_dev *ntb, int pidx, int widx, · 296 unmodified lines
297 * (see CMA_CONFIG_ALIGNMENT)297 * (see CMA_CONFIG_ALIGNMENT)
298 */298 */
299 dev_err(&sndev->stdev->dev,299 dev_err(&sndev->stdev->dev,
300 "ERROR: Memory window address is not aligned to it's size!\n");300 "ERROR: Memory window address is not aligned to its size!\n");
301 return -EINVAL;301 return -EINVAL;
302 }302 }
303 303
@@ -419,8 +419,10 @@ static void switchtec_ntb_part_link_speed(struct switchtec_ntb *sndev, · 115 unmodified lines
419 enum ntb_width *width)419 enum ntb_width *width)
420{420{
421 struct switchtec_dev *stdev = sndev->stdev;421 struct switchtec_dev *stdev = sndev->stdev;
422 struct part_cfg_regs __iomem *part_cfg =
423 &stdev->mmio_part_cfg_all[partition];
422 424
423 u32 pff = ioread32(&stdev->mmio_part_cfg[partition].vep_pff_inst_id);425 u32 pff = ioread32(&part_cfg->vep_pff_inst_id) & 0xFF;
424 u32 linksta = ioread32(&stdev->mmio_pff_csr[pff].pci_cap_region[13]);426 u32 linksta = ioread32(&stdev->mmio_pff_csr[pff].pci_cap_region[13]);
425 427
426 if (speed)428 if (speed)
@@ -840,7 +842,6 @@ static int switchtec_ntb_init_sndev(struct switchtec_ntb *sndev) · 413 unmodified lines
840 u64 tpart_vec;842 u64 tpart_vec;
841 int self;843 int self;
842 u64 part_map;844 u64 part_map;
843 int bit;
844 845
845 sndev->ntb.pdev = sndev->stdev->pdev;846 sndev->ntb.pdev = sndev->stdev->pdev;
846 sndev->ntb.topo = NTB_TOPO_SWITCH;847 sndev->ntb.topo = NTB_TOPO_SWITCH;
@@ -859,31 +860,31 @@ static int switchtec_ntb_init_sndev(struct switchtec_ntb *sndev) · 12 unmodified lines
859 tpart_vec |= ioread32(&sndev->mmio_ntb->ntp_info[self].target_part_low);860 tpart_vec |= ioread32(&sndev->mmio_ntb->ntp_info[self].target_part_low);
860 861
861 part_map = ioread64(&sndev->mmio_ntb->ep_map);862 part_map = ioread64(&sndev->mmio_ntb->ep_map);
863 tpart_vec &= part_map;
862 part_map &= ~(1 << sndev->self_partition);864 part_map &= ~(1 << sndev->self_partition);
863 865
864 if (!ffs(tpart_vec)) {866 if (!tpart_vec) {
865 if (sndev->stdev->partition_count != 2) {867 if (sndev->stdev->partition_count != 2) {
866 dev_err(&sndev->stdev->dev,868 dev_err(&sndev->stdev->dev,
867 "ntb target partition not defined\n");869 "ntb target partition not defined\n");
868 return -ENODEV;870 return -ENODEV;
869 }871 }
870 872
871 bit = ffs(part_map);873 if (!part_map) {
872 if (!bit) {
873 dev_err(&sndev->stdev->dev,874 dev_err(&sndev->stdev->dev,
874 "peer partition is not NT partition\n");875 "peer partition is not NT partition\n");
875 return -ENODEV;876 return -ENODEV;
876 }877 }
877 878
878 sndev->peer_partition = bit - 1;879 sndev->peer_partition = __ffs64(part_map);
879 } else {880 } else {
880 if (ffs(tpart_vec) != fls(tpart_vec)) {881 if (__ffs64(tpart_vec) != (fls64(tpart_vec) - 1)) {
881 dev_err(&sndev->stdev->dev,882 dev_err(&sndev->stdev->dev,
882 "ntb driver only supports 1 pair of 1-1 ntb mapping\n");883 "ntb driver only supports 1 pair of 1-1 ntb mapping\n");
883 return -ENODEV;884 return -ENODEV;
884 }885 }
885 886
886 sndev->peer_partition = ffs(tpart_vec) - 1;887 sndev->peer_partition = __ffs64(tpart_vec);
887 if (!(part_map & (1ULL << sndev->peer_partition))) {888 if (!(part_map & (1ULL << sndev->peer_partition))) {
888 dev_err(&sndev->stdev->dev,889 dev_err(&sndev->stdev->dev,
889 "ntb target partition is not NT partition\n");890 "ntb target partition is not NT partition\n");
@@ -954,7 +955,7 @@ static int config_req_id_table(struct switchtec_ntb *sndev, · 64 unmodified lines
954 u32 error;955 u32 error;
955 u32 proxy_id;956 u32 proxy_id;
956 957
957 if (ioread32(&mmio_ctrl->req_id_table_size) < count) {958 if (ioread16(&mmio_ctrl->req_id_table_size) < count) {
958 dev_err(&sndev->stdev->dev,959 dev_err(&sndev->stdev->dev,
959 "Not enough requester IDs available.\n");960 "Not enough requester IDs available.\n");
960 return -EFAULT;961 return -EFAULT;
@@ -966,9 +967,6 @@ static int config_req_id_table(struct switchtec_ntb *sndev, · 5 unmodified lines
966 if (rc)967 if (rc)
967 return rc;968 return rc;
968 969
969 iowrite32(NTB_PART_CTRL_ID_PROT_DIS,
970 &mmio_ctrl->partition_ctrl);
971
972 for (i = 0; i < count; i++) {970 for (i = 0; i < count; i++) {
973 iowrite32(req_ids[i] << 16 | NTB_CTRL_REQ_ID_EN,971 iowrite32(req_ids[i] << 16 | NTB_CTRL_REQ_ID_EN,
974 &mmio_ctrl->req_id_table[i]);972 &mmio_ctrl->req_id_table[i]);
@@ -1090,7 +1088,7 @@ static int crosslink_enum_partition(struct switchtec_ntb *sndev, · 115 unmodified lines
1090{1088{
1091 struct part_cfg_regs __iomem *part_cfg =1089 struct part_cfg_regs __iomem *part_cfg =
1092 &sndev->stdev->mmio_part_cfg_all[sndev->peer_partition];1090 &sndev->stdev->mmio_part_cfg_all[sndev->peer_partition];
1093 u32 pff = ioread32(&part_cfg->vep_pff_inst_id);1091 u32 pff = ioread32(&part_cfg->vep_pff_inst_id) & 0xFF;
1094 struct pff_csr_regs __iomem *mmio_pff =1092 struct pff_csr_regs __iomem *mmio_pff =
1095 &sndev->stdev->mmio_pff_csr[pff];1093 &sndev->stdev->mmio_pff_csr[pff];
1096 const u64 bar_space = 0x1000000000LL;1094 const u64 bar_space = 0x1000000000LL;
drivers/ntb/msi.c+2−1
@@ -262,8 +262,9 @@ static int ntbm_msi_setup_callback(struct ntb_dev *ntb, struct msi_desc *entry, · 261 unmodified lines
262 * @handler: Function to be called when the IRQ occurs262 * @handler: Function to be called when the IRQ occurs
263 * @thread_fn: Function to be called in a threaded interrupt context. NULL263 * @thread_fn: Function to be called in a threaded interrupt context. NULL
264 * for clients which handle everything in @handler264 * for clients which handle everything in @handler
265 * @devname: An ascii name for the claiming device, dev_name(dev) if NULL265 * @name: An ascii name for the claiming device, dev_name(dev) if NULL
266 * @dev_id: A cookie passed back to the handler function266 * @dev_id: A cookie passed back to the handler function
267 * @msi_desc: MSI descriptor data which triggers the interrupt
267 *268 *
268 * This function assigns an interrupt handler to an unused269 * This function assigns an interrupt handler to an unused
269 * MSI interrupt and returns the descriptor used to trigger270 * MSI interrupt and returns the descriptor used to trigger
include/linux/switchtec.h+0−2
@@ -337,8 +337,6 @@ enum { · 336 unmodified lines
337 NTB_CTRL_REQ_ID_EN = 1 << 0,337 NTB_CTRL_REQ_ID_EN = 1 << 0,
338 338
339 NTB_CTRL_LUT_EN = 1 << 0,339 NTB_CTRL_LUT_EN = 1 << 0,
340
341 NTB_PART_CTRL_ID_PROT_DIS = 1 << 0,
342};340};
343 341
344struct ntb_ctrl_regs {342struct ntb_ctrl_regs {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t