Re: [PATCH] PCI: disable auto realloc detection for lsi devices

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

 



On Tue, Feb 3, 2015 at 6:54 PM, Yinghai Lu <yinghai@xxxxxxxxxx> wrote:
> LSI cards do not work if pci core change pci bar vaules.
> will need to disable/enable pcie link of bridge manually.

Maybe.  There's no analysis to substantiate this theory in the
bugzilla, and there's no link to email discussion that shows what
experiments you did.

The BIOS sets the BAR.  Why does the device work when the BIOS sets
the BAR but not when Linux does?

> So disable auto realloc if there is any lsi device on that pci root
> bus.
>
> If BIOS is broken, solution would be booting pci=realloc and
> 1. check with lsi to get new hba firmware to handle BAR changing.
> 2. or disable/enable pcie link manually to get firmare reset.
>
> Need to backport to kernel before 3.12 as this one can not be
> applied directly.
>
> Reported-by: Paul Johnson <pjay@xxxxxxxxxxx>
> Tested-by: Paul Johnson <pjay@xxxxxxxxxxx>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=92351
> Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx>
> Cc: 3.12+ <stable@xxxxxxxxxxxxxxx> # 3.12+
>
> ---
>  drivers/pci/setup-bus.c |   17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> Index: linux-2.6/drivers/pci/setup-bus.c
> ===================================================================
> --- linux-2.6.orig/drivers/pci/setup-bus.c
> +++ linux-2.6/drivers/pci/setup-bus.c
> @@ -1548,14 +1548,31 @@ static int iov_resources_unassigned(stru
>         return 0;
>  }
>
> +static int strange_dev_check(struct pci_dev *dev, void *data)
> +{
> +       bool *found = data;
> +
> +       /* LSI device firmware is not happy with changing BAR value */
> +       if (dev->vendor == PCI_VENDOR_ID_LSI_LOGIC) {
> +               *found = true;
> +               return 1; /* return early from pci_walk_bus() */
> +       }

This is pretty ugly.  Do you have evidence that *all* LSI devices have
an issue like this?

Can you use the usual quirk style rather than polluting common code
paths like this?

There's an IORESOURCE_PCI_FIXED flag that might be useful in this situation.

> +
> +       return 0;
> +}
>  static enum enable_type pci_realloc_detect(struct pci_bus *bus,
>                          enum enable_type enable_local)
>  {
>         bool unassigned = false;
> +       bool found = false;
>
>         if (enable_local != undefined)
>                 return enable_local;
>
> +       pci_walk_bus(bus, strange_dev_check, &found);
> +       if (found)
> +               return enable_local;
> +
>         pci_walk_bus(bus, iov_resources_unassigned, &unassigned);
>         if (unassigned)
>                 return auto_enabled;
--
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