Signed-off-by: Wentong Wu <wentong.wu@intel.com>
(cherry picked from commit bf1e109299244c0070d0a8a98476c99132e73488 github.com/intel/ivsc-driver) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit 11f55ee365786229f6a77885a817ead89e5e5a56 github.com/intel/ivsc-driver) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Ye Xiang [Thu, 11 Nov 2021 16:14:54 +0000 (00:14 +0800)]
UBUNTU: SAUCE: mei_vsc: add ACPI HID for ADL
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit c8e2655d0d5e04ae00037a0a37b6c84781d9ec10 github.com/intel/ivsc-driver) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Ye Xiang [Wed, 10 Nov 2021 02:23:17 +0000 (10:23 +0800)]
UBUNTU: SAUCE: mei-vsc: switch wait event to uninterruptible
BugLink: https://bugs.launchpad.net/bugs/1955383
Change wakeup ack wait queue to uninterruptible to avoid
unexpected signal interrupt normal hardware transaction.
Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit c130eb32d87f76974dd2a47d320a6e7ee26cc880 github.com/intel/ivsc-driver) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Ye Xiang <xiang.ye@intel.com>
(cherry picked from commit 1ec53c517383e7537e66e80049788578c2c1ccba github.com/intel/ivsc-driver) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
(cherry picked from commit 539c6057e0af4d0ab3f5721863ad5da99bfc0205 github.com/intel/ivsc-driver) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
(cherry picked from commit 06dec7c7fe2becaeaaab68e9bc386bf93fe80fa9 github.com/intel/ivsc-driver) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
You-Sheng Yang [Tue, 2 Nov 2021 10:13:40 +0000 (18:13 +0800)]
UBUNTU: [Config] ivsc: enable Intel VSC drivers
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Ignacio Hernandez <ignacio.hernandez@gmail.com>
(cherry picked from commit 8659a022b39a23409c18341c3877689c0ce2ecb3 github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
You-Sheng Yang [Tue, 2 Nov 2021 09:27:20 +0000 (17:27 +0800)]
UBUNTU: [Config] IPU6: enable OV01A10 sensor
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Hao Yao <hao.yao@intel.com>
(backported from commit 1f26f0c8cb13d14c22d9f7010b1b4774b89136a9 github.com/intel/ipu6-drivers
added CONFIG_VIDEO_OV01A10 to drivers/media/i2c/Kconfig) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 19 Aug 2021 15:37:18 +0000 (23:37 +0800)]
UBUNTU: SAUCE: Fix build error on Kernel 5.13
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit 65dae1929b4e63fb9e52b7dc79dabb78af21f289 github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 19 Aug 2021 15:37:17 +0000 (23:37 +0800)]
UBUNTU: SAUCE: sensor HM11b1 brightness bugfix
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit eca28d1aa048216dc034b134e65e1b47602ee4a6 github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 29 Jul 2021 06:48:32 +0000 (14:48 +0800)]
UBUNTU: SAUCE: IPU6 driver release for kernel 5.13
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit d6b6959e1ba207eb1ae16ad296818ceae12879c4 github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 29 Jul 2021 06:48:31 +0000 (14:48 +0800)]
UBUNTU: SAUCE: change power control driver to acpi driver
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit 7d9bc3bff21401cf08a99eb37eaead0e86464c8a github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 29 Jul 2021 06:48:30 +0000 (14:48 +0800)]
UBUNTU: SAUCE: intel/ipu6: Remove unnecessary video devices
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(backported from commit 362375c928d184fb0b4187df7da1ffd506bbd07f github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 29 Jul 2021 06:48:29 +0000 (14:48 +0800)]
UBUNTU: SAUCE: Fix ov01a1s IQ issues
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit f06a7aba2573b9ff53e7b186325c4e890066ee5d github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
You-Sheng Yang [Thu, 29 Jul 2021 06:48:28 +0000 (14:48 +0800)]
UBUNTU: [Config] updateconfigs for IPU6 driver
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 29 Jul 2021 06:48:27 +0000 (14:48 +0800)]
UBUNTU: SAUCE: integrate IPU6 builds
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 29 Jul 2021 06:48:26 +0000 (14:48 +0800)]
UBUNTU: SAUCE: Fix ov01a1s output mirror issue
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit 3fd5c5eed1088e127e21f4391f34ce839048cc17 github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 29 Jul 2021 06:48:25 +0000 (14:48 +0800)]
UBUNTU: SAUCE: IPU driver release WW14
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(backported from commit 59cd6e387868e95822a438b7c35cc9eb963f0a9a github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 29 Jul 2021 06:48:24 +0000 (14:48 +0800)]
UBUNTU: SAUCE: IPU driver release WW04
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(backported from commit 626e9311e21f3f36f41f756f22f43d589d9de781 github.com/intel/ipu6-drivers
still build ipu3) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 29 Jul 2021 06:48:23 +0000 (14:48 +0800)]
UBUNTU: SAUCE: IPU driver release WW52
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(backported from commit 71392b666a028c77126a9098fedb1fb30fc30568 github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 29 Jul 2021 06:48:22 +0000 (14:48 +0800)]
UBUNTU: SAUCE: IPU driver release WW48 with MCU
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(cherry picked from commit d127576fe1f1ea9a138618d88ce694b7ddb650f8 github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 29 Jul 2021 06:48:21 +0000 (14:48 +0800)]
UBUNTU: SAUCE: IPU driver release WW48
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(backported from commit 5e7f876527d932189e6e7d30f0dba5651068f0df github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Wang Yating [Thu, 29 Jul 2021 06:48:20 +0000 (14:48 +0800)]
UBUNTU: SAUCE: intel ipu drivers first release
BugLink: https://bugs.launchpad.net/bugs/1955383 Signed-off-by: Wang Yating <yating.wang@intel.com>
(backported from commit ade34d8d514046f0d24879c95bfb5aa622b16073 github.com/intel/ipu6-drivers) Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Hui Wang [Fri, 18 Mar 2022 04:22:31 +0000 (12:22 +0800)]
UBUNTU: [Config] Add cirruslogic side codec support
BugLink: https://bugs.launchpad.net/bugs/1965496 Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Lucas Tanure [Fri, 21 Jan 2022 17:24:31 +0000 (17:24 +0000)]
ACPI / scan: Create platform device for CS35L41
BugLink: https://bugs.launchpad.net/bugs/1965496
The ACPI device with CSC3551 or CLSA0100 are sound cards
with multiple instances of CS35L41 connected by I2C or SPI
to the main CPU.
We add an ID to the ignore_serial_bus_ids list to enumerate
all I2C or SPI devices correctly.
The same IDs are also added into serial-multi-instantiate
so that the driver can correctly enumerate the ACPI.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220121172431.6876-10-sbinding@opensource.cirrus.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit d9c01c530cc5e3b6d5bdfeae12c3d0f33fae7498) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20220121172431.6876-9-sbinding@opensource.cirrus.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(backported from commit 07bcab93946cd9980f8eafe89afe991cd918acb0) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Some peripherals can have either a I2C or a SPI connection
to the host (but not both) but use the same HID for both
types. So it is not possible to use the HID to determine
whether it is I2C or SPI. The driver must check the node
to see if it contains I2cSerialBus or SpiSerialBus entries.
For backwards-compatibility with the existing nodes I2C is
checked first and if such entries are found ONLY I2C devices
are created. Since some existing nodes that were already
handled by this driver could also contain unrelated
SpiSerialBus nodes that were previously ignored, and this
preserves that behavior. If there is ever a need to handle
a node where both I2C and SPI devices must be instantiated
this can be added in future.
BugLink: https://bugs.launchpad.net/bugs/1965496
Reorganize I2C functions to accommodate SPI support
Split the probe and factor out parts of the code
that will be used in the SPI support
Also switched from strlcpy() to strscpy()
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220121172431.6876-7-sbinding@opensource.cirrus.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 35a36cbb7b1ce7596fc03962f7ce261b2e908d1f) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220121172431.6876-6-sbinding@opensource.cirrus.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 5e63b2ea3dfbab9307e197004a3c5ee4e1442582) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Stefan Binding [Fri, 21 Jan 2022 17:24:26 +0000 (17:24 +0000)]
spi: Add API to count spi acpi resources
BugLink: https://bugs.launchpad.net/bugs/1965496
Some ACPI nodes may have more than one Spi Resource.
To be able to handle these case, its necessary to have
a way of counting these resources.
Stefan Binding [Fri, 21 Jan 2022 17:24:25 +0000 (17:24 +0000)]
spi: Support selection of the index of the ACPI Spi Resource before alloc
BugLink: https://bugs.launchpad.net/bugs/1965496
If a node contains more than one SPI resource it may be necessary to
use an index to select which one you want to allocate a spi device for.
The above commit was added to prevent the tipd driver from loading
in devices which have INT3515 ACPI nodes since high CPU load was
reported in these devices due to interrupt flood. Now that the issue
of interrupt flood in the tipd driver is fixed, re-enable the creation
of platform device for INT3515 ACPI nodes.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Saranya Gopal <saranya.gopal@intel.com> Link: https://lore.kernel.org/r/20211020022620.21012-3-saranya.gopal@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6e4d56db30a5feb83ba233a68841ba79483e7731) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
ALSA: hda/realtek: fix speakers and micmute on HP 855 G8
BugLink: https://bugs.launchpad.net/bugs/1965496
There are several PCI ids associated with HP EliteBook 855 G8 Notebook
PC. Commit 0e68c4b11f1e6 ("ALSA: hda/realtek: fix mute/micmute LEDs for
HP 855 G8") covers 0x103c:0x8896, while this commit covers 0x103c:0x8895
which needs some additional work on top of the quirk from 0e68c4b11f1e6.
Note that the device can boot up with working speakers and micmute LED
without this patch, but the success rate would be quite low (order of
16 working boots across 709 boots) at least for the built-in drivers
scenario. This also means that there are some timing issues during early
boot and this patch is a workaround.
With this patch applied speakers and headphones are consistenly working,
as well as mute/micmute LEDs and the internal microphone.
ALSA: hda: cs35l41: Make cs35l41_hda_remove() return void
BugLink: https://bugs.launchpad.net/bugs/1965496
Up to now cs35l41_hda_remove() returns zero unconditionally. Make it
return void instead which makes it easier to see in the callers that
there is no error to handle.
Also the return value of i2c and spi remove callbacks is ignored anyway.
Lucas Tanure [Mon, 17 Jan 2022 16:08:29 +0000 (16:08 +0000)]
ALSA: hda: cs35l41: Make use of the helper function dev_err_probe()
BugLink: https://bugs.launchpad.net/bugs/1965496
When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
Using dev_err_probe() can reduce code size, and the error value
gets printed.
Fixes: f517ba4924ad ("ASoC: cs35l41: Add support for hibernate memory retention mode") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220117160830.709403-2-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 6e4320d8ecbc8711209b3075f2d896667006fa37) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
BugLink: https://bugs.launchpad.net/bugs/1965496
regmap_register_patch can't be used to apply the probe sequence as a
patch is already registers with the regmap by
cs35l41_register_errata_patch and only a single patch can be attached to
a single regmap. The driver doesn't currently rely on a cache sync to
re-apply this probe sequence so simply switch it to a multi write.
Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220117160830.709403-1-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 2cb52046d186863e16ac82850c0e225462e493f1) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20220111072232.GG11243@kili Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 10b1a5a99c6ac42be7a490676aec626fba28b048) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Charles Keepax [Fri, 7 Jan 2022 16:06:36 +0000 (16:06 +0000)]
ASoC: cs35l41: Add support for hibernate memory retention mode
BugLink: https://bugs.launchpad.net/bugs/1965496
The cs35l41 supports a low power DSP memory retention mode. Add support
for entering this mode when then device is not in use.
Co-authored-by: David Rhodes <david.rhodes@cirrus.com> Signed-off-by: David Rhodes <david.rhodes@cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220107160636.6555-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
(backported from commit f517ba4924ad026f2583553db02f3c8bc69de88b) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Charles Keepax [Fri, 7 Jan 2022 16:06:35 +0000 (16:06 +0000)]
ASoC: cs35l41: Update handling of test key registers
BugLink: https://bugs.launchpad.net/bugs/1965496
In preparation for the addition of PM runtime support move the test
key out of the register patches themselves. This is necessary to
allow the test key to be held during cache synchronisation, which is
required by the OTP settings which were unpacked from the device and
written by the driver.
Also whilst at it, the driver uses a mixture of accessing the test key
register by name and by address, consistently use the name.
Charles Keepax [Wed, 5 Jan 2022 11:30:22 +0000 (11:30 +0000)]
ASoC: cs35l41: Correct handling of some registers in the cache
BugLink: https://bugs.launchpad.net/bugs/1965496
It makes no sense to cache the test/user key registers, since they
require values written at specific times, mark them volatile. It is
probably best if they can't be accessed from user-space either, so
mark them precious as well.
The interrupt force, edge, polarity and debounce are all settings
applied to the IRQ rather than status bits and as such should not be
volatile.
The OTP trim values will require re-application in the event of a
cache sync and as such should not be volatile. The OTPID however
should be volatile.
The DSP scratch registers are used to read back an error/debug code
from the DSP on shutdown, as such these should be marked volatile.
Finally, add some missing defaults, add TST_FS_MON0, and allow the
DSP core control register to be cached.
Charles Keepax [Wed, 5 Jan 2022 11:30:21 +0000 (11:30 +0000)]
ASoC: cs35l41: Correct DSP power down
BugLink: https://bugs.launchpad.net/bugs/1965496
The wm_adsp_event should be called before the early_event on power
down, event stops the core running and early_event then powers down
the core. Additionally, the core should only be stopped if it was
actually running in the first place.
Charles Keepax [Wed, 5 Jan 2022 11:30:20 +0000 (11:30 +0000)]
ASoC: cs35l41: Remove incorrect comment
BugLink: https://bugs.launchpad.net/bugs/1965496
The IRQ is not used for the PDN_DONE bit, this is polled during the DAPM
sequence, remove the misleading comment.
Lucas Tanure [Fri, 17 Dec 2021 11:57:02 +0000 (11:57 +0000)]
ASoC: cs35l41: Create shared function for errata patches
BugLink: https://bugs.launchpad.net/bugs/1965496
ASoC and HDA systems require the same errata patches, so
move it to the shared code using a function the correctly
applies the patches by revision
Also, move CS35L41_DSP1_CCM_CORE_CTRL write to errata
patch function as is required to be written at boot,
but not in regmap_register_patch sequence as will affect
waking up from hibernation
Lucas Tanure [Fri, 17 Dec 2021 11:57:01 +0000 (11:57 +0000)]
ASoC: cs35l41: Move power initializations to reg_sequence
BugLink: https://bugs.launchpad.net/bugs/1965496
ASoC and HDA systems for all revisions of CS35L41 will benefit
from having this initialization, so add it to reg_sequence of
each revision
By moving to reg_sequence all gains are set to zero. And boost,
monitoring parts, and class D amplifier are disabled.
Lucas Tanure [Fri, 17 Dec 2021 11:56:59 +0000 (11:56 +0000)]
ASoC: cs35l41: Convert tables to shared source code
BugLink: https://bugs.launchpad.net/bugs/1965496
To support CS35L41 in HDA systems the HDA driver
for CS35L41 would have to duplicate some functions
that already exist on ASoC driver
So instead of duplicate the code, use the new lib
source as a shared resource for both ASoC and HDA
Also, change the way CONFIG_SND_SOC_CS35L41 is
selected, as reported by Intel Kernel test robot,
it is possible to build SND_SOC_CS35L41_SPI/I2C
without the main driver, which would lead to build
failures.
Fixes: a5e0091d62ab ("ASoC: cs35l41: Fix link problem") Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/20211201180004.1402156-2-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 0695ad92fe1a0bb7697eb92c6a145a73c5ab0e24) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Lucas Tanure [Thu, 25 Nov 2021 14:35:01 +0000 (14:35 +0000)]
ASoC: cs35l41: Fix link problem
BugLink: https://bugs.launchpad.net/bugs/1965496
Can't link I2C and SPI to the same binary, better
to move CS35L41 to 3 modules approach.
And instead of exposing cs35l41_reg, volatile_reg,
readable_reg and precious_reg arrays, move
cs35l41_regmap_i2c/spi to new module and expose it.
Lucas Tanure [Tue, 23 Nov 2021 16:31:39 +0000 (16:31 +0000)]
ASoC: cs35l41: Set the max SPI speed for the whole device
BugLink: https://bugs.launchpad.net/bugs/1965496
Higher speeds are only supported when PLL is enabled, but
the current driver doesn't enable PLL outside of stream
use cases, so better to set the lowest SPI speed accepted
by the entire device.
Move the current frequency set to the spi sub-driver so
the whole device can benefit from that speed.
spi-max-frequency property could be used, but ACPI systems don't
support it, so by setting it in the spi sub-driver probe
both Device Trees and ACPI systems are supported.
Charles Keepax [Fri, 29 Oct 2021 21:40:27 +0000 (16:40 -0500)]
ASoC: cs35l41: Change monitor widgets to siggens
BugLink: https://bugs.launchpad.net/bugs/1965496
Currently the internal monitor sources are input widgets, which means
if the card is set to fully routed these will not enable unless connected
to something in the machine driver. However, all these are internal
monitor signals so it makes no sense to connect them to something in the
machine driver. As such switch them to siggen widgets which will have
the same behaviour except not require external linkage on a fully routed
card.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: David Rhodes <drhodes@opensource.cirrus.com> Link: https://lore.kernel.org/r/20211029214028.401284-1-drhodes@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit a2697972b9369c41afea8a928c30ac5b7f28d292) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
BugLink: https://bugs.launchpad.net/bugs/1965496
Up to now cs35l41_remove() returns zero unconditionally. Make it
return void instead which makes it easier to see in the callers that
there is no error to handle.
Also the return value of i2c, platform and spi remove callbacks is
ignored anyway.
Fixes: c2f14cc2bcdd ("ASoC: cs35l41: Fix use of an uninitialised variable") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210916082346.12001-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit c6d1fa6c8f663bd49bfe7a20eccb0dc7e43db63a) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Andrea Righi <andrea.righi@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com>
Charles Keepax [Tue, 14 Sep 2021 14:13:48 +0000 (15:13 +0100)]
ASoC: cs35l41: Fixup the error messages
BugLink: https://bugs.launchpad.net/bugs/1965496
It is not idiomatic for ASoC to print the function name in the error
messages, however it is expected to show the return code. Update the
error messages to follow these conventions.
Charles Keepax [Tue, 14 Sep 2021 14:13:47 +0000 (15:13 +0100)]
ASoC: cs35l41: Don't overwrite returned error code
BugLink: https://bugs.launchpad.net/bugs/1965496
In multiple places the driver overwrites the error code returned with
a static error code, this is not helpful for debugging. Update to pass
the error codes straight through.
Charles Keepax [Tue, 14 Sep 2021 14:13:46 +0000 (15:13 +0100)]
ASoC: cs35l41: Combine adjacent register writes
BugLink: https://bugs.launchpad.net/bugs/1965496
cs35l41 is often connected over I2C which is a very slow bus, as such
timings can be greatly improved combining writes where acceptable.
Update several points where the driver does multiple register writes
when a single one would suffice.
Charles Keepax [Tue, 14 Sep 2021 14:13:44 +0000 (15:13 +0100)]
ASoC: cs35l41: Fix use of an uninitialised variable
BugLink: https://bugs.launchpad.net/bugs/1965496
The loop checking PDN_DONE doesn't check the return value from
regmap_read, nor does it initialise val. This means if regmap_read fails
val will be checked for the PDN_DONE bit whilst being uninitialised.
Fix this up by switching to regmap_read_poll_timeout which tidies up the
code and avoids the uninitialised variable.
Po-Hsu Lin [Fri, 8 Apr 2022 07:41:44 +0000 (15:41 +0800)]
UBUNTU: [Debian] Use kernel-testing repo from launchpad
BugLink: https://bugs.launchpad.net/bugs/1968016
Reflect the change with kernel-testing repo moved from kernel.ubuntu.com
to launchpad, where we host all of our testing tools.
Use shallow clone to save some bandwidth / time.
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com> Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com> Acked-by: Francis Ginther <francis.ginther@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
v2: Used drm_dbg_kms for logs. (Jani)
Added names for different voltage levels. (Imre)
v3: Used const char * for names. (Jani)
v4: Dropped the procom values and changed commit msg (Imre)
Suggested-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220323094307.2439004-1-ankit.k.nautiyal@intel.com
(cherry picked from commit 3fd6afb623ba0f908af4f81794ccdff4dd5e671e
drmtip) Signed-off-by: Koba Ko <koba.ko@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Tim Gardner <tim.gardner@canonical.com>
drm/i915/display: Remove check for low voltage sku for max dp source rate
BugLink: https://bugs.launchpad.net/bugs/1967986
The low voltage sku check can be ignored as OEMs need to consider that
when designing the board and then put any limits in VBT.
Same is now changed in Bspec pages.
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5272 Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220315080247.1161844-2-ankit.k.nautiyal@intel.com
(cherry picked from commit 73867c8709b569cdd7fda67f01dfe02c8d055521
drmtip) Signed-off-by: Koba Ko <koba.ko@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220328115614.15761-7-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 5e2baa04e4cd94c2465b248b7d861fcff8c22fae) Signed-off-by: Chris Chiu <chris.chiu@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220328115614.15761-6-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 5e74a144837997e6efc52c56d6686fb6c11c627e) Signed-off-by: Chris Chiu <chris.chiu@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Tim Gardner <tim.gardner@canonical.com>
The only difference between the variants, is the
the dual Mic variants use a stereo DMIC.
These variants do no use reduce volume (Full Scale Volume)
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220328115614.15761-5-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 6581a045d54c6a8fe335dd2f343fc7cd2ebfe9e7) Signed-off-by: Chris Chiu <chris.chiu@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Tim Gardner <tim.gardner@canonical.com>
Stefan Binding [Wed, 6 Apr 2022 06:13:49 +0000 (14:13 +0800)]
ALSA: hda/cs8409: Fix Full Scale Volume setting for all variants
BugLink: https://bugs.launchpad.net/bugs/1967988
All current variants (Bullseye/Warlock/Cyborg) should be using
reduced volume (-6dB) for better speaker protection.
Refactor to make more explicit the meaning and setting of
Full Scale Volume setting to avoid future confusion.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220328115614.15761-4-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 342b6b610ae2a351de904022271e740c4c2b452b) Signed-off-by: Chris Chiu <chris.chiu@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220328115614.15761-3-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit bdc159dfda0acec5ca3adde1a1b58e1e0ddc8311) Signed-off-by: Chris Chiu <chris.chiu@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Tim Gardner <tim.gardner@canonical.com>
Stefan Binding [Wed, 6 Apr 2022 06:13:47 +0000 (14:13 +0800)]
ALSA: hda/cs8409: Fix Warlock to use mono mic configuration
BugLink: https://bugs.launchpad.net/bugs/1967988
Warlock/Bullseye Laptops have a mono DMIC, Cyborg uses
a stereo DMIC, and the configuration should reflect this.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220328115614.15761-2-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 8a7724535bacbb94fd9441ec232a83d71006d2a9) Signed-off-by: Chris Chiu <chris.chiu@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com> Acked-by: Tim Gardner <tim.gardner@canonical.com>
Matthew Ruffell [Tue, 5 Apr 2022 07:14:09 +0000 (19:14 +1200)]
UBUNTU: [Config] CONFIG_SPEAKUP=m
BugLink: https://bugs.launchpad.net/bugs/1967702
The speakup screen reader which provides accessibility features for
blind system administrators requires the speakup kernel modules
to function.
To enable the speakup modules, CONFIG_ACCESSIBILITY must be set to
'y'. This is omitted on s390x.
CONFIG_SPEAKUP has been present in the Ubuntu kernel for an
extended period of time. Recently it keeps being disabled, notably
during the transition from drivers/staging/ to
drivers/accessibility/ between 5.8 and 5.11, and the recent patch
to re-enable on Hirsute and Impish's kernels not being applied to
ubuntu-unstable, which is why Jammy never picked it up. See the
old bug LP #1942459 for more.
Signed-off-by: Matthew Ruffell <matthew.ruffell@canonical.com> Acked-by: Tim Gardner <tim.gardner@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Tim Gardner [Thu, 31 Mar 2022 17:48:57 +0000 (11:48 -0600)]
UBUNTU: [Config] amd64 CONFIG_SERIAL_8250_MID=y
BugLink: https://bugs.launchpad.net/bugs/1967338 Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Libin Yang [Tue, 29 Mar 2022 04:22:10 +0000 (12:22 +0800)]
ASoC: Intel: soc-acpi: add entries in ADL match table
BugLink: https://bugs.launchpad.net/bugs/1966841
Support configuration with SoundWire RT1316 amplifiers on link0 and
link1, and RT711 on link2 for headphone/headset. This product does not
support local microphones.
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Libin Yang <libin.yang@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220301194903.60859-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit c4dcd7100c26881b1095d5b2651d61190fc5f247) Signed-off-by: Hui Wang <hui.wang@canonical.com> Acked-by: Tim Gardner <tim.gardner@canonical.com> Acked-by: Paolo Pisati <paolo.pisati@canonical.com> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
filter_irq_stacks() has little to do with the stackdepot implementation,
except that it is usually used by users (such as KASAN) of stackdepot to
reduce the stack trace.
However, filter_irq_stacks() itself is not useful without a stack trace
as obtained by stack_trace_save() and friends.
Therefore, move filter_irq_stacks() to kernel/stacktrace.c, so that new
users of filter_irq_stacks() do not have to start depending on
STACKDEPOT only for filter_irq_stacks().
Link: https://lkml.kernel.org/r/20210923104803.2620285-1-elver@google.com Signed-off-by: Marco Elver <elver@google.com> Acked-by: Dmitry Vyukov <dvyukov@google.com> Cc: Alexander Potapenko <glider@google.com> Cc: Jann Horn <jannh@google.com> Cc: Aleksandr Nogikh <nogikh@google.com> Cc: Taras Madan <tarasmadan@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c9ea4fb1f3f356d7a04ebe15ac867ba3192c6d4f) Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
mpe: On 64-bit Book3E vmalloc space starts at 0x8000000000000000.
Because of the way __pa() works we have:
__pa(0x8000000000000000) == 0, and therefore
virt_to_pfn(0x8000000000000000) == 0, and therefore
virt_addr_valid(0x8000000000000000) == true
Which is wrong, virt_addr_valid() should be false for vmalloc space.
In fact all vmalloc addresses that alias with a valid PFN will return
true from virt_addr_valid(). That can cause bugs with hardened usercopy
as described below by Kefeng Wang:
When running ethtool eth0 on 64-bit Book3E, a BUG occurred:
usercopy: Kernel memory exposure attempt detected from SLUB object not in SLUB page?! (offset 0, size 1048)!
kernel BUG at mm/usercopy.c:99
...
usercopy_abort+0x64/0xa0 (unreliable)
__check_heap_object+0x168/0x190
__check_object_size+0x1a0/0x200
dev_ethtool+0x2494/0x2b20
dev_ioctl+0x5d0/0x770
sock_do_ioctl+0xf0/0x1d0
sock_ioctl+0x3ec/0x5a0
__se_sys_ioctl+0xf0/0x160
system_call_exception+0xfc/0x1f0
system_call_common+0xf8/0x200
The code shows below,
data = vzalloc(array_size(gstrings.len, ETH_GSTRING_LEN));
copy_to_user(useraddr, data, gstrings.len * ETH_GSTRING_LEN))
The data is alloced by vmalloc(), virt_addr_valid(ptr) will return true
on 64-bit Book3E, which leads to the panic.
As commit 4dd7554a6456 ("powerpc/64: Add VIRTUAL_BUG_ON checks for __va
and __pa addresses") does, make sure the virt addr above PAGE_OFFSET in
the virt_addr_valid() for 64-bit, also add upper limit check to make
sure the virt is below high_memory.
Meanwhile, for 32-bit PAGE_OFFSET is the virtual address of the start
of lowmem, high_memory is the upper low virtual address, the check is
suitable for 32-bit, this will fix the issue mentioned in commit 602946ec2f90 ("powerpc: Set max_mapnr correctly") too.
On 32-bit there is a similar problem with high memory, that was fixed in
commit 602946ec2f90 ("powerpc: Set max_mapnr correctly"), but that
commit breaks highmem and needs to be reverted.
We can't easily fix __pa(), we have code that relies on its current
behaviour. So for now add extra checks to virt_addr_valid().
For 64-bit Book3S the extra checks are not necessary, the combination of
virt_to_pfn() and pfn_valid() should yield the correct result, but they
are harmless.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
[mpe: Add additional change log detail] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220406145802.538416-1-mpe@ellerman.id.au Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit fddb88bd266f4513abab7c36bca98935c9148a98) Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
In the !CONFIG_SPARSEMEM_EXTREME case, mem_section is a static
2-dimensional array and so the check "!mem_section[SECTION_NR_TO_ROOT(nr)]"
doesn't make sense.
Fix this warning by moving the "!mem_section[SECTION_NR_TO_ROOT(nr)]"
check up inside the CONFIG_SPARSEMEM_EXTREME block and adding an
explicit NR_SECTION_ROOTS check to make sure that there is no
out-of-bound array access.
Link: https://lkml.kernel.org/r/20220331180246.2746210-1-longman@redhat.com Fixes: 3e347261a80b ("sparsemem extreme implementation") Signed-off-by: Waiman Long <longman@redhat.com> Reported-by: Justin Forbes <jforbes@redhat.com> Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Rafael Aquini <aquini@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 429f413ed83f6b9f81e8c4362bcc19e817a4d208) Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
At the moment the GIC IRQ domain translation routine happily converts
ACPI table GSI numbers below 16 to GIC SGIs (Software Generated
Interrupts aka IPIs). On the Devicetree side we explicitly forbid this
translation, actually the function will never return HWIRQs below 16 when
using a DT based domain translation.
We expect SGIs to be handled in the first part of the function, and any
further occurrence should be treated as a firmware bug, so add a check
and print to report this explicitly and avoid lengthy debug sessions.
Using conditional branches between two files is hasardous,
they may get linked too far from each other.
arch/powerpc/kvm/book3s_64_entry.o:(.text+0x3ec): relocation truncated
to fit: R_PPC64_REL14 (stub) against symbol `system_reset_common'
defined in .text section in arch/powerpc/kernel/head_64.o
Reorganise the code to use non conditional branches.
The way KVM drives GICv4.{0,1} is as follows:
- vcpu_load() makes the VPE resident, instructing the RD to start
scanning for interrupts
- just before entering the guest, we check that the RD has finished
scanning and that we can start running the vcpu
- on preemption, we deschedule the VPE by making it invalid on
the RD
However, we are preemptible between the first two steps. If it so
happens *and* that the RD was still scanning, we nonetheless write
to the GICR_VPENDBASER register while Dirty is set, and bad things
happen (we're in UNPRED land).
This affects both the 4.0 and 4.1 implementations.
Make sure Dirty is cleared before performing the deschedule,
meaning that its_clear_vpend_valid() becomes a sort of full VPE
residency barrier.
Reported-by: Jingyi Wang <wangjingyi11@huawei.com> Tested-by: Nianyao Tang <tangnianyao@huawei.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Fixes: 57e3cebd022f ("KVM: arm64: Delay the polling of the GICR_VPENDBASER.Dirty bit") Link: https://lore.kernel.org/r/4aae10ba-b39a-5f84-754b-69c2eb0a2c03@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 7b5d60323f904c91ec7d28282196aa8c6406248b) Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Paolo reported that the instruction sequence that is used to replace:
call __static_call_return0
namely:
66 66 48 31 c0 data16 data16 xor %rax,%rax
decodes to something else on i386, namely:
66 66 48 data16 dec %ax
31 c0 xor %eax,%eax
Which is a nonsensical sequence that happens to have the same outcome.
*However* an important distinction is that it consists of 2
instructions which is a problem when the thing needs to be overwriten
with a regular call instruction again.
As such, replace the instruction with something that decodes the same
on both i386 and x86_64.
try_steal_cookie() looks at task_struct::cpus_mask to decide if the
task could be moved to `this' CPU. It ignores that the task might be in
a migration disabled section while not on the CPU. In this case the task
must not be moved otherwise per-CPU assumption are broken.
Use is_cpu_allowed(), as suggested by Peter Zijlstra, to decide if the a
task can be moved.
Fixes: d2dfa17bc7de6 ("sched: Trivial forced-newidle balancer") Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/YjNK9El+3fzGmswf@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ff6505766565616deb65a203e62d4ca63c6c277b) Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
The macro __WARN_FLAGS() uses a local variable named "f". This being a
common name, there is a risk of shadowing other variables.
For example, GCC would yield:
| In file included from ./include/linux/bug.h:5,
| from ./include/linux/cpumask.h:14,
| from ./arch/x86/include/asm/cpumask.h:5,
| from ./arch/x86/include/asm/msr.h:11,
| from ./arch/x86/include/asm/processor.h:22,
| from ./arch/x86/include/asm/timex.h:5,
| from ./include/linux/timex.h:65,
| from ./include/linux/time32.h:13,
| from ./include/linux/time.h:60,
| from ./include/linux/stat.h:19,
| from ./include/linux/module.h:13,
| from virt/lib/irqbypass.mod.c:1:
| ./include/linux/rcupdate.h: In function 'rcu_head_after_call_rcu':
| ./arch/x86/include/asm/bug.h:80:21: warning: declaration of 'f' shadows a parameter [-Wshadow]
| 80 | __auto_type f = BUGFLAG_WARNING|(flags); \
| | ^
| ./include/asm-generic/bug.h:106:17: note: in expansion of macro '__WARN_FLAGS'
| 106 | __WARN_FLAGS(BUGFLAG_ONCE | \
| | ^~~~~~~~~~~~
| ./include/linux/rcupdate.h:1007:9: note: in expansion of macro 'WARN_ON_ONCE'
| 1007 | WARN_ON_ONCE(func != (rcu_callback_t)~0L);
| | ^~~~~~~~~~~~
| In file included from ./include/linux/rbtree.h:24,
| from ./include/linux/mm_types.h:11,
| from ./include/linux/buildid.h:5,
| from ./include/linux/module.h:14,
| from virt/lib/irqbypass.mod.c:1:
| ./include/linux/rcupdate.h:1001:62: note: shadowed declaration is here
| 1001 | rcu_head_after_call_rcu(struct rcu_head *rhp, rcu_callback_t f)
| | ~~~~~~~~~~~~~~~^
For reference, sparse also warns about it, c.f. [1].
This patch renames the variable from f to __flags (with two underscore
prefixes as suggested in the Linux kernel coding style [2]) in order
to prevent collisions.
[2] Linux kernel coding style, section 12) Macros, Enums and RTL,
paragraph 5) namespace collisions when defining local variables in
macros resembling functions
https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl
Fixes: bfb1a7c91fb7 ("x86/bug: Merge annotate_reachable() into_BUG_FLAGS() asm") Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lkml.kernel.org/r/20220324023742.106546-1-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f399f38eda5779fe90f0620024197f74a45012c0) Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Following the recommendation in Documentation/memory-barriers.txt for
virtual machine guests.
Fixes: 8b6a877c060ed ("Drivers: hv: vmbus: Replace the per-CPU channel lists with a global array of channels") Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com> Link: https://lore.kernel.org/r/20220328154457.100872-1-parri.andrea@gmail.com Signed-off-by: Wei Liu <wei.liu@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 469eed08becdd16368277855d78095622db80513) Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>