Message ID | 20240829192947.1186760-14-mkl@pengutronix.de (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,01/13] can: bcm: Remove proc entry when dev is unregistered. | expand |
On Thu, 29 Aug 2024 21:20:46 +0200 Marc Kleine-Budde wrote: > + if (IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT)) > + dma_set_mask_and_coherent(&pcie->pci->dev, DMA_BIT_MASK(64)); This IS_ENABLED() is quite unusual. The driver just advertises its capability of using 64 addressing. If the platform doesn't support 64b DMA addressing and therefore dma_addr_t is narrower, everything will still work. I could be wrong, but that's how I understand it.
On 30.08.2024 13:17:24, Jakub Kicinski wrote: > On Thu, 29 Aug 2024 21:20:46 +0200 Marc Kleine-Budde wrote: > > + if (IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT)) > > + dma_set_mask_and_coherent(&pcie->pci->dev, DMA_BIT_MASK(64)); > > This IS_ENABLED() is quite unusual. The driver just advertises its > capability of using 64 addressing. If the platform doesn't support > 64b DMA addressing and therefore dma_addr_t is narrower, everything > will still work. I could be wrong, but that's how I understand it. Ditch this PR. I have sent out a new PR without this patch; however, it contains an additional patch that has since arrived. regards, Marc
diff --git a/drivers/net/can/kvaser_pciefd.c b/drivers/net/can/kvaser_pciefd.c index a60d9efd5f8d..99fad592965a 100644 --- a/drivers/net/can/kvaser_pciefd.c +++ b/drivers/net/can/kvaser_pciefd.c @@ -1104,6 +1104,10 @@ static int kvaser_pciefd_setup_dma(struct kvaser_pciefd *pcie) /* Disable the DMA */ iowrite32(0, KVASER_PCIEFD_SRB_ADDR(pcie) + KVASER_PCIEFD_SRB_CTRL_REG); + + if (IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT)) + dma_set_mask_and_coherent(&pcie->pci->dev, DMA_BIT_MASK(64)); + for (i = 0; i < KVASER_PCIEFD_DMA_COUNT; i++) { pcie->dma_data[i] = dmam_alloc_coherent(&pcie->pci->dev, KVASER_PCIEFD_DMA_SIZE,