Currently, RMNET will restart the TX queue after receiving a
low-watermark notification from SMUX. This just clears the XOFF bit,
but does not reschedule the TX thread in the Linux TCP/IP stack. This
means that the next TX operation will not take place until the thread is
scheduled by some other means which may take up to 5 seconds.
Instead, wake the queue which clears the XOFF bit and schedules the TX
thread to allow transmission to continue immediately.
(cherry picked from commit 4d8fb2ecb3a9cdab3e9d605280256c6b46773dd0)
CRs-Fixed: 412758
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Change-Id: I1f169547f3ff518baada632d5a3f766b5795c697
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
This ioctl provides a shorter route to enable/disable flow
on a given qdisc when compared to the traditional NETLINK
based communication. It is known to improve throughput when
data flow is throttled at a higher rate.
Change-Id: I8533887c8a7caffe3b17320dc044f28388ba8b83
CRs-Fixed: 355156
Acked-by: Jimi Shah <jimis@qualcomm.com>
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>
(cherry picked from commit 747a936d6fd1d49331b0891df6797144eec56e23)
(cherry picked from commit cfa440e0faf9b6cd8bc313c750fd0713490f3d94)
Declaring completion variables, card_rem_event_var and shutdown_event_var
as global variables, because we observed these completion variables,
getting freed while wait on these variables.
Change-Id: Iec4e913d58fafa4804ae0b2d34e15460b4f7d0b1
CRs-Fixed: 393414
Signed-off-by: c_gowri <deepthi@codeaurora.org>
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
If multiple packets are written quickly and the high watermark is
exceeded, then the -EAGAIN return code is returned (A) and the code is
checked and the tx processing is throttled (B) until a low-watermark
notification is received (C). If the packet queue is
drained and the low-watermark notification is delivered between steps
(A) and (B), then the order of events will be ACB and the tx queue will
be permanently stalled.
To fix this, a spinlock is held to ensure that the sequence is always
either ABC.
CRs-Fixed: 401544
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
(cherry picked from commit cb24b09ebcf924b43e14cfbf78dcc29c98f3a79b)
Change-Id: I729333f7d6cf7f0c1b39518705571b744ee4b924
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
747a936d6fd1d49331b0891df6797144eec56e23 added dependencies on networking
quality of service modules into msm_rmnet_bam. Properly enumerate those
dependencies in the MSM_RMNET_BAM Kconfig item
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
(cherry picked from commit 2696715ce8dea4f8150e4a7ab8ce1f6286be840b)
Change-Id: Idd74913e5ed0dc8c21c9620560e0fb21edab45ab
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
Allow the ks8851 driver to configure regulators and GPIOs
specified as platform data or in device tree.
Change-Id: I806f7c22ba4b75eb26720704968cdec9cd7796c8
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
(cherry picked from commit c990b2faa3ce0b4f2361630a687abdedee4241a9)
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
The regulator power grid changes slightly when using a PM8917 in
place of a PM8921 on 8064 targets. Add configuration data so
that regulators present only on PM8917 are registered when a
PM8917 chip is detected. Also remove PM8921 only regulators when
PM8917 is detected. Modify the USB OTG MVS supply chain to
handle the replacement of an external 5V boost regulator with the
boost present inside of the PM8917.
Increase the max_uV value requested in the wlan_riva driver for
the iris_vdddig supply to 1225000 in order to handle the case of
this supply coming from the S1 regulator in the PM8917
configuration. The S1 regulator only supports 1225000 uV.
Change-Id: Ib5ffa76cbc4590f468003c6863ba73807c4879e7
Signed-off-by: David Collins <collinsd@codeaurora.org>
(cherry picked from commit 793793b277040989d494921ac12cd4bf99939b76)
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
usbnet_terminate_urbs() defines waitqueue head as local variable.
There is a possibility that wake_up is called on this queue head
in workqueue context and usbnet_terminate_urbs() already returned
or dev->wait pointer becomes NULL while calling wake_up() from
workqueue context. Hence call wake_up() using waitqueue head
defined as static global variable.
Change-Id: I672460533d25589912a847acad2df01f193a120d
CRs-Fixed: 388724
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
When the device is in the midst of being disconnected, calls to
usb_autopm_get_interface() may fail, and a ERR-level message is
printed. Callers of such I/O functions may repeatedly try calling
again, and could end up flooding the console leading to a watchdog
timeout. Replace these printks with DBG-level messages since the
device disconnection is normal and the errors they indicate are
usually benign.
Change-Id: I03045e866c0b35bd1a698d91c12661c6df660d25
CRs-fixed: 394256
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
During interface resume rmnet control driver submits interrupt URB
only if QMI channel is opened by userspace. There is a possibility
that interface is resuming from suspend and QMI channel is still not
opened, in that case interrupt URB will never get submitted again.
Hence always submit the interrupt URB and do not depend on if userspace
has opened the QMI channel.
CRs-Fixed: 388611
Change-Id: Iffe203dee3b3f757affbba3cd9dd12e2cd260d34
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
A recent change in the kernel disabled USB root hubs' wakeup
capability by default. This forces the setting for this particular
device/hub combination to always enable remote wakeup.
Change-Id: If7ef1e731e71feb9730a67b2d912f03890e7210d
Signed-off-by: Jack Pham <jackp@codeaurora.org>
wcnss related host drivers can use these APIs to prevent Apps suspend.
WLAN driver uses this API to prevent suspend, when it's module
initialization routines are being executed.
Change-Id: Id072804e6ccc953c78caf6cf11c73e0ea1d71d18
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
Add struct virtqueue_ops back into the virtio core code to facilitate
the use of virtqueue implementations other than vrings. This allows
virtqueue implementations that use SMD drivers, USB drivers, or other
mechanisms for transport.
Add a new virtqueue operation, virtqueue_get_impl_size, to provide the
functionality of virtqueue_get_vring_size from the previous collapsed
implementation.
This commit partially reverts commit
7c5e9ed0c8.
Change-Id: I1219c4f203879658dce5800f405291bf311564b4
Signed-off-by: Yatin Manerkar <yatinm@codeaurora.org>
APPS vote from coldboot may be still pending when SSR is invoked;
so make sure that the APPS votes from coldboot are cancelled before
SSR votes for these Riva regulators.
Change-Id: I975be7470ce08e941c5846642a9379f23574915b
CRs-fixed: 380434
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
usbnet driver uses tasklet as bottom half handler. Since tasklet
runs in interrupt context in case of high throughput driver is
spending more time in interrupt context to process rx buffers
this is causing watch dog reset. Hence replace the tasklet with
workqueue to avoid watchdog reset.
CRs-Fixed: 378526
Change-Id: I8eac339e37d734dbaaf7a2e874d3974f562e8680
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
The call to enable autosuspend was recently removed from the
qcserial driver. Re-add it here in the RmNet driver as we know
this device will support it.
Change-Id: Iee1d1dbece01eaab99b03c64ebea0fd5ed87eafa
Signed-off-by: Jack Pham <jackp@codeaurora.org>
This change implements poll system call for consumer of
rx QMI control channel in userspace.
CRs-Fixed: 375641
Change-Id: I2886897d7196bfce29020b17c21862c5a6f02be0
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Set the flag that enables the host controller to send zero-length
packets if the payload size is a multiple of the max packet size
(typically 512 bytes) in order to avoid cases in which the device
may stall while waiting for more data.
CRs-fixed: 373737
Change-Id: I779d00837a12bcd1d7df12b77ac1f1f5aab0fe68
Signed-off-by: Jack Pham <jackp@codeaurora.org>
If user space consumer of QMI channels restarts, channels get closed
and opened again. Closing QMI channel stops submitting rx URBs which
is not getting re-submitted during channel open. Since userspace
consumer automatically restarts in case if it gets killed, do not kill
the rx URBs upon channel close.
CRs-Fixed: 370712
Change-Id: Ia58aaefd5245b07640fe2ec5eb2ec5fe1ae43cd4
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
RMNET control driver sets the device interface pointer to NULL
during disconnect and then unlinks the tx URBs. This causes the
tx completion handler to get called and access the device interface
pointer which is already NULL. Fix the issue by adding a flag
which keeps track of device disconnection and do not set device
interface pointer to NULL.
CRs-Fixed: 373617
Change-Id: I4991c1f437f1ce031c634109aca10e170ca6290b
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Override the default autosuspend delay of 4 seconds--that is, 2
seconds for device and 2 seconds for the root hub, to 1s for the
HSIC-connected MDM device and 200ms for the root hub. This should
minimize the time spent active for better power savings.
CRs-fixed: 353213
Change-Id: Idfa49928dbb7fd2508deec0b9fab25e1cbcdf078
Signed-off-by: Jack Pham <jackp@codeaurora.org>
RMNET QMI driver does not prevent auto suspend while submitting
the URB on rx control path. This causes the usb device to go to
low power mode after receiving QMI notification as the auto suspend
timer does not get reset by the driver while submitting the URB
and it expires.
CRs-Fixed: 372251
Change-Id: Idb5c377c09d39ff53d4fac32599d6515ceb3da51
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Use the usb_interface's dev member for dev_printk instead of the
usb_device's, as this will help improve kernel logging clarity by
displaying the interface name and number as well as just the USB
bus/device numbers.
Change-Id: I677558fd6c33ee658ef03fdcbb25bb5c0782f77b
Signed-off-by: Jack Pham <jackp@codeaurora.org>
This is the initial version of the Wireless ConNectivity SubSystem (WCNSS)
WLAN driver. The WCNSS is a new Hardware integrating WLAN, BT and FM
technologies that is built into new MSM chip. This version of the driver
does basic WLAN device detection, WLAN SMD channel allocation probing and
trigger the PIL to download the WCNSS SW image.
Change-Id: I054566453152e8d8d02f79693e6a51f26d047835
Acked-by: Jeff Johnson <jjohnson@qualcomm.com>
Signed-off-by: Yunsen Wang <yunsenw@codeaurora.org>
CONFIG_ATH6K_LEGACY is added to support QCA AR6003 (Non cfg80211).
AR6003 driver needs WIRELESS_EXT support. WIRELESS_EXT is going to
be deprecated so adding it to defconfig will not work. Driver needs
to mark it as dependency.
Change-Id: I09c1f07ea15b8de75c1ed35d4fec6c82265018a9
Acked-by: Prasanth Bhatta <c_bhatta@qca.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Libra SDIO Interface driver module. Adds interface functions
to interact with the SD/MMC bus driver.
Acked-by: Anuradha Chandramouli <chandram@qualcomm.com>
Signed-off-by: Yunsen Wang <yunsenw@quicinc.com>
usbnet driver does not prevent auto suspend while submitting
the URB on rx data path. This causes the usb device to go to low power
mode in the middle of the downlink data transfer as the auto suspend
timer does not get reset by the driver while submitting the URB and
it expires.
Change-Id: Ibd3ac709e7103eb3df91ce3318dba6da4e551366
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Embedded rmnet usb host driver will be used to communicate with modem
devices having rmnet interface. This driver works as pass through layer
for control and data path communication. Driver currently supports device
with product id: 0x9034 and vendor id : 0x05c6.
Change-Id: Ie037af915f2650828420a351bd3fe503a505eaee
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Change the request_irq call to request_any_context_irq, in order
to properly handle nested-interrupt setups.
Change-Id: If3e29836a7223244c5e18563e07c14570c865bf8
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
Add hooks to control the relevant Gpio pin from
the Ethernet driver. This allows the driver to drive the
GPIO line low or high during suspend and resume for
power management.
Change-Id: Idfcf547501198d155d314a30923fd4de440840a9
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
RMNET over SMUX will support IP Traffic over HSUART. This is used in
Fusion 4 target between Application processor and QSC modem.
Change-Id: I50a8acf96dc85d10e574768dc21db672b6615924
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
The BAM Data Mux driver serves as a muxing interface layer to the SPS BAM
driver for RMNET.
Change-Id: Ia8aabb1874955342b4829ddb4e70a01a84c16d5f
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
Module to allow RMNET over SDIO link. As multiple rmnet ports
need to use single SDIO line (function), muxing of the rmnet
packets is required.
Change-Id: I0b0cea7a2135ba4afdc00ce4faf6a28fda5dc929
Signed-off-by: Niranjana Vishwanathapura <nvishwan@codeaurora.org>
The MSM7X00A baseband makes up to 3 "virtual ethernet" channels available,
which allow ethernet packets to be exchanged with the cellular network, once
an appropriate data connection is established.
Signed-off-by: Brian Swetland <swetland@google.com>
Signed-off-by: San Mehat <san@android.com>
[ARM] msm_rmnet: HACK: do not count ARP packets
The android network traffic watchdog is tricked into thinking that
data traffic is working at times when it isn't, due to ARP traffic
between the apps and modem processor. Don't count ARP packets in
link statistics to avoid this problem.
[ARM] msm: rmnet: Add stat tracking for number of radio wakeups occur.
There are two paramaters that appear for all rmnet devices.
rmnet0 for example:
/sys/devices/virtual/net/rmnet0/timeout (RW)
/sys/devices/virtual/net/rmnet0/wakeups (RO)
timeout is configured by userspace for the proper network timeout values
wakeups is the number of radio wakeups that occured.
By default timeout is zero which means the stats are disabled.
MSM_RMNET_DEBUG must be set.
Signed-off-by: Mike Chan <mike@android.com>
[ARM] msm: rmnet: Track wakeups due to xmit/rcv instead of globally.
Signed-off-by: Mike Chan <mike@android.com>
[ARM] msm: rmnet: Different stat timeouts when screen is on/off.
Timeout for modem powerdown can differ when the screen is on/off.
Allow timeout to change via early suspend/resume hooks.
Signed-off-by: Mike Chan <mike@android.com>
[ARM] msm: rmnet: Lock a wakelock for half a second when receiving data.
Signed-off-by: Arve Hjønnevåg <arve@android.com>
[ARM] msm: rmnet: Tracks total awake time when the rmnet is active.
Exports data in /sys/devices/virtual/net/rmnet0/awake_time_ms
in time expressed as ms awake.
Signed-off-by: Mike Chan <mike@android.com>
[ARM] msm: rmnet: Fix compilation issue when MSM_RMNET_DEBUG is not set.
Signed-off-by: Dima Zavin <dima@android.com>
msm_rmnet: fix to build on 2.6.32
Change-Id: Ic6a4903dd12ea83723354d00f639ae2f9375167f
msm_rmnet: ensure packet writes are atomic
Use the smd_write_atomic() function to prevent concurrent
packet writes to the transport from stepping on each other.
Signed-off-by: Brian Swetland <swetland@google.com>
This replaces the uses of PPP_MTU with PPP_MRU
since both are identical.
Change-Id: Id5c1c590f4c04ab5d6b79da520b5c8eae01881e6
Signed-off-by: tirupathireddy <tirupath@codeaurora.org>
__napi_schedule might raise softirq but nothing
causes do_softirq to trigger, so it does not in fact
run. As a result,
the error message "NOHZ: local_softirq_pending 08"
sometimes occurs during boot of a KVM guest when the network service is
started and we are oom:
...
Bringing up loopback interface: [ OK ]
Bringing up interface eth0:
Determining IP information for eth0...NOHZ: local_softirq_pending 08
done.
[ OK ]
...
Further, receive queue processing might get delayed
indefinitely until some interrupt triggers:
virtio_net expected napi to be run immediately.
One way to cause do_softirq to be executed is by
invoking local_bh_enable(). As __napi_schedule is
normally called from bh or irq context, this
seems to make sense: disable bh before __napi_schedule
and enable afterwards.
In fact it's a very complicated way of calling do_softirq(),
and works since this function is only used when we are not
in interrupt context. It's not hot at all, in any ideal scenario.
Reported-by: Ulrich Obergfell <uobergfe@redhat.com>
Tested-by: Ulrich Obergfell <uobergfe@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
John Linville says:
Here are three more fixes that some of my developers are desperate to
see included in 3.4...
Johan Hedberg went to some length justifyng the inclusion of these two
Bluetooth fixes:
"The device_connected fix should be quite self-explanatory, but it's
actually a wider issue than just for keyboards. All profiles that do
incoming connection authorization (e.g. headsets) will break without it
with specific hardware. The reason it wasn't caught earlier is that it
only occurs with specific Bluetooth adapters.
As for the security level patch, this fixes L2CAP socket based security
level elevation during a connection. The HID profile needs this (for
keyboards) and it is the only way to achieve the security level
elevation when using the management interface to talk to the kernel
(hence the management enabling patch being the one that exposes this"
The rtlwifi fix addresses a regression related to firmware loading,
as described in kernel.org bug 43187. It basically just moves a hunk
of code to a more appropriate place.
Signed-off-by: David S. Miller <davem@davemloft.net>
Andy reported pch_gbe triggered "NETDEV WATCHDOG" errors.
May 11 11:06:09 kontron kernel: WARNING: at net/sched/sch_generic.c:261
dev_watchdog+0x1ec/0x200() (Not tainted)
May 11 11:06:09 kontron kernel: Hardware name: N/A
May 11 11:06:09 kontron kernel: NETDEV WATCHDOG: eth0 (pch_gbe):
transmit queue 0 timed out
It seems pch_gbe has a racy tx path (races with TX completion path)
Remove tx_queue_lock lock since it has no purpose, we must use tx_lock
instead.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Andy Cress <andy.cress@us.kontron.com>
Tested-by: Andy Cress <andy.cress@us.kontron.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Commit 4231d47e6fe69f061f96c98c30eaf9fb4c14b96d(net/usbnet: avoid
recursive locking in usbnet_stop()) fixes the recursive locking
problem by releasing the skb queue lock before unlink, but may
cause skb traversing races:
- after URB is unlinked and the queue lock is released,
the refered skb and skb->next may be moved to done queue,
even be released
- in skb_queue_walk_safe, the next skb is still obtained
by next pointer of the last skb
- so maybe trigger oops or other problems
This patch extends the usage of entry->state to describe 'start_unlink'
state, so always holding the queue(rx/tx) lock to change the state if
the referd skb is in rx or tx queue because we need to know if the
refered urb has been started unlinking in unlink_urbs.
The other part of this patch is based on Huajun's patch:
always traverse from head of the tx/rx queue to get skb which is
to be unlinked but not been started unlinking.
Signed-off-by: Huajun Li <huajun.li.lee@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Cc: Oliver Neukum <oneukum@suse.de>
Cc: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>