platform/adaptation/renesas_rcar/renesas_kernel.git
14 years agoBluetooth: Read RFC conf option on a successful Conf RSP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:39 +0000 (16:15 -0300)]
Bluetooth: Read RFC conf option on a successful Conf RSP

On Enhanced Retransmission Mode and Streaming Mode a entity can send, on
a successful Conf RSP, new values for the RFC fields. For example, the
entity can send txWindow and MPS values less than the value received on
a Conf REQ.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Ignore Tx Window value with Streaming mode
Gustavo F. Padovan [Sat, 1 May 2010 19:15:39 +0000 (16:15 -0300)]
Bluetooth: Ignore Tx Window value with Streaming mode

Tx Window value shall not be used with Streaming Mode and the receiver
of the config Request shall ignore its value.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Add timer to Acknowledge I-frames
Gustavo F. Padovan [Sat, 1 May 2010 19:15:39 +0000 (16:15 -0300)]
Bluetooth: Add timer to Acknowledge I-frames

We ack I-frames on each txWindow/5 I-frames received, but if the sender
stop to send I-frames and it's not a txWindow multiple we can leave some
frames unacked.
So I added a timer to ack I-frames on this case. The timer expires in
200ms.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Finish implementation for Rec RR (P=1) on ERTM
Gustavo F. Padovan [Sat, 1 May 2010 19:15:39 +0000 (16:15 -0300)]
Bluetooth: Finish implementation for Rec RR (P=1) on ERTM

Now the code handles the case under SREJ_SENT state.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Remove duplicate use of __get_reqseq() macro on L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:38 +0000 (16:15 -0300)]
Bluetooth: Remove duplicate use of __get_reqseq() macro on L2CAP

tx_seq var already has the value of __get_reqseq().

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Group the ack of I-frames into l2cap_data_channel_rrframe()
Gustavo F. Padovan [Sat, 1 May 2010 19:15:38 +0000 (16:15 -0300)]
Bluetooth: Group the ack of I-frames into l2cap_data_channel_rrframe()

It also fix a bug: we weren't acknowledging I-frames when P=1.
Note that when F=1 we are acknowledging packets before setting
RemoteBusy to False. The spec says we should do that in the opposite
order, but acknowledment of packets doesn't care about RemoteBusy flag
so we can do that in the order we want.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Handle all cases of receipt of RNR-frames into L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:38 +0000 (16:15 -0300)]
Bluetooth: Handle all cases of receipt of RNR-frames into L2CAP

We weren't handling the receipt under SREJ_SENT state table.
It also introduce l2cap_send_srejtail(). It will be used in the nexts
commits too.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Split l2cap_data_channel_sframe()
Gustavo F. Padovan [Sat, 1 May 2010 19:15:38 +0000 (16:15 -0300)]
Bluetooth: Split l2cap_data_channel_sframe()

Create a function for each type fo S-frame and avoid a lot of nested
code.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Add Recv RR (P=0)(F=0) for SREJ_SENT state on ERTM
Gustavo F. Padovan [Sat, 1 May 2010 19:15:38 +0000 (16:15 -0300)]
Bluetooth: Add Recv RR (P=0)(F=0) for SREJ_SENT state on ERTM

This finishes the implementation of Recv RR (P=0)(F=0) for the Enhanced
Retransmission Mode on L2CAP.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Move set of P-bit to l2cap_send_sframe()
Gustavo F. Padovan [Sat, 1 May 2010 19:15:37 +0000 (16:15 -0300)]
Bluetooth: Move set of P-bit to l2cap_send_sframe()

Abstract the send of of P-bit and avoids code duplication like we
did with the setting of F-bit.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Implement SendAck() Action on ERTM.
Gustavo F. Padovan [Sat, 1 May 2010 19:15:37 +0000 (16:15 -0300)]
Bluetooth: Implement SendAck() Action on ERTM.

Shall be used to ack received frames, It must decide type of
acknowledgment between a RR frame, a RNR frame or transmission of
pending I-frames.
It also modifies l2cap_ertm_send() to report the number of frames sent.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Check if SDU size is greater than MTU on L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:37 +0000 (16:15 -0300)]
Bluetooth: Check if SDU size is greater than MTU on L2CAP

After reassembly the SDU we need to check his size. It can't overflow
the MTU size.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Check the minimum {I,S}-frame size into L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:37 +0000 (16:15 -0300)]
Bluetooth: Check the minimum {I,S}-frame size into L2CAP

All packets with size fewer than the minimum specified is dropped.
Note that the size of the l2cap basic header, FCS and SAR fields are
already subtracted of len at the moment of the size check.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Support case with F bit set under WAIT_F state.
Gustavo F. Padovan [Sat, 1 May 2010 19:15:37 +0000 (16:15 -0300)]
Bluetooth: Support case with F bit set under WAIT_F state.

On receipt of a F=1 under WAIT_F state ERTM shall stop monitor timer and
start retransmission timer (if there are unacked frames).

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Implement 'Send IorRRorRNR' event
Gustavo F. Padovan [Sat, 1 May 2010 19:15:36 +0000 (16:15 -0300)]
Bluetooth: Implement 'Send IorRRorRNR' event

After receive a RR with P bit set ERTM shall use this funcion to choose
what type of frame to reply with F bit = 1.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Use a l2cap_pinfo struct instead l2cap_pi() macro
Gustavo F. Padovan [Sat, 1 May 2010 19:15:36 +0000 (16:15 -0300)]
Bluetooth: Use a l2cap_pinfo struct instead l2cap_pi() macro

Trivial clean up.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Fix ACL MTU issue
Gustavo F. Padovan [Sat, 1 May 2010 19:15:36 +0000 (16:15 -0300)]
Bluetooth: Fix ACL MTU issue

ERTM and Streaming Modes was having problems when the ACL MTU is lower
than MPS. The 'minus 10' is to take in account the header and fcs
lenghts.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Fix expected_tx_seq calculation on L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:36 +0000 (16:15 -0300)]
Bluetooth: Fix expected_tx_seq calculation on L2CAP

All operation related to the txWindow should be modulo 64.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Fix memory leak of S-frames into L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:35 +0000 (16:15 -0300)]
Bluetooth: Fix memory leak of S-frames into L2CAP

l2cap_data_channel do not free the S-frame, so we free it here.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Move specific Basic Mode code to the right place
Gustavo F. Padovan [Sat, 1 May 2010 19:15:35 +0000 (16:15 -0300)]
Bluetooth: Move specific Basic Mode code to the right place

Inside "case L2CAP_MODE_BASIC:" we don't need to check for sk_type and
L2CAP mode. So only the length check is fine.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Trivial clean ups to SCO
Gustavo F. Padovan [Sat, 1 May 2010 19:15:35 +0000 (16:15 -0300)]
Bluetooth: Trivial clean ups to SCO

Remove extra braces and labels, break over column 80 lines, etc

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Make hci_send_sco() void
Gustavo F. Padovan [Sat, 1 May 2010 19:15:35 +0000 (16:15 -0300)]
Bluetooth: Make hci_send_sco() void

It also removes an unneeded check for the MTU. The check is done before
on sco_send_frame()

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Fix wrong packet type count increment
Gustavo F. Padovan [Sat, 1 May 2010 19:15:34 +0000 (16:15 -0300)]
Bluetooth: Fix wrong packet type count increment

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Use the proper function cast to get hdr data
Gustavo F. Padovan [Sat, 1 May 2010 19:15:34 +0000 (16:15 -0300)]
Bluetooth: Use the proper function cast to get hdr data

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Fix return value when bt_skb_alloc fails
Gustavo F. Padovan [Sat, 1 May 2010 19:15:34 +0000 (16:15 -0300)]
Bluetooth: Fix return value when bt_skb_alloc fails

Set the proper error(ENOMEM), instead of just return 0.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoLinux 2.6.34-rc7
Linus Torvalds [Mon, 10 May 2010 01:36:28 +0000 (18:36 -0700)]
Linux 2.6.34-rc7

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Linus Torvalds [Mon, 10 May 2010 01:35:53 +0000 (18:35 -0700)]
Merge git://git./linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] Retry commands with UNIT_ATTENTION sense codes to fix ext3/ext4 I/O error
  [SCSI] Enable retries for SYNCRONIZE_CACHE commands to fix I/O error
  [SCSI] scsi_debug: virtual_gb ignores sector_size
  [SCSI] libiscsi: regression: fix header digest errors
  [SCSI] fix locking around blk_abort_request()
  [SCSI] advansys: fix narrow board error path

14 years agocpuidle: Fix incorrect optimization
Arjan van de Ven [Sat, 8 May 2010 22:47:37 +0000 (15:47 -0700)]
cpuidle: Fix incorrect optimization

commit 672917dcc78 ("cpuidle: menu governor: reduce latency on exit")
added an optimization, where the analysis on the past idle period moved
from the end of idle, to the beginning of the new idle.

Unfortunately, this optimization had a bug where it zeroed one key
variable for new use, that is needed for the analysis.  The fix is
simple, zero the variable after doing the work from the previous idle.

During the audit of the code that found this issue, another issue was
also found; the ->measured_us data structure member is never set, a
local variable is always used instead.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Corrado Zoccolo <czoccolo@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoipv4: remove ip_rt_secret timer (v4)
Neil Horman [Sat, 8 May 2010 08:57:52 +0000 (01:57 -0700)]
ipv4: remove ip_rt_secret timer (v4)

A while back there was a discussion regarding the rt_secret_interval timer.
Given that we've had the ability to do emergency route cache rebuilds for awhile
now, based on a statistical analysis of the various hash chain lengths in the
cache, the use of the flush timer is somewhat redundant.  This patch removes the
rt_secret_interval sysctl, allowing us to rely solely on the statistical
analysis mechanism to determine the need for route cache flushes.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoHID: fix suspend crash by moving initializations earlier
Alan Stern [Fri, 7 May 2010 14:41:10 +0000 (10:41 -0400)]
HID: fix suspend crash by moving initializations earlier

Although the usbhid driver allocates its usbhid structure in the probe
routine, several critical fields in that structure don't get
initialized until usbhid_start().  However if report descriptor
parsing fails then usbhid_start() is never called.  This leads to
problems during system suspend -- the system will freeze.

This patch (as1378) fixes the bug by moving the initialization
statements up into usbhid_probe().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Bruno Prémont <bonbons@linux-vserver.org>
Tested-By: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
14 years agoMerge branch 'for-linus' of git://neil.brown.name/md
Linus Torvalds [Fri, 7 May 2010 21:11:40 +0000 (14:11 -0700)]
Merge branch 'for-linus' of git://neil.brown.name/md

* 'for-linus' of git://neil.brown.name/md:
  md: restore ability of spare drives to spin down.
  md/raid6: Fix raid-6 read-error correction in degraded state

14 years agoMerge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
Linus Torvalds [Fri, 7 May 2010 21:11:09 +0000 (14:11 -0700)]
Merge branch 'urgent' of git://git./linux/kernel/git/brodo/pcmcia-2.6

* 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
  pcmcia: fix compilation after 16bit state locking changes
  pcmcia: order userspace suspend and resume requests
  pcmcia: avoid pccard_validate_cis failure in resume callpath

14 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Fri, 7 May 2010 21:07:20 +0000 (14:07 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  blk-cgroup: Fix an RCU warning in blkiocg_create()
  blk-cgroup: Fix RCU correctness warning in cfq_init_queue()
  drbd: don't expose failed local READ to upper layers

14 years agoMerge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Fri, 7 May 2010 21:02:01 +0000 (14:02 -0700)]
Merge branch 'drm-linus' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/ttm: Remove the ttm_bo_block_reservation() function.
  drm/ttm: Remove some leftover debug messages.
  drm/radeon: async event synchronization for drmWaitVblank

14 years agovirtio: initialize earlier
Stijn Tintel [Fri, 7 May 2010 04:58:34 +0000 (14:28 +0930)]
virtio: initialize earlier

Move initialization of the virtio framework before the initialization of
mtd, so that block2mtd can be used on virtio-based block devices.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=15644

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
Linus Torvalds [Fri, 7 May 2010 20:59:48 +0000 (13:59 -0700)]
Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  NFS: Fix RCU issues in the NFSv4 delegation code
  NFSv4: Fix the locking in nfs_inode_reclaim_delegation()

14 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Fri, 7 May 2010 20:59:22 +0000 (13:59 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: sleep: init_set_sci_en_on_resume for Dell Studio 155x
  ACPI: fix acpi_hest_firmware_first_pci() caused oops
  sbshc: acpi_device_class "smbus_host_controller" too long
  power_meter: acpi_device_class "power_meter_resource" too long
  acpi_pad: "processor_aggregator" name too long
  PNP: don't check for conflicts with bridge windows
  ACPI: DMI init_set_sci_en_on_resume for multiple Lenovo ThinkPads
  PNPACPI: compute Address Space length rather than using _LEN
  ACPI: silence kmemcheck false positive

14 years agoMerge branch 'v4l_for_2.6.34' of git://git.kernel.org/pub/scm/linux/kernel/git/mcheha...
Linus Torvalds [Fri, 7 May 2010 20:58:56 +0000 (13:58 -0700)]
Merge branch 'v4l_for_2.6.34' of git://git./linux/kernel/git/mchehab/linux-2.6

* 'v4l_for_2.6.34' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  V4L/DVB: pxa_camera: move fifo reset direct before dma start
  V4L/DVB: video: testing unsigned for less than 0
  V4L/DVB: mx1-camera: compile fix
  V4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer  dereference"
  V4L/DVB: ngene: Workaround for stuck DiSEqC pin
  V4L/DVB: saa7146: fix regression of the av7110/budget-av driver
  V4L/DVB: v4l: fix config dependencies: mxb and saa7191 are V4L2 drivers, not V4L1
  V4L/DVB: feature-removal: announce videotext.h removal
  V4L/DVB: V4L - vpfe capture - fix for kernel crash
  V4L/DVB: gspca: make usb id 0461:0815 get handled by the right driver
  V4L/DVB: gspca - stv06xx: Remove the 046d:08da from the stv06xx driver
  V4L/DVB: gspca - sn9c20x: Correct onstack wait_queue_head declaration
  V4L/DVB: saa7146: fix up bytesperline if it is an impossible value
  V4L/DVB: V4L: vpfe_capture - free ccdc_lock when memory allocation fails
  V4L/DVB: V4L - Makfile:Removed duplicate entry of davinci
  V4L/DVB: omap24xxcam: potential buffer overflow

14 years agoMerge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 7 May 2010 20:58:21 +0000 (13:58 -0700)]
Merge branch 'core-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  rcu: create rcu_my_thread_group_empty() wrapper
  memcg: css_id() must be called under rcu_read_lock()
  cgroup: Check task_lock in task_subsys_state()
  sched: Fix an RCU warning in print_task()
  cgroup: Fix an RCU warning in alloc_css_id()
  cgroup: Fix an RCU warning in cgroup_path()
  KEYS: Fix an RCU warning in the reading of user keys
  KEYS: Fix an RCU warning

14 years agort2x00: rt2800: use correct txop value in tx descriptor
Helmut Schaa [Fri, 7 May 2010 09:03:08 +0000 (11:03 +0200)]
rt2x00: rt2800: use correct txop value in tx descriptor

rt2800 devices use a different enumeration to specify what IFS values should
be used on frame transmission compared to the other rt2x00 devices. Hence,
create a new enum called txop that contains the valid values.

Furthermore use the appropriate txop values as found in the ralink drivers:
- TXOP_BACKOFF for management frames
- TXOP_SIFS for subsequent fragments in a burst
- TXOP_HTTXOP for all data frames

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1271: Reduce PSM entry hang over period from 128 => 1 ms
Juuso Oikarinen [Fri, 7 May 2010 08:39:02 +0000 (11:39 +0300)]
wl1271: Reduce PSM entry hang over period from 128 => 1 ms

Currently, we configure a 128ms hang over period for the PSM entry
(the firmware will remain active for 128ms after sending the null func for
PSM and getting an ack for it.) This is a huge power consumption issue, and
appears unnecessary. So, configure the value to 1 ms.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Janne Ylalehto <janne.ylalehto@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1271: Increase timeout for command event waiting
Teemu Paasikivi [Fri, 7 May 2010 08:39:01 +0000 (11:39 +0300)]
wl1271: Increase timeout for command event waiting

Incresed the timeout value for command complete event waiting from 100
ms to 750 ms. In some rare cases it can take about 600 ms before
complete event for join command is received. This is most propably
caused by the firmware being busy with scanning related activities.

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1271: Fix to join and channel number handling
Juuso Oikarinen [Fri, 7 May 2010 08:39:00 +0000 (11:39 +0300)]
wl1271: Fix to join and channel number handling

This patch changes the way JOIN's are performed, and channel numbers updated.
The reason for this is that the firmware JOIN command clears WPA(2) key
material, and if done while associated to a WPA(2) secured AP, will render
the data-path unusable.

While the channel is not usually changed while associated (and currently we
could not even support something like that), after performing a scan operation
while associated, mac80211 will re-set the current channel to the driver. This
caused our problem.

Also, the mac80211 is assuming that the driver channel configuration remains
persistent over periods of IDLE. Therefore remove channel resetting to zero
from the unjoin function.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1271: Fix 32 bit register read related endiannes bug
Juuso Oikarinen [Fri, 7 May 2010 08:38:59 +0000 (11:38 +0300)]
wl1271: Fix 32 bit register read related endiannes bug

Reading single registers did not pay attention to data endianness. This patch
fix that.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1271: Add sysfs file to retrieve HW PG-version and ROM-version
Juuso Oikarinen [Fri, 7 May 2010 08:38:58 +0000 (11:38 +0300)]
wl1271: Add sysfs file to retrieve HW PG-version and ROM-version

This patch reads the HW PG version (along with a ROM-version, embedded in the
same value) from the wl1271 hardware and publishes the value in a sysfs -file.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Handle IDLE LED properly
Sujith [Fri, 7 May 2010 08:07:57 +0000 (13:37 +0530)]
ath9k_htc: Handle IDLE LED properly

Switch LED off/on when handling CONF_CHANGE_IDLE.
Not doing this would leave the radio LED on even
though the chip would be in full sleep mode.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: Update initvals for AR9003 for xb113
Luis R. Rodriguez [Fri, 7 May 2010 02:41:14 +0000 (22:41 -0400)]
ath9k_hw: Update initvals for AR9003 for xb113

Generated using the new shiny intivals-tool [1]:

initvals -w -f ar9003 > ar9003_initvals.h

The respective checksums are:

0x000000005a76829d        ar9300_2p0_radio_postamble
0x000000009d90cb74        ar9300Modes_lowest_ob_db_tx_gain_table_2p0
0x00000000e0bc2c84        ar9300Modes_fast_clock_2p0
0x00000000852fca34        ar9300_2p0_radio_core
0x0000000000000000        ar9300Common_rx_gain_table_merlin_2p0
0x0000000078658fb5        ar9300_2p0_mac_postamble
0x0000000023235333        ar9300_2p0_soc_postamble
0x0000000054d41904        ar9200_merlin_2p0_radio_core
0x00000000618455d4        ar9300_2p0_baseband_postamble
0x000000009aa590a4        ar9300_2p0_baseband_core
0x000000004783d946        ar9300Modes_high_power_tx_gain_table_2p0
0x000000006681db44        ar9300Modes_high_ob_db_tx_gain_table_2p0
0x000000001f318700        ar9300Common_rx_gain_table_2p0
0x000000009990cb74        ar9300Modes_low_ob_db_tx_gain_table_2p0
0x00000000c9d66d40        ar9300_2p0_mac_core
0x0000000039139500        ar9300Common_wo_xlna_rx_gain_table_2p0
0x00000000a0c54980        ar9300_2p0_soc_preamble
0x00000000292e2544        ar9300PciePhy_pll_on_clkreq_disable_L1_2p0
0x000000002d3e2544        ar9300PciePhy_clkreq_enable_L1_2p0
0x00000000293e2544        ar9300PciePhy_clkreq_disable_L1_2p0

[1] http://wireless.kernel.org/en/users/Drivers/ath9k_hw/initvals-tool

Cc: Tom Hammel <thammel@atheros.com>
Cc: Enis Akay <Enis.Akay@Atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_common: drop incomming frames with an invalid hardware rate
Luis R. Rodriguez [Fri, 7 May 2010 02:41:13 +0000 (22:41 -0400)]
ath9k_common: drop incomming frames with an invalid hardware rate

ath9k_common (used by ath9k and ath9k_htc) trusts the frames
blessed by hardware as OK are infact correct even if the rate
seen by the driver is unrecognized. ath9k_common just treats
these frames in mac80211 as frames as frames under 1 mbps rate.
It seems this might not be the best thing to do as other parts of
the frame might not be valid so just drop these frames for now.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_common: move the rate status setting into ath9k_process_rate()
Luis R. Rodriguez [Fri, 7 May 2010 02:41:12 +0000 (22:41 -0400)]
ath9k_common: move the rate status setting into ath9k_process_rate()

This has no real functional change, this just moves the setting the
the mac80211 rate index into ath9k_process_rate(). This allows us
to eventually make ath9k_process_rate() return a negative value
in case we have detected a specific case rate situation which should
have been ignored.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agortl8180: add software-based support for IBSS mode
John W. Linville [Thu, 6 May 2010 20:49:40 +0000 (16:49 -0400)]
rtl8180: add software-based support for IBSS mode

Device documentation suggests that hardware support for beaconing
is available.  But I implemented software-based beacon generation
as an experiment and it seems better to have that working now rather
than waiting for something better to materialize.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agortl8180: assign sequence numbers in the driver
John W. Linville [Thu, 6 May 2010 20:26:23 +0000 (16:26 -0400)]
rtl8180: assign sequence numbers in the driver

This is a step towards support for beaconing modes of operation.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: set IEEE80211_TX_CTL_FIRST_FRAGMENT for beacons
John W. Linville [Thu, 6 May 2010 18:45:17 +0000 (14:45 -0400)]
mac80211: set IEEE80211_TX_CTL_FIRST_FRAGMENT for beacons

Also simplify the flags assignment into a single statement at the
end of ieee80211_beacon_get_tim.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Fix RF3052 channel initialization
Ivo van Doorn [Thu, 6 May 2010 12:45:46 +0000 (14:45 +0200)]
rt2x00: Fix RF3052 channel initialization

Update channel initialization for the RF3052 chipset.
According to the Ralink drivers, the rt3x array must be
used for this chipset, rather then the rt2x array.

Furthermore RF3052 supports the 5GHz band, extend
the rt3x array with the 5GHz channels, and use them
for the RF3052 chip.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: rt2800: don't overwrite SIFS values on erp changes
Helmut Schaa [Thu, 6 May 2010 10:29:44 +0000 (12:29 +0200)]
rt2x00: rt2800: don't overwrite SIFS values on erp changes

The SIFS value is a constant and doesn't need to be updated on erp changes.
Furthermore the code used 10us for both, the OFDM SIFS and CCK SIFS time
which broke CTS protected 11g connections (see patch "rt2x00: rt2800: update
initial SIFS values" for details).

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: rt2800: update initial SIFS values
Helmut Schaa [Thu, 6 May 2010 10:29:04 +0000 (12:29 +0200)]
rt2x00: rt2800: update initial SIFS values

Currently the CCK and OFDM SIFS value is set to 32us. This value is neither
used by the Ralink driver nor specified in 802.11.

Instead of using 10us for CCK SIFS (as defined in 802.11) use 16us like in the
Ralink drivers. And indeed using a SIFS value of 10us breaks connectivity with
11g + CTS protected connections. Add a comment to the code why we don't use 10us
for CCK SIFS value.

The OFDM SIFS value is set to 16us (as defined in 802.11 and also used by the
Ralink drivers).

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_htc: Fix beaconing in IBSS mode
Sujith [Thu, 6 May 2010 09:15:47 +0000 (14:45 +0530)]
ath9k_htc: Fix beaconing in IBSS mode

The current way of managing beaconing in ad-hoc
mode has a subtle race - the beacon obtained from mac80211
is freed in the SWBA handler rather than the TX
completion routine. But transmission of beacons goes
through the normal SKB queue maintained in hif_usb,
leading to a situation where __skb_dequeue() in the TX
completion handler goes kaput.

Fix this by simply getting a beacon from mac80211 for
every SWBA and free it in its completion routine.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: improve HT channel handling
Johannes Berg [Wed, 5 May 2010 13:28:27 +0000 (15:28 +0200)]
mac80211: improve HT channel handling

Currently, when one interface switches HT mode,
all others will follow along. This is clearly
undesirable, since the new one might switch to
no-HT while another one is operating in HT.

Address this issue by keeping track of the HT
mode per interface, and allowing only changes
that are compatible, i.e. switching into HT40+
is not possible when another interface is in
HT40-, in that case the second one needs to
fall back to HT20.

Also, to allow drivers to know what's going on,
store the per-interface HT mode (channel type)
in the virtual interface's bss_conf.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agocfg80211/mac80211: better channel handling
Johannes Berg [Wed, 5 May 2010 13:25:02 +0000 (15:25 +0200)]
cfg80211/mac80211: better channel handling

Currently (all tested with hwsim) you can do stupid
things like setting up an AP on a certain channel,
then adding another virtual interface and making
that associate on another channel -- this will make
the beaconing to move channel but obviously without
the necessary IEs data update.

In order to improve this situation, first make the
configuration APIs (cfg80211 and nl80211) aware of
multi-channel operation -- we'll eventually need
that in the future anyway. There's one userland API
change and one API addition. The API change is that
now SET_WIPHY must be called with virtual interface
index rather than only wiphy index in order to take
effect for that interface -- luckily all current
users (hostapd) do that. For monitor interfaces, the
old setting is preserved, but monitors are always
slaved to other devices anyway so no guarantees.

The second userland API change is the introduction
of a per virtual interface SET_CHANNEL command, that
hostapd should use going forward to make it easier
to understand what's going on (it can automatically
detect a kernel with this command).

Other than mac80211, no existing cfg80211 drivers
are affected by this change because they only allow
a single virtual interface.

mac80211, however, now needs to be aware that the
channel settings are per interface now, and needs
to disallow (for now) real multi-channel operation,
which is another important part of this patch.

One of the immediate benefits is that you can now
start hostapd to operate on a hardware that already
has a connection on another virtual interface, as
long as you specify the same channel.

Note that two things are left unhandled (this is an
improvement -- not a complete fix):

 * different HT/no-HT modes

   currently you could start an HT AP and then
   connect to a non-HT network on the same channel
   which would configure the hardware for no HT;
   that can be fixed fairly easily

 * CSA

   An AP we're connected to on a virtual interface
   might indicate switching channels, and in that
   case we would follow it, regardless of how many
   other interfaces are operating; this requires
   more effort to fix but is pretty rare after all

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: fix BSS info reconfiguration
Johannes Berg [Wed, 5 May 2010 07:44:02 +0000 (09:44 +0200)]
mac80211: fix BSS info reconfiguration

When reconfiguring an interface due to a previous
hardware restart, mac80211 will currently include
the new IBSS flag on non-IBSS interfaces which may
confuse drivers.

Instead of doing the ~0 trick, simply spell out
which things are going to be reconfigured.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoorinoco: refactor xmit path
David Kilroy [Tue, 4 May 2010 21:54:41 +0000 (22:54 +0100)]
orinoco: refactor xmit path

... so orinoco_usb can share some common functionality.

Handle 802.2 encapsulation and MIC calculation in that function.
The 802.3 header is prepended to the SKB. The calculated MIC is written
to a specified buffer. Also modify the transmit control word that will
be passed onto the hardware to specify whether the MIC is present, and
the key used.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: fix another source of corrupt frames
Felix Fietkau [Tue, 4 May 2010 07:58:57 +0000 (09:58 +0200)]
ath9k: fix another source of corrupt frames

Atheros hardware supports receiving frames that span multiple
descriptors and buffers. In this case, the rx status of every
descriptor except for the last one is invalid and may contain random
data. Because the driver does not support this, it needs to drop such
frames.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoar9170usb: remove deprecated aggregation code
Christian Lamparter [Sat, 1 May 2010 16:18:18 +0000 (18:18 +0200)]
ar9170usb: remove deprecated aggregation code

This patch removes the incomplete AMPDU implementation in ar9170usb.

The code in question is:
 * too big and complex (more than 550 SLOC.)
   This is enough to qualify for a new separate code file!

 * unbalanced quantity & quality
over-engineered areas like:
* xmit scheduling and queuing frames for multiple HT peers
* redundant frame sorting
are confronted by gaping holes:
* accurate transmission feedback
* firmware error-handling and device reset
* HT rate control algorithm

 * error-prone
Since its inclusion, hardly anything was done to fix
any of the outlined flaws from the initial commit message.

   => This also indicates poor maintainability.

 * relies heavily on several spinlocks.

As a result of this shortcomings, the code is slow and does not
even support the most basic 11n requirement: HT station mode.

Therefore, I request to purge my heap of **** from the kernel:
"ar9170: implement transmit aggregation".

The next item on the agenda is: (re-)start from scratch with
an adequate design to accommodate the special requirements
and features of the available frameworks and tools.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: remove association work when processing deauth request
Reinette Chatre [Tue, 4 May 2010 23:04:49 +0000 (16:04 -0700)]
mac80211: remove association work when processing deauth request

In https://bugzilla.kernel.org/show_bug.cgi?id=15794 a user encountered the
following:

[18967.469098] wlan0: authenticated
[18967.472527] wlan0: associate with 00:1c:10:b8:e3:ea (try 1)
[18967.472585] wlan0: deauthenticating from 00:1c:10:b8:e3:ea by local choice (reason=3)
[18967.672057] wlan0: associate with 00:1c:10:b8:e3:ea (try 2)
[18967.872357] wlan0: associate with 00:1c:10:b8:e3:ea (try 3)
[18968.072960] wlan0: association with 00:1c:10:b8:e3:ea timed out
[18968.076890] ------------[ cut here ]------------
[18968.076898] WARNING: at net/wireless/mlme.c:341 cfg80211_send_assoc_timeout+0xa8/0x140()
[18968.076900] Hardware name: GX628
[18968.076924] Pid: 1408, comm: phy0 Not tainted 2.6.34-rc4-00082-g250541f-dirty #3
[18968.076926] Call Trace:
[18968.076931]  [<ffffffff8103459e>] ?  warn_slowpath_common+0x6e/0xb0
[18968.076934]  [<ffffffff8157c2d8>] ?  cfg80211_send_assoc_timeout+0xa8/0x140
[18968.076937]  [<ffffffff8103ff8b>] ? mod_timer+0x10b/0x180
[18968.076940]  [<ffffffff8158f0fc>] ?  ieee80211_assoc_done+0xbc/0xc0
[18968.076943]  [<ffffffff81590d53>] ?  ieee80211_work_work+0x553/0x11c0
[18968.076945]  [<ffffffff8102d931>] ? finish_task_switch+0x41/0xb0
[18968.076948]  [<ffffffff81590800>] ?  ieee80211_work_work+0x0/0x11c0
[18968.076951]  [<ffffffff810476fb>] ? worker_thread+0x13b/0x210
[18968.076954]  [<ffffffff8104b6b0>] ?  autoremove_wake_function+0x0/0x30
[18968.076956]  [<ffffffff810475c0>] ? worker_thread+0x0/0x210
[18968.076959]  [<ffffffff8104b21e>] ? kthread+0x8e/0xa0
[18968.076962]  [<ffffffff810031f4>] ?  kernel_thread_helper+0x4/0x10
[18968.076964]  [<ffffffff8104b190>] ? kthread+0x0/0xa0
[18968.076966]  [<ffffffff810031f0>] ?  kernel_thread_helper+0x0/0x10
[18968.076968] ---[ end trace 8aa6265f4b1adfe0 ]---

As explained by Johannes Berg <johannes@sipsolutions.net>:

We authenticate successfully, and then userspace requests association.
Then we start that process, but the AP doesn't respond. While we're
still waiting for an AP response, userspace asks for a deauth. We do
the deauth, but don't abort the association work. Then once the
association work times out we tell cfg80211, but it no longer wants
to know since for all it is concerned we accepted the deauth that
also kills the association attempt.

Fix this by, upon receipt of deauth request, removing the association work
and continuing to send the deauth.

Unfortunately the user reporting the issue is not able to reproduce this
problem anymore and cannot verify this fix. This seems like a well understood
issue though and I thus present the patch.

Bug-identified-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoar9170: wait for asynchronous firmware loading
Christian Lamparter [Thu, 29 Apr 2010 15:53:33 +0000 (17:53 +0200)]
ar9170: wait for asynchronous firmware loading

This patch fixes a regression introduced by the following patch:
"ar9170: load firmware asynchronously"

When we kick off a firmware loading request and then unbind,
or disconnect the usb device right away, we get into trouble:

> ------------[ cut here ]------------
> WARNING: at lib/kref.c:44 kref_get+0x1c/0x20()
> Hardware name: 18666GU
> Modules linked in: ar9170usb [...]
> Pid: 6588, comm: firmware/ar9170 Not tainted 2.6.34-rc5-wl #43
> Call Trace:
> [<c102b05e>] ? warn_slowpath_common+0x6e/0xb0
> [<c117c93c>] ? kref_get+0x1c/0x20
> [<c102b0b3>] ? warn_slowpath_null+0x13/0x20
> [<c117c93c>] ? kref_get+0x1c/0x20
> [<c117bb2f>] ? kobject_get+0xf/0x20
> [<c124d630>] ? get_device+0x10/0x20
> [<c124e5a0>] ? device_add+0x60/0x530
> [<c117b8b5>] ? kobject_init+0x25/0xa0
> [<c12569f9>] ? _request_firmware+0x139/0x3e0
> [<c1256cc0>] ? request_firmware_work_func+0x20/0x70
> [<c1256ca0>] ? request_firmware_work_func+0x0/0x70
> [<c103ff24>] ? kthread+0x74/0x80
> [<c103feb0>] ? kthread+0x0/0x80
> [<c1003136>] ? kernel_thread_helper+0x6/0x10
>---[ end trace 2d50bd818f64a1b7 ]---
- followed by a random Oops -

Avoid that by waiting for the firmware loading to finish
(whether successfully or not) before the unbind in
ar9170_usb_disconnect.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Bug-fixed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomd: restore ability of spare drives to spin down.
NeilBrown [Fri, 7 May 2010 09:44:26 +0000 (19:44 +1000)]
md: restore ability of spare drives to spin down.

Some time ago we stopped the clean/active metadata updates
from being written to a 'spare' device in most cases so that
it could spin down and say spun down.  Device failure/removal
etc are still recorded on spares.

However commit 51d5668cb2e3fd1827a55 broke this 50% of the time,
depending on whether the event count is even or odd.
The change log entry said:

   This means that the alignment between 'odd/even' and
    'clean/dirty' might take a little longer to attain,

how ever the code makes no attempt to create that alignment, so it
could take arbitrarily long.

So when we find that clean/dirty is not aligned with odd/even,
force a second metadata-update immediately.  There are already cases
where a second metadata-update is needed immediately (e.g. when a
device fails during the metadata update).  We just piggy-back on that.

Reported-by: Joe Bryant <tenminjoe@yahoo.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Cc: stable@kernel.org
14 years agomd/raid6: Fix raid-6 read-error correction in degraded state
Gabriele A. Trombetti [Wed, 28 Apr 2010 01:51:17 +0000 (11:51 +1000)]
md/raid6: Fix raid-6 read-error correction in degraded state

Fix: Raid-6 was not trying to correct a read-error when in
singly-degraded state and was instead dropping one more device, going to
doubly-degraded state. This patch fixes this behaviour.

Tested-by: Janos Haar <janos.haar@netcenter.hu>
Signed-off-by: Gabriele A. Trombetti <g.trombetti.lkrnl1213@logicschema.com>
Reported-by: Janos Haar <janos.haar@netcenter.hu>
Signed-off-by: NeilBrown <neilb@suse.de>
Cc: stable@kernel.org
14 years agoRevert "microblaze: Kill NET_SKB_PAD and NET_IP_ALIGN overrides."
David S. Miller [Fri, 7 May 2010 09:55:33 +0000 (02:55 -0700)]
Revert "microblaze: Kill NET_SKB_PAD and NET_IP_ALIGN overrides."

This reverts commit 39e0786d3cf39c6d2f47b4818ae2da8b8ebc9ce2.

On request from microblaze developers, they are going to handle
this differently.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoALSA: hda - fix DG45ID SPDIF output
Wu Fengguang [Fri, 7 May 2010 00:47:54 +0000 (08:47 +0800)]
ALSA: hda - fix DG45ID SPDIF output

This reverts part of commit 52dc438606d1e, in order to fix a regression:
broken SPDIF output on Intel DG45FC motherboard (IDT 92HD73E1X5 codec).

--- DG45FC-IDT-codec-2.6.32  (SPDIF OK)
+++ DG45FC-IDT-codec-2.6.33  (SPDIF broken)

 Node 0x22 [Pin Complex] wcaps 0x400301: Stereo Digital
   Pincap 0x00000010: OUT
-  Pin Default 0x40f000f0: [N/A] Other at Ext N/A
-    Conn = Unknown, Color = Unknown
-    DefAssociation = 0xf, Sequence = 0x0
-  Pin-ctls: 0x00:
+  Pin Default 0x014510a0: [Jack] SPDIF Out at Ext Rear
+    Conn = Optical, Color = Black
+    DefAssociation = 0xa, Sequence = 0x0
+  Pin-ctls: 0x40: OUT
   Connection: 3
      0x25* 0x20 0x21
 Node 0x23 [Pin Complex] wcaps 0x400301: Stereo Digital
   Pincap 0x00000010: OUT
-  Pin Default 0x01451140: [Jack] SPDIF Out at Ext Rear
+  Pin Default 0x074510b0: [Jack] SPDIF Out at Ext Rear Panel
     Conn = Optical, Color = Black
-    DefAssociation = 0x4, Sequence = 0x0
-    Misc = NO_PRESENCE
-  Pin-ctls: 0x40: OUT
+    DefAssociation = 0xb, Sequence = 0x0
+  Pin-ctls: 0x00:
   Connection: 3
      0x26* 0x20 0x21

Cc: <stable@kernel.org>
Cc: Alexey Fisher <bug-track@fisher-privat.net>
Tested-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoblk-cgroup: Fix an RCU warning in blkiocg_create()
Li Zefan [Fri, 7 May 2010 06:57:00 +0000 (08:57 +0200)]
blk-cgroup: Fix an RCU warning in blkiocg_create()

with CONFIG_PROVE_RCU=y, a warning can be triggered:

  # mount -t cgroup -o blkio xxx /mnt
  # mkdir /mnt/subgroup

...
kernel/cgroup.c:4442 invoked rcu_dereference_check() without protection!
...

To fix this, we avoid caling css_depth() here, which is a bit simpler
than the original code.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 years agobnx2: Add prefetches to rx path.
Michael Chan [Thu, 6 May 2010 08:58:13 +0000 (08:58 +0000)]
bnx2: Add prefetches to rx path.

Add prefetches of the skb and the next rx descriptor to speed up rx path.

Use prefetchw() for the skb [suggested by Eric Dumazet].

The rx descriptor is in skb->data which is mapped for streaming mode DMA.
Eric Dumazet pointed out that we should not prefetch the data before
dma_sync.  So we prefetch only if dma_sync is no_op on the system.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2: Add GRO support.
Michael Chan [Thu, 6 May 2010 08:58:12 +0000 (08:58 +0000)]
bnx2: Add GRO support.

And turn on NETIF_F_GRO by default [requested by DaveM].

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotehuti: Remove unnecessary memset of netdev private data
Tobias Klauser [Thu, 6 May 2010 05:43:04 +0000 (05:43 +0000)]
tehuti: Remove unnecessary memset of netdev private data

The memory for the private data is allocated using kzalloc in
alloc_etherdev (or alloc_netdev_mq respectively) so there is no need to
set it to 0 again.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosunhme: Remove unnecessary memset of netdev private data
Tobias Klauser [Thu, 6 May 2010 05:41:44 +0000 (05:41 +0000)]
sunhme: Remove unnecessary memset of netdev private data

The memory for the private data is allocated using kzalloc in
alloc_etherdev (or alloc_netdev_mq respectively) so there is no need to
set it to 0 again.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosmc9194: Remove unnecessary memset of netdev private data
Tobias Klauser [Thu, 6 May 2010 05:41:31 +0000 (05:41 +0000)]
smc9194: Remove unnecessary memset of netdev private data

The memory for the private data is allocated using kzalloc in
alloc_etherdev (or alloc_netdev_mq respectively) so there is no need to
set it to 0 again.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethoc: Remove unnecessary memset of napi member in netdev private data
Tobias Klauser [Thu, 6 May 2010 05:41:12 +0000 (05:41 +0000)]
ethoc: Remove unnecessary memset of napi member in netdev private data

The memory for the private data is allocated using kzalloc in
alloc_etherdev (or alloc_netdev_mq respectively) so there is no need to
set the napi member it to 0 explicitely.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobcm63xx_enet: Remove unnecessary memset of netdev private data
Tobias Klauser [Thu, 6 May 2010 05:40:58 +0000 (05:40 +0000)]
bcm63xx_enet: Remove unnecessary memset of netdev private data

The memory for the private data is allocated using kzalloc in
alloc_etherdev (or alloc_netdev_mq respectively) so there is no need to
set it to 0 again.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoKS8695: Remove unnecessary memset of netdev private data
Tobias Klauser [Thu, 6 May 2010 05:40:29 +0000 (05:40 +0000)]
KS8695: Remove unnecessary memset of netdev private data

The memory for the private data is allocated using kzalloc in
alloc_etherdev (or alloc_netdev_mq respectively) so there is no need to
set it to 0 again.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years ago3c523: Remove unnecessary memset of netdev private data
Tobias Klauser [Thu, 6 May 2010 05:39:46 +0000 (05:39 +0000)]
3c523: Remove unnecessary memset of netdev private data

The memory for the private data is allocated using kzalloc in
alloc_etherdev (or alloc_netdev_mq respectively) so there is no need to
set it to 0 again.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years ago3c507: Remove unnecessary memset of netdev private data
Tobias Klauser [Thu, 6 May 2010 05:39:11 +0000 (05:39 +0000)]
3c507: Remove unnecessary memset of netdev private data

The memory for the private data is allocated using kzalloc in
alloc_etherdev (or alloc_netdev_mq respectively) so there is no need to
set it to 0 again.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agorps: Various optimizations
Eric Dumazet [Fri, 7 May 2010 05:07:48 +0000 (22:07 -0700)]
rps: Various optimizations

Introduce ____napi_schedule() helper for callers in irq disabled
contexts. rps_trigger_softirq() becomes a leaf function.

Use container_of() in process_backlog() instead of accessing per_cpu
address.

Use a custom inlined version of __napi_complete() in process_backlog()
to avoid one locked instruction :

 only current cpu owns and manipulates this napi,
 and NAPI_STATE_SCHED is the only possible flag set on backlog.
 we can use a plain write instead of clear_bit(),
 and we dont need an smp_mb() memory barrier, since RPS is on,
 backlog is protected by a spinlock.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomicroblaze: Kill NET_SKB_PAD and NET_IP_ALIGN overrides.
David S. Miller [Fri, 7 May 2010 05:01:53 +0000 (22:01 -0700)]
microblaze: Kill NET_SKB_PAD and NET_IP_ALIGN overrides.

NET_IP_ALIGN defaults to 2, no need to override.

NET_SKB_PAD is now 64, which is much larger than microblaze's
L1_CACHE_SIZE so no need to override that either.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Increase NET_SKB_PAD to 64 bytes
Eric Dumazet [Fri, 7 May 2010 04:58:51 +0000 (21:58 -0700)]
net: Increase NET_SKB_PAD to 64 bytes

eth_type_trans() & get_rps_cpus() currently need two 64bytes cache
lines in packet to compute rxhash.

Increasing NET_SKB_PAD from 32 to 64 reduces the need to one cache
line only, and makes RPS faster.

NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv6: udp: make short packet logging consistent with ipv4
Bjørn Mork [Thu, 6 May 2010 03:44:35 +0000 (03:44 +0000)]
ipv6: udp: make short packet logging consistent with ipv4

Adding addresses and ports to the short packet log message,
like ipv4/udp.c does it, makes these messages a lot more useful:

[  822.182450] UDPv6: short packet: From [2001:db8:ffb4:3::1]:47839 23715/178 to [2001:db8:ffb4:3:5054:ff:feff:200]:1234

This requires us to drop logging in case pskb_may_pull() fails,
which also is consistent with ipv4/udp.c

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4: udp: fix short packet and bad checksum logging
Bjørn Mork [Thu, 6 May 2010 03:44:34 +0000 (03:44 +0000)]
ipv4: udp: fix short packet and bad checksum logging

commit 2783ef23 moved the initialisation of saddr and daddr after
pskb_may_pull() to avoid a potential data corruption.  Unfortunately
also placing it after the short packet and bad checksum error paths,
where these variables are used for logging.  The result is bogus
output like

[92238.389505] UDP: short packet: From 2.0.0.0:65535 23715/178 to 0.0.0.0:65535

Moving the saddr and daddr initialisation above the error paths, while still
keeping it after the pskb_may_pull() to keep the fix from commit 2783ef23.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: stable@kernel.org
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branches 'bugzilla-14337', 'bugzilla-14998', 'bugzilla-15407', 'bugzilla-15903...
Len Brown [Fri, 7 May 2010 02:04:31 +0000 (22:04 -0400)]
Merge branches 'bugzilla-14337', 'bugzilla-14998', 'bugzilla-15407', 'bugzilla-15903' and 'misc-2.6.34' into release

14 years agodrm/ttm: Remove the ttm_bo_block_reservation() function.
Thomas Hellstrom [Wed, 28 Apr 2010 09:33:25 +0000 (11:33 +0200)]
drm/ttm: Remove the ttm_bo_block_reservation() function.

It's unused and buggy in its current form, since it can place a bo
in the reserved state without removing it from lru lists.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/ttm: Remove some leftover debug messages.
Thomas Hellstrom [Wed, 28 Apr 2010 09:33:24 +0000 (11:33 +0200)]
drm/ttm: Remove some leftover debug messages.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon: async event synchronization for drmWaitVblank
Jerome Glisse [Thu, 6 May 2010 16:52:14 +0000 (18:52 +0200)]
drm/radeon: async event synchronization for drmWaitVblank

Bring radeon up to speed with the async event synchronization for
drmWaitVblank. See c9a9c5e02aedc1a2815877b0268f886d2640b771 for
more information. Without this patch event never get delivered
to userspace client.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoV4L/DVB: pxa_camera: move fifo reset direct before dma start
Stefan Herbrechtsmeier [Tue, 20 Apr 2010 06:51:29 +0000 (03:51 -0300)]
V4L/DVB: pxa_camera: move fifo reset direct before dma start

Move the fifo reset from pxa_camera_start_capture to pxa_camera_irq direct
before the dma start after an end of frame interrupt to prevent images from
shifting because of old data at the begin of the frame.

Signed-off-by: Stefan Herbrechtsmeier <hbmeier@hni.uni-paderborn.de>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB: video: testing unsigned for less than 0
Dan Carpenter [Wed, 7 Apr 2010 09:41:14 +0000 (06:41 -0300)]
V4L/DVB: video: testing unsigned for less than 0

soc_mbus_bytes_per_line() returns -EINVAL on error but we store it in an
unsigned int so the test for less than zero doesn't work.  I think it
always returns "small" positive values so we can just cast it to int
here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB: mx1-camera: compile fix
Uwe Kleine-König [Sat, 27 Mar 2010 21:42:13 +0000 (18:42 -0300)]
V4L/DVB: mx1-camera: compile fix

This fixes a regression of

7d58289 (mx1: prefix SOC specific defines with MX1_ and deprecate old names)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer dereference"
Bjørn Mork [Wed, 24 Mar 2010 10:57:57 +0000 (07:57 -0300)]
V4L/DVB: budget: Oops: "BUG: unable to handle kernel NULL pointer  dereference"

Never call dvb_frontend_detach if we failed to attach a frontend. This fixes
the following oops, which will be triggered by a missing stv090x module:

[    8.172997] DVB: registering new adapter (TT-Budget S2-1600 PCI)
[    8.209018] adapter has MAC addr = 00:d0:5c:cc:a7:29
[    8.328665] Intel ICH 0000:00:1f.5: PCI INT B -> GSI 17 (level, low) -> IRQ 17
[    8.328753] Intel ICH 0000:00:1f.5: setting latency timer to 64
[    8.562047] DVB: Unable to find symbol stv090x_attach()
[    8.562117] BUG: unable to handle kernel NULL pointer dereference at 000000ac
[    8.562239] IP: [<e08b04a3>] dvb_frontend_detach+0x4/0x67 [dvb_core]

Ref http://bugs.debian.org/575207

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB: ngene: Workaround for stuck DiSEqC pin
Oliver Endriss [Sun, 21 Mar 2010 14:48:47 +0000 (11:48 -0300)]
V4L/DVB: ngene: Workaround for stuck DiSEqC pin

Send one DiSEqC byte to make sure that the pin is set to low level.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Reviewed-by: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB: saa7146: fix regression of the av7110/budget-av driver
Hans Verkuil [Wed, 24 Mar 2010 22:09:55 +0000 (19:09 -0300)]
V4L/DVB: saa7146: fix regression of the av7110/budget-av driver

An earlier regression fix for the mxb driver (V4L/DVB: saa7146_vv: fix
regression where v4l2_device was registered too late) caused a new
regression in the av7110 driver.

Reverted the old fix and fixed the problem in the mxb driver instead.
Tested on mxb and budget-av cards.

The real problem is that the saa7146 framework has separate probe()
and attach() driver callbacks which should be rolled into one. This
is now done for the mxb driver, but others should do the same. Lack
of hardware makes this hard to do, though. I hope to get hold of some
hexium cards and then I can try to improve the framework to prevent
this from happening again.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB: v4l: fix config dependencies: mxb and saa7191 are V4L2 drivers, not V4L1
Hans Verkuil [Mon, 22 Mar 2010 06:14:22 +0000 (03:14 -0300)]
V4L/DVB: v4l: fix config dependencies: mxb and saa7191 are V4L2 drivers, not V4L1

v4l: fix config dependencies: mxb and saa7191 are V4L2 drivers, not V4L1

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB: feature-removal: announce videotext.h removal
Hans Verkuil [Mon, 22 Mar 2010 08:43:08 +0000 (05:43 -0300)]
V4L/DVB: feature-removal: announce videotext.h removal

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB: V4L - vpfe capture - fix for kernel crash
Muralidharan Karicheri [Thu, 18 Mar 2010 14:44:12 +0000 (11:44 -0300)]
V4L/DVB: V4L - vpfe capture - fix for kernel crash

As part of upstream merge, set_params() function was removed from isif.c.
This requires removal of BUG_ON() and check for set_params ptr in
vpfe_capture.c. Without this kernel crash dump is seen while bootup on DM365

Also made following changes:-

 1) converted error messages to debug messages since it is not right to flood
    the console with error messages for user mistakes.
 2) returns -EINVAL if ioctl is not supported

Signed-off-by: Muralidharan Karicheri <m-karicheri2@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB: gspca: make usb id 0461:0815 get handled by the right driver
John Ellson [Wed, 17 Mar 2010 13:22:58 +0000 (10:22 -0300)]
V4L/DVB: gspca: make usb id 0461:0815 get handled by the right driver

The 0461:0815 camera is spca561 based not spca508

Signed-off-by: John Ellson <john.ellson@comcast.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB: gspca - stv06xx: Remove the 046d:08da from the stv06xx driver
Erik Andrén [Mon, 8 Mar 2010 20:16:00 +0000 (17:16 -0300)]
V4L/DVB: gspca - stv06xx: Remove the 046d:08da from the stv06xx driver

The 046d:08da usb id shouldn't be associated with the stv06xx driver as they're
not compatible with each other.
This fixes a bug where Quickcam Messenger cams fail to use its proper driver
(gspca-zc3xx), rendering the camera inoperable.

Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Tested-by: Gabriel Craciunescu <nix.or.die@googlemail.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
14 years agoV4L/DVB: gspca - sn9c20x: Correct onstack wait_queue_head declaration
Yong Zhang [Fri, 5 Feb 2010 13:52:39 +0000 (10:52 -0300)]
V4L/DVB: gspca - sn9c20x: Correct onstack wait_queue_head declaration

Use DECLARE_WAIT_QUEUE_HEAD_ONSTACK to make lockdep happy

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
CC: Brian Johnson <brijohn@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>