Re: [PATCH 2/2] PCI: Warn if power_state != PCI_D0 when write MSI message

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

 



[+cc Ben]

On Thu, Sep 12, 2013 at 2:20 AM, Yijing Wang <wangyijing@xxxxxxxxxx> wrote:
> When we setup MSI, if device power state is not equal to PCI_D0,
> system will silently ignore writing MSI message, but pci_enable_msi()
> still return 0 which seems setup successfully. So we should warn here
> to help diagnose this issue.
>
> Signed-off-by: Yijing Wang <wangyijing@xxxxxxxxxx>
> ---
>  drivers/pci/msi.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index aca7578..25ed59d 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -291,6 +291,8 @@ void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
>  {
>         if (entry->dev->current_state != PCI_D0) {
>                 /* Don't touch the hardware now */
> +               dev_warn(&entry->dev->dev,
> +                       "current_state != PCI_D0, ignore writing MSI message!\n");

Is there a real problem here?  If there is a real problem, a printk
doesn't help fix it.  If there's no problem, I don't see the point of
this printk.

I would expect that if the device is not in D0, we should remember the
hardware updates that need to be made, and if the device returns to
D0, we should apply the updates then.  If that's the case this is not
an error and we shouldn't warn about it.

Bjorn

>         } else if (entry->msi_attrib.is_msix) {
>                 void __iomem *base;
>                 base = entry->mask_base +
> --
> 1.7.1
>
>
> --
> 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
--
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