aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSumit Semwal <sumit.semwal@linaro.org>2015-06-01 12:44:44 +0530
committerAmit Pundir <amit.pundir@linaro.org>2015-06-08 11:13:17 +0530
commit17b3b28baf84999421d56dce68c4b1c1ec7f1ef3 (patch)
tree137bdd42efcd74419ff1344e70bbbc4728d94f5b /drivers
parent05b7504d11ce32148c4f73656936fa34375f377f (diff)
fix: align closely to AOSP.
To support Android on a member platform, LMG carry forwarded quiet a few (200+) aosp/android-3.10 patches to linaro-android-3.14-lsk tree when aosp/android-3.14 was not announced. There are few gaps in our forward-ported branch from 3.10->3.14, and how AOSP is maintaining the patches. This consolidated patch help align our tree with AOSP, unless we've added some fixes. Listed below are file-wise changes and rationale behind them: - arch/arm/Kconfig: c0cc1d84: seccomp revert is missing from AOSP, potentially because of cleaner seccomp patches => Align with AOSP. - arch/arm/mm/mmu.c: 97b095e5: "ARM: mm: Split memory banks that span multiple sections when sparsemem is enabled" doesn't seem required anymore, and isn't added to AOSP => Align with AOSP. - arch/arm64/Kconfig: 27aa5398: "arm64: a backwards compatible config option", and 8354fc2d: "arm64: cpuinfo: ARMv7 compatable cpuinfo option" are reverted in AOSP trees => Remove and align with AOSP - arch/arm64/include/asm/debug-monitors.h: Minor differences with AOSP merge v/s ours => Align with AOSP - arch/mips/include/uapi/asm/unistd.h: 598966e MIPS: add seccomp syscall has merge differences between AOSP and ours => Align with AOSP. - drivers/mmc/core/core.c: drivers/mmc/core/host.c: include/linux/mmc/host.h: 2f76feb mmc: core: host: only use wakelock for detect work by Colin Cross: was present in 3.10,and so in fwd-port; Missing from 3.14/3.18; it als introduced a memory leak w/ TI => Align with AOSP by reverting the above commit - drivers/usb/gadget/f_accessory.c: feee075e: "usb: gadget: f_accessory: fix missing NULL pointer check" by Amit Pundir that was being carried in linaro-fixes isn't required anymore due to the AOSP merged fix. => Align with AOSP. - drivers/usb/gadget/u_ether.c: minor code rearrangement during our merge => ALIGN with AOSP. - include/net/bluetooth/hci.h: include/net/bluetooth/hci_core.h: net/bluetooth/hci_conn.c: net/bluetooth/hci_event.c: net/bluetooth/rfcomm/core.c: => BT Patches not in 3.14/3.18; ALIGN with AOSP. - include/net/netfilter/ipv4/nf_reject.h: include/net/netfilter/ipv6/nf_reject.h: net/ipv4/netfilter/Kconfig: net/ipv6/netfilter/Kconfig: 8d83a89758: netfilter: have ip*t REJECT set the sock err when an icmp is to be sent: NOT in 3.14/3.18 => ALIGN with AOSP - include/uapi/asm-generic/unistd.h: 08f6b117d: seccomp: add "seccomp" syscall has merge differences between our merge and AOSP's => ALIGN with AOSP - kernel/irq/pm.c: c2d35c6 irq: pm: Remove unused variable by Dmitry Shmidt => ALIGN with AOSP. - kernel/power/wakelock.c: 11388c8 PM / Sleep: Require CAP_BLOCK_SUSPEND to use wake_lock/wake_unlock by Rafael J. Wysocki has merge differences between our merge and AOSP's => ALIGN with AOSP - kernel/sys.c: 77d83f8d: prctl: adds PR_SET_TIMERSLACK_PID for setting timer slack of an arbitrary thread has merge differences between our merge and AOSP's => ALIGN with AOSP - net/wireless/Kconfig: net/wireless/sme.c: CONFIG_CFG80211 related patches are not in 3.14/3.18 AOSP => ALIGN with AOSP Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/core/core.c23
-rw-r--r--drivers/mmc/core/host.c3
-rw-r--r--drivers/usb/gadget/f_accessory.c3
-rw-r--r--drivers/usb/gadget/u_ether.c22
4 files changed, 24 insertions, 27 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 2a1cc36b3ace..11655e90be53 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -63,6 +63,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(mmc_blk_rw_end);
#define MMC_BKOPS_MAX_TIMEOUT (4 * 60 * 1000) /* max time to wait in ms */
static struct workqueue_struct *workqueue;
+static struct wake_lock mmc_delayed_work_wake_lock;
static const unsigned freqs[] = { 400000, 300000, 200000, 100000 };
/*
@@ -96,6 +97,7 @@ MODULE_PARM_DESC(
static int mmc_schedule_delayed_work(struct delayed_work *work,
unsigned long delay)
{
+ wake_lock(&mmc_delayed_work_wake_lock);
return queue_delayed_work(workqueue, work, delay);
}
@@ -1726,8 +1728,6 @@ static void _mmc_detect_change(struct mmc_host *host, unsigned long delay,
pm_wakeup_event(mmc_dev(host), 5000);
host->detect_change = 1;
-
- wake_lock(&host->detect_wake_lock);
mmc_schedule_delayed_work(&host->detect, delay);
}
@@ -2511,13 +2511,11 @@ void mmc_rescan(struct work_struct *work)
out:
if (extend_wakelock)
- wake_lock_timeout(&host->detect_wake_lock, HZ / 2);
+ wake_lock_timeout(&mmc_delayed_work_wake_lock, HZ / 2);
else
- wake_unlock(&host->detect_wake_lock);
- if (host->caps & MMC_CAP_NEEDS_POLL) {
- wake_lock(&host->detect_wake_lock);
+ wake_unlock(&mmc_delayed_work_wake_lock);
+ if (host->caps & MMC_CAP_NEEDS_POLL)
mmc_schedule_delayed_work(&host->detect, HZ);
- }
}
void mmc_start_host(struct mmc_host *host)
@@ -2541,8 +2539,7 @@ void mmc_stop_host(struct mmc_host *host)
#endif
host->rescan_disable = 1;
- if (cancel_delayed_work_sync(&host->detect))
- wake_unlock(&host->detect_wake_lock);
+ cancel_delayed_work_sync(&host->detect);
mmc_flush_scheduled_work();
/* clear pm flags now and let card drivers set them as needed */
@@ -2699,8 +2696,7 @@ int mmc_pm_notify(struct notifier_block *notify_block,
spin_lock_irqsave(&host->lock, flags);
host->rescan_disable = 1;
spin_unlock_irqrestore(&host->lock, flags);
- if (cancel_delayed_work_sync(&host->detect))
- wake_unlock(&host->detect_wake_lock);
+ cancel_delayed_work_sync(&host->detect);
if (!host->bus_ops)
break;
@@ -2776,6 +2772,9 @@ static int __init mmc_init(void)
if (!workqueue)
return -ENOMEM;
+ wake_lock_init(&mmc_delayed_work_wake_lock, WAKE_LOCK_SUSPEND,
+ "mmc_delayed_work");
+
ret = mmc_register_bus();
if (ret)
goto destroy_workqueue;
@@ -2796,6 +2795,7 @@ unregister_bus:
mmc_unregister_bus();
destroy_workqueue:
destroy_workqueue(workqueue);
+ wake_lock_destroy(&mmc_delayed_work_wake_lock);
return ret;
}
@@ -2806,6 +2806,7 @@ static void __exit mmc_exit(void)
mmc_unregister_host_class();
mmc_unregister_bus();
destroy_workqueue(workqueue);
+ wake_lock_destroy(&mmc_delayed_work_wake_lock);
}
subsys_initcall(mmc_init);
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 2c886ae34198..cc3164a939eb 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -481,8 +481,6 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
spin_lock_init(&host->lock);
init_waitqueue_head(&host->wq);
- wake_lock_init(&host->detect_wake_lock, WAKE_LOCK_SUSPEND,
- kasprintf(GFP_KERNEL, "%s_detect", mmc_hostname(host)));
INIT_DELAYED_WORK(&host->detect, mmc_rescan);
#ifdef CONFIG_PM
host->pm_notify.notifier_call = mmc_pm_notify;
@@ -582,7 +580,6 @@ void mmc_free_host(struct mmc_host *host)
spin_lock(&mmc_host_lock);
idr_remove(&mmc_host_idr, host->index);
spin_unlock(&mmc_host_lock);
- wake_lock_destroy(&host->detect_wake_lock);
put_device(&host->class_dev);
}
diff --git a/drivers/usb/gadget/f_accessory.c b/drivers/usb/gadget/f_accessory.c
index dcedeb4b2fef..0237f1e059b4 100644
--- a/drivers/usb/gadget/f_accessory.c
+++ b/drivers/usb/gadget/f_accessory.c
@@ -1204,8 +1204,7 @@ err:
static void acc_disconnect(void)
{
/* unregister all HID devices if USB is disconnected */
- if (_acc_dev)
- kill_all_hid_devices(_acc_dev);
+ kill_all_hid_devices(_acc_dev);
}
static void acc_cleanup(void)
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index bf6589eb7cb5..28b291a4e0e5 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -875,17 +875,6 @@ static int get_ether_addr(const char *str, u8 *dev_addr)
return 1;
}
-static int get_host_ether_addr(u8 *str, u8 *dev_addr)
-{
- memcpy(dev_addr, str, ETH_ALEN);
- if (is_valid_ether_addr(dev_addr))
- return 0;
-
- random_ether_addr(dev_addr);
- memcpy(str, dev_addr, ETH_ALEN);
- return 1;
-}
-
static int get_ether_addr_str(u8 dev_addr[ETH_ALEN], char *str, int len)
{
if (len < 18)
@@ -897,6 +886,17 @@ static int get_ether_addr_str(u8 dev_addr[ETH_ALEN], char *str, int len)
return 18;
}
+static int get_host_ether_addr(u8 *str, u8 *dev_addr)
+{
+ memcpy(dev_addr, str, ETH_ALEN);
+ if (is_valid_ether_addr(dev_addr))
+ return 0;
+
+ random_ether_addr(dev_addr);
+ memcpy(str, dev_addr, ETH_ALEN);
+ return 1;
+}
+
static const struct net_device_ops eth_netdev_ops = {
.ndo_open = eth_open,
.ndo_stop = eth_stop,