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

Apply SPI TPM patches from upstream #9

Open
wants to merge 152 commits into
base: main
Choose a base branch
from

Conversation

tdavenvidia
Copy link
Contributor

No description provided.

ianmay81 and others added 30 commits May 30, 2023 10:41
Ignore: yes
Signed-off-by: Ian May <[email protected]>
Ignore: yes
Signed-off-by: Dimitri John Ledkov <[email protected]>
BugLink: https://bugs.launchpad.net/bugs/1992162
Properties: no-test-build
Signed-off-by: Dimitri John Ledkov <[email protected]>
Ignore: yes
Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
BugLink: https://bugs.launchpad.net/bugs/1996300
Properties: no-test-build
Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
Ignore: yes
Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
BugLink: https://bugs.launchpad.net/bugs/1998795
Properties: no-test-build
Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
Ignore: yes
Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
BugLink: https://bugs.launchpad.net/bugs/1999745
Properties: no-test-build
Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
BugLink: https://bugs.launchpad.net/bugs/2002679

This reverts commit e96b739.

In order to use the same compiler as used for kinetic:linux (gcc-12) we have
made some changes to explicitly compile jammy:linux-hwe-5.19 with the same
compiler. However, such changes are breaking the build of a number of dkms
packages. Revert this commit, which would make the kernel compile with the
default GCC in Jammy (gcc-11), while a proper solution is being worked on.

Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
Ignore: yes
Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
BugLink: https://bugs.launchpad.net/bugs/2002679

Changing the gcc version used for the build from gcc-12 to gcc (11)
removed CONFIG_INIT_STACK_ALL_ZERO and CONFIG_SHADOW_CALL_STACK from
being an option on the kernel config. Update the annotations file
accondingly, keeping the annotation instead of simply removing it so
when the configs are re-enabled in the future it stays as a reminder
to update the annotation.

Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
BugLink: https://bugs.launchpad.net/bugs/2001755
Properties: no-test-build
Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
In the Jammy environment, some config options cannot be enabled as
enforced in the parent kernel. Add code to automatically adjust those.
This was attempted to be manual edits to the annotations. However those
get overwritten on each rebase. So instead add it to the local-mangle
script but run only if the compiler set to be used is gcc-11.

Ignore: yes
Signed-off-by: Stefan Bader <[email protected]>
ianmay81 and others added 29 commits May 31, 2023 11:56
BugLink: https://bugs.launchpad.net/bugs/1982519
nvbug: https://nvbugswb.nvidia.com/NVBugs5/redir.aspx?url=/3728100

With this change, the NFS driver would be enabled to
support GPUDirectStorage(GDS). The change is around
frwr_map and frwr_unmap in the NFS driver, where the
IO request is first intercepted to check for GDS pages and
if it is a GDS page then the request is served by GDS driver
component called nvidia-fs, else the request would be served
by the standard NFS driver code.

Signed-off-by: Sourab Gupta <[email protected]>
Acked-by: Kiran Kumar Modukuri <[email protected]>
Acked-by: Rebanta Mitra <[email protected]>
Signed-off-by: Brad Figg <[email protected]>
Ignore: yes
Signed-off-by: Brad Figg <[email protected]>
Ignore: yes
Signed-off-by: Roxana Nicolescu <[email protected]>
Signed-off-by: Brad Figg <[email protected]>
CVE-2023-1829
Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
Acked-by: Cengiz Can <[email protected]>
Acked-by: Stefan Bader <[email protected]>
Signed-off-by: Stefan Bader <[email protected]>
Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
Signed-off-by: Brad Figg <[email protected]>
CONFIG_SERIAL_8250_MID=y
CONFIG_SND_HDA_INTEL_DMI_SILENT_STREAM=y
CONFIG_HSU_DMA=y

Signed-off-by: Brad Figg <[email protected]>
…idia-fs version changed to 2.15.3~jammy

Signed-off-by: Brad Figg <[email protected]>
BugLink: https://bugs.launchpad.net/bugs/2021535

ARM architecture only has 'memory', so all devices are accessed by
MMIO if possible.

Signed-off-by: Jammy Huang <[email protected]>
Reviewed-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Thomas Zimmermann <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Acked-by: Brad Figg <[email protected]>
Acked-by: Jamie Nguyen <[email protected]>
(cherry picked from commit 4327a6137ed43a091d900b1ac833345d60f32228)
Signed-off-by: Ian May <[email protected]>
Ignore: yes
Signed-off-by: Ian May <[email protected]>
Copied from master

Ignore: yes
Signed-off-by: Ian May <[email protected]>
Tegra QSPI controller only supports half duplex transfers.
Set half duplex constrain flag.

Signed-off-by: Krishna Yarlagadda <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit f7482d8285b638be87a594a30edaaf1341135c1a)
Signed-off-by: Tushar Dave <[email protected]>
Check for non dma transfers that do not fit in FIFO has issue and skips
combined sequence for Tegra234 & Tegra241 which does not have GPCDMA.

Fixes: 1b8342c ("spi: tegra210-quad: combined sequence mode")

Signed-off-by: Krishna Yarlagadda <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 047ee71ae4f412d8819e39e4b08c588fa299cfc2)
Signed-off-by: Tushar Dave <[email protected]>
Fix warn: iterator used outside loop: 'xfer'. 'xfer' variable contain
invalid value in few conditions. Complete transfer within DATA phase
in successful case and at the end for failed transfer.

Reported-by: Dan Carpenter <[email protected]>
Link:https://lore.kernel.org/all/[email protected]/
Fixes: 8777dd9 ("spi: tegra210-quad: Fix combined sequence")

Signed-off-by: Krishna Yarlagadda <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 2449d436681d40bc63ec2c766fd51b632270d8a7)
Signed-off-by: Tushar Dave <[email protected]>
TPM specification [1] defines flow control over SPI. Client device can
insert a wait state on MISO when address is transmitted by controller
on MOSI. Detecting the wait state in software is only possible for
full duplex controllers. For controllers that support only half-
duplex, the wait state detection needs to be implemented in hardware.

Add a flag SPI_TPM_HW_FLOW for TPM device to set when software flow
control is not possible and hardware flow control is expected from
SPI controller.

Reference:
[1] https://trustedcomputinggroup.org/resource/pc-client-platform-tpm
-profile-ptp-specification/

Signed-off-by: Krishna Yarlagadda <[email protected]>
Reviewed-by: Jerry Snitselaar <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 67a142dc9eb96a5cc018e5db62390665eb5f038c)
(tdave: minor conflict in include/linux/spi/spi.h)
Signed-off-by: Tushar Dave <[email protected]>
Trusted Platform Module requires flow control. As defined in TPM
interface specification, client would drive MISO line at same cycle as
last address bit on MOSI.
Tegra234 and Tegra241 QSPI controllers have TPM wait state detection
feature which is enabled for TPM client devices reported in SPI device
mode bits.

Signed-off-by: Krishna Yarlagadda <[email protected]>
Reviewed-by: Jon Hunter <[email protected]>
Reviewed-by: Jerry Snitselaar <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
(cherry picked from commit 967ca91a996f82219f2883e9e53d8e20df49025a)
Signed-off-by: Tushar Dave <[email protected]>
TPM devices may insert wait state on last clock cycle of ADDR phase.
For SPI controllers that support full-duplex transfers, this can be
detected using software by reading the MISO line. For SPI controllers
that only support half-duplex transfers, such as the Tegra QSPI, it is
not possible to detect the wait signal from software. The QSPI
controller in Tegra234 and Tegra241 implement hardware detection of the
wait signal which can be enabled in the controller for TPM devices.

The current TPM TIS driver only supports software detection of the wait
signal. To support SPI controllers that use hardware to detect the wait
signal, add the function tpm_tis_spi_hw_flow_transfer() and move the
existing code for software based detection into a function called
tpm_tis_spi_sw_flow_transfer(). SPI controllers that only support
half-duplex transfers will always call tpm_tis_spi_hw_flow_transfer()
because they cannot support software based detection. The bit
SPI_TPM_HW_FLOW is set to indicate to the SPI controller that hardware
detection is required and it is the responsibility of the SPI controller
driver to determine if this is supported or not.

For hardware flow control, CMD-ADDR-DATA messages are combined into a
single message where as for software flow control exiting method of
CMD-ADDR in a message and DATA in another is followed.

Signed-off-by: Krishna Yarlagadda <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>
(cherry picked from commit 394dfc8ac4b00b38d4fb781794967aa5b2eac687 linux-next)
Signed-off-by: Tushar Dave <[email protected]>
Enable missing configs in the arm64 defconfig to get all devices probing
on the mt8183-kukui-jacuzzi-juniper machine.

The devices enabled are: ATH10K SDIO wireless adapter, Elan touchscreen,
cr50 TPM, MediaTek SPI controller, JPEG video decoder, ANX7625 DSI/DPI
to DP bridge (used for the internal display), MT8183 sound cards, SCP
co-processor, MediaTek Global Command Engine (controlled by CMDQ
driver), MediaTek Smart Voltage Scaling (SVS) engine, CCI frequency
and voltage scaling, AUXADC thermal sensors.

All symbols are enabled as modules with the exception of SPI, which is
enabled as builtin since on some platforms like mt8195-cherry, the
ChromeOS Embedded Controller is connected through SPI and it is
responsible for the regulators powering the MMC controller used for the
SD card, and thus SPI support is required for booting.

By enabling the support for all of this machine's devices on the
defconfig we make it effortless to test the relevant hardware both by
developers as well as CI systems like KernelCI.

Signed-off-by: Nícolas F. R. A. Prado <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Tested-by: AngeloGioacchino Del Regno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Matthias Brugger <[email protected]>
(cherry picked from commit 83f3da5 linux-next)
Signed-off-by: Tushar Dave <[email protected]>
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.