Re: [pci:pci/host-mediatek 11/11] drivers/pci/host/pcie-mediatek.c:541:43: error: 'node' undeclared

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 25, 2017 at 12:01:21PM +0200, Mason wrote:
> On 24/08/2017 15:44, Bjorn Helgaas wrote:
> 
> > On Thu, Aug 24, 2017 at 11:14:07AM +0800, mtk11102 wrote:
> >
> >> @@ -531,8 +533,10 @@ static const struct irq_domain_ops msi_domain_ops =
> >> {
> >>  static void mtk_pcie_enable_msi(struct mtk_pcie_port *port)
> >>  {
> >>         u32 val;
> >> +       phys_addr_t msg_addr;
> >>
> >> -       val = lower_32_bits((u64)(port->base + PCIE_MSI_VECTOR));
> >> +       msg_addr = virt_to_phys(port->base + PCIE_MSI_VECTOR);
> >> +       val = lower_32_bits(msg_addr);
> >>         writel(val, port->base + PCIE_IMSI_ADDR);
> >>
> >>         val = readl(port->base + PCIE_INT_MASK);
> > 
> > I don't think this is quite right: virt_to_phys() converts a CPU
> > virtual address to a CPU physical address, but the msg_addr is a PCI
> > bus address.  In many cases, PCI bus addresses are identical to CPU
> > physical addresses, but not always.
> 
> Is the virt_to_bus() function not appropriate?

virt_to_bus() is deprecated because there's no way for the caller to
specify which bus.  I don't have a better suggestion than
virt_to_phys(), so I shouldn't have said anything :)

Bjorn



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux