All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jiawen Wu <jiawenwu@trustnetic.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next v3] net: txgbe: Add build support for txgbe
Date: Fri, 27 May 2022 19:44:37 +0300	[thread overview]
Message-ID: <YpD/9dqThFZZgs2K@unreal> (raw)
In-Reply-To: <20220527063157.486686-1-jiawenwu@trustnetic.com>

On Fri, May 27, 2022 at 02:31:57PM +0800, Jiawen Wu wrote:
> Add doc build infrastructure for txgbe driver.
> Initialize PCI memory space for WangXun 10 Gigabit Ethernet devices.
> 
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> ---
>  .../device_drivers/ethernet/index.rst         |   1 +
>  .../device_drivers/ethernet/wangxun/txgbe.rst |  20 ++
>  MAINTAINERS                                   |   7 +
>  drivers/net/ethernet/Kconfig                  |   1 +
>  drivers/net/ethernet/Makefile                 |   1 +
>  drivers/net/ethernet/wangxun/Kconfig          |  32 +++
>  drivers/net/ethernet/wangxun/Makefile         |   6 +
>  drivers/net/ethernet/wangxun/txgbe/Makefile   |   9 +
>  drivers/net/ethernet/wangxun/txgbe/txgbe.h    |  27 ++
>  .../net/ethernet/wangxun/txgbe/txgbe_main.c   | 241 ++++++++++++++++++
>  .../net/ethernet/wangxun/txgbe/txgbe_type.h   |  65 +++++
>  11 files changed, 410 insertions(+)
>  create mode 100644 Documentation/networking/device_drivers/ethernet/wangxun/txgbe.rst
>  create mode 100644 drivers/net/ethernet/wangxun/Kconfig
>  create mode 100644 drivers/net/ethernet/wangxun/Makefile
>  create mode 100644 drivers/net/ethernet/wangxun/txgbe/Makefile
>  create mode 100644 drivers/net/ethernet/wangxun/txgbe/txgbe.h
>  create mode 100644 drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
>  create mode 100644 drivers/net/ethernet/wangxun/txgbe/txgbe_type.h

<...>

> +/**
> + * txgbe_sw_init - Initialize general software structures (struct txgbe_adapter)
> + * @adapter: board private structure to initialize
> + *
> + * txgbe_sw_init initializes the Adapter private data structure.
> + * Fields are initialized based on PCI device information and
> + * OS network device settings (MTU size).
> + **/
> +static int txgbe_sw_init(struct txgbe_adapter *adapter)
> +{
> +	struct txgbe_hw *hw = &adapter->hw;
> +	struct pci_dev *pdev = adapter->pdev;
> +
> +	/* PCI config space info */
> +	hw->vendor_id = pdev->vendor;
> +	hw->device_id = pdev->device;
> +	hw->revision_id = pdev->revision;
> +	hw->subsystem_vendor_id = pdev->subsystem_vendor;
> +	hw->subsystem_device_id = pdev->subsystem_device;
> +
> +	return 0;
> +}

You are setting this data, but not using it. I'm not sure that to cache
this data is even correct thing to do in a first place.

> +

<...>

> +	pci_set_master(pdev);
> +	/* errata 16 */
> +	pcie_capability_clear_and_set_word(pdev, PCI_EXP_DEVCTL,
> +					   PCI_EXP_DEVCTL_READRQ,
> +					   0x1000);

Why do you need this in probe function and not as PCI quirk?

Thanks

  parent reply	other threads:[~2022-05-27 16:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27  6:31 [PATCH net-next v3] net: txgbe: Add build support for txgbe Jiawen Wu
2022-05-27  7:54 ` kernel test robot
2022-05-27 16:44 ` Leon Romanovsky [this message]
     [not found]   ` <001501d873ec$e4f13a00$aed3ae00$@trustnetic.com>
2022-05-30 12:28     ` Leon Romanovsky
2022-05-28  1:29 ` Andrew Lunn

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=YpD/9dqThFZZgs2K@unreal \
    --to=leon@kernel.org \
    --cc=jiawenwu@trustnetic.com \
    --cc=netdev@vger.kernel.org \
    /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.