]> Git Repo - linux.git/log
linux.git
4 years agocoresight: etm4x: Cleanup secure exception level masks
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:37 +0000 (11:13 -0700)]
coresight: etm4x: Cleanup secure exception level masks

We rely on the ETM architecture version to decide whether
Secure EL2 is available on the CPU for excluding the level
for address comparators and viewinst main control register.
We must instead use the TRCDIDR3.EXLEVEL_S field to detect
the supported levels.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: etm4x: Check for Software Lock
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:36 +0000 (11:13 -0700)]
coresight: etm4x: Check for Software Lock

The Software lock is not implemented for system instructions
based accesses. So, skip the lock register access in such
cases.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mike Leach <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: etm4x: Define DEVARCH register fields
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:35 +0000 (11:13 -0700)]
coresight: etm4x: Define DEVARCH register fields

Define the fields of the DEVARCH register for identifying
a component as an ETMv4.x unit. Going forward, we use the
DEVARCH register for the component identification, rather
than the TRCIDR3.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mike Leach <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: etm4x: Hide sysfs attributes for unavailable registers
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:34 +0000 (11:13 -0700)]
coresight: etm4x: Hide sysfs attributes for unavailable registers

Some of the management registers in ETMv4.x are not accessible
via system register instructions. Thus we must hide the sysfs
files exposing them to the userspace, to prevent system crashes.

This patch adds an is_visible() routine to control the visibility
at runtime for the registers that may not be accessed.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mathieu Poirier <[email protected]>
Cc: Mike Leach <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: etm4x: Add sysreg access helpers
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:33 +0000 (11:13 -0700)]
coresight: etm4x: Add sysreg access helpers

ETM architecture defines the system instructions for accessing
via register accesses. Add basic support for accessing a given
register via system instructions.

We split the list of registers as :
 1) Accessible only from memory mapped interface
 2) Accessible from system register instructions.

All registers are accessible via the memory-mapped interface.
However, some registers are not accessible via the system
instructions. This list is then used to further filter out
the files we expose via sysfs.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mike Leach <[email protected]>
Cc: Mathieu Poirier <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: etm4x: Add commentary on the registers
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:32 +0000 (11:13 -0700)]
coresight: etm4x: Add commentary on the registers

As we are about define a switch..case table for individual register
access by offset for implementing the system instruction support,
document the possible set of registers for each group to make
it easier to correlate.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mike Leach <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: etm4x: Make offset available for sysfs attributes
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:31 +0000 (11:13 -0700)]
coresight: etm4x: Make offset available for sysfs attributes

Some of the ETM management registers are not accessible via
system instructions. Thus we need to filter accesses to these
registers depending on the access mechanism for the ETM at runtime.
The driver can cope with this for normal operation, by regular
checks. But the driver also exposes them via sysfs, which now
needs to be removed.

So far, we have used the generic coresight sysfs helper macros
to export a given device register, defining a "show" operation
per register. This is not helpful to filter the files at runtime,
based on the access.

In order to do this dynamically, we need to filter the attributes
by offsets and hard coded "show" functions doesn't make this easy.
Thus, switch to extended attributes, storing the offset in the scratch
space. This allows us to implement filtering based on the offset and
also saves us some text size. This will be later used for determining
a given attribute must be "visible" via sysfs.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mathieu Poirier <[email protected]>
Cc: Mike Leach <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: etm4x: Convert all register accesses
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:30 +0000 (11:13 -0700)]
coresight: etm4x: Convert all register accesses

Convert all register accesses from etm4x driver to use a wrapper
to allow switching the access at runtime with little overhead.

co-developed by sed tool ;-), mostly equivalent to :

s/readl\(_relaxed\)\?(drvdata->base + \(.*\))/etm4x_\1_read32(csdev, \2)
s/writel\(_relaxed\)\?(\(.*\), drvdata->base + \(.*\))/etm4x_\1_write32(csdev, \2, \3)

We don't want to replace them with the csdev_access_* to
avoid a function call for every register access for system
register access. This is a prepartory step to add system
register access later where the support is available.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mike Leach <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: etm4x: Always read the registers on the host CPU
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:29 +0000 (11:13 -0700)]
coresight: etm4x: Always read the registers on the host CPU

As we are about to add support for sysreg access to ETM4.4+ components,
make sure that we read the registers only on the host CPU.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mike Leach <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: Convert claim/disclaim operations to use access wrappers
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:28 +0000 (11:13 -0700)]
coresight: Convert claim/disclaim operations to use access wrappers

Convert the generic CLAIM tag management APIs to use the
device access layer abstraction.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mike Leach <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: Convert coresight_timeout to use access abstraction
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:27 +0000 (11:13 -0700)]
coresight: Convert coresight_timeout to use access abstraction

Convert the generic routines to use the new access abstraction layer
gradually, starting with coresigth_timeout.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mike Leach <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: tpiu: Prepare for using coresight device access abstraction
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:26 +0000 (11:13 -0700)]
coresight: tpiu: Prepare for using coresight device access abstraction

Prepare the TPIU driver to make use of the CoreSight device access
abstraction layer. The driver touches the device even before the
coresight device is registered. Thus we could be accessing the
devices without a csdev. As we are about to use the abstraction
layer for accessing the device, pass in the access directly
to avoid having to deal with the un-initialised csdev.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mike Leach <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: Introduce device access abstraction
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:25 +0000 (11:13 -0700)]
coresight: Introduce device access abstraction

We are about to introduce support for sysreg access to ETMv4.4+
component. Since there are generic routines that access the
registers (e.g, CS_LOCK/UNLOCK , claim/disclaim operations, timeout)
and in order to preserve the logic of these operations at a
single place we introduce an abstraction layer for the accesses
to a given device.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mike Leach <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: etm4x: Skip accessing TRCPDCR in save/restore
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:24 +0000 (11:13 -0700)]
coresight: etm4x: Skip accessing TRCPDCR in save/restore

When the ETM is affected by Qualcomm errata, modifying the
TRCPDCR could cause the system hang. Even though this is
taken care of during enable/disable ETM, the ETM state
save/restore could still access the TRCPDCR. Make sure
we skip the access during the save/restore.

Found by code inspection.

Link: https://lore.kernel.org/r/[email protected]
Fixes: 02510a5aa78d ("coresight: etm4x: Add support to skip trace unit power up")
Cc: Mathieu Poirier <[email protected]>
Cc: Mike Leach <[email protected]>
Cc: Sai Prakash Ranjan <[email protected]>
Cc: Tingwei Zhang <[email protected]>
Tested-by: Sai Prakash Ranjan <[email protected]>
Reviewed-by: Sai Prakash Ranjan <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: etm4x: Handle access to TRCSSPCICRn
Suzuki K Poulose [Mon, 1 Feb 2021 18:13:23 +0000 (11:13 -0700)]
coresight: etm4x: Handle access to TRCSSPCICRn

TRCSSPCICR<n> is present only if all of the following are true:
TRCIDR4.NUMSSCC > n.
TRCIDR4.NUMPC > 0b0000 .
TRCSSCSR<n>.PC == 0b1

Add a helper function to check all the conditions.

Link: https://lore.kernel.org/r/[email protected]
Cc: Mike Leach <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: etm4x: add AMBA id for Cortex-A55 and Cortex-A75
Chunyan Zhang [Mon, 1 Feb 2021 18:13:22 +0000 (11:13 -0700)]
coresight: etm4x: add AMBA id for Cortex-A55 and Cortex-A75

Add AMBA UCI id to support Cortex-A55(Ananke) and Cortex-A75(Promethus).

Reviewed by: Mike Leach <[email protected]>

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bin Ji <[email protected]>
Signed-off-by: Chunyan Zhang <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agocoresight: cti: Reduce scope for the variable 'cs_fwnode' in cti_plat_create_connection()
Markus Elfring [Mon, 1 Feb 2021 18:13:21 +0000 (11:13 -0700)]
coresight: cti: Reduce scope for the variable 'cs_fwnode' in cti_plat_create_connection()

A local variable was used only within an else branch.
Thus move the definition for the variable “cs_fwnode” into
the corresponding code block.

This issue was detected by using the Coccinelle software.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Markus Elfring <[email protected]>
Signed-off-by: Mathieu Poirier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agorandom: fix the RNDRESEEDCRNG ioctl
Eric Biggers [Tue, 12 Jan 2021 19:28:18 +0000 (11:28 -0800)]
random: fix the RNDRESEEDCRNG ioctl

The RNDRESEEDCRNG ioctl reseeds the primary_crng from itself, which
doesn't make sense.  Reseed it from the input_pool instead.

Fixes: d848e5f8e1eb ("random: add new ioctl RNDRESEEDCRNG")
Cc: [email protected]
Cc: [email protected]
Cc: Andy Lutomirski <[email protected]>
Cc: Jann Horn <[email protected]>
Cc: Theodore Ts'o <[email protected]>
Reviewed-by: Jann Horn <[email protected]>
Acked-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Eric Biggers <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agomisc: pvpanic: sysfs_emit uses should have a newline
Joe Perches [Fri, 29 Jan 2021 19:08:01 +0000 (11:08 -0800)]
misc: pvpanic: sysfs_emit uses should have a newline

Add newline terminations to the sysfs_emit uses added by -next
commit 8d6da6575ffe ("misc: pvpanic: introduce events device attribue")

Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: zhenwei pi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agoMerge tag 'misc-habanalabs-next-2021-01-27' of https://git.kernel.org/pub/scm/linux...
Greg Kroah-Hartman [Thu, 4 Feb 2021 15:53:13 +0000 (16:53 +0100)]
Merge tag 'misc-habanalabs-next-2021-01-27' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux into char-misc-next

Oded writes:

This tag contains habanalabs driver changes for v5.12:

- Add feature called "staged command submissions". In this feature,
  the driver allows the user to submit multiple command submissions
  that describe a single pass on the deep learning graph. The driver
  tracks the completion of the entire pass by the last stage CS.

- Update code to support the latest firmware image

- Optimizations and improvements to MMU code:
  - Support page size that is not power-of-2
  - Make the locks scheme simpler
  - mmap areas in device configuration space to userspace

- Security fixes:
  - Make ETR non-secured
  - Remove access to kernel memory through debug-fs interface
  - Remove access through PCI bar to SyncManager register block
    in Gaudi

- Many small bug fixes

* tag 'misc-habanalabs-next-2021-01-27' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux: (41 commits)
  habanalabs: update to latest hl_boot_if.h spec from F/W
  habanalabs/gaudi: unmask HBM interrupts after handling
  habanalabs: update SyncManager interrupt handling
  habanalabs: fix ETR security issue
  habanalabs: staged submission support
  habanalabs: modify device_idle interface
  habanalabs: add CS completion and timeout properties
  habanalabs: add new mem ioctl op for mapping hw blocks
  habanalabs: fix MMU debugfs related nodes
  habanalabs: add user available interrupt to hw_ip
  habanalabs: always try to use the hint address
  CREDITS: update email address and home address
  habanalabs: update email address in sysfs/debugfs docs
  habanalabs: add security violations dump to debugfs
  habanalabs: ignore F/W BMC errors in case no BMC present
  habanalabs/gaudi: print sync manager SEI interrupt info
  habanalabs: Use 'dma_set_mask_and_coherent()'
  habanalabs/gaudi: remove PCI access to SM block
  habanalabs: add driver support for internal cb scheduling
  habanalabs: increment ctx ref from within a cs allocation
  ...

4 years agophy: mediatek: Add missing MODULE_DEVICE_TABLE()
Boris Brezillon [Wed, 3 Feb 2021 11:06:30 +0000 (12:06 +0100)]
phy: mediatek: Add missing MODULE_DEVICE_TABLE()

This patch adds the missing MODULE_DEVICE_TABLE definitions on different
Mediatek phy drivers which generates correct modalias for automatic loading
when these drivers are compiled as an external module.

Signed-off-by: Boris Brezillon <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
4 years agophy: phy-brcm-sata: remove unneeded semicolon
Yang Li [Wed, 3 Feb 2021 02:58:07 +0000 (10:58 +0800)]
phy: phy-brcm-sata: remove unneeded semicolon

Eliminate the following coccicheck warning:
./drivers/phy/broadcom/phy-brcm-sata.c:654:2-3: Unneeded semicolon

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
4 years agophy: qualcomm: usb28nm: Add MDM9607 init sequence
Konrad Dybcio [Sun, 31 Jan 2021 01:31:24 +0000 (02:31 +0100)]
phy: qualcomm: usb28nm: Add MDM9607 init sequence

This is required to bring up the PHY on MDM9607-based boards.

Signed-off-by: Konrad Dybcio <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
4 years agophy: USB_LGM_PHY should depend on X86
Geert Uytterhoeven [Fri, 29 Jan 2021 13:17:53 +0000 (14:17 +0100)]
phy: USB_LGM_PHY should depend on X86

The Intel Lightning Mountain (LGM) USB3 USB is only present on Intel
Lightning Mountain SoCs.  Hence add a dependency on X86, to prevent
asking the user about this driver when configuring a kernel without
Intel Lightning Mountain platform support.

Fixes: 1cce8f73a561c944 ("phy: Add USB3 PHY support for Intel LGM SoC")
Signed-off-by: Geert Uytterhoeven <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
4 years agodt-bindings: phy: qcom,qusb2: document ipq6018 compatible
Baruch Siach [Wed, 27 Jan 2021 14:20:28 +0000 (16:20 +0200)]
dt-bindings: phy: qcom,qusb2: document ipq6018 compatible

This compatible string is for the USB PHY on IPQ60xx systems.

Signed-off-by: Baruch Siach <[email protected]>
Link: https://lore.kernel.org/r/7e1e7bda6ccdaab9adeeb956fac1acc39908a8dc.1611756920.git.baruch@tkos.co.il
Signed-off-by: Vinod Koul <[email protected]>
4 years agophy: qcom-qusb2: add QUSB2 support for IPQ6018
Kathiravan T [Wed, 27 Jan 2021 14:20:27 +0000 (16:20 +0200)]
phy: qcom-qusb2: add QUSB2 support for IPQ6018

Add the phy init sequence for the Super Speed ports found
on IPQ6018.

Signed-off-by: Kathiravan T <[email protected]>
[baruch: add ipq6018_regs_layout[], drop binding change]
Signed-off-by: Baruch Siach <[email protected]>
Link: https://lore.kernel.org/r/b8c22dddf1f70d89e135fe1ae705ddc68e295ebb.1611756920.git.baruch@tkos.co.il
Signed-off-by: Vinod Koul <[email protected]>
4 years agophy: qcom-qmp: Add SC8180X USB phy
Bjorn Andersson [Thu, 21 Jan 2021 01:43:39 +0000 (17:43 -0800)]
phy: qcom-qmp: Add SC8180X USB phy

The Qualcomm SC8180X has two QMP phys used for SuperSpeed USB, which are
either the same or very similar to the same found in SM8150. Add a
compatible for this, reusing the existing SM8150 USB phy config.

Signed-off-by: Bjorn Andersson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
4 years agophy: qcom-qmp: Add SC8180X UFS phy
Bjorn Andersson [Wed, 20 Jan 2021 22:45:31 +0000 (14:45 -0800)]
phy: qcom-qmp: Add SC8180X UFS phy

The UFS phy found in the Qualcomm SC8180X is either the same or very
similar to the phy present in SM8150, so add a compatible and reuse the
SM8150 configuration.

Signed-off-by: Bjorn Andersson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
4 years agodt-bindings: phy: qcom,qmp: Add SC8180X USB phy
Bjorn Andersson [Thu, 21 Jan 2021 01:43:38 +0000 (17:43 -0800)]
dt-bindings: phy: qcom,qmp: Add SC8180X USB phy

Add compatibles for the Qualcomm QMP PHY binding for the SuperSpeed USB
phys found in the SC8180x platform.

Signed-off-by: Bjorn Andersson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
4 years agodt-bindings: phy: qcom,qmp: Add SC8180X UFS to the QMP binding
Bjorn Andersson [Wed, 20 Jan 2021 22:45:30 +0000 (14:45 -0800)]
dt-bindings: phy: qcom,qmp: Add SC8180X UFS to the QMP binding

Add compatible for the SC8180x UFS PHY to the QMP binding.

Signed-off-by: Bjorn Andersson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
4 years agomisc: bcm-vk: only support ttyVK if CONFIG_TTY is set
Scott Branden [Wed, 3 Feb 2021 22:38:26 +0000 (14:38 -0800)]
misc: bcm-vk: only support ttyVK if CONFIG_TTY is set

Correct compile issue if CONFIG_TTY is not set by
only adding ttyVK devices if CONFIG_BCM_VK_TTY is set.

Reported-by: Randy Dunlap <[email protected]>
Acked-by: Randy Dunlap <[email protected]> # build-tested
Signed-off-by: Scott Branden <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agomisc: bcm-vk: Fix a couple error codes in probe()
Dan Carpenter [Wed, 3 Feb 2021 14:42:53 +0000 (17:42 +0300)]
misc: bcm-vk: Fix a couple error codes in probe()

These errors should return negative error codes instead of returning
success.

Fixes: 064ffc7c3939 ("misc: bcm-vk: add autoload support")
Fixes: 522f692686a7 ("misc: bcm-vk: add Broadcom VK driver")
Acked-by: Scott Branden <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/YBpyEbmz00rjvT9S@mwanda
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agomisc: rtsx: Remove unneeded return variable
Yang Li [Mon, 1 Feb 2021 07:30:40 +0000 (15:30 +0800)]
misc: rtsx: Remove unneeded return variable

This patch removes unneeded return variables, using only
'0' instead.
It fixes the following warning detected by coccinelle:
./drivers/misc/cardreader/rtsx_pcr.c:1808:5-8: Unneeded variable: "ret".
Return "0" on line 1833.

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agomisc: bcm-vk: unlock on error in bcm_to_h_msg_dequeue()
Dan Carpenter [Mon, 1 Feb 2021 12:22:07 +0000 (15:22 +0300)]
misc: bcm-vk: unlock on error in bcm_to_h_msg_dequeue()

Unlock before returning on this error path.

Fixes: 111d746bb476 ("misc: bcm-vk: add VK messaging support")
Acked-by: Desmond Yan <[email protected]>
Acked-by: Scott Branden <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/YBfyb+jU5lDUe+5g@mwanda
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agoMerge tag 'amba-make-remove-return-void' of https://git.pengutronix.de/git/ukl/linux...
Russell King [Tue, 2 Feb 2021 14:37:25 +0000 (14:37 +0000)]
Merge tag 'amba-make-remove-return-void' of https://git.pengutronix.de/git/ukl/linux into devel-stable

Tag for adaptions to struct amba_driver::remove changing prototype

4 years agoamba: Make use of bus_type functions
Uwe Kleine-König [Tue, 26 Jan 2021 16:58:35 +0000 (17:58 +0100)]
amba: Make use of bus_type functions

Instead of assigning the needed functions for each driver separately do it
only once in amba_bustype. Move the definition of the functions to their
proper place among the other callbacks used there. Note that the bus's
shutdown function might be called for unbound devices, too, so it needs
additional guarding.

This prepares getting rid of these callbacks in struct device_driver.

Reviewed-by: Ulf Hansson <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Uwe Kleine-König <[email protected]>
4 years agoamba: Make the remove callback return void
Uwe Kleine-König [Tue, 26 Jan 2021 16:58:34 +0000 (17:58 +0100)]
amba: Make the remove callback return void

All amba drivers return 0 in their remove callback. Together with the
driver core ignoring the return value anyhow, it doesn't make sense to
return a value here.

Change the remove prototype to return void, which makes it explicit that
returning an error value doesn't work as expected. This simplifies changing
the core remove callback to return void, too.

Reviewed-by: Ulf Hansson <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]> # for drivers/memory
Acked-by: Mark Brown <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Suzuki K Poulose <[email protected]> # for hwtracing/coresight
Acked-By: Vinod Koul <[email protected]> # for dmaengine
Acked-by: Guenter Roeck <[email protected]> # for watchdog
Acked-by: Wolfram Sang <[email protected]> # for I2C
Acked-by: Takashi Iwai <[email protected]> # for sound
Acked-by: Vladimir Zapolskiy <[email protected]> # for memory/pl172
Acked-by: Greg Kroah-Hartman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Uwe Kleine-König <[email protected]>
4 years agovfio: platform: simplify device removal
Uwe Kleine-König [Tue, 26 Jan 2021 16:58:33 +0000 (17:58 +0100)]
vfio: platform: simplify device removal

vfio_platform_remove_common() cannot return non-NULL in
vfio_amba_remove() as the latter is only called if vfio_amba_probe()
returned success.

Diagnosed-by: Arnd Bergmann <[email protected]>
Acked-by: Eric Auger <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Uwe Kleine-König <[email protected]>
4 years agoamba: reorder functions
Uwe Kleine-König [Tue, 26 Jan 2021 16:58:32 +0000 (17:58 +0100)]
amba: reorder functions

Put helpers (here: amba_get_enable_pclk and amba_put_disable_pclk) at
the top of the file and then define callbacks directly before the
structs they are used in; in the same order.

Reviewed-by: Ulf Hansson <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Uwe Kleine-König <[email protected]>
4 years agoamba: Fix resource leak for drivers without .remove
Uwe Kleine-König [Tue, 26 Jan 2021 16:58:31 +0000 (17:58 +0100)]
amba: Fix resource leak for drivers without .remove

Consider an amba driver with a .probe but without a .remove callback (e.g.
pl061_gpio_driver). The function amba_probe() is called to bind a device
and so dev_pm_domain_attach() and others are called. As there is no remove
callback amba_remove() isn't called at unbind time however and so calling
dev_pm_domain_detach() is missed and the pm domain keeps active.

To fix this always use the core driver callbacks and handle missing amba
callbacks there. For probe refuse registration as a driver without probe
doesn't make sense.

Fixes: 7cfe249475fd ("ARM: AMBA: Add pclk support to AMBA bus infrastructure")
Reviewed-by: Ulf Hansson <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Uwe Kleine-König <[email protected]>
4 years agoMerge branch 'icc-sdx55' into icc-next
Georgi Djakov [Mon, 1 Feb 2021 12:26:57 +0000 (14:26 +0200)]
Merge branch 'icc-sdx55' into icc-next

Add interconnect driver support for SDX55 platform for scaling the
bandwidth requirements over RPMh.

* icc-sdx55
  dt-bindings: interconnect: Add Qualcomm SDX55 DT bindings
  interconnect: qcom: Add SDX55 interconnect provider driver

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Georgi Djakov <[email protected]>
4 years agosoundwire: return earlier if no slave is attached
Chao Song [Tue, 26 Jan 2021 08:54:39 +0000 (16:54 +0800)]
soundwire: return earlier if no slave is attached

If there is no slave attached to soundwire bus, we
can return earlier from sdw_bus_prep_clk_stop() and
sdw_bus_exit_clk_stop(), this saves a redundant value
check.

Signed-off-by: Chao Song <[email protected]>
Reviewed-by: Rander Wang <[email protected]>
Reviewed-by: Guennadi Liakhovetski <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
4 years agosoundwire: bus: add better dev_dbg to track complete() calls
Pierre-Louis Bossart [Tue, 26 Jan 2021 08:54:02 +0000 (16:54 +0800)]
soundwire: bus: add better dev_dbg to track complete() calls

Add a dev_dbg() log for both enumeration and initialization completion
to better track suspend-resume issues.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Rander Wang <[email protected]>
Reviewed-by: Chao Song <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
4 years agomei: me: add adler lake point LP DID
Alexander Usyskin [Fri, 29 Jan 2021 12:07:52 +0000 (14:07 +0200)]
mei: me: add adler lake point LP DID

Add Adler Lake LP device id.

Cc: <[email protected]>
Signed-off-by: Alexander Usyskin <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agomei: me: add adler lake point S DID
Alexander Usyskin [Fri, 29 Jan 2021 12:07:51 +0000 (14:07 +0200)]
mei: me: add adler lake point S DID

Add Adler Lake S device id.

Cc: <[email protected]>
Signed-off-by: Alexander Usyskin <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agomei: me: emmitsburg workstation DID
Tomas Winkler [Fri, 29 Jan 2021 12:07:50 +0000 (14:07 +0200)]
mei: me: emmitsburg workstation DID

Add Emmitsburg workstation DID.

Cc: <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agomei: hbm: drop hbm responses on shutdown
Alexander Usyskin [Fri, 29 Jan 2021 12:07:49 +0000 (14:07 +0200)]
mei: hbm: drop hbm responses on shutdown

Ignore and drop HBM responses from init phase in shutdown phase.
Fixes stall if driver starting to stop in the middle of link init.

Signed-off-by: Alexander Usyskin <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agomei: hbm: call mei_set_devstate() on hbm stop response
Alexander Usyskin [Fri, 29 Jan 2021 12:07:48 +0000 (14:07 +0200)]
mei: hbm: call mei_set_devstate() on hbm stop response

Use mei_set_devstate() wrapper upon hbm stop command response,
to trigger sysfs event.

Fixes: 43b8a7ed4739 ("mei: expose device state in sysfs")
Signed-off-by: Alexander Usyskin <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agomei: document that mei_msg_hdr_init returns ERR_PTR
Tomas Winkler [Fri, 29 Jan 2021 12:07:47 +0000 (14:07 +0200)]
mei: document that mei_msg_hdr_init returns ERR_PTR

Document that mei_msg_hdr_init returns ERR_PTR.

Signed-off-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agomei: fix transfer over dma with extended header
Alexander Usyskin [Fri, 29 Jan 2021 12:07:46 +0000 (14:07 +0200)]
mei: fix transfer over dma with extended header

The size in header field for packet transferred over DMA
includes size of the extended header.
Include extended header in size check.
Add size and sanity checks on extended header.

Cc: <[email protected]> # v5.10+
Signed-off-by: Alexander Usyskin <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agomisc: bcm-vk: fix set_q_num API precedence issue
Desmond Yan [Fri, 29 Jan 2021 06:04:03 +0000 (22:04 -0800)]
misc: bcm-vk: fix set_q_num API precedence issue

Change set_q_num API to use if-else to make it more explicit,
and avoid a precedence rule issue.

Reported-by: kernel test robot <[email protected]>
Signed-off-by: Desmond Yan <[email protected]>
Signed-off-by: Scott Branden <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agomisc: pti: Remove a leftover in documentation
Andy Shevchenko [Fri, 29 Jan 2021 11:27:29 +0000 (13:27 +0200)]
misc: pti: Remove a leftover in documentation

Driver is gone, so is the documentation. Remove a leftover in documentation.

Fixes: 8ba59e9dee31 ("misc: pti: Remove driver for deprecated platform")
Reported-by: Stephen Rothwell <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agohabanalabs: update to latest hl_boot_if.h spec from F/W
Oded Gabbay [Tue, 26 Jan 2021 20:59:35 +0000 (22:59 +0200)]
habanalabs: update to latest hl_boot_if.h spec from F/W

It adds the definition for indication that the F/W handles HBM ECC
events.

Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs/gaudi: unmask HBM interrupts after handling
Oded Gabbay [Tue, 26 Jan 2021 20:58:13 +0000 (22:58 +0200)]
habanalabs/gaudi: unmask HBM interrupts after handling

As the driver does with all interrupts, we need to tell F/W to unmask
the HBM interrupts after the driver handled them.

Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: update SyncManager interrupt handling
Oded Gabbay [Tue, 26 Jan 2021 20:56:56 +0000 (22:56 +0200)]
habanalabs: update SyncManager interrupt handling

The firmware provides more information about SyncManager events.
Adjust the code to the latest firmware interface file.

Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: fix ETR security issue
Ohad Sharabi [Thu, 21 Jan 2021 20:25:52 +0000 (22:25 +0200)]
habanalabs: fix ETR security issue

ETR should always be non-secured as it is used by the users to record
profiling/trace data.
This patch fixes the configuration to match those requirements.

Signed-off-by: Ohad Sharabi <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: staged submission support
Ofir Bitton [Tue, 8 Dec 2020 11:47:05 +0000 (13:47 +0200)]
habanalabs: staged submission support

We introduce a new mechanism named Staged Submission.
This mechanism allows the user to send a whole CS in pieces.
Each CS will not require completion rather than the
last CS. Timeout timer will be triggered upon reception of the first
CS in group.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: modify device_idle interface
Ohad Sharabi [Sun, 17 Jan 2021 14:01:56 +0000 (16:01 +0200)]
habanalabs: modify device_idle interface

Currently this API uses single 64 bits mask for engines idle indication.
Recently, it was observed that more bits are needed for some ASICs.
This patch modifies the use of the idle mask and the idle_extensions
mask.

Signed-off-by: Ohad Sharabi <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: add CS completion and timeout properties
Ofir Bitton [Sun, 6 Dec 2020 15:18:02 +0000 (17:18 +0200)]
habanalabs: add CS completion and timeout properties

In order to support staged submission feature, we need to
distinguish on which command submission we want to receive
timeout and for which we want to receive completion.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: add new mem ioctl op for mapping hw blocks
Ofir Bitton [Tue, 5 Jan 2021 10:55:06 +0000 (12:55 +0200)]
habanalabs: add new mem ioctl op for mapping hw blocks

For future ASIC support the driver allows user to map certain regions
in the device's configuration space for direct access from userspace.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: fix MMU debugfs related nodes
farah kassabri [Tue, 12 Jan 2021 15:24:00 +0000 (17:24 +0200)]
habanalabs: fix MMU debugfs related nodes

In mmu debugfs node show un-scrambled physical addresses.
before read/write through data nodes, need to unscramble the
physical address before using it for pci transaction.

Signed-off-by: farah kassabri <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: add user available interrupt to hw_ip
Ofir Bitton [Wed, 6 Jan 2021 13:40:37 +0000 (15:40 +0200)]
habanalabs: add user available interrupt to hw_ip

In order to support completions that arrive directly to the user,
the driver needs to supply the user with the first available msix
interrupt available.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: always try to use the hint address
farah kassabri [Mon, 11 Jan 2021 08:10:00 +0000 (10:10 +0200)]
habanalabs: always try to use the hint address

Currently hint address is ignored in case va block page size
is not power of 2. We need to support th user hint address also in this
case, but only if the hint address is aligned to page size.

Signed-off-by: farah kassabri <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agoCREDITS: update email address and home address
Oded Gabbay [Wed, 13 Jan 2021 07:15:09 +0000 (09:15 +0200)]
CREDITS: update email address and home address

Update my email address to kernel.org account and my home address
to my new house.

Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: update email address in sysfs/debugfs docs
Oded Gabbay [Tue, 12 Jan 2021 13:13:06 +0000 (15:13 +0200)]
habanalabs: update email address in sysfs/debugfs docs

Use my kernel.org address for contact point instead of my private email
address.

Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: add security violations dump to debugfs
Ofir Bitton [Thu, 7 Jan 2021 10:14:17 +0000 (12:14 +0200)]
habanalabs: add security violations dump to debugfs

In order to improve driver security debuggability, we add
security violations dump to debugfs.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: ignore F/W BMC errors in case no BMC present
Ofir Bitton [Sun, 10 Jan 2021 08:34:42 +0000 (10:34 +0200)]
habanalabs: ignore F/W BMC errors in case no BMC present

In order to support operation mode in which BMC is not active,
driver must not take BMC errors into consideration.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs/gaudi: print sync manager SEI interrupt info
Ofir Bitton [Sun, 3 Jan 2021 18:52:40 +0000 (20:52 +0200)]
habanalabs/gaudi: print sync manager SEI interrupt info

Driver must print sync manager SEI information upon receiving
interrupt from FW.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: Use 'dma_set_mask_and_coherent()'
Christophe JAILLET [Mon, 4 Jan 2021 15:08:46 +0000 (17:08 +0200)]
habanalabs: Use 'dma_set_mask_and_coherent()'

Axe 'hl_pci_set_dma_mask()' and replace it with an equivalent
'dma_set_mask_and_coherent()' call.

This makes the code a bit less verbose.

It also removes an erroneous comment, because 'hl_pci_set_dma_mask()'
does not try to use a fall-back value.

Signed-off-by: Christophe JAILLET <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs/gaudi: remove PCI access to SM block
Ofir Bitton [Tue, 5 Jan 2021 07:04:07 +0000 (09:04 +0200)]
habanalabs/gaudi: remove PCI access to SM block

Due to HW limitation we must remove all direct access to SM
registers, in order to do that we will access SM registers using
the HW QMANS.
When possible and no user context is present, we can directly access
the HW QMANS. Whenever there is an active user, driver will
prepare a pending command buffer list which will be sent upon
user submissions.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: add driver support for internal cb scheduling
Ofir Bitton [Wed, 18 Nov 2020 13:46:57 +0000 (15:46 +0200)]
habanalabs: add driver support for internal cb scheduling

In order to support scnenarios in which driver needs access to
HW components but it cannot access them directly, we add support for
scheduling command buffers internally.
These command buffers will be transmitted upon next user command
submission context.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: increment ctx ref from within a cs allocation
Ofir Bitton [Sun, 3 Jan 2021 12:13:06 +0000 (14:13 +0200)]
habanalabs: increment ctx ref from within a cs allocation

A CS must increment the relevant context reference count.
We want to increment the reference inside the CS allocation function
as opposed for today where we increment it outside.
This is logical since we want to avoid explicitly incrementing
the context every time we call the CS allocate function.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: separate common code to dedicated folders
Ofir Bitton [Mon, 28 Dec 2020 12:36:47 +0000 (14:36 +0200)]
habanalabs: separate common code to dedicated folders

We separate some of the common code source files to different
folders for a better maintainability and testability.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: read device boot errors after cpucp is up
Ofir Bitton [Sun, 27 Dec 2020 15:09:09 +0000 (17:09 +0200)]
habanalabs: read device boot errors after cpucp is up

Boot cpu can report errors in various boot stages.
Current implementaion does not take into consideration errors
reported in late stages, hence we will check for errors at the most
late stage when fetching cpucp information.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: report correct dram size in info ioctl
Ofir Bitton [Thu, 31 Dec 2020 10:00:55 +0000 (12:00 +0200)]
habanalabs: report correct dram size in info ioctl

In case MMU is enabled, we must take MMU page size into
consideration when reporting dram size to the user.
This is because the MMU page size can be a value which is NOT
a power-of-2 value. As a result, the total DRAM size (which is always
a power-of-2 value) needed to be rounded-down.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: support non power-of-2 DRAM phys page sizes
Moti Haimovski [Wed, 18 Nov 2020 18:15:29 +0000 (20:15 +0200)]
habanalabs: support non power-of-2 DRAM phys page sizes

DRAM physical page sizes depend of the amount of HBMs available in
the device. this number is device-dependent and may also be subject
to binning when one or more of the DRAM controllers are found to
to be faulty. Such a configuration may lead to partitioning the DRAM
to non-power-of-2 pages.

To support this feature we also need to add infrastructure of address
scarmbling.

Signed-off-by: Moti Haimovski <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: remove access to kernel memory using debugfs
Ofir Bitton [Mon, 28 Dec 2020 16:28:08 +0000 (18:28 +0200)]
habanalabs: remove access to kernel memory using debugfs

Accessing kernel allocated memory through debugfs should not
be allowed as it introduces a security vulnerability.
We remove the option to read/write kernel memory for all asics.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs/gaudi: set uninitialized symbol
Ofir Bitton [Tue, 22 Dec 2020 13:56:12 +0000 (15:56 +0200)]
habanalabs/gaudi: set uninitialized symbol

Initialize local variable that is returned by the function, in
case it is never assigned.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: return dram virtual address in info ioctl
Alon Mizrahi [Wed, 23 Dec 2020 15:53:17 +0000 (17:53 +0200)]
habanalabs: return dram virtual address in info ioctl

When working with DRAM MMU, we should supply the userspace with the
virtual start address of the DRAM instead of the physical one. This
is because the physical one has no meaning for the user as he only
knows the virtual address range.

Signed-off-by: Alon Mizrahi <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: update to latest hl_boot_if.h
Oded Gabbay [Fri, 18 Dec 2020 19:27:54 +0000 (21:27 +0200)]
habanalabs: update to latest hl_boot_if.h

Update the latest version of this file that the F/W exports

Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: add ASIC property of functional HBMs
Oded Gabbay [Fri, 18 Dec 2020 17:12:56 +0000 (19:12 +0200)]
habanalabs: add ASIC property of functional HBMs

The number of functional HBMs in the same ASIC can be different due
to malfunctioning HBM banks.

Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs/gaudi: add debug prints for security status
Ofir Bitton [Wed, 16 Dec 2020 07:12:08 +0000 (09:12 +0200)]
habanalabs/gaudi: add debug prints for security status

In order to have more information while debugging boot issues,
we should print the firmware security status at every boot stage.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: modify memory functions signatures
Omer Shpigelman [Wed, 9 Dec 2020 11:34:11 +0000 (13:34 +0200)]
habanalabs: modify memory functions signatures

For consistency, modify all memory ioctl functions to get the ioctl
arguments structure rather than the arguments themselves.

Signed-off-by: Omer Shpigelman <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: kernel doc format in memory functions
Omer Shpigelman [Wed, 9 Dec 2020 11:28:46 +0000 (13:28 +0200)]
habanalabs: kernel doc format in memory functions

Change all memory functions documentation according to kernel doc
format.

Signed-off-by: Omer Shpigelman <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: replace WARN/WARN_ON with dev_crit in driver
Alon Mizrahi [Thu, 3 Dec 2020 15:32:19 +0000 (17:32 +0200)]
habanalabs: replace WARN/WARN_ON with dev_crit in driver

Often WARN is defined in data-centers as BUG and we would like to
avoid hanging the entire server on some internal error of the driver
(important as it might be).

Therefore, use dev_crit instead.

Signed-off-by: Alon Mizrahi <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: report dram_page_size in hw_ip_info ioctl
Moti Haimovski [Mon, 7 Dec 2020 07:10:34 +0000 (09:10 +0200)]
habanalabs: report dram_page_size in hw_ip_info ioctl

Instead of having it hard-coded as a define, pass it to the user
in runtime.

Signed-off-by: Moti Haimovski <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs/goya: move mmu_prepare to context init
Ohad Sharabi [Tue, 1 Dec 2020 12:06:27 +0000 (14:06 +0200)]
habanalabs/goya: move mmu_prepare to context init

Currently mmu_prepare is located at context switch.
Since we support a single context, no reason to reconfigure
the MMU registers every context switch.

Signed-off-by: Ohad Sharabi <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs/gaudi: remove duplicated gaudi packets masks
Ofir Bitton [Sun, 6 Dec 2020 08:22:32 +0000 (10:22 +0200)]
habanalabs/gaudi: remove duplicated gaudi packets masks

As all packets use the same CTL register masks, we remove duplicated
masks and use common masks instead.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: allow user to pass a staged submission seq
Ofir Bitton [Thu, 3 Dec 2020 15:12:09 +0000 (17:12 +0200)]
habanalabs: allow user to pass a staged submission seq

In order to support the staged submission feature, user must be
allowed to use the same CS sequence for all submissions in the
same staged submission.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs/gaudi: support CS with no completion
Ofir Bitton [Thu, 3 Dec 2020 14:59:28 +0000 (16:59 +0200)]
habanalabs/gaudi: support CS with no completion

As part of the staged submission feature, we need Gaudi to support
command submissions that will never get a completion.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: Init the VM module for kernel context
Ofir Bitton [Thu, 12 Nov 2020 09:03:32 +0000 (11:03 +0200)]
habanalabs: Init the VM module for kernel context

In order for reserving VA ranges for kernel memory, we need
to allow the VM module to be initiated with kernel context.

Signed-off-by: Ofir Bitton <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: refactor MMU locks code
Ohad Sharabi [Thu, 26 Nov 2020 07:39:26 +0000 (09:39 +0200)]
habanalabs: refactor MMU locks code

remove mmu_cache_lock as it protects a section which is already
protected by mmu_lock.

in addition, wrap mmu cache invalidate calls in hl_vm_ctx_fini with
mmu_lock.

Signed-off-by: Ohad Sharabi <[email protected]>
Reviewed-by: Oded Gabbay <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
4 years agohabanalabs: update firmware boot interface
Oded Gabbay [Fri, 4 Dec 2020 19:58:10 +0000 (21:58 +0200)]
habanalabs: update firmware boot interface

Update to latest firmware hl_boot_if.h file.

Signed-off-by: Oded Gabbay <[email protected]>
4 years agobus: fsl-mc: add autorescan sysfs
Ioana Ciornei [Thu, 14 Jan 2021 17:07:52 +0000 (19:07 +0200)]
bus: fsl-mc: add autorescan sysfs

Add the autorescan sysfs in order to enable/disable the DPRC IRQs on
which automatic rescan of the bus is performed. This is important when
dynamic creation of objects is needed to happen in a timely manner because
object creation can be bundled together.

Acked-by: Laurentiu Tudor <[email protected]>
Signed-off-by: Ioana Ciornei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agobus: fsl-mc: add bus rescan attribute
Ioana Ciornei [Thu, 14 Jan 2021 17:07:51 +0000 (19:07 +0200)]
bus: fsl-mc: add bus rescan attribute

Introduce the rescan attribute as a bus attribute to
synchronize the fsl-mc bus objects and the MC firmware.

To rescan the fsl-mc bus, e.g.,
echo 1 > /sys/bus/fsl-mc/rescan

Acked-by: Laurentiu Tudor <[email protected]>
Signed-off-by: Ioana Ciornei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agobus: fsl-mc: add fsl-mc userspace support
Ioana Ciornei [Thu, 14 Jan 2021 17:07:50 +0000 (19:07 +0200)]
bus: fsl-mc: add fsl-mc userspace support

Adding userspace support for the MC (Management Complex) means exporting
an ioctl capable device file representing the root resource container.

This new functionality in the fsl-mc bus driver intends to provide
userspace applications an interface to interact with the MC firmware.

Commands that are composed in userspace are sent to the MC firmware
through the FSL_MC_SEND_MC_COMMAND ioctl.  By default the implicit MC
I/O portal is used for this operation, but if the implicit one is busy,
a dynamic portal is allocated and then freed upon execution.

The command received through the ioctl interface is checked against a
known whitelist of accepted MC commands. Commands that attempt a change
in hardware configuration will need CAP_NET_ADMIN, while commands used
in debugging do not need it.

Acked-by: Laurentiu Tudor <[email protected]>
Signed-off-by: Ioana Ciornei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agobus: fsl-mc: export mc_cmd_hdr_read_cmdid() to the fsl-mc bus
Ioana Ciornei [Thu, 14 Jan 2021 17:07:49 +0000 (19:07 +0200)]
bus: fsl-mc: export mc_cmd_hdr_read_cmdid() to the fsl-mc bus

Export the mc_cmd_hdr_read_cmdid() function to the entire fsl-mc bus
since it will be needed in the following patch.

Acked-by: Laurentiu Tudor <[email protected]>
Signed-off-by: Ioana Ciornei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agobus: fsl-mc: move fsl_mc_command struct in a uapi header
Ioana Ciornei [Thu, 14 Jan 2021 17:07:48 +0000 (19:07 +0200)]
bus: fsl-mc: move fsl_mc_command struct in a uapi header

Define "struct fsl_mc_command" as a structure that can cross the
user/kernel boundary.

Acked-by: Laurentiu Tudor <[email protected]>
Signed-off-by: Ioana Ciornei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agow1: w1_therm: Fix conversion result for negative temperatures
Ivan Zaentsev [Thu, 21 Jan 2021 09:30:21 +0000 (12:30 +0300)]
w1: w1_therm: Fix conversion result for negative temperatures

DS18B20 device driver returns an incorrect value for negative temperatures
due to a missing sign-extension in w1_DS18B20_convert_temp().

Fix by using s16 temperature value when converting to int.

Fixes: 9ace0b4dab1c (w1: w1_therm: Add support for GXCAS GX20MH01 device.)
Cc: stable <[email protected]>
Reported-by: Paweł Marciniak <[email protected]>
Signed-off-by: Ivan Zaentsev <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
4 years agoplatform/goldfish: Convert pipe tasklet to threaded irq
Davidlohr Bueso [Fri, 15 Jan 2021 00:20:14 +0000 (16:20 -0800)]
platform/goldfish: Convert pipe tasklet to threaded irq

Tasklets have long been deprecated as being too heavy on the system
by running in irq context - and this is not a performance critical
path. If a higher priority process wants to run, it must wait for
the tasklet to finish before doing so. A more suitable equivalent
is to converted to threaded irq instead and deal with the signaled
pipes in task context.

Signed-off-by: Davidlohr Bueso <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This page took 0.133709 seconds and 4 git commands to generate.