All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Varnin <fenixk19-JGs/UdohzUI@public.gmane.org>
To: Bing Zhao <bzhao-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>,
	"linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: "linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: mwifiex_sdio on chromebook
Date: Mon, 04 Nov 2013 06:18:14 +0400	[thread overview]
Message-ID: <527703E6.8040504@mail.ru> (raw)
In-Reply-To: <477F20668A386D41ADCC57781B1F70430F45757E63-r8ILAu4/owuHXkj8w7BxOhL4W9x8LtSr@public.gmane.org>

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

04.11.2013 02:10, Bing Zhao пишет:
> Your Chromebook supports SDIO high speed mode (SDIO 2.0 spec). So
> 50MHz is correct.

Ok, but mainline kernel doesn't try this frequency. It tries 400kHz at
most.

> What are you trying to do here? Are you trying to run a mainline kernel on your Chromebook?

Yes. I've got kernel 3.4 from Google Chrome OS. It works ok for
mwifiex_sdio. But I want to run mainline kernel. As of 3.11 it is able
to boot on Chromebook, but WiFi doesn't work.

> You said mmc_attach_sdio function fails. The mwifiex_sdio driver and
> the firmware will not be loaded at all. 

Ok, that is clear.

> CONFIG_MMC_DEBUG=y, and collect the debug logs.  

This way seems not very useful, because there is also internal and
external storage on mmc bus, so log quickly get garbaged with it. Dmesg
seems to be overflowed and forgets early initialization. I have made a
dirty hack to collect some useful info about initialization. I am
attaching it. Please check, if I need to add something. Will it be
useful this way?

[-- Attachment #2: dirty-hack.diff --]
[-- Type: text/x-patch, Size: 2948 bytes --]

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index bf18b6b..c4a2b22 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1001,12 +1001,16 @@ EXPORT_SYMBOL(mmc_put_card);
 static inline void mmc_set_ios(struct mmc_host *host)
 {
 	struct mmc_ios *ios = &host->ios;
-
-	pr_debug("%s: clock %uHz busmode %u powermode %u cs %u Vdd %u "
+	
+	if(((char*)mmc_hostname(host))[3]=='2') {
+	  printk("%s: clock %uHz busmode %u powermode %u cs %u Vdd %u "
 		"width %u timing %u\n",
 		 mmc_hostname(host), ios->clock, ios->bus_mode,
 		 ios->power_mode, ios->chip_select, ios->vdd,
 		 ios->bus_width, ios->timing);
+	
+	  dump_stack();
+	}
 
 	if (ios->clock > 0)
 		mmc_set_ungated(host);
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 80d89cff..0773be2 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -1133,11 +1133,14 @@ int mmc_attach_sdio(struct mmc_host *host)
 	int err, i, funcs;
 	u32 ocr;
 	struct mmc_card *card;
+	
+	printk("mmc_attach_sdio 1\n");
 
 	BUG_ON(!host);
 	WARN_ON(!host->claimed);
 
 	err = mmc_send_io_op_cond(host, 0, &ocr);
+	printk("mmc_attach_sdio err %d\n", err);
 	if (err)
 		return err;
 
@@ -1166,6 +1169,8 @@ int mmc_attach_sdio(struct mmc_host *host)
 		goto err;
 	}
 
+	printk("mmc_attach_sdio 2\n");
+	
 	/*
 	 * Detect and init the card.
 	 */
@@ -1182,11 +1187,13 @@ int mmc_attach_sdio(struct mmc_host *host)
 			host->ocr &= ~R4_18V_PRESENT;
 			err = mmc_sdio_init_card(host, host->ocr, NULL, 0);
 		}
+		printk("mmc_attach_sdio 3 err %d\n", err);
 		if (err)
 			goto err;
 	}
 	card = host->card;
 
+	printk("mmc_attach_sdio 4\n");
 	/*
 	 * Enable runtime PM only if supported by host+card+board
 	 */
@@ -1195,6 +1202,7 @@ int mmc_attach_sdio(struct mmc_host *host)
 		 * Let runtime PM core know our card is active
 		 */
 		err = pm_runtime_set_active(&card->dev);
+		printk("mmc_attach_sdio 5 err %d\n", err);
 		if (err)
 			goto remove;
 
@@ -1226,6 +1234,7 @@ int mmc_attach_sdio(struct mmc_host *host)
 			pm_runtime_enable(&card->sdio_func[i]->dev);
 	}
 
+	printk("mmc_attach_sdio 6\n");
 	/*
 	 * First add the card to the driver model...
 	 */
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 018f365..342b0c4 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1917,6 +1917,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 
 	mmc->ops = &dw_mci_ops;
 	mmc->f_min = DIV_ROUND_UP(host->bus_hz, 510);
+	printk("f_min = %u;  %d", mmc->f_min, host->bus_hz);
 	mmc->f_max = host->bus_hz;
 
 	if (host->pdata->get_ocr)
diff --git a/drivers/net/wireless/mwifiex/Makefile b/drivers/net/wireless/mwifiex/Makefile
index a42a506..145f376 100644
--- a/drivers/net/wireless/mwifiex/Makefile
+++ b/drivers/net/wireless/mwifiex/Makefile
@@ -14,7 +14,10 @@
 # ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
 # this warranty disclaimer.
 

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Varnin <fenixk19@mail.ru>
To: Bing Zhao <bzhao@marvell.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: mwifiex_sdio on chromebook
Date: Mon, 04 Nov 2013 06:18:14 +0400	[thread overview]
Message-ID: <527703E6.8040504@mail.ru> (raw)
In-Reply-To: <477F20668A386D41ADCC57781B1F70430F45757E63@SC-VEXCH1.marvell.com>

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

04.11.2013 02:10, Bing Zhao пишет:
> Your Chromebook supports SDIO high speed mode (SDIO 2.0 spec). So
> 50MHz is correct.

Ok, but mainline kernel doesn't try this frequency. It tries 400kHz at
most.

> What are you trying to do here? Are you trying to run a mainline kernel on your Chromebook?

Yes. I've got kernel 3.4 from Google Chrome OS. It works ok for
mwifiex_sdio. But I want to run mainline kernel. As of 3.11 it is able
to boot on Chromebook, but WiFi doesn't work.

> You said mmc_attach_sdio function fails. The mwifiex_sdio driver and
> the firmware will not be loaded at all. 

Ok, that is clear.

> CONFIG_MMC_DEBUG=y, and collect the debug logs.  

This way seems not very useful, because there is also internal and
external storage on mmc bus, so log quickly get garbaged with it. Dmesg
seems to be overflowed and forgets early initialization. I have made a
dirty hack to collect some useful info about initialization. I am
attaching it. Please check, if I need to add something. Will it be
useful this way?

[-- Attachment #2: dirty-hack.diff --]
[-- Type: text/x-patch, Size: 3123 bytes --]

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index bf18b6b..c4a2b22 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1001,12 +1001,16 @@ EXPORT_SYMBOL(mmc_put_card);
 static inline void mmc_set_ios(struct mmc_host *host)
 {
 	struct mmc_ios *ios = &host->ios;
-
-	pr_debug("%s: clock %uHz busmode %u powermode %u cs %u Vdd %u "
+	
+	if(((char*)mmc_hostname(host))[3]=='2') {
+	  printk("%s: clock %uHz busmode %u powermode %u cs %u Vdd %u "
 		"width %u timing %u\n",
 		 mmc_hostname(host), ios->clock, ios->bus_mode,
 		 ios->power_mode, ios->chip_select, ios->vdd,
 		 ios->bus_width, ios->timing);
+	
+	  dump_stack();
+	}
 
 	if (ios->clock > 0)
 		mmc_set_ungated(host);
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 80d89cff..0773be2 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -1133,11 +1133,14 @@ int mmc_attach_sdio(struct mmc_host *host)
 	int err, i, funcs;
 	u32 ocr;
 	struct mmc_card *card;
+	
+	printk("mmc_attach_sdio 1\n");
 
 	BUG_ON(!host);
 	WARN_ON(!host->claimed);
 
 	err = mmc_send_io_op_cond(host, 0, &ocr);
+	printk("mmc_attach_sdio err %d\n", err);
 	if (err)
 		return err;
 
@@ -1166,6 +1169,8 @@ int mmc_attach_sdio(struct mmc_host *host)
 		goto err;
 	}
 
+	printk("mmc_attach_sdio 2\n");
+	
 	/*
 	 * Detect and init the card.
 	 */
@@ -1182,11 +1187,13 @@ int mmc_attach_sdio(struct mmc_host *host)
 			host->ocr &= ~R4_18V_PRESENT;
 			err = mmc_sdio_init_card(host, host->ocr, NULL, 0);
 		}
+		printk("mmc_attach_sdio 3 err %d\n", err);
 		if (err)
 			goto err;
 	}
 	card = host->card;
 
+	printk("mmc_attach_sdio 4\n");
 	/*
 	 * Enable runtime PM only if supported by host+card+board
 	 */
@@ -1195,6 +1202,7 @@ int mmc_attach_sdio(struct mmc_host *host)
 		 * Let runtime PM core know our card is active
 		 */
 		err = pm_runtime_set_active(&card->dev);
+		printk("mmc_attach_sdio 5 err %d\n", err);
 		if (err)
 			goto remove;
 
@@ -1226,6 +1234,7 @@ int mmc_attach_sdio(struct mmc_host *host)
 			pm_runtime_enable(&card->sdio_func[i]->dev);
 	}
 
+	printk("mmc_attach_sdio 6\n");
 	/*
 	 * First add the card to the driver model...
 	 */
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 018f365..342b0c4 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1917,6 +1917,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 
 	mmc->ops = &dw_mci_ops;
 	mmc->f_min = DIV_ROUND_UP(host->bus_hz, 510);
+	printk("f_min = %u;  %d", mmc->f_min, host->bus_hz);
 	mmc->f_max = host->bus_hz;
 
 	if (host->pdata->get_ocr)
diff --git a/drivers/net/wireless/mwifiex/Makefile b/drivers/net/wireless/mwifiex/Makefile
index a42a506..145f376 100644
--- a/drivers/net/wireless/mwifiex/Makefile
+++ b/drivers/net/wireless/mwifiex/Makefile
@@ -14,7 +14,10 @@
 # ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
 # this warranty disclaimer.
 
-
+CFLAGS_main.o := -DDEBUG
+CFLAGS_sdio.o := -DDEBUG
+CFLAGS_sta_cmdresp.o := -DDEBUG
+CFLAGS_wmm.o := -DDEBUG
 mwifiex-y += main.o
 mwifiex-y += init.o
 mwifiex-y += cfp.o

  parent reply	other threads:[~2013-11-04  2:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-03 13:01 mwifiex_sdio on chromebook Alexander Varnin
2013-11-03 22:10 ` Bing Zhao
2013-11-03 22:10   ` Bing Zhao
     [not found]   ` <477F20668A386D41ADCC57781B1F70430F45757E63-r8ILAu4/owuHXkj8w7BxOhL4W9x8LtSr@public.gmane.org>
2013-11-04  2:18     ` Alexander Varnin [this message]
2013-11-04  2:18       ` Alexander Varnin
2013-11-04 13:32       ` Luis R. Rodriguez
     [not found]       ` <527703E6.8040504-JGs/UdohzUI@public.gmane.org>
2013-11-04 19:46         ` Bing Zhao
2013-11-04 19:46           ` Bing Zhao
     [not found]           ` <477F20668A386D41ADCC57781B1F70430F45758053-r8ILAu4/owuHXkj8w7BxOhL4W9x8LtSr@public.gmane.org>
2013-11-05  8:38             ` Alexander Varnin
2013-11-05  8:38               ` Alexander Varnin
     [not found]               ` <5278AE8E.9060203-JGs/UdohzUI@public.gmane.org>
2013-11-05  8:53                 ` Arend van Spriel
2013-11-05  8:53                   ` Arend van Spriel
     [not found]                   ` <5278B1EC.8020000-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2013-11-05  9:12                     ` Alexander Varnin
2013-11-05  9:12                       ` Alexander Varnin
     [not found]                       ` <5278B68E.5070807-JGs/UdohzUI@public.gmane.org>
2013-11-05 16:26                         ` Paul Stewart
2013-11-05 16:26                           ` Paul Stewart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=527703E6.8040504@mail.ru \
    --to=fenixk19-jgs/udohzui@public.gmane.org \
    --cc=bzhao-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.