linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>,
	David Miller <davem@davemloft.net>,
	Mirko Lindner <mlindner@marvell.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Clemens Ladisch <clemens@ladisch.de>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	alsa-devel@alsa-project.org
Subject: Re: [PATCH v3 1/8] PCI: add constant PCI_STATUS_ERROR_BITS
Date: Tue, 25 Feb 2020 14:50:47 -0600	[thread overview]
Message-ID: <20200225205047.GA194679@google.com> (raw)
In-Reply-To: <73dd692e-bbce-35f5-88e9-417fb0f7229e@gmail.com>

On Tue, Feb 25, 2020 at 03:03:44PM +0100, Heiner Kallweit wrote:

Run "git log --oneline drivers/pci" and make yours match.  In
particular, capitalize the first word ("Add").  Same for the other PCI
patches.  I don't know the drivers/net convention, but please find and
follow that as well.

> This constant is used (with different names) in more than one driver,
> so move it to the PCI core.

The driver constants in *this* patch at least use the same name.

> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/net/ethernet/marvell/skge.h | 6 ------
>  drivers/net/ethernet/marvell/sky2.h | 6 ------
>  include/uapi/linux/pci_regs.h       | 7 +++++++
>  3 files changed, 7 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/skge.h b/drivers/net/ethernet/marvell/skge.h
> index 6fa7b6a34..e149bdfe1 100644
> --- a/drivers/net/ethernet/marvell/skge.h
> +++ b/drivers/net/ethernet/marvell/skge.h
> @@ -15,12 +15,6 @@
>  #define  PCI_VPD_ROM_SZ	7L<<14	/* VPD ROM size 0=256, 1=512, ... */
>  #define  PCI_REV_DESC	1<<2	/* Reverse Descriptor bytes */
>  
> -#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \
> -			       PCI_STATUS_SIG_SYSTEM_ERROR | \
> -			       PCI_STATUS_REC_MASTER_ABORT | \
> -			       PCI_STATUS_REC_TARGET_ABORT | \
> -			       PCI_STATUS_PARITY)
> -
>  enum csr_regs {
>  	B0_RAP	= 0x0000,
>  	B0_CTST	= 0x0004,
> diff --git a/drivers/net/ethernet/marvell/sky2.h b/drivers/net/ethernet/marvell/sky2.h
> index b02b65230..851d8ed34 100644
> --- a/drivers/net/ethernet/marvell/sky2.h
> +++ b/drivers/net/ethernet/marvell/sky2.h
> @@ -252,12 +252,6 @@ enum {
>  };
>  
>  
> -#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \
> -			       PCI_STATUS_SIG_SYSTEM_ERROR | \
> -			       PCI_STATUS_REC_MASTER_ABORT | \
> -			       PCI_STATUS_REC_TARGET_ABORT | \
> -			       PCI_STATUS_PARITY)
> -
>  enum csr_regs {
>  	B0_RAP		= 0x0000,
>  	B0_CTST		= 0x0004,
> diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
> index 543769048..9b84a1278 100644
> --- a/include/uapi/linux/pci_regs.h
> +++ b/include/uapi/linux/pci_regs.h
> @@ -68,6 +68,13 @@
>  #define  PCI_STATUS_SIG_SYSTEM_ERROR	0x4000 /* Set when we drive SERR */
>  #define  PCI_STATUS_DETECTED_PARITY	0x8000 /* Set on parity error */
>  
> +#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY  | \
> +			       PCI_STATUS_SIG_SYSTEM_ERROR | \
> +			       PCI_STATUS_REC_MASTER_ABORT | \
> +			       PCI_STATUS_REC_TARGET_ABORT | \
> +			       PCI_STATUS_SIG_TARGET_ABORT | \
> +			       PCI_STATUS_PARITY)

This actually *adds* PCI_STATUS_SIG_TARGET_ABORT, which is not in the
driver definitions.  At the very least that should be mentioned in the
commit log.

Ideally the addition would be in its own patch so it's obvious and
bisectable, but I see the problem -- the subsequent patches
consolidate things that aren't really quite the same.  One alternative
would be to have preliminary patches that change the drivers
individually so they all use this new mask, then do the consolidation
afterwards.

There is pitifully little documentation about the use of include/uapi,
but AFAICT that is for the user API, and this isn't part of that.  I
think this #define could go in include/linux/pci.h instead.

> +
>  #define PCI_CLASS_REVISION	0x08	/* High 24 bits are class, low 8 revision */
>  #define PCI_REVISION_ID		0x08	/* Revision ID */
>  #define PCI_CLASS_PROG		0x09	/* Reg. Level Programming Interface */
> -- 
> 2.25.1
> 
> 
> 
> 

  reply	other threads:[~2020-02-25 20:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20200225205047.GA194679@google.com \
    --to=helgaas@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mlindner@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=perex@perex.cz \
    --cc=stephen@networkplumber.org \
    --cc=tiwai@suse.com \
    /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 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).