From 7a80ec3e7d5ec77db4e05a2b403bfa607f971fdb Mon Sep 17 00:00:00 2001 From: kyle Date: Fri, 26 Nov 2010 11:20:50 -0500 Subject: [PATCH] hda/realtek and r8169 fixes --- ...altek-handle-unset-external-amp-bits.patch | 12 ++++ kernel.spec | 20 ++++++ r8169-01-fix-rx-checksum-offload.patch | 63 +++++++++++++++++++ r8169-02-_re_init-phy-on-resume.patch | 44 +++++++++++++ ...ecksum-for-invalid-sctp_igmp-packets.patch | 34 ++++++++++ 5 files changed, 173 insertions(+) create mode 100644 hda_realtek-handle-unset-external-amp-bits.patch create mode 100644 r8169-01-fix-rx-checksum-offload.patch create mode 100644 r8169-02-_re_init-phy-on-resume.patch create mode 100644 r8169-03-fix-broken-checksum-for-invalid-sctp_igmp-packets.patch diff --git a/hda_realtek-handle-unset-external-amp-bits.patch b/hda_realtek-handle-unset-external-amp-bits.patch new file mode 100644 index 000000000..8519fd32a --- /dev/null +++ b/hda_realtek-handle-unset-external-amp-bits.patch @@ -0,0 +1,12 @@ +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c +index 0ac6aed..53f503d 100644 +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -1614,6 +1614,7 @@ do_sku: + spec->init_amp = ALC_INIT_GPIO3; + break; + case 5: ++ default: + spec->init_amp = ALC_INIT_DEFAULT; + break; + } diff --git a/kernel.spec b/kernel.spec index af32ccf60..2e1b17bb5 100644 --- a/kernel.spec +++ b/kernel.spec @@ -787,6 +787,14 @@ Patch13703: posix-cpu-timers-workaround-to-suppress-problems-with-mt-exec.patch Patch13660: rtl8180-improve-signal-reporting-for-rtl8185-hardware.patch Patch13661: rtl8180-improve-signal-reporting-for-actual-rtl8180-hardware.patch +#rhbz #502974 +Patch13670: r8169-01-fix-rx-checksum-offload.patch +Patch13671: r8169-02-_re_init-phy-on-resume.patch +Patch13672: r8169-03-fix-broken-checksum-for-invalid-sctp_igmp-packets.patch + +#rhbz #657388 +Patch13680: hda_realtek-handle-unset-external-amp-bits.patch + %endif BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root @@ -1476,6 +1484,14 @@ ApplyPatch posix-cpu-timers-workaround-to-suppress-problems-with-mt-exec.patch ApplyPatch rtl8180-improve-signal-reporting-for-rtl8185-hardware.patch ApplyPatch rtl8180-improve-signal-reporting-for-actual-rtl8180-hardware.patch +#rhbz #502974 +ApplyPatch r8169-01-fix-rx-checksum-offload.patch +ApplyPatch r8169-02-_re_init-phy-on-resume.patch +ApplyPatch r8169-03-fix-broken-checksum-for-invalid-sctp_igmp-packets.patch + +#rhbz #657388 +ApplyPatch hda_realtek-handle-unset-external-amp-bits.patch + # END OF PATCH APPLICATIONS %endif @@ -2062,6 +2078,10 @@ fi # and build. %changelog +* Fri Nov 26 2010 Kyle McMartin +- r8169 fixes from sgruszka@redhat.com (#502974) +- hda/realtek: handle unset external amp bits (#657388) + * Wed Nov 24 2010 John W. Linville - rtl8180: improve signal reporting for rtl8185 hardware - rtl8180: improve signal reporting for actual rtl8180 hardware diff --git a/r8169-01-fix-rx-checksum-offload.patch b/r8169-01-fix-rx-checksum-offload.patch new file mode 100644 index 000000000..f6786d5f4 --- /dev/null +++ b/r8169-01-fix-rx-checksum-offload.patch @@ -0,0 +1,63 @@ +From sgruszka@redhat.com Fri Nov 26 08:04:40 2010 +From: Stanislaw Gruszka +To: kernel@lists.fedoraproject.org, Kyle McMartin +Subject: [PATCH 2.6.35 1/3] r8169: fix rx checksum offload +Date: Fri, 26 Nov 2010 14:04:31 +0100 + +From: Eric Dumazet + +Commit adea1ac7effbddbe60a9de6d63462bfe79289e59 upstream. + +All skbs given to network stack had their ip_summed set to +CHECKSUM_NONE, while hardware said they had correct TCP/UDP checksums. +The reason is driver sets skb->ip_summed on the original skb before the +copy eventually done by copybreak. The fresh skb gets the ip_summed = +CHECKSUM_NONE value, forcing network stack to recompute checksum, and +preventing my GRO patch to work. + +Fix is to make the ip_summed setting after skb copy. + +Note : rx_copybreak current value is 16383, so all frames are copied... + +Signed-off-by: Eric Dumazet +Acked-by: Francois Romieu +Signed-off-by: David S. Miller +--- + drivers/net/r8169.c | 6 ++---- + 1 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c +index ad9833b..60b5911 100644 +--- a/drivers/net/r8169.c ++++ b/drivers/net/r8169.c +@@ -4458,9 +4458,8 @@ static inline int rtl8169_fragmented_frame(u32 status) + return (status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag); + } + +-static inline void rtl8169_rx_csum(struct sk_buff *skb, struct RxDesc *desc) ++static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1) + { +- u32 opts1 = le32_to_cpu(desc->opts1); + u32 status = opts1 & RxProtoMask; + + if (((status == RxProtoTCP) && !(opts1 & TCPFail)) || +@@ -4554,8 +4553,6 @@ static int rtl8169_rx_interrupt(struct net_device *dev, + continue; + } + +- rtl8169_rx_csum(skb, desc); +- + if (rtl8169_try_rx_copy(&skb, tp, pkt_size, addr)) { + pci_dma_sync_single_for_device(pdev, addr, + pkt_size, PCI_DMA_FROMDEVICE); +@@ -4566,6 +4563,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev, + tp->Rx_skbuff[entry] = NULL; + } + ++ rtl8169_rx_csum(skb, status); + skb_put(skb, pkt_size); + skb->protocol = eth_type_trans(skb, dev); + +-- +1.7.1 + diff --git a/r8169-02-_re_init-phy-on-resume.patch b/r8169-02-_re_init-phy-on-resume.patch new file mode 100644 index 000000000..b9a9ce3ea --- /dev/null +++ b/r8169-02-_re_init-phy-on-resume.patch @@ -0,0 +1,44 @@ +From sgruszka@redhat.com Fri Nov 26 08:04:42 2010 +From: Stanislaw Gruszka +To: kernel@lists.fedoraproject.org, Kyle McMartin +Subject: [PATCH 2.6.35 2/3] r8169: (re)init phy on resume +Date: Fri, 26 Nov 2010 14:04:32 +0100 + +Commit fccec10b33503a2b1197c8e7a3abd30443bedb08 upstream. + +Fix switching device to low-speed mode after resume reported in: +https://bugzilla.redhat.com/show_bug.cgi?id=502974 + +Reported-and-tested-by: Laurentiu Badea +Signed-off-by: Stanislaw Gruszka +Signed-off-by: David S. Miller +--- + drivers/net/r8169.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c +index 60b5911..661109f 100644 +--- a/drivers/net/r8169.c ++++ b/drivers/net/r8169.c +@@ -4893,6 +4893,9 @@ static int rtl8169_resume(struct device *device) + { + struct pci_dev *pdev = to_pci_dev(device); + struct net_device *dev = pci_get_drvdata(pdev); ++ struct rtl8169_private *tp = netdev_priv(dev); ++ ++ rtl8169_init_phy(dev, tp); + + if (netif_running(dev)) + __rtl8169_resume(dev); +@@ -4933,6 +4936,8 @@ static int rtl8169_runtime_resume(struct device *device) + tp->saved_wolopts = 0; + spin_unlock_irq(&tp->lock); + ++ rtl8169_init_phy(dev, tp); ++ + __rtl8169_resume(dev); + + return 0; +-- +1.7.1 + diff --git a/r8169-03-fix-broken-checksum-for-invalid-sctp_igmp-packets.patch b/r8169-03-fix-broken-checksum-for-invalid-sctp_igmp-packets.patch new file mode 100644 index 000000000..01c44ab8d --- /dev/null +++ b/r8169-03-fix-broken-checksum-for-invalid-sctp_igmp-packets.patch @@ -0,0 +1,34 @@ +From sgruszka@redhat.com Fri Nov 26 08:04:43 2010 +From: Stanislaw Gruszka +To: kernel@lists.fedoraproject.org, Kyle McMartin +Subject: [PATCH 2.6.35 3/3] r8169: fix broken checksum for invalid sctp/igmp packets +Date: Fri, 26 Nov 2010 14:04:33 +0100 + +From: Shan Wei + +Commit d5d3ebe3be5c5123f2d444e186717f45284151e2 upstream. + +Signed-off-by: Shan Wei +Acked-by: Francois Romieu +Signed-off-by: David S. Miller +--- + drivers/net/r8169.c | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c +index 661109f..b99dd04 100644 +--- a/drivers/net/r8169.c ++++ b/drivers/net/r8169.c +@@ -4463,8 +4463,7 @@ static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1) + u32 status = opts1 & RxProtoMask; + + if (((status == RxProtoTCP) && !(opts1 & TCPFail)) || +- ((status == RxProtoUDP) && !(opts1 & UDPFail)) || +- ((status == RxProtoIP) && !(opts1 & IPFail))) ++ ((status == RxProtoUDP) && !(opts1 & UDPFail))) + skb->ip_summed = CHECKSUM_UNNECESSARY; + else + skb->ip_summed = CHECKSUM_NONE; +-- +1.7.1 +