aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc
AgeCommit message (Collapse)AuthorFilesLines
2020-09-22habanalabs: remove unused ASIC function pointerOded Gabbay3-7/+0
Old function pointer that was left when the call to this function pointer was removed. Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: rename ArmCP to CPU-CPOded Gabbay4-22/+23
There were a couple of comments where the name ArmCP was still used. Rename it to CPU-CP. In addition, rename ArmCP or ARM in log messages to "device CPU". Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: count dropped CS because max CS in-flightOded Gabbay1-1/+4
There is a case where the user reaches the maximum number of CS in-flight. In that case, the driver rejects the new CS of the user with EAGAIN. Count that event so the user can query the driver later to see if it happened. Reviewed-by: Tomer Tayar <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: make use of dma_mmap_coherentHillf Danton4-16/+9
Add dma_mmap_coherent() for goya and gaudi to match their use of dma_alloc_coherent(), see the Link tag for why. Link: https://lore.kernel.org/lkml/[email protected]/ Cc: Christoph Hellwig <[email protected]> Cc: Zhang Li <[email protected]> Cc: Ding Z Nan <[email protected]> Signed-off-by: Hillf Danton <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: clear vm_pgoff before doing the mmapOded Gabbay1-0/+4
The driver use vm_pgoff to hold the CB idr handle. Before we actually call the mapping function, we need to clear the handle so there won't be any garbage left in vm_pgoff. Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: restructure hl_mmapOded Gabbay3-4/+20
Arrange the hl_mmap code to be more structured and expandable for the future. Add better defines that describe our usage of the vm_pgoff. Note that I shamelessly took the code and defines from the amdkfd driver (my previous driver). Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: cast to u64 before shift > 31 bitsOded Gabbay2-6/+10
When shifting a boolean variable by more than 31 bits and putting the result into a u64 variable, we need to cast the boolean into unsigned 64 bits to prevent possible overflow. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: replace armcp with the generic cpucpOded Gabbay13-313/+331
ArmCP mandates that the device CPU is always an ARM processor, which might be wrong in the future. Most of this change is an internal renaming of variables, functions and defines but there are two entries in sysfs which have armcp in their names. Add identical cpucp entries but don't remove yet the armcp entries. Those will be deprecated next year. Add the documentation about it in sysfs documentation. Signed-off-by: Moti Haimovski <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: update GAUDI hardware specsOded Gabbay1-0/+2
Add define for the 2 MME slave engines. Reviewed-by: Tomer Tayar <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: add support for getting device total energyfarah kassabri4-0/+51
Add driver implementation for reading the total energy consumption from the device ARM FW. Signed-off-by: farah kassabri <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: Include linux/bitfield.h only in habanalabs.hTomer Tayar5-4/+1
Include linux/bitfield.h only in habanalabs.h, instead of in each and every file that needs it, as habanalabs.h is already included by all. Signed-off-by: Tomer Tayar <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: extend busy engines mask to 64 bitsfarah kassabri4-4/+4
change busy engines bitmask to 64 bits in order to represent more engines, needed for future ASIC support. Signed-off-by: farah kassabri <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: use 1U when shifting bitsOded Gabbay1-6166/+6166
Eliminate following warning: warning: Shifting signed 32-bit value by 31 bits is undefined behavior Reported-by: kernel test robot <[email protected]> Reviewed-by: Tomer Tayar <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: check TPC vector pipe is emptyOded Gabbay1-0/+9
The driver waits for the TPC vector pipe to be empty before checking if the TPC kernel has finished executing, but the code doesn't validate that the pipe was indeed empty, it just wait for it without checking the return value. Reported-by: kernel test robot <[email protected]> Reviewed-by: Tomer Tayar <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: remove redundant assignment to variableOded Gabbay1-2/+0
new_dma_pkt->ctl is assigned a value and then is reassigned a new value without the first value ever being used. Reported-by: kernel test robot <[email protected]> Reviewed-by: Tomer Tayar <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: use FIELD_PREP() instead of <<Oded Gabbay3-179/+154
Use the standard FIELD_PREP() macro instead of << operator to perform bitmask operations. This ensures type check safety and eliminate compiler warnings. Reported-by: kernel test robot <[email protected]> Reviewed-by: Tomer Tayar <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: use standard BIT() and GENMASK()Oded Gabbay1-22/+22
Use the standard macros to define bitmasks. Reported-by: kernel test robot <[email protected]> Reviewed-by: Tomer Tayar <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: eliminate redundant else conditionOded Gabbay1-2/+2
If both parts of if-else are goto statements, we can remove the else and put the else goto statement after the if statement. Reported-by: kernel test robot <[email protected]> Reviewed-by: Tomer Tayar <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: cast int to u32 before printing it with %uOded Gabbay1-1/+1
%u is used for unsigned so we need to cast the int variable to u32 to avoid compiler warning. Reported-by: kernel test robot <[email protected]> Reviewed-by: Tomer Tayar <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: change CB's ID to be 64 bitsOded Gabbay3-4/+4
Although the possible values for CB's ID are only 32 bits, there are a few places in the code where this field is shifted and passed into a function which expects 64 bits. Reported-by: kernel test robot <[email protected]> Reviewed-by: Tomer Tayar <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: print the queue id in case of an errorDotan Barak2-6/+12
If there is a failure during the testing of a queue, to ease up debugging - print the queue id. Signed-off-by: Dotan Barak <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: remove security from ARB_MST_QUIET registerfarah kassabri1-36/+19
Allow user application to write to this register in order to be able to configure the quiet period of the QMAN between grants. Signed-off-by: farah kassabri <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: PCIe Advanced Error Reporting supportOfir Bitton1-1/+75
driver will now get notified upon any PCI error occurred and will respond according to the severity of the error. Signed-off-by: Ofir Bitton <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: expose sync manager resources allocation in INFO IOCTLOfir Bitton3-1/+42
Although the driver defines the first user-available sync manager object and monitor in habanalabs.h, we would like to also expose this information via the INFO IOCTL so the runtime can get this information dynamically. This is because in future ASICs we won't need to define it statically. Signed-off-by: Ofir Bitton <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: add information about PCIe controllerOfir Bitton6-0/+111
Update firmware header with new API for getting pcie info such as tx/rx throughput and replay counter. These counters are needed by customers for monitor and maintenance of multiple devices. Add new opcodes to the INFO ioctl to retrieve these counters. Signed-off-by: Ofir Bitton <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: Replace dma-fence mechanism with completionsOfir Bitton4-63/+77
habanalabs driver uses dma-fence mechanism for synchronization. dma-fence mechanism was designed solely for GPUs, hence we purpose a simpler mechanism based on completions to replace current dma-fence objects. Signed-off-by: Ofir Bitton <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Daniel Vetter <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
2020-09-22habanalabs: increase length of ASIC nameOded Gabbay1-1/+1
Future ASIC names are longer than 15 chars so increase the variable length to 32 chars. Signed-off-by: Oded Gabbay <[email protected]> Reviewed-by: Tomer Tayar <[email protected]>
2020-09-21misc: eeprom: use helper to get i2c_client from kobjWolfram Sang1-1/+1
Slightly easier to read. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
2020-09-17drm, iommu: Change type of pasid to u32Fenghua Yu1-1/+1
PASID is defined as a few different types in iommu including "int", "u32", and "unsigned int". To be consistent and to match with uapi definitions, define PASID and its variations (e.g. max PASID) as "u32". "u32" is also shorter and a little more explicit than "unsigned int". No PASID type change in uapi although it defines PASID as __u64 in some places. Suggested-by: Thomas Gleixner <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Tony Luck <[email protected]> Reviewed-by: Lu Baolu <[email protected]> Acked-by: Felix Kuehling <[email protected]> Acked-by: Joerg Roedel <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
2020-09-17eeprom: 93xx46: set type id as EEPROMVadym Kochan1-0/+1
Set type as NVMEM_TYPE_EEPROM to expose this info via sysfs: $ cat /sys/bus/nvmem/devices/{DEVICE}/type EEPROM Signed-off-by: Vadym Kochan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-17eeprom: at25: set type id as EEPROMVadym Kochan1-0/+1
Set type as NVMEM_TYPE_EEPROM to expose this info via sysfs: $ cat /sys/bus/nvmem/devices/{DEVICE}/type EEPROM Signed-off-by: Vadym Kochan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-17eeprom: at24: set type id as EEPROMVadym Kochan1-0/+1
Set type as NVMEM_TYPE_EEPROM to expose this info via sysfs: $ cat /sys/bus/nvmem/devices/{DEVICE}/type EEPROM Signed-off-by: Vadym Kochan <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2020-09-16misc: rtsx: Add power saving functions and fix driving parameterRicky Wu4-19/+283
v4: split power down flow and power saving function to two patch v5: fix up modified change under the --- line Add rts522a L1 sub-state support Save more power on rts5227 rts5249 rts525a rts5260 Fix rts5260 driving parameter Signed-off-by: Ricky Wu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-16misc: fastrpc: add ioctl for attaching to sensors pdJonathan Marek1-3/+6
Initializing sensors requires attaching to pd 2. Add an ioctl for that. This corresponds to FASTRPC_INIT_ATTACH_SENSORS in the downstream driver. Signed-off-by: Jonathan Marek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-16misc: fastrpc: define names for protection domain idsJonathan Marek1-2/+7
Define SENSORS_PD for the next patch, to void using magic values for these. Signed-off-by: Jonathan Marek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-16misc: rtsx: Fix power down flowRicky Wu5-51/+18
Fix and sort out rtsx driver power down flow Signed-off-by: Ricky Wu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-16misc: rtsx: Fix memory leak in rtsx_pci_probeKeita Suzuki1-1/+3
When mfd_add_devices() fail, pcr->slots should also be freed. However, the current implementation does not free the member, leading to a memory leak. Fix this by adding a new goto label that frees pcr->slots. Signed-off-by: Keita Suzuki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-14misc: hisi_hikey_usb: fix return of uninitialized ret status variableColin Ian King1-2/+1
Currently the return value from ret is uninitialized so the function hisi_hikey_usb_parse_kirin970 is returning a garbage value when succeeding. Since ret is not used anywhere else in the function, remove it and just return 0 success at the end of the function. Fixes: d210a0023590 ("misc: hisi_hikey_usb: add support for Hikey 970") Reviewed-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-14Merge 5.9-rc5 into char-misc-nextGreg Kroah-Hartman3-21/+24
We want the char/misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-13Merge tag 'char-misc-5.9-rc5' of ↵Linus Torvalds2-17/+17
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char / misc driver fixes from Greg KH: "Here are a number of small driver fixes for 5.9-rc5 Included in here are: - habanalabs driver fixes - interconnect driver fixes - soundwire driver fixes - dyndbg fixes for reported issues, and then reverts to fix it all up to a sane state. - phy driver fixes All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: Revert "dyndbg: accept query terms like file=bar and module=foo" Revert "dyndbg: fix problem parsing format="foo bar"" scripts/tags.sh: exclude tools directory from tags generation video: fbdev: fix OOB read in vga_8planes_imageblit() dyndbg: fix problem parsing format="foo bar" dyndbg: refine export, rename to dynamic_debug_exec_queries() dyndbg: give %3u width in pr-format, cosmetic only interconnect: qcom: Fix small BW votes being truncated to zero soundwire: fix double free of dangling pointer interconnect: Show bandwidth for disabled paths as zero in debugfs habanalabs: fix report of RAZWI initiator coordinates habanalabs: prevent user buff overflow phy: omap-usb2-phy: disable PHY charger detect phy: qcom-qmp: Use correct values for ipq8074 PCIe Gen2 PHY init soundwire: bus: fix typo in comment on INTSTAT registers phy: qualcomm: fix return value check in qcom_ipq806x_usb_phy_probe() phy: qualcomm: fix platform_no_drv_owner.cocci warnings
2020-09-11dma-mapping: fix DMA_OPS dependenciesChristoph Hellwig1-0/+1
Driver that select DMA_OPS need to depend on HAS_DMA support to work. The vop driver was missing that dependency, so add it, and also add a another depends in DMA_OPS itself. That won't fix the issue due to how the Kconfig dependencies work, but at least produce a warning about unmet dependencies. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Robin Murphy <[email protected]>
2020-09-10misc: hisi_hikey_usb: add support for Hikey 970Mauro Carvalho Chehab2-19/+88
The HiKey 970 board is similar to Hikey 960 with regards to its USB configutation: it also relies on a USB HUB that is used when DWC3 is at host mode. However, it requires a few extra DT settings, as it uses a voltage regulator and GPIO reset pin. Add support for them. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Link: https://lore.kernel.org/r/62843df9927b4d8dac5dc7c4a189567fa52ab2bb.1599717402.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-10misc: hisi_hikey_usb: Driver to support onboard USB gpio hub on Hikey960Yu Chen3-0/+215
The HiKey960 has a fairly complex USB configuration due to it needing to support a USB-C port for host/device mode and multiple USB-A ports in host mode, all using a single USB controller. See schematics here: https://github.com/96boards/documentation/raw/master/consumer/hikey/hikey960/hardware-docs/HiKey960_Schematics.pdf This driver acts as a usb-role-switch intermediary, intercepting the role switch notifications from the tcpm code, and passing them on to the dwc3 core. In doing so, it also controls the onboard hub and power gpios in order to properly route the data lines between the USB-C port and the onboard hub to the USB-A ports. Signed-off-by: Yu Chen <[email protected]> [jstultz: Major rework to make the driver a usb-role-switch intermediary] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Link: https://lore.kernel.org/r/c263f72e1d803c18c45a69ce2c333e79a7ed89ff.1599717402.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-09Merge tag 'at24-fixes-for-v5.9-rc5' of ↵Wolfram Sang1-4/+7
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-current at24 fixes for v5.9-rc5 - delay registration of the nvmem provider until after power is enabled
2020-09-08lkdtm: remove set_fs-based testsChristoph Hellwig4-29/+0
Once we can't manipulate the address limit, we also can't test what happens when the manipulation is abused. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Al Viro <[email protected]>
2020-09-07uacce: Use kobj_to_dev() instead of container_of()Tian Tao1-1/+1
Use kobj_to_dev() instead of container_of() Signed-off-by: Tian Tao <[email protected]> Reviewed-by: Zhou Wang <[email protected]> Acked-by: Zhangfei Gao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-09-07misc: pci_endpoint_test: Add Device ID for RZ/G2H PCIe controllerLad Prabhakar1-0/+2
Add Renesas R8A774E1 in pci_device_id table so that pci-epf-test can be used for testing PCIe EP on RZ/G2H. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lad Prabhakar <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Biju Das <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]>
2020-09-07misc: pci_endpoint_test: Add Device ID for RZ/G2M and RZ/G2N PCIe controllersLad Prabhakar1-2/+5
Add Renesas R8A774A1 and R8A774B1 in pci_device_id table so that pci-epf-test can be used for testing PCIe EP on RZ/G2M and RZ/G2N. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lad Prabhakar <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Biju Das <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]>
2020-09-01misc: eeprom: at24: register nvmem only after eeprom is ready to useVadym Kochan1-4/+7
During nvmem_register() the nvmem core sends notifications when: - cell added - nvmem added and during these notifications some callback func may access the nvmem device, which will fail in case of at24 eeprom because regulator and pm are enabled after nvmem_register(). Fixes: cd5676db0574 ("misc: eeprom: at24: support pm_runtime control") Fixes: b20eb4c1f026 ("eeprom: at24: drop unnecessary label") Cc: [email protected] Signed-off-by: Vadym Kochan <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2020-08-31habanalabs: fix report of RAZWI initiator coordinatesOfir Bitton1-16/+16
All initiator coordinates received upon an 'MMU page fault RAZWI event' should be the routers coordinates, the only exception is the DMA initiators for which the reported coordinates correspond to their actual location. Signed-off-by: Ofir Bitton <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>