Re: [PATCH] pci: Allow very large resource windows

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

 



On Thu, Jul 3, 2014 at 3:11 PM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx> wrote:
> On Thu, Jul 03, 2014 at 12:59:21PM -0700, Yinghai Lu wrote:

>> when we try to size it,  means that bar is not assigned. with r->flags
>> = 0, means
>> we will ignore it all the way.
>
> With "r->flags = 0", we will not try to assign resources to the BAR,
> but the hardware BAR still exists and contains some address.  If the
> device has other memory BARs, pci_enable_resources() will turn on
> PCI_COMMAND_MEMORY.  Now the "r->flags == 0" BAR is enabled but the
> address it contains might conflict with other devices.  That's the
> problem.
>
> To fix this, I think we need to do "r->flags |= IORESOURCE_UNSET |
> IORESOURCE_DISABLED".

No, that is not right.

Current that r->flags = 0 and reset_resource() cover the bug in
pci_enable_resources() when assign and reassign resource fail.

In pci_enable_resources() if there is one resource with IO BAR or SRIOV BAR
is not assigned and have UNSET, it will prevent device from being enabled.

Most drivers could work without io port.

If you change r->flags = 0 to
r->flags |= IORESOURCE_UNSET | IORESOURCE_DISABLED

Those drivers would not work anymore.

I also know one driver that could work with pref mmio, but mmio is not assigned.
--- silicon bug, that it exposes non-needed mmio bar.

BTW I think we may need to clear the BAR in pci_claim_resource().

Maybe Linus or Greg have more idea about this.
Do we need to get more strict? will only enable PCI_COMMAND_MEMORY
unless all mmio BARs get assigned value?

Thanks

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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