net: mctp: Add MCTP USB transport driverAdd an implementation for DMTF DSP0283, which defines a MCTP-over-USBtransport. As per that spec, we're restricted to full speed mode,requiring 512-byte tr
net: mctp: Add MCTP USB transport driverAdd an implementation for DMTF DSP0283, which defines a MCTP-over-USBtransport. As per that spec, we're restricted to full speed mode,requiring 512-byte transfers.Each MCTP-over-USB interface is a peer-to-peer link to a single MCTPendpoint, so no physical addressing is required (of course, that MCTPendpoint may then bridge to further MCTP endpoints). Consequently,interfaces will report with no lladdr data: # mctp link dev lo index 1 address 00:00:00:00:00:00 net 1 mtu 65536 up dev mctpusb0 index 6 address none net 1 mtu 68 upThis is a simple initial implementation, with single rx & tx urbs, andno multi-packet tx transfers - although we do accept multi-packet rxfrom the device.Includes suggested fixes and backport reworks from Santosh Puranik<spuranik@nvidia.com>.Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>Cc: Santosh Puranik <spuranik@nvidia.com>Link: https://patch.msgid.link/20250221-dev-mctp-usb-v3-2-3353030fe9cc@codeconstruct.com.auSigned-off-by: Jakub Kicinski <kuba@kernel.org>(cherry picked from commit 0791c0327a6e4e7691d6fc5ad334c215de04dcc9)[arj: squashed in Santosh's v6.6 rework into the backport]Link: https://patch.msgid.link/20250507173806.5371-4-santosh.puranik.ibm@gmail.comSigned-off-by: Santosh Puranik <santosh.puranik.ibm@gmail.com>Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
net: mctp i3c: Copy headers if clonedUse skb_cow_head() prior to modifying the tx skb. This is necessarywhen the skb has been cloned, to avoid modifying other shared clones.Signed-off-by: Matt J
net: mctp i3c: Copy headers if clonedUse skb_cow_head() prior to modifying the tx skb. This is necessarywhen the skb has been cloned, to avoid modifying other shared clones.Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>Fixes: c8755b29b58e ("mctp i3c: MCTP I3C driver")Link: https://patch.msgid.link/20250306-matt-i3c-cow-head-v1-1-d5e6a5495227@codeconstruct.com.auSigned-off-by: Jakub Kicinski <kuba@kernel.org>(cherry picked from commit 26db9c9ee19c36a97dbb1cfef007a3c189c4c874)Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
mctp i3c: handle NULL header addressdaddr can be NULL if there is no neighbour table entry present,in that case the tx packet should be dropped.saddr will usually be set by MCTP core, but check
mctp i3c: handle NULL header addressdaddr can be NULL if there is no neighbour table entry present,in that case the tx packet should be dropped.saddr will usually be set by MCTP core, but check for NULL in case apacket is transmitted by a different protocol.Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>Fixes: c8755b29b58e ("mctp i3c: MCTP I3C driver")Link: https://patch.msgid.link/20250304-mctp-i3c-null-v1-1-4416bbd56540@codeconstruct.com.auSigned-off-by: Paolo Abeni <pabeni@redhat.com>(cherry picked from commit cf7ee25e70c6edfac4553d6b671e8b19db1d9573)Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
mctp i3c: fix MCTP I3C driver multi-thread issueWe found a timeout problem with the pldm command on our system. Thereason is that the MCTP-I3C driver has a race condition when receivingmultiple-
mctp i3c: fix MCTP I3C driver multi-thread issueWe found a timeout problem with the pldm command on our system. Thereason is that the MCTP-I3C driver has a race condition when receivingmultiple-packet messages in multi-thread, resulting in a wrong packetorder problem.We identified this problem by adding a debug message to themctp_i3c_read function.According to the MCTP spec, a multiple-packet message must be composedin sequence, and if there is a wrong sequence, the whole message will bediscarded and wait for the next SOM.For example, SOM → Pkt Seq #2 → Pkt Seq #1 → Pkt Seq #3 → EOM.Therefore, we try to solve this problem by adding a mutex to themctp_i3c_read function. Before the modification, when a commandrequesting a multiple-packet message response is sent consecutively, anerror usually occurs within 100 loops. After the mutex, it can gothrough 40000 loops without any error, and it seems to run well.Fixes: c8755b29b58e ("mctp i3c: MCTP I3C driver")Signed-off-by: Leo Yang <Leo-Yang@quantatw.com>Link: https://patch.msgid.link/20250107031529.3296094-1-Leo-Yang@quantatw.com[pabeni@redhat.com: dropped already answered question from changelog]Signed-off-by: Paolo Abeni <pabeni@redhat.com>(cherry picked from commit 2d2d4f60ed266a8f340a721102d035252606980b)Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
net: mctp: Expose transport binding identifier via IFLA attributeMCTP control protocol implementations are transport binding dependent.Endpoint discovery is mandatory based on transport binding.M
net: mctp: Expose transport binding identifier via IFLA attributeMCTP control protocol implementations are transport binding dependent.Endpoint discovery is mandatory based on transport binding.Message timing requirements are specified in each respective transportbinding specification.However, we currently have no means to get this information from MCTPlinks.Add a IFLA_MCTP_PHYS_BINDING netlink link attribute, which representsthe transport type using the DMTF DSP0239-defined type numbers, returnedas part of RTM_GETLINK data.We get an IFLA_MCTP_PHYS_BINDING attribute for each MCTP link, forexample:- 0x00 (unspec) for loopback interface;- 0x01 (SMBus/I2C) for mctpi2c%d interfaces; and- 0x05 (serial) for mctpserial%d interfaces.Signed-off-by: Khang Nguyen <khangng@os.amperecomputing.com>Reviewed-by: Matt Johnston <matt@codeconstruct.com.au>Link: https://patch.msgid.link/20241105071915.821871-1-khangng@os.amperecomputing.comSigned-off-by: Jakub Kicinski <kuba@kernel.org>(cherry picked from commit 580db513b4a9d52f306580015a1872eea0a0894e)Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Merge tag 'v6.6.84' into for/openbmc/dev-6.6This is the 6.6.84 stable release# -----BEGIN PGP SIGNATURE-----## iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmffFS0ACgkQONu9yGCS# aT53cw/+ND0RyKj
Merge tag 'v6.6.84' into for/openbmc/dev-6.6This is the 6.6.84 stable release# -----BEGIN PGP SIGNATURE-----## iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmffFS0ACgkQONu9yGCS# aT53cw/+ND0RyKjVr11YxrMGR7mtAUVMUzE4bcJWGgl7M/BF+2bTWcic5n648P9O# y/hr24jUDpK8kVRvsxlScyPX59drz9f+wDu1nC3oGTFRu2Cs4SG2KGAJoXt0NWLc# oWZ4PskH9YxCK1bjHqSOgVC1+mUqrCASgp7bS1Y4Xd6mUPVN5A3nkq4AUaAq5NJP# 3VNLKJLNEgusjFxZKYQX4f7I6f5PPYaEONxXje+mGYduGOjV7kePa6cyzZDWxger# ZKLyvG/FIDDIIi6wd0x0aOTR2318HfDkz4xfNaw58II61XukSRrZ1PoO+4Jo6l26# aAbY4Cdv0QhCvmI4AqRGZcSTrNFZoroAwHbUjzjkX5DEMF0UoqqKJb8QFQB/HtC5# fKzXMyRcztB2kFldOQgZszHzHzwkzvJuSIQgBNYkQ6Kj2yvnydsDUKSJJIY4NNz/# Ii3q4lflFAYmJUNfzM7lofMXAAiwXKumnTsUZ1AYbWKfciJveX+QO2mqFmDM0Vdr# PdyoO5X7iZkDF0B+GKScUryStI3mBnqCk6XVBIsN+ucobus2EdDVxCsNObEel7v9# nNRqU16+0OhWP9MNyg6sL64Kwb1VrNoUOaspL7cn01v+Iw18i3qiXblNdwpWHvO3# Y0HNwdPIltaPj5qubkAoS6L2DFNzfa7oVgFZafNbLq80YWeQqPQ=# =i2jc# -----END PGP SIGNATURE-----# gpg: Signature made Sun 23 Mar 2025 06:23:17 ACDT# gpg: using RSA key 647F28654894E3BD457199BE38DBBDC86092693E# gpg: Good signature from "Greg Kroah-Hartman <gregkh@kernel.org>" [marginal]# gpg: gregkh@kernel.org: Verified 13 signatures in the past 8 weeks. Encrypted# 0 messages.# gpg: Warning: you have yet to encrypt a message to this key!# gpg: WARNING: This key is not certified with sufficiently trusted signatures!# gpg: It is not certain that the signature belongs to the owner.# Primary key fingerprint: 647F 2865 4894 E3BD 4571 99BE 38DB BDC8 6092 693E
net: mctp i2c: Copy headers if cloned[ Upstream commit df8ce77ba8b7c012a3edd1ca7368b46831341466 ]Use skb_cow_head() prior to modifying the TX SKB. This is necessarywhen the SKB has been cloned,
net: mctp i2c: Copy headers if cloned[ Upstream commit df8ce77ba8b7c012a3edd1ca7368b46831341466 ]Use skb_cow_head() prior to modifying the TX SKB. This is necessarywhen the SKB has been cloned, to avoid modifying other shared clones.Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>Fixes: f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver")Link: https://patch.msgid.link/20250306-matt-mctp-i2c-cow-v1-1-293827212681@codeconstruct.com.auSigned-off-by: Jakub Kicinski <kuba@kernel.org>Signed-off-by: Sasha Levin <sashal@kernel.org>
Merge tag 'v6.6.60' into for/openbmc/dev-6.6This is the 6.6.60 stable release
mctp i2c: handle NULL header address[ Upstream commit 01e215975fd80af81b5b79f009d49ddd35976c13 ]daddr can be NULL if there is no neighbour table entry present,in that case the tx packet should b
mctp i2c: handle NULL header address[ Upstream commit 01e215975fd80af81b5b79f009d49ddd35976c13 ]daddr can be NULL if there is no neighbour table entry present,in that case the tx packet should be dropped.saddr will usually be set by MCTP core, but check for NULL in case apacket is transmitted by a different protocol.Fixes: f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver")Cc: stable@vger.kernel.orgReported-by: Dung Cao <dung@os.amperecomputing.com>Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>Reviewed-by: Simon Horman <horms@kernel.org>Link: https://patch.msgid.link/20241022-mctp-i2c-null-dest-v3-1-e929709956c5@codeconstruct.com.auSigned-off-by: Jakub Kicinski <kuba@kernel.org>Signed-off-by: Sasha Levin <sashal@kernel.org>
Merge tag 'v6.6.51' into for/openbmc/dev-6.6This is the 6.6.51 stable release
net: mctp-serial: Fix missing escapes on transmitcommit f962e8361adfa84e8252d3fc3e5e6bb879f029b1 upstream.0x7d and 0x7e bytes are meant to be escaped in the data portion offrames, but this didn'
net: mctp-serial: Fix missing escapes on transmitcommit f962e8361adfa84e8252d3fc3e5e6bb879f029b1 upstream.0x7d and 0x7e bytes are meant to be escaped in the data portion offrames, but this didn't occur since next_chunk_len() had an off-by-oneerror. That also resulted in the final byte of a payload being writtenas a separate tty write op.The chunk prior to an escaped byte would be one byte short, and thenext call would never test the txpos+1 case, which is where the escapedbyte was located. That meant it never hit the escaping case inmctp_serial_tx_work().Example Input: 01 00 08 c8 7e 80 02Previous incorrect chunks from next_chunk_len():01 00 08c8 7e 8002With this fix:01 00 08 c87e80 02Cc: stable@vger.kernel.orgFixes: a0c2ccd9b5ad ("mctp: Add MCTP-over-serial transport binding")Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>Signed-off-by: David S. Miller <davem@davemloft.net>Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mctp i3c: MCTP I3C driverProvides MCTP network transport over an I3C bus, as specified inDMTF DSP0233.Each I3C bus (with "mctp-controller" devicetree property) gets an"mctpi3cX" net device crea
mctp i3c: MCTP I3C driverProvides MCTP network transport over an I3C bus, as specified inDMTF DSP0233.Each I3C bus (with "mctp-controller" devicetree property) gets an"mctpi3cX" net device created. I3C devices are reachable as remoteendpoints through that net device. Link layer addressing uses theI3C PID as a fixed hardware address for neighbour table entries.The driver matches I3C devices that have the MIPI assigned DCR 0xCC forMCTP.Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>Reviewed-by: Simon Horman <horms@kernel.org>Signed-off-by: Paolo Abeni <pabeni@redhat.com>(cherry picked from commit c8755b29b58ec65be17bcb8c40763d2dcb1f1db5)Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
tty: use u8 for flagsThis makes all those 'char's an explicit 'u8'. This is part of thecontinuing unification of chars and flags to be consistent u8.This approaches tty_port_default_receive_buf(
tty: use u8 for flagsThis makes all those 'char's an explicit 'u8'. This is part of thecontinuing unification of chars and flags to be consistent u8.This approaches tty_port_default_receive_buf().Note that we do not change signedness as we compile with-funsigned-char.Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>Cc: William Hubbs <w.d.hubbs@gmail.com>Cc: Chris Brannon <chris@the-brannons.com>Cc: Kirk Reiser <kirk@reisers.ca>Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>Cc: Marcel Holtmann <marcel@holtmann.org>Cc: Johan Hedberg <johan.hedberg@gmail.com>Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>Cc: Arnd Bergmann <arnd@arndb.de>Cc: "David S. Miller" <davem@davemloft.net>Cc: Eric Dumazet <edumazet@google.com>Cc: Jakub Kicinski <kuba@kernel.org>Cc: Paolo Abeni <pabeni@redhat.com>Cc: Max Staudt <max@enpas.org>Cc: Wolfgang Grandegger <wg@grandegger.com>Cc: Marc Kleine-Budde <mkl@pengutronix.de>Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>Cc: Jeremy Kerr <jk@codeconstruct.com.au>Cc: Matt Johnston <matt@codeconstruct.com.au>Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>Cc: Liam Girdwood <lgirdwood@gmail.com>Cc: Mark Brown <broonie@kernel.org>Cc: Jaroslav Kysela <perex@perex.cz>Cc: Takashi Iwai <tiwai@suse.com>Acked-by: Mark Brown <broonie@kernel.org>Link: https://lore.kernel.org/r/20230810091510.13006-18-jirislaby@kernel.orgSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tty: use u8 for charsThis makes all those 'unsigned char's an explicit 'u8'. This is part ofthe continuing unification of chars and flags to be consistent u8.This approaches tty_port_default_rec
tty: use u8 for charsThis makes all those 'unsigned char's an explicit 'u8'. This is part ofthe continuing unification of chars and flags to be consistent u8.This approaches tty_port_default_receive_buf(). Flags to be next.Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>Cc: William Hubbs <w.d.hubbs@gmail.com>Cc: Chris Brannon <chris@the-brannons.com>Cc: Kirk Reiser <kirk@reisers.ca>Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>Cc: Arnd Bergmann <arnd@arndb.de>Cc: Max Staudt <max@enpas.org>Cc: Wolfgang Grandegger <wg@grandegger.com>Cc: Marc Kleine-Budde <mkl@pengutronix.de>Cc: "David S. Miller" <davem@davemloft.net>Cc: Eric Dumazet <edumazet@google.com>Cc: Jakub Kicinski <kuba@kernel.org>Cc: Paolo Abeni <pabeni@redhat.com>Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>Cc: Jeremy Kerr <jk@codeconstruct.com.au>Cc: Matt Johnston <matt@codeconstruct.com.au>Cc: Liam Girdwood <lgirdwood@gmail.com>Cc: Mark Brown <broonie@kernel.org>Cc: Jaroslav Kysela <perex@perex.cz>Cc: Takashi Iwai <tiwai@suse.com>Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>Acked-by: Mark Brown <broonie@kernel.org>Link: https://lore.kernel.org/r/20230810091510.13006-17-jirislaby@kernel.orgSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tty: make tty_ldisc_ops::*buf*() hooks operate on size_tCount passed to tty_ldisc_ops::receive_buf*(), ::lookahead_buf(), andreturned from ::receive_buf2() is expected to be size_t. So set it tos
tty: make tty_ldisc_ops::*buf*() hooks operate on size_tCount passed to tty_ldisc_ops::receive_buf*(), ::lookahead_buf(), andreturned from ::receive_buf2() is expected to be size_t. So set it tosize_t to unify with the rest of the code.Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>Cc: William Hubbs <w.d.hubbs@gmail.com>Cc: Chris Brannon <chris@the-brannons.com>Cc: Kirk Reiser <kirk@reisers.ca>Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>Cc: Marcel Holtmann <marcel@holtmann.org>Cc: Johan Hedberg <johan.hedberg@gmail.com>Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>Cc: Arnd Bergmann <arnd@arndb.de>Cc: "David S. Miller" <davem@davemloft.net>Cc: Eric Dumazet <edumazet@google.com>Cc: Jakub Kicinski <kuba@kernel.org>Cc: Paolo Abeni <pabeni@redhat.com>Cc: Max Staudt <max@enpas.org>Cc: Wolfgang Grandegger <wg@grandegger.com>Cc: Marc Kleine-Budde <mkl@pengutronix.de>Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>Cc: Jeremy Kerr <jk@codeconstruct.com.au>Cc: Matt Johnston <matt@codeconstruct.com.au>Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>Cc: Liam Girdwood <lgirdwood@gmail.com>Cc: Mark Brown <broonie@kernel.org>Cc: Jaroslav Kysela <perex@perex.cz>Cc: Takashi Iwai <tiwai@suse.com>Acked-by: Mark Brown <broonie@kernel.org>Link: https://lore.kernel.org/r/20230810091510.13006-16-jirislaby@kernel.orgSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mctp i2c: Switch back to use struct i2c_driver's .probe()After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()call-back type"), all drivers being converted to .probe_new() and thencom
mctp i2c: Switch back to use struct i2c_driver's .probe()After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()call-back type"), all drivers being converted to .probe_new() and thencommit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter")convert back to (the new) .probe() to be able to eventually drop.probe_new() from struct i2c_driver.Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>Link: https://lore.kernel.org/r/20230612071641.836976-1-u.kleine-koenig@pengutronix.deSigned-off-by: Jakub Kicinski <kuba@kernel.org>
mctp: serial: Fix starting value for frame check sequenceRFC1662 defines the start state for the crc16 FCS to be 0xffff, butwe're currently starting at zero.This change uses the correct start st
mctp: serial: Fix starting value for frame check sequenceRFC1662 defines the start state for the crc16 FCS to be 0xffff, butwe're currently starting at zero.This change uses the correct start state. We're only early in theadoption for the serial binding, so there aren't yet any other users tointerface to.Fixes: a0c2ccd9b5ad ("mctp: Add MCTP-over-serial transport binding")Reported-by: Harsh Tyagi <harshtya@google.com>Tested-by: Harsh Tyagi <harshtya@google.com>Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>Signed-off-by: David S. Miller <davem@davemloft.net>
mctp i2c: don't count unused / invalid keys for flow releaseWe're currently hitting the WARN_ON in mctp_i2c_flow_release: if (midev->release_count > midev->i2c_lock_count) { WARN_ONCE(
mctp i2c: don't count unused / invalid keys for flow releaseWe're currently hitting the WARN_ON in mctp_i2c_flow_release: if (midev->release_count > midev->i2c_lock_count) { WARN_ONCE(1, "release count overflow");This may be hit if we expire a flow before sending the first packet itcontains - as we will not be pairing the increment of release_count(performed on flow release) with the i2c lock operation (onlyperformed on actual TX).To fix this, only release a flow if we've encountered it previously (ie,dev_flow_state does not indicate NEW), as we will mark the flow asACTIVE at the same time as accounting for the i2c lock operation. Wealso need to add an INVALID flow state, to indicate when we've done therelease.Fixes: f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver")Reported-by: Jian Zhang <zhangjian.3032@bytedance.com>Tested-by: Jian Zhang <zhangjian.3032@bytedance.com>Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>Link: https://lore.kernel.org/r/20221110053135.329071-1-jk@codeconstruct.com.auSigned-off-by: Jakub Kicinski <kuba@kernel.org>
i2c: Make remove callback return voidThe value returned by an i2c driver's remove function is mostly ignored.(Only an error message is printed if the value is non-zero that theerror is ignored.)
i2c: Make remove callback return voidThe value returned by an i2c driver's remove function is mostly ignored.(Only an error message is printed if the value is non-zero that theerror is ignored.)So change the prototype of the remove function to return no value. Thisway driver authors are not tempted to assume that passing an error tothe upper layer is a good idea. All drivers are adapted accordingly.There is no intended change of behaviour, all callbacks were prepared toreturn 0 before.Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com>Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>Reviewed-by: Crt Mori <cmo@melexis.com>Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>Acked-by: Marek Behún <kabel@kernel.org> # for leds-turris-omniaAcked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxswReviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for surface3_powerAcked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> # for bmc150-accel-i2c + kxcjk-1013Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> # for media/* + staging/media/*Acked-by: Miguel Ojeda <ojeda@kernel.org> # for auxdisplay/ht16k33 + auxdisplay/lcd2sReviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for versaclock5Reviewed-by: Ajay Gupta <ajayg@nvidia.com> # for ucsi_ccgAcked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # for iioAcked-by: Peter Rosin <peda@axentia.se> # for i2c-mux-*, max9860Acked-by: Adrien Grassein <adrien.grassein@gmail.com> # for lontium-lt8912bReviewed-by: Jean Delvare <jdelvare@suse.de> # for hwmon, i2c-core and i2c/muxesAcked-by: Corey Minyard <cminyard@mvista.com> # for IPMIReviewed-by: Vladimir Oltean <olteanv@gmail.com>Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for drivers/powerAcked-by: Krzysztof Hałasa <khalasa@piap.pl>Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>Signed-off-by: Wolfram Sang <wsa@kernel.org>
mctp i2c: correct mctp_i2c_header_create resultheader_ops.create should return the length of the header,instead mctp_i2c_head_create() returned 0.This didn't cause any problem because the MCTP st
mctp i2c: correct mctp_i2c_header_create resultheader_ops.create should return the length of the header,instead mctp_i2c_head_create() returned 0.This didn't cause any problem because the MCTP stack accepted0 as success.Fixes: f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver")Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>Signed-off-by: David S. Miller <davem@davemloft.net>
mctp: serial: Use netif_rx().Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.")the function netif_rx() can be used in preemptible/thread context asw
mctp: serial: Use netif_rx().Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.")the function netif_rx() can be used in preemptible/thread context aswell as in interrupt context.Use netif_rx().Cc: Jeremy Kerr <jk@codeconstruct.com.au>Cc: Matt Johnston <matt@codeconstruct.com.au>Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>Signed-off-by: David S. Miller <davem@davemloft.net>
mctp i2c: Fix hard head TX bounds length checkWe should be testing the length before fitting into the u8 byte_count.This is just a sanity check, the MCTP stack should have limited to MTUwhich is
mctp i2c: Fix hard head TX bounds length checkWe should be testing the length before fitting into the u8 byte_count.This is just a sanity check, the MCTP stack should have limited to MTUwhich is checked, and we check consistency later in mctp_i2c_xmit().Found by Smatchmctp_i2c_header_create() warn: impossible condition '(hdr->byte_count > 255) => (0-255 > 255)'Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>Signed-off-by: Jakub Kicinski <kuba@kernel.org>
mctp i2c: Fix potential use-after-freeThe skb is handed off to netif_rx() which may free it.Found by Smatch.Reported-by: Dan Carpenter <dan.carpenter@oracle.com>Signed-off-by: Matt Johnston <ma
mctp i2c: Fix potential use-after-freeThe skb is handed off to netif_rx() which may free it.Found by Smatch.Reported-by: Dan Carpenter <dan.carpenter@oracle.com>Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>Signed-off-by: Jakub Kicinski <kuba@kernel.org>
mctp i2c: MCTP I2C binding driverProvides MCTP network transport over an I2C bus, as specified inDMTF DSP0237. All messages between nodes are sent as SMBus Block Writes.Each I2C bus to be used f
mctp i2c: MCTP I2C binding driverProvides MCTP network transport over an I2C bus, as specified inDMTF DSP0237. All messages between nodes are sent as SMBus Block Writes.Each I2C bus to be used for MCTP is flagged in devicetree by a'mctp-controller' property on the bus node. Each flagged bus gets amctpi2cX net device created based on the bus number. A'mctp-i2c-controller' I2C client needs to be added under the adapter. Inan I2C mux situation the mctp-i2c-controller node must be attached onlyto the root I2C bus. The I2C client will handle incoming I2C slave blockwrite data for subordinate busses as well as its own bus.In configurations without devicetree a driver instance can be attachedto a bus using the I2C slave new_device mechanism.The MCTP core will hold/release the MCTP I2C device while responsesare pending (a 6 second timeout or once a socket is closed, responsereceived etc). While held the MCTP I2C driver will lock the I2C bus sothat the correct I2C mux remains selected while responses are received.(Ideally we would just lock the mux to keep the current bus selected forthe response rather than a full I2C bus lock, but that isn't exposed inthe I2C mux API)Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>Reviewed-by: Wolfram Sang <wsa@kernel.org> # I2C transport partsSigned-off-by: David S. Miller <davem@davemloft.net>
mctp: serial: Cancel pending work from ndo_uninit handlerWe cannot do the cancel_work_sync from after the unregister_netdev, asthe dev pointer is no longer valid, causing a uaf on ldisc unregister
mctp: serial: Cancel pending work from ndo_uninit handlerWe cannot do the cancel_work_sync from after the unregister_netdev, asthe dev pointer is no longer valid, causing a uaf on ldisc unregister(or device close).Instead, do the cancel_work_sync from the ndo_uninit op, where the devstill exists, but the queue has stopped.Fixes: 7bd9890f3d74 ("mctp: serial: cancel tx work on ldisc close")Reported-by: Luo Likang <luolikang@nsfocus.com>Tested-by: Luo Likang <luolikang@nsfocus.com>Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>Link: https://lore.kernel.org/r/20220211011552.1861886-1-jk@codeconstruct.com.auSigned-off-by: Jakub Kicinski <kuba@kernel.org>
12