* Re: [PATCH] ath9k_htc: fix panic on packet injection using airbase-ng tool.
From: Luis R. Rodriguez @ 2010-08-11 15:41 UTC (permalink / raw)
To: Rajkumar Manoharan; +Cc: linville, linux-wireless, stable
In-Reply-To: <1281538663-14475-1-git-send-email-rmanoharan@atheros.com>
On Wed, Aug 11, 2010 at 7:57 AM, Rajkumar Manoharan
<rmanoharan@atheros.com> wrote:
> This should fix the oops which occurs during the packet injection
> on monitor interface.
>
> EIP is at ath9k_htc_tx_start+0x69/0x220 [ath9k_htc]
> [<f84dc8ea>] ? invoke_tx_handlers+0xa5a/0xee0 [mac80211]
> [<f82c84f4>] ? ath9k_htc_tx+0x44/0xe0 [ath9k_htc]
> [<f84db7b8>] ? __ieee80211_tx+0xf8/0x190 [mac80211]
> [<f84dce0d>] ? ieee80211_tx+0x9d/0x1a0 [mac80211]
> [<f84dcfac>] ? ieee80211_xmit+0x9c/0x1c0 [mac80211]
> [<f84dd1b5>] ? ieee80211_monitor_start_xmit+0x85/0xb0 [mac80211]
> [<c04c30cd>] ? dev_hard_start_xmit+0x1ad/0x210
> [<c04b97c2>] ? __alloc_skb+0x52/0x130
> [<c04d7cd5>] ? sch_direct_xmit+0x105/0x170
> [<c04c5e9f>] ? dev_queue_xmit+0x37f/0x4b0
> [<c0567e1e>] ? packet_snd+0x21e/0x250
> [<c05684a2>] ? packet_sendmsg+0x32/0x40
> [<c04b4c63>] ? sock_aio_write+0x113/0x130
> [<c0207934>] ? do_sync_write+0xc4/0x100
> [<c0167740>] ? autoremove_wake_function+0x0/0x50
> [<c02f4414>] ? security_file_permission+0x14/0x20
> [<c0207ad4>] ? rw_verify_area+0x64/0xe0
> [<c01e6458>] ? handle_mm_fault+0x338/0x390
> [<c0207cd5>] ? vfs_write+0x185/0x1a0
> [<c058db20>] ? do_page_fault+0x160/0x3a0
> [<c0208512>] ? sys_write+0x42/0x70
> [<c01033ec>] ? syscall_call+0x7/0xb
>
> Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Nice, you cc'd stable on the e-mail but did not add it to the commit
log. If you add it to the commit log once Linus pulls this patch in to
his tree then the stable@kernel.org list will be e-mailed notifying
them of this and then the stable team can apply the patch to stable.
John mind pegging the commit log entry, this time around?
Luis
> ---
> drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 15 ++++++++++-----
> 1 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
> index bd0b4ac..2a6e45a 100644
> --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
> @@ -78,18 +78,23 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
> struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
> struct ieee80211_sta *sta = tx_info->control.sta;
> struct ath9k_htc_sta *ista;
> - struct ath9k_htc_vif *avp;
> struct ath9k_htc_tx_ctl tx_ctl;
> enum htc_endpoint_id epid;
> u16 qnum;
> __le16 fc;
> u8 *tx_fhdr;
> - u8 sta_idx;
> + u8 sta_idx, vif_idx;
>
> hdr = (struct ieee80211_hdr *) skb->data;
> fc = hdr->frame_control;
>
> - avp = (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv;
> + if (tx_info->control.vif &&
> + (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv)
> + vif_idx = ((struct ath9k_htc_vif *)
> + tx_info->control.vif->drv_priv)->index;
> + else
> + vif_idx = priv->nvifs;
> +
> if (sta) {
> ista = (struct ath9k_htc_sta *) sta->drv_priv;
> sta_idx = ista->index;
> @@ -106,7 +111,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
> memset(&tx_hdr, 0, sizeof(struct tx_frame_hdr));
>
> tx_hdr.node_idx = sta_idx;
> - tx_hdr.vif_idx = avp->index;
> + tx_hdr.vif_idx = vif_idx;
>
> if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
> tx_ctl.type = ATH9K_HTC_AMPDU;
> @@ -169,7 +174,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
> tx_ctl.type = ATH9K_HTC_NORMAL;
>
> mgmt_hdr.node_idx = sta_idx;
> - mgmt_hdr.vif_idx = avp->index;
> + mgmt_hdr.vif_idx = vif_idx;
> mgmt_hdr.tidno = 0;
> mgmt_hdr.flags = 0;
>
> --
> 1.7.2.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH v3 9/9] omap: zoom: add mmc3/wl1271 device support
From: Ohad Ben-Cohen @ 2010-08-11 15:38 UTC (permalink / raw)
To: Roger Quadros
Cc: linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-omap@vger.kernel.org, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Tony Lindgren, Nicolas Pitre, Pandita Vikram,
Kalle Valo
In-Reply-To: <4C626140.3080107@nokia.com>
On Wed, Aug 11, 2010 at 11:37 AM, Roger Quadros <roger.quadros@nokia.com> wrote:
>> + .ocr_mask = MMC_VDD_165_195,
>
> Do we really need to specify ocr_mask here?
Removed, thanks!
^ permalink raw reply
* Re: [PATCH v3 9/9] omap: zoom: add mmc3/wl1271 device support
From: Ohad Ben-Cohen @ 2010-08-11 15:38 UTC (permalink / raw)
To: Roger Quadros
Cc: linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-omap@vger.kernel.org, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Tony Lindgren, Nicolas Pitre, Pandita Vikram,
Kalle Valo
In-Reply-To: <4C6266FE.5000904@nokia.com>
On Wed, Aug 11, 2010 at 12:01 PM, Roger Quadros <roger.quadros@nokia.com> wrote:
> Also shouldn't .nonremovable be set to true? as this is a non-removable card
> slot.
This doesn't seem to have any effect on SDIO, but it can't hurt.
Thanks!
>
> regards,
> -roger
>
^ permalink raw reply
* [PATCH] ath9k_htc: fix panic on packet injection using airbase-ng tool.
From: Rajkumar Manoharan @ 2010-08-11 14:57 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, stable, Rajkumar Manoharan
This should fix the oops which occurs during the packet injection
on monitor interface.
EIP is at ath9k_htc_tx_start+0x69/0x220 [ath9k_htc]
[<f84dc8ea>] ? invoke_tx_handlers+0xa5a/0xee0 [mac80211]
[<f82c84f4>] ? ath9k_htc_tx+0x44/0xe0 [ath9k_htc]
[<f84db7b8>] ? __ieee80211_tx+0xf8/0x190 [mac80211]
[<f84dce0d>] ? ieee80211_tx+0x9d/0x1a0 [mac80211]
[<f84dcfac>] ? ieee80211_xmit+0x9c/0x1c0 [mac80211]
[<f84dd1b5>] ? ieee80211_monitor_start_xmit+0x85/0xb0 [mac80211]
[<c04c30cd>] ? dev_hard_start_xmit+0x1ad/0x210
[<c04b97c2>] ? __alloc_skb+0x52/0x130
[<c04d7cd5>] ? sch_direct_xmit+0x105/0x170
[<c04c5e9f>] ? dev_queue_xmit+0x37f/0x4b0
[<c0567e1e>] ? packet_snd+0x21e/0x250
[<c05684a2>] ? packet_sendmsg+0x32/0x40
[<c04b4c63>] ? sock_aio_write+0x113/0x130
[<c0207934>] ? do_sync_write+0xc4/0x100
[<c0167740>] ? autoremove_wake_function+0x0/0x50
[<c02f4414>] ? security_file_permission+0x14/0x20
[<c0207ad4>] ? rw_verify_area+0x64/0xe0
[<c01e6458>] ? handle_mm_fault+0x338/0x390
[<c0207cd5>] ? vfs_write+0x185/0x1a0
[<c058db20>] ? do_page_fault+0x160/0x3a0
[<c0208512>] ? sys_write+0x42/0x70
[<c01033ec>] ? syscall_call+0x7/0xb
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
---
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index bd0b4ac..2a6e45a 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -78,18 +78,23 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ieee80211_sta *sta = tx_info->control.sta;
struct ath9k_htc_sta *ista;
- struct ath9k_htc_vif *avp;
struct ath9k_htc_tx_ctl tx_ctl;
enum htc_endpoint_id epid;
u16 qnum;
__le16 fc;
u8 *tx_fhdr;
- u8 sta_idx;
+ u8 sta_idx, vif_idx;
hdr = (struct ieee80211_hdr *) skb->data;
fc = hdr->frame_control;
- avp = (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv;
+ if (tx_info->control.vif &&
+ (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv)
+ vif_idx = ((struct ath9k_htc_vif *)
+ tx_info->control.vif->drv_priv)->index;
+ else
+ vif_idx = priv->nvifs;
+
if (sta) {
ista = (struct ath9k_htc_sta *) sta->drv_priv;
sta_idx = ista->index;
@@ -106,7 +111,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
memset(&tx_hdr, 0, sizeof(struct tx_frame_hdr));
tx_hdr.node_idx = sta_idx;
- tx_hdr.vif_idx = avp->index;
+ tx_hdr.vif_idx = vif_idx;
if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
tx_ctl.type = ATH9K_HTC_AMPDU;
@@ -169,7 +174,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
tx_ctl.type = ATH9K_HTC_NORMAL;
mgmt_hdr.node_idx = sta_idx;
- mgmt_hdr.vif_idx = avp->index;
+ mgmt_hdr.vif_idx = vif_idx;
mgmt_hdr.tidno = 0;
mgmt_hdr.flags = 0;
--
1.7.2.1
^ permalink raw reply related
* [RFC/PATCH 6/6] wireless: wl1271_sdio: enable Runtime PM
From: Ohad Ben-Cohen @ 2010-08-11 13:19 UTC (permalink / raw)
To: linux-wireless, linux-mmc
Cc: linux-arm-kernel, Luciano Coelho, akpm, Ido Yariv, San Mehat,
Roger Quadros, Nicolas Pitre, Gao Yunpeng, Ohad Ben-Cohen
In-Reply-To: <1281532770-27545-1-git-send-email-ohad@wizery.com>
Enable runtime pm for the wl1271 SDIO device.
We request power whenever the WLAN interface is brought up,
and release it after the WLAN interface is taken down.
As a result, power is released immediately after probe returns,
since at that point power has not been explicitly requested yet
(i.e. the WLAN interface is still down).
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/net/wireless/wl12xx/wl1271_sdio.c | 37 ++++++++++++++++++++++++++++-
1 files changed, 36 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c b/drivers/net/wireless/wl12xx/wl1271_sdio.c
index bfb18b6..2dede64 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
@@ -33,6 +33,7 @@
#include <linux/gpio.h>
#include <linux/platform_device.h>
#include <linux/completion.h>
+#include <linux/pm_runtime.h>
#include "wl1271.h"
#include "wl12xx_80211.h"
@@ -156,20 +157,23 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
static int wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
{
struct sdio_func *func = wl_to_func(wl);
+ int err;
/* Let the SDIO stack handle wlan_enable control, so we
* keep host claimed while wlan is in use to keep wl1271
* alive.
*/
if (enable) {
+ err = pm_runtime_get_sync(&func->dev);
sdio_claim_host(func);
sdio_enable_func(func);
} else {
sdio_disable_func(func);
sdio_release_host(func);
+ err = pm_runtime_put_sync(&func->dev);
}
- return 0;
+ return err;
}
static struct wl1271_if_operations sdio_ops = {
@@ -318,10 +322,23 @@ static int __devinit wl1271_probe(struct sdio_func *func,
sdio_set_drvdata(func, wl);
+ /* indicate to Runtime PM core that our device is active */
+ ret = pm_runtime_set_active(&func->dev);
+ if (ret)
+ goto unreg_hw;
+
+ /* enable Runtime PM.
+ * When probe will return, runtime pm will immediately release power
+ * for us since we call pm_runtime_get() only when the user brings up
+ * the WLAN interface */
+ pm_runtime_enable(&func->dev);
+
wl1271_notice("initialized");
return 0;
+unreg_hw:
+ wl1271_unregister_hw(wl);
out_irq:
free_irq(wl->irq, wl);
put_data:
@@ -346,11 +363,29 @@ static void __devexit wl1271_remove(struct sdio_func *func)
wl1271_free_hw(wl);
}
+static int wl1271_sdio_runtime_suspend(struct device *dev)
+{
+ return 0;
+}
+
+static int wl1271_sdio_runtime_resume(struct device *dev)
+{
+ return 0;
+}
+
+static const struct dev_pm_ops wl1271_sdio_pm_ops = {
+ .runtime_suspend = wl1271_sdio_runtime_suspend,
+ .runtime_resume = wl1271_sdio_runtime_resume,
+};
+
static struct sdio_driver wl1271_sdio_driver = {
.name = "wl1271_sdio",
.id_table = wl1271_devices,
.probe = wl1271_probe,
.remove = __devexit_p(wl1271_remove),
+ .drv = {
+ .pm = &wl1271_sdio_pm_ops,
+ },
};
static int __init wl1271_init(void)
--
1.7.0.4
^ permalink raw reply related
* [RFC/PATCH 5/6] sdio: enable Runtime PM for SDIO cards
From: Ohad Ben-Cohen @ 2010-08-11 13:19 UTC (permalink / raw)
To: linux-wireless, linux-mmc
Cc: linux-arm-kernel, Luciano Coelho, akpm, Ido Yariv, San Mehat,
Roger Quadros, Nicolas Pitre, Gao Yunpeng, Ohad Ben-Cohen
In-Reply-To: <1281532770-27545-1-git-send-email-ohad@wizery.com>
Before adding SDIO functions, indicate to the runtime pm core
the card is active, and enable runtime pm.
The power will be released automatically if the card
will be idle.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/mmc/core/sdio.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index ddbb9d3..498fdfb 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -10,6 +10,7 @@
*/
#include <linux/err.h>
+#include <linux/pm_runtime.h>
#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
@@ -610,6 +611,9 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
if (err)
goto remove_added;
+ pm_runtime_set_active(&host->card->dev);
+ pm_runtime_enable(&host->card->dev);
+
/*
* ...then the SDIO functions.
*/
--
1.7.0.4
^ permalink raw reply related
* [RFC/PATCH 4/6] sdio: add general runtime PM support
From: Ohad Ben-Cohen @ 2010-08-11 13:19 UTC (permalink / raw)
To: linux-wireless, linux-mmc
Cc: linux-arm-kernel, Luciano Coelho, akpm, Ido Yariv, San Mehat,
Roger Quadros, Nicolas Pitre, Gao Yunpeng, Ohad Ben-Cohen
In-Reply-To: <1281532770-27545-1-git-send-email-ohad@wizery.com>
Add generic Runtime PM handlers to sdio.
When a runtime pm event kicks in, those handlers call the
runtime pm handlers of the relevant SDIO function drivers.
Runtime PM is still disabled by default, so this patch alone
has no immediate effect.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/mmc/core/sdio_bus.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 4a890dc..2e417f9 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -14,6 +14,7 @@
#include <linux/device.h>
#include <linux/err.h>
#include <linux/slab.h>
+#include <linux/pm_runtime.h>
#include <linux/mmc/card.h>
#include <linux/mmc/sdio_func.h>
@@ -154,6 +155,14 @@ static int sdio_bus_remove(struct device *dev)
return 0;
}
+static const struct dev_pm_ops sdio_bus_pm_ops = {
+ SET_RUNTIME_PM_OPS(
+ pm_generic_runtime_suspend,
+ pm_generic_runtime_resume,
+ pm_generic_runtime_idle
+ )
+};
+
static struct bus_type sdio_bus_type = {
.name = "sdio",
.dev_attrs = sdio_dev_attrs,
@@ -161,6 +170,7 @@ static struct bus_type sdio_bus_type = {
.uevent = sdio_bus_uevent,
.probe = sdio_bus_probe,
.remove = sdio_bus_remove,
+ .pm = &sdio_bus_pm_ops,
};
int sdio_register_bus(void)
--
1.7.0.4
^ permalink raw reply related
* [RFC/PATCH 3/6] mmc: add general runtime PM support
From: Ohad Ben-Cohen @ 2010-08-11 13:19 UTC (permalink / raw)
To: linux-wireless, linux-mmc
Cc: linux-arm-kernel, Luciano Coelho, akpm, Ido Yariv, San Mehat,
Roger Quadros, Nicolas Pitre, Gao Yunpeng, Ohad Ben-Cohen
In-Reply-To: <1281532770-27545-1-git-send-email-ohad@wizery.com>
Add Runtime PM handlers to mmc, which calls mmc_power_save_host
and mmc_power_restore_host in respond to runtime_suspend and
runtime_resume events.
Runtime PM is still disabled by default, so this patch alone
has no immediate effect.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/mmc/core/bus.c | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 49d9dca..27902b4 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -14,6 +14,7 @@
#include <linux/device.h>
#include <linux/err.h>
#include <linux/slab.h>
+#include <linux/pm_runtime.h>
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
@@ -137,6 +138,39 @@ static int mmc_bus_resume(struct device *dev)
return ret;
}
+static int mmc_runtime_suspend(struct device *dev)
+{
+ int status = 0;
+ struct mmc_card *card = dev_to_mmc_card(dev);
+
+ mmc_power_save_host(card->host);
+
+ return status;
+}
+
+static int mmc_runtime_resume(struct device *dev)
+{
+ int status = 0;
+ struct mmc_card *card = dev_to_mmc_card(dev);
+
+ mmc_power_restore_host(card->host);
+
+ return status;
+}
+
+static int mmc_runtime_idle(struct device *dev)
+{
+ struct mmc_card *card = dev_to_mmc_card(dev);
+
+ return pm_runtime_suspend(dev);
+}
+
+static const struct dev_pm_ops mmc_bus_pm_ops = {
+ .runtime_suspend = mmc_runtime_suspend,
+ .runtime_resume = mmc_runtime_resume,
+ .runtime_idle = mmc_runtime_idle,
+};
+
static struct bus_type mmc_bus_type = {
.name = "mmc",
.dev_attrs = mmc_dev_attrs,
@@ -146,6 +180,7 @@ static struct bus_type mmc_bus_type = {
.remove = mmc_bus_remove,
.suspend = mmc_bus_suspend,
.resume = mmc_bus_resume,
+ .pm = &mmc_bus_pm_ops,
};
int mmc_register_bus(void)
--
1.7.0.4
^ permalink raw reply related
* [RFC/PATCH 2/6] sdio: add power_restore support
From: Ohad Ben-Cohen @ 2010-08-11 13:19 UTC (permalink / raw)
To: linux-wireless, linux-mmc
Cc: linux-arm-kernel, Luciano Coelho, akpm, Ido Yariv, San Mehat,
Roger Quadros, Nicolas Pitre, Gao Yunpeng, Ohad Ben-Cohen
In-Reply-To: <1281532770-27545-1-git-send-email-ohad@wizery.com>
Add a power_restore handler to the SDIO bus ops,
in order to support waking up SDIO cards that
were powered off by runtime pm.
Note: this approach would also require changing
the power_restore/save bus handlers to support
a return value.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/mmc/core/sdio.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 645f173..ddbb9d3 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -511,11 +511,27 @@ static int mmc_sdio_resume(struct mmc_host *host)
return err;
}
+static void mmc_sdio_power_restore(struct mmc_host *host)
+{
+ int err;
+
+ BUG_ON(!host);
+ BUG_ON(!host->card);
+
+ mmc_claim_host(host);
+ err = mmc_sdio_init_card(host, host->ocr, host->card,
+ (host->pm_flags & MMC_PM_KEEP_POWER));
+ if (!err && host->sdio_irqs)
+ mmc_signal_sdio_irq(host);
+ mmc_release_host(host);
+}
+
static const struct mmc_bus_ops mmc_sdio_ops = {
.remove = mmc_sdio_remove,
.detect = mmc_sdio_detect,
.suspend = mmc_sdio_suspend,
.resume = mmc_sdio_resume,
+ .power_restore = mmc_sdio_power_restore,
};
--
1.7.0.4
^ permalink raw reply related
* [RFC/PATCH 1/6] mmc: sdio: fully reconfigure oldcard on resume
From: Ohad Ben-Cohen @ 2010-08-11 13:19 UTC (permalink / raw)
To: linux-wireless, linux-mmc
Cc: linux-arm-kernel, Luciano Coelho, akpm, Ido Yariv, San Mehat,
Roger Quadros, Nicolas Pitre, Gao Yunpeng, Ohad Ben-Cohen
In-Reply-To: <1281532770-27545-1-git-send-email-ohad@wizery.com>
On resume, let mmc_sdio_init_card go all the way, instead
of skipping the reconfiguration of the card's speed and width.
This is needed to ensure cards wake up with their clock
reconfigured (otherwise it's kept low).
This patch also removes the explicit bus width reconfiguration
on resume, since now this is part of mmc_sdio_init_card.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/mmc/core/sdio.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index b9dee28..645f173 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -344,7 +344,6 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
goto err;
}
card = oldcard;
- return 0;
}
/*
@@ -487,9 +486,6 @@ static int mmc_sdio_resume(struct mmc_host *host)
mmc_claim_host(host);
err = mmc_sdio_init_card(host, host->ocr, host->card,
(host->pm_flags & MMC_PM_KEEP_POWER));
- if (!err)
- /* We may have switched to 1-bit mode during suspend. */
- err = sdio_enable_wide(host->card);
if (!err && host->sdio_irqs)
mmc_signal_sdio_irq(host);
mmc_release_host(host);
--
1.7.0.4
^ permalink raw reply related
* [RFC 0/6] adding SDIO Runtime PM support
From: Ohad Ben-Cohen @ 2010-08-11 13:19 UTC (permalink / raw)
To: linux-wireless, linux-mmc
Cc: linux-arm-kernel, Luciano Coelho, akpm, Ido Yariv, San Mehat,
Roger Quadros, Nicolas Pitre, Gao Yunpeng, Ohad Ben-Cohen
SDIO function drivers should be able to power down/up
their cards (e.g. a WLAN SDIO driver might want to
power down its card whenever wlan0 is down).
In the past few weeks we've been discussing how this
could be achieved, and I'd like to present a new approach,
which is based on runtime pm API.
The following few patches add runtime pm support for SDIO
devices, and demonstrate it with the wl1271_sdio driver.
Basic functionality is provided: The power state of the
device is now coupled with the state of the wlan0 interface.
The nice thing about this approach is how small it is,
as the runtime PM core is already taking care of everything
needed (usage counts, device hierarchy, established set of API,
synchronization, ...).
Having said that, I'd like to stress that these patches
are early submitted for RFC purposes only, as they
are still in a preliminary state and only lightly tested.
Please note that I will soon be leaving for the rest of August and
am going to have a very limited email access, so it might
take me some time to respond.
Appreciate your feedback,
Thank you,
Ohad Ben-Cohen (6):
mmc: sdio: fully reconfigure oldcard on resume
sdio: add power_restore support
mmc: add general runtime PM support
sdio: add general runtime PM support
sdio: enable Runtime PM for SDIO cards
wireless: wl1271_sdio: enable Runtime PM
drivers/mmc/core/bus.c | 35 +++++++++++++++++++++++++++
drivers/mmc/core/sdio.c | 24 +++++++++++++++---
drivers/mmc/core/sdio_bus.c | 10 ++++++++
drivers/net/wireless/wl12xx/wl1271_sdio.c | 37 ++++++++++++++++++++++++++++-
4 files changed, 101 insertions(+), 5 deletions(-)
^ permalink raw reply
* Re: [PATCH 3/5] mac80211: remove unused status flag checks
From: Johannes Berg @ 2010-08-11 12:39 UTC (permalink / raw)
To: Juuso Oikarinen; +Cc: John Linville, linux-wireless@vger.kernel.org
In-Reply-To: <1281528765.6475.163.camel@wimaxnb.nmp.nokia.com>
On Wed, 2010-08-11 at 15:12 +0300, Juuso Oikarinen wrote:
> > > The decryption code verifies whether or not
> > > a given frame was decrypted and verified by
> > > hardware. This is unnecessary, as the crypto
> > > RX handler already does it long before the
> > > decryption code is even invoked, so remove
> > > that code to avoid confusion.
> > >
> > > Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> > > ---
> > > net/mac80211/wpa.c | 26 ++++++--------------------
> > > 1 file changed, 6 insertions(+), 20 deletions(-)
> > >
> >
> > This patch for some reason seems to break wl1271 WPA - association
> > succeeds but encrypted data transfer fails.
> >
> > I still don't know why, but I'm looking into it.
> >
>
> It appears, that in function ieee80211_rx_h_decrypt we go here:
>
> if (!is_multicast_ether_addr(hdr->addr1) && stakey) {
> rx->key = stakey;
> /* Skip decryption if the frame is not protected. */
> if (!ieee80211_has_protected(hdr->frame_control))
> return RX_CONTINUE;
>
> And here, as the frame is protected, we go out of the if, and end up in
> tkip_decrypt, which with this patch no longer checks whether the frame
> is already decrypted.
>
> The frame then ends up dropped.
Err, you're right, sorry about that. There are too many paths here. How
about this patch?
johannes
--- wireless-testing.orig/net/mac80211/rx.c 2010-08-11 14:37:13.000000000 +0200
+++ wireless-testing/net/mac80211/rx.c 2010-08-11 14:38:13.000000000 +0200
@@ -873,6 +873,9 @@ ieee80211_rx_h_decrypt(struct ieee80211_
if (!is_multicast_ether_addr(hdr->addr1) && stakey) {
rx->key = stakey;
+ if ((status->flag & RX_FLAG_DECRYPTED) &&
+ (status->flag & RX_FLAG_IV_STRIPPED))
+ return RX_CONTINUE;
/* Skip decryption if the frame is not protected. */
if (!ieee80211_has_protected(fc))
return RX_CONTINUE;
^ permalink raw reply
* Re: [PATCH 3/5] mac80211: remove unused status flag checks
From: Juuso Oikarinen @ 2010-08-11 12:12 UTC (permalink / raw)
To: ext Johannes Berg; +Cc: John Linville, linux-wireless@vger.kernel.org
In-Reply-To: <1281527495.6475.160.camel@wimaxnb.nmp.nokia.com>
On Wed, 2010-08-11 at 13:51 +0200, Oikarinen Juuso (Nokia-MS/Tampere)
wrote:
> On Tue, 2010-08-10 at 09:46 +0200, ext Johannes Berg wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> >
> > The decryption code verifies whether or not
> > a given frame was decrypted and verified by
> > hardware. This is unnecessary, as the crypto
> > RX handler already does it long before the
> > decryption code is even invoked, so remove
> > that code to avoid confusion.
> >
> > Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> > ---
> > net/mac80211/wpa.c | 26 ++++++--------------------
> > 1 file changed, 6 insertions(+), 20 deletions(-)
> >
>
> This patch for some reason seems to break wl1271 WPA - association
> succeeds but encrypted data transfer fails.
>
> I still don't know why, but I'm looking into it.
>
It appears, that in function ieee80211_rx_h_decrypt we go here:
if (!is_multicast_ether_addr(hdr->addr1) && stakey) {
rx->key = stakey;
/* Skip decryption if the frame is not protected. */
if (!ieee80211_has_protected(hdr->frame_control))
return RX_CONTINUE;
And here, as the frame is protected, we go out of the if, and end up in
tkip_decrypt, which with this patch no longer checks whether the frame
is already decrypted.
The frame then ends up dropped.
> -Juuso
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 3/5] mac80211: remove unused status flag checks
From: Juuso Oikarinen @ 2010-08-11 11:51 UTC (permalink / raw)
To: ext Johannes Berg; +Cc: John Linville, linux-wireless@vger.kernel.org
In-Reply-To: <20100810074700.385206959@sipsolutions.net>
On Tue, 2010-08-10 at 09:46 +0200, ext Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> The decryption code verifies whether or not
> a given frame was decrypted and verified by
> hardware. This is unnecessary, as the crypto
> RX handler already does it long before the
> decryption code is even invoked, so remove
> that code to avoid confusion.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> net/mac80211/wpa.c | 26 ++++++--------------------
> 1 file changed, 6 insertions(+), 20 deletions(-)
>
This patch for some reason seems to break wl1271 WPA - association
succeeds but encrypted data transfer fails.
I still don't know why, but I'm looking into it.
-Juuso
^ permalink raw reply
* Re: [PATCH v3 8/9] omap: hsmmc: split mmc23 power control
From: Ohad Ben-Cohen @ 2010-08-11 11:01 UTC (permalink / raw)
To: Roger Quadros
Cc: Hunter Adrian (Nokia-MS/Helsinki), linux-wireless@vger.kernel.org,
linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Tony Lindgren, Nicolas Pitre, Pandita Vikram,
Kalle Valo
In-Reply-To: <4C6280DA.70205@nokia.com>
On Wed, Aug 11, 2010 at 1:52 PM, Roger Quadros <roger.quadros@nokia.com> wrote:
> On 08/11/2010 01:05 PM, Hunter Adrian (Nokia-MS/Helsinki) wrote:
>>
>> Ohad Ben-Cohen wrote:
>>>
>>> Prepare for mmc3 regulator power control by splitting the power
>>> control functions of mmc2 and mmc3, and expecting mmc3 to have
>>> a single, dedicated, regulator support.
>>
>> Why? Can't the controller be connected to an eMMC with 2 power
>> supplies? At a glance, it is not obvious why this patch is needed.
>>
> I agree with Adrian. This patch is not required at all.
>
Thanks guys, I'll check it out.
I'm about to leave until e/o August and I still have to sort out some
stuff, so I might not respond right away, but please send any comments
you may still have.
^ permalink raw reply
* Re: [PATCH v3 8/9] omap: hsmmc: split mmc23 power control
From: Roger Quadros @ 2010-08-11 10:52 UTC (permalink / raw)
To: Hunter Adrian (Nokia-MS/Helsinki)
Cc: Ohad Ben-Cohen, linux-wireless@vger.kernel.org,
linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Tony Lindgren, Nicolas Pitre, Pandita Vikram,
Kalle Valo
In-Reply-To: <4C6275F3.6030108@nokia.com>
On 08/11/2010 01:05 PM, Hunter Adrian (Nokia-MS/Helsinki) wrote:
> Ohad Ben-Cohen wrote:
>> Prepare for mmc3 regulator power control by splitting the power
>> control functions of mmc2 and mmc3, and expecting mmc3 to have
>> a single, dedicated, regulator support.
>
> Why? Can't the controller be connected to an eMMC with 2 power
> supplies? At a glance, it is not obvious why this patch is needed.
>
I agree with Adrian. This patch is not required at all.
^ permalink raw reply
* Re: [PATCH v3 6/9] omap: hsmmc: remove unused variable
From: Adrian Hunter @ 2010-08-11 10:28 UTC (permalink / raw)
To: Ohad Ben-Cohen
Cc: linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-omap@vger.kernel.org, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
Nicolas Pitre, Pandita Vikram, Kalle Valo
In-Reply-To: <AANLkTi=bB++-VU88JQTicJeYf==9qccx0HMDiz5-geyg@mail.gmail.com>
Ohad Ben-Cohen wrote:
> On Wed, Aug 11, 2010 at 12:55 PM, Adrian Hunter <adrian.hunter@nokia.com> wrote:
>> Ohad Ben-Cohen wrote:
>>> Make this go away:
>>>
>>> drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_suspend':
>>> drivers/mmc/host/omap_hsmmc.c:2328: warning: unused variable 'state'
>> Was done a while ago.
>
> Are you sure ?
Oops sorry =0_o= It is still there.
>
> I can still see the unused state variable in Linus' tree:
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/mmc/host/omap_hsmmc.c;h=b032828c61263028963bd412a7455546d5e86ce7;hb=HEAD#l2275
>
>
>> See 1a13f8fa76c880be41d6b1e6a2b44404bcbfdf9e in linus' tree.
>
> This commit only seem to adapt to the API change (the state variable
> is not removed):
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index d25b19b..b032828 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -2292,7 +2292,7 @@ static int omap_hsmmc_suspend(struct device *dev)
> }
> cancel_work_sync(&host->mmc_carddetect_work);
> mmc_host_enable(host->mmc);
> - ret = mmc_suspend_host(host->mmc, state);
> + ret = mmc_suspend_host(host->mmc);
> if (ret == 0) {
> omap_hsmmc_disable_irq(host);
> OMAP_HSMMC_WRITE(host->base, HCTL,
>
>>> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
>>> ---
>>> drivers/mmc/host/omap_hsmmc.c | 1 -
>>> 1 files changed, 0 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
>>> index b032828..d50e917 100644
>>> --- a/drivers/mmc/host/omap_hsmmc.c
>>> +++ b/drivers/mmc/host/omap_hsmmc.c
>>> @@ -2272,7 +2272,6 @@ static int omap_hsmmc_suspend(struct device *dev)
>>> int ret = 0;
>>> struct platform_device *pdev = to_platform_device(dev);
>>> struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
>>> - pm_message_t state = PMSG_SUSPEND; /* unused by MMC core */
>>> if (host && host->suspended)
>>> return 0;
>>
>
^ permalink raw reply
* Re: [PATCH v3 6/9] omap: hsmmc: remove unused variable
From: Ohad Ben-Cohen @ 2010-08-11 10:08 UTC (permalink / raw)
To: Adrian Hunter
Cc: linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-omap@vger.kernel.org, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
Nicolas Pitre, Pandita Vikram, Kalle Valo
In-Reply-To: <4C627378.2090304@nokia.com>
On Wed, Aug 11, 2010 at 12:55 PM, Adrian Hunter <adrian.hunter@nokia.com> wrote:
> Ohad Ben-Cohen wrote:
>>
>> Make this go away:
>>
>> drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_suspend':
>> drivers/mmc/host/omap_hsmmc.c:2328: warning: unused variable 'state'
>
> Was done a while ago.
Are you sure ?
I can still see the unused state variable in Linus' tree:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/mmc/host/omap_hsmmc.c;h=b032828c61263028963bd412a7455546d5e86ce7;hb=HEAD#l2275
> See 1a13f8fa76c880be41d6b1e6a2b44404bcbfdf9e in linus' tree.
This commit only seem to adapt to the API change (the state variable
is not removed):
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index d25b19b..b032828 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2292,7 +2292,7 @@ static int omap_hsmmc_suspend(struct device *dev)
}
cancel_work_sync(&host->mmc_carddetect_work);
mmc_host_enable(host->mmc);
- ret = mmc_suspend_host(host->mmc, state);
+ ret = mmc_suspend_host(host->mmc);
if (ret == 0) {
omap_hsmmc_disable_irq(host);
OMAP_HSMMC_WRITE(host->base, HCTL,
>
>>
>> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
>> ---
>> drivers/mmc/host/omap_hsmmc.c | 1 -
>> 1 files changed, 0 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
>> index b032828..d50e917 100644
>> --- a/drivers/mmc/host/omap_hsmmc.c
>> +++ b/drivers/mmc/host/omap_hsmmc.c
>> @@ -2272,7 +2272,6 @@ static int omap_hsmmc_suspend(struct device *dev)
>> int ret = 0;
>> struct platform_device *pdev = to_platform_device(dev);
>> struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
>> - pm_message_t state = PMSG_SUSPEND; /* unused by MMC core */
>> if (host && host->suspended)
>> return 0;
>
>
^ permalink raw reply related
* Re: [PATCH v3 8/9] omap: hsmmc: split mmc23 power control
From: Adrian Hunter @ 2010-08-11 10:05 UTC (permalink / raw)
To: Ohad Ben-Cohen
Cc: linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-omap@vger.kernel.org, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
Nicolas Pitre, Pandita Vikram, Kalle Valo
In-Reply-To: <1281478348-24833-9-git-send-email-ohad@wizery.com>
Ohad Ben-Cohen wrote:
> Prepare for mmc3 regulator power control by splitting the power
> control functions of mmc2 and mmc3, and expecting mmc3 to have
> a single, dedicated, regulator support.
Why? Can't the controller be connected to an eMMC with 2 power
supplies? At a glance, it is not obvious why this patch is needed.
>
> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
> ---
> arch/arm/mach-omap2/hsmmc.c | 10 ++++--
> drivers/mmc/host/omap_hsmmc.c | 67 ++++++++++++++++++++++++++++++++++++----
> 2 files changed, 66 insertions(+), 11 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index 1ef54b0..5d3d789 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -174,7 +174,7 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
> }
> }
>
> -static void hsmmc23_before_set_reg(struct device *dev, int slot,
> +static void hsmmc2_before_set_reg(struct device *dev, int slot,
> int power_on, int vdd)
> {
> struct omap_mmc_platform_data *mmc = dev->platform_data;
> @@ -325,14 +325,16 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
> c->transceiver = 1;
> if (c->transceiver && c->wires > 4)
> c->wires = 4;
> - /* FALLTHROUGH */
> - case 3:
> if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
> /* off-chip level shifting, or none */
> - mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
> + mmc->slots[0].before_set_reg = hsmmc2_before_set_reg;
> mmc->slots[0].after_set_reg = NULL;
> }
> break;
> + case 3:
> + mmc->slots[0].before_set_reg = NULL;
> + mmc->slots[0].after_set_reg = NULL;
> + break;
> default:
> pr_err("MMC%d configuration not supported!\n", c->mmc);
> kfree(mmc);
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index d50e917..6f5cea0 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -258,7 +258,7 @@ static int omap_hsmmc_1_set_power(struct device *dev, int slot, int power_on,
> return ret;
> }
>
> -static int omap_hsmmc_23_set_power(struct device *dev, int slot, int power_on,
> +static int omap_hsmmc_2_set_power(struct device *dev, int slot, int power_on,
> int vdd)
> {
> struct omap_hsmmc_host *host =
> @@ -309,6 +309,31 @@ static int omap_hsmmc_23_set_power(struct device *dev, int slot, int power_on,
> return ret;
> }
>
> +static int omap_hsmmc_3_set_power(struct device *dev, int slot, int power_on,
> + int vdd)
> +{
> + struct omap_hsmmc_host *host =
> + platform_get_drvdata(to_platform_device(dev));
> + int ret = 0;
> +
> + if (power_on) {
> + ret = mmc_regulator_set_ocr(host->vcc, vdd);
> + /* Enable interface voltage rail, if needed */
> + if (ret == 0 && host->vcc) {
> + ret = regulator_enable(host->vcc);
> + if (ret < 0)
> + ret = mmc_regulator_set_ocr(host->vcc, 0);
> + }
> + } else {
> + if (host->vcc)
> + ret = regulator_disable(host->vcc);
> + if (ret == 0)
> + ret = mmc_regulator_set_ocr(host->vcc, 0);
> + }
> +
> + return ret;
> +}
> +
> static int omap_hsmmc_1_set_sleep(struct device *dev, int slot, int sleep,
> int vdd, int cardsleep)
> {
> @@ -319,7 +344,7 @@ static int omap_hsmmc_1_set_sleep(struct device *dev, int slot, int sleep,
> return regulator_set_mode(host->vcc, mode);
> }
>
> -static int omap_hsmmc_23_set_sleep(struct device *dev, int slot, int sleep,
> +static int omap_hsmmc_2_set_sleep(struct device *dev, int slot, int sleep,
> int vdd, int cardsleep)
> {
> struct omap_hsmmc_host *host =
> @@ -358,6 +383,31 @@ static int omap_hsmmc_23_set_sleep(struct device *dev, int slot, int sleep,
> return regulator_enable(host->vcc_aux);
> }
>
> +static int omap_hsmmc_3_set_sleep(struct device *dev, int slot, int sleep,
> + int vdd, int cardsleep)
> +{
> + struct omap_hsmmc_host *host =
> + platform_get_drvdata(to_platform_device(dev));
> + int err = 0;
> +
> + /*
> + * If we don't see a Vcc regulator, assume it's a fixed
> + * voltage always-on regulator.
> + */
> + if (!host->vcc)
> + return 0;
> +
> + if (cardsleep) {
> + /* VCC can be turned off if card is asleep */
> + if (sleep)
> + err = mmc_regulator_set_ocr(host->vcc, 0);
> + else
> + err = mmc_regulator_set_ocr(host->vcc, vdd);
> + }
> +
> + return err;
> +}
> +
> static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
> {
> struct regulator *reg;
> @@ -370,10 +420,13 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
> mmc_slot(host).set_sleep = omap_hsmmc_1_set_sleep;
> break;
> case OMAP_MMC2_DEVID:
> - case OMAP_MMC3_DEVID:
> /* Off-chip level shifting, or none */
> - mmc_slot(host).set_power = omap_hsmmc_23_set_power;
> - mmc_slot(host).set_sleep = omap_hsmmc_23_set_sleep;
> + mmc_slot(host).set_power = omap_hsmmc_2_set_power;
> + mmc_slot(host).set_sleep = omap_hsmmc_2_set_sleep;
> + break;
> + case OMAP_MMC3_DEVID:
> + mmc_slot(host).set_power = omap_hsmmc_3_set_power;
> + mmc_slot(host).set_sleep = omap_hsmmc_3_set_sleep;
> break;
> default:
> pr_err("MMC%d configuration not supported!\n", host->id);
> @@ -386,9 +439,9 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
> /*
> * HACK: until fixed.c regulator is usable,
> * we don't require a main regulator
> - * for MMC2 or MMC3
> + * for MMC2
> */
> - if (host->id == OMAP_MMC1_DEVID) {
> + if (host->id != OMAP_MMC2_DEVID) {
> ret = PTR_ERR(reg);
> goto err;
> }
^ permalink raw reply
* Re: [PATCH v3 6/9] omap: hsmmc: remove unused variable
From: Adrian Hunter @ 2010-08-11 9:55 UTC (permalink / raw)
To: Ohad Ben-Cohen
Cc: linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-omap@vger.kernel.org, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Quadros Roger (Nokia-MS/Helsinki), Tony Lindgren,
Nicolas Pitre, Pandita Vikram, Kalle Valo
In-Reply-To: <1281478348-24833-7-git-send-email-ohad@wizery.com>
Ohad Ben-Cohen wrote:
> Make this go away:
>
> drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_suspend':
> drivers/mmc/host/omap_hsmmc.c:2328: warning: unused variable 'state'
Was done a while ago.
See 1a13f8fa76c880be41d6b1e6a2b44404bcbfdf9e in linus' tree.
>
> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
> ---
> drivers/mmc/host/omap_hsmmc.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index b032828..d50e917 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -2272,7 +2272,6 @@ static int omap_hsmmc_suspend(struct device *dev)
> int ret = 0;
> struct platform_device *pdev = to_platform_device(dev);
> struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
> - pm_message_t state = PMSG_SUSPEND; /* unused by MMC core */
>
> if (host && host->suspended)
> return 0;
^ permalink raw reply
* Re: [PATCH v3 9/9] omap: zoom: add mmc3/wl1271 device support
From: Roger Quadros @ 2010-08-11 9:01 UTC (permalink / raw)
To: ext Ohad Ben-Cohen
Cc: linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-omap@vger.kernel.org, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Tony Lindgren, Nicolas Pitre, Pandita Vikram,
Kalle Valo
In-Reply-To: <4C626140.3080107@nokia.com>
On 08/11/2010 11:37 AM, Roger Quadros wrote:
> On 08/11/2010 01:12 AM, ext Ohad Ben-Cohen wrote:
>> Add MMC3 support on ZOOM, which has the wl1271 device hardwired to.
>>
>> The wl1271 is a 4-wire, 1.8V, embedded SDIO WLAN device with an
>> external IRQ line, and power-controlled by a GPIO-based fixed regulator.
>>
>> Signed-off-by: Ohad Ben-Cohen<ohad@wizery.com>
>> ---
>> arch/arm/mach-omap2/board-zoom-peripherals.c | 34 ++++++++++++++++++++++++++
>> 1 files changed, 34 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
>> index de88635..82776bc 100644
>> --- a/arch/arm/mach-omap2/board-zoom-peripherals.c
>> +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
>> @@ -17,6 +17,8 @@
>> #include<linux/i2c/twl.h>
>> #include<linux/regulator/machine.h>
>> #include<linux/regulator/fixed.h>
>> +#include<linux/mmc/host.h>
>> +#include<linux/wl12xx.h>
>>
>> #include<asm/mach-types.h>
>> #include<asm/mach/arch.h>
>> @@ -29,6 +31,7 @@
>> #include "hsmmc.h"
>>
>> #define OMAP_ZOOM_WLAN_PMENA_GPIO (101)
>> +#define OMAP_ZOOM_WLAN_IRQ_GPIO (162)
>>
>> /* Zoom2 has Qwerty keyboard*/
>> static int board_keymap[] = {
>> @@ -185,6 +188,28 @@ static struct platform_device omap_vwlan_device = {
>> },
>> };
>>
>> +struct wl12xx_platform_data omap_zoom_wlan_data = {
>> + /* ZOOM ref clock is 26 MHz */
>> + .board_ref_clock = 1,
>> +};
>> +
>> +static struct resource omap_zoom_wl1271_resources[] = {
>> + {
>> + .start = OMAP_GPIO_IRQ(OMAP_ZOOM_WLAN_IRQ_GPIO),
>> + .end = OMAP_GPIO_IRQ(OMAP_ZOOM_WLAN_IRQ_GPIO),
>> + .flags = IORESOURCE_IRQ,
>> + }
>> +};
>> +static struct platform_device omap_zoom_wl1271 = {
>> + .name = "wl1271_plat.2",
>> + .id = -1,
>> + .resource = omap_zoom_wl1271_resources,
>> + .num_resources = ARRAY_SIZE(omap_zoom_wl1271_resources),
>> + .dev = {
>> + .platform_data =&omap_zoom_wlan_data,
>> + },
>> +};
>> +
>> static struct omap2_hsmmc_info mmc[] __initdata = {
>> {
>> .name = "external",
>> @@ -202,6 +227,14 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
>> .nonremovable = true,
>> .power_saving = true,
>> },
>> + {
>> + .name = "wl1271",
>> + .mmc = 3,
>> + .wires = 4,
>> + .gpio_wp = -EINVAL,
>> + .gpio_cd = -EINVAL,
>> + .ocr_mask = MMC_VDD_165_195,
>
> Do we really need to specify ocr_mask here?
> It seems to be set in omap_hsmmc_reg_get() by calling mmc_regulator_get_ocrmask().
>
> This should automatically pick the right mask if you have defined the "vmmc"
> regulator output voltage correctly.
>
Also shouldn't .nonremovable be set to true? as this is a non-removable card slot.
regards,
-roger
^ permalink raw reply
* Re: [PATCH v3 9/9] omap: zoom: add mmc3/wl1271 device support
From: Roger Quadros @ 2010-08-11 8:37 UTC (permalink / raw)
To: ext Ohad Ben-Cohen
Cc: linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-omap@vger.kernel.org, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Tony Lindgren, Nicolas Pitre, Pandita Vikram,
Kalle Valo
In-Reply-To: <1281478348-24833-10-git-send-email-ohad@wizery.com>
On 08/11/2010 01:12 AM, ext Ohad Ben-Cohen wrote:
> Add MMC3 support on ZOOM, which has the wl1271 device hardwired to.
>
> The wl1271 is a 4-wire, 1.8V, embedded SDIO WLAN device with an
> external IRQ line, and power-controlled by a GPIO-based fixed regulator.
>
> Signed-off-by: Ohad Ben-Cohen<ohad@wizery.com>
> ---
> arch/arm/mach-omap2/board-zoom-peripherals.c | 34 ++++++++++++++++++++++++++
> 1 files changed, 34 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
> index de88635..82776bc 100644
> --- a/arch/arm/mach-omap2/board-zoom-peripherals.c
> +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
> @@ -17,6 +17,8 @@
> #include<linux/i2c/twl.h>
> #include<linux/regulator/machine.h>
> #include<linux/regulator/fixed.h>
> +#include<linux/mmc/host.h>
> +#include<linux/wl12xx.h>
>
> #include<asm/mach-types.h>
> #include<asm/mach/arch.h>
> @@ -29,6 +31,7 @@
> #include "hsmmc.h"
>
> #define OMAP_ZOOM_WLAN_PMENA_GPIO (101)
> +#define OMAP_ZOOM_WLAN_IRQ_GPIO (162)
>
> /* Zoom2 has Qwerty keyboard*/
> static int board_keymap[] = {
> @@ -185,6 +188,28 @@ static struct platform_device omap_vwlan_device = {
> },
> };
>
> +struct wl12xx_platform_data omap_zoom_wlan_data = {
> + /* ZOOM ref clock is 26 MHz */
> + .board_ref_clock = 1,
> +};
> +
> +static struct resource omap_zoom_wl1271_resources[] = {
> + {
> + .start = OMAP_GPIO_IRQ(OMAP_ZOOM_WLAN_IRQ_GPIO),
> + .end = OMAP_GPIO_IRQ(OMAP_ZOOM_WLAN_IRQ_GPIO),
> + .flags = IORESOURCE_IRQ,
> + }
> +};
> +static struct platform_device omap_zoom_wl1271 = {
> + .name = "wl1271_plat.2",
> + .id = -1,
> + .resource = omap_zoom_wl1271_resources,
> + .num_resources = ARRAY_SIZE(omap_zoom_wl1271_resources),
> + .dev = {
> + .platform_data =&omap_zoom_wlan_data,
> + },
> +};
> +
> static struct omap2_hsmmc_info mmc[] __initdata = {
> {
> .name = "external",
> @@ -202,6 +227,14 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
> .nonremovable = true,
> .power_saving = true,
> },
> + {
> + .name = "wl1271",
> + .mmc = 3,
> + .wires = 4,
> + .gpio_wp = -EINVAL,
> + .gpio_cd = -EINVAL,
> + .ocr_mask = MMC_VDD_165_195,
Do we really need to specify ocr_mask here?
It seems to be set in omap_hsmmc_reg_get() by calling mmc_regulator_get_ocrmask().
This should automatically pick the right mask if you have defined the "vmmc"
regulator output voltage correctly.
regards,
-roger
^ permalink raw reply
* Re: [PATCH v3 8/9] omap: hsmmc: split mmc23 power control
From: Roger Quadros @ 2010-08-11 8:30 UTC (permalink / raw)
To: ext Ohad Ben-Cohen
Cc: linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-omap@vger.kernel.org, Mark Brown,
linux-arm-kernel@lists.infradead.org,
Chikkature Rajashekar Madhusudhan,
Coelho Luciano (Nokia-MS/Helsinki), akpm@linux-foundation.org,
San Mehat, Tony Lindgren, Nicolas Pitre, Pandita Vikram,
Kalle Valo
In-Reply-To: <1281478348-24833-9-git-send-email-ohad@wizery.com>
Hi Ohad,
On 08/11/2010 01:12 AM, ext Ohad Ben-Cohen wrote:
> Prepare for mmc3 regulator power control by splitting the power
> control functions of mmc2 and mmc3, and expecting mmc3 to have
> a single, dedicated, regulator support.
>
> Signed-off-by: Ohad Ben-Cohen<ohad@wizery.com>
> ---
> arch/arm/mach-omap2/hsmmc.c | 10 ++++--
> drivers/mmc/host/omap_hsmmc.c | 67 ++++++++++++++++++++++++++++++++++++----
> 2 files changed, 66 insertions(+), 11 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
> index 1ef54b0..5d3d789 100644
> --- a/arch/arm/mach-omap2/hsmmc.c
> +++ b/arch/arm/mach-omap2/hsmmc.c
> @@ -174,7 +174,7 @@ static void omap4_hsmmc1_after_set_reg(struct device *dev, int slot,
> }
> }
>
> -static void hsmmc23_before_set_reg(struct device *dev, int slot,
> +static void hsmmc2_before_set_reg(struct device *dev, int slot,
> int power_on, int vdd)
> {
> struct omap_mmc_platform_data *mmc = dev->platform_data;
> @@ -325,14 +325,16 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
> c->transceiver = 1;
> if (c->transceiver&& c->wires> 4)
> c->wires = 4;
> - /* FALLTHROUGH */
> - case 3:
> if (mmc->slots[0].features& HSMMC_HAS_PBIAS) {
> /* off-chip level shifting, or none */
> - mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
> + mmc->slots[0].before_set_reg = hsmmc2_before_set_reg;
> mmc->slots[0].after_set_reg = NULL;
> }
> break;
> + case 3:
> + mmc->slots[0].before_set_reg = NULL;
> + mmc->slots[0].after_set_reg = NULL;
> + break;
> default:
> pr_err("MMC%d configuration not supported!\n", c->mmc);
> kfree(mmc);
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index d50e917..6f5cea0 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -258,7 +258,7 @@ static int omap_hsmmc_1_set_power(struct device *dev, int slot, int power_on,
> return ret;
> }
>
> -static int omap_hsmmc_23_set_power(struct device *dev, int slot, int power_on,
> +static int omap_hsmmc_2_set_power(struct device *dev, int slot, int power_on,
> int vdd)
> {
> struct omap_hsmmc_host *host =
> @@ -309,6 +309,31 @@ static int omap_hsmmc_23_set_power(struct device *dev, int slot, int power_on,
> return ret;
> }
>
> +static int omap_hsmmc_3_set_power(struct device *dev, int slot, int power_on,
> + int vdd)
> +{
> + struct omap_hsmmc_host *host =
> + platform_get_drvdata(to_platform_device(dev));
> + int ret = 0;
> +
> + if (power_on) {
> + ret = mmc_regulator_set_ocr(host->vcc, vdd);
> + /* Enable interface voltage rail, if needed */
Why is this needed? In this case interface voltage rail seems to be the same as
card supply.
If you notice mmc_regulator_set_ocr code, it is doing the regulator enable, so
don't need to enable it again below.
> + if (ret == 0&& host->vcc) {
> + ret = regulator_enable(host->vcc);
> + if (ret< 0)
> + ret = mmc_regulator_set_ocr(host->vcc, 0);
> + }
> + } else {
> + if (host->vcc)
> + ret = regulator_disable(host->vcc);
> + if (ret == 0)
> + ret = mmc_regulator_set_ocr(host->vcc, 0);
> + }
> +
> + return ret;
> +}
All This can be replaced to the following to simply
if (power_on) {
return mmc_regulator_set_ocr(host->vcc, vdd);
else
return mmc_regulator_set_ocr(host->vcc, 0);
regards,
-roger
^ permalink raw reply
* Re: RTL 8187b - naughty behaviour
From: Larry Finger @ 2010-08-11 2:51 UTC (permalink / raw)
To: Thadeu Lima de Souza Cascardo
Cc: Rogerio Luz Coelho, Gábor Stefanik, linux-wireless,
Herton Ronaldo Krzesinski
In-Reply-To: <20100811002355.GB5874@barata.holoscopio.com>
On 08/10/2010 07:23 PM, Thadeu Lima de Souza Cascardo wrote:
>
> I've been working for some two weeks observing the behaviour of
> rtl8187B. Thanks to someone's report (I think it was Rogerio's), I found
> the realtek driver. It does seem to work a little better regarding
> transmission. I have taken a look at the driver (it's GPLed) and done
> some experiments, but couldn't find any particular difference that
> magically make it work yet.
>
> I think the mmiotrace is not exactly what you want. Since these are USB
> devices, usbmon dumps are much more readable and useful. I've made some
> of my own, but still need to write some scripts to translate them to
> something I can read and compare more easily.
>
> As soon as I get some patches that work for me and are field tested for
> these particular device versions, I will send them to the list for
> review and testing with other device versions.
>
> Larry, you mentioned in one of your messages about the specs. Are they
> under an NDA or could you provide or ask for a copy?
The spec sheets I have gotten from Realtek are minimal, but I do not have the
right to redistribute them.
> At a glance, the realtek driver seems to do some dynamic power gain
> control. I will try this as one of my next steps.
That sounds like a promising place to start.
Larry
^ permalink raw reply
* Re: [WTF, maintainers] Re: *PING* iwlagn 2.6.35: "BA scd_flow 0 does not match txq_id 10" regression
From: Andrew Lutomirski @ 2010-08-11 1:54 UTC (permalink / raw)
To: Guy, Wey-Yi; +Cc: linux-wireless@vger.kernel.org, linville@tuxdriver.com
In-Reply-To: <1281481505.20038.10.camel@wwguy-ubuntu>
On Tue, Aug 10, 2010 at 7:05 PM, Guy, Wey-Yi <wey-yi.w.guy@intel.com> wrote:
> Hi Andrew,
>
> On Tue, 2010-08-10 at 14:39 -0700, Andrew Lutomirski wrote:
>> On Mon, Jul 26, 2010 at 4:02 PM, Andrew Lutomirski <luto@mit.edu> wrote:
>> > There's a regression in 2.6.35 where the connection breaks and iwlagn
>> > writes a bunch of:
>> >
>> > iwlagn 0000:03:00.0: BA scd_flow 0 does not match txq_id 10
>> >
>> > This is confirmed [1] and a patch supposedly exists. Since this
>> > breaks at least two people's wireless and 2.6.35 is about to be
>> > released, can we see the patches?
>> >
>> > Thanks,
>> > Andy
>> >
>> > [1] http://article.gmane.org/gmane.linux.kernel.wireless.general/53552
>> >
>>
>> This regression was reported on July 21 and confirmed, supposedly with
>> a patch available, on July 24 (or maybe July 23). On July 26 I pinged
>> the list because I'm affected as well.
>>
>> It's now August 10 and both 2.6.35 and 2.5.35.1 have been released and
>> the bug is still there. WTF happened? (I admit I haven't actually
>> tested 2.6.35.1 because it's still compiling, but I see nothing to
>> suggest that it's been fixed.)
>>
>
> Sorry for the delay, the problem you report is a real problem in our
> uCode; unfortunately, we still not root cause the real problem yet. The
> patch I provide previous just a hack and still waiting for our internal
> validation team to make sure it did not break the overall behaviors.
Fair enough.
>
> I will submit the patch as soon as I got the report back from our test
> team; at the meantime, we are very active work on root cause the real
> problem. Once we have the possible solution, it will be great if you can
> help us to verify it.
>
I'll do my best, but I'm don't know how easily I can reproduce this.
I only rarely get the messages, but I have random problems connecting
fairly frequently.
--Andy
> Best regards
> Wey
>>
>> P.S. iwlagn malfunctions for me *all the time*. I'd love to help
>> debug but it's hard when no one pays attention and when the bugs are
>> all hard to trigger. Any volunteers to help?
>
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox