lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <91ccdd4-797-5d8b-d5c9-5fef5742575@linux.intel.com>
Date: Tue, 15 Aug 2023 14:31:05 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Bjorn Helgaas <helgaas@...nel.org>
cc: linux-pci@...r.kernel.org, Saeed Mahameed <saeedm@...dia.com>, 
    Leon Romanovsky <leon@...nel.org>, "David S. Miller" <davem@...emloft.net>, 
    Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, 
    Paolo Abeni <pabeni@...hat.com>, Moshe Shemesh <moshe@...lanox.com>, 
    Netdev <netdev@...r.kernel.org>, linux-rdma@...r.kernel.org, 
    LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] net/mlx5: Convert PCI error values to generic
 errnos

On Mon, 14 Aug 2023, Bjorn Helgaas wrote:

> On Mon, Aug 14, 2023 at 04:27:20PM +0300, Ilpo Järvinen wrote:
> > mlx5_pci_link_toggle() returns mix PCI specific error codes and generic
> > errnos.
> > 
> > Convert the PCI specific error values to generic errno using
> > pcibios_err_to_errno() before returning them.
> > 
> > Fixes: eabe8e5e88f5 ("net/mlx5: Handle sync reset now event")
> > Fixes: 212b4d7251c1 ("net/mlx5: Wait for firmware to enable CRS before pci_restore_state")
> > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
> > 
> > ---
> > 
> > Maintainers beware, this will conflict with read+write -> set/clear_word
> > fixes in pci.git/pcie-rmw. As such, it might be the easiest for Bjorn to
> > take it instead of net people.
> 
> I provisionally rebased and applied it on pci/pcie-rmw.  Take a look
> and make sure I didn't botch it --

Looks okay.

> I also found a case in
> mlx5_check_dev_ids() that looks like it needs the same conversion.

Ah, that where the one of them went (my first version had that fixed 
inside link_toggle but then when rebasing I didn't realize it had moved 
into another function).
 
> The commit as applied is below.
> 
> If networking folks would prefer to take this, let me know and I can
> drop it.
> 
> > I wonder if these PCIBIOS_* error codes are useful at all? There's 1:1
> > mapping into errno values so no information loss if the functions would just
> > return errnos directly. Perhaps this is just legacy nobody has bothered to
> > remove? If nobody opposes, I could take a look at getting rid of them.
> 
> I don't think the PCIBIOS error codes are very useful outside of
> arch/x86.  They're returned by x86 PCIBIOS functions, and I think we
> still use those calls, but I don't think there's value in exposing the
> x86 error codes outside arch/x86.  Looks like a big job to clean it up
> though ;)

Hmm... Do you mean pci_bios_read/write() in arch/x86/pci/pcbios.c?
...Because those functions are already inconsistent even with themselves, 
returning either -EINVAL or the PCI BIOS error code (or what I assume that 
masking of result to yield).

And unfortunately, that's far from the only inconsistency within arch PCI
read/write func return values...


-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ