Commit Graph

993197 Commits

Author SHA1 Message Date
Michael Grzeschik
fc33d1de5c UPSTREAM: usb: gadget: uvc: prevent index variables to start from 0
Some configfs variables like bDefaultFrameIndex are always starting by
1. This patch adds a check to prevent setting those variables to 0.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>

Link: https://lore.kernel.org/r/20220421211427.3400834-4-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit a350cfb653)
Bug: 242344221
Change-Id: Ieb800223fe0071c7a3650b146a1d0c6f5f7ad8a2
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
da9de7cbf5 UPSTREAM: usb: gadget: uvc: improve sg exit condition
The exit condition to quit iterating over the sg_list, while encoding
the sg entries, has to consider the case that the dma_len of the entry
could be zero. This patch takes this condition to account.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20220402232744.3622565-4-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit aef1127988)
Bug: 242344221
Change-Id: I7eddc039ec0c54982fd6bae95af2f73f4ce04ef6
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
474eabbb17 UPSTREAM: usb: gadget: uvc: giveback vb2 buffer on req complete
On uvc_video_encode_isoc_sg the mapped vb2 buffer is returned
to early. Only after the last usb_request worked with the buffer
it is allowed to give it back to vb2. This patch fixes that.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20220402232744.3622565-3-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 9b969f93bc)
Bug: 242344221
Change-Id: If2dbb1ec5ca6a2b5f11153cec4db76cbcc1065c3
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
e60b62c1ae UPSTREAM: usb: gadget: uvc: rework uvcg_queue_next_buffer to uvcg_complete_buffer
The function uvcg_queue_next_buffer is used different than its name
suggests. The return value nextbuf is never used by any caller. This
patch reworks the function to its actual purpose, by removing the unused
code and renaming it. The function name uvcg_complete_buffer makes it
more clear that it is actually marking the current video buffer as
complete.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20220402232744.3622565-2-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 61aa709ca5)
Bug: 242344221
Change-Id: I50f0995acabff20b36721d368aa9691a713381d7
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Dan Vacura
0889895826 UPSTREAM: usb: gadget: uvc: remove pause flag use
The pause flag doesn't appear to serve a purpose as it is possible for
the pump worker thread to not be running when new buffers are queued.
Before the following change was introduced: "43cd0023872e usb: gadget:
uvc_video: add worker to handle the frame pumping", the pause flag
status was discarded and never returned. This masked a current issues of
the userspace receiving non-zero values (considered unsuccessful) and
prevents trace_v4l2_qbuf() from being called.

Signed-off-by: Dan Vacura <w36195@motorola.com>
Link: https://lore.kernel.org/r/20220413192402.26063-1-w36195@motorola.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit be30e35027)
Bug: 242344221
Change-Id: I5c2a67641d8a0af7a11ac43ad57b76b69bba26fc
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Dan Vacura
be90188351 UPSTREAM: usb: gadget: uvc: allow changing interface name via configfs
Add a configfs entry, "function_name", to change the iInterface field
for VideoControl. This name is used on host devices for user selection,
useful when multiple cameras are present. The default will remain "UVC
Camera".

Signed-off-by: Dan Vacura <w36195@motorola.com>
Link: https://lore.kernel.org/r/20220401160447.5919-1-w36195@motorola.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 324e4f8507)
Bug: 242344221
Change-Id: I5b4666156ce2300ae902bca2ff380560d19d3f0a
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Olbrich
88ffebe891 UPSTREAM: usb: gadget: uvc: implement dwPresentationTime and scrSourceClock
This patch adds the fields UVC_STREAM_PTS and UVC_STREAM_SCR to the uvc
header, in case this data is available. It also enables the copy of the
timestamp to the vb2_v4l2_buffer by setting V4L2_BUF_FLAG_TIMESTAMP_COPY
in the queue.timestamp_flags.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20211022093223.26493-2-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit fd03af27c3)
Bug: 242344221
Change-Id: Icccbf2d453f58e05984d995c572524ec3d9f577b
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
009b462fb3 UPSTREAM: usb: gadget: uvc: use on returned header len in video_encode_isoc_sg
The function uvc_video_encode_header function returns the number of
bytes used for the header. We change the video_encode_isoc_sg function
to use the returned header_len rather than UVCG_REQUEST_HEADER_LEN and
make the encode function more flexible.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20211022093223.26493-1-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit f262ce66d4)
Bug: 242344221
Change-Id: I3f3fe1deb42ca9a3c559968ef324af3e850d073f
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
c59078421b UPSTREAM: usb: gadget: uvc: ensure the vdev is unset
Since the uvc video device is created on demand, we have to ensure
that the struct is always zeroed. Otherwise the previous settings
might collide with the new values.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20211017215017.18392-7-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit e4ce9ed835)
Bug: 242344221
Change-Id: Iff680809310e34b0341a902250f208be4e6cdb6e
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
6a53e7b6a4 UPSTREAM: usb: gadget: uvc: only pump video data if necessary
If the streaming endpoint is not enabled, the worker has nothing to do.
In the case buffers are still queued, this patch ensures that it will bail
out without handling any data.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20211017215017.18392-6-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit f9897ec0f6)
Bug: 242344221
Change-Id: I1d43fb5b45f209ec98ac5ca335a04c88d536075f
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
d8b55ca86d UPSTREAM: usb: gadget: uvc: only schedule stream in streaming state
This patch ensures that the video pump thread will only be scheduled if
the uvc is really in streaming state. This way the worker will not have
to run on an empty queue.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20211017215017.18392-5-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 5fc49d8bee)
Bug: 242344221
Change-Id: I9b38b336d69e1840de6c557ad52d5f0c5e2afc96
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
5c5e45ee7b UPSTREAM: usb: gadget: uvc: test if ep->desc is valid on ep_queue
The reason that the ep_queue has failed could be a disabled endpoint.
In that case it is not guaranteed that the ep->desc is still valid.
This patch adds a check for NULL.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20211017215017.18392-4-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 38db3716a5)
Bug: 242344221
Change-Id: I0165b6ad67056d875020500d7d47ebc3ee73c5a7
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
071bf7bf20 UPSTREAM: usb: gadget: uvc: consistently use define for headerlen
The uvc request headerlen of 2 was defined as UVCG_REQUEST_HEADER_LEN
in commit e81e7f9a0e ("usb: gadget: uvc: add scatter gather support").
We missed to use it consistently. This patch fixes that.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20211018072059.11465-1-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

(cherry picked from commit 859c675d84)
Bug: 242344221
Change-Id: I8e54d5919142646bdc61b7c6e6b58269987b9b4d
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
4ea3a805ea UPSTREAM: usb: gadget: uvc: decrease the interrupt load to a quarter
With usb3 we handle many more requests. Decrease the interrupt load by
only enabling the interrupt every quarter of the allocated requests.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>

--
v1 -> v2: - edited patch description
	  - removed extra parantheses
	  - added a comment for the logic
	  - using unsigned int instead of int
	  - reinitializing req_int_count in uvcg_video_enable
v2 -> v3: -
Link: https://lore.kernel.org/r/20210628155311.16762-6-m.grzeschik@pengutronix.de

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit fc78941d81)
Bug: 242344221
Change-Id: I4b40c4bbd90b9b8ad85957a77589fb304e00a876
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
000cbb7d4b UPSTREAM: usb: gadget: uvc: add scatter gather support
This patch adds support for scatter gather transfers. If the underlying
gadgets sg_supported == true, then the videeobuf2-dma-sg is used and the
encode routine maps all scatter entries to separate scatterlists for the
usb gadget.

When streaming 1080p with request size of 1024 times 3 bytes top shows a
difference of about 6.4% CPU load applying this patch:

 PID USER      PR  NI    VIRT    RES  %CPU  %MEM     TIME+ S COMMAND

  64 root       0 -20    0.0m   0.0m   7.7   0.0   0:01.25 I [kworker/u5:0-uvcvideo]
  83 root       0 -20    0.0m   0.0m   4.5   0.0   0:03.71 I [kworker/u5:3-uvcvideo]
 307 root     -51   0    0.0m   0.0m   3.8   0.0   0:01.05 S [irq/51-dwc3]

vs.

  64 root       0 -20    0.0m   0.0m   5.8   0.0   0:01.79 I [kworker/u5:0-uvcvideo]
 306 root     -51   0    0.0m   0.0m   3.2   0.0   0:01.97 S [irq/51-dwc3]
  82 root       0 -20    0.0m   0.0m   0.6   0.0   0:01.86 I [kworker/u5:1-uvcvideo]

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20210628155311.16762-5-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit e81e7f9a0e)
Bug: 242344221
Change-Id: I466e3aaac60ffee4439ecf2b4583dae543e373f4
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
29cd732e9a UPSTREAM: usb: gadget: uvc: set v4l2_dev->dev in f_uvc
The v4l2_dev has no corresponding device to it. We will
point it to the gadget's dev.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20210628155311.16762-4-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit b9b82d3d0d)
Bug: 242344221
Change-Id: Ic4af4e164a2bb01578b10dd3c478a142c244c9ad
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
Michael Grzeschik
b9cfdaa0e1 UPSTREAM: usb: gadget: uvc: make uvc_num_requests depend on gadget speed
While sending bigger images is possible with USB_SPEED_SUPER it is
better to use more isochronous requests in flight. This patch makes the
number uvc_num_requests dynamic by changing it depending on the gadget
speed.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20210628155311.16762-3-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 9973772dbb)
Bug: 242344221
Change-Id: Ie3757dde02125eaa0e28b6181c475726cb344742
Signed-off-by: Avichal Rakesh <arakesh@google.com>
2023-01-10 23:32:31 +00:00
davidchiang
6a2b747210 ANDROID: Update the ABI symbol list and xml
Add symbols find_vm_area.

1 function symbol(s) added
  'struct vm_struct * find_vm_area(void *)'

Bug: 263839332
Change-Id: I1c1298fe8d2bbdba323a7990c58c2eae2e9b5610
Signed-off-by: davidchiang <davidchiang@google.com>
2023-01-10 04:21:27 +00:00
davidchiang
41b027695f ANDROID: mm: Export find_vm_area
Export find_vm_area for obtaining pages of vmalloc'ed memory, which is
required for both GXP and TPU modules.

Bug: 263839332
Change-Id: I1d6c37a5abb6012c3ff295120dd2d3cb2871c820
Signed-off-by: davidchiang <davidchiang@google.com>
2023-01-10 02:52:23 +00:00
Greg Kroah-Hartman
c82a7304de ANDROID: allmodconfig: disable WERROR
-Werror still fails on some arm and arm64 code due to clang issues
(works on gcc!), so disable it when building allmodconfig builds for
now.

Hopefully the clang developers will work on this...

Bug: 199872592
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6ccc856773c40e3c0f541a1316b20e9ae3de4380
(cherry picked from commit eb57c31115)
Signed-off-by: Alistair Delva <adelva@google.com>
2023-01-10 00:54:47 +00:00
Linus Torvalds
0697ad7f44 UPSTREAM: Enable '-Werror' by default for all kernel builds
... but make it a config option so that broken environments can disable
it when required.

We really should always have a clean build, and will disable specific
over-eager warnings as required, if we can't fix them.  But while I
fairly religiously enforce that in my own tree, it doesn't get enforced
by various build robots that don't necessarily report warnings.

So this just makes '-Werror' a default compiler flag, but allows people
to disable it for their configuration if they have some particular
issues.

Occasionally, new compiler versions end up enabling new warnings, and it
can take a while before we have them fixed (or the warnings disabled if
that is what it takes), so the config option allows for that situation.

Hopefully this will mean that I get fewer pull requests that have new
warnings that were not noticed by various automation we have in place.

Knock wood.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 3fe617ccaf)
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: If981f26ebe668be7c727661fede10215c4ee5bc5
2023-01-10 00:54:47 +00:00
Sangmoon Kim
c66fc69f33 ANDROID: ABI: update galaxy allowed list for trace hook
Bug: 263703180

Change-Id: Ie26dfae4b8340ae7ccc977e8ac308a5cd7284374
Signed-off-by: Woogeun Lee <woogeun.lee@samsung.com>
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
2023-01-09 20:02:44 +00:00
Sangmoon Kim
b42eddeb28 Revert "Revert "ANDROID: workqueue: add vendor hook for wq lockup information""
This reverts commit 7a6ea55aa0.

This hook was removed because there is no user.
But the new project needs this hook.

Bug: 263703180

Change-Id: I14e286fd6d426d4ffdb4cb440477f0fae65e980e
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
2023-01-09 20:02:44 +00:00
Eric Biggers
f2a236c7ae ANDROID: fips140: add crypto_memneq() back to the module
crypto_memneq() is one of the utility functions that was intentionally
included in the fips140 module, out of concerns that it would be seen as
"cryptographic" and thus would be required to be included the module for
the FIPS certification.  It should not have been removed from the
module, so add it back.

Bug: 188620248
Fixes: 29c427664a ("Merge tag 'android13-5.10.149_r00' into android13-5.10")
Change-Id: I8a19dfd73390f8c1348885f97fa42d900e47b82b
Signed-off-by: Eric Biggers <ebiggers@google.com>
2023-01-09 10:55:56 +00:00
Jens Axboe
4f1eb203c6 UPSTREAM: io_uring: kill goto error handling in io_sqpoll_wait_sq()
Hunk extracted from commit 70aacfe661
upstream.

If the sqpoll thread has died, the out condition doesn't remove the
waiting task from the waitqueue. The goto and check are not needed, just
make it a break condition after setting the error value. That ensures
that we always remove ourselves from sqo_sq_wait waitqueue.

Bug: 259534862
Reported-by: Xingyuan Mo <hdthky0@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0f544353fe)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I453c3e23a2f0c5ce6a8dd73dac020ec6f32994ca
2023-01-09 09:01:31 +00:00
Woogeun Lee
f7ea55aee6 ANDROID: ABI: initial add allowed list for galaxy
80 function symbol(s) added
  'int __blk_mq_debugfs_rq_show(struct seq_file *, struct request *)'
  'ktime_t __hrtimer_get_remaining(const struct hrtimer *, bool)'
  'void __kfree_skb(struct sk_buff *)'
  'bool __percpu_down_read(struct percpu_rw_semaphore *, bool)'
  'int __traceiter_android_rvh_dequeue_task_idle(void *, struct task_struct *)'
  'int __traceiter_android_rvh_report_bug(void *, const char *, unsigned int, unsigned long int)'
  'int __traceiter_android_rvh_schedule_bug(void *, struct task_struct *)'
  'int __traceiter_android_vh_mutex_wait_finish(void *, struct mutex *)'
  'int __traceiter_android_vh_mutex_wait_start(void *, struct mutex *)'
  'int __traceiter_android_vh_ptype_head(void *, const struct packet_type *, struct list_head *)'
  'int __traceiter_android_vh_rtmutex_wait_finish(void *, struct rt_mutex *)'
  'int __traceiter_android_vh_rtmutex_wait_start(void *, struct rt_mutex *)'
  'int __traceiter_android_vh_rwsem_read_wait_finish(void *, struct rw_semaphore *)'
  'int __traceiter_android_vh_rwsem_read_wait_start(void *, struct rw_semaphore *)'
  'int __traceiter_android_vh_rwsem_write_wait_finish(void *, struct rw_semaphore *)'
  'int __traceiter_android_vh_rwsem_write_wait_start(void *, struct rw_semaphore *)'
  'int __traceiter_android_vh_sched_show_task(void *, struct task_struct *)'
  'int __traceiter_android_vh_try_to_freeze_todo(void *, unsigned int, unsigned int, bool)'
  'int __traceiter_android_vh_try_to_freeze_todo_unfrozen(void *, struct task_struct *)'
  'int __traceiter_android_vh_watchdog_timer_softlockup(void *, int, struct pt_regs *, bool)'
  'int __traceiter_kfree_skb(void *, struct sk_buff *, void *)'
  'void alarm_start(struct alarm *, ktime_t)'
  'int blk_mq_debugfs_rq_show(struct seq_file *, void *)'
  'void blk_mq_sched_request_inserted(struct request *)'
  'bool blk_mq_sched_try_insert_merge(struct request_queue *, struct request *)'
  'bool blk_mq_sched_try_merge(struct request_queue *, struct bio *, unsigned int, struct request * *)'
  'struct blkcg_gq * blkg_lookup_slowpath(struct blkcg *, struct request_queue *, bool)'
  'void * bsearch(void *, void *, size_t, size_t, cmp_func_t)'
  'struct device * create_function_device(char *)'
  'struct device_driver * driver_find(const char *, struct bus_type *)'
  'int dump_align(struct coredump_params *, int)'
  'int dump_emit(struct coredump_params *, void *, int)'
  'struct elevator_queue * elevator_alloc(struct request_queue *, struct elevator_type *)'
  'bool elv_bio_merge_ok(struct request *, struct bio *)'
  'void elv_rb_add(struct rb_root *, struct request *)'
  'void elv_rb_del(struct rb_root *, struct request *)'
  'struct request * elv_rb_find(struct rb_root *, sector_t)'
  'struct request * elv_rb_former_request(struct request_queue *, struct request *)'
  'struct request * elv_rb_latter_request(struct request_queue *, struct request *)'
  'int elv_register(struct elevator_type *)'
  'void elv_rqhash_add(struct request_queue *, struct request *)'
  'void elv_rqhash_del(struct request_queue *, struct request *)'
  'void elv_unregister(struct elevator_type *)'
  'void file_ra_state_init(struct file_ra_state *, struct address_space *)'
  'ssize_t generic_file_read_iter(struct kiocb *, struct iov_iter *)'
  'struct file * get_mm_exe_file(struct mm_struct *)'
  'struct kernfs_node * kernfs_find_and_get_ns(struct kernfs_node *, const char *, void *)'
  'void kernfs_put(struct kernfs_node *)'
  'int kstrtos16(const char *, unsigned int, s16 *)'
  'struct cgroup_subsys_state * kthread_blkcg()'
  'int kthread_park(struct task_struct *)'
  'bool kthread_should_park()'
  'dev_t name_to_dev_t(const char *)'
  'int of_add_property(struct device_node *, struct property *)'
  'void pm_get_active_wakeup_sources(char *, size_t)'
  'int rcuwait_wake_up(struct rcuwait *)'
  'int register_kretprobe(struct kretprobe *)'
  'struct ctl_table_header * register_net_sysctl(struct net *, const char *, struct ctl_table *)'
  'void regulator_bulk_free(int, struct regulator_bulk_data *)'
  'void sbitmap_queue_min_shallow_depth(struct sbitmap_queue *, unsigned int)'
  'struct list_head * seq_list_next(void *, struct list_head *, loff_t *)'
  'struct list_head * seq_list_start(struct list_head *, loff_t)'
  'int skb_copy_ubufs(struct sk_buff *, gfp_t)'
  'int smp_call_function_single_async(int, struct __call_single_data *)'
  'int smpboot_register_percpu_thread(struct smp_hotplug_thread *)'
  'void smpboot_unregister_percpu_thread(struct smp_hotplug_thread *)'
  'int snd_soc_add_card_controls(struct snd_soc_card *, const struct snd_kcontrol_new *, int)'
  'int snd_soc_dai_set_tristate(struct snd_soc_dai *, int)'
  'unsigned int stack_trace_save(unsigned long int *, unsigned int, unsigned int)'
  'unsigned int stack_trace_save_regs(struct pt_regs *, unsigned long int *, unsigned int, unsigned int)'
  'unsigned int stack_trace_save_tsk(struct task_struct *, unsigned long int *, unsigned int, unsigned int)'
  'int tcp_register_congestion_control(struct tcp_congestion_ops *)'
  'void tcp_reno_cong_avoid(struct sock *, u32, u32)'
  'u32 tcp_reno_ssthresh(struct sock *)'
  'u32 tcp_reno_undo_cwnd(struct sock *)'
  'u32 tcp_slow_start(struct tcp_sock *, u32)'
  'void tcp_unregister_congestion_control(struct tcp_congestion_ops *)'
  'void unregister_kretprobe(struct kretprobe *)'
  'struct usb_device * usb_alloc_dev(struct usb_device *, struct usb_bus *, unsigned int)'
  'void usb_set_device_state(struct usb_device *, enum usb_device_state)'

19 variable symbol(s) added
  'struct tracepoint __tracepoint_android_rvh_dequeue_task_idle'
  'struct tracepoint __tracepoint_android_rvh_report_bug'
  'struct tracepoint __tracepoint_android_rvh_schedule_bug'
  'struct tracepoint __tracepoint_android_vh_mutex_wait_finish'
  'struct tracepoint __tracepoint_android_vh_mutex_wait_start'
  'struct tracepoint __tracepoint_android_vh_ptype_head'
  'struct tracepoint __tracepoint_android_vh_rtmutex_wait_finish'
  'struct tracepoint __tracepoint_android_vh_rtmutex_wait_start'
  'struct tracepoint __tracepoint_android_vh_rwsem_read_wait_finish'
  'struct tracepoint __tracepoint_android_vh_rwsem_read_wait_start'
  'struct tracepoint __tracepoint_android_vh_rwsem_write_wait_finish'
  'struct tracepoint __tracepoint_android_vh_rwsem_write_wait_start'
  'struct tracepoint __tracepoint_android_vh_sched_show_task'
  'struct tracepoint __tracepoint_android_vh_try_to_freeze_todo'
  'struct tracepoint __tracepoint_android_vh_try_to_freeze_todo_unfrozen'
  'struct tracepoint __tracepoint_android_vh_watchdog_timer_softlockup'
  'struct tracepoint __tracepoint_kfree_skb'
  'struct blkcg blkcg_root'
  'kimage_vaddr'

Bug: 263211890
Change-Id: If90d89ca7b94620c0dd3dbd43d50c07cab8070bb
Signed-off-by: Woogeun Lee <woogeun.lee@samsung.com>
2023-01-07 14:03:03 +00:00
Kalesh Singh
a19efee97a ANDROID: Re-enable fast mremap and fix UAF with SPF
SPF attempts page faults without taking the mmap lock, but takes the
PTL. If there is a concurrent fast mremap (at PMD/PUD level), this
can lead to a UAF as fast mremap will only take the PTL locks at the
PMD/PUD level. SPF cannot take the PTL locks at the larger subtree
granularity since this introduces much contention in the page fault
paths.

To address the race:
  1) Only try fast mremaps if there are no users of the VMA. Android
     is concerned with this optimization in the context of
     GC stop-the-world pause. So there are no other threads active
     and this should almost always succeed.
  2) Speculative faults detect ongoing fast mremaps and fallback
     to conventional fault handling (taking mmap read lock).

Bug: 263177905
Change-Id: I23917e493ddc8576de19883cac053dfde9982b7f
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-01-07 01:21:30 +00:00
Kalesh Singh
f610378ca2 Revert "ANDROID: Make SPF aware of fast mremaps"
This reverts commit 206a66b5c4.

Reason for revert: vts_linux_kselftest_arm_64 timeout

Bug: 263479421
Bug: 263177905
Change-Id: I123c56741c982d1539ceebd8bfde2443871aa1de
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-01-07 01:21:30 +00:00
Bing-Jhong Billy Jheng
03c04a7cba UPSTREAM: io_uring: add missing item types for splice request
Splice is like read/write and should grab current->nsproxy, denoted by
IO_WQ_WORK_FILES as it refers to current->files as well

Change-Id: I94a99fdef5764e7eda5da778b5b52a150b9fe5eb
Signed-off-by: Bing-Jhong Billy Jheng <billy@starlabs.sg>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 75454b4bbf)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-01-06 09:36:26 +00:00
Kyle Tso
8bd021e7f2 ANDROID: Update the ABI representation
1 function symbol(s) added
  'int extcon_set_property_sync(struct extcon_dev *, unsigned int, unsigned int, union extcon_property_value)'

Bug: 257490462
Change-Id: I616c041604a84ef869fa818f3a0244b80f281656
Signed-off-by: Kyle Tso <kyletso@google.com>
2023-01-05 21:38:59 +00:00
Bian Jin chen
fa957a5de4 ANDROID: GKI: Enable symbols for bcmdhd-pcie
1 function symbol(s) added
  'int netif_set_xps_queue(struct net_device *, const struct cpumask *, u16)'

Bug: 239396464
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
Change-Id: I7dea5ae556484e15394fe5ec5c3446b7692758eb
2022-12-28 11:42:23 +08:00
Bian Jin chen
f2ea038eda ANDROID: GKI: Enable symbols for pwrseq-simple
4 function symbol(s) added
  'unsigned long int * bitmap_alloc(unsigned int, gfp_t)'
  'int gpiod_set_array_value_cansleep(unsigned int, struct gpio_desc * *, struct gpio_array *, unsigned long int *)'
  'int mmc_pwrseq_register(struct mmc_pwrseq *)'
  'void mmc_pwrseq_unregister(struct mmc_pwrseq *)'

Bug: 239396464
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
Change-Id: I7021822c754002e6247f0088399c9fc6987ea468
2022-12-28 11:16:05 +08:00
John Stultz
61a9c903fe FROMLIST: pstore: Make sure CONFIG_PSTORE_PMSG selects CONFIG_RT_MUTEXES
In commit [in -next: 76d62f24db] ("pstore: Switch pmsg_lock to an rt_mutex
to avoid priority inversion") I changed a lock to an rt_mutex.

However, its possible that CONFIG_RT_MUTEXES is not enabled,
which then results in a build failure, as the 0day bot detected:
  https://lore.kernel.org/linux-mm/202212211244.TwzWZD3H-lkp@intel.com/

Thus this patch changes CONFIG_PSTORE_PMSG to select
CONFIG_RT_MUTEXES, which ensures the build will not fail.

Cc: Wei Wang <wvw@google.com>
Cc: Midas Chien<midaschieh@google.com>
Cc: Connor O'Brien <connoro@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Anton Vorontsov <anton@enomsg.org>
Cc: Colin Cross <ccross@android.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: kernel test robot <lkp@intel.com>
Cc: kernel-team@android.com
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/lkml/20221221051855.15761-1-jstultz@google.com/
Change-Id: I56ef91f302aa9ed1be3858c03b72a79543a329e5
[jstultz: Tweaked commit message to avoid catching presubmit checks
 referencing shas that haven't landed upstream yet]
Fixes: 943836e729 ("FROMGIT: pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion")
Signed-off-by: John Stultz <jstultz@google.com>
2022-12-23 06:38:31 +00:00
Bian Jin chen
75ec0fe20f ANDROID: GKI: rockchip: Add symbols for HDMIRX and Ethernet
54 function symbol(s) added
  'int __bitmap_and(unsigned long int *, const unsigned long int *, const unsigned long int *, unsigned int)'
  'struct dentry * debugfs_rename(struct dentry *, struct dentry *, struct dentry *, const char *)'
  'int device_get_phy_mode(struct device *)'
  'struct net_device * devm_alloc_etherdev_mqs(struct device *, int, unsigned int, unsigned int)'
  'void dql_completed(struct dql *, unsigned int)'
  'void dql_reset(struct dql *)'
  'void ethtool_convert_legacy_u32_to_link_mode(unsigned long int *, u32)'
  'bool ethtool_convert_link_mode_to_legacy_u32(u32 *, const unsigned long int *)'
  'int flow_block_cb_setup_simple(struct flow_block_offload *, struct list_head *, flow_setup_cb_t *, void *, void *, bool)'
  'void flow_rule_match_basic(const struct flow_rule *, struct flow_match_basic *)'
  'void flow_rule_match_ipv4_addrs(const struct flow_rule *, struct flow_match_ipv4_addrs *)'
  'void flow_rule_match_ports(const struct flow_rule *, struct flow_match_ports *)'
  'int kvm_arch_ptp_get_crosststamp(u64 *, struct timespec64 *, struct clocksource * *)'
  'bool kvm_arm_hyp_service_available(u32)'
  'struct phy_device * mdiobus_get_phy(struct mii_bus *, int)'
  'void netdev_alert(const struct net_device *, const char *, ...)'
  'void netdev_rss_key_fill(void *, size_t)'
  'void * of_get_mac_address(struct device_node *)'
  'int of_get_phy_mode(struct device_node *, phy_interface_t *)'
  'int of_mdiobus_register(struct mii_bus *, struct device_node *)'
  'bool of_phy_is_fixed_link(struct device_node *)'
  'struct page * page_pool_alloc_pages(struct page_pool *, gfp_t)'
  'struct page_pool * page_pool_create(const struct page_pool_params *)'
  'void page_pool_destroy(struct page_pool *)'
  'void page_pool_put_page(struct page_pool *, struct page *, unsigned int, bool)'
  'void page_pool_release_page(struct page_pool *, struct page *)'
  'int phy_init_eee(struct phy_device *, bool)'
  'int phylink_connect_phy(struct phylink *, struct phy_device *)'
  'struct phylink * phylink_create(struct phylink_config *, struct fwnode_handle *, phy_interface_t, const struct phylink_mac_ops *)'
  'void phylink_destroy(struct phylink *)'
  'void phylink_disconnect_phy(struct phylink *)'
  'int phylink_ethtool_get_eee(struct phylink *, struct ethtool_eee *)'
  'void phylink_ethtool_get_pauseparam(struct phylink *, struct ethtool_pauseparam *)'
  'void phylink_ethtool_get_wol(struct phylink *, struct ethtool_wolinfo *)'
  'int phylink_ethtool_ksettings_get(struct phylink *, struct ethtool_link_ksettings *)'
  'int phylink_ethtool_ksettings_set(struct phylink *, const struct ethtool_link_ksettings *)'
  'int phylink_ethtool_nway_reset(struct phylink *)'
  'int phylink_ethtool_set_eee(struct phylink *, struct ethtool_eee *)'
  'int phylink_ethtool_set_pauseparam(struct phylink *, struct ethtool_pauseparam *)'
  'int phylink_ethtool_set_wol(struct phylink *, struct ethtool_wolinfo *)'
  'int phylink_get_eee_err(struct phylink *)'
  'void phylink_mac_change(struct phylink *, bool)'
  'int phylink_mii_ioctl(struct phylink *, struct ifreq *, int)'
  'int phylink_of_phy_connect(struct phylink *, struct device_node *, u32)'
  'void phylink_set_port_modes(unsigned long int *)'
  'int phylink_speed_down(struct phylink *, bool)'
  'int phylink_speed_up(struct phylink *)'
  'void phylink_start(struct phylink *)'
  'void phylink_stop(struct phylink *)'
  'int platform_get_irq_byname_optional(struct platform_device *, const char *)'
  'int posix_clock_register(struct posix_clock *, struct device *)'
  'void posix_clock_unregister(struct posix_clock *)'
  'bool v4l2_find_dv_timings_cap(struct v4l2_dv_timings *, const struct v4l2_dv_timings_cap *, unsigned int, v4l2_check_dv_timings_fnc *, void *)'
  'int v4l2_src_change_event_subscribe(struct v4l2_fh *, const struct v4l2_event_subscription *)'

1 variable symbol(s) added
  'const struct vb2_mem_ops vb2_dma_contig_memops'

Bug: 239396464
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
Change-Id: Iabbed3d2d885b731c40374a548e40ea3f967d555
2022-12-22 18:05:25 +08:00
Bian Jin chen
d7137d26a6 ANDROID: GKI: Enable symbols for sensordev and hid
9 function symbol(s) added
  'int __hid_request(struct hid_device *, struct hid_report *, int)'
  'void class_remove_file_ns(struct class *, const struct class_attribute *, void *)'
  'int clk_hw_set_parent(struct clk_hw *, struct clk_hw *)'
  'void hid_hw_close(struct hid_device *)'
  'int hid_hw_open(struct hid_device *)'
  'void hid_hw_stop(struct hid_device *)'
  'int hid_report_raw_event(struct hid_device *, int, u8 *, u32, int)'
  'struct hid_report * hid_validate_values(struct hid_device *, unsigned int, unsigned int, unsigned int, unsigned int)'
  'int input_ff_create_memless(struct input_dev *, void *, int(*)(struct input_dev *, void *, struct ff_effect *))'

1 variable symbol(s) added
  'struct hid_ll_driver usb_hid_driver'

Bug: 239396464
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
Change-Id: I332619efca6d5e6428794ec27b7433e55b7c6cad
2022-12-22 17:33:14 +08:00
John Stultz
943836e729 FROMGIT: pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion
Wei Wang reported seeing priority inversion caused latencies
caused by contention on pmsg_lock, and suggested it be switched
to a rt_mutex.

I was initially hesitant this would help, as the tasks in that
trace all seemed to be SCHED_NORMAL, so the benefit would be
limited to only nice boosting.

However, another similar issue was raised where the priority
inversion was seen did involve a blocked RT task so it is clear
this would be helpful in that case.

Cc: Wei Wang <wvw@google.com>
Cc: Midas Chien<midaschieh@google.com>
Cc: Connor O'Brien <connoro@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Anton Vorontsov <anton@enomsg.org>
Cc: Colin Cross <ccross@android.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: kernel-team@android.com
Fixes: 9d5438f462 ("pstore: Add pmsg - user-space accessible pstore object")
Reported-by: Wei Wang <wvw@google.com>
Signed-off-by: John Stultz <jstultz@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221214231834.3711880-1-jstultz@google.com
Bug: 244348789
Bug: 261039801
(cherry picked from commit 76d62f24db
 https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/pstore)
Change-Id: I1ee429420f299eb65b84625f46763fe5a76d058f
Signed-off-by: John Stultz <jstultz@google.com>
2022-12-21 20:46:05 +00:00
Bian Jin chen
7c5b72200f ANDROID: GKI: Enable symbols for wifi
17 function symbol(s) added
  'char * iwe_stream_add_event(struct iw_request_info *, char *, char *, struct iw_event *, int)'
  'char * iwe_stream_add_point(struct iw_request_info *, char *, char *, struct iw_event *, char *)'
  'char * iwe_stream_add_value(struct iw_request_info *, char *, char *, char *, struct iw_event *, int)'
  'int mmc_sw_reset(struct mmc_host *)'
  'bool rfkill_set_hw_state(struct rfkill *, bool)'
  'bool rfkill_set_sw_state(struct rfkill *, bool)'
  'void sched_set_fifo_low(struct task_struct *)'
  'u8 sdio_readb(struct sdio_func *, unsigned int, int *)'
  'u32 sdio_readl(struct sdio_func *, unsigned int, int *)'
  'u16 sdio_readw(struct sdio_func *, unsigned int, int *)'
  'void sdio_retune_crc_disable(struct sdio_func *)'
  'void sdio_retune_crc_enable(struct sdio_func *)'
  'void sdio_retune_hold_now(struct sdio_func *)'
  'void sdio_retune_release(struct sdio_func *)'
  'void sdio_writeb(struct sdio_func *, u8, unsigned int, int *)'
  'void sdio_writel(struct sdio_func *, u32, unsigned int, int *)'
  'void sdio_writew(struct sdio_func *, u16, unsigned int, int *)'

Bug: 239396464
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
Change-Id: I9b904964e2751638bdca927699defbcdbbba3792
2022-12-21 19:06:05 +00:00
Bian Jin chen
f721f7b66e ANDROID: Enable symbols for sound and serial
22 function symbol(s) added
  'bool clk_is_match(const struct clk *, const struct clk *)'
  'bool of_device_is_big_endian(const struct device_node *)'
  'unsigned long int round_jiffies_relative(unsigned long int)'
  'void serial8250_clear_and_reinit_fifos(struct uart_8250_port *)'
  'void serial8250_do_pm(struct uart_port *, unsigned int, unsigned int)'
  'void serial8250_do_set_divisor(struct uart_port *, unsigned int, unsigned int, unsigned int)'
  'void serial8250_do_set_ldisc(struct uart_port *, struct ktermios *)'
  'void serial8250_do_set_termios(struct uart_port *, struct ktermios *, struct ktermios *)'
  'struct uart_8250_port * serial8250_get_port(int)'
  'int serial8250_handle_irq(struct uart_port *, unsigned int)'
  'int serial8250_register_8250_port(struct uart_8250_port *)'
  'void serial8250_resume_port(int)'
  'void serial8250_suspend_port(int)'
  'void serial8250_unregister_port(int)'
  'void serial8250_update_uartclk(struct uart_port *, unsigned int)'
  'int snd_pcm_stop_xrun(struct snd_pcm_substream *)'
  'void snd_soc_component_exit_regmap(struct snd_soc_component *)'
  'int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *, enum snd_soc_bias_level)'
  'int snd_soc_dapm_new_widgets(struct snd_soc_card *)'
  'int snd_soc_get_dai_name(struct of_phandle_args *, const char * *)'
  'int snd_soc_jack_add_zones(struct snd_soc_jack *, int, struct snd_soc_jack_zone *)'
  'int snd_soc_jack_get_type(struct snd_soc_jack *, int)'

Bug: 239396464
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
Change-Id: Ic3d6f701cf8a0ec2a3937899fce7089dc777a642
2022-12-21 19:06:05 +00:00
Kalesh Singh
206a66b5c4 ANDROID: Make SPF aware of fast mremaps
SPF attempts page faults without taking the mmap lock, but takes the
PTL. If there is a concurrent fast mremap (at PMD/PUD level), this
can lead to a UAF as fast mremap will only take the PTL locks at the
PMD/PUD level. SPF cannot take the PTL locks at the larger subtree
granularity since this introduces much contention in the page fault
paths.

To address the race:
  1) Fast mremaps wait until there are no users of the VMA.
  2) Speculative faults detect ongoing fast mremaps and fallback
    to conventional fault handling (taking mmap read lock).

Since this race condition is very rare the performance impact is
negligible.

Bug: 263177905
Change-Id: If9755aa4261337fe180e3093a3cefaae8ac9ff1a
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2022-12-20 09:55:41 -08:00
Farid Chahla
3cd617a48a ANDROID: GKI: enable mulitcolor-led
To enable newer version of DualSense driver, i.e. hid-playstation, we
need to set LEDS_CLASS_MULTICOLOR to "y".

Bug: 260685629
Change-Id: I52b0b1b6a061457e009b62a6bd6b66a91c8c37a2
Signed-off-by: Farid Chahla <farid.chahla@sony.com>
2022-12-19 19:50:48 +00:00
Roderick Colenbrander
2e557218f8 UPSTREAM: HID: playstation: support updated DualSense rumble mode.
Newer DualSense firmware supports a revised classic rumble mode,
which feels more similar to rumble as supported on previous PlayStation
controllers. It has been made the default on PlayStation and non-PlayStation
devices now (e.g. iOS and Windows). Default to this new mode when
supported.

Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20221010212313.78275-4-roderick.colenbrander@sony.com

Bug: 260685629
(cherry picked from commit 9fecab247e)
Change-Id: Icd330111a4d1b1e76a04cd11c623d0982ce3d66f
Signed-off-by: Farid Chahla <farid.chahla@sony.com>
2022-12-19 19:50:48 +00:00
Roderick Colenbrander
e32df322f1 UPSTREAM: HID: playstation: add initial DualSense Edge controller support
Provide initial support for the DualSense Edge controller. The brings
support up to the level of the original DualSense, but won't yet provide
support for new features (e.g. reprogrammable buttons).

Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
CC: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20221010212313.78275-3-roderick.colenbrander@sony.com

Bug: 260685629
(cherry picked from commit b8a968efab)
Change-Id: I5b95de806e823085d1144f016d8cfd76e4a933ef
Signed-off-by: Farid Chahla <farid.chahla@sony.com>
2022-12-19 19:50:48 +00:00
Roderick Colenbrander
2a22248b45 UPSTREAM: HID: playstation: stop DualSense output work on remove.
Ensure we don't schedule any new output work on removal and wait
for any existing work to complete. If we don't do this e.g. rumble
work can get queued during deletion and we trigger a kernel crash.

Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
CC: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20221010212313.78275-2-roderick.colenbrander@sony.com

Bug: 260685629
(cherry picked from commit 182934a1e9)
Change-Id: I40cadfde5765cdabf45def929860258d6019bf10
Signed-off-by: Farid Chahla <farid.chahla@sony.com>
2022-12-19 19:50:48 +00:00
Greg Kroah-Hartman
255a81bcd1 UPSTREAM: HID: playstation: convert to use dev_groups
There is no need for a driver to individually add/create device groups,
the driver core will do it automatically for you.  Convert the
hid-playstation driver to use the dev_groups pointer instead of manually
calling the driver core to create the group and have it be cleaned up
later on by the devm core.

Cc: Roderick Colenbrander <roderick.colenbrander@sony.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

Bug: 260685629
(cherry picked from commit b4a9af9be6)
Change-Id: I516a1b0ef7f4f8545e0c1b9485b49879dd7a3136
Signed-off-by: Farid Chahla <farid.chahla@sony.com>
2022-12-19 19:50:48 +00:00
Jiri Kosina
8621c4accd UPSTREAM: HID: playstation: fix return from dualsense_player_led_set_brightness()
brightness_set_blocking() callback expects function returning int. This fixes
the follwoing build failure:

drivers/hid/hid-playstation.c: In function ‘dualsense_player_led_set_brightness’:
drivers/hid/hid-playstation.c:885:1: error: no return statement in function returning non-void [-Werror=return-type]
 }
 ^

Signed-off-by: Jiri Kosina <jkosina@suse.cz>

Bug: 260685629
(cherry picked from commit 3c92cb4cb6)
Change-Id: Id16b960826a26ac22c1a14572444f9af29689ed6
Signed-off-by: Farid Chahla <farid.chahla@sony.com>
2022-12-19 19:50:48 +00:00
Roderick Colenbrander
409da497ab UPSTREAM: HID: playstation: expose DualSense player LEDs through LED class.
The DualSense player LEDs were so far not adjustable from user-space.
This patch exposes each LED individually through the LED class. Each
LED uses the new 'player' function resulting in a name like:
'inputX:white:player-1' for the first LED.

Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

Bug: 260685629
(cherry picked from commit 8c0ab553b0)
Change-Id: I49c699a99b0b8a7bb7980560e3ea7a12faf646aa
Signed-off-by: Farid Chahla <farid.chahla@sony.com>
2022-12-19 19:50:48 +00:00
Roderick Colenbrander
295a9c7f91 UPSTREAM: leds: add new LED_FUNCTION_PLAYER for player LEDs for game controllers.
Player LEDs are commonly found on game controllers from Nintendo and Sony
to indicate a player ID across a number of LEDs. For example, "Player 2"
might be indicated as "-x--" on a device with 4 LEDs where "x" means on.

This patch introduces LED_FUNCTION_PLAYER1-5 defines to properly indicate
player LEDs from the kernel. Until now there was no good standard, which
resulted in inconsistent behavior across xpad, hid-sony, hid-wiimote and
other drivers. Moving forward new drivers should use LED_FUNCTION_PLAYERx.

Note: management of Player IDs is left to user space, though a kernel
driver may pick a default value.

Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

Bug: 260685629
(cherry picked from commit 61177c088a)
Change-Id: Ie1de4d66304bb25fc2c9fcdb1ec9b7589ad9e7ac
Signed-off-by: Farid Chahla <farid.chahla@sony.com>
2022-12-19 19:50:48 +00:00
Roderick Colenbrander
c3336b229d UPSTREAM: HID: playstation: expose DualSense lightbar through a multi-color LED.
The DualSense lightbar has so far been supported, but it was not yet
adjustable from user space. This patch exposes it through a multi-color
LED.

Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

Bug: 260685629
(cherry picked from commit fc97b4d6a1)
Change-Id: I48204113da804b13ad5bed2f651a5826ab5a86f7
Signed-off-by: Farid Chahla <farid.chahla@sony.com>
2022-12-19 19:50:48 +00:00
Pavel Machek
39563d2066 UPSTREAM: Documentation: leds: standartizing LED names
We have a list of valid functions, but LED names in sysfs are still
far from being consistent. Create list of "well known" LED names so we
nudge people towards using same LED names (except color) for same
functionality.

Signed-off-by: Pavel Machek <pavel@ucw.cz>

Bug: 260685629
(cherry picked from commit 09f1273064)
Change-Id: Iea12a9c230d6cd072b0f4fd4e0c616348173dd53
Signed-off-by: Farid Chahla <farid.chahla@sony.com>
2022-12-19 19:50:48 +00:00
Bian Jin chen
ceff5c1670 ANDROID: GKI: Add symbols for crypto
23 function symbol(s) added
  'void __crypto_xor(u8 *, const u8 *, const u8 *, unsigned int)'
  'int ce_aes_expandkey(struct crypto_aes_ctx *, const u8 *, unsigned int)'
  'int crypto_ahash_digest(struct ahash_request *)'
  'int crypto_ahash_final(struct ahash_request *)'
  'struct crypto_ahash * crypto_alloc_ahash(const char *, u32, u32)'
  'struct crypto_akcipher * crypto_alloc_akcipher(const char *, u32, u32)'
  'struct crypto_async_request * crypto_dequeue_request(struct crypto_queue *)'
  'int crypto_enqueue_request(struct crypto_queue *, struct crypto_async_request *)'
  'void crypto_inc(u8 *, unsigned int)'
  'void crypto_init_queue(struct crypto_queue *, unsigned int)'
  'int crypto_register_akcipher(struct akcipher_alg *)'
  'int crypto_sha1_finup(struct shash_desc *, const u8 *, unsigned int, u8 *)'
  'int crypto_sha1_update(struct shash_desc *, const u8 *, unsigned int)'
  'void crypto_unregister_ahash(struct ahash_alg *)'
  'void crypto_unregister_akcipher(struct akcipher_alg *)'
  'void crypto_unregister_algs(struct crypto_alg *, int)'
  'void crypto_unregister_skcipher(struct skcipher_alg *)'
  'void gf128mul_lle(be128 *, const be128 *)'
  'int rsa_parse_priv_key(struct rsa_key *, void *, unsigned int)'
  'int rsa_parse_pub_key(struct rsa_key *, void *, unsigned int)'
  'struct scatterlist * sg_last(struct scatterlist *, unsigned int)'
  'int sg_nents(struct scatterlist *)'
  'size_t sg_pcopy_to_buffer(struct scatterlist *, unsigned int, void *, size_t, off_t)'

Bug: 239396464
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
Change-Id: I6ead1bad2e1fb4935a9e044e54f7c6a25a314dfa
2022-12-17 12:08:39 +08:00