All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] wl1251: fix a memory leak in probe
@ 2010-06-04 23:25 Grazvydas Ignotas
  2010-06-04 23:25 ` [PATCH 2/2] wl1251: fix ELP_CTRL register reads Grazvydas Ignotas
  2010-06-05  7:00 ` [PATCH 1/2] wl1251: fix a memory leak in probe Kalle Valo
  0 siblings, 2 replies; 13+ messages in thread
From: Grazvydas Ignotas @ 2010-06-04 23:25 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Kalle Valo, Grazvydas Ignotas

wl1251_sdio_probe() error path is missing wl1251_free_hw, add it.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
 drivers/net/wireless/wl12xx/wl1251_sdio.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1251_sdio.c b/drivers/net/wireless/wl12xx/wl1251_sdio.c
index d234285..c561332 100644
--- a/drivers/net/wireless/wl12xx/wl1251_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1251_sdio.c
@@ -259,6 +259,7 @@ disable:
 	sdio_disable_func(func);
 release:
 	sdio_release_host(func);
+	wl1251_free_hw(wl);
 	return ret;
 }
 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/2] wl1251: fix ELP_CTRL register reads
  2010-06-04 23:25 [PATCH 1/2] wl1251: fix a memory leak in probe Grazvydas Ignotas
@ 2010-06-04 23:25 ` Grazvydas Ignotas
  2010-06-05  7:04   ` Kalle Valo
  2010-06-05  7:00 ` [PATCH 1/2] wl1251: fix a memory leak in probe Kalle Valo
  1 sibling, 1 reply; 13+ messages in thread
From: Grazvydas Ignotas @ 2010-06-04 23:25 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Kalle Valo, Grazvydas Ignotas

Reading the ELP_CTRL register with sdio_readb causes problems because
hardware seems to be performing a write using stuff bits in the request
(those bits contain write data in write request). This indicates that it
actually expects RAW (read after write) type of request, so perform that
when reading ELP_CTRL instead. Also cache last written value so we know
what to write when doing RAW request.

Because of the above it was not possible to wake the chip from ELP power
saving mode, PM had to be disabled to have the driver usable in SDIO
mode. After this patch PM is functional.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
this patch is not suitable for backporting because reqiured SDIO function
was only merged during the last merge window.

 drivers/net/wireless/wl12xx/wl1251_sdio.c |   40 ++++++++++++++++++++++++----
 1 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1251_sdio.c b/drivers/net/wireless/wl12xx/wl1251_sdio.c
index c561332..b901b61 100644
--- a/drivers/net/wireless/wl12xx/wl1251_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1251_sdio.c
@@ -37,11 +37,17 @@
 #define SDIO_DEVICE_ID_TI_WL1251	0x9066
 #endif
 
+struct wl1251_sdio {
+	struct sdio_func *func;
+	u32 elp_val;
+};
+
 static struct wl12xx_platform_data *wl12xx_board_data;
 
 static struct sdio_func *wl_to_func(struct wl1251 *wl)
 {
-	return wl->if_priv;
+	struct wl1251_sdio *wl_sdio = wl->if_priv;
+	return wl_sdio->func;
 }
 
 static void wl1251_sdio_interrupt(struct sdio_func *func)
@@ -90,10 +96,17 @@ static void wl1251_sdio_write(struct wl1251 *wl, int addr,
 static void wl1251_sdio_read_elp(struct wl1251 *wl, int addr, u32 *val)
 {
 	int ret = 0;
-	struct sdio_func *func = wl_to_func(wl);
-
+	struct wl1251_sdio *wl_sdio = wl->if_priv;
+	struct sdio_func *func = wl_sdio->func;
+
+	/*
+	 * The hardware only supports RAW (read after write) access for
+	 * reading, regular sdio_readb won't work here (it interprets
+	 * the unused bits of CMD52 as write data even if we send read
+	 * request).
+	 */
 	sdio_claim_host(func);
-	*val = sdio_readb(func, addr, &ret);
+	*val = sdio_writeb_readb(func, wl_sdio->elp_val, addr, &ret);
 	sdio_release_host(func);
 
 	if (ret)
@@ -103,7 +116,8 @@ static void wl1251_sdio_read_elp(struct wl1251 *wl, int addr, u32 *val)
 static void wl1251_sdio_write_elp(struct wl1251 *wl, int addr, u32 val)
 {
 	int ret = 0;
-	struct sdio_func *func = wl_to_func(wl);
+	struct wl1251_sdio *wl_sdio = wl->if_priv;
+	struct sdio_func *func = wl_sdio->func;
 
 	sdio_claim_host(func);
 	sdio_writeb(func, val, addr, &ret);
@@ -111,6 +125,8 @@ static void wl1251_sdio_write_elp(struct wl1251 *wl, int addr, u32 val)
 
 	if (ret)
 		wl1251_error("sdio_writeb failed (%d)", ret);
+	else
+		wl_sdio->elp_val = val;
 }
 
 static void wl1251_sdio_reset(struct wl1251 *wl)
@@ -197,6 +213,7 @@ static int wl1251_sdio_probe(struct sdio_func *func,
 	int ret;
 	struct wl1251 *wl;
 	struct ieee80211_hw *hw;
+	struct wl1251_sdio *wl_sdio;
 
 	hw = wl1251_alloc_hw();
 	if (IS_ERR(hw))
@@ -204,6 +221,12 @@ static int wl1251_sdio_probe(struct sdio_func *func,
 
 	wl = hw->priv;
 
+	wl_sdio = kzalloc(sizeof(*wl_sdio), GFP_KERNEL);
+	if (wl_sdio == NULL) {
+		ret = -ENOMEM;
+		goto out_free_hw;
+	}
+
 	sdio_claim_host(func);
 	ret = sdio_enable_func(func);
 	if (ret)
@@ -213,7 +236,8 @@ static int wl1251_sdio_probe(struct sdio_func *func,
 	sdio_release_host(func);
 
 	SET_IEEE80211_DEV(hw, &func->dev);
-	wl->if_priv = func;
+	wl_sdio->func = func;
+	wl->if_priv = wl_sdio;
 	wl->if_ops = &wl1251_sdio_ops;
 	wl->set_power = wl1251_sdio_set_power;
 
@@ -259,6 +283,8 @@ disable:
 	sdio_disable_func(func);
 release:
 	sdio_release_host(func);
+	kfree(wl_sdio);
+out_free_hw:
 	wl1251_free_hw(wl);
 	return ret;
 }
@@ -266,9 +292,11 @@ release:
 static void __devexit wl1251_sdio_remove(struct sdio_func *func)
 {
 	struct wl1251 *wl = sdio_get_drvdata(func);
+	struct wl1251_sdio *wl_sdio = wl->if_priv;
 
 	if (wl->irq)
 		free_irq(wl->irq, wl);
+	kfree(wl_sdio);
 	wl1251_free_hw(wl);
 
 	sdio_claim_host(func);
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/2] wl1251: fix a memory leak in probe
  2010-06-04 23:25 [PATCH 1/2] wl1251: fix a memory leak in probe Grazvydas Ignotas
  2010-06-04 23:25 ` [PATCH 2/2] wl1251: fix ELP_CTRL register reads Grazvydas Ignotas
@ 2010-06-05  7:00 ` Kalle Valo
  1 sibling, 0 replies; 13+ messages in thread
From: Kalle Valo @ 2010-06-05  7:00 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: John W. Linville, linux-wireless

On 5 June 2010 02:25, Grazvydas Ignotas <notasas@gmail.com> wrote:
> wl1251_sdio_probe() error path is missing wl1251_free_hw, add it.

Looks good, thanks.

> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>

Acked-by: Kalle Valo <kvalo@adurom.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] wl1251: fix ELP_CTRL register reads
  2010-06-04 23:25 ` [PATCH 2/2] wl1251: fix ELP_CTRL register reads Grazvydas Ignotas
@ 2010-06-05  7:04   ` Kalle Valo
  2010-06-21 12:46     ` Denis 'GNUtoo' Carikli
  0 siblings, 1 reply; 13+ messages in thread
From: Kalle Valo @ 2010-06-05  7:04 UTC (permalink / raw)
  To: Grazvydas Ignotas; +Cc: John W. Linville, linux-wireless

On 5 June 2010 02:25, Grazvydas Ignotas <notasas@gmail.com> wrote:
> Reading the ELP_CTRL register with sdio_readb causes problems because
> hardware seems to be performing a write using stuff bits in the request
> (those bits contain write data in write request). This indicates that it
> actually expects RAW (read after write) type of request, so perform that
> when reading ELP_CTRL instead. Also cache last written value so we know
> what to write when doing RAW request.
>
> Because of the above it was not possible to wake the chip from ELP power
> saving mode, PM had to be disabled to have the driver usable in SDIO
> mode. After this patch PM is functional.

Excellent that Power Save is now working SDIO. Thank you very much!

> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>

Acked-by: Kalle Valo <kvalo@adurom.com>

> this patch is not suitable for backporting because reqiured SDIO function
> was only merged during the last merge window.

Usually information like this is good to store in the commit log
itself so that it gets properly archived.

Kalle

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] wl1251: fix ELP_CTRL register reads
  2010-06-05  7:04   ` Kalle Valo
@ 2010-06-21 12:46     ` Denis 'GNUtoo' Carikli
  2010-06-21 17:54       ` Bob Copeland
  0 siblings, 1 reply; 13+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2010-06-21 12:46 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Grazvydas Ignotas, John W.Linville, linux-wireless

On Sat, 2010-06-05 at 10:04 +0300, Kalle Valo wrote:
> On 5 June 2010 02:25, Grazvydas Ignotas <notasas@gmail.com> wrote:
> > Reading the ELP_CTRL register with sdio_readb causes problems because
> > hardware seems to be performing a write using stuff bits in the request
> > (those bits contain write data in write request). This indicates that it
> > actually expects RAW (read after write) type of request, so perform that
> > when reading ELP_CTRL instead. Also cache last written value so we know
> > what to write when doing RAW request.
> >
> > Because of the above it was not possible to wake the chip from ELP power
> > saving mode, PM had to be disabled to have the driver usable in SDIO
> > mode. After this patch PM is functional.
> 
> Excellent that Power Save is now working SDIO. Thank you very much!
Hi, me and some other people are trying to run standard GNU/Linux (not
android ) on the htcdream.
The htcdream has a wl1251_sdio with a msm sdio controller.
we currently work on a 2.6.32 kenrel.
As it's a phone, power management is important and so I tried with PS
enabled by default in the kernel:
CONFIG_CFG80211_DEFAULT_PS=y
CONFIG_CFG80211_DEFAULT_PS_VALUE=1

I've tried lastest compat-wireless (2010-06-20) with the following
patches:

Index:
compat-wireless-2010-06-19/drivers/net/wireless/wl12xx/wl1251_sdio.c
===================================================================
---
compat-wireless-2010-06-19.orig/drivers/net/wireless/wl12xx/wl1251_sdio.c	2010-06-20 23:00:09.755843242 +0200
+++ compat-wireless-2010-06-19/drivers/net/wireless/wl12xx/wl1251_sdio.c
2010-06-20 23:01:34.733958063 +0200
@@ -106,7 +106,7 @@
 	 * request).
 	 */
 	sdio_claim_host(func);
-	*val = sdio_writeb_readb(func, wl_sdio->elp_val, addr, &ret);
+	*val = sdio_readb_ext(func, addr, &ret, 1);
 	sdio_release_host(func);
 
 	if (ret)

Index:
compat-wireless-2010-06-19/drivers/net/wireless/wl12xx/wl1251_sdio.c
===================================================================
---
compat-wireless-2010-06-19.orig/drivers/net/wireless/wl12xx/wl1251_sdio.c	2010-06-20 22:04:12.776553632 +0200
+++ compat-wireless-2010-06-19/drivers/net/wireless/wl12xx/wl1251_sdio.c
2010-06-20 22:06:30.375232047 +0200
@@ -131,6 +131,20 @@
 
 static void wl1251_sdio_reset(struct wl1251 *wl)
 {
+	extern int sdio_reset_comm(struct mmc_card *card);
+	struct sdio_func *func = wl_to_func(wl);
+	int ret;
+
+	sdio_claim_host(func);
+	sdio_reset_comm(func->card);
+	ret = sdio_enable_func(func);
+	if (ret)
+		goto release;
+
+	sdio_set_block_size(func, 512);
+
+release:
+	sdio_release_host(func);
 }
 
 static void wl1251_sdio_enable_irq(struct wl1251 *wl)
@@ -271,6 +285,9 @@
 	ret = wl1251_init_ieee80211(wl);
 	if (ret)
 		goto out_free_irq;
+	
+	/* we can power it down now until it's started */
+	wl->set_power(0);
 
 	sdio_set_drvdata(func, wl);
 	return ret;

Index: compat-wireless-2010-06-19/drivers/net/wireless/wl12xx/wl1251.h
===================================================================
--- compat-wireless-2010-06-19.orig/drivers/net/wireless/wl12xx/wl1251.h
2010-06-20 22:07:29.346389894 +0200
+++ compat-wireless-2010-06-19/drivers/net/wireless/wl12xx/wl1251.h
2010-06-20 22:08:41.974607260 +0200
@@ -381,6 +381,8 @@
 
 	u32 chip_id;
 	char fw_ver[21];
+
+	bool associated;
 };
 
 int wl1251_plt_start(struct wl1251 *wl);
Index:
compat-wireless-2010-06-19/drivers/net/wireless/wl12xx/wl1251_main.c
===================================================================
---
compat-wireless-2010-06-19.orig/drivers/net/wireless/wl12xx/wl1251_main.c	2010-06-20 22:07:36.606391128 +0200
+++ compat-wireless-2010-06-19/drivers/net/wireless/wl12xx/wl1251_main.c
2010-06-20 22:10:11.594572491 +0200
@@ -869,6 +869,13 @@
 
 	wl1251_debug(DEBUG_MAC80211, "mac80211 hw scan");
 
+	/*
+	 * FIXME: scanning while associated causes lockups,
+	 * so we don't allow that
+	 */
+	if (wl->associated)
+		return -EBUSY;
+
 	if (req->n_ssids) {
 		ssid = req->ssids[0].ssid;
 		ssid_len = req->ssids[0].ssid_len;
and a minor build patch:
Index: compat-wireless-2010-06-19/scripts/gen-compat-autoconf.sh
===================================================================
--- compat-wireless-2010-06-19.orig/scripts/gen-compat-autoconf.sh
2010-06-20 17:40:48.586388753 +0200
+++ compat-wireless-2010-06-19/scripts/gen-compat-autoconf.sh	2010-06-20
17:41:07.833335272 +0200
@@ -192,7 +192,7 @@
 		define_config_multiple_deps CONFIG_MAC80211_QOS y $ALL_DEPS
 		rm -f $MULT_DEP_FILE
 		# Kernels >= 2.6.32 can disable WEXT :D
-		if [ $SUBLEVEL -lt 32 ]; then
+		if [ $SUBLEVEL -le 32 ]; then
 			define_config_dep CONFIG_CFG80211_WEXT 1 CONFIG_WIRELESS_EXT
 		fi
 	fi


And I've the following messages in dmesg:
[ 1412.632263] cfg80211: Calling CRDA to update world regulatory domain
[ 1413.038391] wifi probe start
[ 1413.038452] trout_wifi_power: 1
[ 1413.240142] trout_wifi_reset: 0
[ 1413.291748] trout_wifi_set_carddetect: 1
[ 1413.291778] mmc0: card_present 1
[ 1413.291809] mmc0: Slot status change detected (0 -> 1)
[ 1413.291839] wifi probe done
[ 1415.828735] mmc0: Command timeout
[ 1415.834259] mmc0: card claims to support voltages below the defined
range. These will be ignored.
[ 1415.838806] mmc0: new SDIO card at address 0001
[ 1415.855041] wl1251: using SDIO interrupt
[ 1415.985321] phy0: Selected rate control algorithm 'minstrel'
[ 1415.990325] wl1251: loaded
[ 1415.991363] wl1251: initialized
[ 1433.640594] request_suspend_state: sleep (0->3) at 1427975218412
(2010-06-21 12:31:23.116053303 UTC)
[ 1433.641845] msm_i2c msm_i2c.0: Warning bus was busy (8)
[ 1464.390441] sdio_reset_comm():
[ 1465.120025] wl1251: 151 tx blocks at 0x3b788, 35 rx blocks at 0x3a780
[ 1465.140136] wl1251: firmware booted (Rev 4.0.4.3.5)
[ 1465.280761] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 1556.024566] wlan0: authenticate with 00:24:01:63:89:bd (try 1)
[ 1556.036285] wlan0: authenticated
[ 1556.114501] wlan0: associate with 00:24:01:63:89:bd (try 1)
[ 1556.126525] wlan0: RX AssocResp from 00:24:01:63:89:bd (capab=0x401
status=0 aid=3)
[ 1556.126556] wlan0: associated
[ 1556.425354] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 1556.734130] mmc0: Command timeout
[ 1556.739166] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1557.454101] mmc0: Command CRC error
[ 1557.454162] wl1251: ERROR sdio_writeb failed (-84)
[ 1557.763610] mmc0: Command timeout
[ 1557.768829] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1558.773071] mmc0: Command CRC error
[ 1558.773132] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1559.782562] mmc0: Command timeout
[ 1559.787628] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1560.792022] mmc0: Command CRC error
[ 1560.792083] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1561.821563] mmc0: Command timeout
[ 1561.826629] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1562.831085] mmc0: Command CRC error
[ 1562.831146] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1563.860534] mmc0: Command timeout
[ 1563.865570] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1564.869995] mmc0: Command CRC error
[ 1564.870056] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1565.899475] mmc0: Command timeout
[ 1565.904541] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1566.449127] wlan0: no IPv6 routers present
[ 1566.908996] mmc0: Command CRC error
[ 1566.909057] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1567.918518] mmc0: Command timeout
[ 1567.923553] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1568.928009] mmc0: Command CRC error
[ 1568.928100] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1569.937500] mmc0: Command timeout
[ 1569.942565] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1570.946990] mmc0: Command CRC error
[ 1570.947052] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1571.956481] mmc0: Command timeout
[ 1571.961547] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1572.966003] mmc0: Command CRC error
[ 1572.966064] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1573.975463] mmc0: Command timeout
[ 1573.980529] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1574.984985] mmc0: Command CRC error
[ 1574.985046] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1576.244323] mmc0: Command timeout
[ 1576.249359] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1577.253845] mmc0: Command CRC error
[ 1577.253906] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1578.563140] mmc0: Command timeout
[ 1578.568237] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1578.667968] mmc0: Command CRC error
[ 1578.668029] wl1251: ERROR sdio_writeb failed (-84)
[ 1579.572692] mmc0: Command timeout
[ 1579.577758] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1580.582153] mmc0: Command CRC error
[ 1580.582214] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1581.591705] mmc0: Command timeout
[ 1581.596771] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1582.601165] mmc0: Command CRC error
[ 1582.601226] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1583.610626] mmc0: Command timeout
[ 1583.615692] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1584.620117] mmc0: Command CRC error
[ 1584.620178] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1585.629638] mmc0: Command timeout
[ 1585.634704] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1586.639129] mmc0: Command CRC error
[ 1586.639190] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1587.648681] mmc0: Command timeout
[ 1587.653717] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1588.658142] mmc0: Command CRC error
[ 1588.658203] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1589.667663] mmc0: Command timeout
[ 1589.672729] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1590.677093] mmc0: Command CRC error
[ 1590.677185] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1591.686614] mmc0: Command timeout
[ 1591.691680] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1592.696075] mmc0: Command CRC error
[ 1592.696136] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1593.705657] mmc0: Command timeout
[ 1593.710693] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1594.715087] mmc0: Command CRC error
[ 1594.715148] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 1595.724639] mmc0: Command timeout
[ 1595.729705] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 1596.734100] mmc0: Command CRC error
[ 1596.734161] mmc0:0001: error -84 reading SDIO_CCCR_INTx
etc....
So I use the wifi,listen to a webradio,browse the web etc...
but after a while it stop working,and after a while it stops working.
and when it occurs,iwconfig say that it's still associated...
Denis.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] wl1251: fix ELP_CTRL register reads
  2010-06-21 12:46     ` Denis 'GNUtoo' Carikli
@ 2010-06-21 17:54       ` Bob Copeland
  2010-06-21 18:45         ` Denis 'GNUtoo' Carikli
  0 siblings, 1 reply; 13+ messages in thread
From: Bob Copeland @ 2010-06-21 17:54 UTC (permalink / raw)
  To: Denis 'GNUtoo' Carikli
  Cc: Kalle Valo, Grazvydas Ignotas, John W.Linville, linux-wireless

On Mon, Jun 21, 2010 at 8:46 AM, Denis 'GNUtoo' Carikli
<GNUtoo@no-log.org> wrote:

> Hi, me and some other people are trying to run standard GNU/Linux (not
> android ) on the htcdream.

> [ 1556.425354] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
> [ 1556.734130] mmc0: Command timeout

In this case it was only up for 1/3 second before it quit
responding to reads.  With power saving disabled it works?

Probably not relevant to power saving, but:

Are you using the dedicated irq line or sdio interrupt?
It makes a big difference in overall throughput to use
the former.

> +       /*
> +        * FIXME: scanning while associated causes lockups,
> +        * so we don't allow that
> +        */
> +       if (wl->associated)
> +               return -EBUSY;

Any idea why?  Could you turn on lockdep?

-- 
Bob Copeland %% www.bobcopeland.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] wl1251: fix ELP_CTRL register reads
  2010-06-21 17:54       ` Bob Copeland
@ 2010-06-21 18:45         ` Denis 'GNUtoo' Carikli
  2010-06-21 22:48           ` Grazvydas Ignotas
  0 siblings, 1 reply; 13+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2010-06-21 18:45 UTC (permalink / raw)
  To: Bob Copeland
  Cc: Kalle Valo, Grazvydas Ignotas, John W.Linville, linux-wireless

On Mon, 2010-06-21 at 13:54 -0400, Bob Copeland wrote:
> On Mon, Jun 21, 2010 at 8:46 AM, Denis 'GNUtoo' Carikli
> <GNUtoo@no-log.org> wrote:
> 
> > Hi, me and some other people are trying to run standard GNU/Linux (not
> > android ) on the htcdream.
> 
> > [ 1556.425354] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
> > [ 1556.734130] mmc0: Command timeout
> 
> In this case it was only up for 1/3 second before it quit
> responding to reads.  With power saving disabled it works?
In this case I think only some command timeout(If I remember well it
worked for a bit and then stopped working)
But I'm sure that you can ping with the command timeout and have some
transfers etc...

With power saving disabled it works fine,until the battery goes out.
Disabling power saving also stop the flow of timeout messages...

> Probably not relevant to power saving, but:
> 
> Are you using the dedicated irq line or sdio interrupt?
> It makes a big difference in overall throughput to use
> the former.
I don't know. what should I grep for?

> > +       /*
> > +        * FIXME: scanning while associated causes lockups,
> > +        * so we don't allow that
> > +        */
> > +       if (wl->associated)
> > +               return -EBUSY;
> 
> Any idea why?  Could you turn on lockdep?
No I just used the patches that weren't mine
I took them from openpandora wireless repository,looked if they were
already included,and include the one that weren't.

Denis.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] wl1251: fix ELP_CTRL register reads
  2010-06-21 18:45         ` Denis 'GNUtoo' Carikli
@ 2010-06-21 22:48           ` Grazvydas Ignotas
  2010-06-22 23:33             ` Denis 'GNUtoo' Carikli
  0 siblings, 1 reply; 13+ messages in thread
From: Grazvydas Ignotas @ 2010-06-21 22:48 UTC (permalink / raw)
  To: Denis 'GNUtoo' Carikli
  Cc: Bob Copeland, Kalle Valo, John W.Linville, linux-wireless

>> Probably not relevant to power saving, but:
>>
>> Are you using the dedicated irq line or sdio interrupt?
>> It makes a big difference in overall throughput to use
>> the former.
> I don't know. what should I grep for?

It might actually be related.. Try adding this to your board file to
enable GPIO irq:

static void wl1251_set_power(bool enable)
{
}

static struct wl12xx_platform_data wl1251_pdata = {
        .set_power      = wl1251_set_power,
};

static struct platform_device wl1251_data = {
        .name           = "wl1251_data",
        .id             = -1,
        .dev            = {
                .platform_data  = &wl1251_pdata,
        },
};

.. then from some init function:

// WIFI_IRQ_GPIO is the GPIO number connected to wl1251 irq line
wl1251_pdata.irq = gpio_to_irq(WIFI_IRQ_GPIO);
platform_device_register(&wl1251_pdata);

>
>> > +       /*
>> > +        * FIXME: scanning while associated causes lockups,
>> > +        * so we don't allow that
>> > +        */
>> > +       if (wl->associated)
>> > +               return -EBUSY;
>>
>> Any idea why?  Could you turn on lockdep?
> No I just used the patches that weren't mine
> I took them from openpandora wireless repository,looked if they were
> already included,and include the one that weren't.

This is a workaround we use on pandora, otherwise with NetworkManager
running the driver locks up. I didn't have a chance to properly debug
this, but I can do some backtraces if you are interested.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] wl1251: fix ELP_CTRL register reads
  2010-06-21 22:48           ` Grazvydas Ignotas
@ 2010-06-22 23:33             ` Denis 'GNUtoo' Carikli
  2010-06-24 23:09               ` Denis 'GNUtoo' Carikli
  0 siblings, 1 reply; 13+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2010-06-22 23:33 UTC (permalink / raw)
  To: Grazvydas Ignotas
  Cc: Bob Copeland, Kalle Valo, John W.Linville, linux-wireless

On Tue, 2010-06-22 at 01:48 +0300, Grazvydas Ignotas wrote:
> >> Probably not relevant to power saving, but:
> >>
> >> Are you using the dedicated irq line or sdio interrupt?
> >> It makes a big difference in overall throughput to use
> >> the former.
> > I don't know. what should I grep for?
> 
> It might actually be related.. Try adding this to your board file to
> enable GPIO irq:
> 
> static void wl1251_set_power(bool enable)
> {
> }
> 
> static struct wl12xx_platform_data wl1251_pdata = {
>         .set_power      = wl1251_set_power,
> };
> 
> static struct platform_device wl1251_data = {
>         .name           = "wl1251_data",
>         .id             = -1,
>         .dev            = {
>                 .platform_data  = &wl1251_pdata,
>         },
> };
> 
> .. then from some init function:
> 
> // WIFI_IRQ_GPIO is the GPIO number connected to wl1251 irq line
> wl1251_pdata.irq = gpio_to_irq(WIFI_IRQ_GPIO);
> platform_device_register(&wl1251_pdata);
Thanks a lot for the infos,they were really helpfull.

I've applied that patch(as it was not for submitting,just for reading I
didn't bother sending with git-send-email): 
Index: sources/arch/arm/mach-msm/board-trout.c
===================================================================
--- sources.orig/arch/arm/mach-msm/board-trout.c	2010-06-23
00:41:54.601288614 +0200
+++ sources/arch/arm/mach-msm/board-trout.c	2010-06-23
00:43:59.893158944 +0200
@@ -52,6 +52,7 @@
 #include <asm/mach/mmc.h>
 #include <linux/mmc/sdio_ids.h>
 #include <linux/msm_audio.h>
+#include <linux/spi/wl12xx.h>
 
 #include "board-trout.h"
 
@@ -363,6 +364,17 @@
 	},
 };
 
+struct wl12xx_platform_data wl12xx_data = {
+};
+
+static struct platform_device  wl12xx = {
+	.name		= "wl1251_data",
+	.id		= -1,
+	.dev		= {
+		.platform_data = &wl12xx_data,
+	},
+};
+
 #ifdef CONFIG_HTC_HEADSET
 static void h2w_config_cpld(int route)
 {
@@ -650,6 +662,7 @@
 	&trout_pwr_sink,
 #endif
 	&trout_snd,
+	&wl12xx,
 };
 
 extern struct sys_timer msm_timer;
@@ -745,6 +758,7 @@
 
 static void __init config_gpios(void)
 {
+	wl12xx_data.irq = gpio_to_irq(29);
 	config_gpio_table(gpio_table, ARRAY_SIZE(gpio_table));
 	config_camera_off_gpios();
 }
Index: sources/include/linux/spi/wl12xx.h
===================================================================
--- sources.orig/include/linux/spi/wl12xx.h	2010-06-23
00:42:03.641283312 +0200
+++ sources/include/linux/spi/wl12xx.h	2010-06-23 00:42:48.103178185
+0200
@@ -26,6 +26,7 @@
 
 struct wl12xx_platform_data {
 	void (*set_power)(bool enable);
+	int irq;
 };
 
 #endif

The patch was made from someone in irc and modified by me later.

Then I load the wifi as usual:
modprobe wl1251_sdio #it doesn't crash
modprobe msm_wifi
the modprobe msm_wifi gives the following result:
[ 1366.500427] wifi probe start
[ 1366.500457] trout_wifi_power: 1
[ 1366.927185] trout_wifi_reset: 0
[ 1367.030944] trout_wifi_set_carddetect: 1
[ 1367.030975] mmc0: card_present 1
[ 1367.030975] mmc0: Slot status change detected (0 -> 1)
[ 1367.031036] wifi probe done
And then I've an invisible crash/kernel panic which result in the
machine lockup and then reboot(so it should be a kernel panic).
Note that I've no serial yet(I think I should really get a serial cable
for this machine)

msm_wifi comes from here:
http://bobcopeland.com/srcs/android/msm_wifi.patch

I had already some wifi structures which may have conflicted:

struct wifi_platform_data trout_wifi_control = {
	.set_power		= trout_wifi_power,
	.set_reset		= trout_wifi_reset,
	.set_carddetect		= trout_wifi_set_carddetect,
#ifdef CONFIG_WIFI_MEM_PREALLOC
	.mem_prealloc		= trout_wifi_mem_prealloc,
#else
	.mem_prealloc		= NULL,
#endif	
};

static struct platform_device trout_wifi = {
	.name		= "msm_wifi",
	.id		= 1,
	.num_resources	= 0,
	.resource	= NULL,
	.dev		= {
		.platform_data = &trout_wifi_control,
	},
};

Thanks a lot for the help so far.
Denis




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] wl1251: fix ELP_CTRL register reads
  2010-06-22 23:33             ` Denis 'GNUtoo' Carikli
@ 2010-06-24 23:09               ` Denis 'GNUtoo' Carikli
  2010-06-24 23:34                 ` Grazvydas Ignotas
  0 siblings, 1 reply; 13+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2010-06-24 23:09 UTC (permalink / raw)
  To: Grazvydas Ignotas
  Cc: Bob Copeland, Kalle Valo, John W.Linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 5450 bytes --]

On Wed, 2010-06-23 at 01:33 +0200, Denis 'GNUtoo' Carikli wrote:
> On Tue, 2010-06-22 at 01:48 +0300, Grazvydas Ignotas wrote:
> > >> Probably not relevant to power saving, but:
> > >>
> > >> Are you using the dedicated irq line or sdio interrupt?
> > >> It makes a big difference in overall throughput to use
> > >> the former.
> > > I don't know. what should I grep for?
> > 
> > It might actually be related.. Try adding this to your board file to
> > enable GPIO irq:
> > 
> > static void wl1251_set_power(bool enable)
> > {
> > }
> > 
> > static struct wl12xx_platform_data wl1251_pdata = {
> >         .set_power      = wl1251_set_power,
> > };
> > 
> > static struct platform_device wl1251_data = {
> >         .name           = "wl1251_data",
> >         .id             = -1,
> >         .dev            = {
> >                 .platform_data  = &wl1251_pdata,
> >         },
> > };
> > 
> > .. then from some init function:
> > 
> > // WIFI_IRQ_GPIO is the GPIO number connected to wl1251 irq line
> > wl1251_pdata.irq = gpio_to_irq(WIFI_IRQ_GPIO);
> > platform_device_register(&wl1251_pdata);
> Thanks a lot for the infos,they were really helpfull.
> 
> I've applied that patch(as it was not for submitting,just for reading I
> didn't bother sending with git-send-email): 
> Index: sources/arch/arm/mach-msm/board-trout.c
> ===================================================================
> --- sources.orig/arch/arm/mach-msm/board-trout.c	2010-06-23
> 00:41:54.601288614 +0200
> +++ sources/arch/arm/mach-msm/board-trout.c	2010-06-23
> 00:43:59.893158944 +0200
> @@ -52,6 +52,7 @@
>  #include <asm/mach/mmc.h>
>  #include <linux/mmc/sdio_ids.h>
>  #include <linux/msm_audio.h>
> +#include <linux/spi/wl12xx.h>
>  
>  #include "board-trout.h"
>  
> @@ -363,6 +364,17 @@
>  	},
>  };
>  
> +struct wl12xx_platform_data wl12xx_data = {
> +};
> +
> +static struct platform_device  wl12xx = {
> +	.name		= "wl1251_data",
> +	.id		= -1,
> +	.dev		= {
> +		.platform_data = &wl12xx_data,
> +	},
> +};
> +
>  #ifdef CONFIG_HTC_HEADSET
>  static void h2w_config_cpld(int route)
>  {
> @@ -650,6 +662,7 @@
>  	&trout_pwr_sink,
>  #endif
>  	&trout_snd,
> +	&wl12xx,
>  };
>  
>  extern struct sys_timer msm_timer;
> @@ -745,6 +758,7 @@
>  
>  static void __init config_gpios(void)
>  {
> +	wl12xx_data.irq = gpio_to_irq(29);
>  	config_gpio_table(gpio_table, ARRAY_SIZE(gpio_table));
>  	config_camera_off_gpios();
>  }
> Index: sources/include/linux/spi/wl12xx.h
> ===================================================================
> --- sources.orig/include/linux/spi/wl12xx.h	2010-06-23
> 00:42:03.641283312 +0200
> +++ sources/include/linux/spi/wl12xx.h	2010-06-23 00:42:48.103178185
> +0200
> @@ -26,6 +26,7 @@
>  
>  struct wl12xx_platform_data {
>  	void (*set_power)(bool enable);
> +	int irq;
>  };
>  
>  #endif
> 
> The patch was made from someone in irc and modified by me later.
> 
> Then I load the wifi as usual:
> modprobe wl1251_sdio #it doesn't crash
> modprobe msm_wifi
> the modprobe msm_wifi gives the following result:
> [ 1366.500427] wifi probe start
> [ 1366.500457] trout_wifi_power: 1
> [ 1366.927185] trout_wifi_reset: 0
> [ 1367.030944] trout_wifi_set_carddetect: 1
> [ 1367.030975] mmc0: card_present 1
> [ 1367.030975] mmc0: Slot status change detected (0 -> 1)
> [ 1367.031036] wifi probe done
> And then I've an invisible crash/kernel panic which result in the
> machine lockup and then reboot(so it should be a kernel panic).
> Note that I've no serial yet(I think I should really get a serial cable
> for this machine)
> 
> msm_wifi comes from here:
> http://bobcopeland.com/srcs/android/msm_wifi.patch
> 
> I had already some wifi structures which may have conflicted:
> 
> struct wifi_platform_data trout_wifi_control = {
> 	.set_power		= trout_wifi_power,
> 	.set_reset		= trout_wifi_reset,
> 	.set_carddetect		= trout_wifi_set_carddetect,
> #ifdef CONFIG_WIFI_MEM_PREALLOC
> 	.mem_prealloc		= trout_wifi_mem_prealloc,
> #else
> 	.mem_prealloc		= NULL,
> #endif	
> };
I've changed that struct to wl12xx_platform_Data and added the irq
int,and I've still the following errors:
[  541.676849] wl1251: ERROR sdio_writeb failed (-84)
[  542.006378] mmc0: Command timeout
[  542.011444] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[  543.016357] mmc0: Command CRC error
[  543.016418] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[  544.026367] mmc0: Command timeout
[  544.031433] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[  545.036376] mmc0: Command CRC error
[  545.036437] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[  546.066345] mmc0: Command timeout
[  546.071411] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[  547.076354] mmc0: Command CRC error
[  547.076416] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[  548.106384] mmc0: Command timeout
[  548.111450] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[  548.706665] mmc0: Command CRC error
[  548.706726] wl1251: ERROR sdio_writeb failed (-84)
[  549.136383] mmc0: Command timeout
[  549.141479] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[  549.676635] mmc0: Command CRC error
[  549.676696] wl1251: ERROR sdio_writeb failed (-84)
[  550.166381] mmc0: Command timeout
[  550.171447] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[  550.676269] wlan0: no IPv6 routers present
[  551.176361] mmc0: Command CRC error
[  551.176422] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[  552.186340] mmc0: Command timeout

The patch is attached.

Denis.


[-- Attachment #2: cleaner_wifi_patch_quilt.patch --]
[-- Type: text/x-patch, Size: 4876 bytes --]

Index: sources/arch/arm/mach-msm/board-trout-wifi.c
===================================================================
--- sources.orig/arch/arm/mach-msm/board-trout-wifi.c	2010-06-24 23:58:13.194099802 +0200
+++ sources/arch/arm/mach-msm/board-trout-wifi.c	2010-06-24 23:58:21.385931197 +0200
@@ -20,7 +20,7 @@
 #include <linux/platform_device.h>
 #include <linux/vmalloc.h>
 #include <linux/err.h>
-#include <linux/wifi_tiwlan.h>
+#include <linux/spi/wl12xx.h>
 
 extern int trout_wifi_set_carddetect(int val);
 extern int trout_wifi_power(int on);
@@ -60,7 +60,7 @@
 }
 #endif
 
-struct wifi_platform_data trout_wifi_control = {
+struct wl12xx_platform_data trout_wifi_control = {
 	.set_power		= trout_wifi_power,
 	.set_reset		= trout_wifi_reset,
 	.set_carddetect		= trout_wifi_set_carddetect,
Index: sources/arch/arm/mach-msm/board-trout.c
===================================================================
--- sources.orig/arch/arm/mach-msm/board-trout.c	2010-06-24 23:58:13.234055563 +0200
+++ sources/arch/arm/mach-msm/board-trout.c	2010-06-25 00:40:37.324053664 +0200
@@ -66,7 +66,7 @@
 #include <mach/htc_headset.h>
 #endif
 #ifdef CONFIG_WIFI_CONTROL_FUNC
-#include <linux/wifi_tiwlan.h>
+#include <linux/spi/wl12xx.h>
 #endif
 
 #include "proc_comm.h"
@@ -80,7 +80,7 @@
 #ifdef CONFIG_WIFI_MEM_PREALLOC
 extern int trout_init_wifi_mem(void);
 #endif
-extern struct wifi_platform_data trout_wifi_control;
+extern struct wl12xx_platform_data trout_wifi_control;
 #endif
 
 struct trout_axis_info {
@@ -545,6 +545,28 @@
 	.ram_console_size = MSM_RAM_CONSOLE_SIZE,
 };
 
+
+static void trout_wl1251_init(void)
+{
+	int ret;
+
+	ret = gpio_request(TROUT_WIFI_IRQ_GPIO, "wl1251 irq");
+	if (ret < 0)
+		goto fail_irq;
+
+	ret = gpio_direction_input(TROUT_WIFI_IRQ_GPIO);
+	if (ret < 0)
+		goto fail_irq;
+
+	trout_wifi_control.irq = gpio_to_irq(TROUT_WIFI_IRQ_GPIO);
+	if (trout_wifi_control.irq < 0)
+		goto fail_irq;
+
+	return;
+
+fail_irq:
+	gpio_free(TROUT_WIFI_IRQ_GPIO);
+}
 #ifdef CONFIG_WIFI_CONTROL_FUNC
 static struct platform_device trout_wifi = {
 	.name		= "msm_wifi",
@@ -823,6 +845,7 @@
 
 	/* SD card door should wake the device */
 	set_irq_wake(TROUT_GPIO_TO_INT(TROUT_GPIO_SD_DOOR_N), 1);
+	trout_wl1251_init();
 }
 
 static struct map_desc trout_io_desc[] __initdata = {
Index: sources/arch/arm/mach-msm/board-trout.h
===================================================================
--- sources.orig/arch/arm/mach-msm/board-trout.h	2010-06-24 23:58:13.294049700 +0200
+++ sources/arch/arm/mach-msm/board-trout.h	2010-06-24 23:58:21.385931197 +0200
@@ -74,6 +74,7 @@
 
 #define TROUT_GPIO_HAPTIC_PWM               (28)
 #define TROUT_GPIO_PS_HOLD                  (25)
+#define TROUT_WIFI_IRQ_GPIO	            (29)
 
 #define TROUT_GPIO_MISC2_BASE               (TROUT_GPIO_START + 0x00)
 #define TROUT_GPIO_MISC3_BASE               (TROUT_GPIO_START + 0x08)
Index: sources/arch/arm/mach-msm/msm_wifi.c
===================================================================
--- sources.orig/arch/arm/mach-msm/msm_wifi.c	2010-06-24 23:58:13.344052459 +0200
+++ sources/arch/arm/mach-msm/msm_wifi.c	2010-06-24 23:58:21.385931197 +0200
@@ -18,12 +18,12 @@
  * Copyright (C) 2008 Google Inc
  */
 #include <linux/platform_device.h>
-#include <linux/wifi_tiwlan.h>
+#include <linux/spi/wl12xx.h>
 
 static int wifi_probe(struct platform_device *pdev)
 {
-	struct wifi_platform_data *wifi_ctrl =
-		(struct wifi_platform_data *)(pdev->dev.platform_data);
+	struct wl12xx_platform_data *wifi_ctrl =
+		(struct wl12xx_platform_data *)(pdev->dev.platform_data);
 
 	printk(KERN_DEBUG "wifi probe start\n");
 
@@ -43,8 +43,8 @@
 
 static int wifi_remove(struct platform_device *pdev)
 {
-	struct wifi_platform_data *wifi_ctrl =
-		(struct wifi_platform_data *)(pdev->dev.platform_data);
+	struct wl12xx_platform_data *wifi_ctrl =
+		(struct w12xx_platform_data *)(pdev->dev.platform_data);
 
 	printk(KERN_DEBUG "wifi remove start\n");
 	if (!wifi_ctrl)
Index: sources/include/linux/spi/wl12xx.h
===================================================================
--- sources.orig/include/linux/spi/wl12xx.h	2010-06-24 23:58:13.404053597 +0200
+++ sources/include/linux/spi/wl12xx.h	2010-06-24 23:58:21.385931197 +0200
@@ -24,8 +24,19 @@
 #ifndef _LINUX_SPI_WL12XX_H
 #define _LINUX_SPI_WL12XX_H
 
+#define WMPA_NUMBER_OF_SECTIONS	3
+#define WMPA_NUMBER_OF_BUFFERS	160
+#define WMPA_SECTION_HEADER	24
+#define WMPA_SECTION_SIZE_0	(WMPA_NUMBER_OF_BUFFERS * 64)
+#define WMPA_SECTION_SIZE_1	(WMPA_NUMBER_OF_BUFFERS * 256)
+#define WMPA_SECTION_SIZE_2	(WMPA_NUMBER_OF_BUFFERS * 2048)
+
 struct wl12xx_platform_data {
-	void (*set_power)(bool enable);
+        int (*set_power)(bool enable);
+        int (*set_reset)(bool enable);
+        int (*set_carddetect)(bool enable);
+	void *(*mem_prealloc)(int section, unsigned long size);
+	int irq;
 };
 
 #endif

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] wl1251: fix ELP_CTRL register reads
  2010-06-24 23:09               ` Denis 'GNUtoo' Carikli
@ 2010-06-24 23:34                 ` Grazvydas Ignotas
  2010-06-25 16:01                   ` Denis 'GNUtoo' Carikli
  0 siblings, 1 reply; 13+ messages in thread
From: Grazvydas Ignotas @ 2010-06-24 23:34 UTC (permalink / raw)
  To: Denis 'GNUtoo' Carikli
  Cc: Bob Copeland, Kalle Valo, John W.Linville, linux-wireless

> I've changed that struct to wl12xx_platform_Data and added the irq
> int,and I've still the following errors:
> [  541.676849] wl1251: ERROR sdio_writeb failed (-84)
> [  542.006378] mmc0: Command timeout
> [  542.011444] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> [  543.016357] mmc0: Command CRC error
> [  543.016418] mmc0:0001: error -84 reading SDIO_CCCR_INTx
> [  544.026367] mmc0: Command timeout
> [  544.031433] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> [  545.036376] mmc0: Command CRC error

Has powersaving ever worked on your device with this driver? It does
work fine on pandora (OMAP3).

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] wl1251: fix ELP_CTRL register reads
  2010-06-24 23:34                 ` Grazvydas Ignotas
@ 2010-06-25 16:01                   ` Denis 'GNUtoo' Carikli
  2010-06-25 18:06                     ` Denis 'GNUtoo' Carikli
  0 siblings, 1 reply; 13+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2010-06-25 16:01 UTC (permalink / raw)
  To: Grazvydas Ignotas
  Cc: Bob Copeland, Kalle Valo, John W.Linville, linux-wireless

On Fri, 2010-06-25 at 02:34 +0300, Grazvydas Ignotas wrote:
> > I've changed that struct to wl12xx_platform_Data and added the irq
> > int,and I've still the following errors:
> > [  541.676849] wl1251: ERROR sdio_writeb failed (-84)
> > [  542.006378] mmc0: Command timeout
> > [  542.011444] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> > [  543.016357] mmc0: Command CRC error
> > [  543.016418] mmc0:0001: error -84 reading SDIO_CCCR_INTx
> > [  544.026367] mmc0: Command timeout
> > [  544.031433] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> > [  545.036376] mmc0: Command CRC error
> 
> Has powersaving ever worked on your device with this driver? It does
> work fine on pandora (OMAP3).
Not sure,
I've updated the sd driver,but I think I've still an issue
maybe the irq is not well recognized because I did some mistake. 
here are the debug:
[ 2132.599578] wl1251: cmd configure
[ 2132.619567] wl1251: acx wake up conditions
[ 2132.619628] wl1251: cmd configure
[ 2132.639587] wl1251: cmd set ps mode
[ 2132.640747] wl1251: sleep auth psm/elp
[ 2132.640808] wl1251: acx sleep auth
[ 2132.640808] wl1251: cmd configure
[ 2132.650268] wl1251: elp work
[ 2132.650299] wl1251: chip to elp
[ 2133.239471] wl1251: IRQ
[ 2133.239654] wl1251: IRQ work
[ 2133.239654] wl1251: waking up chip from elp
[ 2133.239715] wl1251: wakeup time: 0 ms
[ 2133.239868] wl1251: intr: 0x3
[ 2133.239929] wl1251: RX: FW +1
[ 2133.239929] wl1251: RX counter: 7
[ 2133.239959] wl1251: WL1251_ACX_INTR_RX0_DATA
[ 2133.240081] wl1251: rx skb 0xc61c3480: 88 B 
[ 2133.240203] wl1251: WL1251_ACX_INTR_TX_RESULT
[ 2133.240478] wl1251: tx status id 0 skb 0xc635f480 failures 0 rate 0x1
status 0x0 ()
[ 2133.251251] wl1251: elp work
[ 2133.264434] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 2133.479278] wlan0: no IPv6 routers present
[ 2134.269470] mmc0: Command CRC error
[ 2134.269561] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 2135.284484] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 2136.289428] mmc0: Command CRC error
[ 2136.289489] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 2137.304504] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 2138.309478] mmc0: Command CRC error
[ 2138.309539] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 2139.324523] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 2140.329437] mmc0: Command CRC error
[ 2140.329498] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 2141.344512] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 2142.349456] mmc0: Command CRC error
[ 2142.349548] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 2143.364501] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 2144.369476] mmc0: Command CRC error
[ 2144.369537] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 2145.384490] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 2146.389404] mmc0: Command CRC error
[ 2146.389495] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 2147.404541] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 2148.409454] mmc0: Command CRC error
[ 2148.409545] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 2149.424530] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 2150.429534] mmc0: Command CRC error
[ 2150.429595] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 2151.444488] mmc0:0001: error -110 reading SDIO_CCCR_INTx
[ 2152.449432] mmc0: Command CRC error
[ 2152.449523] mmc0:0001: error -84 reading SDIO_CCCR_INTx
[ 2152.969360] wl1251: mac80211 config ch 7 psm off power 20
[ 2152.969421] wl1251: waking up chip from elp
[ 2152.989410] wl1251: wakeup time: 20 ms
[ 2152.989440] wl1251: psm disabled
[ 2152.989471] wl1251: leaving psm
[ 2152.989471] wl1251: sleep auth cam

SDIO_CCCR_INT is in sdio_irq.c in driver/mmc/core
static int process_sdio_pending_irqs(struct mmc_card *card)
{
  int i, ret, count;
  unsigned char pending;

  ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_INTx, 0, &pending);
  if (ret) {
    printk(KERN_DEBUG "%s: error %d reading SDIO_CCCR_INTx\n",
                       mmc_card_id(card), ret);
    return ret;
  }
...

so I think that the IRQ could not have been proprerly initialized and so
it would prevent PSM because:
it seem to want to enter PSM,then fail because of the IRQ issue and go
back to normal mode.

Denis.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/2] wl1251: fix ELP_CTRL register reads
  2010-06-25 16:01                   ` Denis 'GNUtoo' Carikli
@ 2010-06-25 18:06                     ` Denis 'GNUtoo' Carikli
  0 siblings, 0 replies; 13+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2010-06-25 18:06 UTC (permalink / raw)
  To: Grazvydas Ignotas
  Cc: Bob Copeland, Kalle Valo, John W.Linville, linux-wireless

On Fri, 2010-06-25 at 18:01 +0200, Denis 'GNUtoo' Carikli wrote:
> [ 2132.599578] wl1251: cmd configure
> [ 2132.619567] wl1251: acx wake up conditions
> [ 2132.619628] wl1251: cmd configure
> [ 2132.639587] wl1251: cmd set ps mode
> [ 2132.640747] wl1251: sleep auth psm/elp
> [ 2132.640808] wl1251: acx sleep auth
> [ 2132.640808] wl1251: cmd configure
> [ 2132.650268] wl1251: elp work
> [ 2132.650299] wl1251: chip to elp
> [ 2133.239471] wl1251: IRQ
> [ 2133.239654] wl1251: IRQ work
> [ 2133.239654] wl1251: waking up chip from elp
> [ 2133.239715] wl1251: wakeup time: 0 ms
does it mean that here it works?
> [ 2133.239868] wl1251: intr: 0x3
> [ 2133.239929] wl1251: RX: FW +1
> [ 2133.239929] wl1251: RX counter: 7
> [ 2133.239959] wl1251: WL1251_ACX_INTR_RX0_DATA
> [ 2133.240081] wl1251: rx skb 0xc61c3480: 88 B 
> [ 2133.240203] wl1251: WL1251_ACX_INTR_TX_RESULT
> [ 2133.240478] wl1251: tx status id 0 skb 0xc635f480 failures 0 rate
> 0x1
> status 0x0 ()
> [ 2133.251251] wl1251: elp work
> [ 2133.264434] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> [ 2133.479278] wlan0: no IPv6 routers present
> [ 2134.269470] mmc0: Command CRC error
> [ 2134.269561] mmc0:0001: error -84 reading SDIO_CCCR_INTx
> [ 2135.284484] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> [ 2136.289428] mmc0: Command CRC error
> [ 2136.289489] mmc0:0001: error -84 reading SDIO_CCCR_INTx
> [ 2137.304504] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> [ 2138.309478] mmc0: Command CRC error
> [ 2138.309539] mmc0:0001: error -84 reading SDIO_CCCR_INTx
> [ 2139.324523] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> [ 2140.329437] mmc0: Command CRC error
> [ 2140.329498] mmc0:0001: error -84 reading SDIO_CCCR_INTx
> [ 2141.344512] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> [ 2142.349456] mmc0: Command CRC error
> [ 2142.349548] mmc0:0001: error -84 reading SDIO_CCCR_INTx
> [ 2143.364501] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> [ 2144.369476] mmc0: Command CRC error
> [ 2144.369537] mmc0:0001: error -84 reading SDIO_CCCR_INTx
> [ 2145.384490] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> [ 2146.389404] mmc0: Command CRC error
> [ 2146.389495] mmc0:0001: error -84 reading SDIO_CCCR_INTx
> [ 2147.404541] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> [ 2148.409454] mmc0: Command CRC error
> [ 2148.409545] mmc0:0001: error -84 reading SDIO_CCCR_INTx
> [ 2149.424530] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> [ 2150.429534] mmc0: Command CRC error
> [ 2150.429595] mmc0:0001: error -84 reading SDIO_CCCR_INTx
> [ 2151.444488] mmc0:0001: error -110 reading SDIO_CCCR_INTx
> [ 2152.449432] mmc0: Command CRC error
> [ 2152.449523] mmc0:0001: error -84 reading SDIO_CCCR_INTx
and that here it doesn't anymore?
> [ 2152.969360] wl1251: mac80211 config ch 7 psm off power 20
> [ 2152.969421] wl1251: waking up chip from elp
> [ 2152.989410] wl1251: wakeup time: 20 ms
> [ 2152.989440] wl1251: psm disabled
> [ 2152.989471] wl1251: leaving psm
> [ 2152.989471] wl1251: sleep auth cam 

Denis.



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-06-25 18:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-04 23:25 [PATCH 1/2] wl1251: fix a memory leak in probe Grazvydas Ignotas
2010-06-04 23:25 ` [PATCH 2/2] wl1251: fix ELP_CTRL register reads Grazvydas Ignotas
2010-06-05  7:04   ` Kalle Valo
2010-06-21 12:46     ` Denis 'GNUtoo' Carikli
2010-06-21 17:54       ` Bob Copeland
2010-06-21 18:45         ` Denis 'GNUtoo' Carikli
2010-06-21 22:48           ` Grazvydas Ignotas
2010-06-22 23:33             ` Denis 'GNUtoo' Carikli
2010-06-24 23:09               ` Denis 'GNUtoo' Carikli
2010-06-24 23:34                 ` Grazvydas Ignotas
2010-06-25 16:01                   ` Denis 'GNUtoo' Carikli
2010-06-25 18:06                     ` Denis 'GNUtoo' Carikli
2010-06-05  7:00 ` [PATCH 1/2] wl1251: fix a memory leak in probe Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.