Skip to content

Commit

Permalink
Merge 5.10.156 into android12-5.10-lts
Browse files Browse the repository at this point in the history
Changes in 5.10.156
	ASoC: wm5102: Revert "ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe"
	ASoC: wm5110: Revert "ASoC: wm5110: Fix PM disable depth imbalance in wm5110_probe"
	ASoC: wm8997: Revert "ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe"
	ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe
	ASoC: wm8962: Add an event handler for TEMP_HP and TEMP_SPK
	spi: intel: Fix the offset to get the 64K erase opcode
	ASoC: codecs: jz4725b: add missed Line In power control bit
	ASoC: codecs: jz4725b: fix reported volume for Master ctl
	ASoC: codecs: jz4725b: use right control for Capture Volume
	ASoC: codecs: jz4725b: fix capture selector naming
	selftests/futex: fix build for clang
	selftests/intel_pstate: fix build for ARCH=x86_64
	ASoC: rt1308-sdw: add the default value of some registers
	drm/amd/display: Remove wrong pipe control lock
	NFSv4: Retry LOCK on OLD_STATEID during delegation return
	i2c: tegra: Allocate DMA memory for DMA engine
	i2c: i801: add lis3lv02d's I2C address for Vostro 5568
	drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid
	btrfs: remove pointless and double ulist frees in error paths of qgroup tests
	Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm
	ASoC: codecs: jz4725b: Fix spelling mistake "Sourc" -> "Source", "Routee" -> "Route"
	ALSA: hda/realtek: fix speakers and micmute on HP 855 G8
	mtd: spi-nor: intel-spi: Disable write protection only if asked
	spi: intel: Use correct mask for flash and protected regions
	mmc: sdhci-esdhc-imx: use the correct host caps for MMC_CAP_8_BIT_DATA
	drm/amd/pm: support power source switch on Sienna Cichlid
	drm/amd/pm: Read BIF STRAP also for BACO check
	drm/amd/pm: disable BACO entry/exit completely on several sienna cichlid cards
	drm/amdgpu: disable BACO on special BEIGE_GOBY card
	spi: stm32: Print summary 'callbacks suppressed' message
	ASoC: core: Fix use-after-free in snd_soc_exit()
	ASoC: tas2770: Fix set_tdm_slot in case of single slot
	ASoC: tas2764: Fix set_tdm_slot in case of single slot
	serial: 8250: Remove serial_rs485 sanitization from em485
	serial: 8250: omap: Fix missing PM runtime calls for omap8250_set_mctrl()
	serial: 8250_omap: remove wait loop from Errata i202 workaround
	serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove()
	serial: 8250: omap: Flush PM QOS work on remove
	serial: imx: Add missing .thaw_noirq hook
	tty: n_gsm: fix sleep-in-atomic-context bug in gsm_control_send
	bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb()
	ASoC: soc-utils: Remove __exit for snd_soc_util_exit()
	sctp: remove the unnecessary sinfo_stream check in sctp_prsctp_prune_unsent
	sctp: clear out_curr if all frag chunks of current msg are pruned
	block: sed-opal: kmalloc the cmd/resp buffers
	arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro
	siox: fix possible memory leak in siox_device_add()
	parport_pc: Avoid FIFO port location truncation
	pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map
	drm/panel: simple: set bpc field for logic technologies displays
	drm/drv: Fix potential memory leak in drm_dev_init()
	drm: Fix potential null-ptr-deref in drm_vblank_destroy_worker()
	ARM: dts: imx7: Fix NAND controller size-cells
	arm64: dts: imx8mm: Fix NAND controller size-cells
	arm64: dts: imx8mn: Fix NAND controller size-cells
	ata: libata-transport: fix double ata_host_put() in ata_tport_add()
	ata: libata-transport: fix error handling in ata_tport_add()
	ata: libata-transport: fix error handling in ata_tlink_add()
	ata: libata-transport: fix error handling in ata_tdev_add()
	bpf: Initialize same number of free nodes for each pcpu_freelist
	net: bgmac: Drop free_netdev() from bgmac_enet_remove()
	mISDN: fix possible memory leak in mISDN_dsp_element_register()
	net: hinic: Fix error handling in hinic_module_init()
	net: liquidio: release resources when liquidio driver open failed
	mISDN: fix misuse of put_device() in mISDN_register_device()
	net: macvlan: Use built-in RCU list checking
	net: caif: fix double disconnect client in chnl_net_open()
	bnxt_en: Remove debugfs when pci_register_driver failed
	xen/pcpu: fix possible memory leak in register_pcpu()
	net: ionic: Fix error handling in ionic_init_module()
	net: ena: Fix error handling in ena_init()
	drbd: use after free in drbd_create_device()
	platform/x86/intel: pmc: Don't unconditionally attach Intel PMC when virtualized
	cifs: add check for returning value of SMB2_close_init
	net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open()
	net/x25: Fix skb leak in x25_lapb_receive_frame()
	cifs: Fix wrong return value checking when GETFLAGS
	net: thunderbolt: Fix error handling in tbnet_init()
	cifs: add check for returning value of SMB2_set_info_init
	ftrace: Fix the possible incorrect kernel message
	ftrace: Optimize the allocation for mcount entries
	ftrace: Fix null pointer dereference in ftrace_add_mod()
	ring_buffer: Do not deactivate non-existant pages
	tracing/ring-buffer: Have polling block on watermark
	tracing: Fix memory leak in test_gen_synth_cmd() and test_empty_synth_event()
	tracing: Fix wild-memory-access in register_synth_event()
	tracing: kprobe: Fix potential null-ptr-deref on trace_event_file in kprobe_event_gen_test_exit()
	tracing: kprobe: Fix potential null-ptr-deref on trace_array in kprobe_event_gen_test_exit()
	ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open()
	ALSA: hda/realtek: fix speakers for Samsung Galaxy Book Pro
	ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book Pro 360
	Revert "usb: dwc3: disable USB core PHY management"
	slimbus: stream: correct presence rate frequencies
	speakup: fix a segfault caused by switching consoles
	USB: bcma: Make GPIO explicitly optional
	USB: serial: option: add Sierra Wireless EM9191
	USB: serial: option: remove old LARA-R6 PID
	USB: serial: option: add u-blox LARA-R6 00B modem
	USB: serial: option: add u-blox LARA-L6 modem
	USB: serial: option: add Fibocom FM160 0x0111 composition
	usb: add NO_LPM quirk for Realforce 87U Keyboard
	usb: chipidea: fix deadlock in ci_otg_del_timer
	usb: typec: mux: Enter safe mode only when pins need to be reconfigured
	iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger()
	iio: trigger: sysfs: fix possible memory leak in iio_sysfs_trig_init()
	iio: adc: mp2629: fix wrong comparison of channel
	iio: adc: mp2629: fix potential array out of bound access
	iio: pressure: ms5611: changed hardcoded SPI speed to value limited
	dm ioctl: fix misbehavior if list_versions races with module loading
	serial: 8250: Fall back to non-DMA Rx if IIR_RDI occurs
	serial: 8250: Flush DMA Rx on RLSI
	serial: 8250_lpss: Configure DMA also w/o DMA filter
	Input: iforce - invert valid length check when fetching device IDs
	maccess: Fix writing offset in case of fault in strncpy_from_kernel_nofault()
	scsi: zfcp: Fix double free of FSF request when qdio send fails
	iommu/vt-d: Set SRE bit only when hardware has SRS cap
	firmware: coreboot: Register bus in module init
	mmc: core: properly select voltage range without power cycle
	mmc: sdhci-pci-o2micro: fix card detect fail issue caused by CD# debounce timeout
	mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put()
	docs: update mediator contact information in CoC doc
	misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram()
	perf/x86/intel/pt: Fix sampling using single range output
	nvme: restrict management ioctls to admin
	nvme: ensure subsystem reset is single threaded
	net: fix a concurrency bug in l2tp_tunnel_register()
	ring-buffer: Include dropped pages in counting dirty patches
	usbnet: smsc95xx: Fix deadlock on runtime resume
	stddef: Introduce struct_group() helper macro
	net: use struct_group to copy ip/ipv6 header addresses
	scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus()
	scsi: scsi_debug: Fix possible UAF in sdebug_add_host_helper()
	kprobes: Skip clearing aggrprobe's post_handler in kprobe-on-ftrace case
	Input: i8042 - fix leaking of platform device on module removal
	uapi/linux/stddef.h: Add include guards
	macvlan: enforce a consistent minimal mtu
	tcp: cdg: allow tcp_cdg_release() to be called multiple times
	kcm: avoid potential race in kcm_tx_work
	kcm: close race conditions on sk_receive_queue
	9p: trans_fd/p9_conn_cancel: drop client lock earlier
	gfs2: Check sb_bsize_shift after reading superblock
	gfs2: Switch from strlcpy to strscpy
	9p/trans_fd: always use O_NONBLOCK read/write
	mm: fs: initialize fsdata passed to write_begin/write_end interface
	ntfs: fix use-after-free in ntfs_attr_find()
	ntfs: fix out-of-bounds read in ntfs_attr_find()
	ntfs: check overflow when iterating ATTR_RECORDs
	Revert "net: broadcom: Fix BCMGENET Kconfig"
	Linux 5.10.156

Change-Id: Ic9fe339913a510cc9fb9c4557b3bd6e196db834f
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Dec 2, 2022
2 parents 25af5a1 + 6d46ef5 commit d9b90a9
Show file tree
Hide file tree
Showing 126 changed files with 994 additions and 467 deletions.
2 changes: 1 addition & 1 deletion Documentation/process/code-of-conduct-interpretation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ the Technical Advisory Board (TAB) or other maintainers if you're
uncertain how to handle situations that come up. It will not be
considered a violation report unless you want it to be. If you are
uncertain about approaching the TAB or any other maintainers, please
reach out to our conflict mediator, Joanna Lee <[email protected]>.
reach out to our conflict mediator, Joanna Lee <[email protected]>.

In the end, "be kind to each other" is really what the end goal is for
everybody. We know everyone is human and we all fail at times, but the
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 10
SUBLEVEL = 155
SUBLEVEL = 156
EXTRAVERSION =
NAME = Dare mighty things

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/imx7s.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -1221,10 +1221,10 @@
clocks = <&clks IMX7D_NAND_USDHC_BUS_RAWNAND_CLK>;
};

gpmi: nand-controller@33002000{
gpmi: nand-controller@33002000 {
compatible = "fsl,imx7d-gpmi-nand";
#address-cells = <1>;
#size-cells = <1>;
#size-cells = <0>;
reg = <0x33002000 0x2000>, <0x33004000 0x4000>;
reg-names = "gpmi-nand", "bch";
interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/boot/dts/freescale/imx8mm.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -939,10 +939,10 @@
clocks = <&clk IMX8MM_CLK_NAND_USDHC_BUS_RAWNAND_CLK>;
};

gpmi: nand-controller@33002000{
gpmi: nand-controller@33002000 {
compatible = "fsl,imx8mm-gpmi-nand", "fsl,imx7d-gpmi-nand";
#address-cells = <1>;
#size-cells = <1>;
#size-cells = <0>;
reg = <0x33002000 0x2000>, <0x33004000 0x4000>;
reg-names = "gpmi-nand", "bch";
interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/freescale/imx8mn.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@
gpmi: nand-controller@33002000 {
compatible = "fsl,imx8mn-gpmi-nand", "fsl,imx7d-gpmi-nand";
#address-cells = <1>;
#size-cells = <1>;
#size-cells = <0>;
reg = <0x33002000 0x2000>, <0x33004000 0x4000>;
reg-names = "gpmi-nand", "bch";
interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/include/asm/cputype.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
(((midr) & MIDR_IMPLEMENTOR_MASK) >> MIDR_IMPLEMENTOR_SHIFT)

#define MIDR_CPU_MODEL(imp, partnum) \
(((imp) << MIDR_IMPLEMENTOR_SHIFT) | \
((_AT(u32, imp) << MIDR_IMPLEMENTOR_SHIFT) | \
(0xf << MIDR_ARCHITECTURE_SHIFT) | \
((partnum) << MIDR_PARTNUM_SHIFT))

Expand Down
9 changes: 9 additions & 0 deletions arch/x86/events/intel/pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,15 @@ static int pt_buffer_try_single(struct pt_buffer *buf, int nr_pages)
if (1 << order != nr_pages)
goto out;

/*
* Some processors cannot always support single range for more than
* 4KB - refer errata TGL052, ADL037 and RPL017. Future processors might
* also be affected, so for now rather than trying to keep track of
* which ones, just disable it for all.
*/
if (nr_pages > 1)
goto out;

buf->single = true;
buf->nr_pages = nr_pages;
ret = 0;
Expand Down
32 changes: 28 additions & 4 deletions block/sed-opal.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ struct opal_dev {
u64 lowest_lba;

size_t pos;
u8 cmd[IO_BUFFER_LENGTH];
u8 resp[IO_BUFFER_LENGTH];
u8 *cmd;
u8 *resp;

struct parsed_resp parsed;
size_t prev_d_len;
Expand Down Expand Up @@ -2134,6 +2134,8 @@ void free_opal_dev(struct opal_dev *dev)
return;

clean_opal_dev(dev);
kfree(dev->resp);
kfree(dev->cmd);
kfree(dev);
}
EXPORT_SYMBOL(free_opal_dev);
Expand All @@ -2146,17 +2148,39 @@ struct opal_dev *init_opal_dev(void *data, sec_send_recv *send_recv)
if (!dev)
return NULL;

/*
* Presumably DMA-able buffers must be cache-aligned. Kmalloc makes
* sure the allocated buffer is DMA-safe in that regard.
*/
dev->cmd = kmalloc(IO_BUFFER_LENGTH, GFP_KERNEL);
if (!dev->cmd)
goto err_free_dev;

dev->resp = kmalloc(IO_BUFFER_LENGTH, GFP_KERNEL);
if (!dev->resp)
goto err_free_cmd;

INIT_LIST_HEAD(&dev->unlk_lst);
mutex_init(&dev->dev_lock);
dev->data = data;
dev->send_recv = send_recv;
if (check_opal_support(dev) != 0) {
pr_debug("Opal is not supported on this device\n");
kfree(dev);
return NULL;
goto err_free_resp;
}

return dev;

err_free_resp:
kfree(dev->resp);

err_free_cmd:
kfree(dev->cmd);

err_free_dev:
kfree(dev);

return NULL;
}
EXPORT_SYMBOL(init_opal_dev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/accessibility/speakup/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,7 @@ static void speakup_con_update(struct vc_data *vc)
{
unsigned long flags;

if (!speakup_console[vc->vc_num] || spk_parked)
if (!speakup_console[vc->vc_num] || spk_parked || !synth)
return;
if (!spin_trylock_irqsave(&speakup_info.spinlock, flags))
/* Speakup output, discard */
Expand Down
19 changes: 15 additions & 4 deletions drivers/ata/libata-transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ int ata_tport_add(struct device *parent,
pm_runtime_enable(dev);
pm_runtime_forbid(dev);

transport_add_device(dev);
error = transport_add_device(dev);
if (error)
goto tport_transport_add_err;
transport_configure_device(dev);

error = ata_tlink_add(&ap->link);
Expand All @@ -312,12 +314,12 @@ int ata_tport_add(struct device *parent,

tport_link_err:
transport_remove_device(dev);
tport_transport_add_err:
device_del(dev);

tport_err:
transport_destroy_device(dev);
put_device(dev);
ata_host_put(ap->host);
return error;
}

Expand Down Expand Up @@ -426,7 +428,9 @@ int ata_tlink_add(struct ata_link *link)
goto tlink_err;
}

transport_add_device(dev);
error = transport_add_device(dev);
if (error)
goto tlink_transport_err;
transport_configure_device(dev);

ata_for_each_dev(ata_dev, link, ALL) {
Expand All @@ -441,6 +445,7 @@ int ata_tlink_add(struct ata_link *link)
ata_tdev_delete(ata_dev);
}
transport_remove_device(dev);
tlink_transport_err:
device_del(dev);
tlink_err:
transport_destroy_device(dev);
Expand Down Expand Up @@ -678,7 +683,13 @@ static int ata_tdev_add(struct ata_device *ata_dev)
return error;
}

transport_add_device(dev);
error = transport_add_device(dev);
if (error) {
device_del(dev);
ata_tdev_free(ata_dev);
return error;
}

transport_configure_device(dev);
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2720,7 +2720,7 @@ static int init_submitter(struct drbd_device *device)
enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsigned int minor)
{
struct drbd_resource *resource = adm_ctx->resource;
struct drbd_connection *connection;
struct drbd_connection *connection, *n;
struct drbd_device *device;
struct drbd_peer_device *peer_device, *tmp_peer_device;
struct gendisk *disk;
Expand Down Expand Up @@ -2839,7 +2839,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig
out_idr_remove_vol:
idr_remove(&connection->peer_devices, vnr);
out_idr_remove_from_resource:
for_each_connection(connection, resource) {
for_each_connection_safe(connection, n, resource) {
peer_device = idr_remove(&connection->peer_devices, vnr);
if (peer_device)
kref_put(&connection->kref, drbd_destroy_connection);
Expand Down
37 changes: 29 additions & 8 deletions drivers/firmware/google/coreboot_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,8 @@ static int coreboot_table_probe(struct platform_device *pdev)
if (!ptr)
return -ENOMEM;

ret = bus_register(&coreboot_bus_type);
if (!ret) {
ret = coreboot_table_populate(dev, ptr);
if (ret)
bus_unregister(&coreboot_bus_type);
}
ret = coreboot_table_populate(dev, ptr);

memunmap(ptr);

return ret;
Expand All @@ -172,7 +168,6 @@ static int __cb_dev_unregister(struct device *dev, void *dummy)
static int coreboot_table_remove(struct platform_device *pdev)
{
bus_for_each_dev(&coreboot_bus_type, NULL, NULL, __cb_dev_unregister);
bus_unregister(&coreboot_bus_type);
return 0;
}

Expand Down Expand Up @@ -202,6 +197,32 @@ static struct platform_driver coreboot_table_driver = {
.of_match_table = of_match_ptr(coreboot_of_match),
},
};
module_platform_driver(coreboot_table_driver);

static int __init coreboot_table_driver_init(void)
{
int ret;

ret = bus_register(&coreboot_bus_type);
if (ret)
return ret;

ret = platform_driver_register(&coreboot_table_driver);
if (ret) {
bus_unregister(&coreboot_bus_type);
return ret;
}

return 0;
}

static void __exit coreboot_table_driver_exit(void)
{
platform_driver_unregister(&coreboot_table_driver);
bus_unregister(&coreboot_bus_type);
}

module_init(coreboot_table_driver_init);
module_exit(coreboot_table_driver_exit);

MODULE_AUTHOR("Google, Inc.");
MODULE_LICENSE("GPL");
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ void dcn20_post_unlock_program_front_end(

for (j = 0; j < TIMEOUT_FOR_PIPE_ENABLE_MS*1000
&& hubp->funcs->hubp_is_flip_pending(hubp); j++)
mdelay(1);
udelay(1);
}
}

Expand Down
25 changes: 19 additions & 6 deletions drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,16 +379,31 @@ static int arcturus_set_default_dpm_table(struct smu_context *smu)
return 0;
}

static int arcturus_check_powerplay_table(struct smu_context *smu)
static void arcturus_check_bxco_support(struct smu_context *smu)
{
struct smu_table_context *table_context = &smu->smu_table;
struct smu_11_0_powerplay_table *powerplay_table =
table_context->power_play_table;
struct smu_baco_context *smu_baco = &smu->smu_baco;
struct amdgpu_device *adev = smu->adev;
uint32_t val;

if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_BACO ||
powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_MACO)
smu_baco->platform_support = true;
powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_MACO) {
val = RREG32_SOC15(NBIO, 0, mmRCC_BIF_STRAP0);
smu_baco->platform_support =
(val & RCC_BIF_STRAP0__STRAP_PX_CAPABLE_MASK) ? true :
false;
}
}

static int arcturus_check_powerplay_table(struct smu_context *smu)
{
struct smu_table_context *table_context = &smu->smu_table;
struct smu_11_0_powerplay_table *powerplay_table =
table_context->power_play_table;

arcturus_check_bxco_support(smu);

table_context->thermal_controller_type =
powerplay_table->thermal_controller_type;
Expand Down Expand Up @@ -2131,13 +2146,11 @@ static void arcturus_get_unique_id(struct smu_context *smu)
static bool arcturus_is_baco_supported(struct smu_context *smu)
{
struct amdgpu_device *adev = smu->adev;
uint32_t val;

if (!smu_v11_0_baco_is_support(smu) || amdgpu_sriov_vf(adev))
return false;

val = RREG32_SOC15(NBIO, 0, mmRCC_BIF_STRAP0);
return (val & RCC_BIF_STRAP0__STRAP_PX_CAPABLE_MASK) ? true : false;
return true;
}

static int arcturus_set_df_cstate(struct smu_context *smu,
Expand Down
27 changes: 20 additions & 7 deletions drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,19 +338,34 @@ navi10_get_allowed_feature_mask(struct smu_context *smu,
return 0;
}

static int navi10_check_powerplay_table(struct smu_context *smu)
static void navi10_check_bxco_support(struct smu_context *smu)
{
struct smu_table_context *table_context = &smu->smu_table;
struct smu_11_0_powerplay_table *powerplay_table =
table_context->power_play_table;
struct smu_baco_context *smu_baco = &smu->smu_baco;
struct amdgpu_device *adev = smu->adev;
uint32_t val;

if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_BACO ||
powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_MACO) {
val = RREG32_SOC15(NBIO, 0, mmRCC_BIF_STRAP0);
smu_baco->platform_support =
(val & RCC_BIF_STRAP0__STRAP_PX_CAPABLE_MASK) ? true :
false;
}
}

static int navi10_check_powerplay_table(struct smu_context *smu)
{
struct smu_table_context *table_context = &smu->smu_table;
struct smu_11_0_powerplay_table *powerplay_table =
table_context->power_play_table;

if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_HARDWAREDC)
smu->dc_controlled_by_gpio = true;

if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_BACO ||
powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_MACO)
smu_baco->platform_support = true;
navi10_check_bxco_support(smu);

table_context->thermal_controller_type =
powerplay_table->thermal_controller_type;
Expand Down Expand Up @@ -1948,13 +1963,11 @@ static int navi10_overdrive_get_gfx_clk_base_voltage(struct smu_context *smu,
static bool navi10_is_baco_supported(struct smu_context *smu)
{
struct amdgpu_device *adev = smu->adev;
uint32_t val;

if (amdgpu_sriov_vf(adev) || (!smu_v11_0_baco_is_support(smu)))
return false;

val = RREG32_SOC15(NBIO, 0, mmRCC_BIF_STRAP0);
return (val & RCC_BIF_STRAP0__STRAP_PX_CAPABLE_MASK) ? true : false;
return true;
}

static int navi10_set_default_od_settings(struct smu_context *smu)
Expand Down
Loading

0 comments on commit d9b90a9

Please sign in to comment.