Merge 5.15.72 into android14-5.15

Changes in 5.15.72
	ALSA: hda: Do disconnect jacks at codec unbind
	ALSA: hda: Fix hang at HD-audio codec unbinding due to refcount saturation
	ALSA: hda: Fix Nvidia dp infoframe
	ALSA: hda/realtek: fix speakers and micmute on HP 855 G8
	cgroup: reduce dependency on cgroup_mutex
	cgroup: cgroup_get_from_id() must check the looked-up kn is a directory
	uas: add no-uas quirk for Hiksemi usb_disk
	usb-storage: Add Hiksemi USB3-FW to IGNORE_UAS
	uas: ignore UAS for Thinkplus chips
	usb: typec: ucsi: Remove incorrect warning
	thunderbolt: Explicitly reset plug events delay back to USB4 spec value
	net: usb: qmi_wwan: Add new usb-id for Dell branded EM7455
	Input: snvs_pwrkey - fix SNVS_HPVIDR1 register address
	can: c_can: don't cache TX messages for C_CAN cores
	clk: ingenic-tcu: Properly enable registers before accessing timers
	x86/sgx: Do not fail on incomplete sanitization on premature stop of ksgxd
	ARM: dts: integrator: Tag PCI host with device_type
	ntfs: fix BUG_ON in ntfs_lookup_inode_by_name()
	mm/damon/dbgfs: fix memory leak when using debugfs_lookup()
	net: mt7531: only do PLL once after the reset
	Revert "firmware: arm_scmi: Add clock management to the SCMI power domain"
	drm/i915/gt: Restrict forced preemption to the active context
	drm/amdgpu: Add amdgpu suspend-resume code path under SRIOV
	vduse: prevent uninitialized memory accesses
	libata: add ATA_HORKAGE_NOLPM for Pioneer BDR-207M and BDR-205
	mmc: moxart: fix 4-bit bus width and remove 8-bit bus width
	mmc: hsq: Fix data stomping during mmc recovery
	mm/page_alloc: fix race condition between build_all_zonelists and page allocation
	mm: prevent page_frag_alloc() from corrupting the memory
	mm: fix dereferencing possible ERR_PTR
	mm/migrate_device.c: flush TLB while holding PTL
	mm: fix madivse_pageout mishandling on non-LRU page
	mm,hwpoison: check mm when killing accessing process
	media: dvb_vb2: fix possible out of bound access
	media: rkvdec: Disable H.264 error detection
	media: v4l2-compat-ioctl32.c: zero buffer passed to v4l2_compat_get_array_args()
	swiotlb: max mapping size takes min align mask into account
	ARM: dts: am33xx: Fix MMCHS0 dma properties
	reset: imx7: Fix the iMX8MP PCIe PHY PERST support
	ARM: dts: am5748: keep usb4_tm disabled
	soc: sunxi: sram: Actually claim SRAM regions
	soc: sunxi: sram: Prevent the driver from being unbound
	soc: sunxi_sram: Make use of the helper function devm_platform_ioremap_resource()
	soc: sunxi: sram: Fix probe function ordering issues
	soc: sunxi: sram: Fix debugfs info for A64 SRAM C
	ASoC: imx-card: Fix refcount issue with of_node_put
	arm64: dts: qcom: sm8350: fix UFS PHY serdes size
	ASoC: tas2770: Reinit regcache on reset
	drm/bridge: lt8912b: add vsync hsync
	drm/bridge: lt8912b: set hdmi or dvi mode
	drm/bridge: lt8912b: fix corrupted image output
	Revert "drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time"
	Input: melfas_mip4 - fix return value check in mip4_probe()
	gpio: mvebu: Fix check for pwm support on non-A8K platforms
	usbnet: Fix memory leak in usbnet_disconnect()
	net: sched: act_ct: fix possible refcount leak in tcf_ct_init()
	cxgb4: fix missing unlock on ETHOFLD desc collect fail path
	net/mlxbf_gige: Fix an IS_ERR() vs NULL bug in mlxbf_gige_mdio_probe
	nvme: Fix IOC_PR_CLEAR and IOC_PR_RELEASE ioctls for nvme devices
	wifi: mac80211: fix regression with non-QoS drivers
	net: stmmac: power up/down serdes in stmmac_open/release
	net: phy: Don't WARN for PHY_UP state in mdio_bus_phy_resume()
	selftests: Fix the if conditions of in test_extra_filter()
	vdpa/ifcvf: fix the calculation of queuepair
	fs: split off setxattr_copy and do_setxattr function from setxattr
	clk: imx: imx6sx: remove the SET_RATE_PARENT flag for QSPI clocks
	clk: iproc: Do not rely on node name for correct PLL setup
	KVM: x86: Hide IA32_PLATFORM_DCA_CAP[31:0] from the guest
	x86/alternative: Fix race in try_get_desc()
	drm/i915/gem: Really move i915_gem_context.link under ref protection
	Linux 5.15.72

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ib8569de2af78d5080b026a46196aad5fc816fd42
This commit is contained in:
Greg Kroah-Hartman
2022-10-05 11:59:55 +02:00
66 changed files with 561 additions and 267 deletions

View File

@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
VERSION = 5 VERSION = 5
PATCHLEVEL = 15 PATCHLEVEL = 15
SUBLEVEL = 71 SUBLEVEL = 72
EXTRAVERSION = EXTRAVERSION =
NAME = Trick or Treat NAME = Trick or Treat

View File

@@ -1500,8 +1500,7 @@
mmc1: mmc@0 { mmc1: mmc@0 {
compatible = "ti,am335-sdhci"; compatible = "ti,am335-sdhci";
ti,needs-special-reset; ti,needs-special-reset;
dmas = <&edma_xbar 24 0 0 dmas = <&edma 24 0>, <&edma 25 0>;
&edma_xbar 25 0 0>;
dma-names = "tx", "rx"; dma-names = "tx", "rx";
interrupts = <64>; interrupts = <64>;
reg = <0x0 0x1000>; reg = <0x0 0x1000>;

View File

@@ -25,6 +25,10 @@
status = "disabled"; status = "disabled";
}; };
&usb4_tm {
status = "disabled";
};
&atl_tm { &atl_tm {
status = "disabled"; status = "disabled";
}; };

View File

@@ -153,6 +153,7 @@
pci: pciv3@62000000 { pci: pciv3@62000000 {
compatible = "arm,integrator-ap-pci", "v3,v360epc-pci"; compatible = "arm,integrator-ap-pci", "v3,v360epc-pci";
device_type = "pci";
#interrupt-cells = <1>; #interrupt-cells = <1>;
#size-cells = <2>; #size-cells = <2>;
#address-cells = <3>; #address-cells = <3>;

View File

@@ -1109,7 +1109,7 @@
ufs_mem_phy: phy@1d87000 { ufs_mem_phy: phy@1d87000 {
compatible = "qcom,sm8350-qmp-ufs-phy"; compatible = "qcom,sm8350-qmp-ufs-phy";
reg = <0 0x01d87000 0 0xe10>; reg = <0 0x01d87000 0 0x1c4>;
#address-cells = <2>; #address-cells = <2>;
#size-cells = <2>; #size-cells = <2>;
#clock-cells = <1>; #clock-cells = <1>;

View File

@@ -1200,22 +1200,23 @@ struct bp_patching_desc {
atomic_t refs; atomic_t refs;
}; };
static struct bp_patching_desc *bp_desc; static struct bp_patching_desc bp_desc;
static __always_inline static __always_inline
struct bp_patching_desc *try_get_desc(struct bp_patching_desc **descp) struct bp_patching_desc *try_get_desc(void)
{ {
/* rcu_dereference */ struct bp_patching_desc *desc = &bp_desc;
struct bp_patching_desc *desc = __READ_ONCE(*descp);
if (!desc || !arch_atomic_inc_not_zero(&desc->refs)) if (!arch_atomic_inc_not_zero(&desc->refs))
return NULL; return NULL;
return desc; return desc;
} }
static __always_inline void put_desc(struct bp_patching_desc *desc) static __always_inline void put_desc(void)
{ {
struct bp_patching_desc *desc = &bp_desc;
smp_mb__before_atomic(); smp_mb__before_atomic();
arch_atomic_dec(&desc->refs); arch_atomic_dec(&desc->refs);
} }
@@ -1248,15 +1249,15 @@ noinstr int poke_int3_handler(struct pt_regs *regs)
/* /*
* Having observed our INT3 instruction, we now must observe * Having observed our INT3 instruction, we now must observe
* bp_desc: * bp_desc with non-zero refcount:
* *
* bp_desc = desc INT3 * bp_desc.refs = 1 INT3
* WMB RMB * WMB RMB
* write INT3 if (desc) * write INT3 if (bp_desc.refs != 0)
*/ */
smp_rmb(); smp_rmb();
desc = try_get_desc(&bp_desc); desc = try_get_desc();
if (!desc) if (!desc)
return 0; return 0;
@@ -1310,7 +1311,7 @@ noinstr int poke_int3_handler(struct pt_regs *regs)
ret = 1; ret = 1;
out_put: out_put:
put_desc(desc); put_desc();
return ret; return ret;
} }
@@ -1341,18 +1342,20 @@ static int tp_vec_nr;
*/ */
static void text_poke_bp_batch(struct text_poke_loc *tp, unsigned int nr_entries) static void text_poke_bp_batch(struct text_poke_loc *tp, unsigned int nr_entries)
{ {
struct bp_patching_desc desc = {
.vec = tp,
.nr_entries = nr_entries,
.refs = ATOMIC_INIT(1),
};
unsigned char int3 = INT3_INSN_OPCODE; unsigned char int3 = INT3_INSN_OPCODE;
unsigned int i; unsigned int i;
int do_sync; int do_sync;
lockdep_assert_held(&text_mutex); lockdep_assert_held(&text_mutex);
smp_store_release(&bp_desc, &desc); /* rcu_assign_pointer */ bp_desc.vec = tp;
bp_desc.nr_entries = nr_entries;
/*
* Corresponds to the implicit memory barrier in try_get_desc() to
* ensure reading a non-zero refcount provides up to date bp_desc data.
*/
atomic_set_release(&bp_desc.refs, 1);
/* /*
* Corresponding read barrier in int3 notifier for making sure the * Corresponding read barrier in int3 notifier for making sure the
@@ -1440,12 +1443,10 @@ static void text_poke_bp_batch(struct text_poke_loc *tp, unsigned int nr_entries
text_poke_sync(); text_poke_sync();
/* /*
* Remove and synchronize_rcu(), except we have a very primitive * Remove and wait for refs to be zero.
* refcount based completion.
*/ */
WRITE_ONCE(bp_desc, NULL); /* RCU_INIT_POINTER */ if (!atomic_dec_and_test(&bp_desc.refs))
if (!atomic_dec_and_test(&desc.refs)) atomic_cond_read_acquire(&bp_desc.refs, !VAL);
atomic_cond_read_acquire(&desc.refs, !VAL);
} }
static void text_poke_loc_init(struct text_poke_loc *tp, void *addr, static void text_poke_loc_init(struct text_poke_loc *tp, void *addr,

View File

@@ -46,9 +46,13 @@ static LIST_HEAD(sgx_dirty_page_list);
* Reset post-kexec EPC pages to the uninitialized state. The pages are removed * Reset post-kexec EPC pages to the uninitialized state. The pages are removed
* from the input list, and made available for the page allocator. SECS pages * from the input list, and made available for the page allocator. SECS pages
* prepending their children in the input list are left intact. * prepending their children in the input list are left intact.
*
* Return 0 when sanitization was successful or kthread was stopped, and the
* number of unsanitized pages otherwise.
*/ */
static void __sgx_sanitize_pages(struct list_head *dirty_page_list) static unsigned long __sgx_sanitize_pages(struct list_head *dirty_page_list)
{ {
unsigned long left_dirty = 0;
struct sgx_epc_page *page; struct sgx_epc_page *page;
LIST_HEAD(dirty); LIST_HEAD(dirty);
int ret; int ret;
@@ -56,7 +60,7 @@ static void __sgx_sanitize_pages(struct list_head *dirty_page_list)
/* dirty_page_list is thread-local, no need for a lock: */ /* dirty_page_list is thread-local, no need for a lock: */
while (!list_empty(dirty_page_list)) { while (!list_empty(dirty_page_list)) {
if (kthread_should_stop()) if (kthread_should_stop())
return; return 0;
page = list_first_entry(dirty_page_list, struct sgx_epc_page, list); page = list_first_entry(dirty_page_list, struct sgx_epc_page, list);
@@ -71,12 +75,14 @@ static void __sgx_sanitize_pages(struct list_head *dirty_page_list)
} else { } else {
/* The page is not yet clean - move to the dirty list. */ /* The page is not yet clean - move to the dirty list. */
list_move_tail(&page->list, &dirty); list_move_tail(&page->list, &dirty);
left_dirty++;
} }
cond_resched(); cond_resched();
} }
list_splice(&dirty, dirty_page_list); list_splice(&dirty, dirty_page_list);
return left_dirty;
} }
static bool sgx_reclaimer_age(struct sgx_epc_page *epc_page) static bool sgx_reclaimer_age(struct sgx_epc_page *epc_page)
@@ -427,10 +433,7 @@ static int ksgxd(void *p)
* required for SECS pages, whose child pages blocked EREMOVE. * required for SECS pages, whose child pages blocked EREMOVE.
*/ */
__sgx_sanitize_pages(&sgx_dirty_page_list); __sgx_sanitize_pages(&sgx_dirty_page_list);
__sgx_sanitize_pages(&sgx_dirty_page_list); WARN_ON(__sgx_sanitize_pages(&sgx_dirty_page_list));
/* sanity check: */
WARN_ON(!list_empty(&sgx_dirty_page_list));
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
if (try_to_freeze()) if (try_to_freeze())

View File

@@ -718,8 +718,6 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
entry->edx = 0; entry->edx = 0;
} }
break; break;
case 9:
break;
case 0xa: { /* Architectural Performance Monitoring */ case 0xa: { /* Architectural Performance Monitoring */
struct x86_pmu_capability cap; struct x86_pmu_capability cap;
union cpuid10_eax eax; union cpuid10_eax eax;

View File

@@ -3961,6 +3961,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER }, { "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER },
{ "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER },
/* These specific Pioneer models have LPM issues */
{ "PIONEER BD-RW BDR-207M", NULL, ATA_HORKAGE_NOLPM },
{ "PIONEER BD-RW BDR-205", NULL, ATA_HORKAGE_NOLPM },
/* Crucial BX100 SSD 500GB has broken LPM support */ /* Crucial BX100 SSD 500GB has broken LPM support */
{ "CT500BX100SSD1", NULL, ATA_HORKAGE_NOLPM }, { "CT500BX100SSD1", NULL, ATA_HORKAGE_NOLPM },

View File

@@ -736,6 +736,7 @@ void iproc_pll_clk_setup(struct device_node *node,
const char *parent_name; const char *parent_name;
struct iproc_clk *iclk_array; struct iproc_clk *iclk_array;
struct clk_hw_onecell_data *clk_data; struct clk_hw_onecell_data *clk_data;
const char *clk_name;
if (WARN_ON(!pll_ctrl) || WARN_ON(!clk_ctrl)) if (WARN_ON(!pll_ctrl) || WARN_ON(!clk_ctrl))
return; return;
@@ -783,7 +784,12 @@ void iproc_pll_clk_setup(struct device_node *node,
iclk = &iclk_array[0]; iclk = &iclk_array[0];
iclk->pll = pll; iclk->pll = pll;
init.name = node->name; ret = of_property_read_string_index(node, "clock-output-names",
0, &clk_name);
if (WARN_ON(ret))
goto err_pll_register;
init.name = clk_name;
init.ops = &iproc_pll_ops; init.ops = &iproc_pll_ops;
init.flags = 0; init.flags = 0;
parent_name = of_clk_get_parent_name(node, 0); parent_name = of_clk_get_parent_name(node, 0);
@@ -803,13 +809,11 @@ void iproc_pll_clk_setup(struct device_node *node,
goto err_pll_register; goto err_pll_register;
clk_data->hws[0] = &iclk->hw; clk_data->hws[0] = &iclk->hw;
parent_name = clk_name;
/* now initialize and register all leaf clocks */ /* now initialize and register all leaf clocks */
for (i = 1; i < num_clks; i++) { for (i = 1; i < num_clks; i++) {
const char *clk_name;
memset(&init, 0, sizeof(init)); memset(&init, 0, sizeof(init));
parent_name = node->name;
ret = of_property_read_string_index(node, "clock-output-names", ret = of_property_read_string_index(node, "clock-output-names",
i, &clk_name); i, &clk_name);

View File

@@ -280,13 +280,13 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node)
hws[IMX6SX_CLK_SSI3_SEL] = imx_clk_hw_mux("ssi3_sel", base + 0x1c, 14, 2, ssi_sels, ARRAY_SIZE(ssi_sels)); hws[IMX6SX_CLK_SSI3_SEL] = imx_clk_hw_mux("ssi3_sel", base + 0x1c, 14, 2, ssi_sels, ARRAY_SIZE(ssi_sels));
hws[IMX6SX_CLK_SSI2_SEL] = imx_clk_hw_mux("ssi2_sel", base + 0x1c, 12, 2, ssi_sels, ARRAY_SIZE(ssi_sels)); hws[IMX6SX_CLK_SSI2_SEL] = imx_clk_hw_mux("ssi2_sel", base + 0x1c, 12, 2, ssi_sels, ARRAY_SIZE(ssi_sels));
hws[IMX6SX_CLK_SSI1_SEL] = imx_clk_hw_mux("ssi1_sel", base + 0x1c, 10, 2, ssi_sels, ARRAY_SIZE(ssi_sels)); hws[IMX6SX_CLK_SSI1_SEL] = imx_clk_hw_mux("ssi1_sel", base + 0x1c, 10, 2, ssi_sels, ARRAY_SIZE(ssi_sels));
hws[IMX6SX_CLK_QSPI1_SEL] = imx_clk_hw_mux_flags("qspi1_sel", base + 0x1c, 7, 3, qspi1_sels, ARRAY_SIZE(qspi1_sels), CLK_SET_RATE_PARENT); hws[IMX6SX_CLK_QSPI1_SEL] = imx_clk_hw_mux("qspi1_sel", base + 0x1c, 7, 3, qspi1_sels, ARRAY_SIZE(qspi1_sels));
hws[IMX6SX_CLK_PERCLK_SEL] = imx_clk_hw_mux("perclk_sel", base + 0x1c, 6, 1, perclk_sels, ARRAY_SIZE(perclk_sels)); hws[IMX6SX_CLK_PERCLK_SEL] = imx_clk_hw_mux("perclk_sel", base + 0x1c, 6, 1, perclk_sels, ARRAY_SIZE(perclk_sels));
hws[IMX6SX_CLK_VID_SEL] = imx_clk_hw_mux("vid_sel", base + 0x20, 21, 3, vid_sels, ARRAY_SIZE(vid_sels)); hws[IMX6SX_CLK_VID_SEL] = imx_clk_hw_mux("vid_sel", base + 0x20, 21, 3, vid_sels, ARRAY_SIZE(vid_sels));
hws[IMX6SX_CLK_ESAI_SEL] = imx_clk_hw_mux("esai_sel", base + 0x20, 19, 2, audio_sels, ARRAY_SIZE(audio_sels)); hws[IMX6SX_CLK_ESAI_SEL] = imx_clk_hw_mux("esai_sel", base + 0x20, 19, 2, audio_sels, ARRAY_SIZE(audio_sels));
hws[IMX6SX_CLK_CAN_SEL] = imx_clk_hw_mux("can_sel", base + 0x20, 8, 2, can_sels, ARRAY_SIZE(can_sels)); hws[IMX6SX_CLK_CAN_SEL] = imx_clk_hw_mux("can_sel", base + 0x20, 8, 2, can_sels, ARRAY_SIZE(can_sels));
hws[IMX6SX_CLK_UART_SEL] = imx_clk_hw_mux("uart_sel", base + 0x24, 6, 1, uart_sels, ARRAY_SIZE(uart_sels)); hws[IMX6SX_CLK_UART_SEL] = imx_clk_hw_mux("uart_sel", base + 0x24, 6, 1, uart_sels, ARRAY_SIZE(uart_sels));
hws[IMX6SX_CLK_QSPI2_SEL] = imx_clk_hw_mux_flags("qspi2_sel", base + 0x2c, 15, 3, qspi2_sels, ARRAY_SIZE(qspi2_sels), CLK_SET_RATE_PARENT); hws[IMX6SX_CLK_QSPI2_SEL] = imx_clk_hw_mux("qspi2_sel", base + 0x2c, 15, 3, qspi2_sels, ARRAY_SIZE(qspi2_sels));
hws[IMX6SX_CLK_SPDIF_SEL] = imx_clk_hw_mux("spdif_sel", base + 0x30, 20, 2, audio_sels, ARRAY_SIZE(audio_sels)); hws[IMX6SX_CLK_SPDIF_SEL] = imx_clk_hw_mux("spdif_sel", base + 0x30, 20, 2, audio_sels, ARRAY_SIZE(audio_sels));
hws[IMX6SX_CLK_AUDIO_SEL] = imx_clk_hw_mux("audio_sel", base + 0x30, 7, 2, audio_sels, ARRAY_SIZE(audio_sels)); hws[IMX6SX_CLK_AUDIO_SEL] = imx_clk_hw_mux("audio_sel", base + 0x30, 7, 2, audio_sels, ARRAY_SIZE(audio_sels));
hws[IMX6SX_CLK_ENET_PRE_SEL] = imx_clk_hw_mux("enet_pre_sel", base + 0x34, 15, 3, enet_pre_sels, ARRAY_SIZE(enet_pre_sels)); hws[IMX6SX_CLK_ENET_PRE_SEL] = imx_clk_hw_mux("enet_pre_sel", base + 0x34, 15, 3, enet_pre_sels, ARRAY_SIZE(enet_pre_sels));

View File

@@ -100,15 +100,11 @@ static bool ingenic_tcu_enable_regs(struct clk_hw *hw)
bool enabled = false; bool enabled = false;
/* /*
* If the SoC has no global TCU clock, we must ungate the channel's * According to the programming manual, a timer channel's registers can
* clock to be able to access its registers. * only be accessed when the channel's stop bit is clear.
* If we have a TCU clock, it will be enabled automatically as it has
* been attached to the regmap.
*/ */
if (!tcu->clk) { enabled = !!ingenic_tcu_is_enabled(hw);
enabled = !!ingenic_tcu_is_enabled(hw); regmap_write(tcu->map, TCU_REG_TSCR, BIT(info->gate_bit));
regmap_write(tcu->map, TCU_REG_TSCR, BIT(info->gate_bit));
}
return enabled; return enabled;
} }
@@ -119,8 +115,7 @@ static void ingenic_tcu_disable_regs(struct clk_hw *hw)
const struct ingenic_tcu_clk_info *info = tcu_clk->info; const struct ingenic_tcu_clk_info *info = tcu_clk->info;
struct ingenic_tcu *tcu = tcu_clk->tcu; struct ingenic_tcu *tcu = tcu_clk->tcu;
if (!tcu->clk) regmap_write(tcu->map, TCU_REG_TSSR, BIT(info->gate_bit));
regmap_write(tcu->map, TCU_REG_TSSR, BIT(info->gate_bit));
} }
static u8 ingenic_tcu_get_parent(struct clk_hw *hw) static u8 ingenic_tcu_get_parent(struct clk_hw *hw)

View File

@@ -8,7 +8,6 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pm_clock.h>
#include <linux/pm_domain.h> #include <linux/pm_domain.h>
#include <linux/scmi_protocol.h> #include <linux/scmi_protocol.h>
@@ -53,27 +52,6 @@ static int scmi_pd_power_off(struct generic_pm_domain *domain)
return scmi_pd_power(domain, false); return scmi_pd_power(domain, false);
} }
static int scmi_pd_attach_dev(struct generic_pm_domain *pd, struct device *dev)
{
int ret;
ret = pm_clk_create(dev);
if (ret)
return ret;
ret = of_pm_clk_add_clks(dev);
if (ret >= 0)
return 0;
pm_clk_destroy(dev);
return ret;
}
static void scmi_pd_detach_dev(struct generic_pm_domain *pd, struct device *dev)
{
pm_clk_destroy(dev);
}
static int scmi_pm_domain_probe(struct scmi_device *sdev) static int scmi_pm_domain_probe(struct scmi_device *sdev)
{ {
int num_domains, i; int num_domains, i;
@@ -124,10 +102,6 @@ static int scmi_pm_domain_probe(struct scmi_device *sdev)
scmi_pd->genpd.name = scmi_pd->name; scmi_pd->genpd.name = scmi_pd->name;
scmi_pd->genpd.power_off = scmi_pd_power_off; scmi_pd->genpd.power_off = scmi_pd_power_off;
scmi_pd->genpd.power_on = scmi_pd_power_on; scmi_pd->genpd.power_on = scmi_pd_power_on;
scmi_pd->genpd.attach_dev = scmi_pd_attach_dev;
scmi_pd->genpd.detach_dev = scmi_pd_detach_dev;
scmi_pd->genpd.flags = GENPD_FLAG_PM_CLK |
GENPD_FLAG_ACTIVE_WAKEUP;
pm_genpd_init(&scmi_pd->genpd, NULL, pm_genpd_init(&scmi_pd->genpd, NULL,
state == SCMI_POWER_STATE_GENERIC_OFF); state == SCMI_POWER_STATE_GENERIC_OFF);

View File

@@ -793,8 +793,12 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
u32 offset; u32 offset;
u32 set; u32 set;
if (of_device_is_compatible(mvchip->chip.of_node, if (mvchip->soc_variant == MVEBU_GPIO_SOC_VARIANT_A8K) {
"marvell,armada-370-gpio")) { int ret = of_property_read_u32(dev->of_node,
"marvell,pwm-offset", &offset);
if (ret < 0)
return 0;
} else {
/* /*
* There are only two sets of PWM configuration registers for * There are only two sets of PWM configuration registers for
* all the GPIO lines on those SoCs which this driver reserves * all the GPIO lines on those SoCs which this driver reserves
@@ -804,13 +808,6 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwm")) if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwm"))
return 0; return 0;
offset = 0; offset = 0;
} else if (mvchip->soc_variant == MVEBU_GPIO_SOC_VARIANT_A8K) {
int ret = of_property_read_u32(dev->of_node,
"marvell,pwm-offset", &offset);
if (ret < 0)
return 0;
} else {
return 0;
} }
if (IS_ERR(mvchip->clk)) if (IS_ERR(mvchip->clk))

View File

@@ -1056,6 +1056,10 @@ bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev)
{ {
if (adev->flags & AMD_IS_APU) if (adev->flags & AMD_IS_APU)
return false; return false;
if (amdgpu_sriov_vf(adev))
return false;
return pm_suspend_target_state != PM_SUSPEND_TO_IDLE; return pm_suspend_target_state != PM_SUSPEND_TO_IDLE;
} }

View File

@@ -3137,7 +3137,8 @@ static int amdgpu_device_ip_resume_phase1(struct amdgpu_device *adev)
continue; continue;
if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_COMMON || if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_COMMON ||
adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC || adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC ||
adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_IH) { adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_IH ||
(adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP && amdgpu_sriov_vf(adev))) {
r = adev->ip_blocks[i].version->funcs->resume(adev); r = adev->ip_blocks[i].version->funcs->resume(adev);
if (r) { if (r) {
@@ -4001,12 +4002,20 @@ static void amdgpu_device_evict_resources(struct amdgpu_device *adev)
int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
{ {
struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_device *adev = drm_to_adev(dev);
int r = 0;
if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
return 0; return 0;
adev->in_suspend = true; adev->in_suspend = true;
if (amdgpu_sriov_vf(adev)) {
amdgpu_virt_fini_data_exchange(adev);
r = amdgpu_virt_request_full_gpu(adev, false);
if (r)
return r;
}
if (amdgpu_acpi_smart_shift_update(dev, AMDGPU_SS_DEV_D3)) if (amdgpu_acpi_smart_shift_update(dev, AMDGPU_SS_DEV_D3))
DRM_WARN("smart shift update failed\n"); DRM_WARN("smart shift update failed\n");
@@ -4035,6 +4044,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
*/ */
amdgpu_device_evict_resources(adev); amdgpu_device_evict_resources(adev);
if (amdgpu_sriov_vf(adev))
amdgpu_virt_release_full_gpu(adev, false);
return 0; return 0;
} }
@@ -4053,6 +4065,12 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
struct amdgpu_device *adev = drm_to_adev(dev); struct amdgpu_device *adev = drm_to_adev(dev);
int r = 0; int r = 0;
if (amdgpu_sriov_vf(adev)) {
r = amdgpu_virt_request_full_gpu(adev, true);
if (r)
return r;
}
if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
return 0; return 0;
@@ -4067,6 +4085,13 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
} }
r = amdgpu_device_ip_resume(adev); r = amdgpu_device_ip_resume(adev);
/* no matter what r is, always need to properly release full GPU */
if (amdgpu_sriov_vf(adev)) {
amdgpu_virt_init_data_exchange(adev);
amdgpu_virt_release_full_gpu(adev, true);
}
if (r) { if (r) {
dev_err(adev->dev, "amdgpu_device_ip_resume failed (%d).\n", r); dev_err(adev->dev, "amdgpu_device_ip_resume failed (%d).\n", r);
return r; return r;

View File

@@ -1860,12 +1860,6 @@ EXPORT_SYMBOL_GPL(analogix_dp_remove);
int analogix_dp_suspend(struct analogix_dp_device *dp) int analogix_dp_suspend(struct analogix_dp_device *dp)
{ {
clk_disable_unprepare(dp->clock); clk_disable_unprepare(dp->clock);
if (dp->plat_data->panel) {
if (drm_panel_unprepare(dp->plat_data->panel))
DRM_ERROR("failed to turnoff the panel\n");
}
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(analogix_dp_suspend); EXPORT_SYMBOL_GPL(analogix_dp_suspend);
@@ -1880,13 +1874,6 @@ int analogix_dp_resume(struct analogix_dp_device *dp)
return ret; return ret;
} }
if (dp->plat_data->panel) {
if (drm_panel_prepare(dp->plat_data->panel)) {
DRM_ERROR("failed to setup the panel\n");
return -EBUSY;
}
}
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(analogix_dp_resume); EXPORT_SYMBOL_GPL(analogix_dp_resume);

View File

@@ -186,7 +186,7 @@ static int lt8912_write_lvds_config(struct lt8912 *lt)
{0x03, 0xff}, {0x03, 0xff},
}; };
return regmap_multi_reg_write(lt->regmap[I2C_CEC_DSI], seq, ARRAY_SIZE(seq)); return regmap_multi_reg_write(lt->regmap[I2C_MAIN], seq, ARRAY_SIZE(seq));
}; };
static inline struct lt8912 *bridge_to_lt8912(struct drm_bridge *b) static inline struct lt8912 *bridge_to_lt8912(struct drm_bridge *b)
@@ -266,7 +266,7 @@ static int lt8912_video_setup(struct lt8912 *lt)
u32 hactive, h_total, hpw, hfp, hbp; u32 hactive, h_total, hpw, hfp, hbp;
u32 vactive, v_total, vpw, vfp, vbp; u32 vactive, v_total, vpw, vfp, vbp;
u8 settle = 0x08; u8 settle = 0x08;
int ret; int ret, hsync_activehigh, vsync_activehigh;
if (!lt) if (!lt)
return -EINVAL; return -EINVAL;
@@ -276,12 +276,14 @@ static int lt8912_video_setup(struct lt8912 *lt)
hpw = lt->mode.hsync_len; hpw = lt->mode.hsync_len;
hbp = lt->mode.hback_porch; hbp = lt->mode.hback_porch;
h_total = hactive + hfp + hpw + hbp; h_total = hactive + hfp + hpw + hbp;
hsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_HSYNC_HIGH;
vactive = lt->mode.vactive; vactive = lt->mode.vactive;
vfp = lt->mode.vfront_porch; vfp = lt->mode.vfront_porch;
vpw = lt->mode.vsync_len; vpw = lt->mode.vsync_len;
vbp = lt->mode.vback_porch; vbp = lt->mode.vback_porch;
v_total = vactive + vfp + vpw + vbp; v_total = vactive + vfp + vpw + vbp;
vsync_activehigh = lt->mode.flags & DISPLAY_FLAGS_VSYNC_HIGH;
if (vactive <= 600) if (vactive <= 600)
settle = 0x04; settle = 0x04;
@@ -315,6 +317,13 @@ static int lt8912_video_setup(struct lt8912 *lt)
ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3e, hfp & 0xff); ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3e, hfp & 0xff);
ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3f, hfp >> 8); ret |= regmap_write(lt->regmap[I2C_CEC_DSI], 0x3f, hfp >> 8);
ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(0),
vsync_activehigh ? BIT(0) : 0);
ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xab, BIT(1),
hsync_activehigh ? BIT(1) : 0);
ret |= regmap_update_bits(lt->regmap[I2C_MAIN], 0xb2, BIT(0),
lt->connector.display_info.is_hdmi ? BIT(0) : 0);
return ret; return ret;
} }

View File

@@ -997,6 +997,10 @@ void i915_gem_context_release(struct kref *ref)
trace_i915_context_free(ctx); trace_i915_context_free(ctx);
GEM_BUG_ON(!i915_gem_context_is_closed(ctx)); GEM_BUG_ON(!i915_gem_context_is_closed(ctx));
spin_lock(&ctx->i915->gem.contexts.lock);
list_del(&ctx->link);
spin_unlock(&ctx->i915->gem.contexts.lock);
if (ctx->syncobj) if (ctx->syncobj)
drm_syncobj_put(ctx->syncobj); drm_syncobj_put(ctx->syncobj);
@@ -1228,10 +1232,6 @@ static void context_close(struct i915_gem_context *ctx)
*/ */
lut_close(ctx); lut_close(ctx);
spin_lock(&ctx->i915->gem.contexts.lock);
list_del(&ctx->link);
spin_unlock(&ctx->i915->gem.contexts.lock);
mutex_unlock(&ctx->mutex); mutex_unlock(&ctx->mutex);
/* /*

View File

@@ -143,6 +143,21 @@ struct intel_engine_execlists {
*/ */
struct timer_list preempt; struct timer_list preempt;
/**
* @preempt_target: active request at the time of the preemption request
*
* We force a preemption to occur if the pending contexts have not
* been promoted to active upon receipt of the CS ack event within
* the timeout. This timeout maybe chosen based on the target,
* using a very short timeout if the context is no longer schedulable.
* That short timeout may not be applicable to other contexts, so
* if a context switch should happen within before the preemption
* timeout, we may shoot early at an innocent context. To prevent this,
* we record which context was active at the time of the preemption
* request and only reset that context upon the timeout.
*/
const struct i915_request *preempt_target;
/** /**
* @ccid: identifier for contexts submitted to this engine * @ccid: identifier for contexts submitted to this engine
*/ */

View File

@@ -1225,6 +1225,9 @@ static unsigned long active_preempt_timeout(struct intel_engine_cs *engine,
if (!rq) if (!rq)
return 0; return 0;
/* Only allow ourselves to force reset the currently active context */
engine->execlists.preempt_target = rq;
/* Force a fast reset for terminated contexts (ignoring sysfs!) */ /* Force a fast reset for terminated contexts (ignoring sysfs!) */
if (unlikely(intel_context_is_banned(rq->context) || bad_request(rq))) if (unlikely(intel_context_is_banned(rq->context) || bad_request(rq)))
return 1; return 1;
@@ -2401,8 +2404,24 @@ static void execlists_submission_tasklet(struct tasklet_struct *t)
GEM_BUG_ON(inactive - post > ARRAY_SIZE(post)); GEM_BUG_ON(inactive - post > ARRAY_SIZE(post));
if (unlikely(preempt_timeout(engine))) { if (unlikely(preempt_timeout(engine))) {
const struct i915_request *rq = *engine->execlists.active;
/*
* If after the preempt-timeout expired, we are still on the
* same active request/context as before we initiated the
* preemption, reset the engine.
*
* However, if we have processed a CS event to switch contexts,
* but not yet processed the CS event for the pending
* preemption, reset the timer allowing the new context to
* gracefully exit.
*/
cancel_timer(&engine->execlists.preempt); cancel_timer(&engine->execlists.preempt);
engine->execlists.error_interrupt |= ERROR_PREEMPT; if (rq == engine->execlists.preempt_target)
engine->execlists.error_interrupt |= ERROR_PREEMPT;
else
set_timer_ms(&engine->execlists.preempt,
active_preempt_timeout(engine, rq));
} }
if (unlikely(READ_ONCE(engine->execlists.error_interrupt))) { if (unlikely(READ_ONCE(engine->execlists.error_interrupt))) {

View File

@@ -20,7 +20,7 @@
#include <linux/mfd/syscon.h> #include <linux/mfd/syscon.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#define SNVS_HPVIDR1_REG 0xF8 #define SNVS_HPVIDR1_REG 0xBF8
#define SNVS_LPSR_REG 0x4C /* LP Status Register */ #define SNVS_LPSR_REG 0x4C /* LP Status Register */
#define SNVS_LPCR_REG 0x38 /* LP Control Register */ #define SNVS_LPCR_REG 0x38 /* LP Control Register */
#define SNVS_HPSR_REG 0x14 #define SNVS_HPSR_REG 0x14

View File

@@ -1453,7 +1453,7 @@ static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id)
"ce", GPIOD_OUT_LOW); "ce", GPIOD_OUT_LOW);
if (IS_ERR(ts->gpio_ce)) { if (IS_ERR(ts->gpio_ce)) {
error = PTR_ERR(ts->gpio_ce); error = PTR_ERR(ts->gpio_ce);
if (error != EPROBE_DEFER) if (error != -EPROBE_DEFER)
dev_err(&client->dev, dev_err(&client->dev,
"Failed to get gpio: %d\n", error); "Failed to get gpio: %d\n", error);
return error; return error;

View File

@@ -358,6 +358,12 @@ int dvb_vb2_reqbufs(struct dvb_vb2_ctx *ctx, struct dmx_requestbuffers *req)
int dvb_vb2_querybuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b) int dvb_vb2_querybuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b)
{ {
struct vb2_queue *q = &ctx->vb_q;
if (b->index >= q->num_buffers) {
dprintk(1, "[%s] buffer index out of range\n", ctx->name);
return -EINVAL;
}
vb2_core_querybuf(&ctx->vb_q, b->index, b); vb2_core_querybuf(&ctx->vb_q, b->index, b);
dprintk(3, "[%s] index=%d\n", ctx->name, b->index); dprintk(3, "[%s] index=%d\n", ctx->name, b->index);
return 0; return 0;
@@ -382,8 +388,13 @@ int dvb_vb2_expbuf(struct dvb_vb2_ctx *ctx, struct dmx_exportbuffer *exp)
int dvb_vb2_qbuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b) int dvb_vb2_qbuf(struct dvb_vb2_ctx *ctx, struct dmx_buffer *b)
{ {
struct vb2_queue *q = &ctx->vb_q;
int ret; int ret;
if (b->index >= q->num_buffers) {
dprintk(1, "[%s] buffer index out of range\n", ctx->name);
return -EINVAL;
}
ret = vb2_core_qbuf(&ctx->vb_q, b->index, b, NULL); ret = vb2_core_qbuf(&ctx->vb_q, b->index, b, NULL);
if (ret) { if (ret) {
dprintk(1, "[%s] index=%d errno=%d\n", ctx->name, dprintk(1, "[%s] index=%d errno=%d\n", ctx->name,

View File

@@ -1033,6 +1033,8 @@ int v4l2_compat_get_array_args(struct file *file, void *mbuf,
{ {
int err = 0; int err = 0;
memset(mbuf, 0, array_size);
switch (cmd) { switch (cmd) {
case VIDIOC_G_FMT32: case VIDIOC_G_FMT32:
case VIDIOC_S_FMT32: case VIDIOC_S_FMT32:

View File

@@ -34,7 +34,7 @@ static void mmc_hsq_pump_requests(struct mmc_hsq *hsq)
spin_lock_irqsave(&hsq->lock, flags); spin_lock_irqsave(&hsq->lock, flags);
/* Make sure we are not already running a request now */ /* Make sure we are not already running a request now */
if (hsq->mrq) { if (hsq->mrq || hsq->recovery_halt) {
spin_unlock_irqrestore(&hsq->lock, flags); spin_unlock_irqrestore(&hsq->lock, flags);
return; return;
} }

View File

@@ -111,8 +111,8 @@
#define CLK_DIV_MASK 0x7f #define CLK_DIV_MASK 0x7f
/* REG_BUS_WIDTH */ /* REG_BUS_WIDTH */
#define BUS_WIDTH_8 BIT(2) #define BUS_WIDTH_4_SUPPORT BIT(3)
#define BUS_WIDTH_4 BIT(1) #define BUS_WIDTH_4 BIT(2)
#define BUS_WIDTH_1 BIT(0) #define BUS_WIDTH_1 BIT(0)
#define MMC_VDD_360 23 #define MMC_VDD_360 23
@@ -524,9 +524,6 @@ static void moxart_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
case MMC_BUS_WIDTH_4: case MMC_BUS_WIDTH_4:
writel(BUS_WIDTH_4, host->base + REG_BUS_WIDTH); writel(BUS_WIDTH_4, host->base + REG_BUS_WIDTH);
break; break;
case MMC_BUS_WIDTH_8:
writel(BUS_WIDTH_8, host->base + REG_BUS_WIDTH);
break;
default: default:
writel(BUS_WIDTH_1, host->base + REG_BUS_WIDTH); writel(BUS_WIDTH_1, host->base + REG_BUS_WIDTH);
break; break;
@@ -651,16 +648,8 @@ static int moxart_probe(struct platform_device *pdev)
dmaengine_slave_config(host->dma_chan_rx, &cfg); dmaengine_slave_config(host->dma_chan_rx, &cfg);
} }
switch ((readl(host->base + REG_BUS_WIDTH) >> 3) & 3) { if (readl(host->base + REG_BUS_WIDTH) & BUS_WIDTH_4_SUPPORT)
case 1:
mmc->caps |= MMC_CAP_4_BIT_DATA; mmc->caps |= MMC_CAP_4_BIT_DATA;
break;
case 2:
mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
break;
default:
break;
}
writel(0, host->base + REG_INTERRUPT_MASK); writel(0, host->base + REG_INTERRUPT_MASK);

View File

@@ -236,9 +236,22 @@ static inline u8 c_can_get_tx_tail(const struct c_can_tx_ring *ring)
return ring->tail & (ring->obj_num - 1); return ring->tail & (ring->obj_num - 1);
} }
static inline u8 c_can_get_tx_free(const struct c_can_tx_ring *ring) static inline u8 c_can_get_tx_free(const struct c_can_priv *priv,
const struct c_can_tx_ring *ring)
{ {
return ring->obj_num - (ring->head - ring->tail); u8 head = c_can_get_tx_head(ring);
u8 tail = c_can_get_tx_tail(ring);
if (priv->type == BOSCH_D_CAN)
return ring->obj_num - (ring->head - ring->tail);
/* This is not a FIFO. C/D_CAN sends out the buffers
* prioritized. The lowest buffer number wins.
*/
if (head < tail)
return 0;
return ring->obj_num - head;
} }
#endif /* C_CAN_H */ #endif /* C_CAN_H */

View File

@@ -430,7 +430,7 @@ static void c_can_setup_receive_object(struct net_device *dev, int iface,
static bool c_can_tx_busy(const struct c_can_priv *priv, static bool c_can_tx_busy(const struct c_can_priv *priv,
const struct c_can_tx_ring *tx_ring) const struct c_can_tx_ring *tx_ring)
{ {
if (c_can_get_tx_free(tx_ring) > 0) if (c_can_get_tx_free(priv, tx_ring) > 0)
return false; return false;
netif_stop_queue(priv->dev); netif_stop_queue(priv->dev);
@@ -438,7 +438,7 @@ static bool c_can_tx_busy(const struct c_can_priv *priv,
/* Memory barrier before checking tx_free (head and tail) */ /* Memory barrier before checking tx_free (head and tail) */
smp_mb(); smp_mb();
if (c_can_get_tx_free(tx_ring) == 0) { if (c_can_get_tx_free(priv, tx_ring) == 0) {
netdev_dbg(priv->dev, netdev_dbg(priv->dev,
"Stopping tx-queue (tx_head=0x%08x, tx_tail=0x%08x, len=%d).\n", "Stopping tx-queue (tx_head=0x%08x, tx_tail=0x%08x, len=%d).\n",
tx_ring->head, tx_ring->tail, tx_ring->head, tx_ring->tail,
@@ -466,7 +466,7 @@ static netdev_tx_t c_can_start_xmit(struct sk_buff *skb,
idx = c_can_get_tx_head(tx_ring); idx = c_can_get_tx_head(tx_ring);
tx_ring->head++; tx_ring->head++;
if (c_can_get_tx_free(tx_ring) == 0) if (c_can_get_tx_free(priv, tx_ring) == 0)
netif_stop_queue(dev); netif_stop_queue(dev);
if (idx < c_can_get_tx_tail(tx_ring)) if (idx < c_can_get_tx_tail(tx_ring))
@@ -751,7 +751,7 @@ static void c_can_do_tx(struct net_device *dev)
return; return;
tx_ring->tail += pkts; tx_ring->tail += pkts;
if (c_can_get_tx_free(tx_ring)) { if (c_can_get_tx_free(priv, tx_ring)) {
/* Make sure that anybody stopping the queue after /* Make sure that anybody stopping the queue after
* this sees the new tx_ring->tail. * this sees the new tx_ring->tail.
*/ */
@@ -764,8 +764,7 @@ static void c_can_do_tx(struct net_device *dev)
can_led_event(dev, CAN_LED_EVENT_TX); can_led_event(dev, CAN_LED_EVENT_TX);
tail = c_can_get_tx_tail(tx_ring); tail = c_can_get_tx_tail(tx_ring);
if (priv->type == BOSCH_D_CAN && tail == 0) {
if (tail == 0) {
u8 head = c_can_get_tx_head(tx_ring); u8 head = c_can_get_tx_head(tx_ring);
/* Start transmission for all cached messages */ /* Start transmission for all cached messages */

View File

@@ -501,14 +501,19 @@ static bool mt7531_dual_sgmii_supported(struct mt7530_priv *priv)
static int static int
mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface) mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
{ {
struct mt7530_priv *priv = ds->priv; return 0;
}
static void
mt7531_pll_setup(struct mt7530_priv *priv)
{
u32 top_sig; u32 top_sig;
u32 hwstrap; u32 hwstrap;
u32 xtal; u32 xtal;
u32 val; u32 val;
if (mt7531_dual_sgmii_supported(priv)) if (mt7531_dual_sgmii_supported(priv))
return 0; return;
val = mt7530_read(priv, MT7531_CREV); val = mt7530_read(priv, MT7531_CREV);
top_sig = mt7530_read(priv, MT7531_TOP_SIG_SR); top_sig = mt7530_read(priv, MT7531_TOP_SIG_SR);
@@ -587,8 +592,6 @@ mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
val |= EN_COREPLL; val |= EN_COREPLL;
mt7530_write(priv, MT7531_PLLGP_EN, val); mt7530_write(priv, MT7531_PLLGP_EN, val);
usleep_range(25, 35); usleep_range(25, 35);
return 0;
} }
static void static void
@@ -2292,6 +2295,8 @@ mt7531_setup(struct dsa_switch *ds)
SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST | SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST |
SYS_CTRL_REG_RST); SYS_CTRL_REG_RST);
mt7531_pll_setup(priv);
if (mt7531_dual_sgmii_supported(priv)) { if (mt7531_dual_sgmii_supported(priv)) {
priv->p5_intf_sel = P5_INTF_SEL_GMAC5_SGMII; priv->p5_intf_sel = P5_INTF_SEL_GMAC5_SGMII;
@@ -2867,8 +2872,6 @@ mt7531_cpu_port_config(struct dsa_switch *ds, int port)
case 6: case 6:
interface = PHY_INTERFACE_MODE_2500BASEX; interface = PHY_INTERFACE_MODE_2500BASEX;
mt7531_pad_setup(ds, interface);
priv->p6_interface = interface; priv->p6_interface = interface;
break; break;
default: default:

View File

@@ -14,6 +14,7 @@
#include "cudbg_entity.h" #include "cudbg_entity.h"
#include "cudbg_lib.h" #include "cudbg_lib.h"
#include "cudbg_zlib.h" #include "cudbg_zlib.h"
#include "cxgb4_tc_mqprio.h"
static const u32 t6_tp_pio_array[][IREG_NUM_ELEM] = { static const u32 t6_tp_pio_array[][IREG_NUM_ELEM] = {
{0x7e40, 0x7e44, 0x020, 28}, /* t6_tp_pio_regs_20_to_3b */ {0x7e40, 0x7e44, 0x020, 28}, /* t6_tp_pio_regs_20_to_3b */
@@ -3458,7 +3459,7 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init,
for (i = 0; i < utxq->ntxq; i++) for (i = 0; i < utxq->ntxq; i++)
QDESC_GET_TXQ(&utxq->uldtxq[i].q, QDESC_GET_TXQ(&utxq->uldtxq[i].q,
cudbg_uld_txq_to_qtype(j), cudbg_uld_txq_to_qtype(j),
out_unlock); out_unlock_uld);
} }
} }
@@ -3475,7 +3476,7 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init,
for (i = 0; i < urxq->nrxq; i++) for (i = 0; i < urxq->nrxq; i++)
QDESC_GET_RXQ(&urxq->uldrxq[i].rspq, QDESC_GET_RXQ(&urxq->uldrxq[i].rspq,
cudbg_uld_rxq_to_qtype(j), cudbg_uld_rxq_to_qtype(j),
out_unlock); out_unlock_uld);
} }
/* ULD FLQ */ /* ULD FLQ */
@@ -3487,7 +3488,7 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init,
for (i = 0; i < urxq->nrxq; i++) for (i = 0; i < urxq->nrxq; i++)
QDESC_GET_FLQ(&urxq->uldrxq[i].fl, QDESC_GET_FLQ(&urxq->uldrxq[i].fl,
cudbg_uld_flq_to_qtype(j), cudbg_uld_flq_to_qtype(j),
out_unlock); out_unlock_uld);
} }
/* ULD CIQ */ /* ULD CIQ */
@@ -3500,29 +3501,34 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init,
for (i = 0; i < urxq->nciq; i++) for (i = 0; i < urxq->nciq; i++)
QDESC_GET_RXQ(&urxq->uldrxq[base + i].rspq, QDESC_GET_RXQ(&urxq->uldrxq[base + i].rspq,
cudbg_uld_ciq_to_qtype(j), cudbg_uld_ciq_to_qtype(j),
out_unlock); out_unlock_uld);
} }
} }
mutex_unlock(&uld_mutex);
if (!padap->tc_mqprio)
goto out;
mutex_lock(&padap->tc_mqprio->mqprio_mutex);
/* ETHOFLD TXQ */ /* ETHOFLD TXQ */
if (s->eohw_txq) if (s->eohw_txq)
for (i = 0; i < s->eoqsets; i++) for (i = 0; i < s->eoqsets; i++)
QDESC_GET_TXQ(&s->eohw_txq[i].q, QDESC_GET_TXQ(&s->eohw_txq[i].q,
CUDBG_QTYPE_ETHOFLD_TXQ, out); CUDBG_QTYPE_ETHOFLD_TXQ, out_unlock_mqprio);
/* ETHOFLD RXQ and FLQ */ /* ETHOFLD RXQ and FLQ */
if (s->eohw_rxq) { if (s->eohw_rxq) {
for (i = 0; i < s->eoqsets; i++) for (i = 0; i < s->eoqsets; i++)
QDESC_GET_RXQ(&s->eohw_rxq[i].rspq, QDESC_GET_RXQ(&s->eohw_rxq[i].rspq,
CUDBG_QTYPE_ETHOFLD_RXQ, out); CUDBG_QTYPE_ETHOFLD_RXQ, out_unlock_mqprio);
for (i = 0; i < s->eoqsets; i++) for (i = 0; i < s->eoqsets; i++)
QDESC_GET_FLQ(&s->eohw_rxq[i].fl, QDESC_GET_FLQ(&s->eohw_rxq[i].fl,
CUDBG_QTYPE_ETHOFLD_FLQ, out); CUDBG_QTYPE_ETHOFLD_FLQ, out_unlock_mqprio);
} }
out_unlock: out_unlock_mqprio:
mutex_unlock(&uld_mutex); mutex_unlock(&padap->tc_mqprio->mqprio_mutex);
out: out:
qdesc_info->qdesc_entry_size = sizeof(*qdesc_entry); qdesc_info->qdesc_entry_size = sizeof(*qdesc_entry);
@@ -3559,6 +3565,10 @@ out_free:
#undef QDESC_GET #undef QDESC_GET
return rc; return rc;
out_unlock_uld:
mutex_unlock(&uld_mutex);
goto out;
} }
int cudbg_collect_flash(struct cudbg_init *pdbg_init, int cudbg_collect_flash(struct cudbg_init *pdbg_init,

View File

@@ -244,8 +244,8 @@ int mlxbf_gige_mdio_probe(struct platform_device *pdev, struct mlxbf_gige *priv)
} }
priv->clk_io = devm_ioremap(dev, res->start, resource_size(res)); priv->clk_io = devm_ioremap(dev, res->start, resource_size(res));
if (IS_ERR(priv->clk_io)) if (!priv->clk_io)
return PTR_ERR(priv->clk_io); return -ENOMEM;
mlxbf_gige_mdio_cfg(priv); mlxbf_gige_mdio_cfg(priv);

View File

@@ -3757,6 +3757,15 @@ static int stmmac_open(struct net_device *dev)
goto init_error; goto init_error;
} }
if (priv->plat->serdes_powerup) {
ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv);
if (ret < 0) {
netdev_err(priv->dev, "%s: Serdes powerup failed\n",
__func__);
goto init_error;
}
}
ret = stmmac_hw_setup(dev, true); ret = stmmac_hw_setup(dev, true);
if (ret < 0) { if (ret < 0) {
netdev_err(priv->dev, "%s: Hw setup failed\n", __func__); netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
@@ -3846,6 +3855,10 @@ static int stmmac_release(struct net_device *dev)
/* Disable the MAC Rx/Tx */ /* Disable the MAC Rx/Tx */
stmmac_mac_set(priv, priv->ioaddr, false); stmmac_mac_set(priv, priv->ioaddr, false);
/* Powerdown Serdes if there is */
if (priv->plat->serdes_powerdown)
priv->plat->serdes_powerdown(dev, priv->plat->bsp_priv);
netif_carrier_off(dev); netif_carrier_off(dev);
stmmac_release_ptp(priv); stmmac_release_ptp(priv);
@@ -7224,14 +7237,6 @@ int stmmac_dvr_probe(struct device *device,
goto error_netdev_register; goto error_netdev_register;
} }
if (priv->plat->serdes_powerup) {
ret = priv->plat->serdes_powerup(ndev,
priv->plat->bsp_priv);
if (ret < 0)
goto error_serdes_powerup;
}
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
stmmac_init_fs(ndev); stmmac_init_fs(ndev);
#endif #endif
@@ -7246,8 +7251,6 @@ int stmmac_dvr_probe(struct device *device,
return ret; return ret;
error_serdes_powerup:
unregister_netdev(ndev);
error_netdev_register: error_netdev_register:
phylink_destroy(priv->phylink); phylink_destroy(priv->phylink);
error_xpcs_setup: error_xpcs_setup:

View File

@@ -315,11 +315,13 @@ static __maybe_unused int mdio_bus_phy_resume(struct device *dev)
phydev->suspended_by_mdio_bus = 0; phydev->suspended_by_mdio_bus = 0;
/* If we manged to get here with the PHY state machine in a state neither /* If we managed to get here with the PHY state machine in a state
* PHY_HALTED nor PHY_READY this is an indication that something went wrong * neither PHY_HALTED, PHY_READY nor PHY_UP, this is an indication
* and we should most likely be using MAC managed PM and we are not. * that something went wrong and we should most likely be using
* MAC managed PM, but we are not.
*/ */
WARN_ON(phydev->state != PHY_HALTED && phydev->state != PHY_READY); WARN_ON(phydev->state != PHY_HALTED && phydev->state != PHY_READY &&
phydev->state != PHY_UP);
ret = phy_init_hw(phydev); ret = phy_init_hw(phydev);
if (ret < 0) if (ret < 0)

View File

@@ -1393,6 +1393,7 @@ static const struct usb_device_id products[] = {
{QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
{QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */
{QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */
{QMI_FIXED_INTF(0x413c, 0x81c2, 8)}, /* Dell Wireless 5811e */
{QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */ {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */
{QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */ {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */
{QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */ {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */

View File

@@ -1599,6 +1599,7 @@ void usbnet_disconnect (struct usb_interface *intf)
struct usbnet *dev; struct usbnet *dev;
struct usb_device *xdev; struct usb_device *xdev;
struct net_device *net; struct net_device *net;
struct urb *urb;
dev = usb_get_intfdata(intf); dev = usb_get_intfdata(intf);
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
@@ -1615,7 +1616,11 @@ void usbnet_disconnect (struct usb_interface *intf)
net = dev->net; net = dev->net;
unregister_netdev (net); unregister_netdev (net);
usb_scuttle_anchored_urbs(&dev->deferred); while ((urb = usb_get_from_anchor(&dev->deferred))) {
dev_kfree_skb(urb->context);
kfree(urb->sg);
usb_free_urb(urb);
}
if (dev->driver_info->unbind) if (dev->driver_info->unbind)
dev->driver_info->unbind(dev, intf); dev->driver_info->unbind(dev, intf);

View File

@@ -2056,14 +2056,14 @@ static int nvme_pr_preempt(struct block_device *bdev, u64 old, u64 new,
static int nvme_pr_clear(struct block_device *bdev, u64 key) static int nvme_pr_clear(struct block_device *bdev, u64 key)
{ {
u32 cdw10 = 1 | (key ? 1 << 3 : 0); u32 cdw10 = 1 | (key ? 0 : 1 << 3);
return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_register); return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release);
} }
static int nvme_pr_release(struct block_device *bdev, u64 key, enum pr_type type) static int nvme_pr_release(struct block_device *bdev, u64 key, enum pr_type type)
{ {
u32 cdw10 = nvme_pr_type(type) << 8 | (key ? 1 << 3 : 0); u32 cdw10 = nvme_pr_type(type) << 8 | (key ? 0 : 1 << 3);
return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release); return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release);
} }

View File

@@ -329,6 +329,7 @@ static int imx8mp_reset_set(struct reset_controller_dev *rcdev,
break; break;
case IMX8MP_RESET_PCIE_CTRL_APPS_EN: case IMX8MP_RESET_PCIE_CTRL_APPS_EN:
case IMX8MP_RESET_PCIEPHY_PERST:
value = assert ? 0 : bit; value = assert ? 0 : bit;
break; break;
} }

View File

@@ -78,8 +78,8 @@ static struct sunxi_sram_desc sun4i_a10_sram_d = {
static struct sunxi_sram_desc sun50i_a64_sram_c = { static struct sunxi_sram_desc sun50i_a64_sram_c = {
.data = SUNXI_SRAM_DATA("C", 0x4, 24, 1, .data = SUNXI_SRAM_DATA("C", 0x4, 24, 1,
SUNXI_SRAM_MAP(0, 1, "cpu"), SUNXI_SRAM_MAP(1, 0, "cpu"),
SUNXI_SRAM_MAP(1, 0, "de2")), SUNXI_SRAM_MAP(0, 1, "de2")),
}; };
static const struct of_device_id sunxi_sram_dt_ids[] = { static const struct of_device_id sunxi_sram_dt_ids[] = {
@@ -254,6 +254,7 @@ int sunxi_sram_claim(struct device *dev)
writel(val | ((device << sram_data->offset) & mask), writel(val | ((device << sram_data->offset) & mask),
base + sram_data->reg); base + sram_data->reg);
sram_desc->claimed = true;
spin_unlock(&sram_lock); spin_unlock(&sram_lock);
return 0; return 0;
@@ -329,12 +330,11 @@ static struct regmap_config sunxi_sram_emac_clock_regmap = {
.writeable_reg = sunxi_sram_regmap_accessible_reg, .writeable_reg = sunxi_sram_regmap_accessible_reg,
}; };
static int sunxi_sram_probe(struct platform_device *pdev) static int __init sunxi_sram_probe(struct platform_device *pdev)
{ {
struct resource *res;
struct dentry *d;
struct regmap *emac_clock; struct regmap *emac_clock;
const struct sunxi_sramc_variant *variant; const struct sunxi_sramc_variant *variant;
struct device *dev = &pdev->dev;
sram_dev = &pdev->dev; sram_dev = &pdev->dev;
@@ -342,18 +342,10 @@ static int sunxi_sram_probe(struct platform_device *pdev)
if (!variant) if (!variant)
return -EINVAL; return -EINVAL;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_platform_ioremap_resource(pdev, 0);
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
d = debugfs_create_file("sram", S_IRUGO, NULL, NULL,
&sunxi_sram_fops);
if (!d)
return -ENOMEM;
if (variant->num_emac_clocks > 0) { if (variant->num_emac_clocks > 0) {
emac_clock = devm_regmap_init_mmio(&pdev->dev, base, emac_clock = devm_regmap_init_mmio(&pdev->dev, base,
&sunxi_sram_emac_clock_regmap); &sunxi_sram_emac_clock_regmap);
@@ -362,6 +354,10 @@ static int sunxi_sram_probe(struct platform_device *pdev)
return PTR_ERR(emac_clock); return PTR_ERR(emac_clock);
} }
of_platform_populate(dev->of_node, NULL, NULL, dev);
debugfs_create_file("sram", 0444, NULL, NULL, &sunxi_sram_fops);
return 0; return 0;
} }
@@ -411,9 +407,8 @@ static struct platform_driver sunxi_sram_driver = {
.name = "sunxi-sram", .name = "sunxi-sram",
.of_match_table = sunxi_sram_dt_match, .of_match_table = sunxi_sram_dt_match,
}, },
.probe = sunxi_sram_probe,
}; };
module_platform_driver(sunxi_sram_driver); builtin_platform_driver_probe(sunxi_sram_driver, sunxi_sram_probe);
MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>"); MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>");
MODULE_DESCRIPTION("Allwinner sunXi SRAM Controller Driver"); MODULE_DESCRIPTION("Allwinner sunXi SRAM Controller Driver");

View File

@@ -1124,8 +1124,8 @@ static int rkvdec_h264_run(struct rkvdec_ctx *ctx)
schedule_delayed_work(&rkvdec->watchdog_work, msecs_to_jiffies(2000)); schedule_delayed_work(&rkvdec->watchdog_work, msecs_to_jiffies(2000));
writel(0xffffffff, rkvdec->regs + RKVDEC_REG_STRMD_ERR_EN); writel(0, rkvdec->regs + RKVDEC_REG_STRMD_ERR_EN);
writel(0xffffffff, rkvdec->regs + RKVDEC_REG_H264_ERR_E); writel(0, rkvdec->regs + RKVDEC_REG_H264_ERR_E);
writel(1, rkvdec->regs + RKVDEC_REG_PREF_LUMA_CACHE_COMMAND); writel(1, rkvdec->regs + RKVDEC_REG_PREF_LUMA_CACHE_COMMAND);
writel(1, rkvdec->regs + RKVDEC_REG_PREF_CHR_CACHE_COMMAND); writel(1, rkvdec->regs + RKVDEC_REG_PREF_CHR_CACHE_COMMAND);

View File

@@ -2281,6 +2281,7 @@ int tb_switch_configure(struct tb_switch *sw)
* additional capabilities. * additional capabilities.
*/ */
sw->config.cmuv = USB4_VERSION_1_0; sw->config.cmuv = USB4_VERSION_1_0;
sw->config.plug_events_delay = 0xa;
/* Enumerate the switch */ /* Enumerate the switch */
ret = tb_sw_write(sw, (u32 *)&sw->config + 1, TB_CFG_SWITCH, ret = tb_sw_write(sw, (u32 *)&sw->config + 1, TB_CFG_SWITCH,

View File

@@ -52,6 +52,13 @@ UNUSUAL_DEV(0x059f, 0x1061, 0x0000, 0x9999,
USB_SC_DEVICE, USB_PR_DEVICE, NULL, USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_NO_REPORT_OPCODES | US_FL_NO_SAME), US_FL_NO_REPORT_OPCODES | US_FL_NO_SAME),
/* Reported-by: Hongling Zeng <zenghongling@kylinos.cn> */
UNUSUAL_DEV(0x090c, 0x2000, 0x0000, 0x9999,
"Hiksemi",
"External HDD",
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_IGNORE_UAS),
/* /*
* Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI
* commands in UAS mode. Observed with the 1.28 firmware; are there others? * commands in UAS mode. Observed with the 1.28 firmware; are there others?
@@ -76,6 +83,13 @@ UNUSUAL_DEV(0x0bc2, 0x331a, 0x0000, 0x9999,
USB_SC_DEVICE, USB_PR_DEVICE, NULL, USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_NO_REPORT_LUNS), US_FL_NO_REPORT_LUNS),
/* Reported-by: Hongling Zeng <zenghongling@kylinos.cn> */
UNUSUAL_DEV(0x0bda, 0x9210, 0x0000, 0x9999,
"Hiksemi",
"External HDD",
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_IGNORE_UAS),
/* Reported-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> */ /* Reported-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> */
UNUSUAL_DEV(0x13fd, 0x3940, 0x0000, 0x9999, UNUSUAL_DEV(0x13fd, 0x3940, 0x0000, 0x9999,
"Initio Corporation", "Initio Corporation",
@@ -118,6 +132,13 @@ UNUSUAL_DEV(0x154b, 0xf00d, 0x0000, 0x9999,
USB_SC_DEVICE, USB_PR_DEVICE, NULL, USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_NO_ATA_1X), US_FL_NO_ATA_1X),
/* Reported-by: Hongling Zeng <zenghongling@kylinos.cn> */
UNUSUAL_DEV(0x17ef, 0x3899, 0x0000, 0x9999,
"Thinkplus",
"External HDD",
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
US_FL_IGNORE_UAS),
/* Reported-by: Hans de Goede <hdegoede@redhat.com> */ /* Reported-by: Hans de Goede <hdegoede@redhat.com> */
UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999, UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999,
"VIA", "VIA",

View File

@@ -515,8 +515,6 @@ static int ucsi_get_pdos(struct ucsi_connector *con, int is_partner,
num_pdos * sizeof(u32)); num_pdos * sizeof(u32));
if (ret < 0) if (ret < 0)
dev_err(ucsi->dev, "UCSI_GET_PDOS failed (%d)\n", ret); dev_err(ucsi->dev, "UCSI_GET_PDOS failed (%d)\n", ret);
if (ret == 0 && offset == 0)
dev_warn(ucsi->dev, "UCSI_GET_PDOS returned 0 bytes\n");
return ret; return ret;
} }

View File

@@ -327,7 +327,7 @@ u16 ifcvf_get_vq_state(struct ifcvf_hw *hw, u16 qid)
u32 q_pair_id; u32 q_pair_id;
ifcvf_lm = (struct ifcvf_lm_cfg __iomem *)hw->lm_cfg; ifcvf_lm = (struct ifcvf_lm_cfg __iomem *)hw->lm_cfg;
q_pair_id = qid / hw->nr_vring; q_pair_id = qid / 2;
avail_idx_addr = &ifcvf_lm->vring_lm_cfg[q_pair_id].idx_addr[qid % 2]; avail_idx_addr = &ifcvf_lm->vring_lm_cfg[q_pair_id].idx_addr[qid % 2];
last_avail_idx = ifc_ioread16(avail_idx_addr); last_avail_idx = ifc_ioread16(avail_idx_addr);
@@ -341,7 +341,7 @@ int ifcvf_set_vq_state(struct ifcvf_hw *hw, u16 qid, u16 num)
u32 q_pair_id; u32 q_pair_id;
ifcvf_lm = (struct ifcvf_lm_cfg __iomem *)hw->lm_cfg; ifcvf_lm = (struct ifcvf_lm_cfg __iomem *)hw->lm_cfg;
q_pair_id = qid / hw->nr_vring; q_pair_id = qid / 2;
avail_idx_addr = &ifcvf_lm->vring_lm_cfg[q_pair_id].idx_addr[qid % 2]; avail_idx_addr = &ifcvf_lm->vring_lm_cfg[q_pair_id].idx_addr[qid % 2];
hw->vring[qid].last_avail_idx = num; hw->vring[qid].last_avail_idx = num;
ifc_iowrite16(num, avail_idx_addr); ifc_iowrite16(num, avail_idx_addr);

View File

@@ -655,10 +655,15 @@ static void vduse_vdpa_get_config(struct vdpa_device *vdpa, unsigned int offset,
{ {
struct vduse_dev *dev = vdpa_to_vduse(vdpa); struct vduse_dev *dev = vdpa_to_vduse(vdpa);
if (offset > dev->config_size || /* Initialize the buffer in case of partial copy. */
len > dev->config_size - offset) memset(buf, 0, len);
if (offset > dev->config_size)
return; return;
if (len > dev->config_size - offset)
len = dev->config_size - offset;
memcpy(buf, dev->config + offset, len); memcpy(buf, dev->config + offset, len);
} }

View File

@@ -195,3 +195,27 @@ long splice_file_to_pipe(struct file *in,
struct pipe_inode_info *opipe, struct pipe_inode_info *opipe,
loff_t *offset, loff_t *offset,
size_t len, unsigned int flags); size_t len, unsigned int flags);
/*
* fs/xattr.c:
*/
struct xattr_name {
char name[XATTR_NAME_MAX + 1];
};
struct xattr_ctx {
/* Value of attribute */
union {
const void __user *cvalue;
void __user *value;
};
void *kvalue;
size_t size;
/* Attribute name */
struct xattr_name *kname;
unsigned int flags;
};
int setxattr_copy(const char __user *name, struct xattr_ctx *ctx);
int do_setxattr(struct user_namespace *mnt_userns, struct dentry *dentry,
struct xattr_ctx *ctx);

View File

@@ -2092,7 +2092,8 @@ get_ctx_vol_failed:
// TODO: Initialize security. // TODO: Initialize security.
/* Get the extended system files' directory inode. */ /* Get the extended system files' directory inode. */
vol->extend_ino = ntfs_iget(sb, FILE_Extend); vol->extend_ino = ntfs_iget(sb, FILE_Extend);
if (IS_ERR(vol->extend_ino) || is_bad_inode(vol->extend_ino)) { if (IS_ERR(vol->extend_ino) || is_bad_inode(vol->extend_ino) ||
!S_ISDIR(vol->extend_ino->i_mode)) {
if (!IS_ERR(vol->extend_ino)) if (!IS_ERR(vol->extend_ino))
iput(vol->extend_ino); iput(vol->extend_ino);
ntfs_error(sb, "Failed to load $Extend."); ntfs_error(sb, "Failed to load $Extend.");

View File

@@ -25,6 +25,8 @@
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include "internal.h"
static const char * static const char *
strcmp_prefix(const char *a, const char *a_prefix) strcmp_prefix(const char *a, const char *a_prefix)
{ {
@@ -539,44 +541,76 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
/* /*
* Extended attribute SET operations * Extended attribute SET operations
*/ */
static long
setxattr(struct user_namespace *mnt_userns, struct dentry *d, int setxattr_copy(const char __user *name, struct xattr_ctx *ctx)
const char __user *name, const void __user *value, size_t size,
int flags)
{ {
int error; int error;
void *kvalue = NULL;
char kname[XATTR_NAME_MAX + 1];
if (flags & ~(XATTR_CREATE|XATTR_REPLACE)) if (ctx->flags & ~(XATTR_CREATE|XATTR_REPLACE))
return -EINVAL; return -EINVAL;
error = strncpy_from_user(kname, name, sizeof(kname)); error = strncpy_from_user(ctx->kname->name, name,
if (error == 0 || error == sizeof(kname)) sizeof(ctx->kname->name));
error = -ERANGE; if (error == 0 || error == sizeof(ctx->kname->name))
return -ERANGE;
if (error < 0) if (error < 0)
return error; return error;
if (size) { error = 0;
if (size > XATTR_SIZE_MAX) if (ctx->size) {
if (ctx->size > XATTR_SIZE_MAX)
return -E2BIG; return -E2BIG;
kvalue = kvmalloc(size, GFP_KERNEL);
if (!kvalue) ctx->kvalue = vmemdup_user(ctx->cvalue, ctx->size);
return -ENOMEM; if (IS_ERR(ctx->kvalue)) {
if (copy_from_user(kvalue, value, size)) { error = PTR_ERR(ctx->kvalue);
error = -EFAULT; ctx->kvalue = NULL;
goto out;
} }
if ((strcmp(kname, XATTR_NAME_POSIX_ACL_ACCESS) == 0) ||
(strcmp(kname, XATTR_NAME_POSIX_ACL_DEFAULT) == 0))
posix_acl_fix_xattr_from_user(mnt_userns, d_inode(d),
kvalue, size);
} }
error = vfs_setxattr(mnt_userns, d, kname, kvalue, size, flags); return error;
out: }
kvfree(kvalue);
static void setxattr_convert(struct user_namespace *mnt_userns,
struct dentry *d, struct xattr_ctx *ctx)
{
if (ctx->size &&
((strcmp(ctx->kname->name, XATTR_NAME_POSIX_ACL_ACCESS) == 0) ||
(strcmp(ctx->kname->name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0)))
posix_acl_fix_xattr_from_user(mnt_userns, d_inode(d),
ctx->kvalue, ctx->size);
}
int do_setxattr(struct user_namespace *mnt_userns, struct dentry *dentry,
struct xattr_ctx *ctx)
{
setxattr_convert(mnt_userns, dentry, ctx);
return vfs_setxattr(mnt_userns, dentry, ctx->kname->name,
ctx->kvalue, ctx->size, ctx->flags);
}
static long
setxattr(struct user_namespace *mnt_userns, struct dentry *d,
const char __user *name, const void __user *value, size_t size,
int flags)
{
struct xattr_name kname;
struct xattr_ctx ctx = {
.cvalue = value,
.kvalue = NULL,
.size = size,
.kname = &kname,
.flags = flags,
};
int error;
error = setxattr_copy(name, &ctx);
if (error)
return error;
error = do_setxattr(mnt_userns, d, &ctx);
kvfree(ctx.kvalue);
return error; return error;
} }

View File

@@ -6035,17 +6035,23 @@ struct cgroup *cgroup_get_from_id(u64 id)
struct kernfs_node *kn; struct kernfs_node *kn;
struct cgroup *cgrp = NULL; struct cgroup *cgrp = NULL;
mutex_lock(&cgroup_mutex);
kn = kernfs_find_and_get_node_by_id(cgrp_dfl_root.kf_root, id); kn = kernfs_find_and_get_node_by_id(cgrp_dfl_root.kf_root, id);
if (!kn) if (!kn)
goto out_unlock; goto out;
cgrp = kn->priv; if (kernfs_type(kn) != KERNFS_DIR)
if (cgroup_is_dead(cgrp) || !cgroup_tryget(cgrp)) goto put;
rcu_read_lock();
cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv);
if (cgrp && !cgroup_tryget(cgrp))
cgrp = NULL; cgrp = NULL;
rcu_read_unlock();
put:
kernfs_put(kn); kernfs_put(kn);
out_unlock: out:
mutex_unlock(&cgroup_mutex);
return cgrp; return cgrp;
} }
EXPORT_SYMBOL_GPL(cgroup_get_from_id); EXPORT_SYMBOL_GPL(cgroup_get_from_id);
@@ -6599,30 +6605,34 @@ struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss)
* *
* Find the cgroup at @path on the default hierarchy, increment its * Find the cgroup at @path on the default hierarchy, increment its
* reference count and return it. Returns pointer to the found cgroup on * reference count and return it. Returns pointer to the found cgroup on
* success, ERR_PTR(-ENOENT) if @path doesn't exist and ERR_PTR(-ENOTDIR) * success, ERR_PTR(-ENOENT) if @path doesn't exist or if the cgroup has already
* if @path points to a non-directory. * been released and ERR_PTR(-ENOTDIR) if @path points to a non-directory.
*/ */
struct cgroup *cgroup_get_from_path(const char *path) struct cgroup *cgroup_get_from_path(const char *path)
{ {
struct kernfs_node *kn; struct kernfs_node *kn;
struct cgroup *cgrp; struct cgroup *cgrp = ERR_PTR(-ENOENT);
mutex_lock(&cgroup_mutex);
kn = kernfs_walk_and_get(cgrp_dfl_root.cgrp.kn, path); kn = kernfs_walk_and_get(cgrp_dfl_root.cgrp.kn, path);
if (kn) { if (!kn)
if (kernfs_type(kn) == KERNFS_DIR) { goto out;
cgrp = kn->priv;
cgroup_get_live(cgrp); if (kernfs_type(kn) != KERNFS_DIR) {
} else { cgrp = ERR_PTR(-ENOTDIR);
cgrp = ERR_PTR(-ENOTDIR); goto out_kernfs;
}
kernfs_put(kn);
} else {
cgrp = ERR_PTR(-ENOENT);
} }
mutex_unlock(&cgroup_mutex); rcu_read_lock();
cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv);
if (!cgrp || !cgroup_tryget(cgrp))
cgrp = ERR_PTR(-ENOENT);
rcu_read_unlock();
out_kernfs:
kernfs_put(kn);
out:
return cgrp; return cgrp;
} }
EXPORT_SYMBOL_GPL(cgroup_get_from_path); EXPORT_SYMBOL_GPL(cgroup_get_from_path);

View File

@@ -709,7 +709,18 @@ dma_addr_t swiotlb_map(struct device *dev, phys_addr_t paddr, size_t size,
size_t swiotlb_max_mapping_size(struct device *dev) size_t swiotlb_max_mapping_size(struct device *dev)
{ {
return ((size_t)IO_TLB_SIZE) * IO_TLB_SEGSIZE; int min_align_mask = dma_get_min_align_mask(dev);
int min_align = 0;
/*
* swiotlb_find_slots() skips slots according to
* min align mask. This affects max mapping size.
* Take it into acount here.
*/
if (min_align_mask)
min_align = roundup(min_align_mask, IO_TLB_SIZE);
return ((size_t)IO_TLB_SIZE) * IO_TLB_SEGSIZE - min_align;
} }
bool is_swiotlb_active(struct device *dev) bool is_swiotlb_active(struct device *dev)

View File

@@ -790,6 +790,7 @@ static int dbgfs_rm_context(char *name)
struct dentry *root, *dir, **new_dirs; struct dentry *root, *dir, **new_dirs;
struct damon_ctx **new_ctxs; struct damon_ctx **new_ctxs;
int i, j; int i, j;
int ret = 0;
if (damon_nr_running_ctxs()) if (damon_nr_running_ctxs())
return -EBUSY; return -EBUSY;
@@ -804,14 +805,16 @@ static int dbgfs_rm_context(char *name)
new_dirs = kmalloc_array(dbgfs_nr_ctxs - 1, sizeof(*dbgfs_dirs), new_dirs = kmalloc_array(dbgfs_nr_ctxs - 1, sizeof(*dbgfs_dirs),
GFP_KERNEL); GFP_KERNEL);
if (!new_dirs) if (!new_dirs) {
return -ENOMEM; ret = -ENOMEM;
goto out_dput;
}
new_ctxs = kmalloc_array(dbgfs_nr_ctxs - 1, sizeof(*dbgfs_ctxs), new_ctxs = kmalloc_array(dbgfs_nr_ctxs - 1, sizeof(*dbgfs_ctxs),
GFP_KERNEL); GFP_KERNEL);
if (!new_ctxs) { if (!new_ctxs) {
kfree(new_dirs); ret = -ENOMEM;
return -ENOMEM; goto out_new_dirs;
} }
for (i = 0, j = 0; i < dbgfs_nr_ctxs; i++) { for (i = 0, j = 0; i < dbgfs_nr_ctxs; i++) {
@@ -831,7 +834,13 @@ static int dbgfs_rm_context(char *name)
dbgfs_ctxs = new_ctxs; dbgfs_ctxs = new_ctxs;
dbgfs_nr_ctxs--; dbgfs_nr_ctxs--;
return 0; goto out_dput;
out_new_dirs:
kfree(new_dirs);
out_dput:
dput(dir);
return ret;
} }
static ssize_t dbgfs_rm_context_write(struct file *file, static ssize_t dbgfs_rm_context_write(struct file *file,

View File

@@ -442,8 +442,11 @@ regular_page:
continue; continue;
} }
/* Do not interfere with other mappings of this page */ /*
if (page_mapcount(page) != 1) * Do not interfere with other mappings of this page and
* non-LRU page.
*/
if (!PageLRU(page) || page_mapcount(page) != 1)
continue; continue;
VM_BUG_ON_PAGE(PageTransCompound(page), page); VM_BUG_ON_PAGE(PageTransCompound(page), page);

View File

@@ -700,6 +700,9 @@ static int kill_accessing_process(struct task_struct *p, unsigned long pfn,
}; };
priv.tk.tsk = p; priv.tk.tsk = p;
if (!p->mm)
return -EFAULT;
mmap_read_lock(p->mm); mmap_read_lock(p->mm);
ret = walk_page_range(p->mm, 0, TASK_SIZE, &hwp_walk_ops, ret = walk_page_range(p->mm, 0, TASK_SIZE, &hwp_walk_ops,
(void *)&priv); (void *)&priv);

View File

@@ -2424,13 +2424,14 @@ next:
migrate->dst[migrate->npages] = 0; migrate->dst[migrate->npages] = 0;
migrate->src[migrate->npages++] = mpfn; migrate->src[migrate->npages++] = mpfn;
} }
arch_leave_lazy_mmu_mode();
pte_unmap_unlock(ptep - 1, ptl);
/* Only flush the TLB if we actually modified any entries */ /* Only flush the TLB if we actually modified any entries */
if (unmapped) if (unmapped)
flush_tlb_range(walk->vma, start, end); flush_tlb_range(walk->vma, start, end);
arch_leave_lazy_mmu_mode();
pte_unmap_unlock(ptep - 1, ptl);
return 0; return 0;
} }

View File

@@ -4703,6 +4703,30 @@ void fs_reclaim_release(gfp_t gfp_mask)
EXPORT_SYMBOL_GPL(fs_reclaim_release); EXPORT_SYMBOL_GPL(fs_reclaim_release);
#endif #endif
/*
* Zonelists may change due to hotplug during allocation. Detect when zonelists
* have been rebuilt so allocation retries. Reader side does not lock and
* retries the allocation if zonelist changes. Writer side is protected by the
* embedded spin_lock.
*/
static DEFINE_SEQLOCK(zonelist_update_seq);
static unsigned int zonelist_iter_begin(void)
{
if (IS_ENABLED(CONFIG_MEMORY_HOTREMOVE))
return read_seqbegin(&zonelist_update_seq);
return 0;
}
static unsigned int check_retry_zonelist(unsigned int seq)
{
if (IS_ENABLED(CONFIG_MEMORY_HOTREMOVE))
return read_seqretry(&zonelist_update_seq, seq);
return seq;
}
/* Perform direct synchronous page reclaim */ /* Perform direct synchronous page reclaim */
static unsigned long static unsigned long
__perform_reclaim(gfp_t gfp_mask, unsigned int order, __perform_reclaim(gfp_t gfp_mask, unsigned int order,
@@ -5016,6 +5040,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
int compaction_retries; int compaction_retries;
int no_progress_loops; int no_progress_loops;
unsigned int cpuset_mems_cookie; unsigned int cpuset_mems_cookie;
unsigned int zonelist_iter_cookie;
int reserve_flags; int reserve_flags;
unsigned long alloc_start = jiffies; unsigned long alloc_start = jiffies;
/* /*
@@ -5026,11 +5051,12 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
(__GFP_ATOMIC|__GFP_DIRECT_RECLAIM))) (__GFP_ATOMIC|__GFP_DIRECT_RECLAIM)))
gfp_mask &= ~__GFP_ATOMIC; gfp_mask &= ~__GFP_ATOMIC;
retry_cpuset: restart:
compaction_retries = 0; compaction_retries = 0;
no_progress_loops = 0; no_progress_loops = 0;
compact_priority = DEF_COMPACT_PRIORITY; compact_priority = DEF_COMPACT_PRIORITY;
cpuset_mems_cookie = read_mems_allowed_begin(); cpuset_mems_cookie = read_mems_allowed_begin();
zonelist_iter_cookie = zonelist_iter_begin();
/* /*
* The fast path uses conservative alloc_flags to succeed only until * The fast path uses conservative alloc_flags to succeed only until
@@ -5189,9 +5215,13 @@ retry:
goto retry; goto retry;
/* Deal with possible cpuset update races before we start OOM killing */ /*
if (check_retry_cpuset(cpuset_mems_cookie, ac)) * Deal with possible cpuset update races or zonelist updates to avoid
goto retry_cpuset; * a unnecessary OOM kill.
*/
if (check_retry_cpuset(cpuset_mems_cookie, ac) ||
check_retry_zonelist(zonelist_iter_cookie))
goto restart;
/* Reclaim has failed us, start killing things */ /* Reclaim has failed us, start killing things */
page = __alloc_pages_may_oom(gfp_mask, order, ac, &did_some_progress); page = __alloc_pages_may_oom(gfp_mask, order, ac, &did_some_progress);
@@ -5211,9 +5241,13 @@ retry:
} }
nopage: nopage:
/* Deal with possible cpuset update races before we fail */ /*
if (check_retry_cpuset(cpuset_mems_cookie, ac)) * Deal with possible cpuset update races or zonelist updates to avoid
goto retry_cpuset; * a unnecessary OOM kill.
*/
if (check_retry_cpuset(cpuset_mems_cookie, ac) ||
check_retry_zonelist(zonelist_iter_cookie))
goto restart;
/* /*
* Make sure that __GFP_NOFAIL request doesn't leak out and make sure * Make sure that __GFP_NOFAIL request doesn't leak out and make sure
@@ -5693,6 +5727,18 @@ refill:
/* reset page count bias and offset to start of new frag */ /* reset page count bias and offset to start of new frag */
nc->pagecnt_bias = PAGE_FRAG_CACHE_MAX_SIZE + 1; nc->pagecnt_bias = PAGE_FRAG_CACHE_MAX_SIZE + 1;
offset = size - fragsz; offset = size - fragsz;
if (unlikely(offset < 0)) {
/*
* The caller is trying to allocate a fragment
* with fragsz > PAGE_SIZE but the cache isn't big
* enough to satisfy the request, this may
* happen in low memory conditions.
* We don't release the cache page because
* it could make memory pressure worse
* so we simply return NULL here.
*/
return NULL;
}
} }
nc->pagecnt_bias--; nc->pagecnt_bias--;
@@ -6494,9 +6540,8 @@ static void __build_all_zonelists(void *data)
int nid; int nid;
int __maybe_unused cpu; int __maybe_unused cpu;
pg_data_t *self = data; pg_data_t *self = data;
static DEFINE_SPINLOCK(lock);
spin_lock(&lock); write_seqlock(&zonelist_update_seq);
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
memset(node_load, 0, sizeof(node_load)); memset(node_load, 0, sizeof(node_load));
@@ -6529,7 +6574,7 @@ static void __build_all_zonelists(void *data)
#endif #endif
} }
spin_unlock(&lock); write_sequnlock(&zonelist_update_seq);
} }
static noinline void __init static noinline void __init

View File

@@ -283,7 +283,7 @@ static int secretmem_init(void)
secretmem_mnt = kern_mount(&secretmem_fs); secretmem_mnt = kern_mount(&secretmem_fs);
if (IS_ERR(secretmem_mnt)) if (IS_ERR(secretmem_mnt))
ret = PTR_ERR(secretmem_mnt); return PTR_ERR(secretmem_mnt);
/* prevent secretmem mappings from ever getting PROT_EXEC */ /* prevent secretmem mappings from ever getting PROT_EXEC */
secretmem_mnt->mnt_flags |= MNT_NOEXEC; secretmem_mnt->mnt_flags |= MNT_NOEXEC;

View File

@@ -5720,6 +5720,9 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
skb_reset_network_header(skb); skb_reset_network_header(skb);
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
if (local->hw.queues < IEEE80211_NUM_ACS)
goto start_xmit;
/* update QoS header to prioritize control port frames if possible, /* update QoS header to prioritize control port frames if possible,
* priorization also happens for control port frames send over * priorization also happens for control port frames send over
* AF_PACKET * AF_PACKET
@@ -5735,6 +5738,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
rcu_read_unlock(); rcu_read_unlock();
start_xmit:
/* mutex lock is only needed for incrementing the cookie counter */ /* mutex lock is only needed for incrementing the cookie counter */
mutex_lock(&local->mtx); mutex_lock(&local->mtx);

View File

@@ -1306,7 +1306,7 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla,
err = tcf_ct_flow_table_get(params); err = tcf_ct_flow_table_get(params);
if (err) if (err)
goto cleanup; goto cleanup_params;
spin_lock_bh(&c->tcf_lock); spin_lock_bh(&c->tcf_lock);
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch); goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
@@ -1321,6 +1321,9 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla,
return res; return res;
cleanup_params:
if (params->tmpl)
nf_ct_put(params->tmpl);
cleanup: cleanup:
if (goto_ch) if (goto_ch)
tcf_chain_put_by_act(goto_ch); tcf_chain_put_by_act(goto_ch);

View File

@@ -14,6 +14,7 @@
#include <sound/core.h> #include <sound/core.h>
#include <sound/hda_codec.h> #include <sound/hda_codec.h>
#include "hda_local.h" #include "hda_local.h"
#include "hda_jack.h"
/* /*
* find a matching codec id * find a matching codec id
@@ -156,9 +157,10 @@ static int hda_codec_driver_remove(struct device *dev)
return codec->bus->core.ext_ops->hdev_detach(&codec->core); return codec->bus->core.ext_ops->hdev_detach(&codec->core);
} }
refcount_dec(&codec->pcm_ref);
snd_hda_codec_disconnect_pcms(codec); snd_hda_codec_disconnect_pcms(codec);
wait_event(codec->remove_sleep, !refcount_read(&codec->pcm_ref)); snd_hda_jack_tbl_disconnect(codec);
if (!refcount_dec_and_test(&codec->pcm_ref))
wait_event(codec->remove_sleep, !refcount_read(&codec->pcm_ref));
snd_power_sync_ref(codec->bus->card); snd_power_sync_ref(codec->bus->card);
if (codec->patch_ops.free) if (codec->patch_ops.free)

View File

@@ -158,6 +158,17 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid, int dev_id)
return jack; return jack;
} }
void snd_hda_jack_tbl_disconnect(struct hda_codec *codec)
{
struct hda_jack_tbl *jack = codec->jacktbl.list;
int i;
for (i = 0; i < codec->jacktbl.used; i++, jack++) {
if (!codec->bus->shutdown && jack->jack)
snd_device_disconnect(codec->card, jack->jack);
}
}
void snd_hda_jack_tbl_clear(struct hda_codec *codec) void snd_hda_jack_tbl_clear(struct hda_codec *codec)
{ {
struct hda_jack_tbl *jack = codec->jacktbl.list; struct hda_jack_tbl *jack = codec->jacktbl.list;

View File

@@ -69,6 +69,7 @@ struct hda_jack_tbl *
snd_hda_jack_tbl_get_from_tag(struct hda_codec *codec, snd_hda_jack_tbl_get_from_tag(struct hda_codec *codec,
unsigned char tag, int dev_id); unsigned char tag, int dev_id);
void snd_hda_jack_tbl_disconnect(struct hda_codec *codec);
void snd_hda_jack_tbl_clear(struct hda_codec *codec); void snd_hda_jack_tbl_clear(struct hda_codec *codec);
void snd_hda_jack_set_dirty_all(struct hda_codec *codec); void snd_hda_jack_set_dirty_all(struct hda_codec *codec);

View File

@@ -162,6 +162,8 @@ struct hdmi_spec {
bool dyn_pin_out; bool dyn_pin_out;
bool dyn_pcm_assign; bool dyn_pcm_assign;
bool dyn_pcm_no_legacy; bool dyn_pcm_no_legacy;
bool nv_dp_workaround; /* workaround DP audio infoframe for Nvidia */
bool intel_hsw_fixup; /* apply Intel platform-specific fixups */ bool intel_hsw_fixup; /* apply Intel platform-specific fixups */
/* /*
* Non-generic VIA/NVIDIA specific * Non-generic VIA/NVIDIA specific
@@ -671,15 +673,24 @@ static void hdmi_pin_setup_infoframe(struct hda_codec *codec,
int ca, int active_channels, int ca, int active_channels,
int conn_type) int conn_type)
{ {
struct hdmi_spec *spec = codec->spec;
union audio_infoframe ai; union audio_infoframe ai;
memset(&ai, 0, sizeof(ai)); memset(&ai, 0, sizeof(ai));
if (conn_type == 0) { /* HDMI */ if ((conn_type == 0) || /* HDMI */
/* Nvidia DisplayPort: Nvidia HW expects same layout as HDMI */
(conn_type == 1 && spec->nv_dp_workaround)) {
struct hdmi_audio_infoframe *hdmi_ai = &ai.hdmi; struct hdmi_audio_infoframe *hdmi_ai = &ai.hdmi;
hdmi_ai->type = 0x84; if (conn_type == 0) { /* HDMI */
hdmi_ai->ver = 0x01; hdmi_ai->type = 0x84;
hdmi_ai->len = 0x0a; hdmi_ai->ver = 0x01;
hdmi_ai->len = 0x0a;
} else {/* Nvidia DP */
hdmi_ai->type = 0x84;
hdmi_ai->ver = 0x1b;
hdmi_ai->len = 0x11 << 2;
}
hdmi_ai->CC02_CT47 = active_channels - 1; hdmi_ai->CC02_CT47 = active_channels - 1;
hdmi_ai->CA = ca; hdmi_ai->CA = ca;
hdmi_checksum_audio_infoframe(hdmi_ai); hdmi_checksum_audio_infoframe(hdmi_ai);
@@ -3539,6 +3550,7 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec)
spec->pcm_playback.rates = SUPPORTED_RATES; spec->pcm_playback.rates = SUPPORTED_RATES;
spec->pcm_playback.maxbps = SUPPORTED_MAXBPS; spec->pcm_playback.maxbps = SUPPORTED_MAXBPS;
spec->pcm_playback.formats = SUPPORTED_FORMATS; spec->pcm_playback.formats = SUPPORTED_FORMATS;
spec->nv_dp_workaround = true;
return 0; return 0;
} }
@@ -3678,6 +3690,7 @@ static int patch_nvhdmi(struct hda_codec *codec)
spec->chmap.ops.chmap_cea_alloc_validate_get_type = spec->chmap.ops.chmap_cea_alloc_validate_get_type =
nvhdmi_chmap_cea_alloc_validate_get_type; nvhdmi_chmap_cea_alloc_validate_get_type;
spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate; spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate;
spec->nv_dp_workaround = true;
codec->link_down_at_suspend = 1; codec->link_down_at_suspend = 1;
@@ -3701,6 +3714,7 @@ static int patch_nvhdmi_legacy(struct hda_codec *codec)
spec->chmap.ops.chmap_cea_alloc_validate_get_type = spec->chmap.ops.chmap_cea_alloc_validate_get_type =
nvhdmi_chmap_cea_alloc_validate_get_type; nvhdmi_chmap_cea_alloc_validate_get_type;
spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate; spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate;
spec->nv_dp_workaround = true;
codec->link_down_at_suspend = 1; codec->link_down_at_suspend = 1;
@@ -3874,6 +3888,7 @@ static int patch_tegra_hdmi(struct hda_codec *codec)
spec->chmap.ops.chmap_cea_alloc_validate_get_type = spec->chmap.ops.chmap_cea_alloc_validate_get_type =
nvhdmi_chmap_cea_alloc_validate_get_type; nvhdmi_chmap_cea_alloc_validate_get_type;
spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate; spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate;
spec->nv_dp_workaround = true;
return 0; return 0;
} }

View File

@@ -6939,6 +6939,7 @@ enum {
ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME, ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
ALC285_FIXUP_LEGION_Y9000X_SPEAKERS, ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
}; };
/* A special fixup for Lenovo C940 and Yoga Duet 7; /* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -8753,6 +8754,16 @@ static const struct hda_fixup alc269_fixups[] = {
.chained = true, .chained = true,
.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
}, },
[ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
.type = HDA_FIXUP_VERBS,
.v.verbs = (const struct hda_verb[]) {
{ 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
{ 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
{ }
},
.chained = true,
.chain_id = ALC285_FIXUP_HP_MUTE_LED,
},
}; };
static const struct snd_pci_quirk alc269_fixup_tbl[] = { static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -8976,6 +8987,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED), SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),

View File

@@ -495,6 +495,8 @@ static struct snd_soc_dai_driver tas2770_dai_driver[] = {
}, },
}; };
static const struct regmap_config tas2770_i2c_regmap;
static int tas2770_codec_probe(struct snd_soc_component *component) static int tas2770_codec_probe(struct snd_soc_component *component)
{ {
struct tas2770_priv *tas2770 = struct tas2770_priv *tas2770 =
@@ -508,6 +510,7 @@ static int tas2770_codec_probe(struct snd_soc_component *component)
} }
tas2770_reset(tas2770); tas2770_reset(tas2770);
regmap_reinit_cache(tas2770->regmap, &tas2770_i2c_regmap);
return 0; return 0;
} }

View File

@@ -698,6 +698,10 @@ static int imx_card_parse_of(struct imx_card_data *data)
of_node_put(cpu); of_node_put(cpu);
of_node_put(codec); of_node_put(codec);
of_node_put(platform); of_node_put(platform);
cpu = NULL;
codec = NULL;
platform = NULL;
} }
return 0; return 0;

View File

@@ -330,7 +330,7 @@ static void test_extra_filter(const struct test_params p)
if (bind(fd1, addr, sockaddr_size())) if (bind(fd1, addr, sockaddr_size()))
error(1, errno, "failed to bind recv socket 1"); error(1, errno, "failed to bind recv socket 1");
if (!bind(fd2, addr, sockaddr_size()) && errno != EADDRINUSE) if (!bind(fd2, addr, sockaddr_size()) || errno != EADDRINUSE)
error(1, errno, "bind socket 2 should fail with EADDRINUSE"); error(1, errno, "bind socket 2 should fail with EADDRINUSE");
free(addr); free(addr);