* [PATCH net v3.16]r8169: Remove unsupported command on pci express
@ 2016-03-11 15:06 Corcodel Marian
2016-03-11 19:10 ` Sergei Shtylyov
0 siblings, 1 reply; 3+ messages in thread
From: Corcodel Marian @ 2016-03-11 15:06 UTC (permalink / raw)
To: netdev; +Cc: Francois Romieu, Corcodel Marian
On pci express not support latency timer.For more info read file /drivers/pci/pci.c
on pcibios_set_master function.
Signed-off-by: Corcodel Marian <asd@marian1000.go.ro>
---
drivers/net/ethernet/realtek/r8169.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 41750df..02aec96 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -753,6 +753,7 @@ struct rtl8169_private {
struct ring_info tx_skb[NUM_TX_DESC]; /* Tx data buffers */
struct timer_list timer;
u16 cp_cmd;
+ bool pcie;
u16 event_slow;
@@ -3757,8 +3758,8 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
RTL_W8(0x82, 0x01);
}
-
- pci_write_config_byte(tp->pci_dev, PCI_LATENCY_TIMER, 0x40);
+ if (tp->pcie == 0)
+ pci_write_config_byte(tp->pci_dev, PCI_LATENCY_TIMER, 0x40);
if (tp->mac_version <= RTL_GIGA_MAC_VER_06)
pci_write_config_byte(tp->pci_dev, PCI_CACHE_LINE_SIZE, 0x08);
@@ -7083,8 +7084,11 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
}
tp->mmio_addr = ioaddr;
- if (!pci_is_pcie(pdev))
+ if (!pci_is_pcie(pdev)) {
netif_info(tp, probe, dev, "not PCI Express\n");
+ tp->pcie = 0;
+ } else
+ tp->pcie = 1;
/* Identify chip attached to board */
rtl8169_get_mac_version(tp, dev, cfg->default_ver);
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v3.16]r8169: Remove unsupported command on pci express
2016-03-11 15:06 [PATCH net v3.16]r8169: Remove unsupported command on pci express Corcodel Marian
@ 2016-03-11 19:10 ` Sergei Shtylyov
2016-03-11 22:00 ` Francois Romieu
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2016-03-11 19:10 UTC (permalink / raw)
To: Corcodel Marian, netdev; +Cc: Francois Romieu
Hello.
On 03/11/2016 06:06 PM, Corcodel Marian wrote:
> On pci express not support latency timer.For more info read file /drivers/pci/pci.c
> on pcibios_set_master function.
>
> Signed-off-by: Corcodel Marian <asd@marian1000.go.ro>
> ---
> drivers/net/ethernet/realtek/r8169.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 41750df..02aec96 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -753,6 +753,7 @@ struct rtl8169_private {
> struct ring_info tx_skb[NUM_TX_DESC]; /* Tx data buffers */
> struct timer_list timer;
> u16 cp_cmd;
> + bool pcie;
>
> u16 event_slow;
>
> @@ -3757,8 +3758,8 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
> dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n");
> RTL_W8(0x82, 0x01);
> }
> -
> - pci_write_config_byte(tp->pci_dev, PCI_LATENCY_TIMER, 0x40);
> + if (tp->pcie == 0)
Haven't you just declared this field as *bool*?
> + pci_write_config_byte(tp->pci_dev, PCI_LATENCY_TIMER, 0x40);
>
> if (tp->mac_version <= RTL_GIGA_MAC_VER_06)
> pci_write_config_byte(tp->pci_dev, PCI_CACHE_LINE_SIZE, 0x08);
> @@ -7083,8 +7084,11 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
> }
> tp->mmio_addr = ioaddr;
>
> - if (!pci_is_pcie(pdev))
> + if (!pci_is_pcie(pdev)) {
> netif_info(tp, probe, dev, "not PCI Express\n");
> + tp->pcie = 0;
> + } else
> + tp->pcie = 1;
Same question, you should assign true/false.
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v3.16]r8169: Remove unsupported command on pci express
2016-03-11 19:10 ` Sergei Shtylyov
@ 2016-03-11 22:00 ` Francois Romieu
0 siblings, 0 replies; 3+ messages in thread
From: Francois Romieu @ 2016-03-11 22:00 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: Corcodel Marian, netdev
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> :
[...]
> >@@ -7083,8 +7084,11 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
> > }
> > tp->mmio_addr = ioaddr;
> >
> >- if (!pci_is_pcie(pdev))
> >+ if (!pci_is_pcie(pdev)) {
> > netif_info(tp, probe, dev, "not PCI Express\n");
> >+ tp->pcie = 0;
> >+ } else
> >+ tp->pcie = 1;
>
> Same question, you should assign true/false.
He should not bloat the private struct in the first place and the log
message adds no value but the change makes sense.
--
Ueimor
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-11 22:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-11 15:06 [PATCH net v3.16]r8169: Remove unsupported command on pci express Corcodel Marian
2016-03-11 19:10 ` Sergei Shtylyov
2016-03-11 22:00 ` Francois Romieu
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).