Commit graph

147469 commits

Author SHA1 Message Date
Sathya Perla d79c0a207a be2net: do not use SCRATCHPAD register
The CUST_SCRATCHPAD_CSR register is used for marking if FW cleanup is
needed. This is used in a crash kernel scenario. Do no use this register as
it is not available for some functions. Instead, always issue an FLR when
a function is probed *except* when VFs are preset (enabled in the previous
PF load).

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-06 09:06:18 -07:00
Sathya Perla 421737bdd5 be2net: remove unnecessary usage of unlikely()
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-06 09:06:18 -07:00
Sathya Perla 7f64006266 be2net: fix reporting number of actual rx queues
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-06 09:06:18 -07:00
Sathya Perla 0513ac3d22 be2net: do not modify PCI MaxReadReq size
Setting the PCI MRRS to a value of 4096 (overriding the system decided
value) had provided perf improvement in TX.
But, IBM has provided feedback that on POWER platforms, this value is set
by the system firmware, and drivers modifying this value can cause
unpredictable results (like EEH errors.) So, backing off this change.
On POWER7 platforms most slots, it seems, do get a MRRS of 4096.

This patch reverts the following commit:
"be2net: Modified PCI MaxReadReq size to 4096 bytes"
commit 5a56eb10ba.

Suggested-by: Brian King <bjking1@us.ibm.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-06 09:06:18 -07:00
Sathya Perla 10329df8f9 be2net: cleanup be_vid_config()
- get rid of 2 unused arguments to the routine and some unused code
- don't use the term "vlan_tag" in place of "vid" as they are different

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-06 09:06:17 -07:00
Sathya Perla 1d1e9a467c be2net: don't call vid_config() when there's no vlan config
be_vid_config() is called from be_setup() to replay config cmds after
a card reset. Skip calling it when no vlans are configured.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-06 09:06:17 -07:00
Eugeni Dodonov 67384fe3fd char/agp: add another Ironlake host bridge
This seems to come on Gigabyte H55M-S2V and was discovered through the
https://bugs.freedesktop.org/show_bug.cgi?id=50381 debugging.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50381
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-06-06 17:05:29 +02:00
Johannes Berg b1abedada3 iwlwifi: remove extern opmode ops declarations
There's no need to declare the opmode ops
as extern since they're now dynamically
registered.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:26:00 +02:00
Johannes Berg 1280d428ad iwlwifi: move RF config into NIC config
Since the RF config is done for all devices,
there's no need to keep a separate function
that is called for all devices, move it into
the general NIC config function.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:25:17 +02:00
Johannes Berg 12b78246aa iwlwifi: configure PHY version for 1000 series
We should also configure the PHY version in the
CSR_HW_IF_CONFIG_REG register for 1000 series
devices, not just for the other devices.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:24:58 +02:00
Paul Bolle 6de4902ee8 iwlwifi: fix typo 'IWL_WATCHHDOG_DISABLED'
Commit 7c5ba4a830 ("iwlwifi: move queue
watchdog into transport") introduced the named constant
'IWL_WATCHHDOG_DISABLED'. Rename it to 'IWL_WATCHDOG_DISABLED'.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:24:36 +02:00
Johannes Berg 26a7ca9a71 iwlwifi: refactor EEPROM reading/parsing
The EEPROM reading/parsing code is all mixed in
the driver today, and the EEPROM is parsed only
when we access data from it. This is problematic
because the NVM needs to be parsed and that is
independent of reading it. Also, the NVM format
for new devices will be different and probably
require a new parser.

Therefore refactor the reading and parsing and
create two independent components. Reading the
EEPROM requires direct hardware accesses and
therefore access to the transport, but parsing
is independent and can be done on an NVM blob.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:24:19 +02:00
Emmanuel Grumbach 08838cdeca iwlwifi: configure the SKU in the HW
This was missing. Fix the mask of the REV_TYPE on the way.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:22:30 +02:00
Emmanuel Grumbach 7b6a2be9e4 iwlwifi: fix rf configuration
Johannes noticed this was completely messed up.
We got confused between masks and bit position.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:22:11 +02:00
Johannes Berg 2baa2e57a9 iwlwifi: add iwl_set_bits_mask
In a few cases we need to set a value in
a certain mask inside a register, add the
function iwl_set_bits_mask() to make such
code easy.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:21:52 +02:00
Emmanuel Grumbach 59c647b626 iwlwifi: allocate Tx cmd pool per device
Different transports will have different needs: New tranports
need headroom for their own use before the Tx cmd. So allocate
the Tx cmd pool in the transport and give it a unique name
based on dev_name.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:21:22 +02:00
Emmanuel Grumbach cde5b48700 iwlwifi: update mask value for SCD queue config
Although we don't use bit 24, this bit is valid, but bit 23
is not. Update the mask accordingly.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:21:21 +02:00
Emmanuel Grumbach 4beaf6c2f8 iwlwifi: s/txq_setup/txq_enable
We need to be able to enable / disable Tx queues in HW
dynamically. So this function is no longer related to AGG
only. It can do the job for any queue, even AC ones. Change
the name to better reflect its role.

Also use the new function to configure the AC / CMD queues
in tx_start.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:21:20 +02:00
Emmanuel Grumbach d0624be65a iwlwifi: s/txq_agg_disable/txq_disable
We need to be able to enable / disable Tx queues in HW
dynamically. So this function is no longer related to AGG
only. It can do the job for any queue, even AC ones. Change
the name to better reflect its role.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:21:19 +02:00
Emmanuel Grumbach 559b1a257d iwlwifi: use iwl_trans_set_wr_ptrs to init the queues
This functions does the job so use it instead of duplicating
the code.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:21:19 +02:00
Emmanuel Grumbach fc24861531 iwlwifi: first config the SCD queues, then activate them
The DMA channels of the FH should be activated after the
configuration of the SCD queues too.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:21:18 +02:00
Emmanuel Grumbach 588d932044 iwlwifi: SCD_INT_MSK is obsolete - don't update it
The scheduler can issue an interrupt when moving the read
pointer. To get this interrupt, the driver needs to
configure what queue can issue an interrupt when its read
pointer moves in the scheduler: this is the SCD_INT_MSK.
The driver also needs to enable the interrupt in
CSR_INT_MASK (bit CSR_INT_BIT_SCD).

Since we don't enable the scheduler interrupt in
CSR_INT_MASK, there is no point in requesting an interrupt
from the scheduler: it will be masked anyway. So don't
configure the scheduler to issue interrupts at all.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:21:17 +02:00
Johannes Berg d370493f9b iwlwifi: move ht40 bitmap into config
There's no need to dynamically fill the HT40
band bitmap as it's a device parameter, just
put it into the HT configuration.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:21:16 +02:00
Johannes Berg 2587d36b1e iwlwifi: unify tx_chains_num setting
There's no need to copy the same code for all
devices since none of the 5000 series devices
(that don't have the RX SISO override) don't
set the rx_with_siso_diversity variable.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:21:15 +02:00
Johannes Berg 1023fdc485 iwlwifi: move DVM code into subdirectory
Since we're working on another mode/driver
inside iwlwifi, move the current one into a
subdirectory to more cleanly separate the
code. While at it, rename all the files.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:21:14 +02:00
Johannes Berg 20041ea622 iwlwifi: trust mac80211 HT40 setting
When mac80211 asks us to do HT40, it'll not do so
on a channel that we marked as not having HT40+/-
with IEEE80211_CHAN_NO_HT40PLUS (or MINUS). Thus,
there's no need to verify it again in the driver.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:09:51 +02:00
Johannes Berg 6468a01a71 iwlwifi: move PCIe into subdirectory
Structure the code a bit more and move all PCIe code
including the hardware configuration files into a
PCIe specific subdirectory.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:09:30 +02:00
Ilan Peer 76a3aa8993 iwlwifi: clear STATUS_SCAN_HW when PAN_PARAMS fails
The STATUS_SCAN_HW is set before calling iwlagn_set_pan_params
(used as an input to calculate slot time allocation). The bit needs
to be cleared in case sending the command fails.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:08:41 +02:00
Johannes Berg 53e1116ebd iwlwifi: give HT format to mac80211/radiotap
We know whether we received a frame in GF format
or not, add it to the radiotap information.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:08:40 +02:00
Johannes Berg cc66880ba5 iwlwifi: use mac80211 channel for radar check
In channel switch, instead of relying on our internal
channel database, just use the mac80211 channel that
we filled with that information on startup.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:08:39 +02:00
Johannes Berg d9b9d940ac iwlwifi: use mac80211 channels for reset scan
Instead of iterating our own channel list,
use the mac80211 channel list since that's
already processed per band and thus makes
for less code.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:08:38 +02:00
Johannes Berg 9dc216d740 iwlwifi: trust mac80211 channel setting
mac80211 will never set, switch to, or scan on an
invalid channel, so remove the code to validate
the channels against the driver channel list.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:06:07 +02:00
Johannes Berg 7ad580c2e6 iwlwifi: use mac80211 channel in connection init
mac80211 guarantees that the channel pointer is
always valid, so we can use that instead of our
own channel list.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:05:39 +02:00
Johannes Berg aca86268fa iwlwifi: make a lot of functions static
A lot of functions were temporarily made non-static
for experimental work, make them static again now.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:05:08 +02:00
Ilan Peer 622a926823 iwlwifi: handle race condition in ROC flow
When a remain on channel request from mac80211 is followed by
a request to tx a mgmt frame offchannel, it is possible that
the remain on channel expires before the device reported the
tx status for the frame. This causes a race condition in
mac80211.

To fix this, delay the ROC notification to mac80211 until the
device reported the Tx status for all frames in the aux queue.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:03:54 +02:00
Ilan Peer e19ebcab01 iwlwifi: Check BSS ctx active before call mac80211
It is possible that the BSS context is not active (for example
when the current mode is set to GO), or that the vif->type is
different than station. In such a case we cannot
call mac80211 to report the average rssi for the interface
(the function assumes that the vif is valid and that the type
is station).

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-06-06 13:03:25 +02:00
John Fastabend 43e95f11ac ixgbe: IXGBE_RXD_STAT_VP set even with Rx stripping enabled
The hardware bit IXGBE_RXD_STAT_VP appears to be set even when Rx
stripping is disabled. This results in passing frames up the stack
which do not have the 802.1Q tag stripped but have the tci bits
set as if it was.

Working around this with a check for the feature flag bit. I
would welcome any better ideas or a pointer to exactly which
bits in the hardware register need to be cleared to get the
IXGBE_RXD_STAT_VP bit to be set per data sheet.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Marcus Dennis <marcusx.e.dennis@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-06-05 21:04:25 -07:00
John Fastabend 146d4cc98d ixgbe: fix_features rxvlan is independent of DCB and needs to be set
DCB can be used independent of if RX VLAN stripping is enabled
or disabled so remove erroneous check.

Also enable or disable VLAN stripping when features are applied so
hardware and feature flags are in sync.

CC: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Marcus Dennis <marcusx.e.dennis@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-06-05 21:00:31 -07:00
Bruce Allan 470a54207c e1000e: test for valid check_reset_block function pointer
commit 44abd5c127 introduced NULL pointer
dereferences when attempting to access the check_reset_block function
pointer on 8257x and 80003es2lan non-copper devices.

This fix should be applied back through 3.4.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-06-05 20:47:50 -07:00
Jan Ceuleers cbfc60717b gianfar_ethtool: coding style and whitespace cleanups
Signed-off-by: Jan Ceuleers <jan.ceuleers@computer.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-05 15:38:40 -07:00
Jan Ceuleers 3a2e16c816 gianfar: Remove superfluous initialisations
Signed-off-by: Jan Ceuleers <jan.ceuleers@computer.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-05 15:38:40 -07:00
Jan Ceuleers bc4598bc07 gianfar: various coding style and whitespace cleanups
Signed-off-by: Jan Ceuleers <jan.ceuleers@computer.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-05 15:38:40 -07:00
Jan Ceuleers 0977f817df gianfar: comment cleanup
Signed-off-by: Jan Ceuleers <jan.ceuleers@computer.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-05 15:38:40 -07:00
Jan Ceuleers 2281a0f334 gianfar: whitespace cleanup - pointers and multiplications
Signed-off-by: Jan Ceuleers <jan.ceuleers@computer.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-05 15:38:40 -07:00
Stanislav Yakovlev fdbfff7340 net/wireless: ipw2200: introduce ipw_read_eeprom function
We separate reading of device's eeprom content from writing it back
to the device's sram.

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 17:15:49 -04:00
Avinash Patil 605b73af32 mwifiex: support NL80211_HIDDEN_SSID_ZERO_LEN for uAP
mwifiex uAP supports NL80211_HIDDEN_SSID_ZERO_LEN type of hidden
SSID only. NL80211_HIDDEN_SSID_ZERO_CONTENTS is not supported.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 17:15:47 -04:00
Avinash Patil aa4bbbe448 mwifiex: invalidate bss config before setting channel for uAP
Mark bss_config parameters as invalid before setting AP channel.
This prevents from setting invalid parameters while setting AP
channel to FW.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 17:15:45 -04:00
Johannes Berg aa430da410 cfg80211: provide channel to start_ap function
Instead of setting the channel first and then
starting the AP, let cfg80211 store the channel
and provide it as one of the AP settings.

This means that now you have to set the channel
before you can start an AP interface, but since
hostapd/wpa_supplicant always do that we're OK
with this change.

Alternatively, it's now possible to give the
channel as an attribute to the start-ap nl80211
command, overriding any preset channel.

Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:16 -04:00
Meenakshi Venkataraman d38069d1e3 iwlwifi: add debugging to shadow registers and fix typo
Add a debugging log when using shadow
registers. Also fix a minor typo in this
connection.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:14 -04:00
Johannes Berg 20d3b64752 iwlwifi: clean up coding style in PCIe transport
Mostly clean up indentation around parentheses
after if, function calls, etc. and also a few
unneeded line breaks and some other things.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:14 -04:00
Johannes Berg ac91f91045 iwlwifi: move notification wait into core
This code is a library to be used by multiple
opmodes, so move it into the iwlwifi module.

Reviewed-by: Donald H Fry <donald.h.fry@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:14 -04:00
Don Fry cc5f7e3976 iwlwifi: implement dynamic opmode loading
This is the next step in splitting up the driver,
making the uCode API dependent pieces of it live
in separate modules. Right now there's only one
so it's not user-selectable, but we're actively
working on more.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:13 -04:00
Johannes Berg c08ce20c7e iwlwifi: move IWL_CMD_FAILED_MSK
This is common, not uCode API specific, so move
it to the transport together with the command
header struct definition.

Reviewed-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Reviewed-by: Guy Cohen <guy.cohen@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:13 -04:00
Johannes Berg 76ed2edd5b iwlwifi: properly handle device_set_wakeup_enable
This is intended to be set whenever wakeup will be
needed upon suspend, not only when suspending, so
use the new callbacks to set it then.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:13 -04:00
Gregory Greenman ff110c8f93 iwlwifi: Move IWL_MASK macro to transport.
This macro is needed by other transports besides PCIe, thus
moving to a common location.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:12 -04:00
Emmanuel Grumbach eec373f026 iwlwifi: s/iwlagn_unmap_tfd/iwl_unmap_tfd
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:12 -04:00
Emmanuel Grumbach bc2529c337 iwlwifi: s/iwlagn_txq_free_tfd/iwl_txq_free_tfd
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:12 -04:00
Johannes Berg 142fb5b733 iwlwifi: add __printf argument checking
Joe Perches suggested adding the __printf attribute
to the __iwl_dbg function to check arguments; add it
to all of the logging functions (err, warn, info, dbg
and crit.)

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:12 -04:00
Meenakshi Venkataraman a35e270881 iwlwifi: fix debug print in iwl_sta_calc_ht_flags
We missed passing an argument to the
debug print. Fix it.

Cc: stable@kernel.org
Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:11 -04:00
Emmanuel Grumbach 726f23fdeb iwlwifi: fix prints in iwl_rx_handle
The debug prints were wrong and buggy. The HW pointer wasn't printed
correctly, it was mixed up with the pointer to the rxbuf.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:11 -04:00
villacis@palosanto.com ccf91bd678 rt2x00: Add support for RT5360 based PCI devices.
This chip is used at least by the D-Link DWA-525 adapter.

Signed-off-by: Alex Villac<ED>s Lasso <a_villacis@palosanto.com>
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:11 -04:00
Ben Greear b90bd9d14f ath9k: Support ethtool getstats api.
This returns many of the values that formerly could
only be obtained from debugfs.  This should be an
improvement when trying to access these counters
programatically.  Currently this support is only
enabled when DEBUGFS is enabled because otherwise
these stats are not accumulated.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:32:10 -04:00
Mohammed Shafi Shajakhan d25360b190 ath9k: Fix modal EEPROM dump
we provide excess buffer size for 'simple_read_from_buffer'
for modal EEPROM dump. This results in trailing NULL bytes
at the end of EEPROM dump, fix this.

Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Reported-by: Holger Schurig <holgerschurig@googlemail.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Tested-by: Holger Schurig <holgerschurig@gogglemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:23:20 -04:00
Dan Carpenter 1dacd1980d brcm80211: brcmu_pkt_buf_free_skb() should handle NULL
This is potentially called with NULL pointers, for example, look at
brcmf_c_prec_enq().  Since it's a free() function, probably people
expect it to handle NULL pointers.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:23:20 -04:00
Dan Carpenter 9be0292337 brcm80211: remove an unneeded NULL check
This code causes a static checker warning because "pi" gets dereferenced
before it is checked.  The dereference is inside the write_phy_reg()
function which is called from wlc_phy_write_txmacreg_nphy().

This code is only called from wlc_phy_init_nphy() and "pi" is a
valid pointer so we can remove the check for NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:23:20 -04:00
Albert Pool 8fd9d059af rt2800usb: 2001:3c17 is an RT3370 device
D-Link DWA-123 rev A1

Signed-off-by: Albert Pool<albertpool@solcon.nl>
Cc: <stable@vger.kernel.org>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 15:23:20 -04:00
Daniel Vetter cb05d8dede drm/i915: fix up ivb plane 3 pageflips
Or at least plug another gapping hole. Apparrently hw desingers only
moved the bit field, but did not bother ot re-enumerate the planes
when adding support for a 3rd pipe.

Discovered by i-g-t/flip_test.

This may or may not fix the reference bugzilla, because that one
smells like we have still larger fish to fry.

v2: Fixup the impossible case to catch programming errors, noticed by
Chris Wilson.

References: https://bugs.freedesktop.org/show_bug.cgi?id=50069
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Eugeni Dodonov <eugeni.dodonov@intel.com>
Cc: stable@vger.kernel.org
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-06-05 21:05:21 +02:00
Linus Torvalds 5f73639c63 Merge branch '3.5-merge-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Pull two scsi target fixes from Nicholas Bellinger:
 "The first is a small name-space collision fix from Stefan for the new
  sbp-target / ieee-1394 code, and second is the FILEIO backend
  conversion patch to always use O_DSYNC by default instead of O_SYNC as
  recommended by hch.  Note the latter is CC'ed stable."

* '3.5-merge-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  target/file: Use O_DSYNC by default for FILEIO backends
  sbp-target: rename a variable to avoid name clash
2012-06-05 11:55:27 -07:00
Johannes Berg 0e1fa7ef25 iwlwifi: unregister LEDs if mac80211 registration fails
Otherwise the LEDs stick around and cause issues the
next time around since they're still there but not
really hooked up.

Cc: stable@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 14:27:30 -04:00
Johannes Berg f69a23b795 iwlwifi: fix double free/complete in firmware loading
Linus reported that due to mac80211 failing to register
the device (due to WoWLAN) his machine crashed etc. as
we double-freed the vmalloc() firmware area. His patch
to fix it was very similar to this one but I noticed
that there's another bug in the area: we complete the
completion before starting, so since we're running in
a work struct context stop() could be called while in
the middle of start() which will almost certainly lead
to issues.

Make a modification similar to his to avoid the double-
free but also move the completion to another spot so it
is only done after start() either finished or failed so
that stop() can have a consistent state.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 14:27:29 -04:00
Linus Torvalds 690efa08e2 Merge branch 'i2c-embedded/for-current' of git://git.pengutronix.de/git/wsa/linux
Pull embedded i2c update from Wolfram Sang:
 "This only contains one new driver which had multiple dependencies
  (pinctrl, i2c-mux-rework, new devm_* functions), so I decided to wait
  for rc1.  Plus, it had to wait a little for the ack of a devicetree
  maintainer since the bindings were not trivial enough for me to pass
  through.

  So, given that, I hope there is still something like the "new driver
  rule", so we could have the driver in 3.5 and people can start using
  it.  That would make merging support for some boards easier for 3.6
  since the dependency on this driver is gone then."

* 'i2c-embedded/for-current' of git://git.pengutronix.de/git/wsa/linux:
  i2c: Add generic I2C multiplexer using pinctrl API
2012-06-05 10:55:31 -07:00
Victor Goldenshtein a4203c6453 wlcore: wait for roc complete only for the first roc command
In some multi role scenarios the driver might send multi
roc requests without sending a croc first, the fw queues
those requests and starts service the next roc request as
soon as the driver sends a croc for the previous one. So,
if the fw rocs on channel X and driver asks to roc also
on channel Y, the fw will not start service Y (and will
not send roc complete event for this request) until the
driver releases the fw with croc X.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:32 +03:00
Victor Goldenshtein e832837bbb wlcore: don't enable BET for high basic rates
The beacon early termination is not relevant for
high basic rates, which doesn't contribute
anything to the PS and only adds unnecessary FW
work.

Enable BET only if the basic rate is less than 9
Mbps.

Signed-off-by: Ziv Riesel <zivriesel@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:32 +03:00
Victor Goldenshtein 461b958fd6 wl18xx: fix fm_coex parameters configuration
Wrong fm_coex parameters were set during wl18xx
init phase, fix it.

Signed-off-by: Ziv Riesel <zivriesel@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:32 +03:00
Victor Goldenshtein 836d3f2058 wl12xx: fix fm_coex parameters configuration
Wrong fm_coex parameters were set during wl12xx
init phase, fix it.

Signed-off-by: Ziv Riesel <zivriesel@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:32 +03:00
Arik Nemtsov 5a344b87ce wlcore: remove duplicate BUG_ON during recovery
This BUG_ON also ignored the INTENDED_FW_RECOVERY flag. This would
result in a BUG() when using the bug_on_recovery module parameter during
multi-role.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:31 +03:00
Eliad Peller 0c21298435 wlcore: increase WL1271_EVENT_TIMEOUT
In some cases, the ROC_COMPLETE event might exceed the
current timeout (750 msec). Increase it to 1 sec.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:31 +03:00
Eliad Peller d1bcb53f91 wlcore: flush tx on CHANGE_CHANNEL
On CHANGE_CHANNEL indication, we should flush all the
queued tx frames, so they will be sent on the correct
(current) channel.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:31 +03:00
Yoni Divinsky feb47eb86b wlcore: fix the CONF_TX_AC_ANY_TID to be 0xff
In the enum conf_tx_ac CONF_TX_AC_ANY_TID should
be 0xff to match the firmware's implementation.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:31 +03:00
Yoni Divinsky 4a6c789b73 wl12xx: set the irq polarity before loading the fw
The polarity should be set before the firmware is loaded
since the firmware touches the same register. Access
of the firmware and driver to the same register will
cause a collision since there is no exclusion scheme.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:31 +03:00
Yoni Divinsky 2e42c203a9 wlcore: use psd_type indexing according to spec
In ieee80211.h the uapsd bit mask is defined such that
VO=BIT(0), VI=BIT(1), BK=BIT(2), BE=BIT(3).
The firmware uses the indexing as defined in the ieee80211
spec, meaning that VO=3, VI=2, BK=1, BE=0.

In AP mode when adding peer wlcore needs to convert
the indexing accordingly.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:31 +03:00
Eliad Peller bfb92ca133 wlcore: set wl->ht_cap per-band
Save the ht_cap IE per-band, so we can configure different
params to BG and A bands (we currently don't support MIMO
on A band)

[Small fix for rx_highest - Arik]

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:09 +03:00
Arik Nemtsov a121a5b8ab wl18xx: add dependency on mac80211
Add a dependency on mac80211 in Kconfig, and also replace some spaces
with tabs.

Reported-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:09 +03:00
Assaf Azulay 0a15d9b589 wlcore: increase number of BA sessions to 3
With the new FW (sigle role X.3.8.0.108, multi role X.5.4.0.21)
we are supporting 3 RX BA sessions, this change is to support this
new ability.

Signed-off-by: Assaf Azulay <assaf@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Igal Chernobelsky 7b052214e5 wlcore: modify bss loss parameters
Modify default parameters to reduce firmware BSS lose
probability in congested environment.

[Applied to 18xx configuration as well - Arik]

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Eliad Peller b515d83a29 wlcore: flush before stopping AP
Make sure the deauth bcast gets sent

[Make sure we are AP as well before the flush - Arik]

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Eliad Peller 45b60f7ddd wlcore: use correct link for bcast/multicast frames
Multicast management frames (e.g. global deauth)
should be sent out on the bcast link, rather than
the global, which should be used only for pre-added
stations (e.g. for auth/assoc resp).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Arik Nemtsov 6b8bf5bc5e wlcore: fixes for connection_loss_work
We can't use cancel_delayed_work_sync() from functions that take the
wl->mutex, since connection_loss_work also takes the mutex. This might
result in a deadlock. Restructure the code so the work is synchronously
canceled before taking the mutex.
Avoid a bug where we would indefinitely delay the connection loss
indication by re-queuing the connection loss work on consecutive beacon
loss events.

Cc: bartosz.markowski <bartosz.markowski@tieto.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Arik Nemtsov 6e066921b3 wlcore: fix dynamic_ps_timeout time regression
In patch d7b63b9fc7 we have raised the dynamic
PS timeout to 200ms to improve user experience. Re-apply the change,
since it was reverted in the wlcore split.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Eliad Peller 1ab0f21262 wlcore: use the original elp time in forced_ps mode
The dynamic PS timeout is meaningless in forced PS mode.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Arik Nemtsov d35dc739f6 wlcore: fix sparse warnings related to static functions
The "static" modifier was mistakenly forgotten for some functions.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Alex Deucher d430f7dbf7 drm/radeon/kms: add new Trinity PCI ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 15:11:09 +01:00
Luciano Coelho b5d6d9b28c wlcore/wl12xx/wl18xx: don't use TX align quirk for wl127x
Commit 4afc37 (wlcore: reorder identify_chip and get_hw_info) broke
support for wl127x chips.

When we moved the identify_chip operation to an earlier stage (ie. to
the probe function), we broke wl127x support because during HW init we
would set the WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN.

To avoid this, set this quirk in the identify_chip operations and only
force it to be unset if the bus module doesn't support it.  We were
doing the opposite and setting the flag if the bus module supports it.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 16:07:16 +03:00
Assaf Azulay 3d62eb5a7e wl18xx: change default tcp_checksum to false
as tcp check sum is going to be removed from firmware, and as
there is a problem with getting dns in security when checksum is
enabled, it was decided to disable it by default.
for none security modes it can be enabled by module paramenter.

Signed-off-by: Assaf Azulay <assaf@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:59:41 +03:00
Luciano Coelho c5d94169e8 wl18xx: use new fw stats structures
Some of the structures were updated, other structures had a few
missing values and a few new ones were added.  Change the driver
structs accordingly.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:59:10 +03:00
Luciano Coelho 3507efa084 wl18xx: increase tx_ba_win_size to 64
Now the firmware can support TX block ack sessions with 64 frames.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:59:06 +03:00
Luciano Coelho 5a7589be34 wlcore: increase aggregation buffer size by one page
With 4 pages (16Kb), we can't fit 10 frames in the aggregation buffer
during iperf.  This is the optimal for the firmware.  Thus, increase
the buffer size by one page.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:59:02 +03:00
Luciano Coelho ad62d81a9e wlcore/wl12xx/wl18xx: move lower driver debugfs to a subdir
Instead of adding more files from the lower drivers into the same
directory in debugfs as wlcore, we now add a subdirectory for the
lower driver.  This makes things a bit easier, because we can quickly
see where the debugfs entry is implemented and what is specific to the
lower driver.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:59 +03:00
Luciano Coelho 7b03c306da wl18xx: export pwr_limit_reference_11_abg value as a module parameter
Yet another temporary module parameter requested by the firmware team.
This will be replaced by the conf binary.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:54 +03:00
Luciano Coelho 858403ab44 wl18xx: export low/high band component values as module params
We use hardcoded values for the different board types.  In some cases
we may need to override the defaults, so export the values as module
params.  If not defined, the defaults for the specified board type
will be used.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:51 +03:00
Luciano Coelho 5add82edd1 wl18xx: add power limit reference value to mac_and_phy settings
With more recent PHY firmware versions (>8.1.0.0.116), we need to use
the correct value for the pwr_limit_reference_11_abg parameter when
setting the mac_and_phy options.

For now we use a hardcoded 0xc8 as the value.  This will be moved to
the configuration binary when it gets implemented.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:46 +03:00
Luciano Coelho 8334271882 wl18xx: add module parameter to force SISO 20MHz
In some cases it may be useful to force narrow-band SISO channels.
Add a new value to the ht_mode module parameter to force the device to
operate in SISO 20MHz.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:42 +03:00
Luciano Coelho 60462b4885 wlcore: use proper values for supported local rates
We were setting all the rates bits when starting the AP role.  Instead
of doing this, we should set only the rates we really support
(eg. MIMO rates or wide-channel rates).  This commit changes that so
that we always use the default rates (basic rates + MCS0-7) and add
the values returned by the ap_get_mimo_wide_rate_mask operation.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:36 +03:00
Luciano Coelho 174a73034c wl18xx: don't use MIMO when ht_mode is set to wide
If the wl18xx module is loaded with ht_mode=wide (the default), we
shouldn't use MIMO rates when the channel type is not HT40.  Fix this
by checking the ht_mode before deciding which rates to used.
Additionally, set the ht_mode parameter explicitly to "wide" as the
default.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:32 +03:00
Luciano Coelho 06bba80e71 wlcore: print the interrupt status when recovery is triggered
In some cases it may be useful for debugging to check what is the
status of the interrupt register when a hardware recovery happens.
Print the contents of REG_INTERRUPT_NO_CLEAR (aka. HINT_STS_RAW) when
recovery starts.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:28 +03:00
Luciano Coelho 283e8c425f wl18xx: print the PHY firmware version from the private static data
The wl18xx firmware writes the PHY firmware version in the static
data.  Add an operation to parse the static data and print the PHY
firmware version when booting.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:24 +03:00
Luciano Coelho 7140df6e51 wlcore: create private static_data area and add operation to parse it
The wl18xx firmware has more information in the static_data than
wl12xx.  To be able to parse that in an abstracted way, this patch
adds a priv area to the static data struct and an operation that
allows the lower driver to parse it if necessary.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:20 +03:00
Luciano Coelho 8c0ea1021c wl18xx: implement fw status debugfs entries
Implement the operations that are necessary to fetch the
wl18xx-specific FW statistics and export them in debugfs.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:16 +03:00
Luciano Coelho 10b1e8a27a wl12xx: implement fw status debugfs entries
Implement the operations that are necessary to fetch the
wl12xx-specific FW statistics.  Re-add some of the code removed from
wlcore.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:12 +03:00
Luciano Coelho bcca1bbdd4 wlcore: add debugfs macro to help print fw statistics arrays
Add a macro to make it easy to print arrays from the FW statistics
array in debugfs.  At the same time, increase the buffer size so
arrays fit more easily.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:08 +03:00
Luciano Coelho 4987257c30 wlcore: abstract debugfs fw_stats to be handled by the lower drivers
The FW statistics differ from hardware to hardware.  This commit
prepares for hardware-specific implementation of the FW statistics
debugfs entries.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:02 +03:00
Luciano Coelho 15e05bc059 wlcore: use all AP basic rates as default
Sometimes we get a BSS_CHANGED_BEACON_ENABLED event before the basic
rates have been properly set.  To avoid problems with the firmware not
expecting to receive frames at rates that are not set during
CMD_START_ROLE, we now start with all basic rates by default.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:58 +03:00
Luciano Coelho 62c2e579e0 wlcore: update beacon and probe_resp templates when rates change
When the data rates change, we get BSS_CHANGED_BASIC_RATES.  At this
point, we should update all the templates to match the new rates.  We
were changing some of the templates, but the beacon and the probe
response templates were missing.

[Remove redundant min_rate variable - Arik]

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:50 +03:00
Luciano Coelho 7ae25da396 wl18xx: disable MCS_13 for wl18xx PG 1.0
There are some problems with MCS_13 in PG 1.0 hardware.  So we disable
it when PG 1.0 is detected.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:45 +03:00
Luciano Coelho 4afc37a0c1 wlcore: reorder identify_chip and get_hw_info
We can do get the HW information and identify the chip already at
probe time.  This makes it easier to mangle with the parameters during
identify chip before registering the hardware with mac80211.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:41 +03:00
Luciano Coelho 73d8a42464 wl18xx: change low_band_component_type value for COM8
Like HDK, COM8 uses 0x06 for the low_band_component_type as well.
Hardcode the value for COM8 until this configuration can be done in
the external configuration binary (to be implemented).

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:36 +03:00
Luciano Coelho 4f64a1e93f wlcore: add space for private area when allocating fw_status
When allocating the fw_status structure, the space for the
lower-driver private area was missing.  This was causing an illegal
write outside the allocated area, which was causing random oopses
around the kernel.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:32 +03:00
Luciano Coelho 4b9d2365d5 wl18xx: changed default board_type to HDK
Since the most common board we're using now is an HDK board, change
the default board_type to hdk.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:27 +03:00
Luciano Coelho 776f030aa0 wl18xx: copy the default configuration before checking the board_type
We were changing the low_band_component_type in the private
configuration structure before copying the default values to it, so
the change was overwritten and only took effect after HW recovery.

Reported-by: Dror Erez <drorer@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:20 +03:00
Luciano Coelho df472894ab wlcore: add module parameter to dump SDIO reads and writes
In some cases we may want to dump all the SDIO data in order to get
detailed information for debugging the communication with the
firmware.

Add printks to dump the data and a module parameter to enable/disable
it.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:15 +03:00
Luciano Coelho 1ddbc7d4c7 wl18xx: add a module parameter to control 11a support
In wl18xx we don't have an NVS yet, so we need to control whether 11a
is supported with a module parameter for now.  11a support is enabled
by default and can be changed by setting enable_11a to false when
loading the module.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:11 +03:00
Luciano Coelho a5114d9c0d wl18xx: derive the MAC address from the BD_ADDR in fuse ROM
Add the get_mac operation in order to fetch the BD_ADDR from fuse ROM,
so that we can derive the WLAN MAC addresses from it.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:06 +03:00
Arik Nemtsov 0afd04e5e5 wlcore/wl12xx/18xx: split fw_status struct into two
The number of RX packet descriptors may vary from chip to chip and
in different firmware versions.  Unfortunately, the array that
contains the actual descriptors is in the middle of the fw_status
structure.  To manage this, we split the struct into two so we can
calculate the offset of what comes after the array and access the last
elements more easily.

[Changed the STATUS_LEN macro to be placement agnostic - Arik]

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:56:58 +03:00
Luciano Coelho 102165c6d2 wl18xx: add module parameter to disable TCP checksum
Add a new module parameter to disable TCP checksum offload.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:56:53 +03:00
Luciano Coelho e9258815a8 wl18xx: add number of antennas and dc2dc type as module params
We need to specify the number of 2.4GHz and 5GHz antennas and whether
the board has an internal or external DC2DC.  Add some module
parameters that allow changing that.

In the future this will come from the "NVS" file.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:56:48 +03:00
Luciano Coelho 0a1569f82b wl18xx: change the low_band_component_type for HDK boards
Currently, all HDK boards use low_band_component_type 0x06.  In the
future this may change, but for now, we hardcode this value when the
board_type is set to HDK.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:56:43 +03:00
Luciano Coelho be42aee6df wl18xx: add plt_init operation
Add the correct FW name for PLT (which is the same as the normal
firmware) and implement the plt_init operation.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:56:39 +03:00
Luciano Coelho c331b344d5 wlcore/wl12xx: add plt_init op and move the code to wl12xx
PLT mode needs to be initialized differently for each chip.  This
patch adds an operation to init PLT and moves the existing PLT
initialization into the wl12xx driver.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:56:33 +03:00
Arik Nemtsov 05057c0621 wl18xx: change board type enum according to new FW
Add more board types and remove a now unneeded write to SCR_PAD2 setting
the board type.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:56:31 +03:00
Arik Nemtsov 2f1d74e6e7 wl18xx: don't upload NVS to FW
In this chip family the NVS file should not be uploaded to FW. In fact,
we encounter strange bugs (sdio errors) when trying to upload it with
certain parameters.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:56:29 +03:00
Arik Nemtsov f2baf075c5 wl18xx: init Tx-released index to 0 on HW init
This ensures the index is 0 on FW recovery and prevents spurious error
prints - "WARNING illegal id in tx completion".

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:56:27 +03:00
Luciano Coelho 4b4887e971 wlcore/wl12xx: move rx_mem_pool_addr element to wl12xx
Only wl127x chips use the rx_mem_pool_addr values, which need to be
given to the firmware as part of the RX path.  Move this from core to
the wl12xx driver.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:56:22 +03:00
Arik Nemtsov 549562946f wl18xx: implement hw op to read PG version
Read the HW PG version of the 18xx chip from FUSE.

Based on an earlier patch by Luciano Coelho <coelho@ti.com>.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:56:20 +03:00
Luciano Coelho a5d751bb92 wlcore/wl12xx: move ref_clock and tcxo_clock elements to wl12xx
Only wl12xx needs to get the ref_clock anc tcxo_clock values from the
platform data.  Move these elements from the wl1271 structure to
wl12xx's private data.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:56:15 +03:00
Luciano Coelho 8388569a34 wlcore: rename wl12xx.h to wlcore_i.h
The wl12xx.h file now contains mostly definitions that are internal to
wlcore.  Still, some things need to me moved to the public header, so
for now we keep including it in wlcore.h.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:56:10 +03:00
Luciano Coelho be65202a61 wl18xx: read clock frequency and do top init accordingly
Instead of using hardcoded values for a single frequency, we need to
read the frequency and use the appropriate values for it in the top
initialization.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:56:03 +03:00
Arik Nemtsov d9fedea2a3 wl18xx: disable FW log functionality
Currently (Fw .67) appears to do more harm than good.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:56:01 +03:00
Arik Nemtsov 1c351da667 wl18xx: read FW pc on recovery
Define the FW pc in the 18xx register translation table. This specific
register is only valid in the boot partition, so change the momentarily
change partitions. This doesn't damage 12xx cards, where the FW pc is
accessible via boot partition as well.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:58 +03:00
Luciano Coelho d5b592764f wl18xx: translate and write the board type to SCR_PAD2
The firmware uses the SCR_PAD2 register to read the board type passed
from the driver.  The values don't match the ones used in the mac and
phy configuration, so we need to map them before writing.  This commit
adds a translation table that is used when writing the board type to
SCR_PAD2.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:55:53 +03:00
Luciano Coelho a9c130d522 wl18xx: add board type module argument
Different board types (ie. FPGA, HDK and DVP/EVB) require slightly
different init configuration options.  Since we cannot probe the type
of board from the actual hardware, we need to pass it as an option
during module load.

This patch adds a module parameters that accepts the 3 different board
types, with DVP/EVB as the default, and uses this value where needed.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:55:47 +03:00
Arik Nemtsov 3a8ddb6176 wl18xx: add module param for overriding HT caps
Set an alternate HT cap allowing MIMO rates (but only 20mhz) channels,
when the module is loaded with ht_mode=mimo.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:45 +03:00
Arik Nemtsov 0e0f5a3b5c wl18xx: set HT capabilities
Define the default HT capabilities of the 18xx chip family - these include
support for wide-channel.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:43 +03:00
Arik Nemtsov ebc7e57ddd wlcore/wl18xx: enable MIMO/wide-chan rates in AP-mode rate config
Add a HW op to add extra enabled rates for AP-mode data-rates. Since
the rates might depend on channel properties, reconfigure AP-mode rates
when these change.

Implement the HW op for the 18xx family, where MIMO or wide-chan rates
can be added.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:41 +03:00
Arik Nemtsov b3a47ee0ec wlcore: support peer MIMO rates
Parse the peer ht_cap element containing MCS8-MCS15 rates and pass it
to the FW. Rates unsupported by the HW will be sanitized by mac80211
before reaching us.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:40 +03:00
Arik Nemtsov f13af3484f wl18xx: ipmlement ap_rate_mask hw op
Enable wide-chan or MIMO rates when appropriate.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:38 +03:00
Arik Nemtsov a6298dbe95 wl18xx: send channel type to FW on role start
Translate the NL80211 channel type to a FW-specific channel type and send
it to the FW as part of the role-start command. For wl12xx this has no
effect - this element is treated as padding.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:33 +03:00
Arik Nemtsov 83d08d3ff3 wlcore: track current channel type per vif
Track the current 802.11 channel type, defaulting to a NO_HT channel.
Update the channel type element when changed by mac80211.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:31 +03:00
Luciano Coelho 23ee9bf8c3 wl18xx: add runtime configuration parameters
Now wlcore requires the lower drivers to set the correct
configuration.  Move the existing private configuration to the proper
place and add all generic configuration parameters.

The important changes are in Tx interrupt pacing and Rx BA window size.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:55:25 +03:00
Arik Nemtsov 169da04f52 wlcore/wl18xx: add hw op for Rx HW checksum
Some chip families can checksum certain classes of Rx packets in FW.
Implement the Rx-checksum feature as a HW-op. For the 18xx chip-family,
set Rx-checsum according to indication from FW.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:23 +03:00
Arik Nemtsov 2fc28de598 wlcore/wl18xx: add hw op for setting Tx HW checksum
Some chip families are capable of checksumming certain classes of Tx
packets in HW. Indicate this fact in the netdev features and perform the
HW checksum by protocol type for the 18xx family.

Fix the location of the skb network header when we move it so we can
rely on it when setting the checksum.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:20 +03:00
Luciano Coelho b8422dcb86 wl18xx: add hw_init operation
Add wl18xx-specific HW initialization operation and create acx.[ch]
files to support that.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:55:14 +03:00
Arik Nemtsov 872b345fba wl18xx: implement immediate Tx completion
Implement immediate Tx completion for the 18xx family. Move 18xx
specific Tx code to new tx.c/h files and create helper header files
for definitions.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:12 +03:00
Arik Nemtsov 30e2dd798d wl18xx: implement hw op for getting rx packet data length
Implement the 18xx-specific way for getting the length of a Rx packet.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:10 +03:00
Arik Nemtsov 9c809f8883 wl18xx: implement hw op for getting rx buffer data alignment
Implement the HW op for getting alignment state in wl18xx. The FW aligns
the Rx Ethernet payload data.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:08 +03:00
Arik Nemtsov 7cfefd1f2a wl18xx: set Rx block-size alignment quirk
The 18xx FW sends Rx blocks with aligned length.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:55:06 +03:00
Arik Nemtsov 1fab39dc4a wl18xx: add fw_status private data
The wl18xx chip passes extra information in the firmware status to the
driver.  Add a private data section to handle that.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:55:00 +03:00
Arik Nemtsov f648eab758 wl18xx: define HW-rate translation elements/tables
Define HW-rate conversion tables for the 18xx chip. Initialize
the appropriate wlcore elements with these tables and values to allow
conversion of HW-rates.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:54:58 +03:00
Arik Nemtsov d2361c5140 wl18xx: implement hw op for setting frame length in tx_hw_desc
Set the frame length during Tx in a way compatible with the 18xx FW.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:54:57 +03:00
Arik Nemtsov fb0f2e4ac0 wl18xx: implement hw op for setting blocks in hw_tx_desc
Add the 18xx variant to the HW Tx descriptor union and set the 18xx
specific values during Tx.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:54:55 +03:00
Arik Nemtsov 624845b31c wl18xx: implement hw op for calculating hw block count per packet
Implement the calc_tx_blocks op for the 18xx family.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:54:53 +03:00
Arik Nemtsov 1349c4212a wl18xx: set normal/GEM Tx spare block counts
Initialize the Tx spare block counts for all operating modes in the 18xx
card.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:54:51 +03:00
Arik Nemtsov cb7b5d86c8 wl18xx: set the number of Tx descriptors
Initialize the number of Tx-descriptors for the 18xx family.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:54:49 +03:00
Arik Nemtsov 9d1c973a7b wl18xx: create per-chip-family private storage
Make use of the wlcore provided private storage in the 18xx low-level
driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:54:46 +03:00
Luciano Coelho 274c66cdcd wl18xx: add trigger command and ack event operations
Add the operations that allow wlcore to trigger commands to the
firmware and acknowledge when an event has been fully received.

Allocate a private buffer to hold the maximum sized cmd. Send the
entire length of the buffer each time a command is sent to signal
EOT. Remove the previous EOT mechanism.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:54:42 +03:00
Luciano Coelho 46a1d51261 wl18xx: add some boot operations and hw-specific configurations
Implement the boot operation.  Add a wl18xx-specific configuration
structure (namely to configure the mac and phy parameters).

The default hw configuration matches the DVP board.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:54:34 +03:00
Luciano Coelho 0cd6543f68 wl18xx: add identify chip operation
Add identify_chip operation to detect the chip ID for wl185x and set
the correct firmware name.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:54:28 +03:00
Luciano Coelho 5d4a9fa692 wl18xx: add register table
Add the register table with the appropriate values for wl18xx.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:54:24 +03:00
Luciano Coelho 82b890cd4e wl18xx: add partition table
Define and add the partition table in the wlcore struct.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:54:19 +03:00
Luciano Coelho 554c36b737 wl18xx: add empty operations struct
We don't have any chip-specific operations yet, but now wlcore has
defined an operations structure and requires the pointer to be set.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:54:14 +03:00
Luciano Coelho 197c62832b wlcore_sdio/wl18xx: use SDIO revision number to identify wl18xx chips
At least in PG1, the wl18xx chips use the same SDIO vendor/device ID,
so it's not possible to figure out which driver is to be used.  As a
workaround, we can check the SDIO revision number, because wl18xx uses
3.00 and wl12xx does not.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:54:09 +03:00
Luciano Coelho 9a1a69901d wl18xx: add new module
Add the wl18xx module and the probe functions.  Use wlcore for the
main parts (not functional at this point due to differences in the
wl18xx initialization).

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:54:04 +03:00
Haojian Zhuang 61663171be regulator: max8649: fix missing regmap in rdev
In probe(), rdev->regmap must be assigned.

Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-05 11:15:22 +01:00
Christian König bb40915582 drm/radeon: fix vm deadlocks on cayman
Locking mutex in different orders just screams for
deadlocks, and some testing showed that it is actually
quite easy to trigger them.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 09:27:23 +01:00
Alex Deucher 1a8ca7502c drm/radeon: fix gpu_init on si
- Properly set up the RBs
- Properly set up the SPI
- Properly set up gb_addr_config

This should fix rendering issues on certain cards.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 09:25:54 +01:00
Rafał Miłecki 7838e05a0d drm/radeon/hdmi: don't set SEND_MAX_PACKETS bit
Many TVs and A/V receivers don't work with this bit set. Problem was
confirmed using: Onkyo TX-SR605, Sony BRAVIA KDL-52X3500, Sony BRAVIA
KDL-40S40xx. In theory this bit shouldn't affect audio engine when
feeding it with data, however it seems it does. Driver fglrx doesn't set
that bit in any of the above cases.
This fixes a regression introduced by 3.5-rc1.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 09:25:33 +01:00
Rafał Miłecki 0aecb5a4ba drm/radeon/audio: don't hardcode CRTC id
This is based on info released by AMD, should allow using audio in much
more cases.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 09:25:01 +01:00
Alex Deucher d4e30ef05c drm/radeon: make audio_init consistent across asics
Call it in the asic startup callback on all asics.
Previously r600 and rv770 called it in the startup
and resume callbacks while all the other asics called
it in the startup callback.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 09:24:33 +01:00
Seung-Woo Kim 5736603bef drm/exynos: fixed blending for hdmi graphic layer
Blending for graphic layer 0 of hdmi mixer was not set so video
layer cannot be showed if graphic layer 0 is enabled.
This patch fixes blending values to support blending between
graphic layer 0 and video layer.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-06-05 13:25:18 +09:00
Laurent Pinchart f56fdcef4d drm/exynos: Remove dummy encoder get_crtc operation implementation
The encoder get_crtc operation is called to retrieve a pointer to the
CRTC the encoder is currenctly connected to, right after setting the
encoder::crtc field to the new CRTC. The implementation of this
operation returns the pointer to the new CRTC, which is then pointlessly
compared to itself.

As the operation is not mandatory, don't implement it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-06-05 13:25:15 +09:00
Laurent Pinchart 07b6835f2c drm/exynos: Keep a reference to frame buffer GEM objects
GEM objects used by frame buffers must be referenced for the whole life
of the frame buffer. Release the references in the frame buffer
destructor instead of its constructor.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-06-05 11:53:58 +09:00
Laurent Pinchart 6037bafa2e drm/exynos: Don't cast GEM object to Exynos GEM object when not needed
The exynos_drm_gem_dumb_map_offset() doesn't need to access any
Exynos-specific GEM object fields, don't cast the GEM object.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-06-05 11:53:58 +09:00
Laurent Pinchart 293a1c128e drm/exynos: DRIVER_BUS_PLATFORM is not a driver feature
DRIVER_BUS_PLATFORM is a bus type used internally in the DRM core, not a
flag for the drm_driver::driver_features field.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-06-05 11:53:58 +09:00
Ville Syrjälä 363b06aaa5 drm/exynos: Use DRM_FORMAT_{NV12, YUV420} instead of DRM_FORMAT_{NV12M, YUV420M}
The NV12M/YUV420M formats are identical to the already existing standard
NV12/YUV420 formats. The M variants will be removed, so convert the
driver to use the standard names.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-06-05 11:51:43 +09:00
Samuel Ortiz 51ad304cc8 NFC: Monitor pn533 target mode
When receiving a DEP link down event, we should cancel all pending URBs
if we're activated as a target or if we're an initiator.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:34 +02:00
Samuel Ortiz 0201ed0349 NFC: Convert pn533 from semaphore to mutex
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:34 +02:00
Samuel Ortiz 41a8ec496d NFC: Set the proper baud rate when trying to activate pn533 targets
We get the right baud rate from the last polled modulation.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:33 +02:00
Samuel Ortiz 6fbbdc16be NFC: Implement pn533 polling loop
After going through all the modulations, the pn533 driver spends 2
seconds listening for targets.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:33 +02:00
Samuel Ortiz 51d9e803b9 NFC: Add type A and type F parameters for pn533 target mode
Without those settings several devices will not activate pn533 as a target.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:32 +02:00
Samuel Ortiz d7f3345d3a NFC: Add passive initiator data for pn533
When trying to enable a DEP link as a passive initiator, pn533 needs to
provide the polling request command payload.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:32 +02:00
Samuel Ortiz 34a85bfcfb NFC: Configure pn533 RF timings
Those define the ATR_RES response timeout after which the pn533 considers the
target to be mute.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:32 +02:00
Samuel Ortiz 9f2f8ba172 NFC: Unregister device if pn533 initial configuration fails
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:32 +02:00
Samuel Ortiz 7c2a04a933 NFC: Reset poll mod list when stopping pn533 poll
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:31 +02:00
Samuel Ortiz dadb06f270 NFC: Implement the pn533 target mode Tx op
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:31 +02:00
Samuel Ortiz 103b34cf5f NFC: Implement the pn533 target mode data fetching routine
This one needs to be called as soon as we are activated as a target, for
the pn533 to receive the first SYMM and keep the LLCP link alive.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:31 +02:00
Samuel Ortiz be9ae4ce4e NFC: Introduce target mode tx ops
And rename the initiator mode data exchange ops for consistency sake.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:30 +02:00
Samuel Ortiz fc40a8c1a0 NFC: Add target mode activation netlink event
Userspace gets a netlink event upon target mode activation.
The LLCP layer is also signaled when we get an ATR_REQ in order to get
the remote general bytes.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:30 +02:00
Samuel Ortiz ad3823cef6 NFC: Implement pn533 target mode polling loop
We only want to support p2p target mode for now, no host card emulation.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:29 +02:00
Samuel Ortiz fe7c580073 NFC: Add target mode protocols to the polling loop startup routine
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-06-04 21:34:29 +02:00
Linus Torvalds a3fe778c78 Frontswap provides a "transcendent memory" interface for swap pages.
In some environments, dramatic performance savings may be obtained because
 swapped pages are saved in RAM (or a RAM-like device) instead of a swap disk.
 This tag provides the basic infrastructure along with some changes to the
 existing backends.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQEcBAABAgAGBQJPsorBAAoJEFjIrFwIi8fJcz8H/RBXCtFo0kiJmRked3nMAIDO
 /2zN/q/Qawsg9aeoGlP7G8hQi9PMipbhQj3ixHyCTMv0zMbH988GXbBce+gIcg6e
 TOQi7xXAuPEwLizmSpiTv84XzN5bMgu1oJXEqIXw0EIpuZAmp+9m/o3WBwEAtyxi
 B+hvjE7eZM8f75K3lxs6sOtmIcERj9zqmT933Y8+i9iiuRyGMey2SyKtvVLbYZ+j
 HroFMUi0so5TzxT/cpkRiHu0U75c651o+LV00zh7InMqbwyRsWlKTf53k8Q/q2WP
 I7dVmfItwN/TpOrYTfxglYFlbYuUP35ziFvZ2trd6hcs9RK8OuKw+OmBLReHTtc=
 =x9Vp
 -----END PGP SIGNATURE-----

Merge tag 'stable/frontswap.v16-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/mm

Pull frontswap feature from Konrad Rzeszutek Wilk:
 "Frontswap provides a "transcendent memory" interface for swap pages.
  In some environments, dramatic performance savings may be obtained
  because swapped pages are saved in RAM (or a RAM-like device) instead
  of a swap disk.  This tag provides the basic infrastructure along with
  some changes to the existing backends."

Fix up trivial conflict in mm/Makefile due to removal of swap token code
changing a line next to the new frontswap entry.

This pull request came in before the merge window even opened, it got
delayed to after the merge window by me just wanting to make sure it had
actual users.  Apparently IBM is using this on their embedded side, and
Jan Beulich says that it's already made available for SLES and OpenSUSE
users.

Also acked by Rik van Riel, and Konrad points to other people liking it
too.  So in it goes.

By Dan Magenheimer (4) and Konrad Rzeszutek Wilk (2)
via Konrad Rzeszutek Wilk
* tag 'stable/frontswap.v16-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/mm:
  frontswap: s/put_page/store/g s/get_page/load
  MAINTAINER: Add myself for the frontswap API
  mm: frontswap: config and doc files
  mm: frontswap: core frontswap functionality
  mm: frontswap: core swap subsystem hooks and headers
  mm: frontswap: add frontswap header file
2012-06-04 12:28:45 -07:00
Johannes Berg fcb6ff5e2c iwlwifi: disable WoWLAN if !CONFIG_PM_SLEEP
If CONFIG_PM_SLEEP is disabled, then iwlwifi doesn't
support suspend/resume handlers and thus mac80211
(correctly) refuses advertising WoWLAN. Disable
WoWLAN in the driver in this case.

Cc: stable@kernel.org
Reported-by: Sebastian Kemper <sebastian_ml@gmx.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-04 15:27:07 -04:00
Seth Forshee 69aaedd3cf bcma: add ext PA workaround for BCM4331 and BCM43431
MacBook Pro models with BCM4331 wireless have been found to have the ext
PA lines disabled after resuming from S3 without external power attach.
This causes them to be unable to transmit. Add a workaround to ensure
that the ext PA lines are enabled on BCM4331. Also extend all handling
of ext PA line muxing to BCM43431 as is done in the Broadcom SDK.

BugLink: http://bugs.launchpad.net/bugs/925577
Cc: Arend van Spriel <arend@broadcom.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: stable@vger.kernel.org
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-04 15:26:40 -04:00
Stanislaw Gruszka e5851dac2c rt2x00: use atomic variable for seqno
Remove spinlock as atomic_t can be used instead. Note we use only 16
lower bits, upper bits are changed but we impilcilty cast to u16.

This fix possible deadlock on IBSS mode reproted by lockdep:

=================================
[ INFO: inconsistent lock state ]
3.4.0-wl+ #4 Not tainted
---------------------------------
inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
kworker/u:2/30374 [HC0[0]:SC0[0]:HE1:SE1] takes:
 (&(&intf->seqlock)->rlock){+.?...}, at: [<f9979a20>] rt2x00queue_create_tx_descriptor+0x380/0x490 [rt2x00lib]
{IN-SOFTIRQ-W} state was registered at:
  [<c04978ab>] __lock_acquire+0x47b/0x1050
  [<c0498504>] lock_acquire+0x84/0xf0
  [<c0835733>] _raw_spin_lock+0x33/0x40
  [<f9979a20>] rt2x00queue_create_tx_descriptor+0x380/0x490 [rt2x00lib]
  [<f9979f2a>] rt2x00queue_write_tx_frame+0x1a/0x300 [rt2x00lib]
  [<f997834f>] rt2x00mac_tx+0x7f/0x380 [rt2x00lib]
  [<f98fe363>] __ieee80211_tx+0x1b3/0x300 [mac80211]
  [<f98ffdf5>] ieee80211_tx+0x105/0x130 [mac80211]
  [<f99000dd>] ieee80211_xmit+0xad/0x100 [mac80211]
  [<f9900519>] ieee80211_subif_start_xmit+0x2d9/0x930 [mac80211]
  [<c0782e87>] dev_hard_start_xmit+0x307/0x660
  [<c079bb71>] sch_direct_xmit+0xa1/0x1e0
  [<c0784bb3>] dev_queue_xmit+0x183/0x730
  [<c078c27a>] neigh_resolve_output+0xfa/0x1e0
  [<c07b436a>] ip_finish_output+0x24a/0x460
  [<c07b4897>] ip_output+0xb7/0x100
  [<c07b2d60>] ip_local_out+0x20/0x60
  [<c07e01ff>] igmpv3_sendpack+0x4f/0x60
  [<c07e108f>] igmp_ifc_timer_expire+0x29f/0x330
  [<c04520fc>] run_timer_softirq+0x15c/0x2f0
  [<c0449e3e>] __do_softirq+0xae/0x1e0
irq event stamp: 18380437
hardirqs last  enabled at (18380437): [<c0526027>] __slab_alloc.clone.3+0x67/0x5f0
hardirqs last disabled at (18380436): [<c0525ff3>] __slab_alloc.clone.3+0x33/0x5f0
softirqs last  enabled at (18377616): [<c0449eb3>] __do_softirq+0x123/0x1e0
softirqs last disabled at (18377611): [<c041278d>] do_softirq+0x9d/0xe0

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&(&intf->seqlock)->rlock);
  <Interrupt>
    lock(&(&intf->seqlock)->rlock);

 *** DEADLOCK ***

4 locks held by kworker/u:2/30374:
 #0:  (wiphy_name(local->hw.wiphy)){++++.+}, at: [<c045cf99>] process_one_work+0x109/0x3f0
 #1:  ((&sdata->work)){+.+.+.}, at: [<c045cf99>] process_one_work+0x109/0x3f0
 #2:  (&ifibss->mtx){+.+.+.}, at: [<f98f005b>] ieee80211_ibss_work+0x1b/0x470 [mac80211]
 #3:  (&intf->beacon_skb_mutex){+.+...}, at: [<f997a644>] rt2x00queue_update_beacon+0x24/0x50 [rt2x00lib]

stack backtrace:
Pid: 30374, comm: kworker/u:2 Not tainted 3.4.0-wl+ #4
Call Trace:
 [<c04962a6>] print_usage_bug+0x1f6/0x220
 [<c0496a12>] mark_lock+0x2c2/0x300
 [<c0495ff0>] ? check_usage_forwards+0xc0/0xc0
 [<c04978ec>] __lock_acquire+0x4bc/0x1050
 [<c0527890>] ? __kmalloc_track_caller+0x1c0/0x1d0
 [<c0777fb6>] ? copy_skb_header+0x26/0x90
 [<c0498504>] lock_acquire+0x84/0xf0
 [<f9979a20>] ? rt2x00queue_create_tx_descriptor+0x380/0x490 [rt2x00lib]
 [<c0835733>] _raw_spin_lock+0x33/0x40
 [<f9979a20>] ? rt2x00queue_create_tx_descriptor+0x380/0x490 [rt2x00lib]
 [<f9979a20>] rt2x00queue_create_tx_descriptor+0x380/0x490 [rt2x00lib]
 [<f997a5cf>] rt2x00queue_update_beacon_locked+0x5f/0xb0 [rt2x00lib]
 [<f997a64d>] rt2x00queue_update_beacon+0x2d/0x50 [rt2x00lib]
 [<f9977e3a>] rt2x00mac_bss_info_changed+0x1ca/0x200 [rt2x00lib]
 [<f9977c70>] ? rt2x00mac_remove_interface+0x70/0x70 [rt2x00lib]
 [<f98e4dd0>] ieee80211_bss_info_change_notify+0xe0/0x1d0 [mac80211]
 [<f98ef7b8>] __ieee80211_sta_join_ibss+0x3b8/0x610 [mac80211]
 [<c0496ab4>] ? mark_held_locks+0x64/0xc0
 [<c0440012>] ? virt_efi_query_capsule_caps+0x12/0x50
 [<f98efb09>] ieee80211_sta_join_ibss+0xf9/0x140 [mac80211]
 [<f98f0456>] ieee80211_ibss_work+0x416/0x470 [mac80211]
 [<c0496d8b>] ? trace_hardirqs_on+0xb/0x10
 [<c077683b>] ? skb_dequeue+0x4b/0x70
 [<f98f207f>] ieee80211_iface_work+0x13f/0x230 [mac80211]
 [<c045cf99>] ? process_one_work+0x109/0x3f0
 [<c045d015>] process_one_work+0x185/0x3f0
 [<c045cf99>] ? process_one_work+0x109/0x3f0
 [<f98f1f40>] ? ieee80211_teardown_sdata+0xa0/0xa0 [mac80211]
 [<c045ed86>] worker_thread+0x116/0x270
 [<c045ec70>] ? manage_workers+0x1e0/0x1e0
 [<c0462f64>] kthread+0x84/0x90
 [<c0462ee0>] ? __init_kthread_worker+0x60/0x60
 [<c083d382>] kernel_thread_helper+0x6/0x10

Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-04 15:26:26 -04:00
Joe Perches f304a99319 brcmfmac: Fix likely misuse of | for &
Using | with a constant is always true.
Likely this should have be &.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-04 15:26:11 -04:00
Johannes Berg 1ae2fc25a1 mac80211_hwsim: advertise interface combinations
Enforcing interface combinations broke uses of hwsim
with multiple virtual interfaces. Advertise that all
combinations are possible to fix this.

Reported-by: Nirav Shah <nirav.j2.shah@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-04 15:25:10 -04:00
Johannes Berg a5fdde28b4 iwlwifi: fix TX power antenna access
Since my commit
  iwlwifi: use valid TX/RX antenna from hw_params
the config values are pure overrides, not the
real values for all hardware. Therefore, the
EEPROM TX power reading code checks the wrong
values, it should check the hw_params values.

Cc: stable@kernel.org [3.4]
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-04 15:24:42 -04:00
Avinash Patil 7a1c99343c mwifiex: support NL80211_HIDDEN_SSID_ZERO_LEN for uAP
mwifiex uAP supports NL80211_HIDDEN_SSID_ZERO_LEN type of hidden
SSID only. NL80211_HIDDEN_SSID_ZERO_CONTENTS is not supported.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-04 15:21:25 -04:00
Avinash Patil f0e3bd2341 mwifiex: invalidate bss config before setting channel for uAP
Mark bss_config parameters as invalid before setting AP channel.
This prevents from setting invalid parameters while setting AP
channel to FW.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-04 15:21:21 -04:00
Linus Torvalds c22072bdf0 Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner:
 "The clocksource driver is pure hardware enablement and the skew option
  is default off, well tested and non dangerous."

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  tick: Move skew_tick option into the HIGH_RES_TIMER section
  clocksource: em_sti: Add DT support
  clocksource: em_sti: Emma Mobile STI driver
  clockevents: Make clockevents_config() a global symbol
  tick: Add tick skew boot option
2012-06-04 11:25:31 -07:00
Daniel Vetter b7884eb45e drm/i915: hold forcewake around ring hw init
Empirical evidence suggests that we need to: On at least one ivb
machine when running the hangman i-g-t test, the rings don't properly
initialize properly - the RING_START registers seems to be stuck at
all zeros.

Holding forcewake around this register init sequences makes chip reset
reliable again. Note that this is not the first such issue:

commit f01db988ef
Author: Sean Paul <seanpaul@chromium.org>
Date:   Fri Mar 16 12:43:22 2012 -0400

    drm/i915: Add wait_for in init_ring_common

added delay loops to make RING_START and RING_CTL initialization
reliable on the blt ring at boot-up. So I guess it won't hurt if we do
this unconditionally for all force_wake needing gpus.

To avoid copy&pasting of the HAS_FORCE_WAKE check I've added a new
intel_info bit for that.

v2: Fixup missing commas in static struct and properly handling the
error case in init_ring_common, both noticed by Jani Nikula.

Cc: stable@vger.kernel.org
Reported-and-tested-by: Yang Guang <guang.a.yang@intel.com>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50522
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-06-04 20:25:29 +02:00
Chris Wilson 3eef8918ff drm/i915: Mark the ringbuffers as being in the GTT domain
By correctly describing the rinbuffers as being in the GTT domain, it
appears that we are more careful with the management of the CPU cache
upon resume and so prevent some coherency issue when submitting commands
to the GPU later. A secondary effect is that the debug logs are then
consistent with the actual usage (i.e. they no longer describe the
ringbuffers as being in the CPU write domain when we are accessing them
through an wc iomapping.)

Reported-and-tested-by: Daniel Gnoutcheff <daniel@gnoutcheff.name>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41092
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-06-04 20:16:40 +02:00
Giuseppe CAVALLARO 13497f5867 stmmac: remove two useless initialisations
This patch removes two useless initialisations in the
stmmac_rx and stmmac_tx functions.
In the former, the count variable was reset twice and in
the stmmac_tx we only need to increment the dirty pointer
w/o setting the entry variable.

v2: review the subject and comment that was not clear in my
first version.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-04 13:51:45 -04:00
Haiyang Zhang dc5cd894ca net/hyperv: Use wait_event on outstanding sends during device removal
Change the busy-waiting/udelay to wait_event on outstanding sends.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-04 13:50:38 -04:00
Giuseppe CAVALLARO 9ec0db71af net: icplus: fix interrupt mask
This patch fixes the interrupt mask for IC101 A/G devices
and now enables the link/speed/duplex interrupts.
This is done by setting the "INTR pin used" bit and cleaning
all the other bits in the Register 17.

Reported-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-04 12:02:40 -04:00
David S. Miller 3ab2cdd028 Merge branch 'master' of git://gitorious.org/linux-can/linux-can 2012-06-04 11:51:37 -04:00
Raffaele Recalcati 29a6b6c060 net/ethernet: ks8851_mll mac address configuration support added
Signed-off-by: Raffaele Recalcati <raffaele.recalcati@bticino.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-04 11:43:00 -04:00
Stephen Warren ae58d1e406 i2c: Add generic I2C multiplexer using pinctrl API
This is useful for SoCs whose I2C module's signals can be routed to
different sets of pins at run-time, using the pinctrl API.

                                 +-----+  +-----+
                                 | dev |  | dev |
    +------------------------+   +-----+  +-----+
    | SoC                    |      |        |
    |                   /----|------+--------+
    |   +---+   +------+     | child bus A, on first set of pins
    |   |I2C|---|Pinmux|     |
    |   +---+   +------+     | child bus B, on second set of pins
    |                   \----|------+--------+--------+
    |                        |      |        |        |
    +------------------------+  +-----+  +-----+  +-----+
                                | dev |  | dev |  | dev |
                                +-----+  +-----+  +-----+

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
2012-06-04 16:49:43 +02:00
Joerg Roedel eee53537c4 iommu/amd: Fix deadlock in ppr-handling error path
In the error path of the ppr_notifer it can happen that the
iommu->lock is taken recursivly. This patch fixes the
problem by releasing the iommu->lock before any notifier is
invoked. This also requires to move the erratum workaround
for the ppr-log (interrupt may be faster than data in the log)
one function up.

Cc: stable@vger.kernel.org # v3.3, v3.4
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2012-06-04 12:47:44 +02:00
Joerg Roedel c1bf94ec1e iommu/amd: Cache pdev pointer to root-bridge
At some point pci_get_bus_and_slot started to enable
interrupts. Since this function is used in the
amd_iommu_resume path it will enable interrupts on resume
which causes a warning. The fix will use a cached pointer
to the root-bridge to re-enable the IOMMU in case the BIOS
is broken.

Cc: stable@vger.kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2012-06-04 12:47:44 +02:00
Archit Taneja 2e063c305a OMAPDSS: DSI: Fix bug when calculating LP command interleaving parameters
In function dsi_compute_interleave_lp(), the escape clock/LP clock time period
is calculated incorrectly. The escape clock/LP clock is calculated as:

LP Clock(Hz) = DSI_FCLK(Hz) / lp_clk_div

Since we are calculating the time period of LP clock, the LP clock divider
should be multiplied with the time period of DSI_FCLK.

Calculating incorrect value of txclkesc results in incorrect calculation of LP
interleaving parameters, it also creates a possibility of a divide by zero
error.

Reported-by: Sureshkumar Manimuthu <mail2msuresh@ti.com>

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-06-04 13:07:51 +03:00
Heiko Stübner b0e4d7bf8b regulator: gpio-regulator: populate selector from set_voltage
This was missing until now and the underlying
_regulator_do_set_voltage is using this value when calling list_voltage.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-04 10:44:30 +01:00
Heiko Stübner 00926369b7 regulator: gpio-regulator: Fix finding of smallest value
Commit 4dbd8f63f0 (regulator: gpio-regulator: Set the smallest
voltage/current in the specified range) forgot to set the newly
introduced best_val.

Therefore it stayed always at INT_MAX thus breaking the setting
of the voltage.

Included is also an init value for target, as warnings about
a possibly uninitialised target started appearing with this fix.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-04 10:44:24 +01:00
Heiko Stübner 7d4be2f5ad regulator: gpio-regulator: do not pass drvdata pointer as reference
Commit c172708d38 (regulator: core: Use a struct to pass in
regulator runtime configuration) added the drvdata pointer
only per reference to the new config array in the gpio-regulator.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-04 10:44:18 +01:00
Axel Lin 0c09d31509 regulator: anatop: Use correct __devexit_p annotation
__devexit functions are discarded when CONFIG_HOTPLUG
is not set, so the symbol needs to be referenced carefully.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-04 10:42:49 +01:00
Axel Lin c71c8fd4da regulator: palmas: Fix wrong kfree calls
The devm_kzalloc function eliminates the need for manual resource releasing
and simplify error handling. Resources allocated by devm_* are freed
automatically on driver detach.

Thus adding kfree calls here will introduce double free bug.

The memory of desc array and the pointers to the rdev[] are allocated by
devm_kzalloc call for struct palmas_pmic.

struct palmas_pmic {
        struct palmas *palmas;
        struct device *dev;
        struct regulator_desc desc[PALMAS_NUM_REGS];
        struct regulator_dev *rdev[PALMAS_NUM_REGS];
        struct mutex mutex;

        int smps123;
        int smps457;

        int range[PALMAS_REG_SMPS10];
};

Which means we should not call kfree for pmic->rdev and pmic->desc.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-04 10:42:49 +01:00
Tomi Valkeinen 5025ce070e OMAPDSS: fix bogus WARN_ON in dss_runtime_put()
pm_runtime_put_sync() in dss_runtime_put() returns -EBUSY when any child
of dss is still enabled. This happens, for example, when a display
output is enabled and one dumps the clocks via debugfs. This causes
dss_runtime_get & put to be called.

While I couldn't find anything about this in the documentation and it
wasn't immediately clear from runtime_pm code, it looks to me that
pm_runtime_put_sync() returns -EBUSY to inform that things went fine,
but the device could not be turned off as there are still child devices
that are enabled. This is not a problem.

This patch skips the WARN_ON if pm_runtime_put_sync() returns -EBUSY.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-06-04 11:04:41 +03:00
Tomi Valkeinen d1700f9258 OMAPDSS: Taal: fix compilation warning
This patch fixes a warning:

drivers/video/omap2/displays/panel-taal.c: In function
‘taal_num_errors_show’:
drivers/video/omap2/displays/panel-taal.c:529: warning: ‘errors’ may be
used uninitialized in this function

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-06-04 11:04:40 +03:00
Tomi Valkeinen 0e9a126e95 OMAPDSS: fix build when DEBUG_FS or DSS_DEBUG_SUPPORT disabled
If CONFIG_DEBUG_FS or CONFIG_OMAP2_DSS_DEBUG_SUPPORT is disabled, the
build fails:

drivers/video/omap2/dss/core.c:197:50: error: static declaration of
'dss_debugfs_create_file' follows non-static declaration
drivers/video/omap2/dss/dss.h:166:5: note: previous declaration of
'dss_debugfs_create_file' was here

This patch fixes the dummy dss_debugfs_create_file() so that the driver
builds.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-06-04 11:04:40 +03:00
Guennadi Liakhovetski bc66468cee pinctrl: fix a minor harmless typo
The way the for_each_maps() macro is currently used, using "i" instead of
"_i_" works and is harmless. Still, this is a bug, that can trigger any
time, if the code around that macro changes. Better fix it now.

Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2012-06-04 09:52:52 +02:00
Barry Song 1253585d7c pinctrl: sirf: mark of_device_id match table as __devinitconst
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2012-06-04 09:52:52 +02:00
Shlomo Pongratz 3aac6ff16a IB/mlx4: Fix EQ deallocation in legacy mode
Commit e605b743f3 ("IB/mlx4: Increase the number of vectors (EQs)
available for ULPs") didn't handle correctly the case where there
aren't enough MSI-X vectors to increase the number of EQs, so only the
legacy EQs are allocated.  This results in an attempt to memset() to
zero the EQ table which was never allocated and a kernel crash.

Fix this by checking in the teardown flow if the table of EQs was ever
allocated.  Also remove some unneeded setting to zero of the EQ
related fields in struct mlx4_ib_dev.

Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2012-06-03 23:02:16 -07:00
Thadeu Lima de Souza Cascardo 71b43fd573 RDMA/cxgb4: Fix crash when peer address is 0.0.0.0
When using rping -c -a 0.0.0.0 with iw_cxgb4, the system crashes when
rdma_connect() is called.  ip_dev_find() will return NULL, but pdev is
accessed anyway.

Checking that pdev is NULL and returning -ENODEV prevents the system
from crashing.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2012-06-03 22:59:15 -07:00
Len Brown d3514abcf5 Merge branches 'bugfix-battery', 'bugfix-misc', 'bugfix-rafael', 'bugfix-turbostat', 'bugfix-video' and 'workaround-pss' into release
bug fixes

Signed-off-by: Len Brown <len.brown@intel.com>
2012-06-04 00:48:41 -04:00
Len Brown 7e1bd6e38b Merge branch 'upstream' into bugfix-video
Update bugfix-video branch to 2.5-rc1
so I don't have to again resolve the
conflict in these patches vs. upstream.

Conflicts:
	drivers/gpu/drm/gma500/psb_drv.c

	text conflict: add comment vs delete neighboring line

	keep just this:
	/* igd_opregion_init(&dev_priv->opregion_dev); */
	/* acpi_video_register(); */

Signed-off-by: Len Brown <len.brown@intel.com>
2012-06-04 00:35:19 -04:00
Kukjin Kim 5041caa4d5 gpio/samsung: fix the typo 'exynos5_xxx' instead of 'exonys5_xxx'
Should be 'exynos5_xxx' instead of 'exonys5_xxx'.

It happened at the commit 30b842889e ("Merge tag 'soc2' of
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc")
during v3.5 merge window.

Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
[ My bad  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-06-03 21:21:01 -07:00
Fabio Estevam 2f07a6134f drivers: acpi: Fix dependency for ACPI_HOTPLUG_CPU
Fix the following build warning:

warning: (ACPI_HOTPLUG_CPU) selects ACPI_CONTAINER which has unmet direct dependencies (ACPI && EXPERIMENTAL)

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2012-06-04 00:07:33 -04:00
Linus Torvalds 4d578573b8 Merge branch 'pm-acpi' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull some left-over PM patches from Rafael J. Wysocki.

* 'pm-acpi' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / PM: Make acpi_pm_device_sleep_state() follow the specification
  ACPI / PM: Make __acpi_bus_get_power() cover D3cold correctly
  ACPI / PM: Fix error messages in drivers/acpi/bus.c
  rtc-cmos / PM: report wakeup event on ACPI RTC alarm
  ACPI / PM: Generate wakeup events on fixed power button
2012-06-03 20:15:57 -07:00
Joe Perches dc605dbdb8 can: cc770: Fix likely misuse of | for &
Using | with a constant is always true.
Likely this should have be &.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-06-03 18:59:21 +02:00
AnilKumar Ch f461f27a44 can: c_can: fix race condition in c_can_open()
Fix the issue of C_CAN interrupts getting disabled forever when canconfig
utility is used multiple times. According to NAPI usage we disable all
the hardware interrupts in ISR and re-enable them in poll(). Current
implementation calls napi_enable() after hardware interrupts are enabled.
If we get any interrupts between these two steps then we do not process
those interrupts because napi is not enabled. Mostly these interrupts
come because of STATUS is not 0x7 or ERROR interrupts. If napi_enable()
happens before HW interrupts enabled then c_can_poll() function will be
called eventual re-enabling.

This patch moves the napi_enable() call before interrupts enabled.

Cc: stable@kernel.org # 2.6.39+
Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-06-03 18:59:20 +02:00
AnilKumar Ch 148c87c89e can: c_can: fix an interrupt thrash issue with c_can driver
This patch fixes an interrupt thrash issue with c_can driver.

In c_can_isr() function interrupts are disabled and enabled only in
c_can_poll() function. c_can_isr() & c_can_poll() both read the
irqstatus flag. However, irqstatus is always read as 0 in c_can_poll()
because all C_CAN interrupts are disabled in c_can_isr(). This causes
all interrupts to be re-enabled in c_can_poll() which in turn causes
another interrupt since the event is not really handled. This keeps
happening causing a flood of interrupts.

To fix this, read the irqstatus register in isr and use the same cached
value in the poll function.

Cc: stable@kernel.org # 2.6.39+
Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-06-03 18:59:19 +02:00
AnilKumar Ch 617caccebe can: c_can: fix "BUG! echo_skb is occupied!" during transmit
This patch fixes an issue with transmit routine, which causes
"can_put_echo_skb: BUG! echo_skb is occupied!" message when
using "cansequence -p" on D_CAN controller.

In c_can driver, while transmitting packets tx_echo flag holds
the no of can frames put for transmission into the hardware.

As the comment above c_can_do_tx() indicates, if we find any packet
which is not transmitted then we should stop looking for more.
In the current implementation this is not taken care of causing the
said message.

Also, fix the condition used to find if the packet is transmitted
or not. Current code skips the first tx message object and ends up
checking one extra invalid object.

While at it, fix the comment on top of c_can_do_tx() to use the
terminology "packet" instead of "package" since it is more
standard.

Cc: stable@kernel.org # 2.6.39+
Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-06-03 18:59:18 +02:00
Fabio Estevam 5494a98f45 regmap: Fix the size calculation for map->format.buf_size
The word to be transmitted/received via regmap is composed by the following
parts:

config->reg_bits
config->val_bits
config->pad_bits

,so the total size should be calculated by summing up the number of bits of
each element and using a DIV_ROUND_UP to return the number of bytes.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:14:01 +01:00
Stephen Warren bfaa25f334 regmap: clean up debugfs if regmap_init fails
If debugfs isn't cleaned up, stale files will be left in the filesystem
which will cause an OOPS when accessed the first time, and hang the
accessing application when accessed again, presumably due to some lock
being left held.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:13:38 +01:00
Nicholas Bellinger a4dff3043c target/file: Use O_DSYNC by default for FILEIO backends
Convert to use O_DSYNC for all cases at FILEIO backend creation time to
avoid the extra syncing of pure timestamp updates with legacy O_SYNC during
default operation as recommended by hch.  Continue to do this independently of
Write Cache Enable (WCE) bit, as WCE=0 is currently the default for all backend
devices and enabled by user on per device basis via attrib/emulate_write_cache.

This patch drops the now unnecessary fd_buffered_io= token usage that was
originally signalling when to explictly disable O_SYNC at backend creation
time for buffered I/O operation.  This can end up being dangerous for a number
of reasons during physical node failure, so go ahead and drop this option
for now when O_DSYNC is used as the default.

Also allow explict FUA WRITEs -> vfs_fsync_range() call to function in
fd_execute_cmd() independently of WCE bit setting.

Reported-by: Christoph Hellwig <hch@lst.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2012-06-02 23:47:20 -07:00
Linus Torvalds 912afc3616 Improve multipath's retrying mechanism in some defined circumstances
and provide a simple reserve/release mechanism for userspace tools to
 access thin provisioning metadata while the pool is in use.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPyqIdAAoJEK2W1qbAHj1nSPoQAJvAb/6UHufTWC/lufbEyo7t
 ft6uwZZ4S/VV1Gdx8V5YXo3rxkVIZj/CV0hiJIDctmDMKGPMlzup39kCgjD/rOUF
 mzcFAE8sEr3QEavkfjSWw2RHIIlhnJpvqVnb8nu3p/mSgAB4qYGgaDjBpi+W60PV
 aqQSSWgwH1uNhfGDBIxQoJ8OIjjYvKPIf2Ir2FAXam/dNi9chWO9nzFdj3q2LccP
 nZir094BDsFac1BF0FYW3J+rgT1FfPO7RRGAQct6WNJ197IZlYWYjKH3XehxnUHE
 wgiJmjfUO8vrho1hhWmWDOesKJPPWFN67EQnl5FqAu9itP7c7k8bd7Ay4jWgtZQU
 QIx10uiAgAuFUmTdWGK1fLlE8HGKUFINYLp63N5n5NZ4TDJrgo8e7CIID3rvYf/O
 EtmL7HzAyztL9Uc6oaXzCK6TgMUtd/ht8OJCDFhjitzQTNjbrfAGz6m+RHnEZyyj
 dtOVK7WBlmuKEANl2vDFGuVVF0+MwJLTlvPx1/b/ejFvnHI/R5Wuk9EH7t/DO4LB
 nCmiwzB6uWMzU3y3vnZG72AYSF5NTKSvnAl5B8U/0rI1MZU+6PehjeviJNx6ddJN
 2YheHBLU4vbBV/LF4XIpaHK2aiHN1ltaKCp8INo3EKhCwpR4ZdlVvnAGU9ocf9+c
 qoaFTOP7zGD9zgPeGjoG
 =wCpY
 -----END PGP SIGNATURE-----

Merge tag 'dm-3.5-changes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm

Pull device-mapper updates from Alasdair G Kergon:
 "Improve multipath's retrying mechanism in some defined circumstances
  and provide a simple reserve/release mechanism for userspace tools to
  access thin provisioning metadata while the pool is in use."

* tag 'dm-3.5-changes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm:
  dm thin: provide userspace access to pool metadata
  dm thin: use slab mempools
  dm mpath: allow ioctls to trigger pg init
  dm mpath: delay retry of bypassed pg
  dm mpath: reduce size of struct multipath
2012-06-02 17:39:40 -07:00
Joe Thornber cc8394d86f dm thin: provide userspace access to pool metadata
This patch implements two new messages that can be sent to the thin
pool target allowing it to take a snapshot of the _metadata_.  This,
read-only snapshot can be accessed by userland, concurrently with the
live target.

Only one metadata snapshot can be held at a time.  The pool's status
line will give the block location for the current msnap.

Since version 0.1.5 of the userland thin provisioning tools, the
thin_dump program displays the msnap as follows:

    thin_dump -m <msnap root> <metadata dev>

Available here: https://github.com/jthornber/thin-provisioning-tools

Now that userland can access the metadata we can do various things
that have traditionally been kernel side tasks:

     i) Incremental backups.

     By using metadata snapshots we can work out what blocks have
     changed over time.  Combined with data snapshots we can ensure
     the data doesn't change while we back it up.

     A short proof of concept script can be found here:

     https://github.com/jthornber/thinp-test-suite/blob/master/incremental_backup_example.rb

     ii) Migration of thin devices from one pool to another.

     iii) Merging snapshots back into an external origin.

     iv) Asyncronous replication.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2012-06-03 00:30:01 +01:00
Mike Snitzer a24c25696b dm thin: use slab mempools
Use dedicated caches prefixed with a "dm_" name rather than relying on
kmalloc mempools backed by generic slab caches so the memory usage of
thin provisioning (and any leaks) can be accounted for independently.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2012-06-03 00:30:00 +01:00
Mikulas Patocka 35991652ba dm mpath: allow ioctls to trigger pg init
After the failure of a group of paths, any alternative paths that
need initialising do not become available until further I/O is sent to
the device.  Until this has happened, ioctls return -EAGAIN.

With this patch, new paths are made available in response to an ioctl
too.  The processing of the ioctl gets delayed until this has happened.

Instead of returning an error, we submit a work item to kmultipathd
(that will potentially activate the new path) and retry in ten
milliseconds.

Note that the patch doesn't retry an ioctl if the ioctl itself fails due
to a path failure.  Such retries should be handled intelligently by the
code that generated the ioctl in the first place, noting that some SCSI
commands should not be retried because they are not idempotent (XOR write
commands).  For commands that could be retried, there is a danger that
if the device rejected the SCSI command, the path could be errorneously
marked as failed, and the request would be retried on another path which
might fail too.  It can be determined if the failure happens on the
device or on the SCSI controller, but there is no guarantee that all
SCSI drivers set these flags correctly.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2012-06-03 00:29:58 +01:00
Mike Christie f220fd4efb dm mpath: delay retry of bypassed pg
If I/O needs retrying and only bypassed priority groups are available,
set the pg_init_delay_retry flag to wait before retrying.

If, for example, the reason for the bypass is that the controller is
getting reset or there is a firmware upgrade happening, retrying right
away would cause a flood of log messages and retries for what could be a
few seconds or even several minutes.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2012-06-03 00:29:45 +01:00
Mike Snitzer 1fbdd2b3a3 dm mpath: reduce size of struct multipath
Move multipath structure's 'lock' and 'queue_size' members to eliminate
two 4-byte holes.  Also use a bit within a single unsigned int for each
existing flag (saves 8-bytes).  This allows future flags to be added
without each consuming an unsigned int.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2012-06-03 00:29:43 +01:00
Linus Torvalds 4fc3acf291 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking updates from David Miller:

 1) Make syn floods consume significantly less resources by

    a) Not pre-COW'ing routing metrics for SYN/ACKs
    b) Mirroring the device queue mapping of the SYN for the SYN/ACK
       reply.

    Both from Eric Dumazet.

 2) Fix calculation errors in Byte Queue Limiting, from Hiroaki SHIMODA.

 3) Validate the length requested when building a paged SKB for a
    socket, so we don't overrun the page vector accidently.  From Jason
    Wang.

 4) When netlabel is disabled, we abort all IP option processing when we
    see a CIPSO option.  This isn't the right thing to do, we should
    simply skip over it and continue processing the remaining options
    (if any).  Fix from Paul Moore.

 5) SRIOV fixes for the mellanox driver from Jack orgenstein and Marcel
    Apfelbaum.

 6) 8139cp enables the receiver before the ring address is properly
    programmed, which potentially lets the device crap over random
    memory.  Fix from Jason Wang.

 7) e1000/e1000e fixes for i217 RST handling, and an improper buffer
    address reference in jumbo RX frame processing from Bruce Allan and
    Sebastian Andrzej Siewior, respectively.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  fec_mpc52xx: fix timestamp filtering
  mcs7830: Implement link state detection
  e1000e: fix Rapid Start Technology support for i217
  e1000: look into the page instead of skb->data for e1000_tbi_adjust_stats()
  r8169: call netif_napi_del at errpaths and at driver unload
  tcp: reflect SYN queue_mapping into SYNACK packets
  tcp: do not create inetpeer on SYNACK message
  8139cp/8139too: terminate the eeprom access with the right opmode
  8139cp: set ring address before enabling receiver
  cipso: handle CIPSO options correctly when NetLabel is disabled
  net: sock: validate data_len before allocating skb in sock_alloc_send_pskb()
  bql: Avoid possible inconsistent calculation.
  bql: Avoid unneeded limit decrement.
  bql: Fix POSDIFF() to integer overflow aware.
  net/mlx4_core: Fix obscure mlx4_cmd_box parameter in QUERY_DEV_CAP
  net/mlx4_core: Check port out-of-range before using in mlx4_slave_cap
  net/mlx4_core: Fixes for VF / Guest startup flow
  net/mlx4_en: Fix improper use of "port" parameter in mlx4_en_event
  net/mlx4_core: Fix number of EQs used in ICM initialisation
  net/mlx4_core: Fix the slave_id out-of-range test in mlx4_eq_int
2012-06-02 16:22:51 -07:00