All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] pci: Add error values definitions from the kernel
Date: Fri, 8 Jan 2016 08:48:07 +0800	[thread overview]
Message-ID: <CAEUhbmUjN17vVaMMkFFnv2PLqa96xGMiF0yZF7JwwRimaEiF-w@mail.gmail.com> (raw)
In-Reply-To: <CAEUhbmVC4U5iZdk76t9f9Pna5mNFGyLRSs3J81OEtHfPH3no3w@mail.gmail.com>

On Fri, Jan 8, 2016 at 8:46 AM, Bin Meng <bmeng.cn@gmail.com> wrote:
> Hi Fabio,
>
> On Thu, Jan 7, 2016 at 9:31 PM, Fabio Estevam <festevam@gmail.com> wrote:
>> On Thu, Jan 7, 2016 at 10:58 AM, Bin Meng <bmeng.cn@gmail.com> wrote:
>>
>>> Ah, yes! Sorry I wanted to say the original proposal to "return 0"
>>> instead. But now I failed to understand why this fixed the issue
>>> because those error numbers are not zero.
>>
>> The problem only happens if we return a negative value.
>
> OK, now I am pretty sure this fix is not correct, that "the problem
> only happens if we return a negative value".
>
> The imx and layerscape PCIe driver registers PCI config ops as following:
>
> pci_set_ops(hose,
>    pci_hose_read_config_byte_via_dword,
>    pci_hose_read_config_word_via_dword,
>    ls_pcie_read_config,
>    pci_hose_write_config_byte_via_dword,
>    pci_hose_write_config_word_via_dword,
>    ls_pcie_write_config);
>
> The pci_hose_read_config_byte_via_dword() and
> pci_hose_read_config_word_via_dword() only return -1 if the error
> number < 0. What if I call:
>
> u32 data;
> ret = pci_read_config_dword(dev, PCI_VENDOR_ID, &data);
>
> This will fail with error number 0x86, but if we do:
>
> u16 data;
> ret = pci_read_config_dword(dev, PCI_VENDOR_ID, &data);

oops, this should be: pci_read_config_word()

>
> This will _not_ fail. This is inconsistent. You are just trying to
> workaround the 'pciinfo' command to make it output no error message.
>
>>
>>> And why returning zero is bad? From a working PCIe controller (either
>>
>> It is not bad, but I still prefer to keep in sync with the kernel driver.
>
> Regards,
> Bin

  reply	other threads:[~2016-01-08  0:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06 20:53 [U-Boot] [PATCH 1/3] pci: Add error values definitions from the kernel Fabio Estevam
2016-01-06 20:53 ` [U-Boot] [PATCH 2/3] pcie_imx: Adjust the return value when imx_pcie_addr_valid() fails Fabio Estevam
2016-01-06 20:57   ` Marek Vasut
2016-01-06 20:53 ` [U-Boot] [PATCH 3/3] pcie_layerscape: Adjust the return value when ls_pcie_addr_valid() fails Fabio Estevam
2016-01-06 20:58   ` Marek Vasut
2016-01-06 20:57 ` [U-Boot] [PATCH 1/3] pci: Add error values definitions from the kernel Marek Vasut
2016-01-06 22:55 ` Tom Rini
2016-01-06 22:58   ` Fabio Estevam
2016-01-06 23:10     ` Tom Rini
2016-01-07  2:11 ` Bin Meng
2016-01-07 12:15   ` Fabio Estevam
2016-01-07 12:58     ` Bin Meng
2016-01-07 13:31       ` Fabio Estevam
2016-01-07 16:28         ` Tom Rini
2016-01-07 16:49           ` Fabio Estevam
2016-01-08  0:02             ` Bin Meng
2016-01-08  0:15               ` Fabio Estevam
2016-01-08  0:31                 ` Bin Meng
2016-01-08  0:35                   ` Marek Vasut
2016-01-08  1:10                     ` Bin Meng
2016-01-08  0:46         ` Bin Meng
2016-01-08  0:48           ` Bin Meng [this message]
2016-01-08  2:09           ` Fabio Estevam
2016-01-08  2:18             ` Bin Meng
2016-01-08  2:20               ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEUhbmUjN17vVaMMkFFnv2PLqa96xGMiF0yZF7JwwRimaEiF-w@mail.gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.