mbox series

[v4,00/10] PCI: Add and use constant PCI_STATUS_ERROR_BITS and helper pci_status_get_and_clear_errors

Message ID adeb9e6e-9be6-317f-3fc0-a4e6e6af5f81@gmail.com
Headers show
Series PCI: Add and use constant PCI_STATUS_ERROR_BITS and helper pci_status_get_and_clear_errors | expand

Message

Heiner Kallweit Feb. 29, 2020, 10:19 p.m. UTC
Several drivers have own definitions for this constant, so move it
to the PCI core. In addition in multiple places the following code
sequence is used:
1. Read PCI_STATUS
2. Mask out non-error bits
3. Action based on set error bits
4. Write back set error bits to clear them

As this is a repeated pattern, add a helper to the PCI core.

Most affected drivers are network drivers. But as it's about core
PCI functionality, I suppose the series should go through the PCI
tree.

v2:
- fix formal issue with cover letter
v3:
- fix dumb typo in patch 7
v4:
- add patches 1-3
- move new constant PCI_STATUS_ERROR_BITS to include/linux/pci.h
- small improvements in commit messages

Heiner Kallweit (10):
  net: marvell: add PCI_STATUS_SIG_TARGET_ABORT to PCI status error bits
  net: skfp: add PCI_STATUS_REC_TARGET_ABORT to PCI status error bits
  r8169: add PCI_STATUS_PARITY to PCI status error bits
  PCI: Add constant PCI_STATUS_ERROR_BITS
  PCI: Add pci_status_get_and_clear_errors
  r8169: use pci_status_get_and_clear_errors
  net: sun: use pci_status_get_and_clear_errors
  net: skfp: use new constant PCI_STATUS_ERROR_BITS
  PCI: pci-bridge-emul: Use new constant PCI_STATUS_ERROR_BITS
  sound: bt87x: use pci_status_get_and_clear_errors

 drivers/net/ethernet/marvell/skge.h       |  6 -----
 drivers/net/ethernet/marvell/sky2.h       |  6 -----
 drivers/net/ethernet/realtek/r8169_main.c | 15 +++++-------
 drivers/net/ethernet/sun/cassini.c        | 28 ++++++++-------------
 drivers/net/ethernet/sun/sungem.c         | 30 +++++++----------------
 drivers/net/fddi/skfp/drvfbi.c            |  4 +--
 drivers/net/fddi/skfp/h/skfbi.h           |  5 ----
 drivers/pci/pci-bridge-emul.c             | 14 ++---------
 drivers/pci/pci.c                         | 23 +++++++++++++++++
 include/linux/pci.h                       |  8 ++++++
 sound/pci/bt87x.c                         |  7 +-----
 11 files changed, 61 insertions(+), 85 deletions(-)

Comments

David Miller March 4, 2020, 2:59 a.m. UTC | #1
Bjorn, please review and let me know if it is OK to merge this via the
networking tree.

Thank you.
Bjorn Helgaas March 4, 2020, 4:59 p.m. UTC | #2
On Tue, Mar 03, 2020 at 06:59:37PM -0800, David Miller wrote:
> 
> Bjorn, please review and let me know if it is OK to merge this via the
> networking tree.

I acked the relevant patches and you're welcome to merge it via
networking.  Thanks!
David Miller March 4, 2020, 10:21 p.m. UTC | #3
From: Bjorn Helgaas <helgaas@kernel.org>
Date: Wed, 4 Mar 2020 10:59:04 -0600

> On Tue, Mar 03, 2020 at 06:59:37PM -0800, David Miller wrote:
>> 
>> Bjorn, please review and let me know if it is OK to merge this via the
>> networking tree.
> 
> I acked the relevant patches and you're welcome to merge it via
> networking.  Thanks!

Ok, thanks.

Series applied to net-next.

Thanks again everyone.