This fixes device lifetime issues where it was possible to free a live
struct device.
Fixes: a3b9a99980 ("counter: add FlexTimer Module Quadrature decoder counter driver")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-19-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This fixes device lifetime issues where it was possible to free a live
struct device.
Fixes: b711f687a1 ("counter: Add support for Intel Quadrature Encoder Peripheral")
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-18-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This fixes device lifetime issues where it was possible to free a live
struct device.
Fixes: a55ebd47f2 ("counter: add IRQ or GPIO based counter")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-17-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This fixes device lifetime issues where it was possible to free a live
struct device.
Fixes: f1d8a071d4 ("counter: 104-quad-8: Add Generic Counter interface support")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-16-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In order to replace the counter registration API also update the
documentation to the new way.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-15-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The current implementation gets device lifetime tracking wrong. The
problem is that allocation of struct counter_device is controlled by the
individual drivers but this structure contains a struct device that
might have to live longer than a driver is bound. As a result a command
sequence like:
{ sleep 5; echo bang; } > /dev/counter0 &
sleep 1;
echo 40000000.timer:counter > /sys/bus/platform/drivers/stm32-timer-counter/unbind
can keep a reference to the struct device and unbinding results in
freeing the memory occupied by this device resulting in an oops.
This commit provides two new functions (plus some helpers):
- counter_alloc() to allocate a struct counter_device that is
automatically freed once the embedded struct device is released
- counter_add() to register such a device.
Note that this commit doesn't fix any issues, all drivers have to be
converted to these new functions to correct the lifetime problems.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-14-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This is a straight forward conversion to the new counter_priv() wrapper.
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-13-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This is a straight forward conversion to the new counter_priv() wrapper.
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-12-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This is a straight forward conversion to the new counter_priv() wrapper.
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Acked-by: David Lechner <david@lechnology.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-11-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This is a straight forward conversion to the new counter_priv() wrapper.
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This is a straight forward conversion to the new counter_priv() wrapper.
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-9-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This is a straight forward conversion to the new counter_priv() wrapper.
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-8-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This is a straight forward conversion to the new counter_priv() wrapper.
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-7-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This is a straight forward conversion to the new counter_priv() wrapper.
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-6-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
For now this just wraps accessing struct counter_device::priv. However
this is about to change and converting drivers to this helper
individually makes fixing device lifetime issues result in easier to
review patches.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-5-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The driver doesn't ever use platform_get_drvdata, so drop this unused
call.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-4-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The driver doesn't ever use platform_get_drvdata, so drop this unused
call.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The counter core uses drvdata to find a struct counter_device from a
struct device. However as the device is a member of struct counter_device,
the lookup can be done faster (and a bit type safe) using container_of.
There are no other users of drvdata, so the call to dev_set_drvdata can
go away, too.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Don't blindly copy status value received from the firmware
into internal client status field,
It may be positive and ERR_PTR(ret) will translate it
into an invalid address and the caller will crash.
Put the error code into the client status on failure.
Fixes: 369aea8459 ("mei: implement client dma setup.")
Cc: <stable@vger.kernel.org> # v5.11+
Reported-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Tested-by: : Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20211228082047.378115-1-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
When firmware load failed, kernel report task hung as follows:
INFO: task xrun:5191 blocked for more than 147 seconds.
Tainted: G W 5.16.0-rc5-next-20211220+ #11
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:xrun state:D stack: 0 pid: 5191 ppid: 270 flags:0x00000004
Call Trace:
__schedule+0xc12/0x4b50 kernel/sched/core.c:4986
schedule+0xd7/0x260 kernel/sched/core.c:6369 (discriminator 1)
schedule_timeout+0x7aa/0xa80 kernel/time/timer.c:1857
wait_for_completion+0x181/0x290 kernel/sched/completion.c:85
lattice_ecp3_remove+0x32/0x40 drivers/misc/lattice-ecp3-config.c:221
spi_remove+0x72/0xb0 drivers/spi/spi.c:409
lattice_ecp3_remove() wait for signals from firmware loading, but when
load failed, firmware_load() does not send this signal. This cause
device remove hung. Fix it by sending signal even if load failed.
Fixes: 781551df57 ("misc: Add Lattice ECP3 FPGA configuration via SPI")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20211228125522.3122284-1-weiyongjun1@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- New support:
- Qualcomm eDP PHY driver
- Qualcomm SM8450 UFS, USB2, USB3, PCIe0 and PCIe1 phy support
- Lan966x ethernet serdes PHY driver
- Support for uniphier NXI & Pro4 SoC
- Qualcomm SM6350 USB2 support
- Amlogic Meson8 HDMI TX PHY driver
- Rockchip rk3568 usb2 support
- Intel Thunder Bay eMMC PHY driver
- Freescale IMX8 PCIe phy driver
- Updates:
- Cadence Sierra driver updates for multilink configurations
- Bcm usb2 updates for Phy reg space
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE+vs47OPLdNbVcHzyfBQHDyUjg0cFAmHNmqQACgkQfBQHDyUj
g0fhew/9H14cOScEaekVHvEtyxWJwAuNFlquEiQPLqnjL67aSDy4Xku43Z8xXvvY
8XwSmDhlZV/UmQMte1+XKyEEPpfUScN7elVP5/Vq07oHM/jaDG1dPPPZyf0pIM4y
bpD2dameXpHThC3Mb8QpERsZA0d4zvm6+8PN0MtkZGTPNKTwMl7sBIA/W76Ic+my
6+HUqANa5OXo0iEZSDK8TkygpblIdgYthYsTaSTuiAkxYSse47U0xUWuex3UVQpZ
DSSCZUtjxTXTMSxJBNi8ry8ZJIkUhiVL4fY3Oh9bYRi9e7UGiEMwCb/yF979kPYA
ZcI8bR/w0/f4oIQdOUjcxIA6n9avKrnAEIQFp18dWTBjUZTEZdYz2zS0DMuXq9t2
4yLXSNqO2FvOo3/AK5B/K6tf2j3zJTEdVpiq+rKOKxCAZWY2EDVtdDJRYYynCPK9
xBiut4PrGoG8Fs1RiL768kzy5a21fbDK5CFS8QYbbno/YhznwNFKKRX4VdgY/b1b
ltI/cD6G70M+TOYCJ0jNIwRoA2dZCUClhdulpltSrTx9tR4M6oH+pXxHBD66WVNK
ouJRaqtvi48ILwXZ9oAEKFQfu8hQt1OMWTcGbJ0ntPPVBPHv7hRQAxAyJZcADfDP
RjO7CX48Il3/33w4kIH9VFO4DE/asYJ6QGOVo9SA0iRh5M9fI88=
=29yF
-----END PGP SIGNATURE-----
Merge tag 'phy-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy into char-misc-next
Vinod writes:
phy-for-5.17
- New support:
- Qualcomm eDP PHY driver
- Qualcomm SM8450 UFS, USB2, USB3, PCIe0 and PCIe1 phy support
- Lan966x ethernet serdes PHY driver
- Support for uniphier NXI & Pro4 SoC
- Qualcomm SM6350 USB2 support
- Amlogic Meson8 HDMI TX PHY driver
- Rockchip rk3568 usb2 support
- Intel Thunder Bay eMMC PHY driver
- Freescale IMX8 PCIe phy driver
- Updates:
- Cadence Sierra driver updates for multilink configurations
- Bcm usb2 updates for Phy reg space
* tag 'phy-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (72 commits)
phy: cadence: Sierra: Add support for derived reference clock output
dt-bindings: phy: cadence-sierra: Add clock ID for derived reference clock
phy: cadence: Sierra: Add PCIe + QSGMII PHY multilink configuration
phy: cadence: Sierra: Add support for PHY multilink configurations
phy: cadence: Sierra: Fix to get correct parent for mux clocks
phy: cadence: Sierra: Update single link PCIe register configuration
phy: cadence: Sierra: Check PIPE mode PHY status to be ready for operation
phy: cadence: Sierra: Check cmn_ready assertion during PHY power on
phy: cadence: Sierra: Add PHY PCS common register configurations
phy: cadence: Sierra: Rename some regmap variables to be in sync with Sierra documentation
phy: cadence: Sierra: Add support to get SSC type from device tree
dt-bindings: phy: cadence-sierra: Add binding to specify SSC mode
dt-bindings: phy: cadence-torrent: Rename SSC macros to use generic names
phy: cadence: Sierra: Prepare driver to add support for multilink configurations
phy: cadence: Sierra: Use of_device_get_match_data() to get driver data
phy: mediatek: Fix missing check in mtk_mipi_tx_probe
phy: uniphier-usb3ss: fix unintended writing zeros to PHY register
phy: phy-mtk-tphy: use new io helpers to access register
phy: phy-mtk-xsphy: use new io helpers to access register
phy: mediatek: add helpers to update bits of registers
...
- Remove redundant version number read in qcom driver
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE+vs47OPLdNbVcHzyfBQHDyUjg0cFAmHNkHcACgkQfBQHDyUj
g0eu2w/6AkEvM0qhM6cTdctjFssm4ygxJsguU7IhRbAnlvOG3kv3YsvE5EG+L/Gb
S5Pi7JnTZNCzW1+d3GwEfXenw+SlYK5uV8dqTf8U1n6dkpN42dIlMXrDu3D+JK3Z
zM090gT+PDfevR0T0aFjfz1XzjVuBZ6FY0dLqdD7WxzMxBwQ+ly6Agrzu85MzIPx
4J4lKL3dS7Tqr8XenwNmJUlpxNvlfMLFQwPJNAEDqmWyb+ja2SudodRvHqY2XH0r
/IqxBvEBRlHw3ayhxgNnssih2kdQik1Cn4d1RYWAio87PjI8E7RMyjjhXWitMW15
cMmn/a8kyJ2HhpT8fG8lu9yN5T2R32Q7DBUhXNxIhX0tc+jaYWxqaJtwoNNChri7
OJjRdMh0vatrwAfuXEamhnNyB2Ci1dqsdnY1DM3RVf/UzKzPcZ+3kN86q3Dm3vme
L8yXYlZzytk7AdJGGFsLAFI7VH5AbEzsswiGJBSlRzdf4ywxs8wc3cydoMtEOuE5
ueVtXojhexGhVUfeWAK7XfE98M4SlQz5BvedOgioC5ntfoFsqiZs7ZajCqs1qbDZ
L9jtzz+9xJyYS3hftwDZEc+WKfl0TX+WgqcdPiIG3yISrKBI/SPYVhe1qoBAyA6U
5bHa4dxoEPZ/hY/ARieoRZ++JyqKnUivG5D3Tz8qKWdV7dcD0tc=
=vmnD
-----END PGP SIGNATURE-----
Merge tag 'soundwire-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next
Vinod writes:
soundwire updates for 5.17-rc1
- Remove redundant version number read in qcom driver
* tag 'soundwire-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
soundwire: qcom: remove redundant version number read
A small additional set of things that just missed the previous
pull request and have mostly been through plenty of review before the
holiday period began (or are trivial). I've not taken some other series
on the list to allow for more eyes after the holiday period.
New device support
* adi,admv1013
- New driver for this wideband microwave upconverter including dt-bindings
and some device specific ABI due to the need to describe phase calibrations
of a differential channel on both i and q phases. Previously we could
do differential or i/q but not both on the same channel. The driver
ABI uses a workaround for core support which will do until we know if
this is a common requirement for which a more generic solution is
needed.
MAINTAINERS:
* Add Haibo Chen as a maintainer for various NXP SoC ADCs.
Minor cleanup:
* sunrise_co2
- Make sure an uninitialized value isn't used to set *val in read_raw().
Not a real bug, but a compiler or reviewer can't tell that based
on what they can see locally.
-----BEGIN PGP SIGNATURE-----
iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAmHMmK8RHGppYzIzQGtl
cm5lbC5vcmcACgkQVIU0mcT0FojlXxAArtYBgrKMtlTj6ipC7k4soCAW/hMJ4G9u
woly0uJTpC2lF+5E2dNixkKY9QfW/CzFDVuUUb5Q5G3fAGHPluw+ZuAbvrlQQngy
1bsn8nu2T4xakdWlQ70z15v1z0C0jcPCRIbIIO71N4qdzqqfp+0zSpFOMJ4HXfAy
e41TJR/IGCZMgio0mwpjNRQ3dXB/vVLn3MGb4++hHcLF3lJplueRan403AIYpAYT
T/MGmQ2UFUsae9p/3VnyB6NLSo4WqxJcUIVBL6/Ppb+1xf/2RZ/TsRg+Ve0CIDjR
E1wwraTymHt+M4XOtG3KEaUyf7UDAkwFvikeYdWYGzESlelLDEIZZzvbpPYQdroy
wKHKYkW/piHZOHN8WpYHwgxkaha12eJqSchHp/0bAI4WZci99MUF10TMA9Hg2a6K
aOfhK4tRza6SzSckrRuQyiAQe397a29F/zJ+8mPsah/wcEVfFMSq0J0/v7qlpZaa
GDou8JSIDN5gZoItMwJN39xZOKgG3WlO/cJKQuDcm0/XiCljVPeQUsO/E6hD/qU6
8AWpLaH4RaiIYvwS3Y/9VeR/NVmpWWB1XUV+Wj+hctWezyz6ibsHjd+IKI0V6Bna
/lMknr+0kEv6R2oj/klwzZvDfKrRSLM55nFULzdU47dMo+jM3k8XYdxSNfoXW1rp
zxqhN8SaP3c=
=A8Bn
-----END PGP SIGNATURE-----
Merge tag 'iio-for-5.17b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes:
2nd set of new device support etc for IIO in the 5.17 cycle.
A small additional set of things that just missed the previous
pull request and have mostly been through plenty of review before the
holiday period began (or are trivial). I've not taken some other series
on the list to allow for more eyes after the holiday period.
New device support
* adi,admv1013
- New driver for this wideband microwave upconverter including dt-bindings
and some device specific ABI due to the need to describe phase calibrations
of a differential channel on both i and q phases. Previously we could
do differential or i/q but not both on the same channel. The driver
ABI uses a workaround for core support which will do until we know if
this is a common requirement for which a more generic solution is
needed.
MAINTAINERS:
* Add Haibo Chen as a maintainer for various NXP SoC ADCs.
Minor cleanup:
* sunrise_co2
- Make sure an uninitialized value isn't used to set *val in read_raw().
Not a real bug, but a compiler or reviewer can't tell that based
on what they can see locally.
* tag 'iio-for-5.17b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
iio: chemical: sunrise_co2: set val parameter only on success
dt-bindings:iio:adc: update the maintainer of vf610-adc
MAINTAINERS: add imx7d/imx6sx/imx6ul/imx8qxp and vf610 adc maintainer
Documentation:ABI:testing:admv1013: add ABI docs
dt-bindings: iio: frequency: add admv1013 doc
iio: frequency: admv1013: add support for ADMV1013
There are currently 2 ways to create a set of sysfs files for a
kobj_type, through the default_attrs field, and the default_groups
field. Move the cxl code to use default_groups field which has been the
preferred way since aa30f47cf6 ("kobject: Add support for default
attribute groups to kobj_type") so that we can soon get rid of the
obsolete default_attrs field.
Cc: Frederic Barrat <fbarrat@linux.ibm.com>
Cc: Andrew Donnellan <ajd@linux.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20211228131350.249532-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There are currently 2 ways to create a set of sysfs files for a
kobj_type, through the default_attrs field, and the default_groups
field. Move the UIO code to use default_groups field which has been the
preferred way since aa30f47cf6 ("kobject: Add support for default
attribute groups to kobj_type") so that we can soon get rid of the
obsolete default_attrs field.
Link: https://lore.kernel.org/r/20211228131319.249324-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Clang static analysis reports this representative warning
sunrise_co2.c:410:9: warning: Assigned value is garbage or undefined
*val = value;
^ ~~~~~
The ealier call to sunrise_read_word can fail without setting
value. So defer setting val until we know the read was successful.
Fixes: c397894e24 ("iio: chemical: Add Senseair Sunrise 006-0-007 driver")
Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20211224150833.3278236-1-trix@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Sierra has derived differential reference clock output which is sourced
after the spread spectrum generation has been added. Add support to drive
derived reference clock out of serdes. Model this derived clock as a
"clock" so that platforms using this can enable it.
Sierra Main LC VCO PLL divider 1 clock is programmed to output 100MHz
clock output.
Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Reviewed-by: Aswath Govindraju <a-govindraju@ti.com>
Link: https://lore.kernel.org/r/20211223060137.9252-16-sjakhade@cadence.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Add register sequences for PCIe + QSGMII PHY multilink configuration.
PHY configuration for multi-link operation is done in two steps.
e.g. Consider a case for a 4 lane PHY with PCIe using 2 lanes and QSGMII
other 2 lanes. Sierra PHY has 2 PLLs, viz. PLLLC and PLLLC1. So in this
case, PLLLC is used for PCIe and PLLLC1 is used for QSGMII.
PHY is configured in two steps as described below.
[1] For first step, the register values are selected as
[TYPE_PCIE][TYPE_QSGMII][ssc].
This will configure PHY registers associated for PCIe involving PLLLC
registers and registers for first 2 lanes of PHY.
[2] In second step, the register values are selected as
[TYPE_QSGMII][TYPE_PCIE][ssc].
This will configure PHY registers associated for QSGMII involving
PLLLC1 registers and registers for other 2 lanes of PHY.
This completes the PHY configuration for multilink operation.
Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Reviewed-by: Aswath Govindraju <a-govindraju@ti.com>
Link: https://lore.kernel.org/r/20211223060137.9252-14-sjakhade@cadence.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Add support for multilink configuration of Sierra PHY. Currently,
maximum two links are supported.
Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Reviewed-by: Aswath Govindraju <a-govindraju@ti.com>
Link: https://lore.kernel.org/r/20211223060137.9252-13-sjakhade@cadence.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Fix get_parent() callback to return the correct index of the parent for
PLL_CMNLC1 clock. Add a separate table of register values corresponding
to the parent index for PLL_CMNLC1. Update set_parent() callback
accordingly.
Fixes: 28081b7285 ("phy: cadence: Sierra: Model PLL_CMNLC and PLL_CMNLC1 as clocks (mux clocks)")
Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Reviewed-by: Aswath Govindraju <a-govindraju@ti.com>
Link: https://lore.kernel.org/r/20211223060137.9252-12-sjakhade@cadence.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Add single link PCIe register configurations for no SSC and internal
SSC. Also, add missing PMA lane registers for external SSC.
Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Reviewed-by: Aswath Govindraju <a-govindraju@ti.com>
Link: https://lore.kernel.org/r/20211223060137.9252-11-sjakhade@cadence.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
PIPE phy status is used to communicate the completion of several PHY
functions. Check if PHY is ready for operation while configured for
PIPE mode during startup.
Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Reviewed-by: Aswath Govindraju <a-govindraju@ti.com>
Link: https://lore.kernel.org/r/20211223060137.9252-10-sjakhade@cadence.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Check if PMA cmn_ready is set indicating the startup process is complete.
Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Reviewed-by: Aswath Govindraju <a-govindraju@ti.com>
Link: https://lore.kernel.org/r/20211223060137.9252-9-sjakhade@cadence.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Rename SSC macros to use generic names instead of PHY specific names,
so that they can be used to specify SSC modes for both Torrent and
Sierra. Renaming the macros should not affect the things as these are
not being used in any DTS file yet.
Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211223060137.9252-4-sjakhade@cadence.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Sierra driver currently supports single link configurations only. Prepare
driver to support multilink multiprotocol configurations along with
different SSC modes.
Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Reviewed-by: Aswath Govindraju <a-govindraju@ti.com>
Link: https://lore.kernel.org/r/20211223060137.9252-3-sjakhade@cadence.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Use of_device_get_match_data() to get driver data instead of boilerplate
code.
Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Reviewed-by: Aswath Govindraju <a-govindraju@ti.com>
Link: https://lore.kernel.org/r/20211223060137.9252-2-sjakhade@cadence.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
The of_device_get_match_data() function may return NULL.
Add check to prevent potential null dereference.
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20211224082103.7658-1-linmq006@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
The upper layer may retry call to mei_cl_dma_alloc_and_map(),
in that case the client status may be non-zero after the previous call
and the wait condition will be true immediately.
Set cl->status to zero to allow waiting for an actual result
from the firmware.
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20211223094705.204624-2-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The POWERING_DOWN state string was missing from
the device states list, add it.
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20211223094705.204624-1-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- Support reset-during-reset. In case the f/w notifies the driver
that the f/w is going to reset the device, the driver should
support that even if it is in the middle of doing another
reset
- Support events from f/w that arrive during device resets.
These events would be ignored which is bad as critical errors
would not be reported and treated by the driver.
- Don't kill processes that hold the control device open during
hard-reset of the device. The control device operations can't
crash if done during hard-reset. And usually, only monitoring
applications are using the control device, so killing them
defies their purpose.
- Fix handling of hwmon nodes when working with legacy f/w
- Change the compute context pointer to be boolean. This pointer
was abused by multiple code paths that wanted fast access to
the compute context structure.
- Add uapi to fetch historical errors. This is necessary as errors
sometimes result in hard-reset where the user application is
being terminated.
- Optimize GAUDI's MMU cache invalidation.
- Add support for loading the latest f/w.
- Add uapi to fetch HBM replacement and pending rows information.
- Multiple bug fixes to the reset code.
- Multiple bug fixes for Multi-CS ioctl code.
- Multiple bug fixes for wait-for-interrupt ioctl code.
- Many small bug fixes and cleanups.
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEE7TEboABC71LctBLFZR1NuKta54AFAmHJcoMACgkQZR1NuKta
54BXBwf+NYkQ8w3TUR2JSkPs3/pk3XFL+OAXq9NBn2bGJ0qoj8VUz6VkcphJ3vAq
3PyLLxeVs8dk+cVePKEnBj1krED5fFBaxIQbp+g1VjS2LsMiHm2Nwi0iDkLWqo1i
7jwFgATzmnsRvEPhhwke7/Gd+rZ9eCfJ2NuE5Hbb2+JkzIaOCo6ZUZns9diSVDsq
X9zaIQSnYxMd4XEhE8CP4BChJO87i+Ik56ZbqrtKhpLz3kkV+Re5S6dnsEluyGuZ
FXmUXyu5I8NbsGmmHZ9aWrCm/DmhKsF8/UWhKD5i/ECvpQ+U4nO2ii9XiCeuaDwQ
yhsYe1LbqMlroJVkIqTnbBbrSSP6bA==
=anio
-----END PGP SIGNATURE-----
Merge tag 'misc-habanalabs-next-2021-12-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.17:
- Support reset-during-reset. In case the f/w notifies the driver
that the f/w is going to reset the device, the driver should
support that even if it is in the middle of doing another
reset
- Support events from f/w that arrive during device resets.
These events would be ignored which is bad as critical errors
would not be reported and treated by the driver.
- Don't kill processes that hold the control device open during
hard-reset of the device. The control device operations can't
crash if done during hard-reset. And usually, only monitoring
applications are using the control device, so killing them
defies their purpose.
- Fix handling of hwmon nodes when working with legacy f/w
- Change the compute context pointer to be boolean. This pointer
was abused by multiple code paths that wanted fast access to
the compute context structure.
- Add uapi to fetch historical errors. This is necessary as errors
sometimes result in hard-reset where the user application is
being terminated.
- Optimize GAUDI's MMU cache invalidation.
- Add support for loading the latest f/w.
- Add uapi to fetch HBM replacement and pending rows information.
- Multiple bug fixes to the reset code.
- Multiple bug fixes for Multi-CS ioctl code.
- Multiple bug fixes for wait-for-interrupt ioctl code.
- Many small bug fixes and cleanups.
* tag 'misc-habanalabs-next-2021-12-27' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux: (70 commits)
habanalabs: support hard-reset scheduling during soft-reset
habanalabs: add a lock to protect multiple reset variables
habanalabs: refactor reset information variables
habanalabs: handle skip multi-CS if handling not done
habanalabs: add CPU-CP packet for engine core ASID cfg
habanalabs: replace some -ENOTTY with -EINVAL
habanalabs: fix comments according to kernel-doc
habanalabs: fix endianness when reading cpld version
habanalabs: change wait_for_interrupt implementation
habanalabs: prevent wait if CS in multi-CS list completed
habanalabs: modify cpu boot status error print
habanalabs: clean MMU headers definitions
habanalabs: expose soft reset sysfs nodes for inference ASIC
habanalabs: sysfs support for two infineon versions
habanalabs: keep control device alive during hard reset
habanalabs: fix hwmon handling for legacy f/w
habanalabs: add current PI value to cpu packets
habanalabs: remove in_debug check in device open
habanalabs: return correct clock throttling period
habanalabs: wait again for multi-CS if no CS completed
...
Detailed description for this pull request:
1. Remove duplicate code in extcon_set_state_sync() in extcon core
2. Fix non-kernel-doc comment for extcon-usb-gpio.c
-----BEGIN PGP SIGNATURE-----
iQJKBAABCgA0FiEEsSpuqBtbWtRe4rLGnM3fLN7rz1MFAmHFaOAWHGN3MDAuY2hv
aUBzYW1zdW5nLmNvbQAKCRCczd8s3uvPU/sMD/9BPPoxUTV/he+qwRJb3AKGOgcx
87WOU4j/psL0dJdevxyGLHa7m6x8a8SQZDom4xo//ZkriPizZqI36VpBSHAXkdU6
LZhEs426aRTL9ZyP4TY2wHj7f8/DvEf3DZndWrorbMIVd0eIrz3zFNLAZNXpHHxY
ZL/ljGPbTtcIdMb3k2PXiIJtU6JyfQXfN1cqXemF1vXLBgvVZzjVocG6fYyOnSo+
4xfVStUBpk1h9CuJyvUZ+/VUr5D6SIiYFrzD73hLh0vsk2Et4GcZJEq0e3SS9155
ycPWPVvhH+qzAWajKfwUkzORHDf/VBApzzV1qMLSmgbU50X56GRQ76xLto8ogGJe
GhB3hg02iUvdEnDhspUXpxxB9knYQKu+L2UGC7m53EKU1moKZYvHmKdZuKIIoauW
v1T7ou1oqbhYD/XM6B7rNXla3tzOy3WNgcs8XaDwRaqyz/A598ZcsUhnWo/Hx2vl
ptVm/4CciderTuj1Z42aN/eruMGzOK3AsYOZKf4hd1zAl03ktC7OE+iWF7oLvMza
Vz4B1uBMTVxjTUojNc1u9XR+2V7HM+2HUrEQNykvdttYAFLhiNzkNr4B+BU4N7HA
mnG9fQLJCqvHPjhYc7IqvRpBaG77JbMiZtiqusjAHNANqn4zeABcMmMlYZ4PyI18
LsHKHyj7BwgrDGQStQ==
=HQLV
-----END PGP SIGNATURE-----
Merge tag 'extcon-next-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next
Chanwoo writes:
Update extcon next for v5.17
Detailed description for this pull request:
1. Remove duplicate code in extcon_set_state_sync() in extcon core
2. Fix non-kernel-doc comment for extcon-usb-gpio.c
* tag 'extcon-next-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon:
extcon: Deduplicate code in extcon_set_state_sync()
extcon: usb-gpio: fix a non-kernel-doc comment
Here are the interconnect changes for the 5.17-rc1 merge window
consisting of new drivers, minor changes and fixes.
New drivers:
- New driver for MSM8996 platforms
- New driver for SC7280 EPSS L3 hardware
- New driver for QCM2290 platforms
- New driver for SM8450 platforms
Driver changes:
- dt-bindings: interconnect: Combine SDM660 bindings into RPM schema
- icc-rpm: Add support for bus power domain
- icc-rpm: Use NOC_QOS_MODE_INVALID for qos_mode check
- icc-rpm: Define ICC device type
- icc-rpm: Add QNOC type QoS support
- icc-rpm: Support child NoC device probe
- icc-rpm: Prevent integer overflow in rate
- icc-rpmh: Add BCMs to commit list in pre_aggregate
Signed-off-by: Georgi Djakov <djakov@kernel.org>
-----BEGIN PGP SIGNATURE-----
iQIcBAABAgAGBQJhxGkPAAoJEIDQzArG2BZjsRwP/3nr3s4b60PZ9hoxSxcBmmoD
OAwd1tIeyXGxkeKHeJDdDj92hvgdvZwpl/H+wLnzy4VZmNqrIkREl23KaSlLeJE7
P4U0ZUj7DYqXhR6+D1MiWa8+2rzQ/kqbDiXsFPEQL5Wa2/rGVgq95D/znz5Szv6f
EtZUDBBtzR9s56LlL9+pprApWRz4+bf4YfX6AsMuKaKedjqzEKxLov2+wC+6zGoV
2vkFQODxntsoZ95cwRz6GVBAZle/6O/NiSc6ndx/MpPhIQpsr2F0Er1nsgERxDum
EsC3JVl+7aoHTym7npFp/JT04YBpHC3l7SnJff0EDws7MSiBjkp1WNIlYwP5juuA
PZ3ziLtSzy36Vi0OVpykZSdwbeS9lNuz58CI74fIzcfGA1H1q3s8K4JHS7WMcgsQ
EgghbCaiREZKBhZa6gMn4d6cufTpqAImDYae8gD788ziw7x+Pr3P6RgWbn+PE7mI
odlx3OKwnCIsDPTj+5B5rXFKkfzV7grX1HI0sUZDIJ8Cv4Qs1kcLWP6Sg4ZafOMj
ZcwYoTo9dMy81aDfEKIlpXR2ILxcb4vJTNTSdmFsPmNX+01X8rPlk/uCPPx9nClW
acpqJLfCMKKbSwoZwrkWZQo2XCJBq/jan5dg8Q/fMLsqDORUtmnkK+hzR75mHHhP
IydRk18TN1TQUhnNiFcd
=dXxk
-----END PGP SIGNATURE-----
Merge tag 'icc-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next
Georgi writes:
interconnect changes for 5.17
Here are the interconnect changes for the 5.17-rc1 merge window
consisting of new drivers, minor changes and fixes.
New drivers:
- New driver for MSM8996 platforms
- New driver for SC7280 EPSS L3 hardware
- New driver for QCM2290 platforms
- New driver for SM8450 platforms
Driver changes:
- dt-bindings: interconnect: Combine SDM660 bindings into RPM schema
- icc-rpm: Add support for bus power domain
- icc-rpm: Use NOC_QOS_MODE_INVALID for qos_mode check
- icc-rpm: Define ICC device type
- icc-rpm: Add QNOC type QoS support
- icc-rpm: Support child NoC device probe
- icc-rpm: Prevent integer overflow in rate
- icc-rpmh: Add BCMs to commit list in pre_aggregate
Signed-off-by: Georgi Djakov <djakov@kernel.org>
* tag 'icc-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc:
interconnect: qcom: Add QCM2290 driver support
dt-bindings: interconnect: Add Qualcomm QCM2290 NoC support
interconnect: icc-rpm: Support child NoC device probe
interconnect: icc-rpm: Add QNOC type QoS support
interconnect: icc-rpm: Define ICC device type
interconnect: qcom: Add SM8450 interconnect provider driver
dt-bindings: interconnect: Add Qualcomm SM8450 DT bindings
interconnect: qcom: rpm: Prevent integer overflow in rate
interconnect: icc-rpm: Use NOC_QOS_MODE_INVALID for qos_mode check
interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate
interconnect: qcom: Add MSM8996 interconnect provider driver
dt-bindings: interconnect: Add Qualcomm MSM8996 DT bindings
interconnect: icc-rpm: Add support for bus power domain
dt-bindings: interconnect: Combine SDM660 bindings into RPM schema
interconnect: qcom: Add EPSS L3 support on SC7280
dt-bindings: interconnect: Add EPSS L3 DT binding on SC7280
As hard-reset can be requested during soft-reset, driver must allow
it or else critical events received during soft-reset will be
ignored.
Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Atomic operations during reset are replaced by a spinlock in order
to have the ability to protect more than a single variable.
Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Unify variables related to device reset, which will help us to
add some new reset functionality in future patches.
Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>