3.2.39-stable review
Subsystems (40)
cover 3.2.39-stable review
This is the start of the stable review cycle for the 3.2.39 release. There are 66 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Feb 19 23:00:00 UTC 2013. Anything received after that time might be too late.
A combined patch relative to 3.2.38 will be posted as an additional response to this. A shortlog and diffstat can be found below.
Ben.
-------------
Alan Stern (2):
USB: EHCI: fix bug in scheduling periodic split transfers
[3e619d04159be54b3daa0b7036b0ce9e067f4b5d]
USB: XHCI: fix memory leak of URB-private data
[48c3375c5f69b1c2ef3d1051a0009cb9bce0ce24]
Alessandro Rubini (1):
ahci: support the STA2X11 I/O Hub
[318893e1429a9d50569a0379d1e20b0ecc45c555]
Alex Deucher (2):
drm/radeon: add quirk for RV100 board
[9200ee4941a6e5d1ec5df88982243686882dff3f]
drm/radeon: prevent crash in the ring space allocation
[fd5d93a0015ce1a7db881382022b2fcdfdc61760]
Alexander Stein (1):
can: c_can: Set reserved bit in IFx_MASK2 to 1 on write
[2bd3bc4e8472424f1a6009825397639a8968920a]
Ben Hutchings (1):
drm/i915: Fix misplaced intel_mark_page_flip_active()
[not needed upstream; fixes bug introduced in backporting
e7d841ca03b7ab668620045cd7b428eda9f41601]
Bing Zhao (1):
mwifiex: fix incomplete scan in case of IE parsing error
[8a7d7cbf7b5ff9912ef50b3e94c9ad9f37b1c75f]
Bjørn Mork (1):
USB: option: add Changhong CH690
[d4fa681541aa7bf8570d03426dd7ba663a71c467]
Cong Wang (2):
net: prevent setting ttl=0 via IP_TTL
[c9be4a5c49cf51cc70a993f004c5bb30067a65ce]
pktgen: correctly handle failures when adding a device
[604dfd6efc9b79bce432f2394791708d8e8f6efc]
Daniel Borkmann (2):
net: sctp: sctp_endpoint_free: zero out secret key data
[b5c37fe6e24eec194bb29d22fdd55d73bcc709bf]
net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree
[6ba542a291a5e558603ac51cda9bded347ce7627]
Daniele Palmas (2):
USB: option: add support for Telit LE920
[03eb466f276ceef9dcf023dc5474db02af68aad9]
USB: qcserial: add Telit Gobi QDL device
[78796ae17eacedcdcaaeb03ba73d2e532a4c8f83]
David Moore (1):
usb: Prevent dead ports when xhci is not enabled
[58b2939b4d5a030eaec469d29812ab8477ee7e76]
Eric Dumazet (4):
net: loopback: fix a dst refcounting issue
[794ed393b707f01858f5ebe2ae5eabaf89d00022]
netxen: fix off by one bug in netxen_release_tx_buffer()
[a05948f296ce103989b28a2606e47d2e287c3c89]
tcp: fix MSG_SENDPAGE_NOTLAST logic
[ae62ca7b03217be5e74759dc6d7698c95df498b3]
tcp: frto should not set snd_cwnd to 0
[2e5f421211ff76c17130b4597bc06df4eeead24f]
Fangxiaozhi (2):
USB: storage: Define a new macro for USB storage match rules
[07c7be3d87e5cdaf5f94c271c516456364ef286c]
USB: storage: optimize to match the Huawei USB storage devices and support new switch command
[200e0d994d9d1919b28c87f1a5fb99a8e13b8a0f]
Haojian Zhuang (1):
drivers/rtc/rtc-pl031.c: fix the missing operation on enable
[e7e034e18a0ab6bafb2425c3242cac311164f4d6]
Heiko Carstens (1):
atm/iphase: rename fregt_t -> ffreg_t
[ab54ee80aa7585f9666ff4dd665441d7ce41f1e8]Hugh Daschbach (1):
[libata] ahci: Add support for Enmotus Bobcat device.
[7f9c9f8e24590e7dcd26ca408458c43df5b83e61]
Ian Campbell (3):
netback: correct netbk_tx_err to handle wrap around.
[b9149729ebdcfce63f853aa54a404c6a8f6ebbf3]
xen/netback: free already allocated memory on failure in xen_netbk_get_requests
[4cc7c1cb7b11b6f3515bd9075527576a1eecc4aa]
xen/netback: shutdown the ring if it contains garbage.
[48856286b64e4b66ec62b94e504d0b29c1ade664]
Ilpo Järvinen (1):
tcp: fix for zero packets_in_flight was too broad
[6731d2095bd4aef18027c72ef845ab1087c3ba63]
Jacob Schloss (1):
[media] gspca_kinect: add Kinect for Windows USB id
[98fd485795db064d0885150e2c0c7f296d8fe06e]
Jan Beulich (2):
x86-64: Replace left over sti/cli in ia32 audit exit code
[40a1ef95da85843696fc3ebe5fce39b0db32669f]
x86/xen: don't assume %ds is usable in xen_iret for 32-bit PVOPS.
[13d2b4d11d69a92574a55bfd985cfb0ca77aebdc]
Jan Luebbe (1):
drivers/rtc/rtc-isl1208.c: call rtc_update_irq() from the alarm irq handler
[72fca4a4b32dc778b5b885c3498700e42b610d49]
Jaume Delclòs (1):
Wireless: rt2x00: Add device id for Sweex LW323 to rt2800usb.c
[36f318bb124b231c01db6965a009f46d5731f012]
Johan Hedberg (1):
Bluetooth: Fix handling of unexpected SMP PDUs
[8cf9fa1240229cbdd888236c0c43fcbad680cf00]
Larry Finger (1):
rtlwifi: Fix the usage of the wrong variable in usb.c
[0a06ad8e3a1cb5311b7dbafde45410aa1bce9d40]
Liu Chuansheng (1):
drm/radeon: Calling object_unrefer() when creating fb failure
[f2d68cf4daa4de97d400d94836b907e35228e54f]
Maia Kozheva (1):
rt2800usb: Add support for 2001:3c1e (D-Link DWA-125 rev B1) USB Wi-Fi adapter
[fd7b9270120ca7e53fbf0469febe0c68acf6a0a2]Marcelo Ricardo Leitner (1):
ipv6: do not create neighbor entries for local delivery
[bd30e947207e2ea0ff2c08f5b4a03025ddce48d3]
Matthew Daley (1):
xen/netback: don't leak pages on failure in xen_netbk_tx_check_gop.
[7d5145d8eb2b9791533ffe4dc003b129b9696c48]
Neil Horman (1):
sctp: refactor sctp_outq_teardown to insure proper re-initalization
[2f94aabd9f6c925d77aecb3ff020f1cc12ed8f86]
Nicholas Santos (1):
HID: usbhid: quirk for Formosa IR receiver
[320cde19a4e8f122b19d2df7a5c00636e11ca3fb]
Nithin Nayak Sujir (2):
tg3: Avoid null pointer dereference in tg3_interrupt in netconsole mode
[9c13cb8bb477a83b9a3c9e5a5478a4e21294a760]
tg3: Fix crc errors on jumbo frame receive
[daf3ec688e057f6060fb9bb0819feac7a8bbf45c]
Oleg Nesterov (5):
ptrace/x86: Introduce set_task_blockstep() helper
[848e8f5f0ad3169560c516fff6471be65f76e69f]
ptrace/x86: Partly fix set_task_blockstep()->update_debugctlmsr() logic
[95cf00fa5d5e2a200a2c044c84bde8389a237e02]
ptrace: ensure arch_ptrace/ptrace_request can never race with SIGKILL
[9899d11f654474d2d54ea52ceaa2a1f4db3abd68]
ptrace: introduce signal_wake_up_state() and ptrace_signal_wake_up()
[910ffdb18a6408e14febbb6e4b6840fd2c928c82]
wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED task
[9067ac85d533651b98c2ff903182a20cbb361fcb]Petr Kubánek (1):
USB: ftdi_sio: add Zolix FTDI PID
[0ba3b2ccc72b3df5c305d61f59d93ab0f0e87991]
Phil Sutter (1):
packet: fix leakage of tx_ring memory
[9665d5d62487e8e7b1f546c00e11107155384b9a]
Romain KUNTZ (1):
ipv6: fix header length calculation in ip6_append_data()
[7efdba5bd9a2f3e2059beeb45c9fa55eefe1bced]
Romain Kuntz (1):
ipv6: fix the noflags test in addrconf_get_prefix_route
[85da53bf1c336bb07ac038fb951403ab0478d2c5]
Sarah Sharp (2):
xhci: Fix TD size for isochronous URBs.
[f18f8ed2a9adc41c2d9294b85b6af115829d2af1]
xhci: Fix isoc TD encoding.
[760973d2a74b93eb1697981f7448f0e62767cfc4]
Sarveshwar Bandi (1):
bridge: Pull ip header into skb->data before looking into ip header.
[6caab7b0544e83e6c160b5e80f5a4a7dd69545c7]Shawn Bohrer (1):
sched/rt: Use root_domain of rt_rq not current processor
[aa7f67304d1a03180f463258aa6f15a8b434e77d]
Sjur Brændeland (1):
virtio_console: Don't access uninitialized data.
[aded024a12b32fc1ed9a80639681daae2d07ec25]
Stephen Hemminger (1):
MAINTAINERS: Stephen Hemminger email change
[adbbf69d1a54abf424e91875746a610dcc80017d]
Sven Killig (1):
USB: ftdi_sio: add PID/VID entries for ELV WS 300 PC II
[c249f911406efcc7456cb4af79396726bf7b8c57]
Szymon Janc (1):
Bluetooth: Fix sending HCI commands after reset
[dbccd791a3fbbdac12c33834b73beff3984988e9]
T Makphaibulchoke (1):
kernel/resource.c: fix stack overflow in __reserve_region_with_split()
[4965f5667f36a95b41cda6638875bc992bd7d18b]
Tilman Schmidt (1):
isdn/gigaset: fix zero size border case in debug dump
[d721a1752ba544df8d7d36959038b26bc92bdf80]
Timo Teräs (1):
r8169: remove the obsolete and incorrect AMD workaround
[5d0feaff230c0abfe4a112e6f09f096ed99e0b2d]
Vyacheslav Dubeyko (1):
nilfs2: fix fix very long mount time issue
[a9bae189542e71f91e61a4428adf6e5a7dfe8063]
Xose Vazquez Perez (1):
wireless: rt2x00: rt{2500,73}usb.c put back duplicate id
[8f35f787b75e9b6435ea37dabcae2d40dc72d31c]MAINTAINERS | 6 +- Makefile | 4 +- arch/x86/ia32/ia32entry.S | 4 +- arch/x86/kernel/step.c | 54 ++-- arch/x86/xen/xen-asm_32.S | 14 +- drivers/ata/ahci.c | 32 +- drivers/atm/iphase.h | 146 ++++----- drivers/char/virtio_console.c | 3 +- drivers/gpu/drm/i915/intel_display.c | 4 +- drivers/gpu/drm/radeon/radeon_combios.c | 8 + drivers/gpu/drm/radeon/radeon_display.c | 4 +- drivers/gpu/drm/radeon/radeon_ring.c | 3 + drivers/hid/hid-ids.h | 3 + drivers/hid/usbhid/hid-quirks.c | 1 + drivers/isdn/gigaset/capi.c | 2 + drivers/media/video/gspca/kinect.c | 1 + drivers/net/can/c_can/c_can.c | 6 +- drivers/net/ethernet/broadcom/tg3.c | 62 ++-- .../net/ethernet/qlogic/netxen/netxen_nic_init.c | 2 +- .../net/ethernet/qlogic/netxen/netxen_nic_main.c | 2 + drivers/net/ethernet/realtek/r8169.c | 7 - drivers/net/loopback.c | 5 + drivers/net/wireless/mwifiex/scan.c | 9 +- drivers/net/wireless/rt2x00/rt2500usb.c | 2 +- drivers/net/wireless/rt2x00/rt2800usb.c | 2 + drivers/net/wireless/rt2x00/rt73usb.c | 1 + drivers/net/wireless/rtlwifi/usb.c | 4 +- drivers/net/xen-netback/common.h | 3 + drivers/net/xen-netback/interface.c | 23 +- drivers/net/xen-netback/netback.c | 115 ++++--- drivers/rtc/rtc-isl1208.c | 3 + drivers/rtc/rtc-pl031.c | 8 +- drivers/usb/host/ehci-sched.c | 2 +- drivers/usb/host/pci-quirks.c | 1 + drivers/usb/host/xhci-ring.c | 11 +- drivers/usb/serial/ftdi_sio.c | 2 + drivers/usb/serial/ftdi_sio_ids.h | 9 +- drivers/usb/serial/option.c | 13 + drivers/usb/serial/qcserial.c | 1 + drivers/usb/storage/initializers.c | 76 ++++- drivers/usb/storage/initializers.h | 4 +- drivers/usb/storage/unusual_devs.h | 329 +------------------- drivers/usb/storage/usb.c | 12 + drivers/usb/storage/usual-tables.c | 15 + fs/nilfs2/ioctl.c | 5 +- fs/splice.c | 4 +- include/linux/sched.h | 11 +- kernel/ptrace.c | 72 ++++- kernel/resource.c | 50 ++- kernel/sched.c | 3 +- kernel/sched_rt.c | 2 +- kernel/signal.c | 19 +- net/bluetooth/hci_event.c | 2 +- net/bluetooth/smp.c | 13 + net/bridge/br_netfilter.c | 3 + net/core/pktgen.c | 9 +- net/ipv4/ip_sockglue.c | 2 +- net/ipv4/tcp_input.c | 5 + net/ipv6/addrconf.c | 2 +- net/ipv6/ip6_output.c | 4 +- net/ipv6/route.c | 3 +- net/packet/af_packet.c | 10 +- net/sctp/endpointola.c | 5 + net/sctp/outqueue.c | 12 +- net/sctp/socket.c | 2 +- 65 files changed, 650 insertions(+), 606 deletions(-)
Signature · 2 lines
Ben Hutchings Experience is what causes a person to make new mistakes instead of old ones.
PATCH 1/66 drm/i915: Fix misplaced intel_mark_page_flip_active()
3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
In commit 28c4566d30b8, backport of commit e7d841ca03b7 ('drm/i915:
Close race between processing unpin task and queueing the flip') I somehow added two calls to intel_mark_page_flip_active() from intel_gen4_queue_flip() and none from intel_gen6_queue_flip(). There should of course be one from each.
---
drivers/gpu/drm/i915/intel_display.c +2 -2
@@ -7156,8 +7156,6 @@ static int intel_gen4_queue_flip(structOUT_RING (pf | pipesrc);intel_mark_page_flip_active (intel_crtc); - -intel_mark_page_flip_active (intel_crtc);ADVANCE_LP_RING ();return 0 ;
@@ -7193,6 +7191,8 @@ static int intel_gen6_queue_flip(struct pf =I915_READ (PF_CTL (intel_crtc->pipe)) &PF_ENABLE ; pipesrc =I915_READ (PIPESRC (intel_crtc->pipe)) &0x0fff0fff ;OUT_RING (pf | pipesrc); + +intel_mark_page_flip_active (intel_crtc);ADVANCE_LP_RING ();return 0 ;
PATCH 2/66 xhci: Fix isoc TD encoding.
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarah Sharp <[email protected]>
commit 760973d2a74b93eb1697981f7448f0e62767cfc4 upstream.
An isochronous TD is comprised of one isochronous TRB chained to zero or more normal TRBs. Only the isoc TRB has the TBC and TLBPC fields. The normal TRBs must set those fields to zeroes. The code was setting the TBC and TLBPC fields for both isoc and normal TRBs. Fix this.
This should be backported to stable kernels as old as 3.0, that contain the commit b61d378f2da41c748aba6ca19d77e1e1c02bcea5 " xhci 1.0: Set transfer burst last packet count field."
--- drivers/usb/host/xhci-ring.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-ring.c +3 -1
@@ -3664,9 +3664,11 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, td = urb_priv->td[i];for (j =0 ; j < trbs_per_td; j++) {u32 remainder =0 ; - field =TRB_TBC (burst_count) |TRB_TLBPC (residue); + field =0 ;if (first_trb) { + field =TRB_TBC (burst_count) | +TRB_TLBPC (residue);/* Queue the isoc TRB */ field |=TRB_TYPE (TRB_ISOC );/* Assume URB_ISO_ASAP is set */
PATCH 3/66 xhci: Fix TD size for isochronous URBs.
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarah Sharp <[email protected]>
commit f18f8ed2a9adc41c2d9294b85b6af115829d2af1 upstream.
To calculate the TD size for a particular TRB in an isoc TD, we need know the endpoint's max packet size. Isochronous endpoints also encode the number of additional service opportunities in their wMaxPacketSize field. The TD size calculation did not mask off those bits before using the field. This resulted in incorrect TD size information for isochronous TRBs when an URB frame buffer crossed a 64KB boundary.
For example:
- an isoc endpoint has 2 additional service opportunites and a max packet size of 1020 bytes
- a frame transfer buffer contains 3060 bytes
- one frame buffer crosses a 64KB boundary, and must be split into one 1276 byte TRB, and one 1784 byte TRB.
The TD size is is the number of packets that remain to be transferred for a TD after processing all the max packet sized packets in the current TRB and all previous TRBs.
For this TD, the number of packets to be transferred is (3060 / 1020), or 3. The first TRB contains 1276 bytes, which means it contains one full packet, and a 256 byte remainder. After processing all the max packet-sized packets in the first TRB, the host will have 2 packets left to transfer.
The old code would calculate the TD size for the first TRB as:
total packet count = DIV_ROUND_UP (TD length / endpoint wMaxPacketSize) total packet count - (first TRB length / endpoint wMaxPacketSize)
The math should have been:
total packet count = DIV_ROUND_UP (3060 / 1020) = 3 3 - (1276 / 1020) = 2
Since the old code didn't mask off the additional service interval bits from the wMaxPacketSize field, the math ended up as
total packet count = DIV_ROUND_UP (3060 / 5116) = 1 1 - (1276 / 5116) = 1
Fix this by masking off the number of additional service opportunities in the wMaxPacketSize field.
This patch should be backported to stable kernels as old as 3.0, that contain the commit 4da6e6f247a2601ab9f1e63424e4d944ed4124f3 "xhci 1.0:
Update TD size field format." It may not apply well to kernels older than 3.2 because of commit 29cc88979a8818cd8c5019426e945aed118b400e "USB: use usb_endpoint_maxp() instead of le16_to_cpu()".
--- drivers/usb/host/xhci-ring.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/host/xhci-ring.c +3 -2
@@ -3108,7 +3108,7 @@ static u32 xhci_v1_0_td_remainder(int running_total, int trb_buff_len,* running_total. */ packets_transferred = (running_total + trb_buff_len) / -usb_endpoint_maxp (&urb->ep->desc); +GET_MAX_PACKET (usb_endpoint_maxp (&urb->ep->desc));if ((total_packet_count - packets_transferred) >31 )return 31 <<17 ;
@@ -3642,7 +3642,8 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, td_len = urb->iso_frame_desc[i].length; td_remain_len = td_len; total_packet_count =DIV_ROUND_UP (td_len, -usb_endpoint_maxp (&urb->ep->desc)); +GET_MAX_PACKET ( +usb_endpoint_maxp (&urb->ep->desc)));/* A zero-length transfer still involves at least one packet. */ if (total_packet_count ==0 ) total_packet_count++;
PATCH 4/66 USB: XHCI: fix memory leak of URB-private data
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 48c3375c5f69b1c2ef3d1051a0009cb9bce0ce24 upstream.
This patch (as1640) fixes a memory leak in xhci-hcd. The urb_priv data structure isn't always deallocated in the handle_tx_event() routine for non-control transfers. The patch adds a kfree() call so that all paths end up freeing the memory properly.
This patch should be backported to kernels as old as 2.6.36, that contain the commit 8e51adccd4c4b9ffcd509d7f2afce0a906139f75 "USB: xHCI:
Introduce urb_priv structure"
--- drivers/usb/host/xhci-ring.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/host/xhci-ring.c +2 -0
@@ -2589,6 +2589,8 @@ cleanup: (trb_comp_code != COMP_STALL && trb_comp_code != COMP_BABBLE))xhci_urb_free_priv (xhci, urb_priv); + else +kfree (urb_priv );usb_hcd_unlink_urb_from_ep (bus_to_hcd (urb->dev->bus), urb); if ((urb->actual_length != urb->transfer_buffer_length &&
PATCH 5/66 usb: Prevent dead ports when xhci is not enabled
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Moore <[email protected]>
commit 58b2939b4d5a030eaec469d29812ab8477ee7e76 upstream.
When the xHCI driver is not available, actively switch the ports to EHCI mode since some BIOSes leave them in xHCI mode where they would otherwise appear dead. This was discovered on a Dell Optiplex 7010, but it's possible other systems could be affected.
This should be backported to kernels as old as 3.0, that contain the commit 69e848c2090aebba5698a1620604c7dccb448684 "Intel xhci: Support EHCI/xHCI port switching."
--- drivers/usb/host/pci-quirks.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/host/pci-quirks.c +1 -0
@@ -780,6 +780,7 @@ void usb_enable_xhci_ports(struct pci_dev *xhci_pdev) "defaulting to EHCI.\n");dev_warn (&xhci_pdev->dev,"USB 3.0 devices will work at USB 2.0 speeds.\n" ); +usb_disable_xhci_ports (xhci_pdev);return ; }
PATCH 6/66 sched/rt: Use root_domain of rt_rq not current processor
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shawn Bohrer <[email protected]>
commit aa7f67304d1a03180f463258aa6f15a8b434e77d upstream.
When the system has multiple domains do_sched_rt_period_timer() can run on any CPU and may iterate over all rt_rq in cpu_online_mask. This means when balance_runtime() is run for a given rt_rq that rt_rq may be in a different rd than the current processor. Thus if we use smp_processor_id() to get rd in do_balance_runtime() we may borrow runtime from a rt_rq that is not part of our rd.
This changes do_balance_runtime to get the rd from the passed in rt_rq ensuring that we borrow runtime only from the correct rd for the given rt_rq.
This fixes a BUG at kernel/sched/rt.c:687! in __disable_runtime when we try reclaim runtime lent to other rt_rq but runtime has been lent to a rt_rq in another rd.
--- kernel/sched_rt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched_rt.c +1 -1
@@ -384,7 +384,7 @@ static inline struct rt_bandwidth *schedstatic int do_balance_runtime (struct rt_rq *rt_rq) {struct rt_bandwidth *rt_b =sched_rt_bandwidth (rt_rq); -struct root_domain *rd =cpu_rq (smp_processor_id ())->rd; +struct root_domain *rd =rq_of_rt_rq (rt_rq)->rd;int i, weight, more =0 ;u64 rt_period;
PATCH 7/66 rtlwifi: Fix the usage of the wrong variable in usb.c
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <[email protected]>
commit 0a06ad8e3a1cb5311b7dbafde45410aa1bce9d40 upstream.
In routine _rtl_rx_pre_process(), skb_dequeue() is called to get an skb; however, the wrong variable name is used in subsequent calls.
--- drivers/net/wireless/rtlwifi/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/rtlwifi/usb.c +2 -2
@@ -542,8 +542,8 @@ static void _rtl_rx_pre_process(struct ieee80211_hw *hw, struct sk_buff *skb)WARN_ON (skb_queue_empty (&rx_queue));while (!skb_queue_empty (&rx_queue)) { _skb =skb_dequeue (&rx_queue); -_rtl_usb_rx_process_agg (hw, skb); -ieee80211_rx_irqsafe (hw, skb); +_rtl_usb_rx_process_agg (hw, _skb); +ieee80211_rx_irqsafe (hw, _skb); } }
PATCH 8/66 drm/radeon: add quirk for RV100 board
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit 9200ee4941a6e5d1ec5df88982243686882dff3f upstream.
vbios says external TMDS while the board is actually internal TMDS.
fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=60037
--- drivers/gpu/drm/radeon/radeon_combios.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/radeon/radeon_combios.c +8 -0
@@ -2470,6 +2470,14 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) 1), ATOM_DEVICE_CRT1_SUPPORT); } +/* RV100 board with external TDMS bit mis-set. +* Actually uses internal TMDS, clear the bit. +*/ +if (dev->pdev->device ==0x5159 && + dev->pdev->subsystem_vendor ==0x1014 && + dev->pdev->subsystem_device ==0x029A ) { + tmp &= ~(1 <<4 ); + }if ((tmp >>4 ) &0x1 ) { devices |=ATOM_DEVICE_DFP2_SUPPORT ; radeon_add_legacy_encoder(dev,
PATCH 9/66 USB: qcserial: add Telit Gobi QDL device
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniele Palmas <[email protected]>
commit 78796ae17eacedcdcaaeb03ba73d2e532a4c8f83 upstream.
Add VID and PID for Telit Gobi QDL device
--- drivers/usb/serial/qcserial.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/qcserial.c +1 -0
@@ -53,6 +53,7 @@ static const struct usb_device_id id_table[] = { {DEVICE_G1K(0x05c6, 0x9221)}, /* Generic Gobi QDL device */ {DEVICE_G1K(0x05c6, 0x9231)}, /* Generic Gobi QDL device */ {DEVICE_G1K(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ + {DEVICE_G1K(0x1bc7, 0x900e)}, /* Telit Gobi QDL device *//* Gobi 2000 devices */ {USB_DEVICE(0x1410, 0xa010)}, /* Novatel Gobi 2000 QDL device */
PATCH 10/66 USB: option: add support for Telit LE920
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniele Palmas <[email protected]>
commit 03eb466f276ceef9dcf023dc5474db02af68aad9 upstream.
Add PID and special handling for Telit LE920
--- drivers/usb/serial/option.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/usb/serial/option.c +8 -0
@@ -242,6 +242,7 @@ static void option_instat_callback(struct urb *urb);#define TELIT_PRODUCT_CC864_DUAL 0x1005#define TELIT_PRODUCT_CC864_SINGLE 0x1006#define TELIT_PRODUCT_DE910_DUAL 0x1010 +#define TELIT_PRODUCT_LE920 0x1200/* ZTE PRODUCTS */ #define ZTE_VENDOR_ID 0x19d2
@@ -534,6 +535,11 @@ static const struct option_blacklist_info zte_1255_blacklist = { .reserved = BIT(3) | BIT(4), }; +static const struct option_blacklist_info telit_le920_blacklist = { + .sendsetup =BIT (0 ), + .reserved =BIT (1 ) |BIT (5 ), +}; +static const struct usb_device_id option_ids[] = { {USB_DEVICE (OPTION_VENDOR_ID ,OPTION_PRODUCT_COLT ) }, {USB_DEVICE (OPTION_VENDOR_ID ,OPTION_PRODUCT_RICOLA ) },
@@ -784,6 +790,8 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_DUAL) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920), + .driver_info = (kernel_ulong_t)&telit_le920_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
PATCH 11/66 mwifiex: fix incomplete scan in case of IE parsing error
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bing Zhao <[email protected]>
commit 8a7d7cbf7b5ff9912ef50b3e94c9ad9f37b1c75f upstream.
A scan request is split into multiple scan commands queued in scan_pending_q. Each scan command will be sent to firmware and its response is handlded one after another.
If any error is detected while parsing IE in command response buffer the remaining data will be ignored and error is returned.
We should check if there is any more scan commands pending in the queue before returning error. This ensures that we will call cfg80211_scan_done if this is the last scan command, or send next scan command in scan_pending_q to firmware.
--- drivers/net/wireless/mwifiex/scan.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/mwifiex/scan.c +5 -4
@@ -1594,7 +1594,7 @@ int mwifiex_ret_802_11_scan(struct mwifidev_err (adapter->dev,"SCAN_RESP: too many AP returned (%d)\n" , scan_rsp->number_of_sets); ret =-1 ; - goto done; + goto check_next_scan; } bytes_left =le16_to_cpu (scan_rsp->bss_descript_size);
@@ -1663,7 +1663,8 @@ int mwifiex_ret_802_11_scan(struct mwifiif (!beacon_size || beacon_size > bytes_left) { bss_info += bytes_left; bytes_left =0 ; -return -1 ; + ret =-1 ; + goto check_next_scan; }/* Initialize the current working beacon pointer for this BSS
@@ -1716,7 +1717,7 @@ int mwifiex_ret_802_11_scan(struct mwifidev_err (priv->adapter->dev,"%s: in processing" " IE, bytes left < IE length\n" , __func__); - goto done; + goto check_next_scan; }if (element_id ==WLAN_EID_DS_PARAMS ) { channel = *(u8 *) (current_ptr +
@@ -1782,6 +1783,7 @@ int mwifiex_ret_802_11_scan(struct mwifi } } +check_next_scan:spin_lock_irqsave (&adapter->scan_pending_q_lock, flags);if (list_empty (&adapter->scan_pending_q)) {spin_unlock_irqrestore (&adapter->scan_pending_q_lock, flags);
@@ -1812,7 +1814,6 @@ int mwifiex_ret_802_11_scan(struct mwifimwifiex_insert_cmd_to_pending_q (adapter, cmd_node, true); } -done:return ret; }
PATCH 12/66 USB: EHCI: fix bug in scheduling periodic split transfers
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 3e619d04159be54b3daa0b7036b0ce9e067f4b5d upstream.
This patch (as1654) fixes a very old bug in ehci-hcd, connected with scheduling of periodic split transfers. The calculations for full/low-speed bus usage are all carried out after the correction for bit-stuffing has been applied, but the values in the max_tt_usecs array assume it hasn't been. The array should allow for allocation of up to 90% of the bus capacity, which is 900 us, not 780 us.
The symptom caused by this bug is that any isochronous transfer to a full-speed device with a maxpacket size larger than about 980 bytes is always rejected with a -ENOSPC error.
--- drivers/usb/host/ehci-sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ehci-sched.c +1 -1
@@ -213,7 +213,7 @@ static inline unsigned char tt_start_uframe(struct ehci_hcd *ehci, __hc32 mask) }static const unsigned char -max_tt_usecs[] = {125 ,125 ,125 ,125 ,125 ,125 ,30 ,0 }; +max_tt_usecs[] = {125 ,125 ,125 ,125 ,125 ,125 ,125 ,25 };/* carryover low/fullspeed bandwidth that crosses uframe boundries */ static inline void carryover_tt_bandwidth (unsigned short tt_usecs[8 ])
PATCH 13/66 x86-64: Replace left over sti/cli in ia32 audit exit code
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Beulich <[email protected]>
commit 40a1ef95da85843696fc3ebe5fce39b0db32669f upstream.
For some reason they didn't get replaced so far by their paravirt equivalents, resulting in code to be run with interrupts disabled that doesn't expect so (causing, in the observed case, a BUG_ON() to trigger) when syscall auditing is enabled.
David (Cc-ed) came up with an identical fix, so likely this can be taken to count as an ack from him.
--- arch/x86/ia32/ia32entry.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/ia32/ia32entry.S +2 -2
@@ -208,7 +208,7 @@ sysexit_from_sys_call: testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) jnz ia32_ret_from_sys_call TRACE_IRQS_ON - sti + ENABLE_INTERRUPTS(CLBR_NONE) movl %eax,%esi /* second arg, syscall return value */ cmpl $0,%eax /* is it < 0? */ setl %al /* 1 if so, 0 if not */
@@ -218,7 +218,7 @@ sysexit_from_sys_call: GET_THREAD_INFO(%r10) movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */ movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi - cli + DISABLE_INTERRUPTS(CLBR_NONE) TRACE_IRQS_OFF testl %edi,TI_flags(%r10) jz \exit
PATCH 14/66 Bluetooth: Fix handling of unexpected SMP PDUs
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hedberg <[email protected]>
commit 8cf9fa1240229cbdd888236c0c43fcbad680cf00 upstream.
The conn->smp_chan pointer can be NULL if SMP PDUs arrive at unexpected moments. To avoid NULL pointer dereferences the code should be checking for this and disconnect if an unexpected SMP PDU arrives. This patch fixes the issue by adding a check for conn->smp_chan for all other PDUs except pairing request and security request (which are are the first PDUs to come to initialize the SMP context).
--- net/bluetooth/smp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
net/bluetooth/smp.c +13 -0
@@ -859,6 +859,19 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)skb_pull (skb,sizeof (code)); +/* +* The SMP context must be initialized for all other PDUs except +* pairing and security requests. If we get any other PDU when +* not initialized simply disconnect (done if this function +* returns an error). +*/ +if (code !=SMP_CMD_PAIRING_REQ && code !=SMP_CMD_SECURITY_REQ && + !conn->smp_chan) { +BT_ERR ("Unexpected SMP command 0x%02x. Disconnecting." , code); +kfree_skb (skb); +return -ENOTSUPP ; + } +switch (code) {case SMP_CMD_PAIRING_REQ : reason =smp_cmd_pairing_req (conn, skb);
PATCH 15/66 drm/radeon: Calling object_unrefer() when creating fb failure
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: liu chuansheng <[email protected]>
commit f2d68cf4daa4de97d400d94836b907e35228e54f upstream.
When kzalloc() failed in radeon_user_framebuffer_create(), need to call object_unreference() to match the object_reference().
--- drivers/gpu/drm/radeon/radeon_display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_display.c +3 -1
@@ -1110,8 +1110,10 @@ radeon_user_framebuffer_create(struct dr } radeon_fb =kzalloc (sizeof (*radeon_fb),GFP_KERNEL ); -if (radeon_fb ==NULL ) +if (radeon_fb ==NULL ) { +drm_gem_object_unreference_unlocked (obj);return ERR_PTR (-ENOMEM ); + }radeon_framebuffer_init (dev, radeon_fb, mode_cmd, obj);
PATCH 16/66 drm/radeon: prevent crash in the ring space allocation
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit fd5d93a0015ce1a7db881382022b2fcdfdc61760 upstream.
If the requested number of DWs on the ring is larger than the size of the ring itself, return an error.
In testing with large VM updates, we've seen crashes when we try and allocate more space on the ring than the total size of the ring without checking.
This prevents the crash but for large VM updates or bo moves of very large buffers, we will need to break the transaction down into multiple batches. I have patches to use IBs for the next kernel.
--- drivers/gpu/drm/radeon/radeon_ring.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/radeon/radeon_ring.c +3 -0
@@ -306,6 +306,9 @@ int radeon_ring_alloc(struct radeon_devi {int r; +/* make sure we aren't trying to allocate more space than there is on the ring */ +if (ndw > (rdev->cp.ring_size /4 )) +return -ENOMEM ;/* Align requested size with padding so unlock_commit can * pad safely */ ndw = (ndw + rdev->cp.align_mask) & ~rdev->cp.align_mask;
PATCH 17/66 can: c_can: Set reserved bit in IFx_MASK2 to 1 on write
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <[email protected]>
commit 2bd3bc4e8472424f1a6009825397639a8968920a upstream.
According to C_CAN documentation, the reserved bit in IFx_MASK2 register is fixed 1.
--- drivers/net/can/c_can/c_can.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/can/c_can/c_can.c +5 -1
@@ -446,8 +446,12 @@ static void c_can_setup_receive_object(s priv->write_reg (priv, &priv->regs->ifregs[iface].mask1,IFX_WRITE_LOW_16BIT (mask)); + +/* According to C_CAN documentation, the reserved bit +* in IFx_MASK2 register is fixed 1 +*/ priv->write_reg (priv, &priv->regs->ifregs[iface].mask2, -IFX_WRITE_HIGH_16BIT (mask)); +IFX_WRITE_HIGH_16BIT (mask) |BIT (13 )); priv->write_reg (priv, &priv->regs->ifregs[iface].arb1,IFX_WRITE_LOW_16BIT (id));
PATCH 18/66 USB: ftdi_sio: add PID/VID entries for ELV WS 300 PC II
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sven Killig <[email protected]>
commit c249f911406efcc7456cb4af79396726bf7b8c57 upstream.
Add PID/VID entries for ELV WS 300 PC II weather station
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -584,6 +584,7 @@ static struct usb_device_id id_table_combined [] = {/* * ELV devices: */ + { USB_DEVICE(FTDI_ELV_VID, FTDI_ELV_WS300_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) },
drivers/usb/serial/ftdi_sio_ids.h +3 -1
@@ -204,7 +204,7 @@/* * ELV USB devices submitted by Christian Abt of ELV (www.elv.de). -* All of these devices use FTDI's vendor ID (0x0403). +* Almost all of these devices use FTDI's vendor ID (0x0403). * Further IDs taken from ELV Windows .inf file. * * The previously included PID for the UO 100 module was incorrect.
@@ -212,6 +212,8 @@* * Armin Laeuger originally sent the PID for the UM 100 module. */ +#define FTDI_ELV_VID 0x1B1F/* ELV AG */ +#define FTDI_ELV_WS300_PID 0xC006/* eQ3 WS 300 PC II */ #define FTDI_ELV_USR_PID 0xE000/* ELV Universal-Sound-Recorder */ #define FTDI_ELV_MSM1_PID 0xE001/* ELV Mini-Sound-Modul */ #define FTDI_ELV_KL100_PID 0xE002/* ELV Kfz-Leistungsmesser KL 100 */
PATCH 19/66 USB: option: add Changhong CH690
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjørn Mork <[email protected]>
commit d4fa681541aa7bf8570d03426dd7ba663a71c467 upstream.
New device with 3 serial interfaces:
If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend) Sub=ff Prot=ff If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend) Sub=ff Prot=ff If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend) Sub=ff Prot=ff If#= 3 Alt= 0 #EPs= 2 Cls=08(stor) Sub=06 Prot=50
--- drivers/usb/serial/option.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/serial/option.c +5 -0
@@ -454,6 +454,10 @@ static void option_instat_callback(struct urb *urb);#define TPLINK_VENDOR_ID 0x2357#define TPLINK_PRODUCT_MA180 0x0201 +/* Changhong products */ +#define CHANGHONG_VENDOR_ID 0x2077 +#define CHANGHONG_PRODUCT_CH690 0x7001 +/* some devices interfaces need special handling due to a number of reasons */ enum option_blacklist_reason {OPTION_BLACKLIST_NONE =0 ,
@@ -1326,6 +1330,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) }, { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, + { USB_DEVICE(CHANGHONG_VENDOR_ID, CHANGHONG_PRODUCT_CH690) }, { } /* Terminating entry */ };MODULE_DEVICE_TABLE (usb, option_ids);
PATCH 20/66 USB: ftdi_sio: add Zolix FTDI PID
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Petr Kubánek <[email protected]>
commit 0ba3b2ccc72b3df5c305d61f59d93ab0f0e87991 upstream.
Add support for Zolix Omni 1509 monochromator custom USB-RS232 converter.
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 5 +++++ 2 files changed, 6 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -671,6 +671,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) }, { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) }, { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) },
drivers/usb/serial/ftdi_sio_ids.h +5 -0
@@ -147,6 +147,11 @@#define XSENS_CONVERTER_6_PID 0xD38E#define XSENS_CONVERTER_7_PID 0xD38F +/** +* Zolix (www.zolix.com.cb) product ids +*/ +#define FTDI_OMNI1509 0xD491/* Omni1509 embedded USB-serial */ +/* * NDI (www.ndigital.com) product ids */
PATCH 21/66 USB: storage: Define a new macro for USB storage match rules
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: fangxiaozhi <[email protected]>
commit 07c7be3d87e5cdaf5f94c271c516456364ef286c upstream.
1. Define a new macro for USB storage match rules:
matching with Vendor ID and interface descriptors.
--- drivers/usb/storage/usb.c | 12 ++++++++++++ drivers/usb/storage/usual-tables.c | 15 +++++++++++++++ 2 files changed, 27 insertions(+)
drivers/usb/storage/usb.c +12 -0
@@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental l .useTransport = use_transport, \ } +#define UNUSUAL_VENDOR_INTF (idVendor, cl, sc, pr, \ + vendor_name, product_name, use_protocol, use_transport, \ + init_function, Flags) \ +{ \ + .vendorName = vendor_name, \ + .productName = product_name, \ + .useProtocol = use_protocol, \ + .useTransport = use_transport, \ + .initFunction = init_function, \ +} +static struct us_unusual_dev us_unusual_dev_list[] = { # include "unusual_devs.h" { }/* Terminating entry */
@@ -128,6 +139,7 @@ static struct us_unusual_dev us_unusual_#undef UNUSUAL_DEV#undef COMPLIANT_DEV#undef USUAL_DEV +#undef UNUSUAL_VENDOR_INTF#ifdef CONFIG_PM /* Minimal support for suspend and resume */
drivers/usb/storage/usual-tables.c +15 -0
@@ -46,6 +46,20 @@ { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \ .driver_info = ((useType)<<24) } +/* Define the device is matched with Vendor ID and interface descriptors */ +#define UNUSUAL_VENDOR_INTF (id_vendor, cl, sc, pr, \ + vendorName, productName, useProtocol, useTransport, \ + initFunction, flags) \ +{ \ + .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ + | USB_DEVICE_ID_MATCH_VENDOR, \ + .idVendor = (id_vendor), \ + .bInterfaceClass = (cl), \ + .bInterfaceSubClass = (sc), \ + .bInterfaceProtocol = (pr), \ + .driver_info = (flags) \ +} +struct usb_device_id usb_storage_usb_ids[] = { # include "unusual_devs.h" { }/* Terminating entry */
@@ -57,6 +71,7 @@ MODULE_DEVICE_TABLE(usb, usb_storage_usb#undef UNUSUAL_DEV#undef COMPLIANT_DEV#undef USUAL_DEV +#undef UNUSUAL_VENDOR_INTF/*
PATCH 22/66 USB: storage: optimize to match the Huawei USB storage devices and support new switch command
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: fangxiaozhi <[email protected]>
commit 200e0d994d9d1919b28c87f1a5fb99a8e13b8a0f upstream.
1. Optimize the match rules with new macro for Huawei USB storage devices, to avoid to load USB storage driver for the modem interface with Huawei devices.
2. Add to support new switch command for new Huawei USB dongles.
--- drivers/usb/storage/initializers.c | 76 ++++++++- drivers/usb/storage/initializers.h | 4 +- drivers/usb/storage/unusual_devs.h | 329 +----------------------------------- 3 files changed, 78 insertions(+), 331 deletions(-)
drivers/usb/storage/initializers.c +74 -2
@@ -92,8 +92,8 @@ int usb_stor_ucr61s2b_init(struct us_data *us)return 0 ; } -/* This places the HUAWEI E220 devices in multi-port mode */ -int usb_stor_huawei_e220_init (struct us_data *us) +/* This places the HUAWEI usb dongles in multi-port mode */ +static int usb_stor_huawei_feature_init (struct us_data *us) {int result;
@@ -104,3 +104,75 @@ int usb_stor_huawei_e220_init(struct us_data *us)US_DEBUGP ("Huawei mode set result is %d\n" , result);return 0 ; } + +/* +* It will send a scsi switch command called rewind' to huawei dongle. +* When the dongle receives this command at the first time, +* it will reboot immediately. After rebooted, it will ignore this command. +* So it is unnecessary to read its response. +*/ +static int usb_stor_huawei_scsi_init (struct us_data *us) +{ +int result =0 ; +int act_len =0 ; +struct bulk_cb_wrap *bcbw = (struct bulk_cb_wrap *) us->iobuf; +char rewind_cmd[] = {0x11 ,0x06 ,0x20 ,0x00 ,0x00 ,0x01 ,0x01 ,0x00 , +0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 }; + + bcbw->Signature =cpu_to_le32 (US_BULK_CB_SIGN ); + bcbw->Tag =0 ; + bcbw->DataTransferLength =0 ; + bcbw->Flags = bcbw->Lun =0 ; + bcbw->Length =sizeof (rewind_cmd); +memset (bcbw->CDB,0 ,sizeof (bcbw->CDB)); +memcpy (bcbw->CDB, rewind_cmd,sizeof (rewind_cmd)); + + result =usb_stor_bulk_transfer_buf (us, us->send_bulk_pipe, bcbw, +US_BULK_CB_WRAP_LEN , &act_len); +US_DEBUGP ("transfer actual length=%d, result=%d\n" , act_len, result); +return result; +} + +/* +* It tries to find the supported Huawei USB dongles. +* In Huawei, they assign the following product IDs +* for all of their mobile broadband dongles, +* including the new dongles in the future. +* So if the product ID is not included in this list, +* it means it is not Huawei's mobile broadband dongles. +*/ +static int usb_stor_huawei_dongles_pid (struct us_data *us) +{ +struct usb_interface_descriptor *idesc; +int idProduct; + + idesc = &us->pusb_intf->cur_altsetting->desc; + idProduct = us->pusb_dev->descriptor.idProduct; +/* The first port is CDROM, +* means the dongle in the single port mode, +* and a switch command is required to be sent. */ +if (idesc && idesc->bInterfaceNumber ==0 ) { +if ((idProduct ==0x1001 ) + || (idProduct ==0x1003 ) + || (idProduct ==0x1004 ) + || (idProduct >=0x1401 && idProduct <=0x1500 ) + || (idProduct >=0x1505 && idProduct <=0x1600 ) + || (idProduct >=0x1c02 && idProduct <=0x2202 )) { +return 1 ; + } + } +return 0 ; +} + +int usb_stor_huawei_init (struct us_data *us) +{ +int result =0 ; + +if (usb_stor_huawei_dongles_pid (us)) { +if (us->pusb_dev->descriptor.idProduct >=0x1446 ) + result =usb_stor_huawei_scsi_init (us); +else + result =usb_stor_huawei_feature_init (us); + } +return result; +}
drivers/usb/storage/initializers.h +2 -2
@@ -46,5 +46,5 @@ int usb_stor_euscsi_init(struct us_data *us);* flash reader */ int usb_stor_ucr61s2b_init (struct us_data *us); -/* This places the HUAWEI E220 devices in multi-port mode */ -int usb_stor_huawei_e220_init (struct us_data *us); +/* This places the HUAWEI usb dongles in multi-port mode */ +int usb_stor_huawei_init (struct us_data *us);
drivers/usb/storage/unusual_devs.h +2 -327
337 lines not on this page · raw message
PATCH 23/66 nilfs2: fix fix very long mount time issue
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vyacheslav Dubeyko <[email protected]>
commit a9bae189542e71f91e61a4428adf6e5a7dfe8063 upstream.
There exists a situation when GC can work in background alone without any other filesystem activity during significant time.
The nilfs_clean_segments() method calls nilfs_segctor_construct() that updates superblocks in the case of NILFS_SC_SUPER_ROOT and THE_NILFS_DISCONTINUED flags are set. But when GC is working alone the nilfs_clean_segments() is called with unset THE_NILFS_DISCONTINUED flag. As a result, the update of superblocks doesn't occurred all this time and in the case of SPOR superblocks keep very old values of last super root placement.
SYMPTOMS:
Trying to mount a NILFS2 volume after SPOR in such environment ends with very long mounting time (it can achieve about several hours in some cases).
REPRODUCING PATH:
1. It needs to use external USB HDD, disable automount and doesn't make any additional filesystem activity on the NILFS2 volume.
2. Generate temporary file with size about 100 - 500 GB (for example, dd if=/dev/zero of=<file_name> bs=1073741824 count=200). The size of file defines duration of GC working.
3. Then it needs to delete file.
4. Start GC manually by means of command "nilfs-clean -p 0". When you start GC by means of such way then, at the end, superblocks is updated by once. So, for simulation of SPOR, it needs to wait sometime (15 - 40 minutes) and simply switch off USB HDD manually.
5. Switch on USB HDD again and try to mount NILFS2 volume. As a result, NILFS2 volume will mount during very long time.
REPRODUCIBILITY: 100%
FIX:
This patch adds checking that superblocks need to update and set THE_NILFS_DISCONTINUED flag before nilfs_clean_segments() call.
--- fs/nilfs2/ioctl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/nilfs2/ioctl.c +4 -1
@@ -664,8 +664,11 @@ static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp,if (ret <0 )printk (KERN_ERR "NILFS: GC failed during preparation: " "cannot read source blocks: err=%d\n" , ret); -else +else { +if (nilfs_sb_need_update (nilfs)) +set_nilfs_discontinued (nilfs); ret =nilfs_clean_segments (inode->i_sb, argv, kbufs); + }nilfs_remove_all_gcinodes (nilfs);clear_nilfs_gc_running (nilfs);
PATCH 24/66 drivers/rtc/rtc-isl1208.c: call rtc_update_irq() from the alarm irq handler
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Luebbe <[email protected]>
commit 72fca4a4b32dc778b5b885c3498700e42b610d49 upstream.
Previously the alarm event was not propagated into the RTC subsystem. By adding a call to rtc_update_irq, this fixes a timeout problem with the hwclock utility.
--- drivers/rtc/rtc-isl1208.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/rtc/rtc-isl1208.c +3 -0
@@ -506,6 +506,7 @@ isl1208_rtc_interrupt(int irq, void *data) {unsigned long timeout = jiffies +msecs_to_jiffies (1000 );struct i2c_client *client = data; +struct rtc_device *rtc =i2c_get_clientdata (client);int handled =0 , sr, err;/*
@@ -528,6 +529,8 @@ isl1208_rtc_interrupt(int irq, void *data)if (sr &ISL1208_REG_SR_ALM ) {dev_dbg (&client->dev,"alarm!\n" ); +rtc_update_irq (rtc,1 ,RTC_IRQF |RTC_AF ); +/* Clear the alarm */ sr &= ~ISL1208_REG_SR_ALM ; sr =i2c_smbus_write_byte_data (client,ISL1208_REG_SR , sr);
PATCH 25/66 drivers/rtc/rtc-pl031.c: fix the missing operation on enable
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haojian Zhuang <[email protected]>
commit e7e034e18a0ab6bafb2425c3242cac311164f4d6 upstream.
The RTC control register should be enabled in the process of initializing.
Without this patch, I failed to enable RTC in Hisilicon Hi3620 SoC. The register mapping section in RTC is always read as zero. So I doubt that ST guys may already enable this register in bootloader. So they won't meet this issue.
--- drivers/rtc/rtc-pl031.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/rtc/rtc-pl031.c +5 -3
@@ -44,6 +44,7 @@#define RTC_YMR 0x34/* Year match register */ #define RTC_YLR 0x38/* Year data load register */ +#define RTC_CR_EN (1 << 0)/* counter enable bit */ #define RTC_CR_CWEN (1 << 26)/* Clockwatch enable bit */ #define RTC_TCR_EN (1 << 1)/* Periodic timer enable bit */
@@ -312,7 +313,7 @@ static int pl031_probe(struct amba_devicint ret;struct pl031_local *ldata;struct rtc_class_ops *ops = id->data; -unsigned long time; +unsigned long time, data; ret =amba_request_regions (adev,NULL );if (ret)
@@ -339,10 +340,11 @@ static int pl031_probe(struct amba_devicdev_dbg (&adev->dev,"designer ID = 0x%02x\n" , ldata->hw_designer);dev_dbg (&adev->dev,"revision = 0x%01x\n" , ldata->hw_revision); + data =readl (ldata->base +RTC_CR );/* Enable the clockwatch on ST Variants */ if (ldata->hw_designer ==AMBA_VENDOR_ST ) -writel (readl (ldata->base +RTC_CR ) |RTC_CR_CWEN , - ldata->base +RTC_CR ); + data |=RTC_CR_CWEN ; +writel (data |RTC_CR_EN , ldata->base +RTC_CR );/* * On ST PL031 variants, the RTC reset value does not provide correct
PATCH 26/66 virtio_console: Dont access uninitialized data.
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sjur Brændeland <[email protected]>
commit aded024a12b32fc1ed9a80639681daae2d07ec25 upstream.
Don't access uninitialized work-queue when removing device. The work queue is initialized only if the device multi-queue. So don't call cancel_work unless this is a multi-queue device.
This fixes the following panic:
Kernel panic - not syncing: BUG! Call Trace: 62031b28: [<6026085d>] panic+0x16b/0x2d3 62031b30: [<6004ef5e>] flush_work+0x0/0x1d7 62031b60: [<602606f2>] panic+0x0/0x2d3 62031b68: [<600333b0>] memcpy+0x0/0x140 62031b80: [<6002d58a>] unblock_signals+0x0/0x84 62031ba0: [<602609c5>] printk+0x0/0xa0 62031bd8: [<60264e51>] __mutex_unlock_slowpath+0x13d/0x148 62031c10: [<6004ef5e>] flush_work+0x0/0x1d7 62031c18: [<60050234>] try_to_grab_pending+0x0/0x17e 62031c38: [<6004e984>] get_work_gcwq+0x71/0x8f 62031c48: [<60050539>] __cancel_work_timer+0x5b/0x115 62031c78: [<628acc85>] unplug_port+0x0/0x191 [virtio_console] 62031c98: [<6005061c>] cancel_work_sync+0x12/0x14 62031ca8: [<628ace96>] virtcons_remove+0x80/0x15c [virtio_console] 62031ce8: [<628191de>] virtio_dev_remove+0x1e/0x7e [virtio] 62031d08: [<601cf242>] __device_release_driver+0x75/0xe4 62031d28: [<601cf2dd>] device_release_driver+0x2c/0x40 62031d48: [<601ce0dd>] driver_unbind+0x7d/0xc6 62031d88: [<601cd5d9>] drv_attr_store+0x27/0x29 62031d98: [<60115f61>] sysfs_write_file+0x100/0x14d 62031df8: [<600b737d>] vfs_write+0xcb/0x184 62031e08: [<600b58b8>] filp_close+0x88/0x94 62031e38: [<600b7686>] sys_write+0x59/0x88 62031e88: [<6001ced1>] handle_syscall+0x5d/0x80 62031ea8: [<60030a74>] userspace+0x405/0x531 62031f08: [<600d32cc>] sys_dup+0x0/0x5e 62031f28: [<601b11d6>] strcpy+0x0/0x18 62031f38: [<600be46c>] do_execve+0x10/0x12 62031f48: [<600184c7>] run_init_process+0x43/0x45 62031fd8: [<60019a91>] new_thread_handler+0xba/0xbc
--- drivers/char/virtio_console.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/char/virtio_console.c +2 -1
@@ -2062,7 +2062,8 @@ static void virtcons_remove(struct virtio_device *vdev)/* Disable interrupts for vqs */ vdev->config->reset (vdev);/* Finish up work that's lined up */ -cancel_work_sync (&portdev->control_work); +if (use_multiport (portdev)) +cancel_work_sync (&portdev->control_work);list_for_each_entry_safe (port, port2, &portdev->ports, list)unplug_port (port);
PATCH 27/66 wireless: rt2x00: rt{2500,73}usb.c put back duplicate id
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xose Vazquez Perez <[email protected]>
commit 8f35f787b75e9b6435ea37dabcae2d40dc72d31c upstream.
put back 0x050d,0x7050 to rt73usb, same usb_id for two chips:
K7SF5D7050A ver 2xxx is rt2500
K7SF5D7050B ver 3xxx is rt73
<http://en-us-support.belkin.com/app/answers/detail/a_id/297/kw/K7SF5D7050>
--- drivers/net/wireless/rt2x00/rt2500usb.c | 2 +- drivers/net/wireless/rt2x00/rt73usb.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/rt2x00/rt2500usb.c +1 -1
@@ -1912,7 +1912,7 @@ static struct usb_device_id rt2500usb_device_table[] = { { USB_DEVICE(0x0b05, 0x1706) }, { USB_DEVICE(0x0b05, 0x1707) },/* Belkin */ - { USB_DEVICE(0x050d, 0x7050) }, + { USB_DEVICE(0x050d, 0x7050) }, /* FCC ID: K7SF5D7050A ver. 2.x */ { USB_DEVICE(0x050d, 0x7051) },/* Cisco Systems */ { USB_DEVICE(0x13b1, 0x000d) },
drivers/net/wireless/rt2x00/rt73usb.c +1 -0
@@ -2412,6 +2412,7 @@ static struct usb_device_id rt73usb_device_table[] = { { USB_DEVICE(0x0b05, 0x1723) }, { USB_DEVICE(0x0b05, 0x1724) },/* Belkin */ + { USB_DEVICE(0x050d, 0x7050) }, /* FCC ID: K7SF5D7050B ver. 3.x */ { USB_DEVICE(0x050d, 0x705a) }, { USB_DEVICE(0x050d, 0x905b) }, { USB_DEVICE(0x050d, 0x905c) },
PATCH 28/66 Wireless: rt2x00: Add device id for Sweex LW323 to rt2800usb.c
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jaume Delclòs <[email protected]>
commit 36f318bb124b231c01db6965a009f46d5731f012 upstream.
This patch adds detection for the Sweex LW323 USB wireless network card in the rt2x00 driver (just one line in rt2800usb.c).
It applies to linux-3.7-rc3.
--- drivers/net/wireless/rt2x00/rt2800usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/rt2x00/rt2800usb.c +1 -0
@@ -1096,6 +1096,7 @@ static struct usb_device_id rt2800usb_device_table[] = { { USB_DEVICE(0x177f, 0x0153) }, { USB_DEVICE(0x177f, 0x0302) }, { USB_DEVICE(0x177f, 0x0313) }, + { USB_DEVICE(0x177f, 0x0323) },/* U-Media */ { USB_DEVICE(0x157e, 0x300e) }, { USB_DEVICE(0x157e, 0x3013) },
PATCH 29/66 rt2800usb: Add support for 2001:3c1e (D-Link DWA-125 rev B1) USB Wi-Fi adapter
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maia Kozheva <[email protected]>
commit fd7b9270120ca7e53fbf0469febe0c68acf6a0a2 upstream.
D-Link DWA-125/B1 is a relatively new USB Wi-Fi adapter, using a Ralink chipset supported by the rt2800usb driver. Currently, to work around the problem (it's missing in all present kernel versions, up to and including 3.7.x), I had to add this to /etc/rc.local:
echo 2001 3c1e >> /sys/bus/usb/drivers/rt2800usb/new_id
After that, the device works without problems. Been using it for over a week with no bugs in sight.
The attached patch is trivial and simply adds the new USB ID to the list of devices handled by rt2800usb.
--- drivers/net/wireless/rt2x00/rt2800usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/rt2x00/rt2800usb.c +1 -0
@@ -965,6 +965,7 @@ static struct usb_device_id rt2800usb_device_table[] = { { USB_DEVICE(0x07d1, 0x3c15) }, { USB_DEVICE(0x07d1, 0x3c16) }, { USB_DEVICE(0x2001, 0x3c1b) }, + { USB_DEVICE(0x2001, 0x3c1e) },/* Draytek */ { USB_DEVICE(0x07fa, 0x7712) },/* DVICO */
PATCH 30/66 gspca_kinect: add Kinect for Windows USB id
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Schloss <[email protected]>
commit 98fd485795db064d0885150e2c0c7f296d8fe06e upstream.
Add the USB ID for the Kinect for Windows RGB camera so it can be used with the gspca_kinect driver.
--- drivers/media/usb/gspca/kinect.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/video/gspca/kinect.c +1 -0
@@ -390,6 +390,7 @@ static const struct sd_desc sd_desc = {/* -- module initialisation -- */ static const struct usb_device_id device_table[] = { {USB_DEVICE (0x045e ,0x02ae )}, + {USB_DEVICE (0x045e ,0x02bf )}, {} };
PATCH 31/66 ahci: support the STA2X11 I/O Hub
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alessandro Rubini <[email protected]>
commit 318893e1429a9d50569a0379d1e20b0ecc45c555 upstream.
The AHCI controller found in the STA2X11 chip uses BAR number 0 instead of 5. Also, the chip's fixup code sets a special DMA mask for all of its PCI functions, and the mask must be preserved here.
--- drivers/ata/ahci.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-)
drivers/ata/ahci.c +21 -5
@@ -52,7 +52,8 @@#define DRV_VERSION "3.0"enum { -AHCI_PCI_BAR =5 , +AHCI_PCI_BAR_STA2X11 =0 , +AHCI_PCI_BAR_STANDARD =5 , };enum board_ids {
@@ -375,6 +376,9 @@ static const struct pci_device_id ahci_pci_tbl[] = { { PCI_VDEVICE(SI, 0x1185), board_ahci }, /* SiS 968 */ { PCI_VDEVICE(SI, 0x0186), board_ahci }, /* SiS 968 */ +/* ST Microelectronics */ + { PCI_VDEVICE(STMICRO, 0xCC06), board_ahci }, /* ST ConneXt */ +/* Marvell */ { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */
@@ -622,6 +626,13 @@ static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac) {int rc; +/* +* If the device fixup already set the dma_mask to some non-standard +* value, don't extend it here. This happens on STA2X11, for example. +*/ +if (pdev->dma_mask && pdev->dma_mask <DMA_BIT_MASK (32 )) +return 0 ; +if (using_dac && !pci_set_dma_mask (pdev,DMA_BIT_MASK (64 ))) { rc =pci_set_consistent_dma_mask (pdev,DMA_BIT_MASK (64 ));
@@ -1026,6 +1037,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)struct ahci_host_priv *hpriv;struct ata_host *host;int n_ports, i, rc; +int ahci_pci_bar =AHCI_PCI_BAR_STANDARD ;VPRINTK ("ENTER\n" );
@@ -1057,6 +1069,10 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)dev_info (&pdev->dev,"PDC42819 can only drive SATA devices with this driver\n" ); +/* The Connext uses non-standard BAR */ +if (pdev->vendor ==PCI_VENDOR_ID_STMICRO && pdev->device ==0xCC06 ) + ahci_pci_bar =AHCI_PCI_BAR_STA2X11 ; +/* acquire resources */ rc =pcim_enable_device (pdev);if (rc)
@@ -1065,7 +1081,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)/* AHCI controllers often implement SFF compatible interface. * Grab all PCI BARs just in case. */ - rc =pcim_iomap_regions_request_all (pdev,1 <<AHCI_PCI_BAR ,DRV_NAME ); + rc =pcim_iomap_regions_request_all (pdev,1 << ahci_pci_bar,DRV_NAME );if (rc == -EBUSY )pcim_pin_device (pdev);if (rc)
@@ -1108,7 +1124,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)if ((hpriv->flags &AHCI_HFLAG_NO_MSI ) ||pci_enable_msi (pdev))pci_intx (pdev,1 ); - hpriv->mmio =pcim_iomap_table (pdev)[AHCI_PCI_BAR ]; + hpriv->mmio =pcim_iomap_table (pdev)[ahci_pci_bar];/* save initial config */ ahci_pci_save_initial_config (pdev, hpriv);
@@ -1172,8 +1188,8 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)for (i =0 ; i < host->n_ports; i++) {struct ata_port *ap = host->ports[i]; -ata_port_pbar_desc (ap,AHCI_PCI_BAR ,-1 ,"abar" ); -ata_port_pbar_desc (ap,AHCI_PCI_BAR , +ata_port_pbar_desc (ap, ahci_pci_bar,-1 ,"abar" ); +ata_port_pbar_desc (ap, ahci_pci_bar,0x100 + ap->port_no *0x80 ,"port" );/* set enclosure management message type */
PATCH 32/66 ahci: Add support for Enmotus Bobcat device.
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hugh Daschbach <[email protected]>
commit 7f9c9f8e24590e7dcd26ca408458c43df5b83e61 upstream.
Silicon does not support standard AHCI BAR assignment. Add vendor/device exception to force BAR 2.
--- drivers/ata/ahci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/ata/ahci.c +7 -1
@@ -53,6 +53,7 @@enum {AHCI_PCI_BAR_STA2X11 =0 , +AHCI_PCI_BAR_ENMOTUS =2 ,AHCI_PCI_BAR_STANDARD =5 , };
@@ -410,6 +411,9 @@ static const struct pci_device_id ahci_pci_tbl[] = { { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */ { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */ +/* Enmotus */ + { PCI_DEVICE(0x1c44, 0x8000), board_ahci }, +/* Generic, PCI class code for AHCI */ { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci },
@@ -1098,9 +1102,11 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)dev_info (&pdev->dev,"PDC42819 can only drive SATA devices with this driver\n" ); -/* The Connext uses non-standard BAR */ +/* Both Connext and Enmotus devices use non-standard BARs */ if (pdev->vendor ==PCI_VENDOR_ID_STMICRO && pdev->device ==0xCC06 ) ahci_pci_bar =AHCI_PCI_BAR_STA2X11 ; +else if (pdev->vendor ==0x1c44 && pdev->device ==0x8000 ) + ahci_pci_bar =AHCI_PCI_BAR_ENMOTUS ;/* acquire resources */ rc =pcim_enable_device (pdev);
PATCH 33/66 ptrace/x86: Introduce set_task_blockstep() helper
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit 848e8f5f0ad3169560c516fff6471be65f76e69f upstream.
No functional changes, preparation for the next fix and for uprobes single-step fixes.
Move the code playing with TIF_BLOCKSTEP/DEBUGCTLMSR_BTF into the new helper, set_task_blockstep().
--- arch/x86/kernel/step.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-)
arch/x86/kernel/step.c +21 -20
@@ -157,6 +157,21 @@ static int enable_single_step(struct task_struct *child)return 1 ; } +static void set_task_blockstep (struct task_struct *task,bool on) +{ +unsigned long debugctl; + + debugctl =get_debugctlmsr (); +if (on) { + debugctl |=DEBUGCTLMSR_BTF ; +set_tsk_thread_flag (task,TIF_BLOCKSTEP ); + }else { + debugctl &= ~DEBUGCTLMSR_BTF ; +clear_tsk_thread_flag (task,TIF_BLOCKSTEP ); + } +update_debugctlmsr (debugctl); +} +/* * Enable single or block step. */
@@ -169,19 +184,10 @@ static void enable_step(struct task_struct *child, bool block)* So no one should try to use debugger block stepping in a program * that uses user-mode single stepping itself. */ -if (enable_single_step (child) && block) { -unsigned long debugctl =get_debugctlmsr (); - - debugctl |=DEBUGCTLMSR_BTF ; -update_debugctlmsr (debugctl); -set_tsk_thread_flag (child,TIF_BLOCKSTEP ); - }else if (test_tsk_thread_flag (child,TIF_BLOCKSTEP )) { -unsigned long debugctl =get_debugctlmsr (); - - debugctl &= ~DEBUGCTLMSR_BTF ; -update_debugctlmsr (debugctl); -clear_tsk_thread_flag (child,TIF_BLOCKSTEP ); - } +if (enable_single_step (child) && block) +set_task_blockstep (child, true); +else if (test_tsk_thread_flag (child,TIF_BLOCKSTEP )) +set_task_blockstep (child, false); }void user_enable_single_step (struct task_struct *child)
@@ -199,13 +205,8 @@ void user_disable_single_step(struct task_struct *child)/* * Make sure block stepping (BTF) is disabled. */ -if (test_tsk_thread_flag (child,TIF_BLOCKSTEP )) { -unsigned long debugctl =get_debugctlmsr (); - - debugctl &= ~DEBUGCTLMSR_BTF ; -update_debugctlmsr (debugctl); -clear_tsk_thread_flag (child,TIF_BLOCKSTEP ); - } +if (test_tsk_thread_flag (child,TIF_BLOCKSTEP )) +set_task_blockstep (child, false);/* Always clear TIF_SINGLESTEP... */ clear_tsk_thread_flag (child,TIF_SINGLESTEP );
PATCH 34/66 ptrace/x86: Partly fix set_task_blockstep()->update_debugctlmsr() logic
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit 95cf00fa5d5e2a200a2c044c84bde8389a237e02 upstream.
Afaics the usage of update_debugctlmsr() and TIF_BLOCKSTEP in step.c was always very wrong.
1. update_debugctlmsr() was simply unneeded. The child sleeps TASK_TRACED, __switch_to_xtra(next_p => child) should notice TIF_BLOCKSTEP and set/clear DEBUGCTLMSR_BTF after resume if needed.
2. It is wrong. The state of DEBUGCTLMSR_BTF bit in CPU register should always match the state of current's TIF_BLOCKSTEP bit.
3. Even get_debugctlmsr() + update_debugctlmsr() itself does not look right. Irq can change other bits in MSR_IA32_DEBUGCTLMSR register or the caller can be preempted in between.
4. It is not safe to play with TIF_BLOCKSTEP if task != current. DEBUGCTLMSR_BTF and TIF_BLOCKSTEP should always match each other if the task is running. The tracee is stopped but it can be SIGKILL'ed right before set/clear_tsk_thread_flag().
However, now that uprobes uses user_enable_single_step(current) we can't simply remove update_debugctlmsr(). So this patch adds the additional "task == current" check and disables irqs to avoid the race with interrupts/preemption.
Unfortunately this patch doesn't solve the last problem, we need another fix. Probably we should teach ptrace_stop() to set/clear single/block stepping after resume.
And afaics there is yet another problem: perf can play with MSR_IA32_DEBUGCTLMSR from nmi, this obviously means that even __switch_to_xtra() has problems.
--- arch/x86/kernel/step.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
arch/x86/kernel/step.c +13 -1
@@ -161,6 +161,16 @@ static void set_task_blockstep(struct task_struct *task, bool on) {unsigned long debugctl; +/* +* Ensure irq/preemption can't change debugctl in between. +* Note also that both TIF_BLOCKSTEP and debugctl should +* be changed atomically wrt preemption. +* FIXME: this means that set/clear TIF_BLOCKSTEP is simply +* wrong if task != current, SIGKILL can wakeup the stopped +* tracee and set/clear can play with the running task, this +* can confuse the next __switch_to_xtra(). +*/ +local_irq_disable (); debugctl =get_debugctlmsr ();if (on) { debugctl |=DEBUGCTLMSR_BTF ;
@@ -169,7 +179,9 @@ static void set_task_blockstep(struct task_struct *task, bool on) debugctl &= ~DEBUGCTLMSR_BTF ;clear_tsk_thread_flag (task,TIF_BLOCKSTEP ); } -update_debugctlmsr (debugctl); +if (task == current) +update_debugctlmsr (debugctl); +local_irq_enable (); }/*
PATCH 35/66 ptrace: introduce signal_wake_up_state() and ptrace_signal_wake_up()
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit 910ffdb18a6408e14febbb6e4b6840fd2c928c82 upstream.
Cleanup and preparation for the next change.
signal_wake_up(resume => true) is overused. None of ptrace/jctl callers actually want to wakeup a TASK_WAKEKILL task, but they can't specify the necessary mask.
Turn signal_wake_up() into signal_wake_up_state(state), reintroduce signal_wake_up() as a trivial helper, and add ptrace_signal_wake_up() which adds __TASK_TRACED.
This way ptrace_signal_wake_up() can work "inside" ptrace_request() even if the tracee doesn't have the TASK_WAKEKILL bit set.
--- include/linux/sched.h | 11 ++++++++++- kernel/ptrace.c | 8 ++++---- kernel/signal.c | 14 ++++---------- 3 files changed, 18 insertions(+), 15 deletions(-)
include/linux/sched.h +10 -1
@@ -2714,7 +2714,16 @@ static inline void thread_group_cputime_init(struct signal_struct *sig)extern void recalc_sigpending_and_wake (struct task_struct *t);extern void recalc_sigpending (void ); -extern void signal_wake_up (struct task_struct *t,int resume_stopped); +extern void signal_wake_up_state (struct task_struct *t,unsigned int state); + +static inline void signal_wake_up (struct task_struct *t,bool resume) +{ +signal_wake_up_state (t, resume ?TASK_WAKEKILL :0 ); +} +static inline void ptrace_signal_wake_up (struct task_struct *t,bool resume) +{ +signal_wake_up_state (t, resume ? __TASK_TRACED :0 ); +}/* * Wrappers for p->thread_info->cpu access. No-op on UP.
kernel/ptrace.c +4 -4
@@ -117,7 +117,7 @@ void __ptrace_unlink(struct task_struct *child)* TASK_KILLABLE sleeps. */ if (child->jobctl &JOBCTL_STOP_PENDING ||task_is_traced (child)) -signal_wake_up (child,task_is_traced (child)); +ptrace_signal_wake_up (child, true);spin_unlock (&child->sighand->siglock); }
@@ -317,7 +317,7 @@ static int ptrace_attach(struct task_struct *task, long request,*/ if (task_is_stopped (task) &&task_set_jobctl_pending (task,JOBCTL_TRAP_STOP |JOBCTL_TRAPPING )) -signal_wake_up (task,1 ); +signal_wake_up_state (task, __TASK_STOPPED);spin_unlock (&task->sighand->siglock);
@@ -737,7 +737,7 @@ int ptrace_request(struct task_struct *child, long request,* tracee into STOP. */ if (likely (task_set_jobctl_pending (child,JOBCTL_TRAP_STOP ))) -signal_wake_up (child, child->jobctl &JOBCTL_LISTENING ); +ptrace_signal_wake_up (child, child->jobctl &JOBCTL_LISTENING );unlock_task_sighand (child, &flags); ret =0 ;
@@ -763,7 +763,7 @@ int ptrace_request(struct task_struct *child, long request,* start of this trap and now. Trigger re-trap. */ if (child->jobctl &JOBCTL_TRAP_NOTIFY ) -signal_wake_up (child, true); +ptrace_signal_wake_up (child, true); ret =0 ; }unlock_task_sighand (child, &flags);
kernel/signal.c +4 -10
@@ -680,23 +680,17 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)* No need to set need_resched since signal event passing * goes through ->blocked */ -void signal_wake_up (struct task_struct *t,int resume) +void signal_wake_up_state (struct task_struct *t,unsigned int state) { -unsigned int mask; -set_tsk_thread_flag (t,TIF_SIGPENDING ); -/* -* For SIGKILL, we want to wake it up in the stopped/traced/killable +* TASK_WAKEKILL also means wake it up in the stopped/traced/killable * case. We don't check t->state here because there is a race with it * executing another processor and just now entering stopped state. * By using wake_up_state, we ensure the process will wake up and * handle its death signal. */ - mask =TASK_INTERRUPTIBLE ; -if (resume) - mask |=TASK_WAKEKILL ; -if (!wake_up_state (t, mask)) +if (!wake_up_state (t, state |TASK_INTERRUPTIBLE ))kick_process (t); }
@@ -844,7 +838,7 @@ static void ptrace_trap_notify(struct task_struct *t)assert_spin_locked (&t->sighand->siglock);task_set_jobctl_pending (t,JOBCTL_TRAP_NOTIFY ); -signal_wake_up (t, t->jobctl &JOBCTL_LISTENING ); +ptrace_signal_wake_up (t, t->jobctl &JOBCTL_LISTENING ); }/*
PATCH 36/66 ptrace: ensure arch_ptrace/ptrace_request can never race with SIGKILL
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit 9899d11f654474d2d54ea52ceaa2a1f4db3abd68 upstream.
putreg() assumes that the tracee is not running and pt_regs_access() can safely play with its stack. However a killed tracee can return from ptrace_stop() to the low-level asm code and do RESTORE_REST, this means that debugger can actually read/modify the kernel stack until the tracee does SAVE_REST again.
set_task_blockstep() can race with SIGKILL too and in some sense this race is even worse, the very fact the tracee can be woken up breaks the logic.
As Linus suggested we can clear TASK_WAKEKILL around the arch_ptrace() call, this ensures that nobody can ever wakeup the tracee while the debugger looks at it. Not only this fixes the mentioned problems, we can do some cleanups/simplifications in arch_ptrace() paths.
Probably ptrace_unfreeze_traced() needs more callers, for example it makes sense to make the tracee killable for oom-killer before access_process_vm().
While at it, add the comment into may_ptrace_stop() to explain why ptrace_stop() still can't rely on SIGKILL and signal_pending_state().
--- arch/x86/kernel/step.c | 9 ++++--- kernel/ptrace.c | 64 ++++++++++++++++++++++++++++++++++++++++-------- kernel/signal.c | 5 ++++ 3 files changed, 64 insertions(+), 14 deletions(-)
arch/x86/kernel/step.c +5 -4
@@ -165,10 +165,11 @@ void set_task_blockstep(struct task_struct *task, bool on)* Ensure irq/preemption can't change debugctl in between. * Note also that both TIF_BLOCKSTEP and debugctl should * be changed atomically wrt preemption. -* FIXME: this means that set/clear TIF_BLOCKSTEP is simply -* wrong if task != current, SIGKILL can wakeup the stopped -* tracee and set/clear can play with the running task, this -* can confuse the next __switch_to_xtra(). +* +* NOTE: this means that set/clear TIF_BLOCKSTEP is only safe if +* task is current or it can't be running, otherwise we can race +* with __switch_to_xtra(). We rely on ptrace_freeze_traced() but +* PTRACE_KILL is not safe. */ local_irq_disable (); debugctl =get_debugctlmsr ();
kernel/ptrace.c +54 -10
98 lines not on this page · raw message
kernel/signal.c +5 -0
@@ -1794,6 +1794,10 @@ static inline int may_ptrace_stop(void)* If SIGKILL was already sent before the caller unlocked * ->siglock we must see ->core_state != NULL. Otherwise it * is safe to enter schedule(). +* +* This is almost outdated, a task with the pending SIGKILL can't +* block in TASK_TRACED. But PTRACE_EVENT_EXIT can be reported +* after SIGKILL was already dequeued. */ if (unlikely (current->mm->core_state) &&unlikely (current->mm == current->parent->mm))
@@ -1919,6 +1923,7 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)if (gstop_done)do_notify_parent_cldstop (current, false, why); +/* tasklist protects us from ptrace_freeze_traced() */ __set_current_state (TASK_RUNNING );if (clear_code) current->exit_code =0 ;
PATCH 37/66 wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED task
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit 9067ac85d533651b98c2ff903182a20cbb361fcb upstream.
wake_up_process() should never wakeup a TASK_STOPPED/TRACED task. Change it to use TASK_NORMAL and add the WARN_ON().
TASK_ALL has no other users, probably can be killed.
--- kernel/sched/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sched.c +2 -1
@@ -2924,7 +2924,8 @@ out:*/ int wake_up_process (struct task_struct *p) { -return try_to_wake_up (p,TASK_ALL ,0 ); +WARN_ON (task_is_stopped_or_traced (p)); +return try_to_wake_up (p,TASK_NORMAL ,0 ); }EXPORT_SYMBOL (wake_up_process);
PATCH 38/66 Bluetooth: Fix sending HCI commands after reset
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Szymon Janc <[email protected]>
commit dbccd791a3fbbdac12c33834b73beff3984988e9 upstream.
After sending reset command wait for its command complete event before sending next command. Some chips sends CC event for command received before reset if reset was send before chip replied with CC.
This is also required by specification that host shall not send additional HCI commands before receiving CC for reset.
< HCI Command: Reset (0x03|0x0003) plen 0 [hci0] 18.404612
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4 [hci0] 18.405850
Write Extended Inquiry Response (0x03|0x0052) ncmd 1
Status: Success (0x00)< HCI Command: Read Local Supported Features (0x04|0x0003) plen 0 [hci0] 18.406079
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4 [hci0] 18.407864
Reset (0x03|0x0003) ncmd 1
Status: Success (0x00)< HCI Command: Read Local Supported Features (0x04|0x0003) plen 0 [hci0] 18.408062
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 12 [hci0] 18.408835
--- net/bluetooth/hci_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hci_event.c +1 -1
@@ -1972,7 +1972,7 @@ static inline void hci_cmd_complete_evt(if (ev->opcode !=HCI_OP_NOP )del_timer (&hdev->cmd_timer); -if (ev->ncmd) { +if (ev->ncmd && !test_bit (HCI_RESET , &hdev->flags)) {atomic_set (&hdev->cmd_cnt,1 );if (!skb_queue_empty (&hdev->cmd_q))tasklet_schedule (&hdev->cmd_task);
PATCH 39/66 HID: usbhid: quirk for Formosa IR receiver
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Santos <[email protected]>
commit 320cde19a4e8f122b19d2df7a5c00636e11ca3fb upstream.
Patch to add the Formosa Industrial Computing, Inc. Infrared Receiver [IR605A/Q] to hid-ids.h and hid-quirks.c. This IR receiver causes about a 10 second timeout when the usbhid driver attempts to initialze the device. Adding this device to the quirks list with HID_QUIRK_NO_INIT_REPORTS removes the delay.
--- drivers/hid/hid-ids.h | 3 +++ drivers/hid/usbhid/hid-quirks.c | 1 + 2 files changed, 4 insertions(+)
drivers/hid/hid-ids.h +3 -0
@@ -278,6 +278,9 @@#define USB_VENDOR_ID_EZKEY 0x0518#define USB_DEVICE_ID_BTC_8193 0x0002 +#define USB_VENDOR_ID_FORMOSA 0x147a +#define USB_DEVICE_ID_FORMOSA_IR_RECEIVER 0xe03e +#define USB_VENDOR_ID_FREESCALE 0x15A2#define USB_DEVICE_ID_FREESCALE_MX28 0x004F
drivers/hid/usbhid/hid-quirks.c +1 -0
@@ -68,6 +68,7 @@ static const struct hid_blacklist { { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET }, { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, + { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET }, { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS },
PATCH 40/66 kernel/resource.c: fix stack overflow in __reserve_region_with_split()
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: T Makphaibulchoke <[email protected]>
commit 4965f5667f36a95b41cda6638875bc992bd7d18b upstream.
Using a recursive call add a non-conflicting region in __reserve_region_with_split() could result in a stack overflow in the case that the recursive calls are too deep. Convert the recursive calls to an iterative loop to avoid the problem.
Tested on a machine containing 135 regions. The kernel no longer panicked with stack overflow.
Also tested with code arbitrarily adding regions with no conflict, embedding two consecutive conflicts and embedding two non-consecutive conflicts.
--- kernel/resource.c | 50 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 12 deletions(-)
kernel/resource.c +38 -12
@@ -763,6 +763,7 @@ static void __init __reserve_region_with_split(struct resource *root,struct resource *parent = root;struct resource *conflict;struct resource *res =kzalloc (sizeof (*res),GFP_ATOMIC ); +struct resource *next_res =NULL ;if (!res)return ;
@@ -772,21 +773,46 @@ static void __init __reserve_region_with_split(struct resource *root, res->end = end; res->flags =IORESOURCE_BUSY ; - conflict =__request_resource (parent, res); -if (!conflict) -return ; +while (1 ) { -/* failed, split and try again */ -kfree (res); + conflict =__request_resource (parent, res); +if (!conflict) { +if (!next_res) +break ; + res = next_res; + next_res =NULL ; +continue ; + } -/* conflict covered whole area */ -if (conflict->start <= start && conflict->end >= end) -return ; +/* conflict covered whole area */ +if (conflict->start <= res->start && + conflict->end >= res->end) { +kfree (res); +WARN_ON (next_res); +break ; + } + +/* failed, split and try again */ +if (conflict->start > res->start) { + end = res->end; + res->end = conflict->start -1 ; +if (conflict->end < end) { + next_res =kzalloc (sizeof (*next_res), +GFP_ATOMIC ); +if (!next_res) { +kfree (res); +break ; + } + next_res->name = name; + next_res->start = conflict->end +1 ; + next_res->end = end; + next_res->flags =IORESOURCE_BUSY ; + } + }else { + res->start = conflict->end +1 ; + } + } -if (conflict->start > start) -__reserve_region_with_split (root, start, conflict->start-1 , name); -if (conflict->end < end) -__reserve_region_with_split (root, conflict->end+1 , end, name); } void __init reserve_region_with_split(struct resource *root,
PATCH 41/66 net: prevent setting ttl=0 via IP_TTL
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit c9be4a5c49cf51cc70a993f004c5bb30067a65ce ]
A regression is introduced by the following commit:
commit 4d52cfbef6266092d535237ba5a4b981458ab171 Author: Eric Dumazet <[email protected]> Date: Tue Jun 2 00:42:16 2009 -0700 net: ipv4/ip_sockglue.c cleanups Pure cleanups
but it is not a pure cleanup...
- if (val != -1 && (val < 1 || val>255)) + if (val != -1 && (val < 0 || val > 255))
Since there is no reason provided to allow ttl=0, change it back.
--- net/ipv4/ip_sockglue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/ip_sockglue.c +1 -1
@@ -600,7 +600,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,case IP_TTL :if (optlen <1 ) goto e_inval; -if (val !=-1 && (val <0 || val >255 )) +if (val !=-1 && (val <1 || val >255 )) goto e_inval; inet->uc_ttl = val;break ;
PATCH 42/66 ipv6: fix the noflags test in addrconf_get_prefix_route
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Romain Kuntz <[email protected]>
[ Upstream commit 85da53bf1c336bb07ac038fb951403ab0478d2c5 ]
The tests on the flags in addrconf_get_prefix_route() does no make much sense: the 'noflags' parameter contains the set of flags that must not match with the route flags, so the test must be done against 'noflags', and not against 'flags'.
--- net/ipv6/addrconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/addrconf.c +1 -1
@@ -1739,7 +1739,7 @@ static struct rt6_info *addrconf_get_prefix_route(const struct in6_addr *pfx,continue ;if ((rt->rt6i_flags & flags) != flags)continue ; -if ((noflags !=0 ) && ((rt->rt6i_flags & flags) !=0 )) +if ((rt->rt6i_flags & noflags) !=0 )continue ;dst_hold (&rt->dst);break ;
PATCH 43/66 MAINTAINERS: Stephen Hemminger email change
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Hemminger <[email protected]>
[ Upstream commit adbbf69d1a54abf424e91875746a610dcc80017d ]
I changed my email because the vyatta.com mail server is now redirected to brocade.com; and the Brocade mail system is not friendly to Linux desktop users.
--- MAINTAINERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
MAINTAINERS +3 -3
@@ -2584,7 +2584,7 @@ S: Maintained F: drivers/net/ethernet/i825xx/eexpress.* ETHERNET BRIDGE -M: Stephen Hemminger <[email protected]> +M: Stephen Hemminger <[email protected]> L: [email protected] L: [email protected] W: http://www.linuxfoundation.org/en/Net:Bridge
@@ -4475,7 +4475,7 @@ S: Supported F: drivers/infiniband/hw/nes/ NETEM NETWORK EMULATOR -M: Stephen Hemminger <[email protected]> +M: Stephen Hemminger <[email protected]> L: [email protected] S: Maintained F: net/sched/sch_netem.c
@@ -5993,7 +5993,7 @@ S: Maintained F: drivers/usb/misc/sisusbvga/ SKGE, SKY2 10/100/1000 GIGABIT ETHERNET DRIVERS -M: Stephen Hemminger <[email protected]> +M: Stephen Hemminger <[email protected]> L: [email protected] S: Maintained F: drivers/net/ethernet/marvell/sk*
PATCH 44/66 ipv6: fix header length calculation in ip6_append_data()
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Romain KUNTZ <[email protected]>
[ Upstream commit 7efdba5bd9a2f3e2059beeb45c9fa55eefe1bced ]
Commit 299b0767 (ipv6: Fix IPsec slowpath fragmentation problem) has introduced a error in the header length calculation that provokes corrupted packets when non-fragmentable extensions headers (Destination Option or Routing Header Type 2) are used.
rt->rt6i_nfheader_len is the length of the non-fragmentable extension header, and it should be substracted to rt->dst.header_len, and not to exthdrlen, as it was done before commit 299b0767.
This patch reverts to the original and correct behavior. It has been successfully tested with and without IPsec on packets that include non-fragmentable extensions headers.
--- net/ipv6/ip6_output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/ip6_output.c +2 -2
@@ -1284,10 +1284,10 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, cork->length =0 ; sk->sk_sndmsg_page =NULL ; sk->sk_sndmsg_off =0 ; - exthdrlen = (opt ? opt->opt_flen :0 ) - rt->rt6i_nfheader_len; + exthdrlen = (opt ? opt->opt_flen :0 ); length += exthdrlen; transhdrlen += exthdrlen; - dst_exthdrlen = rt->dst.header_len; + dst_exthdrlen = rt->dst.header_len - rt->rt6i_nfheader_len; }else { rt = (struct rt6_info *)cork->dst; fl6 = &inet->cork.fl.u.ip6;
PATCH 45/66 isdn/gigaset: fix zero size border case in debug dump
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tilman Schmidt <[email protected]>
[ Upstream commit d721a1752ba544df8d7d36959038b26bc92bdf80 ]
If subtracting 12 from l leaves zero we'd do a zero size allocation, leading to an oops later when we try to set the NUL terminator.
--- drivers/isdn/gigaset/capi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/isdn/gigaset/capi.c +2 -0
@@ -264,6 +264,8 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag,CAPIMSG_APPID (data),CAPIMSG_MSGID (data), l, CAPIMSG_CONTROL(data)); l -=12 ; +if (l <=0 ) +return ; dbgline =kmalloc (3 *l,GFP_ATOMIC );if (!dbgline)return ;
PATCH 46/66 netxen: fix off by one bug in netxen_release_tx_buffer()
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit a05948f296ce103989b28a2606e47d2e287c3c89 ]
Christoph Paasch found netxen could trigger a BUG in its dismantle phase, in netxen_release_tx_buffer(), using full size TSO packets.
cmd_buf->frag_count includes the skb->data part, so the loop must start at index 1 instead of 0, or else we can make an out of bound access to cmd_buff->frag_array[MAX_SKB_FRAGS + 2]
Christoph provided the fixes in netxen_map_tx_skb() function. In case of a dma mapping error, its better to clear the dma fields so that we don't try to unmap them again in netxen_release_tx_buffer()
--- drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | 2 +- drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +1 -1
@@ -144,7 +144,7 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter) buffrag->length, PCI_DMA_TODEVICE); buffrag->dma =0ULL ; } -for (j =0 ; j < cmd_buf->frag_count; j++) { +for (j =1 ; j < cmd_buf->frag_count; j++) { buffrag++;if (buffrag->dma) { pci_unmap_page(adapter->pdev, buffrag->dma,
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +2 -0
@@ -1924,10 +1924,12 @@ unwind:while (--i >=0 ) { nf = &pbuf->frag_array[i+1 ];pci_unmap_page (pdev, nf->dma, nf->length,PCI_DMA_TODEVICE ); + nf->dma =0ULL ; } nf = &pbuf->frag_array[0 ];pci_unmap_single (pdev, nf->dma,skb_headlen (skb),PCI_DMA_TODEVICE ); + nf->dma =0ULL ; out_err:return -ENOMEM ;
PATCH 47/66 r8169: remove the obsolete and incorrect AMD workaround
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Timo Teräs <[email protected]>
[ Upstream commit 5d0feaff230c0abfe4a112e6f09f096ed99e0b2d ]
This was introduced in commit 6dccd16 "r8169: merge with version 6.001.00 of Realtek's r8169 driver". I did not find the version 6.001.00 online, but in 6.002.00 or any later r8169 from Realtek this hunk is no longer present.
Also commit 05af214 "r8169: fix Ethernet Hangup for RTL8110SC rev d" claims to have fixed this issue otherwise.
The magic compare mask of 0xfffe000 is dubious as it masks parts of the Reserved part, and parts of the VLAN tag. But this does not make much sense as the VLAN tag parts are perfectly valid there. In matter of fact this seems to be triggered with any VLAN tagged packet as RxVlanTag bit is matched. I would suspect 0xfffe0000 was intended to test reserved part only.
Finally, this hunk is evil as it can cause more packets to be handled than what was NAPI quota causing net/core/dev.c:net_rx_action(): WARN_ON_ONCE(work > weight) to trigger, and mess up the NAPI state causing device to hang.
As result, any system using VLANs and having high receive traffic (so that NAPI poll budget limits rtl_rx) would result in device hang.
--- drivers/net/ethernet/realtek/r8169.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/net/ethernet/realtek/r8169.c +0 -7
@@ -5829,13 +5829,6 @@ static int rtl8169_rx_interrupt(struct net_device *dev, dev->stats.rx_bytes += pkt_size; dev->stats.rx_packets++; } - -/* Work around for AMD plateform. */ -if ((desc->opts2 &cpu_to_le32 (0xfffe000 )) && - (tp->mac_version ==RTL_GIGA_MAC_VER_05 )) { - desc->opts2 =0 ; - cur_rx++; - } } count = cur_rx - tp->cur_rx;
PATCH 48/66 net: loopback: fix a dst refcounting issue
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 794ed393b707f01858f5ebe2ae5eabaf89d00022 ]
Ben Greear reported crashes in ip_rcv_finish() on a stress test involving many macvlans.
We tracked the bug to a dst use after free. ip_rcv_finish() was calling dst->input() and got garbage for dst->input value.
It appears the bug is in loopback driver, lacking a skb_dst_force() before calling netif_rx().
As a result, a non refcounted dst, normally protected by a RCU read_lock section, was escaping this section and could be freed before the packet being processed.
[<ffffffff813a3c4d>] loopback_xmit+0x64/0x83 [<ffffffff81477364>] dev_hard_start_xmit+0x26c/0x35e [<ffffffff8147771a>] dev_queue_xmit+0x2c4/0x37c [<ffffffff81477456>] ? dev_hard_start_xmit+0x35e/0x35e [<ffffffff8148cfa6>] ? eth_header+0x28/0xb6 [<ffffffff81480f09>] neigh_resolve_output+0x176/0x1a7 [<ffffffff814ad835>] ip_finish_output2+0x297/0x30d [<ffffffff814ad6d5>] ? ip_finish_output2+0x137/0x30d [<ffffffff814ad90e>] ip_finish_output+0x63/0x68 [<ffffffff814ae412>] ip_output+0x61/0x67 [<ffffffff814ab904>] dst_output+0x17/0x1b [<ffffffff814adb6d>] ip_local_out+0x1e/0x23 [<ffffffff814ae1c4>] ip_queue_xmit+0x315/0x353 [<ffffffff814adeaf>] ? ip_send_unicast_reply+0x2cc/0x2cc [<ffffffff814c018f>] tcp_transmit_skb+0x7ca/0x80b [<ffffffff814c3571>] tcp_connect+0x53c/0x587 [<ffffffff810c2f0c>] ? getnstimeofday+0x44/0x7d [<ffffffff810c2f56>] ? ktime_get_real+0x11/0x3e [<ffffffff814c6f9b>] tcp_v4_connect+0x3c2/0x431 [<ffffffff814d6913>] __inet_stream_connect+0x84/0x287 [<ffffffff814d6b38>] ? inet_stream_connect+0x22/0x49 [<ffffffff8108d695>] ? _local_bh_enable_ip+0x84/0x9f [<ffffffff8108d6c8>] ? local_bh_enable+0xd/0x11 [<ffffffff8146763c>] ? lock_sock_nested+0x6e/0x79 [<ffffffff814d6b38>] ? inet_stream_connect+0x22/0x49 [<ffffffff814d6b49>] inet_stream_connect+0x33/0x49 [<ffffffff814632c6>] sys_connect+0x75/0x98
This bug was introduced in linux-2.6.35, in commit 7fee226ad2397b (net: add a noref bit on skb dst)
skb_dst_force() is enforced in dev_queue_xmit() for devices having a qdisc.
--- drivers/net/loopback.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/loopback.c +5 -0
@@ -78,6 +78,11 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,skb_orphan (skb); +/* Before queueing this packet to netif_rx(), +* make sure dst is refcounted. +*/ +skb_dst_force (skb); + skb->protocol =eth_type_trans (skb, dev);/* it's OK to use per_cpu_ptr() because BHs are off */
PATCH 49/66 pktgen: correctly handle failures when adding a device
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit 604dfd6efc9b79bce432f2394791708d8e8f6efc ]
The return value of pktgen_add_device() is not checked, so even if we fail to add some device, for example, non-exist one, we still see "OK:...". This patch fixes it.
After this patch, I got:
# echo "add_device non-exist" > /proc/net/pktgen/kpktgend_0 -bash: echo: write error: No such device # cat /proc/net/pktgen/kpktgend_0 Running: Stopped: Result: ERROR: can not add device non-exist # echo "add_device eth0" > /proc/net/pktgen/kpktgend_0 # cat /proc/net/pktgen/kpktgend_0 Running: Stopped: eth0 Result: OK: add_device=eth0
(Candidate for -stable)
--- net/core/pktgen.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/core/pktgen.c +6 -3
@@ -1803,10 +1803,13 @@ static ssize_t pktgen_thread_write(struct file *file,return -EFAULT ; i += len;mutex_lock (&pktgen_thread_lock); -pktgen_add_device (t, f); + ret =pktgen_add_device (t, f);mutex_unlock (&pktgen_thread_lock); - ret = count; -sprintf (pg_result,"OK: add_device=%s" , f); +if (!ret) { + ret = count; +sprintf (pg_result,"OK: add_device=%s" , f); + }else +sprintf (pg_result,"ERROR: can not add device %s" , f); goto out; }
PATCH 50/66 ipv6: do not create neighbor entries for local delivery
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcelo Ricardo Leitner <[email protected]>
[ Upstream commit bd30e947207e2ea0ff2c08f5b4a03025ddce48d3 ]
They will be created at output, if ever needed. This avoids creating empty neighbor entries when TPROXYing/Forwarding packets for addresses that are not even directly reachable.
Note that IPv4 already handles it this way. No neighbor entries are created for local input.
Tested by myself and customer.
--- net/ipv6/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv6/route.c +2 -1
@@ -819,7 +819,8 @@ restart:dst_hold (&rt->dst);read_unlock_bh (&table->tb6_lock); -if (!dst_get_neighbour_raw (&rt->dst) && !(rt->rt6i_flags &RTF_NONEXTHOP )) +if (!dst_get_neighbour_raw (&rt->dst) + && !(rt->rt6i_flags & (RTF_NONEXTHOP |RTF_LOCAL ))) nrt =rt6_alloc_cow (rt, &fl6->daddr, &fl6->saddr);else if (!(rt->dst.flags &DST_HOST )) nrt =rt6_alloc_clone (rt, &fl6->daddr);
PATCH 51/66 packet: fix leakage of tx_ring memory
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Phil Sutter <[email protected]>
[ Upstream commit 9665d5d62487e8e7b1f546c00e11107155384b9a ]
When releasing a packet socket, the routine packet_set_ring() is reused to free rings instead of allocating them. But when calling it for the first time, it fills req->tp_block_nr with the value of rb->pg_vec_len which in the second invocation makes it bail out since req->tp_block_nr is greater zero but req->tp_block_size is zero.
This patch solves the problem by passing a zeroed auto-variable to packet_set_ring() upon each invocation from packet_release().
As far as I can tell, this issue exists even since 69e3c75 (net: TX_RING and packet mmap), i.e. the original inclusion of TX ring support into af_packet, but applies only to sockets with both RX and TX ring allocated, which is probably why this was unnoticed all the time.
--- net/packet/af_packet.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
net/packet/af_packet.c +6 -4
@@ -2422,13 +2422,15 @@ static int packet_release(struct socket *sock)packet_flush_mclist (sk); -memset (&req_u,0 ,sizeof (req_u)); - -if (po->rx_ring.pg_vec) +if (po->rx_ring.pg_vec) { +memset (&req_u,0 ,sizeof (req_u));packet_set_ring (sk, &req_u,1 ,0 ); + } -if (po->tx_ring.pg_vec) +if (po->tx_ring.pg_vec) { +memset (&req_u,0 ,sizeof (req_u));packet_set_ring (sk, &req_u,1 ,1 ); + }fanout_release (sk);
PATCH 52/66 atm/iphase: rename fregt_t -> ffreg_t
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Carstens <[email protected]>
[ Upstream commit ab54ee80aa7585f9666ff4dd665441d7ce41f1e8 ]
We have conflicting type qualifiers for "freg_t" in s390's ptrace.h and the iphase atm device driver, which causes the compile error below. Unfortunately the s390 typedef can't be renamed, since it's a user visible api, nor can I change the include order in s390 code to avoid the conflict.
So simply rename the iphase typedef to a new name. Fixes this compile error:
In file included from drivers/atm/iphase.c:66:0:drivers/atm/iphase.h:639:25: error: conflicting type qualifiers for 'freg_t' In file included from next/arch/s390/include/asm/ptrace.h:9:0,
from next/arch/s390/include/asm/lowcore.h:12,
from next/arch/s390/include/asm/thread_info.h:30,
from include/linux/thread_info.h:54,
from include/linux/preempt.h:9,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:29,
from include/linux/time.h:5,
from include/linux/stat.h:18,
from include/linux/module.h:10,
from drivers/atm/iphase.c:43:next/arch/s390/include/uapi/asm/ptrace.h:197:3: note: previous declaration of 'freg_t' was here
--- drivers/atm/iphase.h | 146 +++++++++++++++++++++++++-------------------------- 1 file changed, 73 insertions(+), 73 deletions(-)
drivers/atm/iphase.h +73 -73
@@ -636,82 +636,82 @@ struct rx_buf_desc {#define SEG_BASE IPHASE5575_FRAG_CONTROL_REG_BASE#define REASS_BASE IPHASE5575_REASS_CONTROL_REG_BASE -typedef volatile u_int freg_t ; +typedef volatile u_int ffreg_t ;typedef u_int rreg_t ;typedef struct _ffredn_t { -freg_t idlehead_high;/* Idle cell header (high) */ -freg_t idlehead_low;/* Idle cell header (low) */ -freg_t maxrate;/* Maximum rate */ -freg_t stparms;/* Traffic Management Parameters */ -freg_t abrubr_abr;/* ABRUBR Priority Byte 1, TCR Byte 0 */ -freg_t rm_type;/* */ -u_int filler5[0x17 -0x06 ]; -freg_t cmd_reg;/* Command register */ -u_int filler18[0x20 -0x18 ]; -freg_t cbr_base;/* CBR Pointer Base */ -freg_t vbr_base;/* VBR Pointer Base */ -freg_t abr_base;/* ABR Pointer Base */ -freg_t ubr_base;/* UBR Pointer Base */ -u_int filler24; -freg_t vbrwq_base;/* VBR Wait Queue Base */ -freg_t abrwq_base;/* ABR Wait Queue Base */ -freg_t ubrwq_base;/* UBR Wait Queue Base */ -freg_t vct_base;/* Main VC Table Base */ -freg_t vcte_base;/* Extended Main VC Table Base */ -u_int filler2a[0x2C -0x2A ]; -freg_t cbr_tab_beg;/* CBR Table Begin */ -freg_t cbr_tab_end;/* CBR Table End */ -freg_t cbr_pointer;/* CBR Pointer */ -u_int filler2f[0x30 -0x2F ]; -freg_t prq_st_adr;/* Packet Ready Queue Start Address */ -freg_t prq_ed_adr;/* Packet Ready Queue End Address */ -freg_t prq_rd_ptr;/* Packet Ready Queue read pointer */ -freg_t prq_wr_ptr;/* Packet Ready Queue write pointer */ -freg_t tcq_st_adr;/* Transmit Complete Queue Start Address*/ -freg_t tcq_ed_adr;/* Transmit Complete Queue End Address */ -freg_t tcq_rd_ptr;/* Transmit Complete Queue read pointer */ -freg_t tcq_wr_ptr;/* Transmit Complete Queue write pointer*/ -u_int filler38[0x40 -0x38 ]; -freg_t queue_base;/* Base address for PRQ and TCQ */ -freg_t desc_base;/* Base address of descriptor table */ -u_int filler42[0x45 -0x42 ]; -freg_t mode_reg_0;/* Mode register 0 */ -freg_t mode_reg_1;/* Mode register 1 */ -freg_t intr_status_reg;/* Interrupt Status register */ -freg_t mask_reg;/* Mask Register */ -freg_t cell_ctr_high1;/* Total cell transfer count (high) */ -freg_t cell_ctr_lo1;/* Total cell transfer count (low) */ -freg_t state_reg;/* Status register */ -u_int filler4c[0x58 -0x4c ]; -freg_t curr_desc_num;/* Contains the current descriptor num */ -freg_t next_desc;/* Next descriptor */ -freg_t next_vc;/* Next VC */ -u_int filler5b[0x5d -0x5b ]; -freg_t present_slot_cnt;/* Present slot count */ -u_int filler5e[0x6a -0x5e ]; -freg_t new_desc_num;/* New descriptor number */ -freg_t new_vc;/* New VC */ -freg_t sched_tbl_ptr;/* Schedule table pointer */ -freg_t vbrwq_wptr;/* VBR wait queue write pointer */ -freg_t vbrwq_rptr;/* VBR wait queue read pointer */ -freg_t abrwq_wptr;/* ABR wait queue write pointer */ -freg_t abrwq_rptr;/* ABR wait queue read pointer */ -freg_t ubrwq_wptr;/* UBR wait queue write pointer */ -freg_t ubrwq_rptr;/* UBR wait queue read pointer */ -freg_t cbr_vc;/* CBR VC */ -freg_t vbr_sb_vc;/* VBR SB VC */ -freg_t abr_sb_vc;/* ABR SB VC */ -freg_t ubr_sb_vc;/* UBR SB VC */ -freg_t vbr_next_link;/* VBR next link */ -freg_t abr_next_link;/* ABR next link */ -freg_t ubr_next_link;/* UBR next link */ -u_int filler7a[0x7c -0x7a ]; -freg_t out_rate_head;/* Out of rate head */ -u_int filler7d[0xca -0x7d ];/* pad out to full address space */ -freg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */ -freg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */ -u_int fillercc[0x100 -0xcc ];/* pad out to full address space */ +ffreg_t idlehead_high;/* Idle cell header (high) */ +ffreg_t idlehead_low;/* Idle cell header (low) */ +ffreg_t maxrate;/* Maximum rate */ +ffreg_t stparms;/* Traffic Management Parameters */ +ffreg_t abrubr_abr;/* ABRUBR Priority Byte 1, TCR Byte 0 */ +ffreg_t rm_type;/* */ +u_int filler5[0x17 -0x06 ]; +ffreg_t cmd_reg;/* Command register */ +u_int filler18[0x20 -0x18 ]; +ffreg_t cbr_base;/* CBR Pointer Base */ +ffreg_t vbr_base;/* VBR Pointer Base */ +ffreg_t abr_base;/* ABR Pointer Base */ +ffreg_t ubr_base;/* UBR Pointer Base */ +u_int filler24; +ffreg_t vbrwq_base;/* VBR Wait Queue Base */ +ffreg_t abrwq_base;/* ABR Wait Queue Base */ +ffreg_t ubrwq_base;/* UBR Wait Queue Base */ +ffreg_t vct_base;/* Main VC Table Base */ +ffreg_t vcte_base;/* Extended Main VC Table Base */ +u_int filler2a[0x2C -0x2A ]; +ffreg_t cbr_tab_beg;/* CBR Table Begin */ +ffreg_t cbr_tab_end;/* CBR Table End */ +ffreg_t cbr_pointer;/* CBR Pointer */ +u_int filler2f[0x30 -0x2F ]; +ffreg_t prq_st_adr;/* Packet Ready Queue Start Address */ +ffreg_t prq_ed_adr;/* Packet Ready Queue End Address */ +ffreg_t prq_rd_ptr;/* Packet Ready Queue read pointer */ +ffreg_t prq_wr_ptr;/* Packet Ready Queue write pointer */ +ffreg_t tcq_st_adr;/* Transmit Complete Queue Start Address*/ +ffreg_t tcq_ed_adr;/* Transmit Complete Queue End Address */ +ffreg_t tcq_rd_ptr;/* Transmit Complete Queue read pointer */ +ffreg_t tcq_wr_ptr;/* Transmit Complete Queue write pointer*/ +u_int filler38[0x40 -0x38 ]; +ffreg_t queue_base;/* Base address for PRQ and TCQ */ +ffreg_t desc_base;/* Base address of descriptor table */ +u_int filler42[0x45 -0x42 ]; +ffreg_t mode_reg_0;/* Mode register 0 */ +ffreg_t mode_reg_1;/* Mode register 1 */ +ffreg_t intr_status_reg;/* Interrupt Status register */ +ffreg_t mask_reg;/* Mask Register */ +ffreg_t cell_ctr_high1;/* Total cell transfer count (high) */ +ffreg_t cell_ctr_lo1;/* Total cell transfer count (low) */ +ffreg_t state_reg;/* Status register */ +u_int filler4c[0x58 -0x4c ]; +ffreg_t curr_desc_num;/* Contains the current descriptor num */ +ffreg_t next_desc;/* Next descriptor */ +ffreg_t next_vc;/* Next VC */ +u_int filler5b[0x5d -0x5b ]; +ffreg_t present_slot_cnt;/* Present slot count */ +u_int filler5e[0x6a -0x5e ]; +ffreg_t new_desc_num;/* New descriptor number */ +ffreg_t new_vc;/* New VC */ +ffreg_t sched_tbl_ptr;/* Schedule table pointer */ +ffreg_t vbrwq_wptr;/* VBR wait queue write pointer */ +ffreg_t vbrwq_rptr;/* VBR wait queue read pointer */ +ffreg_t abrwq_wptr;/* ABR wait queue write pointer */ +ffreg_t abrwq_rptr;/* ABR wait queue read pointer */ +ffreg_t ubrwq_wptr;/* UBR wait queue write pointer */ +ffreg_t ubrwq_rptr;/* UBR wait queue read pointer */ +ffreg_t cbr_vc;/* CBR VC */ +ffreg_t vbr_sb_vc;/* VBR SB VC */ +ffreg_t abr_sb_vc;/* ABR SB VC */ +ffreg_t ubr_sb_vc;/* UBR SB VC */ +ffreg_t vbr_next_link;/* VBR next link */ +ffreg_t abr_next_link;/* ABR next link */ +ffreg_t ubr_next_link;/* UBR next link */ +u_int filler7a[0x7c -0x7a ]; +ffreg_t out_rate_head;/* Out of rate head */ +u_int filler7d[0xca -0x7d ];/* pad out to full address space */ +ffreg_t cell_ctr_high1_nc;/* Total cell transfer count (high) */ +ffreg_t cell_ctr_lo1_nc;/* Total cell transfer count (low) */ +u_int fillercc[0x100 -0xcc ];/* pad out to full address space */ }ffredn_t ; typedef struct _rfredn_t {
PATCH 53/66 sctp: refactor sctp_outq_teardown to insure proper re-initalization
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Horman <[email protected]>
[ Upstream commit 2f94aabd9f6c925d77aecb3ff020f1cc12ed8f86 ]
Jamie Parsons reported a problem recently, in which the re-initalization of an association (The duplicate init case), resulted in a loss of receive window space. He tracked down the root cause to sctp_outq_teardown, which discarded all the data on an outq during a re-initalization of the corresponding association, but never reset the outq->outstanding_data field to zero. I wrote, and he tested this fix, which does a proper full re-initalization of the outq, fixing this problem, and hopefully future proofing us from simmilar issues down the road.
--- net/sctp/outqueue.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
net/sctp/outqueue.c +8 -4
@@ -223,7 +223,7 @@ void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q)/* Free the outqueue structure and any related pending chunks. */ -void sctp_outq_teardown (struct sctp_outq *q) +static void __sctp_outq_teardown (struct sctp_outq *q) {struct sctp_transport *transport;struct list_head *lchunk, *temp;
@@ -276,8 +276,6 @@ void sctp_outq_teardown(struct sctp_outq *q)sctp_chunk_free (chunk); } - q->error =0 ; -/* Throw away any leftover control chunks. */ list_for_each_entry_safe (chunk, tmp, &q->control_chunk_list, list) {list_del_init (&chunk->list);
@@ -285,11 +283,17 @@ void sctp_outq_teardown(struct sctp_outq *q) } } +void sctp_outq_teardown (struct sctp_outq *q) +{ +__sctp_outq_teardown (q); +sctp_outq_init (q->asoc, q); +} +/* Free the outqueue structure and any related pending chunks. */ void sctp_outq_free (struct sctp_outq *q) {/* Throw away leftover chunks. */ -sctp_outq_teardown (q); +__sctp_outq_teardown (q);/* If we were kmalloc()'d, free the memory. */ if (q->malloced)
PATCH 54/66 net: sctp: sctp_setsockopt_auth_key: use kzfree instead of kfree
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit 6ba542a291a5e558603ac51cda9bded347ce7627 ]
In sctp_setsockopt_auth_key, we create a temporary copy of the user passed shared auth key for the endpoint or association and after internal setup, we free it right away. Since it's sensitive data, we should zero out the key before returning the memory back to the allocator. Thus, use kzfree instead of kfree, just as we do in sctp_auth_key_put().
--- net/sctp/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sctp/socket.c +1 -1
@@ -3375,7 +3375,7 @@ static int sctp_setsockopt_auth_key(struct sock *sk, ret =sctp_auth_set_key (sctp_sk (sk)->ep, asoc, authkey); out: -kfree (authkey); +kzfree (authkey);return ret; }
PATCH 55/66 net: sctp: sctp_endpoint_free: zero out secret key data
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit b5c37fe6e24eec194bb29d22fdd55d73bcc709bf ]
On sctp_endpoint_destroy, previously used sensitive keying material should be zeroed out before the memory is returned, as we already do with e.g. auth keys when released.
--- net/sctp/endpointola.c | 5 +++++ 1 file changed, 5 insertions(+)
net/sctp/endpointola.c +5 -0
@@ -248,6 +248,8 @@ void sctp_endpoint_free(struct sctp_endpoint *ep)/* Final destructor for endpoint. */ static void sctp_endpoint_destroy (struct sctp_endpoint *ep) { +int i; +SCTP_ASSERT (ep->base.dead,"Endpoint is not dead" , return);/* Free up the HMAC transform. */
@@ -270,6 +272,9 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep)sctp_inq_free (&ep->base.inqueue);sctp_bind_addr_free (&ep->base.bind_addr); +for (i =0 ; i <SCTP_HOW_MANY_SECRETS ; ++i) +memset (&ep->secret_key[i],0 ,SCTP_SECRET_SIZE ); +/* Remove and free the port */ if (sctp_sk (ep->base.sk)->bind_hash)sctp_put_port (ep->base.sk);
PATCH 56/66 xen/netback: shutdown the ring if it contains garbage.
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Campbell <[email protected]>
[ Upstream commit 48856286b64e4b66ec62b94e504d0b29c1ade664 ]
A buggy or malicious frontend should not be able to confuse netback. If we spot anything which is not as it should be then shutdown the device and don't try to continue with the ring in a potentially hostile state. Well behaved and non-hostile frontends will not be penalised.
As well as making the existing checks for such errors fatal also add a new check that ensures that there isn't an insane number of requests on the ring (i.e. more than would fit in the ring). If the ring contains garbage then previously is was possible to loop over this insane number, getting an error each time and therefore not generating any more pending requests and therefore not exiting the loop in xen_netbk_tx_build_gops for an externded period.
Also turn various netdev_dbg calls which no precipitate a fatal error into netdev_err, they are rate limited because the device is shutdown afterwards.
This fixes at least one known DoS/softlockup of the backend domain.
--- drivers/net/xen-netback/common.h | 3 ++ drivers/net/xen-netback/interface.c | 23 ++++++++------ drivers/net/xen-netback/netback.c | 62 +++++++++++++++++++++++++++---------- 3 files changed, 62 insertions(+), 26 deletions(-)
drivers/net/xen-netback/common.h +3 -0
@@ -151,6 +151,9 @@ void xen_netbk_queue_tx_skb(struct xenvif *vif, struct sk_buff *skb);/* Notify xenvif that ring now has space to send an skb to the frontend */ void xenvif_notify_tx_completion (struct xenvif *vif); +/* Prevent the device from generating any further traffic. */ +void xenvif_carrier_off (struct xenvif *vif); +/* Returns number of ring slots required to send an skb to the frontend */ unsigned int xen_netbk_count_skb_slots (struct xenvif *vif,struct sk_buff *skb);
drivers/net/xen-netback/interface.c +14 -9
@@ -342,17 +342,22 @@ err:return err; } -void xenvif_disconnect (struct xenvif *vif) +void xenvif_carrier_off (struct xenvif *vif) {struct net_device *dev = vif->dev; -if (netif_carrier_ok (dev)) { -rtnl_lock (); -netif_carrier_off (dev);/* discard queued packets */ -if (netif_running (dev)) -xenvif_down (vif); -rtnl_unlock (); -xenvif_put (vif); - } + +rtnl_lock (); +netif_carrier_off (dev);/* discard queued packets */ +if (netif_running (dev)) +xenvif_down (vif); +rtnl_unlock (); +xenvif_put (vif); +} + +void xenvif_disconnect (struct xenvif *vif) +{ +if (netif_carrier_ok (vif->dev)) +xenvif_carrier_off (vif);atomic_dec (&vif->refcnt);wait_event (vif->waiting_to_free,atomic_read (&vif->refcnt) ==0 );
drivers/net/xen-netback/netback.c +45 -17
151 lines not on this page · raw message
PATCH 57/66 xen/netback: dont leak pages on failure in xen_netbk_tx_check_gop.
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Daley <[email protected]>
[ Upstream commit 7d5145d8eb2b9791533ffe4dc003b129b9696c48 ]
--- drivers/net/xen-netback/netback.c | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-)
drivers/net/xen-netback/netback.c +13 -25
@@ -146,7 +146,8 @@ void xen_netbk_remove_xenvif(struct xenvif *vif)atomic_dec (&netbk->netfront_count); } -static void xen_netbk_idx_release (struct xen_netbk *netbk,u16 pending_idx); +static void xen_netbk_idx_release (struct xen_netbk *netbk,u16 pending_idx, +u8 status);static void make_tx_response (struct xenvif *vif,struct xen_netif_tx_request *txp,s8 st);
@@ -981,30 +982,20 @@ static int xen_netbk_tx_check_gop(struct xen_netbk *netbk, {struct gnttab_copy *gop = *gopp;u16 pending_idx = *((u16 *)skb->data); -struct pending_tx_info *pending_tx_info = netbk->pending_tx_info; -struct xenvif *vif = pending_tx_info[pending_idx].vif; -struct xen_netif_tx_request *txp;struct skb_shared_info *shinfo =skb_shinfo (skb);int nr_frags = shinfo->nr_frags;int i, err, start;/* Check status of header. */ err = gop->status; -if (unlikely (err)) { -pending_ring_idx_t index; - index =pending_index (netbk->pending_prod++); - txp = &pending_tx_info[pending_idx].req; -make_tx_response (vif, txp,XEN_NETIF_RSP_ERROR ); - netbk->pending_ring[index] = pending_idx; -xenvif_put (vif); - } +if (unlikely (err)) +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_ERROR );/* Skip first skb fragment if it is on same page as header fragment. */ start = (frag_get_pending_idx (&shinfo->frags[0 ]) == pending_idx);for (i = start; i < nr_frags; i++) {int j, newerr; -pending_ring_idx_t index; pending_idx =frag_get_pending_idx (&shinfo->frags[i]);
@@ -1013,16 +1004,12 @@ static int xen_netbk_tx_check_gop(struct xen_netbk *netbk,if (likely (!newerr)) {/* Had a previous error? Invalidate this fragment. */ if (unlikely (err)) -xen_netbk_idx_release (netbk, pending_idx); +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_OKAY );continue ; }/* Error on this fragment: respond to client with an error. */ - txp = &netbk->pending_tx_info[pending_idx].req; -make_tx_response (vif, txp,XEN_NETIF_RSP_ERROR ); - index =pending_index (netbk->pending_prod++); - netbk->pending_ring[index] = pending_idx; -xenvif_put (vif); +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_ERROR );/* Not the first error? Preceding frags already invalidated. */ if (err)
@@ -1030,10 +1017,10 @@ static int xen_netbk_tx_check_gop(struct xen_netbk *netbk,/* First error: invalidate header and preceding fragments. */ pending_idx = *((u16 *)skb->data); -xen_netbk_idx_release (netbk, pending_idx); +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_OKAY );for (j = start; j < i; j++) { pending_idx =frag_get_pending_idx (&shinfo->frags[j]); -xen_netbk_idx_release (netbk, pending_idx); +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_OKAY ); }/* Remember the error: invalidate all subsequent fragments. */
@@ -1067,7 +1054,7 @@ static void xen_netbk_fill_frags(struct xen_netbk *netbk, struct sk_buff *skb)/* Take an extra reference to offset xen_netbk_idx_release */ get_page (netbk->mmap_pages[pending_idx]); -xen_netbk_idx_release (netbk, pending_idx); +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_OKAY ); } }
@@ -1452,7 +1439,7 @@ static void xen_netbk_tx_submit(struct xen_netbk *netbk) txp->size -= data_len; }else {/* Schedule a response immediately. */ -xen_netbk_idx_release (netbk, pending_idx); +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_OKAY ); }if (txp->flags & XEN_NETTXF_csum_blank)
@@ -1507,7 +1494,8 @@ static void xen_netbk_tx_action(struct xen_netbk *netbk) } -static void xen_netbk_idx_release (struct xen_netbk *netbk,u16 pending_idx) +static void xen_netbk_idx_release (struct xen_netbk *netbk,u16 pending_idx, +u8 status) {struct xenvif *vif;struct pending_tx_info *pending_tx_info;
@@ -1521,7 +1509,7 @@ static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx) vif = pending_tx_info->vif; -make_tx_response (vif, &pending_tx_info->req,XEN_NETIF_RSP_OKAY ); +make_tx_response (vif, &pending_tx_info->req, status); index =pending_index (netbk->pending_prod++); netbk->pending_ring[index] = pending_idx;
PATCH 58/66 xen/netback: free already allocated memory on failure in xen_netbk_get_requests
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Campbell <[email protected]>
[ Upstream commit 4cc7c1cb7b11b6f3515bd9075527576a1eecc4aa ]
--- drivers/net/xen-netback/netback.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/net/xen-netback/netback.c +12 -1
@@ -950,7 +950,7 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk, pending_idx = netbk->pending_ring[index]; page =xen_netbk_alloc_page (netbk, skb, pending_idx);if (!page) -return NULL ; + goto err; netbk->mmap_pages[pending_idx] = page;
@@ -974,6 +974,17 @@ static struct gnttab_copy *xen_netbk_get_requests(struct xen_netbk *netbk, }return gop; +err: +/* Unwind, freeing all pages and sending error responses. */ +while (i-- > start) { +xen_netbk_idx_release (netbk,frag_get_pending_idx (&frags[i]), +XEN_NETIF_RSP_ERROR ); + } +/* The head too, if necessary. */ +if (start) +xen_netbk_idx_release (netbk, pending_idx,XEN_NETIF_RSP_ERROR ); + +return NULL ; } static int xen_netbk_tx_check_gop(struct xen_netbk *netbk,
PATCH 59/66 netback: correct netbk_tx_err to handle wrap around.
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Campbell <[email protected]>
[ Upstream commit b9149729ebdcfce63f853aa54a404c6a8f6ebbf3 ]
--- drivers/net/xen-netback/netback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/xen-netback/netback.c +1 -1
@@ -852,7 +852,7 @@ static void netbk_tx_err(struct xenvif *vif,do {make_tx_response (vif, txp,XEN_NETIF_RSP_ERROR ); -if (cons >= end) +if (cons == end)break ; txp =RING_GET_REQUEST (&vif->tx, cons++); }while (1 );
PATCH 60/66 tcp: frto should not set snd_cwnd to 0
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 2e5f421211ff76c17130b4597bc06df4eeead24f ]
Commit 9dc274151a548 (tcp: fix ABC in tcp_slow_start()) uncovered a bug in FRTO code :tcp_process_frto() is setting snd_cwnd to 0 if the number of in flight packets is 0.
As Neal pointed out, if no packet is in flight we lost our chance to disambiguate whether a loss timeout was spurious.
We should assume it was a proper loss.
--- net/ipv4/tcp_input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv4/tcp_input.c +2 -1
@@ -3635,7 +3635,8 @@ static int tcp_process_frto(struct sock *sk, int flag) ((tp->frto_counter >= 2) && (flag & FLAG_RETRANS_DATA_ACKED))) tp->undo_marker = 0; -if (!before (tp->snd_una, tp->frto_highmark)) { +if (!before (tp->snd_una, tp->frto_highmark) || + !tcp_packets_in_flight (tp)) {tcp_enter_frto_loss (sk, (tp->frto_counter ==1 ?2 :3 ), flag);return 1 ; }
PATCH 61/66 tcp: fix for zero packets_in_flight was too broad
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilpo Järvinen <[email protected]>
[ Upstream commit 6731d2095bd4aef18027c72ef845ab1087c3ba63 ]
There are transients during normal FRTO procedure during which the packets_in_flight can go to zero between write_queue state updates and firing the resulting segments out. As FRTO processing occurs during that window the check must be more precise to not match "spuriously" :-). More specificly, e.g., when packets_in_flight is zero but FLAG_DATA_ACKED is true the problematic branch that set cwnd into zero would not be taken and new segments might be sent out later.
--- net/ipv4/tcp_input.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
net/ipv4/tcp_input.c +6 -2
@@ -3635,8 +3635,7 @@ static int tcp_process_frto(struct sock *sk, int flag) ((tp->frto_counter >= 2) && (flag & FLAG_RETRANS_DATA_ACKED))) tp->undo_marker = 0; -if (!before (tp->snd_una, tp->frto_highmark) || - !tcp_packets_in_flight (tp)) { +if (!before (tp->snd_una, tp->frto_highmark)) {tcp_enter_frto_loss (sk, (tp->frto_counter ==1 ?2 :3 ), flag);return 1 ; }
@@ -3656,6 +3655,11 @@ static int tcp_process_frto(struct sock *sk, int flag) } }else {if (!(flag &FLAG_DATA_ACKED ) && (tp->frto_counter ==1 )) { +if (!tcp_packets_in_flight (tp)) { +tcp_enter_frto_loss (sk,2 , flag); +return true; + } +/* Prevent sending of new data. */ tp->snd_cwnd =min (tp->snd_cwnd,tcp_packets_in_flight (tp));
PATCH 62/66 tcp: fix MSG_SENDPAGE_NOTLAST logic
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit ae62ca7b03217be5e74759dc6d7698c95df498b3 ]
commit 35f9c09fe9c72e (tcp: tcp_sendpages() should call tcp_push() once) added an internal flag : MSG_SENDPAGE_NOTLAST meant to be set on all frags but the last one for a splice() call.
The condition used to set the flag in pipe_to_sendpage() relied on splice() user passing the exact number of bytes present in the pipe, or a smaller one.
But some programs pass an arbitrary high value, and the test fails.
The effect of this bug is a lack of tcp_push() at the end of a splice(pipe -> socket) call, and possibly very slow or erratic TCP sessions.
We should both test sd->total_len and fact that another fragment is in the pipe (pipe->nrbufs > 1)
Many thanks to Willy for providing very clear bug report, bisection and test programs.
--- fs/splice.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/splice.c +3 -1
@@ -697,8 +697,10 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe,return -EINVAL ; more = (sd->flags &SPLICE_F_MORE ) ?MSG_MORE :0 ; -if (sd->len < sd->total_len) + +if (sd->len < sd->total_len && pipe->nrbufs >1 ) more |=MSG_SENDPAGE_NOTLAST ; +return file->f_op->sendpage (file, buf->page, buf->offset, sd->len, &pos, more); }
PATCH 63/66 bridge: Pull ip header into skb->data before looking into ip header.
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarveshwar Bandi <[email protected]>
[ Upstream commit 6caab7b0544e83e6c160b5e80f5a4a7dd69545c7 ]
If lower layer driver leaves the ip header in the skb fragment, it needs to be first pulled into skb->data before inspecting ip header length or ip version number.
--- net/bridge/br_netfilter.c | 3 +++ 1 file changed, 3 insertions(+)
net/bridge/br_netfilter.c +3 -0
@@ -245,6 +245,9 @@ static int br_parse_ip_options(struct sk_buff *skb)struct net_device *dev = skb->dev;u32 len; +if (!pskb_may_pull (skb,sizeof (struct iphdr ))) + goto inhdr_error; + iph =ip_hdr (skb); opt = &(IPCB (skb)->opt);
PATCH 64/66 tg3: Avoid null pointer dereference in tg3_interrupt in netconsole mode
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nithin Nayak Sujir <[email protected]>
[ Upstream commit 9c13cb8bb477a83b9a3c9e5a5478a4e21294a760 ]
When netconsole is enabled, logging messages generated during tg3_open can result in a null pointer dereference for the uninitialized tg3 status block. Use the irq_sync flag to disable polling in the early stages. irq_sync is cleared when the driver is enabling interrupts after all initialization is completed.
--- drivers/net/ethernet/broadcom/tg3.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/broadcom/tg3.c +4 -0
@@ -6353,6 +6353,9 @@ static void tg3_poll_controller(struct net_device *dev)int i;struct tg3 *tp =netdev_priv (dev); +if (tg3_irq_sync (tp)) +return ; +for (i =0 ; i < tp->irq_cnt; i++)tg3_interrupt (tp->napi[i].irq_vec, &tp->napi[i]); }
@@ -15388,6 +15391,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, tp->pm_cap = pm_cap; tp->rx_mode =TG3_DEF_RX_MODE ; tp->tx_mode =TG3_DEF_TX_MODE ; + tp->irq_sync =1 ;if (tg3_debug >0 ) tp->msg_enable = tg3_debug;
PATCH 65/66 tg3: Fix crc errors on jumbo frame receive
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nithin Nayak Sujir <[email protected]>
[ Upstream commit daf3ec688e057f6060fb9bb0819feac7a8bbf45c ]
TG3_PHY_AUXCTL_SMDSP_ENABLE/DISABLE macros do a blind write to the phy auxiliary control register and overwrite the EXT_PKT_LEN (bit 14) resulting in intermittent crc errors on jumbo frames with some link partners. Change the code to do a read/modify/write.
--- drivers/net/ethernet/broadcom/tg3.c | 58 ++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 23 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +35 -23
@@ -1135,14 +1135,26 @@ static int tg3_phy_auxctl_write(struct tg3 *tp, int reg, u32 set)return tg3_writephy (tp,MII_TG3_AUX_CTRL , set | reg); } -#define TG3_PHY_AUXCTL_SMDSP_ENABLE (tp) \ - tg3_phy_auxctl_write((tp), MII_TG3_AUXCTL_SHDWSEL_AUXCTL, \ - MII_TG3_AUXCTL_ACTL_SMDSP_ENA | \ - MII_TG3_AUXCTL_ACTL_TX_6DB) +static int tg3_phy_toggle_auxctl_smdsp (struct tg3 *tp,bool enable) +{ +u32 val; +int err; + + err =tg3_phy_auxctl_read (tp,MII_TG3_AUXCTL_SHDWSEL_AUXCTL , &val); -#define TG3_PHY_AUXCTL_SMDSP_DISABLE (tp) \ - tg3_phy_auxctl_write((tp), MII_TG3_AUXCTL_SHDWSEL_AUXCTL, \ - MII_TG3_AUXCTL_ACTL_TX_6DB); +if (err) +return err; +if (enable) + + val |=MII_TG3_AUXCTL_ACTL_SMDSP_ENA ; +else + val &= ~MII_TG3_AUXCTL_ACTL_SMDSP_ENA ; + + err =tg3_phy_auxctl_write ((tp),MII_TG3_AUXCTL_SHDWSEL_AUXCTL , + val |MII_TG3_AUXCTL_ACTL_TX_6DB ); + +return err; +}static int tg3_bmcr_reset (struct tg3 *tp) {
@@ -2087,7 +2099,7 @@ static void tg3_phy_apply_otp(struct tg3 *tp) otp = tp->phy_otp; -if (TG3_PHY_AUXCTL_SMDSP_ENABLE (tp)) +if (tg3_phy_toggle_auxctl_smdsp (tp, true))return ; phy = ((otp &TG3_OTP_AGCTGT_MASK ) >>TG3_OTP_AGCTGT_SHIFT );
@@ -2112,7 +2124,7 @@ static void tg3_phy_apply_otp(struct tg3 *tp) ((otp &TG3_OTP_RCOFF_MASK ) >>TG3_OTP_RCOFF_SHIFT );tg3_phydsp_write (tp,MII_TG3_DSP_EXP97 , phy); -TG3_PHY_AUXCTL_SMDSP_DISABLE (tp); +tg3_phy_toggle_auxctl_smdsp (tp, false); }static void tg3_phy_eee_adjust (struct tg3 *tp,u32 current_link_up)
@@ -2148,9 +2160,9 @@ static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)if (!tp->setlpicnt) {if (current_link_up ==1 && - !TG3_PHY_AUXCTL_SMDSP_ENABLE (tp)) { + !tg3_phy_toggle_auxctl_smdsp (tp, true)) {tg3_phydsp_write (tp,MII_TG3_DSP_TAP26 ,0x0000 ); -TG3_PHY_AUXCTL_SMDSP_DISABLE (tp); +tg3_phy_toggle_auxctl_smdsp (tp, false); } val =tr32 (TG3_CPMU_EEE_MODE );
@@ -2166,11 +2178,11 @@ static void tg3_phy_eee_enable(struct tg3 *tp) (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) && - !TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) { + !tg3_phy_toggle_auxctl_smdsp(tp, true)) { val =MII_TG3_DSP_TAP26_ALNOKO |MII_TG3_DSP_TAP26_RMRXSTO ;tg3_phydsp_write (tp,MII_TG3_DSP_TAP26 , val); -TG3_PHY_AUXCTL_SMDSP_DISABLE (tp); +tg3_phy_toggle_auxctl_smdsp (tp, false); } val =tr32 (TG3_CPMU_EEE_MODE );
@@ -2314,7 +2326,7 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)tg3_writephy (tp,MII_CTRL1000 ,CTL1000_AS_MASTER |CTL1000_ENABLE_MASTER ); - err =TG3_PHY_AUXCTL_SMDSP_ENABLE (tp); + err =tg3_phy_toggle_auxctl_smdsp (tp, true);if (err)return err;
@@ -2335,7 +2347,7 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)tg3_writephy (tp,MII_TG3_DSP_ADDRESS ,0x8200 );tg3_writephy (tp,MII_TG3_DSP_CONTROL ,0x0000 ); -TG3_PHY_AUXCTL_SMDSP_DISABLE (tp); +tg3_phy_toggle_auxctl_smdsp (tp, false);tg3_writephy (tp,MII_CTRL1000 , phy9_orig);
@@ -2424,10 +2436,10 @@ static int tg3_phy_reset(struct tg3 *tp) out:if ((tp->phy_flags &TG3_PHYFLG_ADC_BUG ) && - !TG3_PHY_AUXCTL_SMDSP_ENABLE (tp)) { + !tg3_phy_toggle_auxctl_smdsp (tp, true)) {tg3_phydsp_write (tp,0x201f ,0x2aaa );tg3_phydsp_write (tp,0x000a ,0x0323 ); -TG3_PHY_AUXCTL_SMDSP_DISABLE (tp); +tg3_phy_toggle_auxctl_smdsp (tp, false); }if (tp->phy_flags &TG3_PHYFLG_5704_A0_BUG ) {
@@ -2436,14 +2448,14 @@ out: }if (tp->phy_flags &TG3_PHYFLG_BER_BUG ) { -if (!TG3_PHY_AUXCTL_SMDSP_ENABLE (tp)) { +if (!tg3_phy_toggle_auxctl_smdsp (tp, true)) {tg3_phydsp_write (tp,0x000a ,0x310b );tg3_phydsp_write (tp,0x201f ,0x9506 );tg3_phydsp_write (tp,0x401f ,0x14e2 ); -TG3_PHY_AUXCTL_SMDSP_DISABLE (tp); +tg3_phy_toggle_auxctl_smdsp (tp, false); } }else if (tp->phy_flags &TG3_PHYFLG_JITTER_BUG ) { -if (!TG3_PHY_AUXCTL_SMDSP_ENABLE (tp)) { +if (!tg3_phy_toggle_auxctl_smdsp (tp, true)) {tg3_writephy (tp,MII_TG3_DSP_ADDRESS ,0x000a );if (tp->phy_flags &TG3_PHYFLG_ADJUST_TRIM ) {tg3_writephy (tp,MII_TG3_DSP_RW_PORT ,0x110b );
@@ -2452,7 +2464,7 @@ out: }else tg3_writephy (tp,MII_TG3_DSP_RW_PORT ,0x010b ); -TG3_PHY_AUXCTL_SMDSP_DISABLE (tp); +tg3_phy_toggle_auxctl_smdsp (tp, false); } }
@@ -3639,7 +3651,7 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)tw32 (TG3_CPMU_EEE_MODE ,tr32 (TG3_CPMU_EEE_MODE ) & ~TG3_CPMU_EEEMD_LPI_ENABLE ); - err =TG3_PHY_AUXCTL_SMDSP_ENABLE (tp); + err =tg3_phy_toggle_auxctl_smdsp (tp, true);if (!err) {u32 err2;
@@ -3671,7 +3683,7 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl) MII_TG3_DSP_CH34TP2_HIBW01); } - err2 =TG3_PHY_AUXCTL_SMDSP_DISABLE (tp); + err2 =tg3_phy_toggle_auxctl_smdsp (tp, false);if (!err) err = err2; }
PATCH 66/66 x86/xen: dont assume %ds is usable in xen_iret for 32-bit PVOPS.
In reply to Ben Hutchings3.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Beulich <[email protected]>
commit 13d2b4d11d69a92574a55bfd985cfb0ca77aebdc upstream.
This fixes CVE-2013-0228 / XSA-42
Drew Jones while working on CVE-2013-0190 found that that unprivileged guest user in 32bit PV guest can use to crash the > guest with the panic like this:
-------------
general protection fault: 0000 [#1] SMP last sysfs file: /sys/devices/vbd-51712/block/xvda/dev Modules linked in: sunrpc ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4
iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 xen_netfront ext4 mbcache jbd2 xen_blkfront dm_mirror dm_region_hash dm_log dm_mod [last
unloaded: scsi_wait_scan]
Pid: 1250, comm: r Not tainted 2.6.32-356.el6.i686 #1
EIP: 0061:[<c0407462>] EFLAGS: 00010086 CPU: 0
EIP is at xen_iret+0x12/0x2b
EAX: eb8d0000 EBX: 00000001 ECX: 08049860 EDX: 00000010
ESI: 00000000 EDI: 003d0f00 EBP: b77f8388 ESP: eb8d1fe0
DS: 0000 ES: 007b FS: 0000 GS: 00e0 SS: 0069
Process r (pid: 1250, ti=eb8d0000 task=c2953550 task.ti=eb8d0000)
Stack: 00000000 0027f416 00000073 00000206 b77f8364 0000007b 00000000 00000000 Call Trace: Code: c3 8b 44 24 18 81 4c 24 38 00 02 00 00 8d 64 24 30 e9 03 00 00 00 8d 76 00 f7 44 24 08 00 00 02 80 75 33 50 b8 00 e0 ff ff 21 e0 <8b> 40 10 8b 04 85 a0 f6 ab c0 8b 80 0c b0 b3 c0 f6 44 24 0d 02 EIP: [<c0407462>] xen_iret+0x12/0x2b SS:ESP 0069:eb8d1fe0 general protection fault: 0000 [#2] ---[ end trace ab0d29a492dcd330 ]--- Kernel panic - not syncing: Fatal exception Pid: 1250, comm: r Tainted: G D --------------- 2.6.32-356.el6.i686 #1 Call Trace: [<c08476df>] ? panic+0x6e/0x122 [<c084b63c>] ? oops_end+0xbc/0xd0 [<c084b260>] ? do_general_protection+0x0/0x210 [<c084a9b7>] ? error_code+0x73/ -------------
Petr says: "
I've analysed the bug and I think that xen_iret() cannot cope with mangled DS, in this case zeroed out (null selector/descriptor) by either xen_failsafe_callback() or RESTORE_REGS because the corresponding LDT entry was invalidated by the reproducer. "
Jan took a look at the preliminary patch and came up a fix that solves this problem:
"This code gets called after all registers other than those handled by IRET got already restored, hence a null selector in %ds or a non-null one that got loaded from a code or read-only data descriptor would cause a kernel mode fault (with the potential of crashing the kernel as a whole, if panic_on_oops is set)."
The way to fix this is to realize that the we can only relay on the registers that IRET restores. The two that are guaranteed are the %cs and %ss as they are always fixed GDT selectors. Also they are inaccessible from user mode - so they cannot be altered. This is the approach taken in this patch.
Another alternative option suggested by Jan would be to relay on the subtle realization that using the %ebp or %esp relative references uses the %ss segment. In which case we could switch from using %eax to %ebp and would not need the %ss over-rides. That would also require one extra instruction to compensate for the one place where the register is used as scaled index. However Andrew pointed out that is too subtle and if further work was to be done in this code-path it could escape folks attention and lead to accidents.
--- arch/x86/xen/xen-asm_32.S | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
arch/x86/xen/xen-asm_32.S +7 -7
@@ -89,11 +89,11 @@ ENTRY(xen_iret) */ #ifdef CONFIG_SMP GET_THREAD_INFO(%eax) - movl TI_cpu(%eax), %eax - movl __per_cpu_offset(,%eax,4), %eax - mov xen_vcpu(%eax), %eax + movl %ss:TI_cpu(%eax), %eax + movl %ss:__per_cpu_offset(,%eax,4), %eax + mov %ss:xen_vcpu(%eax), %eax #else - movl xen_vcpu, %eax + movl %ss:xen_vcpu, %eax #endif /* check IF state we're restoring */
@@ -106,11 +106,11 @@ ENTRY(xen_iret) * resuming the code, so we don't have to be worried about * being preempted to another CPU. */ - setz XEN_vcpu_info_mask(%eax) + setz %ss:XEN_vcpu_info_mask(%eax) xen_iret_start_crit: /* check for unmasked and pending */ - cmpw $0x0001, XEN_vcpu_info_pending(%eax) + cmpw $0x0001, %ss:XEN_vcpu_info_pending(%eax) /* * If there's something pending, mask events again so we can
@@ -118,7 +118,7 @@ xen_iret_start_crit: * touch XEN_vcpu_info_mask. */ jne 1f - movb $1, XEN_vcpu_info_mask(%eax) + movb $1, %ss:XEN_vcpu_info_mask(%eax) 1: popl %eax
This is the combined patch for 3.2.39-rc1 relative to 3.2.38.
Ben.
Signature · 2 lines
Ben Hutchings Sturgeon's Law: Ninety percent of everything is crap.
MAINTAINERS +3 -3
@@ -2584,7 +2584,7 @@ S: Maintained F: drivers/net/ethernet/i825xx/eexpress.* ETHERNET BRIDGE -M: Stephen Hemminger <[email protected]> +M: Stephen Hemminger <[email protected]> L: [email protected] L: [email protected] W: http://www.linuxfoundation.org/en/Net:Bridge
@@ -4475,7 +4475,7 @@ S: Supported F: drivers/infiniband/hw/nes/ NETEM NETWORK EMULATOR -M: Stephen Hemminger <[email protected]> +M: Stephen Hemminger <[email protected]> L: [email protected] S: Maintained F: net/sched/sch_netem.c
@@ -5993,7 +5993,7 @@ S: Maintained F: drivers/usb/misc/sisusbvga/ SKGE, SKY2 10/100/1000 GIGABIT ETHERNET DRIVERS -M: Stephen Hemminger <[email protected]> +M: Stephen Hemminger <[email protected]> L: [email protected] S: Maintained F: drivers/net/ethernet/marvell/sk*
Makefile +2 -2
@@ -1,7 +1,7 @@ VERSION = 3 PATCHLEVEL = 2 -SUBLEVEL = 38 -EXTRAVERSION = +SUBLEVEL = 39 +EXTRAVERSION = -rc1 NAME = Saber-toothed Squirrel # *DOCUMENTATION*
arch/x86/ia32/ia32entry.S +2 -2
@@ -208,7 +208,7 @@ sysexit_from_sys_call: testl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10) jnz ia32_ret_from_sys_call TRACE_IRQS_ON - sti + ENABLE_INTERRUPTS(CLBR_NONE) movl %eax,%esi /* second arg, syscall return value */ cmpl $0,%eax /* is it < 0? */ setl %al /* 1 if so, 0 if not */
@@ -218,7 +218,7 @@ sysexit_from_sys_call: GET_THREAD_INFO(%r10) movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall return value */ movl $(_TIF_ALLWORK_MASK & ~_TIF_SYSCALL_AUDIT),%edi - cli + DISABLE_INTERRUPTS(CLBR_NONE) TRACE_IRQS_OFF testl %edi,TI_flags(%r10) jz \exit
arch/x86/kernel/step.c +34 -20
72 lines not on this page · raw message
arch/x86/xen/xen-asm_32.S +7 -7
@@ -88,11 +88,11 @@ ENTRY(xen_iret) */ #ifdef CONFIG_SMP GET_THREAD_INFO(%eax) - movl TI_cpu(%eax), %eax - movl __per_cpu_offset(,%eax,4), %eax - mov xen_vcpu(%eax), %eax + movl %ss:TI_cpu(%eax), %eax + movl %ss:__per_cpu_offset(,%eax,4), %eax + mov %ss:xen_vcpu(%eax), %eax #else - movl xen_vcpu, %eax + movl %ss:xen_vcpu, %eax #endif /* check IF state we're restoring */
@@ -105,11 +105,11 @@ ENTRY(xen_iret) * resuming the code, so we don't have to be worried about * being preempted to another CPU. */ - setz XEN_vcpu_info_mask(%eax) + setz %ss:XEN_vcpu_info_mask(%eax) xen_iret_start_crit: /* check for unmasked and pending */ - cmpw $0x0001, XEN_vcpu_info_pending(%eax) + cmpw $0x0001, %ss:XEN_vcpu_info_pending(%eax) /* * If there's something pending, mask events again so we can
@@ -117,7 +117,7 @@ xen_iret_start_crit: * touch XEN_vcpu_info_mask. */ jne 1f - movb $1, XEN_vcpu_info_mask(%eax) + movb $1, %ss:XEN_vcpu_info_mask(%eax) 1: popl %eax
drivers/ata/ahci.c +27 -5
@@ -52,7 +52,9 @@#define DRV_VERSION "3.0"enum { -AHCI_PCI_BAR =5 , +AHCI_PCI_BAR_STA2X11 =0 , +AHCI_PCI_BAR_ENMOTUS =2 , +AHCI_PCI_BAR_STANDARD =5 , };enum board_ids {
@@ -375,6 +377,9 @@ static const struct pci_device_id ahci_pci_tbl[] = { { PCI_VDEVICE(SI, 0x1185), board_ahci }, /* SiS 968 */ { PCI_VDEVICE(SI, 0x0186), board_ahci }, /* SiS 968 */ +/* ST Microelectronics */ + { PCI_VDEVICE(STMICRO, 0xCC06), board_ahci }, /* ST ConneXt */ +/* Marvell */ { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */
@@ -400,6 +405,9 @@ static const struct pci_device_id ahci_pci_tbl[] = { { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */ { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */ +/* Enmotus */ + { PCI_DEVICE(0x1c44, 0x8000), board_ahci }, +/* Generic, PCI class code for AHCI */ { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci },
@@ -629,6 +637,13 @@ static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac) {int rc; +/* +* If the device fixup already set the dma_mask to some non-standard +* value, don't extend it here. This happens on STA2X11, for example. +*/ +if (pdev->dma_mask && pdev->dma_mask <DMA_BIT_MASK (32 )) +return 0 ; +if (using_dac && !pci_set_dma_mask (pdev,DMA_BIT_MASK (64 ))) { rc =pci_set_consistent_dma_mask (pdev,DMA_BIT_MASK (64 ));
@@ -1033,6 +1048,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)struct ahci_host_priv *hpriv;struct ata_host *host;int n_ports, i, rc; +int ahci_pci_bar =AHCI_PCI_BAR_STANDARD ;VPRINTK ("ENTER\n" );
@@ -1064,6 +1080,12 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)dev_info (&pdev->dev,"PDC42819 can only drive SATA devices with this driver\n" ); +/* Both Connext and Enmotus devices use non-standard BARs */ +if (pdev->vendor ==PCI_VENDOR_ID_STMICRO && pdev->device ==0xCC06 ) + ahci_pci_bar =AHCI_PCI_BAR_STA2X11 ; +else if (pdev->vendor ==0x1c44 && pdev->device ==0x8000 ) + ahci_pci_bar =AHCI_PCI_BAR_ENMOTUS ; +/* acquire resources */ rc =pcim_enable_device (pdev);if (rc)
@@ -1072,7 +1094,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)/* AHCI controllers often implement SFF compatible interface. * Grab all PCI BARs just in case. */ - rc =pcim_iomap_regions_request_all (pdev,1 <<AHCI_PCI_BAR ,DRV_NAME ); + rc =pcim_iomap_regions_request_all (pdev,1 << ahci_pci_bar,DRV_NAME );if (rc == -EBUSY )pcim_pin_device (pdev);if (rc)
@@ -1115,7 +1137,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)if ((hpriv->flags &AHCI_HFLAG_NO_MSI ) ||pci_enable_msi (pdev))pci_intx (pdev,1 ); - hpriv->mmio =pcim_iomap_table (pdev)[AHCI_PCI_BAR ]; + hpriv->mmio =pcim_iomap_table (pdev)[ahci_pci_bar];/* save initial config */ ahci_pci_save_initial_config (pdev, hpriv);
@@ -1179,8 +1201,8 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)for (i =0 ; i < host->n_ports; i++) {struct ata_port *ap = host->ports[i]; -ata_port_pbar_desc (ap,AHCI_PCI_BAR ,-1 ,"abar" ); -ata_port_pbar_desc (ap,AHCI_PCI_BAR , +ata_port_pbar_desc (ap, ahci_pci_bar,-1 ,"abar" ); +ata_port_pbar_desc (ap, ahci_pci_bar,0x100 + ap->port_no *0x80 ,"port" );/* set enclosure management message type */
drivers/atm/iphase.h +73 -73
155 lines not on this page · raw message
drivers/char/virtio_console.c +2 -1
@@ -1789,7 +1789,8 @@ static void virtcons_remove(struct virtio_device *vdev)/* Disable interrupts for vqs */ vdev->config->reset (vdev);/* Finish up work that's lined up */ -cancel_work_sync (&portdev->control_work); +if (use_multiport (portdev)) +cancel_work_sync (&portdev->control_work);list_for_each_entry_safe (port, port2, &portdev->ports, list)unplug_port (port);
drivers/gpu/drm/i915/intel_display.c +2 -2
@@ -7156,8 +7156,6 @@ static int intel_gen4_queue_flip(struct drm_device *dev,OUT_RING (pf | pipesrc);intel_mark_page_flip_active (intel_crtc); - -intel_mark_page_flip_active (intel_crtc);ADVANCE_LP_RING ();return 0 ;
@@ -7193,6 +7191,8 @@ static int intel_gen6_queue_flip(struct drm_device *dev, pf =I915_READ (PF_CTL (intel_crtc->pipe)) &PF_ENABLE ; pipesrc =I915_READ (PIPESRC (intel_crtc->pipe)) &0x0fff0fff ;OUT_RING (pf | pipesrc); + +intel_mark_page_flip_active (intel_crtc);ADVANCE_LP_RING ();return 0 ;
drivers/gpu/drm/radeon/radeon_combios.c +8 -0
@@ -2455,6 +2455,14 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) 1), ATOM_DEVICE_CRT1_SUPPORT); } +/* RV100 board with external TDMS bit mis-set. +* Actually uses internal TMDS, clear the bit. +*/ +if (dev->pdev->device ==0x5159 && + dev->pdev->subsystem_vendor ==0x1014 && + dev->pdev->subsystem_device ==0x029A ) { + tmp &= ~(1 <<4 ); + }if ((tmp >>4 ) &0x1 ) { devices |=ATOM_DEVICE_DFP2_SUPPORT ; radeon_add_legacy_encoder(dev,
drivers/gpu/drm/radeon/radeon_display.c +3 -1
@@ -1110,8 +1110,10 @@ radeon_user_framebuffer_create(struct drm_device *dev, } radeon_fb =kzalloc (sizeof (*radeon_fb),GFP_KERNEL ); -if (radeon_fb ==NULL ) +if (radeon_fb ==NULL ) { +drm_gem_object_unreference_unlocked (obj);return ERR_PTR (-ENOMEM ); + }radeon_framebuffer_init (dev, radeon_fb, mode_cmd, obj);
drivers/gpu/drm/radeon/radeon_ring.c +3 -0
@@ -306,6 +306,9 @@ int radeon_ring_alloc(struct radeon_device *rdev, unsigned ndw) {int r; +/* make sure we aren't trying to allocate more space than there is on the ring */ +if (ndw > (rdev->cp.ring_size /4 )) +return -ENOMEM ;/* Align requested size with padding so unlock_commit can * pad safely */ ndw = (ndw + rdev->cp.align_mask) & ~rdev->cp.align_mask;
drivers/hid/hid-ids.h +3 -0
@@ -278,6 +278,9 @@#define USB_VENDOR_ID_EZKEY 0x0518#define USB_DEVICE_ID_BTC_8193 0x0002 +#define USB_VENDOR_ID_FORMOSA 0x147a +#define USB_DEVICE_ID_FORMOSA_IR_RECEIVER 0xe03e +#define USB_VENDOR_ID_FREESCALE 0x15A2#define USB_DEVICE_ID_FREESCALE_MX28 0x004F
drivers/hid/usbhid/hid-quirks.c +1 -0
@@ -68,6 +68,7 @@ static const struct hid_blacklist { { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET }, { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, + { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET }, { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS },
drivers/isdn/gigaset/capi.c +2 -0
@@ -264,6 +264,8 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag,CAPIMSG_APPID (data),CAPIMSG_MSGID (data), l, CAPIMSG_CONTROL(data)); l -=12 ; +if (l <=0 ) +return ; dbgline =kmalloc (3 *l,GFP_ATOMIC );if (!dbgline)return ;
drivers/media/video/gspca/kinect.c +1 -0
@@ -390,6 +390,7 @@ static const struct sd_desc sd_desc = {/* -- module initialisation -- */ static const struct usb_device_id device_table[] = { {USB_DEVICE (0x045e ,0x02ae )}, + {USB_DEVICE (0x045e ,0x02bf )}, {} };
drivers/net/can/c_can/c_can.c +5 -1
@@ -446,8 +446,12 @@ static void c_can_setup_receive_object(struct net_device *dev, int iface, priv->write_reg (priv, &priv->regs->ifregs[iface].mask1,IFX_WRITE_LOW_16BIT (mask)); + +/* According to C_CAN documentation, the reserved bit +* in IFx_MASK2 register is fixed 1 +*/ priv->write_reg (priv, &priv->regs->ifregs[iface].mask2, -IFX_WRITE_HIGH_16BIT (mask)); +IFX_WRITE_HIGH_16BIT (mask) |BIT (13 )); priv->write_reg (priv, &priv->regs->ifregs[iface].arb1,IFX_WRITE_LOW_16BIT (id));
drivers/net/ethernet/broadcom/tg3.c +39 -23
158 lines not on this page · raw message
drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +1 -1
@@ -144,7 +144,7 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter) buffrag->length, PCI_DMA_TODEVICE); buffrag->dma =0ULL ; } -for (j =0 ; j < cmd_buf->frag_count; j++) { +for (j =1 ; j < cmd_buf->frag_count; j++) { buffrag++;if (buffrag->dma) { pci_unmap_page(adapter->pdev, buffrag->dma,
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +2 -0
@@ -1924,10 +1924,12 @@ unwind:while (--i >=0 ) { nf = &pbuf->frag_array[i+1 ];pci_unmap_page (pdev, nf->dma, nf->length,PCI_DMA_TODEVICE ); + nf->dma =0ULL ; } nf = &pbuf->frag_array[0 ];pci_unmap_single (pdev, nf->dma,skb_headlen (skb),PCI_DMA_TODEVICE ); + nf->dma =0ULL ; out_err:return -ENOMEM ;
drivers/net/ethernet/realtek/r8169.c +0 -7
@@ -5829,13 +5829,6 @@ static int rtl8169_rx_interrupt(struct net_device *dev, dev->stats.rx_bytes += pkt_size; dev->stats.rx_packets++; } - -/* Work around for AMD plateform. */ -if ((desc->opts2 &cpu_to_le32 (0xfffe000 )) && - (tp->mac_version ==RTL_GIGA_MAC_VER_05 )) { - desc->opts2 =0 ; - cur_rx++; - } } count = cur_rx - tp->cur_rx;
drivers/net/loopback.c +5 -0
@@ -78,6 +78,11 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,skb_orphan (skb); +/* Before queueing this packet to netif_rx(), +* make sure dst is refcounted. +*/ +skb_dst_force (skb); + skb->protocol =eth_type_trans (skb, dev);/* it's OK to use per_cpu_ptr() because BHs are off */
drivers/net/wireless/mwifiex/scan.c +5 -4
@@ -1594,7 +1594,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,dev_err (adapter->dev,"SCAN_RESP: too many AP returned (%d)\n" , scan_rsp->number_of_sets); ret =-1 ; - goto done; + goto check_next_scan; } bytes_left =le16_to_cpu (scan_rsp->bss_descript_size);
@@ -1663,7 +1663,8 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,if (!beacon_size || beacon_size > bytes_left) { bss_info += bytes_left; bytes_left =0 ; -return -1 ; + ret =-1 ; + goto check_next_scan; }/* Initialize the current working beacon pointer for this BSS
@@ -1716,7 +1717,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,dev_err (priv->adapter->dev,"%s: in processing" " IE, bytes left < IE length\n" , __func__); - goto done; + goto check_next_scan; }if (element_id ==WLAN_EID_DS_PARAMS ) { channel = *(u8 *) (current_ptr +
@@ -1782,6 +1783,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, } } +check_next_scan:spin_lock_irqsave (&adapter->scan_pending_q_lock, flags);if (list_empty (&adapter->scan_pending_q)) {spin_unlock_irqrestore (&adapter->scan_pending_q_lock, flags);
@@ -1812,7 +1814,6 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,mwifiex_insert_cmd_to_pending_q (adapter, cmd_node, true); } -done:return ret; }
drivers/net/wireless/rt2x00/rt2500usb.c +1 -1
@@ -1921,7 +1921,7 @@ static struct usb_device_id rt2500usb_device_table[] = { { USB_DEVICE(0x0b05, 0x1706) }, { USB_DEVICE(0x0b05, 0x1707) },/* Belkin */ - { USB_DEVICE(0x050d, 0x7050) }, + { USB_DEVICE(0x050d, 0x7050) }, /* FCC ID: K7SF5D7050A ver. 2.x */ { USB_DEVICE(0x050d, 0x7051) },/* Cisco Systems */ { USB_DEVICE(0x13b1, 0x000d) },
drivers/net/wireless/rt2x00/rt2800usb.c +2 -0
@@ -959,6 +959,7 @@ static struct usb_device_id rt2800usb_device_table[] = { { USB_DEVICE(0x07d1, 0x3c15) }, { USB_DEVICE(0x07d1, 0x3c16) }, { USB_DEVICE(0x2001, 0x3c1b) }, + { USB_DEVICE(0x2001, 0x3c1e) },/* Draytek */ { USB_DEVICE(0x07fa, 0x7712) },/* DVICO */
@@ -1090,6 +1091,7 @@ static struct usb_device_id rt2800usb_device_table[] = { { USB_DEVICE(0x177f, 0x0153) }, { USB_DEVICE(0x177f, 0x0302) }, { USB_DEVICE(0x177f, 0x0313) }, + { USB_DEVICE(0x177f, 0x0323) },/* U-Media */ { USB_DEVICE(0x157e, 0x300e) }, { USB_DEVICE(0x157e, 0x3013) },
drivers/net/wireless/rt2x00/rt73usb.c +1 -0
@@ -2421,6 +2421,7 @@ static struct usb_device_id rt73usb_device_table[] = { { USB_DEVICE(0x0b05, 0x1723) }, { USB_DEVICE(0x0b05, 0x1724) },/* Belkin */ + { USB_DEVICE(0x050d, 0x7050) }, /* FCC ID: K7SF5D7050B ver. 3.x */ { USB_DEVICE(0x050d, 0x705a) }, { USB_DEVICE(0x050d, 0x905b) }, { USB_DEVICE(0x050d, 0x905c) },
drivers/net/wireless/rtlwifi/usb.c +2 -2
@@ -503,8 +503,8 @@ static void _rtl_rx_pre_process(struct ieee80211_hw *hw, struct sk_buff *skb)WARN_ON (skb_queue_empty (&rx_queue));while (!skb_queue_empty (&rx_queue)) { _skb =skb_dequeue (&rx_queue); -_rtl_usb_rx_process_agg (hw, skb); -ieee80211_rx_irqsafe (hw, skb); +_rtl_usb_rx_process_agg (hw, _skb); +ieee80211_rx_irqsafe (hw, _skb); } }
drivers/net/xen-netback/common.h +3 -0
@@ -151,6 +151,9 @@ void xen_netbk_queue_tx_skb(struct xenvif *vif, struct sk_buff *skb);/* Notify xenvif that ring now has space to send an skb to the frontend */ void xenvif_notify_tx_completion (struct xenvif *vif); +/* Prevent the device from generating any further traffic. */ +void xenvif_carrier_off (struct xenvif *vif); +/* Returns number of ring slots required to send an skb to the frontend */ unsigned int xen_netbk_count_skb_slots (struct xenvif *vif,struct sk_buff *skb);
drivers/net/xen-netback/interface.c +14 -9
@@ -342,17 +342,22 @@ err:return err; } -void xenvif_disconnect (struct xenvif *vif) +void xenvif_carrier_off (struct xenvif *vif) {struct net_device *dev = vif->dev; -if (netif_carrier_ok (dev)) { -rtnl_lock (); -netif_carrier_off (dev);/* discard queued packets */ -if (netif_running (dev)) -xenvif_down (vif); -rtnl_unlock (); -xenvif_put (vif); - } + +rtnl_lock (); +netif_carrier_off (dev);/* discard queued packets */ +if (netif_running (dev)) +xenvif_down (vif); +rtnl_unlock (); +xenvif_put (vif); +} + +void xenvif_disconnect (struct xenvif *vif) +{ +if (netif_carrier_ok (vif->dev)) +xenvif_carrier_off (vif);atomic_dec (&vif->refcnt);wait_event (vif->waiting_to_free,atomic_read (&vif->refcnt) ==0 );
drivers/net/xen-netback/netback.c +71 -44
288 lines not on this page · raw message
drivers/rtc/rtc-isl1208.c +3 -0
@@ -494,6 +494,7 @@ isl1208_rtc_interrupt(int irq, void *data) {unsigned long timeout = jiffies +msecs_to_jiffies (1000 );struct i2c_client *client = data; +struct rtc_device *rtc =i2c_get_clientdata (client);int handled =0 , sr, err;/*
@@ -516,6 +517,8 @@ isl1208_rtc_interrupt(int irq, void *data)if (sr &ISL1208_REG_SR_ALM ) {dev_dbg (&client->dev,"alarm!\n" ); +rtc_update_irq (rtc,1 ,RTC_IRQF |RTC_AF ); +/* Clear the alarm */ sr &= ~ISL1208_REG_SR_ALM ; sr =i2c_smbus_write_byte_data (client,ISL1208_REG_SR , sr);
drivers/rtc/rtc-pl031.c +5 -3
@@ -44,6 +44,7 @@#define RTC_YMR 0x34/* Year match register */ #define RTC_YLR 0x38/* Year data load register */ +#define RTC_CR_EN (1 << 0)/* counter enable bit */ #define RTC_CR_CWEN (1 << 26)/* Clockwatch enable bit */ #define RTC_TCR_EN (1 << 1)/* Periodic timer enable bit */
@@ -312,7 +313,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)int ret;struct pl031_local *ldata;struct rtc_class_ops *ops = id->data; -unsigned long time; +unsigned long time, data; ret =amba_request_regions (adev,NULL );if (ret)
@@ -339,10 +340,11 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)dev_dbg (&adev->dev,"designer ID = 0x%02x\n" , ldata->hw_designer);dev_dbg (&adev->dev,"revision = 0x%01x\n" , ldata->hw_revision); + data =readl (ldata->base +RTC_CR );/* Enable the clockwatch on ST Variants */ if (ldata->hw_designer ==AMBA_VENDOR_ST ) -writel (readl (ldata->base +RTC_CR ) |RTC_CR_CWEN , - ldata->base +RTC_CR ); + data |=RTC_CR_CWEN ; +writel (data |RTC_CR_EN , ldata->base +RTC_CR );/* * On ST PL031 variants, the RTC reset value does not provide correct
drivers/usb/host/ehci-sched.c +1 -1
@@ -236,7 +236,7 @@ static inline unsigned char tt_start_uframe(struct ehci_hcd *ehci, __hc32 mask) }static const unsigned char -max_tt_usecs[] = {125 ,125 ,125 ,125 ,125 ,125 ,30 ,0 }; +max_tt_usecs[] = {125 ,125 ,125 ,125 ,125 ,125 ,125 ,25 };/* carryover low/fullspeed bandwidth that crosses uframe boundries */ static inline void carryover_tt_bandwidth (unsigned short tt_usecs[8 ])
drivers/usb/host/pci-quirks.c +1 -0
@@ -780,6 +780,7 @@ void usb_enable_xhci_ports(struct pci_dev *xhci_pdev) "defaulting to EHCI.\n");dev_warn (&xhci_pdev->dev,"USB 3.0 devices will work at USB 2.0 speeds.\n" ); +usb_disable_xhci_ports (xhci_pdev);return ; }
drivers/usb/host/xhci-ring.c +8 -3
@@ -2504,6 +2504,8 @@ cleanup: (trb_comp_code != COMP_STALL && trb_comp_code != COMP_BABBLE))xhci_urb_free_priv (xhci, urb_priv); + else +kfree (urb_priv );usb_hcd_unlink_urb_from_ep (bus_to_hcd (urb->dev->bus), urb); if ((urb->actual_length != urb->transfer_buffer_length &&
@@ -3032,7 +3034,7 @@ static u32 xhci_v1_0_td_remainder(int running_total, int trb_buff_len,* running_total. */ packets_transferred = (running_total + trb_buff_len) / -usb_endpoint_maxp (&urb->ep->desc); +GET_MAX_PACKET (usb_endpoint_maxp (&urb->ep->desc));if ((total_packet_count - packets_transferred) >31 )return 31 <<17 ;
@@ -3594,7 +3596,8 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, td_len = urb->iso_frame_desc[i].length; td_remain_len = td_len; total_packet_count =DIV_ROUND_UP (td_len, -usb_endpoint_maxp (&urb->ep->desc)); +GET_MAX_PACKET ( +usb_endpoint_maxp (&urb->ep->desc)));/* A zero-length transfer still involves at least one packet. */ if (total_packet_count ==0 ) total_packet_count++;
@@ -3617,9 +3620,11 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, td = urb_priv->td[i];for (j =0 ; j < trbs_per_td; j++) {u32 remainder =0 ; - field =TRB_TBC (burst_count) |TRB_TLBPC (residue); + field =0 ;if (first_trb) { + field =TRB_TBC (burst_count) | +TRB_TLBPC (residue);/* Queue the isoc TRB */ field |=TRB_TYPE (TRB_ISOC );/* Assume URB_ISO_ASAP is set */
drivers/usb/serial/ftdi_sio.c +2 -0
@@ -590,6 +590,7 @@ static struct usb_device_id id_table_combined [] = {/* * ELV devices: */ + { USB_DEVICE(FTDI_ELV_VID, FTDI_ELV_WS300_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) },
@@ -676,6 +677,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_5_PID) }, { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_6_PID) }, { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) },
drivers/usb/serial/ftdi_sio_ids.h +8 -1
@@ -147,6 +147,11 @@#define XSENS_CONVERTER_6_PID 0xD38E#define XSENS_CONVERTER_7_PID 0xD38F +/** +* Zolix (www.zolix.com.cb) product ids +*/ +#define FTDI_OMNI1509 0xD491/* Omni1509 embedded USB-serial */ +/* * NDI (www.ndigital.com) product ids */
@@ -204,7 +209,7 @@/* * ELV USB devices submitted by Christian Abt of ELV (www.elv.de). -* All of these devices use FTDI's vendor ID (0x0403). +* Almost all of these devices use FTDI's vendor ID (0x0403). * Further IDs taken from ELV Windows .inf file. * * The previously included PID for the UO 100 module was incorrect.
@@ -212,6 +217,8 @@* * Armin Laeuger originally sent the PID for the UM 100 module. */ +#define FTDI_ELV_VID 0x1B1F/* ELV AG */ +#define FTDI_ELV_WS300_PID 0xC006/* eQ3 WS 300 PC II */ #define FTDI_ELV_USR_PID 0xE000/* ELV Universal-Sound-Recorder */ #define FTDI_ELV_MSM1_PID 0xE001/* ELV Mini-Sound-Modul */ #define FTDI_ELV_KL100_PID 0xE002/* ELV Kfz-Leistungsmesser KL 100 */
drivers/usb/serial/option.c +13 -0
@@ -242,6 +242,7 @@ static void option_instat_callback(struct urb *urb);#define TELIT_PRODUCT_CC864_DUAL 0x1005#define TELIT_PRODUCT_CC864_SINGLE 0x1006#define TELIT_PRODUCT_DE910_DUAL 0x1010 +#define TELIT_PRODUCT_LE920 0x1200/* ZTE PRODUCTS */ #define ZTE_VENDOR_ID 0x19d2
@@ -453,6 +454,10 @@ static void option_instat_callback(struct urb *urb);#define TPLINK_VENDOR_ID 0x2357#define TPLINK_PRODUCT_MA180 0x0201 +/* Changhong products */ +#define CHANGHONG_VENDOR_ID 0x2077 +#define CHANGHONG_PRODUCT_CH690 0x7001 +/* some devices interfaces need special handling due to a number of reasons */ enum option_blacklist_reason {OPTION_BLACKLIST_NONE =0 ,
@@ -534,6 +539,11 @@ static const struct option_blacklist_info zte_1255_blacklist = { .reserved = BIT(3) | BIT(4), }; +static const struct option_blacklist_info telit_le920_blacklist = { + .sendsetup =BIT (0 ), + .reserved =BIT (1 ) |BIT (5 ), +}; +static const struct usb_device_id option_ids[] = { {USB_DEVICE (OPTION_VENDOR_ID ,OPTION_PRODUCT_COLT ) }, {USB_DEVICE (OPTION_VENDOR_ID ,OPTION_PRODUCT_RICOLA ) },
@@ -784,6 +794,8 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_DUAL) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920), + .driver_info = (kernel_ulong_t)&telit_le920_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff), .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
@@ -1318,6 +1330,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) }, { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, + { USB_DEVICE(CHANGHONG_VENDOR_ID, CHANGHONG_PRODUCT_CH690) }, { } /* Terminating entry */ };MODULE_DEVICE_TABLE (usb, option_ids);
drivers/usb/serial/qcserial.c +1 -0
@@ -55,6 +55,7 @@ static const struct usb_device_id id_table[] = { {DEVICE_G1K(0x05c6, 0x9221)}, /* Generic Gobi QDL device */ {DEVICE_G1K(0x05c6, 0x9231)}, /* Generic Gobi QDL device */ {DEVICE_G1K(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ + {DEVICE_G1K(0x1bc7, 0x900e)}, /* Telit Gobi QDL device *//* Gobi 2000 devices */ {USB_DEVICE(0x1410, 0xa010)}, /* Novatel Gobi 2000 QDL device */
drivers/usb/storage/initializers.c +74 -2
85 lines not on this page · raw message
drivers/usb/storage/initializers.h +2 -2
@@ -46,5 +46,5 @@ int usb_stor_euscsi_init(struct us_data *us);* flash reader */ int usb_stor_ucr61s2b_init (struct us_data *us); -/* This places the HUAWEI E220 devices in multi-port mode */ -int usb_stor_huawei_e220_init (struct us_data *us); +/* This places the HUAWEI usb dongles in multi-port mode */ +int usb_stor_huawei_init (struct us_data *us);
drivers/usb/storage/unusual_devs.h +2 -327
337 lines not on this page · raw message
drivers/usb/storage/usb.c +12 -0
@@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental list of device IDs and their quirks"); .useTransport = use_transport, \ } +#define UNUSUAL_VENDOR_INTF (idVendor, cl, sc, pr, \ + vendor_name, product_name, use_protocol, use_transport, \ + init_function, Flags) \ +{ \ + .vendorName = vendor_name, \ + .productName = product_name, \ + .useProtocol = use_protocol, \ + .useTransport = use_transport, \ + .initFunction = init_function, \ +} +static struct us_unusual_dev us_unusual_dev_list[] = { # include "unusual_devs.h" { }/* Terminating entry */
@@ -128,6 +139,7 @@ static struct us_unusual_dev us_unusual_dev_list[] = {#undef UNUSUAL_DEV#undef COMPLIANT_DEV#undef USUAL_DEV +#undef UNUSUAL_VENDOR_INTF#ifdef CONFIG_PM /* Minimal support for suspend and resume */
drivers/usb/storage/usual-tables.c +15 -0
@@ -46,6 +46,20 @@ { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \ .driver_info = ((useType)<<24) } +/* Define the device is matched with Vendor ID and interface descriptors */ +#define UNUSUAL_VENDOR_INTF (id_vendor, cl, sc, pr, \ + vendorName, productName, useProtocol, useTransport, \ + initFunction, flags) \ +{ \ + .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ + | USB_DEVICE_ID_MATCH_VENDOR, \ + .idVendor = (id_vendor), \ + .bInterfaceClass = (cl), \ + .bInterfaceSubClass = (sc), \ + .bInterfaceProtocol = (pr), \ + .driver_info = (flags) \ +} +struct usb_device_id usb_storage_usb_ids[] = { # include "unusual_devs.h" { }/* Terminating entry */
@@ -57,6 +71,7 @@ MODULE_DEVICE_TABLE(usb, usb_storage_usb_ids);#undef UNUSUAL_DEV#undef COMPLIANT_DEV#undef USUAL_DEV +#undef UNUSUAL_VENDOR_INTF/*
fs/nilfs2/ioctl.c +4 -1
@@ -664,8 +664,11 @@ static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp,if (ret <0 )printk (KERN_ERR "NILFS: GC failed during preparation: " "cannot read source blocks: err=%d\n" , ret); -else +else { +if (nilfs_sb_need_update (nilfs)) +set_nilfs_discontinued (nilfs); ret =nilfs_clean_segments (inode->i_sb, argv, kbufs); + }nilfs_remove_all_gcinodes (nilfs);clear_nilfs_gc_running (nilfs);
fs/splice.c +3 -1
@@ -697,8 +697,10 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe,return -EINVAL ; more = (sd->flags &SPLICE_F_MORE ) ?MSG_MORE :0 ; -if (sd->len < sd->total_len) + +if (sd->len < sd->total_len && pipe->nrbufs >1 ) more |=MSG_SENDPAGE_NOTLAST ; +return file->f_op->sendpage (file, buf->page, buf->offset, sd->len, &pos, more); }
include/linux/sched.h +10 -1
@@ -2597,7 +2597,16 @@ static inline void thread_group_cputime_init(struct signal_struct *sig)extern void recalc_sigpending_and_wake (struct task_struct *t);extern void recalc_sigpending (void ); -extern void signal_wake_up (struct task_struct *t,int resume_stopped); +extern void signal_wake_up_state (struct task_struct *t,unsigned int state); + +static inline void signal_wake_up (struct task_struct *t,bool resume) +{ +signal_wake_up_state (t, resume ?TASK_WAKEKILL :0 ); +} +static inline void ptrace_signal_wake_up (struct task_struct *t,bool resume) +{ +signal_wake_up_state (t, resume ? __TASK_TRACED :0 ); +}/* * Wrappers for p->thread_info->cpu access. No-op on UP.
kernel/ptrace.c +58 -14
128 lines not on this page · raw message
kernel/resource.c +38 -12
65 lines not on this page · raw message
kernel/sched.c +2 -1
@@ -2924,7 +2924,8 @@ out:*/ int wake_up_process (struct task_struct *p) { -return try_to_wake_up (p,TASK_ALL ,0 ); +WARN_ON (task_is_stopped_or_traced (p)); +return try_to_wake_up (p,TASK_NORMAL ,0 ); }EXPORT_SYMBOL (wake_up_process);
kernel/sched_rt.c +1 -1
@@ -384,7 +384,7 @@ static inline struct rt_bandwidth *sched_rt_bandwidth(struct rt_rq *rt_rq)static int do_balance_runtime (struct rt_rq *rt_rq) {struct rt_bandwidth *rt_b =sched_rt_bandwidth (rt_rq); -struct root_domain *rd =cpu_rq (smp_processor_id ())->rd; +struct root_domain *rd =rq_of_rt_rq (rt_rq)->rd;int i, weight, more =0 ;u64 rt_period;
kernel/signal.c +9 -10
@@ -676,23 +676,17 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)* No need to set need_resched since signal event passing * goes through ->blocked */ -void signal_wake_up (struct task_struct *t,int resume) +void signal_wake_up_state (struct task_struct *t,unsigned int state) { -unsigned int mask; -set_tsk_thread_flag (t,TIF_SIGPENDING ); -/* -* For SIGKILL, we want to wake it up in the stopped/traced/killable +* TASK_WAKEKILL also means wake it up in the stopped/traced/killable * case. We don't check t->state here because there is a race with it * executing another processor and just now entering stopped state. * By using wake_up_state, we ensure the process will wake up and * handle its death signal. */ - mask =TASK_INTERRUPTIBLE ; -if (resume) - mask |=TASK_WAKEKILL ; -if (!wake_up_state (t, mask)) +if (!wake_up_state (t, state |TASK_INTERRUPTIBLE ))kick_process (t); }
@@ -841,7 +835,7 @@ static void ptrace_trap_notify(struct task_struct *t)assert_spin_locked (&t->sighand->siglock);task_set_jobctl_pending (t,JOBCTL_TRAP_NOTIFY ); -signal_wake_up (t, t->jobctl &JOBCTL_LISTENING ); +ptrace_signal_wake_up (t, t->jobctl &JOBCTL_LISTENING ); }/*
@@ -1765,6 +1759,10 @@ static inline int may_ptrace_stop(void)* If SIGKILL was already sent before the caller unlocked * ->siglock we must see ->core_state != NULL. Otherwise it * is safe to enter schedule(). +* +* This is almost outdated, a task with the pending SIGKILL can't +* block in TASK_TRACED. But PTRACE_EVENT_EXIT can be reported +* after SIGKILL was already dequeued. */ if (unlikely (current->mm->core_state) &&unlikely (current->mm == current->parent->mm))
@@ -1890,6 +1888,7 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)if (gstop_done)do_notify_parent_cldstop (current, false, why); +/* tasklist protects us from ptrace_freeze_traced() */ __set_current_state (TASK_RUNNING );if (clear_code) current->exit_code =0 ;
net/bluetooth/hci_event.c +1 -1
@@ -1972,7 +1972,7 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skif (ev->opcode !=HCI_OP_NOP )del_timer (&hdev->cmd_timer); -if (ev->ncmd) { +if (ev->ncmd && !test_bit (HCI_RESET , &hdev->flags)) {atomic_set (&hdev->cmd_cnt,1 );if (!skb_queue_empty (&hdev->cmd_q))tasklet_schedule (&hdev->cmd_task);
net/bluetooth/smp.c +13 -0
@@ -642,6 +642,19 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)skb_pull (skb,sizeof (code)); +/* +* The SMP context must be initialized for all other PDUs except +* pairing and security requests. If we get any other PDU when +* not initialized simply disconnect (done if this function +* returns an error). +*/ +if (code !=SMP_CMD_PAIRING_REQ && code !=SMP_CMD_SECURITY_REQ && + !conn->smp_chan) { +BT_ERR ("Unexpected SMP command 0x%02x. Disconnecting." , code); +kfree_skb (skb); +return -ENOTSUPP ; + } +switch (code) {case SMP_CMD_PAIRING_REQ : reason =smp_cmd_pairing_req (conn, skb);
net/bridge/br_netfilter.c +3 -0
@@ -245,6 +245,9 @@ static int br_parse_ip_options(struct sk_buff *skb)struct net_device *dev = skb->dev;u32 len; +if (!pskb_may_pull (skb,sizeof (struct iphdr ))) + goto inhdr_error; + iph =ip_hdr (skb); opt = &(IPCB (skb)->opt);
net/core/pktgen.c +6 -3
@@ -1803,10 +1803,13 @@ static ssize_t pktgen_thread_write(struct file *file,return -EFAULT ; i += len;mutex_lock (&pktgen_thread_lock); -pktgen_add_device (t, f); + ret =pktgen_add_device (t, f);mutex_unlock (&pktgen_thread_lock); - ret = count; -sprintf (pg_result,"OK: add_device=%s" , f); +if (!ret) { + ret = count; +sprintf (pg_result,"OK: add_device=%s" , f); + }else +sprintf (pg_result,"ERROR: can not add device %s" , f); goto out; }
net/ipv4/ip_sockglue.c +1 -1
@@ -600,7 +600,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,case IP_TTL :if (optlen <1 ) goto e_inval; -if (val !=-1 && (val <0 || val >255 )) +if (val !=-1 && (val <1 || val >255 )) goto e_inval; inet->uc_ttl = val;break ;
net/ipv4/tcp_input.c +5 -0
@@ -3655,6 +3655,11 @@ static int tcp_process_frto(struct sock *sk, int flag) } }else {if (!(flag &FLAG_DATA_ACKED ) && (tp->frto_counter ==1 )) { +if (!tcp_packets_in_flight (tp)) { +tcp_enter_frto_loss (sk,2 , flag); +return true; + } +/* Prevent sending of new data. */ tp->snd_cwnd =min (tp->snd_cwnd,tcp_packets_in_flight (tp));
net/ipv6/addrconf.c +1 -1
@@ -1739,7 +1739,7 @@ static struct rt6_info *addrconf_get_prefix_route(const struct in6_addr *pfx,continue ;if ((rt->rt6i_flags & flags) != flags)continue ; -if ((noflags !=0 ) && ((rt->rt6i_flags & flags) !=0 )) +if ((rt->rt6i_flags & noflags) !=0 )continue ;dst_hold (&rt->dst);break ;
net/ipv6/ip6_output.c +2 -2
@@ -1284,10 +1284,10 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, cork->length =0 ; sk->sk_sndmsg_page =NULL ; sk->sk_sndmsg_off =0 ; - exthdrlen = (opt ? opt->opt_flen :0 ) - rt->rt6i_nfheader_len; + exthdrlen = (opt ? opt->opt_flen :0 ); length += exthdrlen; transhdrlen += exthdrlen; - dst_exthdrlen = rt->dst.header_len; + dst_exthdrlen = rt->dst.header_len - rt->rt6i_nfheader_len; }else { rt = (struct rt6_info *)cork->dst; fl6 = &inet->cork.fl.u.ip6;
net/ipv6/route.c +2 -1
@@ -819,7 +819,8 @@ restart:dst_hold (&rt->dst);read_unlock_bh (&table->tb6_lock); -if (!dst_get_neighbour_raw (&rt->dst) && !(rt->rt6i_flags &RTF_NONEXTHOP )) +if (!dst_get_neighbour_raw (&rt->dst) + && !(rt->rt6i_flags & (RTF_NONEXTHOP |RTF_LOCAL ))) nrt =rt6_alloc_cow (rt, &fl6->daddr, &fl6->saddr);else if (!(rt->dst.flags &DST_HOST )) nrt =rt6_alloc_clone (rt, &fl6->daddr);
net/packet/af_packet.c +6 -4
@@ -2422,13 +2422,15 @@ static int packet_release(struct socket *sock)packet_flush_mclist (sk); -memset (&req_u,0 ,sizeof (req_u)); - -if (po->rx_ring.pg_vec) +if (po->rx_ring.pg_vec) { +memset (&req_u,0 ,sizeof (req_u));packet_set_ring (sk, &req_u,1 ,0 ); + } -if (po->tx_ring.pg_vec) +if (po->tx_ring.pg_vec) { +memset (&req_u,0 ,sizeof (req_u));packet_set_ring (sk, &req_u,1 ,1 ); + }fanout_release (sk);
net/sctp/endpointola.c +5 -0
@@ -248,6 +248,8 @@ void sctp_endpoint_free(struct sctp_endpoint *ep)/* Final destructor for endpoint. */ static void sctp_endpoint_destroy (struct sctp_endpoint *ep) { +int i; +SCTP_ASSERT (ep->base.dead,"Endpoint is not dead" , return);/* Free up the HMAC transform. */
@@ -270,6 +272,9 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep)sctp_inq_free (&ep->base.inqueue);sctp_bind_addr_free (&ep->base.bind_addr); +for (i =0 ; i <SCTP_HOW_MANY_SECRETS ; ++i) +memset (&ep->secret_key[i],0 ,SCTP_SECRET_SIZE ); +/* Remove and free the port */ if (sctp_sk (ep->base.sk)->bind_hash)sctp_put_port (ep->base.sk);
net/sctp/outqueue.c +8 -4
@@ -223,7 +223,7 @@ void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q)/* Free the outqueue structure and any related pending chunks. */ -void sctp_outq_teardown (struct sctp_outq *q) +static void __sctp_outq_teardown (struct sctp_outq *q) {struct sctp_transport *transport;struct list_head *lchunk, *temp;
@@ -276,8 +276,6 @@ void sctp_outq_teardown(struct sctp_outq *q)sctp_chunk_free (chunk); } - q->error =0 ; -/* Throw away any leftover control chunks. */ list_for_each_entry_safe (chunk, tmp, &q->control_chunk_list, list) {list_del_init (&chunk->list);
@@ -285,11 +283,17 @@ void sctp_outq_teardown(struct sctp_outq *q) } } +void sctp_outq_teardown (struct sctp_outq *q) +{ +__sctp_outq_teardown (q); +sctp_outq_init (q->asoc, q); +} +/* Free the outqueue structure and any related pending chunks. */ void sctp_outq_free (struct sctp_outq *q) {/* Throw away leftover chunks. */ -sctp_outq_teardown (q); +__sctp_outq_teardown (q);/* If we were kmalloc()'d, free the memory. */ if (q->malloced)
net/sctp/socket.c +1 -1
@@ -3375,7 +3375,7 @@ static int sctp_setsockopt_auth_key(struct sock *sk, ret =sctp_auth_set_key (sctp_sk (sk)->ep, asoc, authkey); out: -kfree (authkey); +kzfree (authkey);return ret; }
At Sun, 17 Feb 2013 22:50:01 +0000,
Quoted 11 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.39 release. There are 66 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Feb 19 23:00:00 UTC 2013. Anything received after that time might be too late.
A combined patch relative to 3.2.38 will be posted as an additional response to this. A shortlog and diffstat can be found below.
This kernel can be built and boot without any problem. Building a kernel with this kernel also works fine.
- Build Machine: debian wheezy x86_64
CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
memory: 8GB
- Test machine: debian wheezy x86_64(KVM guest on the Build Machine)
vCPU: x2
memory: 2GB
I reviewed the following patches and it looks good to me.
Quoted 1 line
Oleg Nesterov (5):
...
Quoted 2 lines
wake_up_process()should be never used to wakeup a TASK_STOPPED/TRACED task
[9067ac85d533651b98c2ff903182a20cbb361fcb]
...
Quoted 3 lines
Shawn Bohrer (1):
sched/rt: Useroot_domainofrt_rqnot current processor
[aa7f67304d1a03180f463258aa6f15a8b434e77d]
...
Quoted 7 lines
Sjur Brændeland (1):
virtio_console: Don't access uninitialized data.
[aded024a12b32fc1ed9a80639681daae2d07ec25]Stephen Hemminger (1):
MAINTAINERS: Stephen Hemminger email change
[adbbf69d1a54abf424e91875746a610dcc80017d]
Thanks,
Satoru
Quoted 21 lines · Satoru Takeuchi
At Sun, 17 Feb 2013 22:50:01 +0000,
Quoted 11 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.39 release. There are 66 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Feb 19 23:00:00 UTC 2013. Anything received after that time might be too late.
A combined patch relative to 3.2.38 will be posted as an additional response to this. A shortlog and diffstat can be found below.
This kernel can be built and boot without any problem. Building a kernel with this kernel also works fine.
- Build Machine: debian wheezy
x86_64
CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
memory: 8GB
Quoted 5 lines
- Test machine: debian wheezy
x86_64(KVM guest on the Build Machine)
vCPU: x2
memory: 2GBI reviewed the following patches and it looks good to me.
[...]
Thanks.
Ben.
Signature · 2 lines
Ben Hutchings Sturgeon's Law: Ninety percent of everything is crap.