summaryrefslogtreecommitdiff
path: root/drivers/i3c
AgeCommit message (Collapse)AuthorFilesLines
2022-06-10i3c: mctp: Add GETMWL/SETMWL and GETMRL/SETMRL supportHEADdev-5.15-intelOleksandr Shulzhenko1-1/+52
We need to set MRL/MWL to 69: 64 byte MCTP payload + 4 byte MCTP header + 1 byte PEC as per MCTP o. I3C spec paragraph 5.4.2. We also need to verify whether MCTP packet size meets the requirement and throw the error otherwise. Signed-off-by: Oleksandr Shulzhenko <oleksandr.shulzhenko.viktorovych@intel.com>
2022-06-10i3c: device: Add SETMWL/GETMWL and SETMRL/GETMRL supportOleksandr Shulzhenko3-4/+154
Add the GETMRL/SETMRL and GETMWL/SETMWL CCC commands functions. The functions are needed to configure maximum read/write length for the specific I3C device. Signed-off-by: Oleksandr Shulzhenko <oleksandr.shulzhenko.viktorovych@intel.com>
2022-06-01i3c: mctp: Add PECI-related functionality to I3C MCTP driverOleksandr Shulzhenko1-0/+54
- Handler for PECI messages have been added; - i3c_mctp_client and platform_device for PECI have been added. Signed-off-by: Oleksandr Shulzhenko <oleksandr.shulzhenko.viktorovych@intel.com>
2022-06-01i3c: mctp: Extend MCTP o. I3C driver with the TX/RX functionsOleksandr Shulzhenko1-60/+219
Extend the driver with the functionality necessary to send and receive MCTP over I3C packets by another component in kernel: - i3c_mctp_client concept needed to implement packet queue so that the driver can manage and classify packets for several clients respectively; - the function that provides MCTP target EID; - the functions to alloc and free mctp_i3c_packet; - the functions to send and receive MCTP packets over I3C. Signed-off-by: Oleksandr Shulzhenko <oleksandr.shulzhenko.viktorovych@intel.com>
2022-05-27Revert "i3c: mctp: Replace redundant MKDEV calls"Iwona Winiarska1-3/+4
This reverts commit 825fd72c22d729a4ad0d4d3ee488525710fe9877. Minor was passed as one of the arguments - it was not redundant and removing it introduces a regression. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-05-25i3c: mctp: Add I3C Target MCTP driverIwona Winiarska3-2/+400
Add a simple device driver that implements necessary system calls to support userspace MCTP communication when I3C HW is configured as I3C Target. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-05-25i3c: mctp: Replace redundant MKDEV callsIwona Winiarska1-4/+3
Since alloc_chrdev_region() returns devt as an output parameter, calling MKDEV() on it is a no-op. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-05-25i3c: mctp: Use ID instead of I3C devname in chardev nameIwona Winiarska1-1/+1
Using I3C device name in char device name makes it longer. There is no need to keep information about I3C device in name, since we have access to this information via sysfs. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-05-20i3c: mctp: Enable PECZbigniew Lukwinski1-0/+4
Following DMTF DSP0233 standard, MCTP over I3C requires PEC generation and validation for private read and write SDR transfers. To enable PEC, I3C driver PEC support is used. Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2022-05-20i3c: dw: master: Enable PEC support in hardwareZbigniew Lukwinski1-0/+6
DWC MIPI I3C Controller supports automatic PEC generation and validation for private write and read SDR transfers. This feature could be used for upper layers, e.g. MCTP over I3C to offload PEC handling to the hardware. PEC supported by DWC MIPI I3C Controller is described in JESD403-1. Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2022-05-20i3c: master: Enable support for PECZbigniew Lukwinski3-0/+39
PEC (Packet Error Check) support enabled in I3C controller driver. API for I3C device driver to control (enable or disable) PEC support in lower layer driver added. Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2022-05-12Merge commit '49caedb668e476c100d727f2174724e0610a2b92' of ↵Sujoy Ray3-4/+7
https://github.com/openbmc/linux into openbmc/dev-5.15-intel-bump_v5.15.36 Signed-off-by: Sujoy Ray <sujoy.ray@intel.com>
2022-04-19i3c: master: dw: Update read transfer lengthIwona Winiarska1-0/+7
Currently, the read transfer length is not updated with the actual number of read bytes, which means that the caller won't have this information and won't be able to distinguish real data obtained during transfer. For every successful read transfer, update its length. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-04-13i3c: hub: core: I3C HUB driver implementationZbigniew Lukwinski3-0/+713
Initial I3C HUB driver implementation. Implementation is able to parse DT entry and configure basic set of registers. Driver is loaded when I3C device with matching DCR is detected on the bus. Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2022-04-13i3c: master: Do not add device for HUBZbigniew Lukwinski1-4/+6
Current implementation tries to add device for each DT entry. In case I3C HUB we do not want add device 'manually', using DT. I3C HUB shall be discovered dynamically. But DT entry for I3C HUB is required. Thus master driver shall not add device for HUB entry in DT. Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2022-04-12i3c: master: dw: Implement I3C target functionsIwona Winiarska1-35/+271
Add support for Synopsys DesignWare I3C Target functionality. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-04-12i3c: Add I3C target supportIwona Winiarska3-7/+271
Extend the existing core implementation with I3C target support. Add missing I3C target driver API. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-03-31i3c: i3cdev: fix module bindingOleksandr Shulzhenko1-0/+1
I3C bus listener should take into account the case when I3C master driver is unbound. Otherwise, on I3C master driver unbind happens the following: Device driver is unbound -> i3cdev is bound -> Master driver is unbound. As a result various device entities (including /dev descriptor) remain in memory. The solution is to detach i3cdev on BUS_NOTIFY_REMOVED_DEVICE as well. Signed-off-by: Oleksandr Shulzhenko <oleksandr.shulzhenko.viktorovych@intel.com>
2022-03-24i3c: mctp: add MCTP I3C driverOleksandr Shulzhenko5-0/+360
The driver was implemented in order to provide userspace with fops functions needed to process MCTP packets over I3C. Signed-off-by: Oleksandr Shulzhenko <oleksandr.shulzhenko.viktorovych@intel.com>
2022-03-14i3c: dw: master: flexible I3C timing controlZbigniew Lukwinski1-10/+361
Enabling mechanism which allows user to control I3C timings with details. It is done over DT. The following options are possible: * 'i3c-od-scl-low-ns' - to control SCL low period I3C Open Drain mode, example: i3c-od-scl-low-ns = <250>; * 'i3c-od-scl-high-ns' - to control SCL high period I3C Open Drain mode, example: i3c-od-scl-high-ns = <40>; * 'i3c-pp-scl-low-ns' - to control SCL low period I3C Push-Pull mode, example: i3c-pp-scl-low-ns = <100>; * 'i3c-pp-scl-high-ns' - to control SCL high period I3C Push-Pull mode, example: i3c-pp-scl-low-ns = <200>; * 'sda-tx-hold-ns' - to control hold time of the transmit data (SDA) with respect to the SCL edge, example: sda-tx-hold-ns = <15>; All values shall be provided in nanoseconds. Driver does necessary validation against limits documented in I3C MIPI specification. Driver also does the calculation in case only low, only high period or none of them are provided. DT SCL clock value parameters ('i2c-scl-hz', 'i3c-scl-hz') are also taken into account during the calculation. For instance if user provides 'i3c-od-scl-low-ns' and 'i2c-scl-hz', driver calculates SCL high period or reports an error if it is not possible. If user provides only 'i2c-scl-hz', driver calculates SCL low and high periods. If user provides all of these parameters, driver does the validation and reports an error in case parameters values does not match. Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2022-03-14i3c: dw: master: revert timing related changesZbigniew Lukwinski1-66/+14
Reverting previous SCL timing configuration which is not in upstream. commit 5562262f4e5d ("Update I3C drivers") Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
2022-03-08i3c: master: dw: check return of dw_i3c_master_get_free_pos()Tom Rix1-0/+4
[ Upstream commit 13462ba1815db5a96891293a9cfaa2451f7bd623 ] Clang static analysis reports this problem dw-i3c-master.c:799:9: warning: The result of the left shift is undefined because the left operand is negative COMMAND_PORT_DEV_INDEX(pos) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ pos can be negative because dw_i3c_master_get_free_pos() can return an error. So check for an error. Fixes: 1dd728f5d4d4 ("i3c: master: Add driver for Synopsys DesignWare IP") Signed-off-by: Tom Rix <trix@redhat.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220108150948.3988790-1-trix@redhat.com Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-03-08i3c/master/mipi-i3c-hci: Fix a potentially infinite loop in ↵Christophe JAILLET1-3/+1
'hci_dat_v1_get_index()' [ Upstream commit 3f43926f271287fb1744c9ac9ae1122497f2b0c2 ] The code in 'hci_dat_v1_get_index()' really looks like a hand coded version of 'for_each_set_bit()', except that a +1 is missing when searching for the next set bit. This really looks odd and it seems that it will loop until 'dat_w0_read()' returns the expected result. So use 'for_each_set_bit()' instead. It is less verbose and should be more correct. Fixes: 9ad9a52cce28 ("i3c/master: introduce the mipi-i3c-hci driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Nicolas Pitre <npitre@baylibre.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/0cdf3cb10293ead1acd271fdb8a70369c298c082.1637186628.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-03-08i3c: fix incorrect address slot lookup on 64-bitJamie Iles1-1/+2
[ Upstream commit f18f98110f2b179792cb70d85cba697320a3790f ] The address slot bitmap is an array of unsigned long's which are the same size as an int on 32-bit platforms but not 64-bit. Loading the bitmap into an int could result in the incorrect status being returned for a slot and slots being reported as the wrong status. Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure") Cc: Boris Brezillon <bbrezillon@kernel.org> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Jamie Iles <quic_jiles@quicinc.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210922165600.179394-1-quic_jiles@quicinc.com Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-03-03i3c: master: dw: Set IBI_WITH_DATA based on Target's BCR[2] bitIwona Winiarska1-1/+2
The Active Controller should set the IBI Payload Control to 1 only when the Target device supports the mandatory byte (BCR[2]=1). Otherwise, when the Target device doesn't support MDB (BCR[2]=0), the IBI Payload Control bit should set to 0. Fixes: ee31c3564a25 ("i3c: master: dw: add IBI support") Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-03-02i3c: master: Remove unused variablesIwona Winiarska1-1/+0
drivers/i3c/master.c: In function 'i3c_master_bus_init': drivers/i3c/master.c:1758:32: warning: unused variable 'i3ctmp' [-Wunused-variable] 1758 | struct i3c_dev_desc *i3cdev, *i3ctmp; | ^~~~~~ drivers/i3c/master.c:1758:23: warning: unused variable 'i3cdev' [-Wunused-variable] 1758 | struct i3c_dev_desc *i3cdev, *i3ctmp; | ^~~~~~ Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-02-07i3c: master: Implement CCC GETSTATUS functionOleksandr Shulzhenko3-0/+51
Get Device Status (GETSTATUS) is a Direct CCC that is sent by I3C controller to I3C Target device to read I3C Target status. Signed-off-by: Oleksandr Shulzhenko <oleksandr.shulzhenko.viktorovych@intel.com>
2022-01-10i3c: dw: master: Fix IBI readingIwona Winiarska1-3/+1
dw_i3c_master_read_fifo() uses readsl() that allows to read all requested data and writes it to the given buffer. Calling it in a loop may cause the data to be overwritten. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-01-10i3c: master: dw: Set dw_i3c_master.devIwona Winiarska1-0/+2
dw_i3c_master.dev is not initialized, which can be observed in logs: [246977.695838] (NULL device *): no matching dev Set dw_i3c_master.dev in probe time to avoid using it as a NULL. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-01-10i3c: master: dw: Enable IBI starting from LC releaseIwona Winiarska1-11/+25
The current implementation of IBI handling on DW controller expects that the HW supports MDB/payload. This support is not available for older hardware releases. Let's enable IBI support only for hardware versions that support it. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-01-10Revert "iklimasz/i3c-fixups (#1)"Iwona Winiarska1-28/+14
This reverts commit aaccb149bfa6ff74dc8e9ff043191730060002db. A series of commits were unintentionally squashed. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2022-01-06iklimasz/i3c-fixups (#1)Iwona Winiarska1-14/+28
* i3c: master: dw: Enable IBI starting from LC release The current implementation of IBI handling on DW controller expects that the HW supports MDB/payload. This support is not available for older hardware releases. Let's enable IBI support only for hardware versions that support it. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com> * i3c: master: dw: Set dw_i3c_master.dev dw_i3c_master.dev is not initialized, which can be observed in logs: [246977.695838] (NULL device *): no matching dev Set dw_i3c_master.dev in probe time to avoid using it as a NULL. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com> * i3c: dw: master: Fix IBI reading dw_i3c_master_read_fifo() uses readsl() that allows to read all requested data and writes it to the given buffer. Calling it in a loop may cause the data to be overwritten. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
2021-11-24i3c: master: Remove aspeed-i3c-globalIwona Winiarska3-116/+0
Intel-BMC Linux fork doesn't use aspeed-i3c-global. Since it is not present upstream, remove it. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com> Change-Id: I9718953aa2e85cbc3689373b6783e15b5faa93c0
2021-11-18i3c: master: dw: add IBI supportOleksandr Shulzhenko1-6/+288
i3c_master_controller_ops APIs were implemented in order to provide i3c drivers with interfaces to act upon IBI requests sent to dw i3c master devices The ASPEED implementation was used as a reference: https://github.com/AspeedTech-BMC/linux Change-Id: I4de28caffc10e099feaecc68e943e1a85224b346 Signed-off-by: Oleksandr Shulzhenko <oleksandr.shulzhenko.viktorovych@intel.com>
2021-11-05i3c: master: dw: Remove IBI_WIP codeOleksandr Shulzhenko1-47/+0
The IBI_WIP code is not used and not expected to be used in the future. Remove it. Change-Id: I6a3808c3808ab827c3ac326dbf1be244beffd6f6 Signed-off-by: Oleksandr Shulzhenko <oleksandr.shulzhenko.viktorovych@intel.com>
2021-11-05Update I3C bus device listJonathan Doman1-1/+8
To support communication with NVDIMM controllers, add definitions for these I3C devices. Each bus now has two definitions for each DIMM slot. If populated with a DDR5 DIMM, the SPD Hub device will be used to gather temperature readings. If populated with an NVDIMM, we'll only need to talk to the controller sitting behind the hub (local device type 1011b), to read temperature and use the FW mailbox. This also removes some logic in the I3C driver which restricts use of certain addresses due to signal integrity paranoia. An NVDIMM controller in slot 6 of any bus is blocked by this logic, and unfortunately we don't have any control over the static address scheme used on the SPD bus, so the restriction must be removed. Tested: Probed I3C busses successfully with DIMMs installed in busses 0 and 1: $ gpioset $(gpiofind FM_SPD_SWITCH_CTRL_N)=1 $ echo 1e7a2000.i3c0 > /sys/bus/platform/drivers/dw-i3c-master/bind $ echo 1e7a3000.i3c1 > /sys/bus/platform/drivers/dw-i3c-master/bind $ ls /dev/i3c* /dev/i3c-0-3c000000000 /dev/i3c-0-3c000000001 /dev/i3c-0-3c000000002 /dev/i3c-0-3c000000003 /dev/i3c-0-3c000000004 /dev/i3c-0-3c000000005 /dev/i3c-0-3c000000006 /dev/i3c-0-3c000000007 /dev/i3c-0-3c000000008 /dev/i3c-0-3c000000009 /dev/i3c-0-3c00000000a /dev/i3c-0-3c00000000b /dev/i3c-0-3c00000000c /dev/i3c-0-3c00000000d /dev/i3c-0-3c00000000e /dev/i3c-1-3c000000000 /dev/i3c-1-3c000000001 /dev/i3c-1-3c000000002 /dev/i3c-1-3c000000003 /dev/i3c-1-3c000000004 /dev/i3c-1-3c000000005 /dev/i3c-1-3c000000006 /dev/i3c-1-3c000000007 /dev/i3c-1-3c000000008 /dev/i3c-1-3c000000009 /dev/i3c-1-3c00000000a /dev/i3c-1-3c00000000b /dev/i3c-1-3c00000000c /dev/i3c-1-3c00000000d /dev/i3c-1-3c00000000e Change-Id: I016450edad1ed4ec981500f04122976f1647b8ee Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
2021-11-05i3c: aspeed: fix a module probe errorJae Hyun Yoo1-14/+11
Modified the Aspeed global driver as a platform driver instead of a postcore initialized one to make it get a reset control resource properly while probing the module. To make it probed ahead of bus modules, it also modifies the object order in makefile. Change-Id: Icefb06c1a4548417aa09f53da5cb2f61ba6f8d09 Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
2021-11-05i3c: master: dw: Fix out of range writeWludzik, Jozef1-5/+8
Fixed out of range write by ignoring usage of CCC_WORKAROUND when DEVICE_ADDR_TABLE_POINTER register returns 0 value. It allows to use simulation software like QEMU where I3C may not be implemented and all its registers are set to zeros. Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
2021-11-05Update I3C driversDylan Hung6-52/+385
This commit ports I3C updates from Aspeed SDK v00.06.00. Note: Should be refined to get upstreamed. Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
2021-11-05i3c: master: dw: fix probing failJae Hyun Yoo1-5/+5
This commit fixed module probing fail by moving irq enabling to just before the i3c_master_register. Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
2021-11-05i3c: master: dw: adjust irq enabling timingJae Hyun Yoo1-8/+8
This commit makes the driver call devm_request_irq when the driver is completely ready to handle interrupts. Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
2021-11-05enable AST2600 I3CJae Hyun Yoo8-1/+545
This commit ports I3C related changes from Aspeed SDK v00.05.05. It also includes Vitor's I3C cdev implementation which isn't upstreamed yet so it should be refined later. Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com> Signed-off-by: Vitor Soares <soares@synopsys.com> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
2021-07-21bus: Make remove callback return voidUwe Kleine-König1-3/+1
The driver core ignores the return value of this callback because there is only little it can do when a device disappears. This is the final bit of a long lasting cleanup quest where several buses were converted to also return void from their remove callback. Additionally some resource leaks were fixed that were caused by drivers returning an error code in the expectation that the driver won't go away. With struct bus_type::remove returning void it's prevented that newly implemented buses return an ignored error code and so don't anticipate wrong expectations for driver authors. Reviewed-by: Tom Rix <trix@redhat.com> (For fpga) Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Cornelia Huck <cohuck@redhat.com> (For drivers/s390 and drivers/vfio) Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> (For ARM, Amba and related parts) Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Chen-Yu Tsai <wens@csie.org> (for sunxi-rsb) Acked-by: Pali Rohár <pali@kernel.org> Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org> (for media) Acked-by: Hans de Goede <hdegoede@redhat.com> (For drivers/platform) Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-By: Vinod Koul <vkoul@kernel.org> Acked-by: Juergen Gross <jgross@suse.com> (For xen) Acked-by: Lee Jones <lee.jones@linaro.org> (For mfd) Acked-by: Johannes Thumshirn <jth@kernel.org> (For mcb) Acked-by: Johan Hovold <johan@kernel.org> Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> (For slimbus) Acked-by: Kirti Wankhede <kwankhede@nvidia.com> (For vfio) Acked-by: Maximilian Luz <luzmaximilian@gmail.com> Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> (For ulpi and typec) Acked-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> (For ipack) Acked-by: Geoff Levand <geoff@infradead.org> (For ps3) Acked-by: Yehezkel Bernat <YehezkelShB@gmail.com> (For thunderbolt) Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> (For intel_th) Acked-by: Dominik Brodowski <linux@dominikbrodowski.net> (For pcmcia) Acked-by: Rafael J. Wysocki <rafael@kernel.org> (For ACPI) Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org> (rpmsg and apr) Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> (For intel-ish-hid) Acked-by: Dan Williams <dan.j.williams@intel.com> (For CXL, DAX, and NVDIMM) Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com> (For isa) Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (For firewire) Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> (For hid) Acked-by: Thorsten Scherer <t.scherer@eckelmann.de> (For siox) Acked-by: Sven Van Asbroeck <TheSven73@gmail.com> (For anybuss) Acked-by: Ulf Hansson <ulf.hansson@linaro.org> (For MMC) Acked-by: Wolfram Sang <wsa@kernel.org> # for I2C Acked-by: Sudeep Holla <sudeep.holla@arm.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Finn Thain <fthain@linux-m68k.org> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20210713193522.1770306-6-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-10Merge tag 'i3c/for-5.14' of ↵Linus Torvalds1-2/+1
git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux Pull i3c updates from Alexandre Belloni: - two small fixes to the svc driver * tag 'i3c/for-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c: master: svc: fix doc warning in svc-i3c-master.c i3c: master: svc: drop free_irq of devm_request_irq allocated irq
2021-06-29i3c: master: cdns: Fix fall-through warning for ClangGustavo A. R. Silva1-0/+2
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2021-06-09i3c: master: svc: fix doc warning in svc-i3c-master.cYang Yingliang1-1/+1
Fix the following make W=1 warning: drivers/i3c/master/svc-i3c-master.c:207: warning: expecting prototype for struct svc_i3c_i3c_dev_data. Prototype was for struct svc_i3c_i2c_dev_data instead Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210602085544.4101980-1-yangyingliang@huawei.com
2021-06-09i3c: master: svc: drop free_irq of devm_request_irq allocated irqYang Yingliang1-1/+0
irq allocated with devm_request_irq() will be freed in devm_irq_release(), using free_irq() in ->remove() will causes a dangling pointer, and a subsequent double free. So remove the free_irq() in svc_i3c_master_remove(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210602084935.3977636-1-yangyingliang@huawei.com
2021-04-24Revert "i3c master: fix missing destroy_workqueue() on error in ↵Jae Hyun Yoo1-4/+1
i3c_master_register" Adding the destroy_workqueue call in i3c_master_register introduced below kernel warning because it makes duplicate destroy_workqueue calls when i3c_master_register fails after allocating the workqueue. The workqueue will be destroyed by i3c_masterdev_release which is called by put_device at the end of the i3c_master_register function eventually in failure cases so the workqueue doesn't need to be destroyed in i3c_master_register. [ 6.972952] WARNING: CPU: 1 PID: 1 at lib/list_debug.c:48 __list_del_entry_valid+0x9c/0xf4 [ 6.982205] list_del corruption, 8fe03c08->prev is LIST_POISON2 (00000122) [ 6.989910] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 5.10.23-c12838a-dirty-31dc772 #1 [ 7.000295] Hardware name: Generic DT based system [ 7.005638] Backtrace: [ 7.008369] [<809133f0>] (dump_backtrace) from [<80913644>] (show_stack+0x20/0x24) [ 7.016819] r7:00000030 r6:60000013 r5:00000000 r4:813b5d40 [ 7.023137] [<80913624>] (show_stack) from [<8091e1a0>] (dump_stack+0x9c/0xb0) [ 7.031201] [<8091e104>] (dump_stack) from [<8011fa30>] (__warn+0xf8/0x154) [ 7.038972] r7:00000030 r6:00000009 r5:804fa1c8 r4:80b6eca4 [ 7.045289] [<8011f938>] (__warn) from [<80913d14>] (warn_slowpath_fmt+0x8c/0xc0) [ 7.053641] r7:00000030 r6:80b6eca4 r5:80b6ed74 r4:818cc000 [ 7.059960] [<80913c8c>] (warn_slowpath_fmt) from [<804fa1c8>] (__list_del_entry_valid+0x9c/0xf4) [ 7.069866] r9:96becf8c r8:818cc000 r7:8fe03c10 r6:8fe03c00 r5:8fe03ba0 r4:ff7ead4c [ 7.078513] [<804fa12c>] (__list_del_entry_valid) from [<8013f0b4>] (destroy_workqueue+0x1c4/0x23c) [ 7.088615] [<8013eef0>] (destroy_workqueue) from [<806aa124>] (i3c_masterdev_release+0x40/0xb0) [ 7.098421] r7:00000000 r6:81a43b80 r5:8fe65360 r4:8fe65048 [ 7.104740] [<806aa0e4>] (i3c_masterdev_release) from [<805f3f04>] (device_release+0x40/0xb0) [ 7.114254] r5:00000000 r4:8fe65048 [ 7.118245] [<805f3ec4>] (device_release) from [<808fe754>] (kobject_put+0xc8/0x204) [ 7.126885] r5:813978dc r4:8fe65048 [ 7.130877] [<808fe68c>] (kobject_put) from [<805f5fbc>] (put_device+0x20/0x24) [ 7.139037] r7:8fe65358 r6:8fe65368 r5:8fe65358 r4:8fe65048 [ 7.145355] [<805f5f9c>] (put_device) from [<806abac4>] (i3c_master_register+0x338/0xb00) [ 7.154487] [<806ab78c>] (i3c_master_register) from [<806ae084>] (dw_i3c_probe+0x224/0x24c) [ 7.163811] r10:00000000 r9:8fe7a100 r8:00000032 r7:819fa810 r6:819fa800 r5:8fe65040 [ 7.172547] r4:00000000 [ 7.175376] [<806ade60>] (dw_i3c_probe) from [<805fdc14>] (platform_drv_probe+0x44/0x80) [ 7.184409] r9:813a25c0 r8:00000000 r7:815ec114 r6:00000000 r5:813a25c0 r4:819fa810 [ 7.193053] [<805fdbd0>] (platform_drv_probe) from [<805fb83c>] (really_probe+0x108/0x50c) [ 7.202275] r5:815ec004 r4:819fa810 [ 7.206265] [<805fb734>] (really_probe) from [<805fc180>] (driver_probe_device+0xb4/0x190) [ 7.215492] r10:813dc000 r9:80c4385c r8:000000d9 r7:813a25c0 r6:819fa810 r5:00000000 [ 7.224228] r4:813a25c0 [ 7.227055] [<805fc0cc>] (driver_probe_device) from [<805fc5cc>] (device_driver_attach+0xb8/0xc0) [ 7.236959] r9:80c4385c r8:000000d9 r7:813a25c0 r6:819fa854 r4:819fa810 [ 7.244439] [<805fc514>] (device_driver_attach) from [<805fc65c>] (__driver_attach+0x88/0x16c) [ 7.254051] r7:00000000 r6:819fa810 r5:00000000 r4:813a25c0 [ 7.260369] [<805fc5d4>] (__driver_attach) from [<805f954c>] (bus_for_each_dev+0x88/0xc8) [ 7.269489] r7:00000000 r6:818cc000 r5:805fc5d4 r4:813a25c0 [ 7.275806] [<805f94c4>] (bus_for_each_dev) from [<805fc76c>] (driver_attach+0x2c/0x30) [ 7.284739] r7:81397c98 r6:00000000 r5:8fe7db80 r4:813a25c0 [ 7.291057] [<805fc740>] (driver_attach) from [<805f9eec>] (bus_add_driver+0x120/0x200) [ 7.299984] [<805f9dcc>] (bus_add_driver) from [<805fce44>] (driver_register+0x98/0x128) [ 7.309005] r7:80c4383c r6:00000000 r5:00000000 r4:813a25c0 [ 7.315323] [<805fcdac>] (driver_register) from [<805fedb4>] (__platform_driver_register+0x50/0x58) [ 7.325410] r5:818cc000 r4:81397c98 [ 7.329404] [<805fed64>] (__platform_driver_register) from [<80c23398>] (dw_i3c_driver_init+0x24/0x28) [ 7.339790] r5:818cc000 r4:80c23374 [ 7.343784] [<80c23374>] (dw_i3c_driver_init) from [<80c01300>] (do_one_initcall+0xac/0x1d0) [ 7.353206] [<80c01254>] (do_one_initcall) from [<80c01630>] (kernel_init_freeable+0x1a8/0x204) [ 7.362916] r8:000000d9 r7:80c4383c r6:00000007 r5:819ca2c0 r4:80c67680 [ 7.370398] [<80c01488>] (kernel_init_freeable) from [<8091eb18>] (kernel_init+0x18/0x12c) [ 7.379616] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:8091eb00 [ 7.388343] r4:00000000 [ 7.391170] [<8091eb00>] (kernel_init) from [<80100148>] (ret_from_fork+0x14/0x2c) [ 7.399607] Exception stack(0x818cdfb0 to 0x818cdff8) [ 7.405243] dfa0: 00000000 00000000 00000000 00000000 [ 7.414371] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 7.423499] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 7.430879] r5:8091eb00 r4:00000000 This reverts commit 59165d16c699182b86b5c65181013f1fd88feb62. Fixes: 59165d16c699 ("i3c master: fix missing destroy_workqueue() on error in i3c_master_register") Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210408172803.24599-1-jae.hyun.yoo@linux.intel.com
2021-03-09i3c: master: svc: remove redundant assignment to cmd->read_lenColin Ian King1-1/+0
The assignment of xfer_len to cmd->read_len appears to be redundant as the next statement re-assigns the value 0 to it. Clean up the code by removing the redundant first assignment. Addresses-Coverity: ("Unused value") Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210224151349.202332-1-colin.king@canonical.com
2021-02-22Merge tag 'i3c/for-5.12' of ↵Linus Torvalds6-10/+1496
git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux Pull i3c update from Alexandre Belloni: "Subsystem: - Handle drivers without probe or remove callback - Remove callback now returns void - DT documentation is now in yaml New driver: - Silvaco I3C master" * tag 'i3c/for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c: master: dw: Drop redundant disec call MAINTAINERS: Add Silvaco I3C master i3c: master: svc: Add Silvaco I3C master driver dt-bindings: i3c: Describe Silvaco master binding dt-bindings: Add vendor prefix for Silvaco dt-bindings: i3c: mipi-hci: Include the bus binding dt-bindings: i3c: Convert the bus description to yaml i3c: Make remove callback return void i3c: Handle drivers without probe or remove callback i3c/master/mipi-i3c-hci: Specify HAS_IOMEM dependency