From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Corcodel Marian <asd@marian1000.go.ro>, netdev@vger.kernel.org
Subject: Re: [PATCH net v4] r8169: Add EEPROM support and disable MWI on pci express.
Date: Sun, 7 Feb 2016 21:10:14 +0300 [thread overview]
Message-ID: <56B78886.20202@cogentembedded.com> (raw)
In-Reply-To: <1454866737-2406-1-git-send-email-asd@marian1000.go.ro>
Hello.
On 02/07/2016 08:38 PM, Corcodel Marian wrote:
> On chip with external eeprom ASPM settings is loaded from eeprom and
> on pci express interface not support MWI.
Does not support.
>
> Signed-off-by: Corcodel Marian <asd@marian1000.go.ro>
> ---
> drivers/net/ethernet/realtek/r8169.c | 22 ++++++++++++++--------
> 1 file changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 1d119a6..bebd550 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
[...]
> @@ -4372,7 +4373,8 @@ static void rtl8169_release_board(struct pci_dev *pdev, struct net_device *dev,
> {
> iounmap(ioaddr);
> pci_release_regions(pdev);
> - pci_clear_mwi(pdev);
> + if (!pci_is_pcie(pdev))
> + pci_clear_mwi(pdev);
Please indent with tab, not space.
> pci_disable_device(pdev);
> free_netdev(dev);
> }
> @@ -8042,7 +8044,7 @@ static const struct rtl_cfg_info {
> .align = 8,
> .event_slow = SYSErr | LinkChg | RxOverflow | RxFIFOOver |
> PCSTimeout | SWInt | TxDescUnavail,
> - .features = RTL_FEATURE_MSI,
> + .features = RTL_FEATURE_MSI | RTL_FEATURE_EEPROM,
> .default_ver = RTL_GIGA_MAC_VER_13,
> }
> };
> @@ -8151,6 +8153,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
> {
> const struct rtl_cfg_info *cfg = rtl_cfg_infos + ent->driver_data;
> const unsigned int region = cfg->region;
> + unsigned features = cfg->features;
Not sure you need this variable.
> struct rtl8169_private *tp;
> struct mii_if_info *mii;
> struct net_device *dev;
> @@ -8186,8 +8189,10 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>
> /* disable ASPM completely as that cause random device stop working
> * problems as well as full system hangs for some PCIe devices users */
> - pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
> - PCIE_LINK_STATE_CLKPM);
> + if (!(features & RTL_FEATURE_EEPROM))
> + pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S |
> + PCIE_LINK_STATE_L1 |
> + PCIE_LINK_STATE_CLKPM);
The continuation likes should start under 'pdev', that's a style used by
the networking code.
>
> mdelay(RTL8169_EE_TIMEOUT);
> /* enable device (incl. PCI PM wakeup and hotplug setup) */
> @@ -8196,10 +8201,10 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
> netif_err(tp, probe, dev, "enable failure\n");
> goto err_out_free_dev_1;
> }
> -
> - if (pci_set_mwi(pdev) < 0)
> + if (!pci_is_pcie(pdev)) {
> + if (pci_set_mwi(pdev) < 0)
Please indent with tab, not space.
> netif_info(tp, probe, dev, "Mem-Wr-Inval unavailable\n");
> -
> + }
> /* make sure PCI base addr 1 is MMIO */
> if (!(pci_resource_flags(pdev, region) & IORESOURCE_MEM)) {
> netif_err(tp, probe, dev,
> @@ -8462,7 +8467,8 @@ err_out_msi_4:
> err_out_free_res_3:
> pci_release_regions(pdev);
> err_out_mwi_2:
> - pci_clear_mwi(pdev);
> + if (!pci_is_pcie(pdev))
> + pci_clear_mwi(pdev);
Please indent properly.
[...]
MBR, Sergei
next prev parent reply other threads:[~2016-02-07 18:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-07 17:38 [PATCH net v4] r8169: Add EEPROM support and disable MWI on pci express Corcodel Marian
2016-02-07 18:10 ` Sergei Shtylyov [this message]
2016-02-07 18:40 ` Corcodel Marian
2016-02-07 18:48 ` Sergei Shtylyov
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=56B78886.20202@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=asd@marian1000.go.ro \
--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 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).