[go: nahoru, domu]

History log of /drivers/net/wireless/cw1200/cw1200_spi.c
Revision Date Author Comments
26c0604628f85d435a664f52fd2ca30aab812266 02-Aug-2014 Himangi Saraogi <himangi774@gmail.com> cw1200: Introduce the use of devm_kzalloc

This patch introduces the use of devm_kzalloc and does away with the
kfrees in the probe and remove functions.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4978705d26149a629b9f50ff221caed6f1ae3048 09-Oct-2013 Solomon Peachy <pizza@shaftnet.org> wireless: cw1200: acquire hwbus lock around cw1200_irq_handler() call.

This fixes "lost interrupt" problems that occurred on SPI-based systems.
cw1200_irq_handler() expects the hwbus to be locked, but on the
SPI-path, that lock wasn't taken (unlike in the SDIO-path, where the
generic SDIO-code takes care of acquiring the lock).

Cc: stable@vger.kernel.org
Signed-off-by: David Mosberger <davidm@egauge.net>
Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3ec8a8d88f762c78caa2d364c111089db81717be 10-Sep-2013 Jingoo Han <jg1.han@samsung.com> wireless: cw1200: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
87421cb6010a2f6494938fbe0a95e1b096b3b7af 23-Sep-2013 Solomon Peachy <pizza@shaftnet.org> cw1200: Use a threaded oneshot irq handler for cw1200_spi

This supercedes the older patch ("cw1200: Don't perform SPI transfers in
interrupt context") that badly attempted to fix this problem.

This is a far simpler solution, which has the added benefit of
actually working.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c4fb19d21b003ec99ec490ba2cb60baffabc73f3 23-Sep-2013 Solomon Peachy <pizza@shaftnet.org> Revert "cw1200: Don't perform SPI transfers in interrupt context"

This reverts commit aec8e88c947b7017e2b4bbcb68a4bfc4a1f8ad35.

This solution turned out to cause interrupt delivery problems, and
rather than trying to fix this approach, it has been scrapped in favor
of an alternative (and far simpler) implementation.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
85ba8f529c57ac6e2fca9be0d9e17920a1afb2e8 28-Aug-2013 Solomon Peachy <pizza@shaftnet.org> cw1200: Prevent a lock-related hang in the cw1200_spi driver

The cw1200_spi driver tries to mirror the cw1200_sdio driver's lock
API, which relies on sdio_claim_host/sdio_release_host to serialize
hardware operations across multiple threads.

Unfortunately the implementation was flawed, as it lacked a way to wake
up the lock requestor when there was contention, often resulting in a
hang.

This problem was uncovered while trying to fix the
spi-transfers-in-interrupt-context BUG() corrected in the previous
patch. Many thanks to Dave Sizeburns for his assistance in fixing this.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
aec8e88c947b7017e2b4bbcb68a4bfc4a1f8ad35 28-Aug-2013 Solomon Peachy <pizza@shaftnet.org> cw1200: Don't perform SPI transfers in interrupt context

When we get an interrupt from the hardware, the first thing the driver does
is tell the device to mask off the interrupt line. Unfortunately this
involves a SPI transaction in interrupt context. Some (most?) SPI
controllers perform the transfer asynchronously and try to sleep.
This is bad, and triggers a BUG().

So, work around this by using adding a hwbus hook for the cw1200 driver
core to call. The cw1200_spi driver translates this into
irq_disable()/irq_enable() calls instead, which can safely be called in
interrupt context.

Apparently the platforms I used to develop the cw1200_spi driver used
synchronous spi_sync() implementations, which is why this didn't surface
until now.

Many thanks to Dave Sizeburns for the inital bug report and his services
as a tester.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7258416c517c79b2ebb30b61d8c6807a04dc6b25 21-Jun-2013 Solomon Peachy <pizza@shaftnet.org> cw1200: Fix up a large pile of sparse warnings

Most of these relate to endianness problems, and are purely cosmetic.

But a couple of them were legit -- listen interval parsing and some of
the rate selection code would malfunction on BE systems.

There's still one cosmetic warning remaining, in the (admittedly) ugly
code in cw1200_spi.c. It's there because the hardware needs 16-bit SPI
transfers, but many SPI controllers only operate 8 bits at a time.

If there's a cleaner way of handling this, I'm all ears.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8b3e7be437a6b62118d0485ad971e724afe23fdf 11-Jun-2013 Solomon Peachy <pizza@shaftnet.org> cw1200: Fix an assorted pile of checkpatch warnings.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4da2a54a842db6921289e3e25b0739531a594dea 02-Jun-2013 Solomon Peachy <pizza@shaftnet.org> cw1200: rename the cw1200 platform definition header

My previous patch just moved the file, but it also needed to be renamed
to conform to proper conventions.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6dd64a304eff76ca7dd41bf63df55efa965fa9ec 02-Jun-2013 Solomon Peachy <pizza@shaftnet.org> cw1200: Replace use of 'struct resource' with 'int' for GPIO fields.

The only advantage of 'struct resource' is that it lets us assign names
as part of the platform data. Unfortunately since we are using platform
data, we are already limited to a single instance of each driver,
rendering this moot.

So, replace the struct resources with ints, resulting in cleaner code.

This was based on a suggestion from Arnd Bergmann.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7b19bc2ca92ddda8f8e128593a2d523092ab4b14 02-Jun-2013 Solomon Peachy <pizza@shaftnet.org> cw1200: Reference correct 'powerup' GPIO signal.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c992219825823cad5e11fab3854eb93df2e9ffa1 02-Jun-2013 Solomon Peachy <pizza@shaftnet.org> cw1200: move platform_data header to correct location.

(As suggested by Arnd Bergmann)

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
911373cca1b45571b62938f8f19cec24cb102471 01-Jun-2013 Solomon Peachy <pizza@shaftnet.org> cw1200: Rename 'sbus' to 'hwbus'

This avoids problems when building on SPARC targets due to the driver
calling the bus abstraction layer 'sbus'. Not that any SBUS-sporting
SPARC targets are likely to have an SDIO controller, but this is the
correct thing to do.

See http://kisskb.ellerman.id.au/kisskb/buildresult/8846508/

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3e817f086f06069a23b797ee2279bbae638d5edc 30-May-2013 Wei Yongjun <yongjun_wei@trendmicro.com.cn> cw1200: remove unused including <linux/version.h>

Remove including <linux/version.h> that don't need it.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d071c0430c6ae42fedec78f1ec2e37603adb8c78 30-May-2013 Wei Yongjun <yongjun_wei@trendmicro.com.cn> cw1200: use module_spi_driver to simplify the code

module_spi_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4e17b87e792ed19e75a96eea618b90510265120c 30-May-2013 Solomon Peachy <pizza@shaftnet.org> cw1200: Fix compile with CONFIG_PM=n

Intel's 0-day kernel build tester caught this build failure. This patch
properly wraps everything that depends on CONFIG_PM.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a910e4a94f6923c8c988565525f017f687bf7205 25-May-2013 Solomon Peachy <pizza@shaftnet.org> cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>