lkml.org 
[lkml]   [2003]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: 8390too, radeonfb support
From
Date
Jeff Garzik <jgarzik@pobox.com> writes:

> On Sun, Jul 20, 2003 at 11:30:14PM +0200, Pavel Machek wrote:
> > Hi!
> >
> > Ole put some patches on his webpage. I ported them to
> > 2.6.0-test1. Could someone who has hardware test them/push them to
> > linus?
>
> Please push net driver patches to the net driver maintainer, who has
> already applied the simple 8139too-refrigerator patch.

Here is an incremental patch.

Correctly initialize the NIC in 8139too.c after software
suspend/resume, so that we don't get Tx/Rx DMA timeouts.

Tested and works fine on my computer. This patch originates from Ole
Myren Rohne's web page:

http://mrohne.home.cern.ch/mrohne/P2120/P2120_Linux_S3.html

drivers/net/8139too.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletion(-)

diff -puN drivers/net/8139too.c~rtl8139-suspend-2 drivers/net/8139too.c
--- linux/drivers/net/8139too.c~rtl8139-suspend-2 Tue Jul 22 12:50:36 2003
+++ linux-petero/drivers/net/8139too.c Tue Jul 22 12:50:36 2003
@@ -566,6 +566,7 @@ struct rtl8139_private {
void *mmio_addr;
int drv_flags;
struct pci_dev *pci_dev;
+ u32 pci_state[16];
struct net_device_stats stats;
unsigned char *rx_ring;
unsigned int cur_rx; /* Index into the Rx buffer of next Rx pkt. */
@@ -2570,6 +2571,9 @@ static int rtl8139_suspend (struct pci_d
tp->stats.rx_missed_errors += RTL_R32 (RxMissed);
RTL_W32 (RxMissed, 0);

+ pci_save_state (pdev, tp->pci_state);
+ pci_set_power_state (pdev, 3);
+
spin_unlock_irqrestore (&tp->lock, flags);
return 0;
}
@@ -2578,11 +2582,15 @@ static int rtl8139_suspend (struct pci_d
static int rtl8139_resume (struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata (pdev);
+ struct rtl8139_private *tp = dev->priv;

if (!netif_running (dev))
return 0;
- netif_device_attach (dev);
+ pci_set_power_state (pdev, 0);
+ pci_restore_state (pdev, tp->pci_state);
+ rtl8139_init_ring (dev);
rtl8139_hw_start (dev);
+ netif_device_attach (dev);
return 0;
}

_

--
Peter Osterlund - petero2@telia.com
http://w1.894.telia.com/~u89404340
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.049 / U:0.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site