linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/8] PCI: add and use constant PCI_STATUS_ERROR_BITS and helper pci_status_get_and_clear_errors
@ 2020-02-25 14:03 Heiner Kallweit
  2020-02-25 14:03 ` [PATCH v3 1/8] PCI: add constant PCI_STATUS_ERROR_BITS Heiner Kallweit
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Heiner Kallweit @ 2020-02-25 14:03 UTC (permalink / raw)
  To: Bjorn Helgaas, Realtek linux nic maintainers, David Miller,
	Mirko Lindner, Stephen Hemminger, Clemens Ladisch,
	Jaroslav Kysela, Takashi Iwai
  Cc: linux-pci, Linux Kernel Mailing List, netdev, alsa-devel

Few drivers have own definitions for this constant, so move it to the
PCI core. In addition there are several places where 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

Heiner Kallweit (8):
  PCI: add constant PCI_STATUS_ERROR_BITS
  PCI: add pci_status_get_and_clear_errors
  r8169: use pci_status_get_and_clear_errors
  net: cassini: use pci_status_get_and_clear_errors
  net: sungem: use pci_status_get_and_clear_errors
  net: skfp: use PCI_STATUS_ERROR_BITS
  PCI: pci-bridge-emul: use 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            |  2 +-
 drivers/net/fddi/skfp/h/skfbi.h           |  5 ----
 drivers/pci/pci-bridge-emul.c             | 14 ++---------
 drivers/pci/pci.c                         | 23 +++++++++++++++++
 include/linux/pci.h                       |  1 +
 include/uapi/linux/pci_regs.h             |  7 ++++++
 sound/pci/bt87x.c                         |  7 +-----
 12 files changed, 60 insertions(+), 84 deletions(-)

-- 
2.25.1




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-02-25 21:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 14:03 [PATCH v3 0/8] PCI: add and use constant PCI_STATUS_ERROR_BITS and helper pci_status_get_and_clear_errors Heiner Kallweit
2020-02-25 14:03 ` [PATCH v3 1/8] PCI: add constant PCI_STATUS_ERROR_BITS Heiner Kallweit
2020-02-25 20:50   ` Bjorn Helgaas
2020-02-25 21:35     ` Heiner Kallweit
2020-02-25 14:04 ` [PATCH v3 2/8] PCI: add pci_status_get_and_clear_errors Heiner Kallweit
2020-02-25 20:57   ` Bjorn Helgaas
2020-02-25 14:04 ` [PATCH v3 3/8] r8169: use pci_status_get_and_clear_errors Heiner Kallweit
2020-02-25 14:05 ` [PATCH v3 4/8] net: cassini: " Heiner Kallweit
2020-02-25 14:05 ` [PATCH v3 5/8] net: sungem: " Heiner Kallweit
2020-02-25 14:06 ` [PATCH v3 6/8] net: skfp: use PCI_STATUS_ERROR_BITS Heiner Kallweit
2020-02-25 14:07 ` [PATCH v3 7/8] PCI: pci-bridge-emul: " Heiner Kallweit
2020-02-25 14:07 ` [PATCH v3 8/8] sound: bt87x: use pci_status_get_and_clear_errors Heiner Kallweit
2020-02-25 20:57 ` [PATCH v3 0/8] PCI: add and use constant PCI_STATUS_ERROR_BITS and helper pci_status_get_and_clear_errors Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).