Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Intel-SIG] MTL mei driver updates sync with upstream (6.9) #245

Merged
merged 10 commits into from
Jun 14, 2024

Conversation

quanxianwang
Copy link
Contributor

f6085a9,mei: vsc: Unregister interrupt handler for system suspend,2024-04-11 15:15:53 +0200,Sakari Ailus [email protected],v6.9
#vsc-tp
e3dc66d,Revert "mei: vsc: Call wake_up() in the threaded IRQ handler",2024-04-11 15:15:52 +0200,Sakari Ailus [email protected],v6.9
bb41fe3,Merge tag 'char-misc-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc,2024-03-21 13:21:31 -0700,Linus Torvalds [email protected],v6.9
33a2120,mei: vsc: Assign pinfo fields in variable declaration,2024-03-05 14:28:22 +0000,Sakari Ailus [email protected],v6.9
b8b19ac,mei: vsc: Don't use sleeping condition in wait_event_timeout(),2024-03-05 14:28:22 +0000,Sakari Ailus [email protected],v6.9
058a38a,mei: vsc: Call wake_up() in the threaded IRQ handler,2024-03-05 14:28:22 +0000,Sakari Ailus [email protected],v6.9
daaf528,mei: Add Meteor Lake support for IVSC device,2024-02-19 11:40:17 +0100,Wentong Wu [email protected],v6.8

platform vsc list

469b832,mei: vsc: Convert to platform remove callback returning void,2024-03-05 14:28:52 +0000,Uwe Kleine-König [email protected],v6.9
386a766,mei: Add MEI hardware support for IVSC device,2023-12-07 11:41:40 +0900,Wentong Wu [email protected],v6.8

hardware for vsc support###

566f5ca,mei: Add transport driver for IVSC device,2023-12-07 11:41:40 +0900,Wentong Wu [email protected],v6.8

wentongwu and others added 10 commits May 30, 2024 12:54
mainline:566f5ca9768075e453b7b51a397733968df4287d
severity: Moderate

upstream commit 566f5ca ("mei: Add transport driver for IVSC device")

The Intel visual sensing controller (IVSC) device is designed to control
the camera sharing between host IPU for media usage and IVSC for context
sensing (face detection).

IVSC is exposed to HOST as an SPI device and the message protocol over
the SPI BUS for communicating with the IVSC device is implemented. This
is the backend of mei framework for IVSC device, which usually handles
the hardware data transfer. The mei_csi and mei_ace are the clients of
IVSC mei framework.

The firmware downloading for the IVSC device is implemented as well.

Intel-SIG: commit 566f5ca ("mei: Add transport driver for IVSC device")

Signed-off-by: Wentong Wu <[email protected]>
Reviewed-by: Sakari Ailus <[email protected]>
Tested-by: Hao Yao <[email protected]>
Acked-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
mainline:386a766c4169006d0e9df44823849930b8995e32
severity: Moderate

upstream commit 386a766 ("mei: Add MEI hardware support for IVSC device")

The protocol used for the IVSC device to communicate with HOST is MEI.
The MEI hardware interfaces for the IVSC device are implemented.

The APIs are exposed by MEI framework to mei clients, e.g. mei_csi and
mei_ace.

Intel-SIG: commit 386a766 ("mei: Add MEI hardware support for IVSC device")

Signed-off-by: Wentong Wu <[email protected]>
Reviewed-by: Alexander Usyskin <[email protected]>
Reviewed-by: Sakari Ailus <[email protected]>
Tested-by: Hao Yao <[email protected]>
Acked-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
mainline:469b832d44f3db7f873d6739a85f26c41681f697
severity: Moderate

upstream commit 469b832 ("mei: vsc: Convert to platform remove callback returning void")

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Intel-SIG: commit 469b832 ("mei: vsc: Convert to platform remove callback returning void")

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Link: https://lore.kernel.org/r/8e14f0b1cea107e613fa0075b3379a9f1e7ef63f.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
mainline:daaf5286b6d2528a73c651aa2d4059bc1bd67c2e
severity: Moderate

upstream commit daaf528 ("mei: Add Meteor Lake support for IVSC device")

Add IVSC device support on Meteor Lake platform.

Intel-SIG: commit daaf528 ("mei: Add Meteor Lake support for IVSC device")

Signed-off-by: Wentong Wu <[email protected]>
Cc: stable <[email protected]>
Reviewed-by: Sakari Ailus <[email protected]>
Acked-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
mainline:058a38acba15fd8e7b262ec6e17c4204cb15f984
severity: Moderate

upstream commit 058a38a ("mei: vsc: Call wake_up() in the threaded IRQ handler")

The hard IRQ handler vsc_tp_irq() is called with a raw spinlock taken.
wake_up() acquires a spinlock, a sleeping lock on PREEMPT_RT. This leads
to sleeping in atomic context.

Move the wake_up() call to the threaded IRQ handler vsc_tp_thread_isr()
where it can be safely called.

Fixes: 566f5ca ("mei: Add transport driver for IVSC device")

Intel-SIG: commit 058a38a ("mei: vsc: Call wake_up() in the threaded IRQ handler")

Signed-off-by: Sakari Ailus <[email protected]>
Tested-and-Reviewed-by: Wentong Wu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
mainline:b8b19acfafdeacbedd4e2795cb18c81c4d8bb6cc
severity: Moderate

upstream commit b8b19ac ("mei: vsc: Don't use sleeping condition in wait_event_timeout()")

vsc_tp_wakeup_request() called wait_event_timeout() with
gpiod_get_value_cansleep() which may sleep, and does so as the
implementation is that of gpio-ljca.

Move the GPIO state check outside the call.

Fixes: 566f5ca ("mei: Add transport driver for IVSC device")

Intel-SIG: commit b8b19ac ("mei: vsc: Don't use sleeping condition in wait_event_timeout()")

Signed-off-by: Sakari Ailus <[email protected]>
Tested-and-Reviewed-by: Wentong Wu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
mainline:33a2120b875f9b93b6ea2db2cc8f706a9eb3e35d
severity: Moderate

upstream commit 33a2120 ("mei: vsc: Assign pinfo fields in variable declaration")

Assign all possible fields of pinfo in variable declaration, instead of
just zeroing it there.

Intel-SIG: commit 33a2120 ("mei: vsc: Assign pinfo fields in variable declaration")

Signed-off-by: Sakari Ailus <[email protected]>
Tested-and-Reviewed-by: Wentong Wu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
mainline:1e21acb7fbfb15fcb4afe21fb5a50a1bc00743ec
severity: Moderate

upstream commit 1e21acb ("sh: hd64461: Make setup_hd64461() static")

Enforce internal linkage for setup_hd64461().

This fixes the following error:
arch/sh/cchips/hd6446x/hd64461.c:75:12: error: no previous prototype for 'setup_hd64461' [-Werror=missing-prototypes]

Intel-SIG: commit 1e21acb ("sh: hd64461: Make setup_hd64461() static")

Signed-off-by: Artur Rojek <[email protected]>
Reviewed-by: John Paul Adrian Glaubitz <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
mainline:e3dc66d998d2b0c2734db9ca1d6c94c97349529a
severity: Moderate

upstream commit e3dc66d ("Revert "mei: vsc: Call wake_up() in the threaded IRQ handler"")

This reverts commit 058a38a.

It's not necessary to avoid a spinlock, a sleeping lock on PREEMPT_RT, in
an interrupt handler as the interrupt handler itself would be called in a
process context if PREEMPT_RT is enabled. So revert the patch.

Intel-SIG: commit e3dc66d ("Revert "mei: vsc: Call wake_up() in the threaded IRQ handler"")

Cc: [email protected] # for 6.8
Signed-off-by: Sakari Ailus <[email protected]>
Acked-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
mainline:f6085a96c97387154be7eaebd1a5420eb3cd55dc
severity: Moderate

upstream commit f6085a9 ("mei: vsc: Unregister interrupt handler for system suspend")

Unregister the MEI VSC interrupt handler before system suspend and
re-register it at system resume time. This mirrors implementation of other
MEI devices.

This patch fixes the bug that causes continuous stream of MEI VSC errors
after system resume.

Fixes: 386a766 ("mei: Add MEI hardware support for IVSC device")

Intel-SIG: commit f6085a9 ("mei: vsc: Unregister interrupt handler for system suspend")

Cc: [email protected] # for 6.8
Reported-by: Dominik Brodowski <[email protected]>
Signed-off-by: Wentong Wu <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Acked-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
[ Quanxian Wang: amend commit log ]
Signed-off-by: Quanxian Wang <[email protected]>
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign utsweetyfish for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link

deepin pr auto review

Intel VSC-TP: Add Linux driver for Intel Visual Sensing Controller Transport Layer

This patch adds a Linux driver for Intel Visual Sensing Controller Transport
Layer (VSC-TP). The VSC-TP is responsible for communication between the
processor and the visual sensing controller (VSC). It uses a SPI protocol for
communication with the VSC.

The driver provides a generic SPI driver for VSC-TP devices, including
initialization, reset, and interrupt handling. It also provides a simple API
for sending and receiving data over SPI.

The driver is designed to work with Intel Alder Lake, Tiger Lake, and Meteor
Lake processors.

The patch includes the driver header file, the driver implementation, and the
ACPI device IDs for identifying VSC-TP devices.

MingcongBai pushed a commit to MingcongBai/deepin-kernel that referenced this pull request Jun 3, 2024
The ptp channel instance is only initialized when ptp traffic is first
processed by the driver. This means that there is a window in between when
port timestamping is enabled and ptp traffic is sent where the ptp channel
instance is not initialized. Accessing statistics during this window will
lead to an access violation (NULL + member offset). Check the validity of
the instance before attempting to query statistics.

  BUG: unable to handle page fault for address: 0000000000003524
  #PF: supervisor read access in kernel mode
  #PF: error_code(0x0000) - not-present page
  PGD 109dfc067 P4D 109dfc067 PUD 1064ef067 PMD 0
  Oops: 0000 [deepin-community#1] SMP
  CPU: 0 PID: 420 Comm: ethtool Not tainted 6.9.0-rc2-rrameshbabu+ deepin-community#245
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS Arch Linux 1.16.3-1-1 04/01/204
  RIP: 0010:mlx5e_stats_ts_get+0x4c/0x130
  <snip>
  Call Trace:
   <TASK>
   ? show_regs+0x60/0x70
   ? __die+0x24/0x70
   ? page_fault_oops+0x15f/0x430
   ? do_user_addr_fault+0x2c9/0x5c0
   ? exc_page_fault+0x63/0x110
   ? asm_exc_page_fault+0x27/0x30
   ? mlx5e_stats_ts_get+0x4c/0x130
   ? mlx5e_stats_ts_get+0x20/0x130
   mlx5e_get_ts_stats+0x15/0x20
  <snip>

Fixes: 3579032 ("net/mlx5e: Implement ethtool hardware timestamping statistics")
Signed-off-by: Rahul Rameshbabu <[email protected]>
Signed-off-by: Tariq Toukan <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
@matrix-wsk matrix-wsk merged commit bb677eb into deepin-community:linux-6.6.y Jun 14, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants