mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 07:10:27 +00:00
Bug fixes for sparse warning, intel port config offset, and a new
mailing list -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoE9b9c3U2JxX98mqbmZLrHqL0iMFAmH7CEMACgkQbmZLrHqL 0iM+jg/+Isu/FM2aS2g0jp4k8uLHjkXLbcnd2HktGQKU1ot0yfrySPM0s7eQb9PV RUnjuW9WDjr60j8bxmiMAHlDJNRiSGyV7UzntgvHg/PrwqDp8eZOKKfKA7NehQdQ riS7EOUfPK8eLxZfEcax5PS9TI/cS+U4HjbsAhZ08vT88PZCxPq2s/3yPYjtMDCA QTx14m4roO3Kp+IqHwwapVZO3m+mmBrAEzTuNudfgL0j8WUb9odb9212FEo4a0E1 BKk3OcYwcn36Cftr8KU4kg96u9k+AuH908pDRGQcIQNSgbqpTxLbaM9j37wWdEG8 v4M240pmJyG1/49Aj0htFJFmAgGlyeOpyAZXNrqfbiqyvR/e8xUR2QILtqc9gMg/ TXzWkFy//SQN4dWe5EZT6WJVHR5mtSdGzNq4y35yXMZC6MRT5JKIisrnMJnIS1rA up0YiIoahVoV8KF/sXq2ko+kMoEySNXtyAma061NUploKyo0ymXu1XD+nPbGW6Mn m7OL/1eX8PQ4Hx2TmtLjE/sTEjPrcvkr0fC3AAhPCh87dvd/pbrz+LuyxQ6zNx6i qa1l+MHPhRWjfwdqBkyl5Yt43lit9wtNOAAxMima2VLRdewI7PHOF4+TGGcXPU70 4uHf4IhgH7rbd3xfHP/sF+OGeE1jYPXyRXqxxaapkVC3pF8kGpc= =Isk3 -----END PGP SIGNATURE----- Merge tag 'ntb-5.17-bugfixes' of git://github.com/jonmason/ntb Pull NTB fixes from Jon Mason: "Bug fixes for sparse warning, intel port config offset, and a new mailing list" * tag 'ntb-5.17-bugfixes' of git://github.com/jonmason/ntb: MAINTAINERS: update mailing list address for NTB subsystem ntb: intel: fix port config status offset for SPR NTB/msi: Use struct_size() helper in devm_kzalloc()
This commit is contained in:
commit
ae5f531d17
@ -13699,7 +13699,7 @@ F: scripts/nsdeps
|
||||
NTB AMD DRIVER
|
||||
M: Sanjay R Mehta <sanju.mehta@amd.com>
|
||||
M: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
|
||||
L: linux-ntb@googlegroups.com
|
||||
L: ntb@lists.linux.dev
|
||||
S: Supported
|
||||
F: drivers/ntb/hw/amd/
|
||||
|
||||
@ -13707,7 +13707,7 @@ NTB DRIVER CORE
|
||||
M: Jon Mason <jdmason@kudzu.us>
|
||||
M: Dave Jiang <dave.jiang@intel.com>
|
||||
M: Allen Hubbe <allenbh@gmail.com>
|
||||
L: linux-ntb@googlegroups.com
|
||||
L: ntb@lists.linux.dev
|
||||
S: Supported
|
||||
W: https://github.com/jonmason/ntb/wiki
|
||||
T: git git://github.com/jonmason/ntb.git
|
||||
@ -13719,13 +13719,13 @@ F: tools/testing/selftests/ntb/
|
||||
|
||||
NTB IDT DRIVER
|
||||
M: Serge Semin <fancer.lancer@gmail.com>
|
||||
L: linux-ntb@googlegroups.com
|
||||
L: ntb@lists.linux.dev
|
||||
S: Supported
|
||||
F: drivers/ntb/hw/idt/
|
||||
|
||||
NTB INTEL DRIVER
|
||||
M: Dave Jiang <dave.jiang@intel.com>
|
||||
L: linux-ntb@googlegroups.com
|
||||
L: ntb@lists.linux.dev
|
||||
S: Supported
|
||||
W: https://github.com/davejiang/linux/wiki
|
||||
T: git https://github.com/davejiang/linux.git
|
||||
|
@ -168,6 +168,18 @@ static enum ntb_topo gen4_ppd_topo(struct intel_ntb_dev *ndev, u32 ppd)
|
||||
return NTB_TOPO_NONE;
|
||||
}
|
||||
|
||||
static enum ntb_topo spr_ppd_topo(struct intel_ntb_dev *ndev, u32 ppd)
|
||||
{
|
||||
switch (ppd & SPR_PPD_TOPO_MASK) {
|
||||
case SPR_PPD_TOPO_B2B_USD:
|
||||
return NTB_TOPO_B2B_USD;
|
||||
case SPR_PPD_TOPO_B2B_DSD:
|
||||
return NTB_TOPO_B2B_DSD;
|
||||
}
|
||||
|
||||
return NTB_TOPO_NONE;
|
||||
}
|
||||
|
||||
int gen4_init_dev(struct intel_ntb_dev *ndev)
|
||||
{
|
||||
struct pci_dev *pdev = ndev->ntb.pdev;
|
||||
@ -183,7 +195,10 @@ int gen4_init_dev(struct intel_ntb_dev *ndev)
|
||||
}
|
||||
|
||||
ppd1 = ioread32(ndev->self_mmio + GEN4_PPD1_OFFSET);
|
||||
ndev->ntb.topo = gen4_ppd_topo(ndev, ppd1);
|
||||
if (pdev_is_ICX(pdev))
|
||||
ndev->ntb.topo = gen4_ppd_topo(ndev, ppd1);
|
||||
else if (pdev_is_SPR(pdev))
|
||||
ndev->ntb.topo = spr_ppd_topo(ndev, ppd1);
|
||||
dev_dbg(&pdev->dev, "ppd %#x topo %s\n", ppd1,
|
||||
ntb_topo_string(ndev->ntb.topo));
|
||||
if (ndev->ntb.topo == NTB_TOPO_NONE)
|
||||
|
@ -49,10 +49,14 @@
|
||||
#define GEN4_PPD_CLEAR_TRN 0x0001
|
||||
#define GEN4_PPD_LINKTRN 0x0008
|
||||
#define GEN4_PPD_CONN_MASK 0x0300
|
||||
#define SPR_PPD_CONN_MASK 0x0700
|
||||
#define GEN4_PPD_CONN_B2B 0x0200
|
||||
#define GEN4_PPD_DEV_MASK 0x1000
|
||||
#define GEN4_PPD_DEV_DSD 0x1000
|
||||
#define GEN4_PPD_DEV_USD 0x0000
|
||||
#define SPR_PPD_DEV_MASK 0x4000
|
||||
#define SPR_PPD_DEV_DSD 0x4000
|
||||
#define SPR_PPD_DEV_USD 0x0000
|
||||
#define GEN4_LINK_CTRL_LINK_DISABLE 0x0010
|
||||
|
||||
#define GEN4_SLOTSTS 0xb05a
|
||||
@ -62,6 +66,10 @@
|
||||
#define GEN4_PPD_TOPO_B2B_USD (GEN4_PPD_CONN_B2B | GEN4_PPD_DEV_USD)
|
||||
#define GEN4_PPD_TOPO_B2B_DSD (GEN4_PPD_CONN_B2B | GEN4_PPD_DEV_DSD)
|
||||
|
||||
#define SPR_PPD_TOPO_MASK (SPR_PPD_CONN_MASK | SPR_PPD_DEV_MASK)
|
||||
#define SPR_PPD_TOPO_B2B_USD (GEN4_PPD_CONN_B2B | SPR_PPD_DEV_USD)
|
||||
#define SPR_PPD_TOPO_B2B_DSD (GEN4_PPD_CONN_B2B | SPR_PPD_DEV_DSD)
|
||||
|
||||
#define GEN4_DB_COUNT 32
|
||||
#define GEN4_DB_LINK 32
|
||||
#define GEN4_DB_LINK_BIT BIT_ULL(GEN4_DB_LINK)
|
||||
@ -112,4 +120,12 @@ static inline int pdev_is_ICX(struct pci_dev *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pdev_is_SPR(struct pci_dev *pdev)
|
||||
{
|
||||
if (pdev_is_gen4(pdev) &&
|
||||
pdev->revision > PCI_DEVICE_REVISION_ICX_MAX)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -33,7 +33,6 @@ int ntb_msi_init(struct ntb_dev *ntb,
|
||||
{
|
||||
phys_addr_t mw_phys_addr;
|
||||
resource_size_t mw_size;
|
||||
size_t struct_size;
|
||||
int peer_widx;
|
||||
int peers;
|
||||
int ret;
|
||||
@ -43,9 +42,8 @@ int ntb_msi_init(struct ntb_dev *ntb,
|
||||
if (peers <= 0)
|
||||
return -EINVAL;
|
||||
|
||||
struct_size = sizeof(*ntb->msi) + sizeof(*ntb->msi->peer_mws) * peers;
|
||||
|
||||
ntb->msi = devm_kzalloc(&ntb->dev, struct_size, GFP_KERNEL);
|
||||
ntb->msi = devm_kzalloc(&ntb->dev, struct_size(ntb->msi, peer_mws, peers),
|
||||
GFP_KERNEL);
|
||||
if (!ntb->msi)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user