Commit graph

873,075 commits

Author SHA1 Message Date
Keith Busch
79a85e214d null_blk: Fix zoned command return code
The return code from null_handle_zoned() sets the cmd->error value.
Returning OK status when an error occured overwrites the intended
cmd->error. Return the appropriate error code instead of setting the
error in the cmd.

Fixes: fceb5d1b19 ("null_blk: create a helper for zoned devices")
Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-10-09 21:00:20 -06:00
Al Viro
26b6c98433 libfs: take cursors out of list when moving past the end of directory
that eliminates the last place where we accessed the tail of ->d_subdirs

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2019-10-09 22:57:30 -04:00
Ian Kent
6fcf0c72e4 vfs: add missing blkdev_put() in get_tree_bdev()
Is there are a couple of missing blkdev_put() in get_tree_bdev()?

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2019-10-09 22:53:57 -04:00
Al Viro
33f37c6488 shmem: fix LSM options parsing
->parse_monolithic() there forgets to call security_sb_eat_lsm_opts()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2019-10-09 22:48:01 -04:00
Valentin Schneider
cd9e72b800 RISC-V: entry: Remove unneeded need_resched() loop
Since the enabling and disabling of IRQs within preempt_schedule_irq()
is contained in a need_resched() loop, we don't need the outer arch
code loop.

Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-riscv@lists.infradead.org
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
2019-10-09 16:48:27 -07:00
Chris Wilson
e137d3abdf drm/i915/gt: execlists->active is serialised by the tasklet
The active/pending execlists is no longer protected by the
engine->active.lock, but is serialised by the tasklet instead. Update
the locking around the debug and stats to follow suit.

v2: local_bh_disable() to prevent recursing into the tasklet in case we
trigger a softirq (Tvrtko)

Fixes: df40306902 ("drm/i915/execlists: Lift process_csb() out of the irq-off spinlock")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191009160906.16195-1-chris@chris-wilson.co.uk
(cherry picked from commit c36eebd9ba5d70b84e1e7408ccc7632566f285c4)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2019-10-09 14:39:31 -07:00
Chris Wilson
749085a213 drm/i915/execlists: Protect peeking at execlists->active
Now that we dropped the engine->active.lock serialisation from around
process_csb(), direct submission can run concurrently to the interrupt
handler. As such execlists->active may be advanced as we dequeue,
dropping the reference to the request. We need to employ our RCU request
protection to ensure that the request is not freed too early.

Fixes: df40306902 ("drm/i915/execlists: Lift process_csb() out of the irq-off spinlock")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191009100955.21477-1-chris@chris-wilson.co.uk
(cherry picked from commit c949ae431467764277cdd88d7c26ff963a9db40a)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2019-10-09 14:39:30 -07:00
Chris Wilson
68184eb7b0 drm/i915: Fixup preempt-to-busy vs reset of a virtual request
Due to the nature of preempt-to-busy the execlists active tracking and
the schedule queue may become temporarily desync'ed (between resubmission
to HW and its ack from HW). This means that we may have unwound a
request and passed it back to the virtual engine, but it is still
inflight on the HW and may even result in a GPU hang. If we detect that
GPU hang and try to reset, the hanging request->engine will no longer
match the current engine, which means that the request is not on the
execlists active list and we should not try to find an older incomplete
request. Given that we have deduced this must be a request on a virtual
engine, it is the single active request in the context and so must be
guilty (as the context is still inflight, it is prevented from being
executed on another engine as we process the reset).

Fixes: 22b7a426bb ("drm/i915/execlists: Preempt-to-busy")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190923152844.8914-2-chris@chris-wilson.co.uk
(cherry picked from commit cb2377a919bbe8107af269c5a31a8d5cfb27d867)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2019-10-09 14:39:30 -07:00
Jens Axboe
8a99734081 io_uring: only flush workqueues on fileset removal
We should not remove the workqueue, we just need to ensure that the
workqueues are synced. The workqueues are torn down on ctx removal.

Cc: stable@vger.kernel.org
Fixes: 6b06314c47 ("io_uring: add file set registration")
Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-10-09 15:13:47 -06:00
Vinayak Menon
b996ea53a5 mm: ratelimit swap write errors
Ratelimit the swap write errors to avoid logbuf getting
filled up by these messages. These pages remove the useful
page allocation failure messages (when zram is used as swap)
from logbuf, thus making the debugging difficult.

Change-Id: I9d4229a76b2551d7baca603112d53012d8722415
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-09 13:44:11 -07:00
qctecmdr
0e0da9c48b Merge "arm64: defconfig: Enable IPC IRQ driver for Lahaina" 2019-10-09 13:38:24 -07:00
David Keitel
8f9b0e0a8e mm: slub: panic for object and slab errors
If the SLUB_DEBUG_PANIC_ON Kconfig option is
selected, also panic for object and slab
errors to allow capturing relevant debug
data.

Change-Id: Idc582ef48d3c0d866fa89cf8660ff0a5402f7e15
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
[isaacm@codeaurora.org: Use IS_ENABLED() for better legibility]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-09 13:31:35 -07:00
Channagoud Kadabi
2e081913d7 mm: Kconfig: Add DEBUG_SLUB_PANIC_ON option
Add the DEBUG_SLUB_PANIC_ON option to KCONFIG preventing
the existing defconfig option from being overwritten
by make config.

This will induce a panic if slab debug catches corruptions
within the padding of a given object.

The intention here is to induce collection of data
immediately after the corruption is detected with
the goal to catch the possible source of the corruption.

Change-Id: Idffa42de790b9e096e28f7e1f484d86c013d7d83
Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-09 13:30:56 -07:00
Chris Wilson
a8385f0c3f drm/i915: Only enqueue already completed requests
If we are asked to submit a completed request, just move it onto the
active-list without modifying it's payload. If we try to emit the
modified payload of a completed request, we risk racing with the
ring->head update during retirement which may advance the head past our
breadcrumb and so we generate a warning for the emission being behind
the RING_HEAD.

v2: Commentary for the sneaky, shared responsibility between functions.
v3: Spelling mistakes and bonus assertion

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190923110056.15176-3-chris@chris-wilson.co.uk
(cherry picked from commit c0bb487dc19fc45dbeede7dcf8f513df51a3cd33)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2019-10-09 13:18:26 -07:00
Chris Wilson
6535a4b34e drm/i915/execlists: Drop redundant list_del_init(&rq->sched.link)
Since amalgamating the queued and active lists in commit 422d7df4f0
("drm/i915: Replace engine->timeline with a plain list"), performing a
i915_request_submit() will remove the request from the execlists
priority queue.

References: 422d7df4f0 ("drm/i915: Replace engine->timeline with a plain list")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190923110056.15176-2-chris@chris-wilson.co.uk
(cherry picked from commit 3231f8c01121ee1febfd82398ee22f7ff9dc5d76)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2019-10-09 13:16:37 -07:00
Trilok Soni
08e6ab0a60 mm/page_owner: ask users about default setting of PAGE_OWNER
Since this commit 48c96a3685 ("mm/page_owner: keep track
of page owners") doesn't enable the page_owner by default
even though CONFIG_PAGE_OWNER is enabled.

Add configuration option CONFIG_PAGE_OWNER_ENABLE_DEFAULT to
allow user to enable it by default through the defconfig file.

CRs-Fixed: 1006743
Change-Id: I9b565a34e2068bf575974eaf3dc9f7820bdd7a96
Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
[swatsrid@codeaurora.org: Fix merge errors and warnings]
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
[isaacm@codeaurora.org: Fix merge conflicts]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-10-09 13:12:06 -07:00
Matt Roper
a8064d577d drm/i915/cml: Add second PCH ID for CMP
The CMP PCH ID we have in the driver is correct for the CML-U machines we have
in our CI system, but the CML-S and CML-H CI machines appear to use a
different PCH ID, leading our driver to detect no PCH for them.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
References: 729ae330a0 ("drm/i915/cml: Introduce Comet Lake PCH")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111461
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190916233251.387-1-matthew.d.roper@intel.com
Fixes: 729ae330a0 ("drm/i915/cml: Introduce Comet Lake PCH")
(cherry picked from commit 8698ba53cd7173c32320ebbef4d389d41ebb5780)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2019-10-09 13:00:56 -07:00
Thomas Bogendoerfer
efcb529694
MIPS: fw: sni: Fix out of bounds init of o32 stack
Use ARRAY_SIZE to caluculate the top of the o32 stack.

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
2019-10-09 12:47:28 -07:00
Thomas Bogendoerfer
46f1619500
MIPS: include: Mark __xchg as __always_inline
Commit ac7c3e4ff4 ("compiler: enable CONFIG_OPTIMIZE_INLINING
forcibly") allows compiler to uninline functions marked as 'inline'.
In cace of __xchg this would cause to reference function
__xchg_called_with_bad_pointer, which is an error case
for catching bugs and will not happen for correct code, if
__xchg is inlined.

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
2019-10-09 12:45:31 -07:00
qctecmdr
1da27d7311 Merge "clk: qcom: Export clk_lucid_5lpe_pll_configure()" 2019-10-09 12:45:26 -07:00
qctecmdr
f62c401333 Merge "msm: ipa: mark the IPA clock on in virtual/emulation mode" 2019-10-09 12:45:26 -07:00
Alistair Delva
72b09c63e4 Revert "kheaders: make headers archive reproducible"
This reverts commit 86cdd2fdc4.

Reason: Broke "make allmodconfig" on Android build machines

$ tar: unrecognized option '--sort=name'
Try 'tar --help' or 'tar --usage' for more information.

Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: I3d406988f23201e5ab824ca7aed215ccc9d43279
2019-10-09 19:27:21 +00:00
David Collins
d37eced82d defconfig: lahaina-qgki: enable QTI regulator debugfs features
Enable CONFIG_REGULATOR_QTI_DEBUG so that regulators can be
controlled from debugfs for testing purposes.

Change-Id: I2e822969b16325bd051a48cf6660363207f4c26f
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-10-09 12:15:57 -07:00
David Collins
43d8c68cf4 regulator: core: add support to log enabled regulators during suspend
Add support to print a list of enabled regulators in the
kernel log.  This is useful when debugging low power modes
during suspend.

Change-Id: I78acb1285caeaeccd30efc16bb5bc001f66bdf33
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-10-09 12:14:27 -07:00
David Collins
491c9e1721 regulator: core: add debugfs regulator monitoring and control features
Add several debugfs files for each registered regulator which
allow for monitoring of the regulator state and the requests from
each consumer.  Also configure these files as writeable so that
the state of each regulator can be voted on via debugfs file
write commands.

Change-Id: Ia13b8f698868374499bb9be390ade4519c517e29
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-10-09 12:06:11 -07:00
qctecmdr
97d4ac5021 Merge "arm64: defconfig: Enable CONFIG_QGKI for Non GKI build" 2019-10-09 11:55:04 -07:00
qctecmdr
ba4a2a4950 Merge "msm: ipa3: remove ipa3_ctx access from wan driver and qmi service" 2019-10-09 11:55:03 -07:00
Chris Lew
53d40934e8 net: qrtr: Send HELLO message on endpoint register
Hello message is currently sent in response to a hello message received
by the ns. When two procs operate in this slave model, then neither of
them exchange the Hello message. This will halt further communication
from happening. Update QRTR to send a hello message once a new endpoint
is registered.

Prevent duplicate Hello messages from reaching the NS because NS will
echo the packet back. On two systems running QRTR, this will loopback
infinitely.

Change-Id: Ibc84fc46658e8c6cedb0d6e84bb1a56d739d5a30
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:26 -07:00
Arun Kumar Neelakantam
a63f27a695 net: qrtr: Add pm_wakeup_event() support
In some cases system enters into suspend state before handling
incoming packets and cause delay in communication.

Add pm_wakup_event() to abort the suspend when a packet is received.

CRs-Fixed: 2432846
Change-Id: I5cec4f9273362e8e2c1df1dae159a6bb5e54d16d
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
2019-10-09 11:35:26 -07:00
Arun Kumar Neelakantam
3b5c20d784 net: qrtr: Make qrtr rx threads as RT priorities
To support high priority clients like sensor use cases in all system
conditions elevating the router reader threads to RT priorities based
on configuration.

Change-Id: I6f46097f6678f2e00c3ec8872b208d773c377224
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
2019-10-09 11:35:25 -07:00
Arun Kumar Neelakantam
b2117d5f34 net: qrtr: Move rx worker to separate worker thread
In system heavy load cases the rx work queued in global worker queue is
getting delayed and causing clients request timeouts.

Create and use separate worker thread to process qrtr rx packets.

Change-Id: I56793a463820340666288bae6111e160d3fc85b9
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
2019-10-09 11:35:25 -07:00
Arun Kumar Neelakantam
0cc9f2c2c8 net: qrtr: Add support to read qrtr packet size
Some transports need to know qrtr packet to read complete packet
from underlying transport.

Add API support to get the incoming packet size form qrtr header.

Change-Id: I4e4e4ab2e4c1fe0e1e1261af85a8b8618ce65bb3
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
2019-10-09 11:35:25 -07:00
Ajay Agarwal
7c4b317c62 net: qrtr: Handle IPCR control port format of older targets
The destination port value in the IPCR control buffer on older
targets is 0xFFFF. Handle the same by updating the dst_port to
QRTR_PORT_CTRL.

Change-Id: Ia70ce1c078ea84f0de47240f6fc3e764f4ae7a6f
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2019-10-09 11:35:24 -07:00
Chris Lew
a7b81fb7db net: qrtr: Return success if control port is not bound
If a port tries to send a message before the name service binds to the
control port, then that message should succeed. This will allow clients
to operate normally until the name service comes online and causes a
net reset to restart all the ports.

Change-Id: Ica0a5e45df0e51f282e5bf426d11ff8e41b339c4
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:24 -07:00
Chris Lew
3fa03f25b4 net: qrtr: Add dynamic node id configuration
Add support to configure the node id through defconfig. This is useful
for targets that are unable to configure the node id through qrtr-ns
because of security reasons. The local node id can still be overridden
by the ns if it is capable.

Change-Id: Ie9fec2ae276948340f4f5a7e0374d554502a0ee1
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:23 -07:00
Chris Lew
a14995b484 net: qrtr: Add permission rules for QTI targets
Give control port access to processes that have root user priveleges,
AID_VENDOR_QRTR user priveleges, or NET_ADMIN capabilities.

Remove the need for SYS_ADMIN priveleges because they will not be
granted on any QTI targets.

This change squashes the following commits from msm-4.14:
  commit 17da4da93c96 ("qrtr: Allow net bind service capabilities")
  commit 56faadfd27b4 ("qrtr: Fix NET_BIND_SERVICE logic")
  commit 82ea58d60c46 ("net: qrtr: Allow control port access to
                        AID_VENDOR_QRTR")
  commit 9db4f5803ce1 ("net: qrtr: Allow Root guid process to bind")

In addition fix minor format issues.

Change-Id: I1441cbf53eb62880333a1031334a5331c1f54a77
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:23 -07:00
Chris Lew
22e63b1f1b net: qrtr: Add support for DEL_PROC control message
Add the DEL_PROC control message for forwarding usecases. If this proc
acts as a gateway between two procs then they need a notification to
clean up servers and client ports when either goes down. This message
acts as notification to clean up all resources associated with the node
in the message.

Change-Id: I3514f54aa0221e104196e2120e929cc9f351847d
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:22 -07:00
Chris Lew
8eef6a4ad1 net: qrtr: Add forwarding support based on net id
Add support for QRTR to forward messages between network clusters. The
network subnet id's are attached to the QRTR subnodes in the MHI and
RPMSG/GLINK nodes.

The current forwarding decisions are done based on the net ids and are
wrapped in a single function for easier maintenance of forwarding
decisions later on. The function will return true once it determines
a subnet has no connection to another subnet.

The NEW_SERVER, DEL_SERVER, and DEL_CLIENT control messages should be
forwarded while the DATA and RESUME_TX commands should be passed along
to their destination node.

The nameservice is expected to send NEW_SERVER commands for it's entire
database instead of just the local service database with these changes.
This is to make sure new nodes get service notifications that came
earlier and were meant to be forwarded to the new node.

This change squashes the following commits from msm-4.14:
  commit e5f6a6769ceb ("net: qrtr: Add forwarding support based on net id")
  commit 4516ab18718d ("net: qrtr: avoid deadlock in case of recursive
                        lock for node list")
  commit dc2d47cd12d3 ("net: qrtr: Only update pkts with broadcast node
                        ID")
  commit 4277aebeff91 ("net: qrtr: Free skb if qrtr_node_lookup fails
                        during qrtr_fwd_pkt")

In addition fix minor format issues and update copyright.

Change-Id: Iaf01dd212b07dfbb13ec087ea0aae980cda7c2fd
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:22 -07:00
Chris Lew
077ebed657 net: qrtr: Add non blocking option for tx_resume
QRTR should support asynchronous sends even with the tx flow control
enabled. Add a timeout to the tx_wait and send a zero size packet to
nonblocking sockets after the remote port is no longer flow controlled.
This zero size packet will act as a notification for clients to start
sending again.

This change squashes the following commits from msm-4.14:
  commit 5dff60d7bb53 ("net: qrtr: Add non blocking option for tx_resume")
  commit aff4c897bcf5 ("net: qrtr: Fix missing resume_tx notification")
  commit c969cce741fc ("net: qrtr: Rearrange tx wait and protect critical
                        section")

In addition fix minor format issues.

Change-Id: I4b2a145b9507aa18ff08ef58e5620b72952f7f5f
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:22 -07:00
Chris Lew
61218504c8 net: qrtr: Move tx_resume handling to work context
There will be non-atomic work associated with receiving the tx resume
packet from the remote. Move the handling to work function context in
preparation for the non-blocking socket blocking improvement.

Change-Id: I2389bdcffba068258650bfbb579f8cb98a0ac928
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:21 -07:00
Chris Lew
bb300aedea net: qrtr: Send BYE message for all nodes on ept
An ept can represent multiple nodes in a system. If an ept unregisters,
qrtr should send a BYE control message for all the nodes that it
represents. Iterate through the node tree to find all the nodes that
belong to the ept.

Change-Id: I641bba615e689f59acecc9ac87fec61c3eecc0d1
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:21 -07:00
Chris Lew
b92521c119 net: qrtr: Add node assignment on new server
The remote processor will not forward a hello packet for the other
processors that it is forwarding from. Discover nodes through
QRTR_TYPE_NEW_SERVER messages as well in order to find remote hosts
which require more than one hop to reach it.

Change-Id: Ia79df1fa2730250786d221fb847029046a53bea4
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:20 -07:00
Chris Lew
5afd5bc51d net: qrtr: Rename qrtr_all_nodes to qrtr_all_epts
The node list only respresents the adjacent nodes in the system. Rename
the list to qrtr_all_epts to better describe the list contents. Rename
qrtr_nodes_lock to qrtr_epts_lock to better describe lock.

Change-Id: I168ca597d5b9b30d6c064c2a56b6e8b2dffa387b
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:20 -07:00
Chris Lew
162cff4d10 net: qrtr: Add support for multiple nodes on a single ept
An ept can be associated with multiple node ids in network. The node
tree should keep track of how to send to a specific node id where as
the node list should keep track of all the adjacent nodes in the
network. Use the node list to broadcast control messages to adjacent
nodes.

Change-Id: If0f4828da149b6e590525518a8410f497f5e3894
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:19 -07:00
Arun Kumar Neelakantam
33685bb27f net: qrtr: use alloc_skb_with_frags() in rx path
net_dev_alloc() fails for high order allocations in system where memory
is fragmented and cause communication stall due to packet drops.

Use alloc_skb_with_frags() to avoid packet drops in memory fragmented case.

This change squashes the following commits from msm-4.14:
  commit 5121b211a5e6 ("net: qrtr: Use skb with fragments in memory
                        failure case")
  commit bdc91a0dae07 ("net: qrtr: use alloc_skb_with_frag() in rx path")

In addition, fix minor format issues and update the copyright.

Change-Id: I46b7e0da0ed04c9222c975ee930f0f8d9b41453b
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
2019-10-09 11:35:19 -07:00
Arun Kumar Neelakantam
a8fb633c78 net: qrtr: Check function pointer before calling
sk_error_report callback function called without validating cause the NULL
pointer dereference.

Validate function pointer before using for error report.

Change-Id: I19d04f85a5457f3857623088f8e0578514f0c395
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
2019-10-09 11:35:19 -07:00
Chris Lew
d2a5084230 net: qrtr: Prevent stale ports from sending
The current implementation of the control port bind releases and
reacquires the port lock between allocating the port idr and resetting
the existing sockets. This creates a race condition where sockets
can send to the control port during the control port bind. Hold the
lock for the duration of the control port bind to prevent this.

In order to prevent messages from stale sockets being sent, check if
ENETRESET has been set on the socket and drop the packet.

Change-Id: Ie9abc6c51139e82d3c9ebd4d546d1acd7269875e
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:35:18 -07:00
Chris Lew
0d116bcb6a net: qrtr: Detach socket from sock during release
There is a race between releasing a socket and a sock structure. Skbs
still in flight may hold references to the sock structure, preventing
it from being freed when the socket is released. Detach the socket in
the release call to prevent references to that sockets resources.

Change-Id: I44ac553cf73b3a2148ce50d7552c39b08f5e0f91
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-10-09 11:21:23 -07:00
zhong jiang
a26e0fbe06 iio: Fix an undefied reference error in noa1305_probe
I hit the following error when compile the kernel.

drivers/iio/light/noa1305.o: In function `noa1305_probe':
noa1305.c:(.text+0x65): undefined reference to `__devm_regmap_init_i2c'
make: *** [vmlinux] Error 1

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-09 19:11:29 +01:00
David Frey
82f3015635 iio: light: opt3001: fix mutex unlock race
When an end-of-conversion interrupt is received after performing a
single-shot reading of the light sensor, the driver was waking up the
result ready queue before checking opt->ok_to_ignore_lock to determine
if it should unlock the mutex. The problem occurred in the case where
the other thread woke up and changed the value of opt->ok_to_ignore_lock
to false prior to the interrupt thread performing its read of the
variable. In this case, the mutex would be unlocked twice.

Signed-off-by: David Frey <dpfrey@gmail.com>
Reviewed-by: Andreas Dannenberg <dannenberg@ti.com>
Fixes: 94a9b7b180 ("iio: light: add support for TI's opt3001 light sensor")
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-09 19:11:29 +01:00