drm/amdgpu/sriov:Correct pfvf exchange logic
Subsystems (7)
Sasha Levin
maintainerPATCH 1/28 drm/amdgpu/sriov:Correct pfvf exchange logic
From: Emily Deng <[email protected]>
[ Upstream commit b8cf66182eddb22e9c7539821ed6eecdb4f86d1a ]
The pfvf exchange need be in exclusive mode. And add pfvf exchange in gpu reset.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++---- drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 -4
@@ -1653,8 +1653,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)amdgpu_amdkfd_device_init (adev); -if (amdgpu_sriov_vf (adev)) +if (amdgpu_sriov_vf (adev)) { +amdgpu_virt_init_data_exchange (adev);amdgpu_virt_release_full_gpu (adev, true); + }return 0 ; }
@@ -2555,9 +2557,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, goto failed; } -if (amdgpu_sriov_vf (adev)) -amdgpu_virt_init_data_exchange (adev); -amdgpu_fbdev_init (adev); r =amdgpu_pm_sysfs_init (adev);
@@ -3269,6 +3268,7 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev, r =amdgpu_ib_ring_tests (adev); error: +amdgpu_virt_init_data_exchange (adev);amdgpu_virt_release_full_gpu (adev, true);if (!r && adev->virt.gim_feature &AMDGIM_FEATURE_GIM_FLR_VRAMLOST ) {atomic_inc (&adev->vram_lost_counter);
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +1 -1
@@ -174,7 +174,7 @@ static int xgpu_ai_send_access_requests(struct amdgpu_device *adev,return r; }/* Retrieve checksum from mailbox2 */ -if (req ==IDH_REQ_GPU_INIT_ACCESS ) { +if (req ==IDH_REQ_GPU_INIT_ACCESS || req ==IDH_REQ_GPU_RESET_ACCESS ) { adev->virt.fw_reserve.checksum_key =RREG32_NO_KIQ (SOC15_REG_OFFSET (NBIO ,0 , mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW2));
Signature · 6 lines
2.19.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Sasha Levin
maintainerPATCH 2/28 ACPI: NUMA: Use correct type for printing addresses on i386-PAE
From: Chao Fan <[email protected]>
[ Upstream commit b9ced18acf68dffebe6888c7ec765a2b1db7a039 ]
The addresses of NUMA nodes are not printed correctly on i386-PAE which is misleading.
Here is a debian9-32bit with PAE in a QEMU guest having more than 4G of memory:
qemu-system-i386 \
-hda /var/lib/libvirt/images/debian32.qcow2 \
-m 5G \
-enable-kvm \
-smp 10 \
-numa node,mem=512M,nodeid=0,cpus=0 \
-numa node,mem=512M,nodeid=1,cpus=1 \
-numa node,mem=512M,nodeid=2,cpus=2 \
-numa node,mem=512M,nodeid=3,cpus=3 \
-numa node,mem=512M,nodeid=4,cpus=4 \
-numa node,mem=512M,nodeid=5,cpus=5 \
-numa node,mem=512M,nodeid=6,cpus=6 \
-numa node,mem=512M,nodeid=7,cpus=7 \
-numa node,mem=512M,nodeid=8,cpus=8 \
-numa node,mem=512M,nodeid=9,cpus=9 \
-serial stdio
Because of the wrong value type, it prints as below:
[ 0.021049] ACPI: SRAT Memory (0x0 length 0xa0000) in proximity domain 0 enabled [ 0.021740] ACPI: SRAT Memory (0x100000 length 0x1ff00000) in proximity domain 0 enabled [ 0.022425] ACPI: SRAT Memory (0x20000000 length 0x20000000) in proximity domain 1 enabled [ 0.023092] ACPI: SRAT Memory (0x40000000 length 0x20000000) in proximity domain 2 enabled [ 0.023764] ACPI: SRAT Memory (0x60000000 length 0x20000000) in proximity domain 3 enabled [ 0.024431] ACPI: SRAT Memory (0x80000000 length 0x20000000) in proximity domain 4 enabled [ 0.025104] ACPI: SRAT Memory (0xa0000000 length 0x20000000) in proximity domain 5 enabled [ 0.025791] ACPI: SRAT Memory (0x0 length 0x20000000) in proximity domain 6 enabled [ 0.026412] ACPI: SRAT Memory (0x20000000 length 0x20000000) in proximity domain 7 enabled [ 0.027118] ACPI: SRAT Memory (0x40000000 length 0x20000000) in proximity domain 8 enabled [ 0.027802] ACPI: SRAT Memory (0x60000000 length 0x20000000) in proximity domain 9 enabled
The upper half of the start address of the NUMA domains between 6 and 9 inclusive was cut, so the printed values are incorrect.
Fix the value type, to get the correct values in the log as follows:
[ 0.023698] ACPI: SRAT Memory (0x0 length 0xa0000) in proximity domain 0 enabled [ 0.024325] ACPI: SRAT Memory (0x100000 length 0x1ff00000) in proximity domain 0 enabled [ 0.024981] ACPI: SRAT Memory (0x20000000 length 0x20000000) in proximity domain 1 enabled [ 0.025659] ACPI: SRAT Memory (0x40000000 length 0x20000000) in proximity domain 2 enabled [ 0.026317] ACPI: SRAT Memory (0x60000000 length 0x20000000) in proximity domain 3 enabled [ 0.026980] ACPI: SRAT Memory (0x80000000 length 0x20000000) in proximity domain 4 enabled [ 0.027635] ACPI: SRAT Memory (0xa0000000 length 0x20000000) in proximity domain 5 enabled [ 0.028311] ACPI: SRAT Memory (0x100000000 length 0x20000000) in proximity domain 6 enabled [ 0.028985] ACPI: SRAT Memory (0x120000000 length 0x20000000) in proximity domain 7 enabled [ 0.029667] ACPI: SRAT Memory (0x140000000 length 0x20000000) in proximity domain 8 enabled [ 0.030334] ACPI: SRAT Memory (0x160000000 length 0x20000000) in proximity domain 9 enabled
--- drivers/acpi/numa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/acpi/numa.c +3 -3
@@ -147,9 +147,9 @@ acpi_table_print_srat_entry(struct acpi_subtable_header *header) {struct acpi_srat_mem_affinity *p = (struct acpi_srat_mem_affinity *)header; - pr_debug("SRAT Memory (0x%lx length 0x%lx) in proximity domain %d %s%s%s\n", - (unsigned long)p->base_address, - (unsigned long)p->length, + pr_debug("SRAT Memory (0x%llx length 0x%llx) in proximity domain %d %s%s%s\n", + (unsigned long long)p->base_address, + (unsigned long long)p->length, p->proximity_domain, (p->flags & ACPI_SRAT_MEM_ENABLED) ? "enabled" : "disabled",
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 7/28 cpufreq: check if policy is inactive early in __cpufreq_get()
In reply to Sasha LevinFrom: Sudeep Holla <[email protected]>
[ Upstream commit 2f66196208c98b3d1b4294edffb2c5a8197be899 ]
cpuinfo_cur_freq gets current CPU frequency as detected by hardware while scaling_cur_freq last known CPU frequency. Some platforms may not allow checking the CPU frequency of an offline CPU or the associated resources may have been released via cpufreq_exit when the CPU gets offlined, in which case the policy would have been invalidated already. If we attempt to get current frequency from the hardware, it may result in hang or crash.
For example on Juno, I see:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000188 [0000000000000188] pgd=0000000000000000 Internal error: Oops: 96000004 [#1] PREEMPT SMP Modules linked in: CPU: 5 PID: 4202 Comm: cat Not tainted 4.20.0-08251-ga0f2c0318a15-dirty #87 Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform pstate: 40000005 (nZcv daif -PAN -UAO) pc : scmi_cpufreq_get_rate+0x34/0xb0 lr : scmi_cpufreq_get_rate+0x34/0xb0 Call trace: scmi_cpufreq_get_rate+0x34/0xb0 __cpufreq_get+0x34/0xc0 show_cpuinfo_cur_freq+0x24/0x78 show+0x40/0x60 sysfs_kf_seq_show+0xc0/0x148 kernfs_seq_show+0x44/0x50 seq_read+0xd4/0x480 kernfs_fop_read+0x15c/0x208 __vfs_read+0x60/0x188 vfs_read+0x94/0x150 ksys_read+0x6c/0xd8 __arm64_sys_read+0x24/0x30 el0_svc_common+0x78/0x100 el0_svc_handler+0x38/0x78 el0_svc+0x8/0xc ---[ end trace 3d1024e58f77f6b2 ]---
So fix the issue by checking if the policy is invalid early in __cpufreq_get before attempting to get the current frequency.
--- drivers/cpufreq/cpufreq.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/cpufreq/cpufreq.c +4 -8
@@ -1530,17 +1530,16 @@ static unsigned int __cpufreq_get(struct cpufreq_policy *policy) {unsigned int ret_freq =0 ; -if (!cpufreq_driver->get) +if (unlikely (policy_is_inactive (policy)) || !cpufreq_driver->get)return ret_freq; ret_freq = cpufreq_driver->get (policy->cpu);/* -* Updating inactive policies is invalid, so avoid doing that. Also -* if fast frequency switching is used with the given policy, the check +* If fast frequency switching is used with the given policy, the check * against policy->cur is pointless, so skip it in that case too. */ -if (unlikely (policy_is_inactive (policy)) || policy->fast_switch_enabled) +if (policy->fast_switch_enabled)return ret_freq; if (ret_freq && policy->cur &&
@@ -1569,10 +1568,7 @@ unsigned int cpufreq_get(unsigned int cpu)if (policy) {down_read (&policy->rwsem); - -if (!policy_is_inactive (policy)) - ret_freq =__cpufreq_get (policy); - + ret_freq =__cpufreq_get (policy);up_read (&policy->rwsem);cpufreq_cpu_put (policy);
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 9/28 drm/bridge: tc358767: add defines for DP1_SRCCTRL & PHY_2LANE
In reply to Sasha LevinFrom: Tomi Valkeinen <[email protected]>
[ Upstream commit adf4109896bbee27fd2ac3b48d22d6a0062fe517 ]
DP1_SRCCTRL register and PHY_2LANE field did not have matching defines. Add these.
--- drivers/gpu/drm/bridge/tc358767.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/tc358767.c +7 -3
@@ -142,6 +142,8 @@#define DP0_LTLOOPCTRL 0x06d8#define DP0_SNKLTCTRL 0x06e4 +#define DP1_SRCCTRL 0x07a0 +/* PHY */ #define DP_PHY_CTRL 0x0800#define DP_PHY_RST BIT(28)/* DP PHY Global Soft Reset */
@@ -150,6 +152,7 @@#define PHY_M1_RST BIT(12)/* Reset PHY1 Main Channel */ #define PHY_RDY BIT(16)/* PHY Main Channels Ready */ #define PHY_M0_RST BIT(8)/* Reset PHY0 Main Channel */ +#define PHY_2LANE BIT(2)/* PHY Enable 2 lanes */ #define PHY_A0_EN BIT(1)/* PHY Aux Channel0 Enable */ #define PHY_M0_EN BIT(0)/* PHY Main Channel0 Enable */
@@ -564,7 +567,7 @@ static int tc_aux_link_setup(struct tc_data *tc) value |=SYSCLK_SEL_LSCLK |LSCLK_DIV_2 ;tc_write (SYS_PLLPARAM , value); -tc_write (DP_PHY_CTRL ,BGREN |PWR_SW_EN |BIT (2 ) |PHY_A0_EN ); +tc_write (DP_PHY_CTRL ,BGREN |PWR_SW_EN |PHY_2LANE |PHY_A0_EN );/* * Initially PLLs are in bypass. Force PLL parameter update,
@@ -834,7 +837,7 @@ static int tc_main_link_setup(struct tc_data *tc)DP0_SRCCTRL_LANESKEW |DP0_SRCCTRL_LANES_2 | DP0_SRCCTRL_BW27 | DP0_SRCCTRL_AUTOCORRECT);/* from excel file - DP1_SrcCtrl */ -tc_write (0x07a0 ,0x00003083 ); +tc_write (DP1_SRCCTRL ,0x00003083 ); rate =clk_get_rate (tc->refclk);switch (rate) {
@@ -855,8 +858,9 @@ static int tc_main_link_setup(struct tc_data *tc) } value |=SYSCLK_SEL_LSCLK |LSCLK_DIV_2 ;tc_write (SYS_PLLPARAM , value); +/* Setup Main Link */ - dp_phy_ctrl =BGREN |PWR_SW_EN |BIT (2 ) |PHY_A0_EN |PHY_M0_EN ; + dp_phy_ctrl =BGREN |PWR_SW_EN |PHY_2LANE |PHY_A0_EN |PHY_M0_EN ;tc_write (DP_PHY_CTRL , dp_phy_ctrl);msleep (100 );
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 14/28 nvme-pci: use the same attributes when freeing host_mem_desc_bufs.
In reply to Sasha LevinFrom: Liviu Dudau <[email protected]>
[ Upstream commit cc667f6d5de023ee131e96bb88e5cddca23272bd ]
When using HMB the PCIe host driver allocates host_mem_desc_bufs using dma_alloc_attrs() but frees them using dma_free_coherent(). Use the correct dma_free_attrs() function to free the buffers.
--- drivers/nvme/host/pci.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/nvme/host/pci.c +6 -4
@@ -1727,8 +1727,9 @@ static void nvme_free_host_mem(struct nvme_dev *dev)struct nvme_host_mem_buf_desc *desc = &dev->host_mem_descs[i];size_t size =le32_to_cpu (desc->size) * dev->ctrl.page_size; -dma_free_coherent (dev->dev, size, dev->host_mem_desc_bufs[i], -le64_to_cpu (desc->addr)); +dma_free_attrs (dev->dev, size, dev->host_mem_desc_bufs[i], +le64_to_cpu (desc->addr), +DMA_ATTR_NO_KERNEL_MAPPING |DMA_ATTR_NO_WARN ); }kfree (dev->host_mem_desc_bufs);
@@ -1794,8 +1795,9 @@ static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,while (--i >=0 ) {size_t size =le32_to_cpu (descs[i].size) * dev->ctrl.page_size; -dma_free_coherent (dev->dev, size, bufs[i], -le64_to_cpu (descs[i].addr)); +dma_free_attrs (dev->dev, size, bufs[i], +le64_to_cpu (descs[i].addr), +DMA_ATTR_NO_KERNEL_MAPPING |DMA_ATTR_NO_WARN ); }kfree (bufs);
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 15/28 nvme-pci: fix out of bounds access in nvme_cqe_pending
In reply to Sasha LevinFrom: Hongbo Yao <[email protected]>
[ Upstream commit dcca1662727220d18fa351097ddff33f95f516c5 ]
There is an out of bounds array access in nvme_cqe_peding().
When enable irq_thread for nvme interrupt, there is racing between the nvmeq->cq_head updating and reading.
nvmeq->cq_head is updated in nvme_update_cq_head(), if nvmeq->cq_head equals nvmeq->q_depth and before its value set to zero, nvme_cqe_pending() uses its value as an array index, the index will be out of bounds.
--- drivers/nvme/host/pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/nvme/host/pci.c +3 -1
@@ -908,9 +908,11 @@ static void nvme_complete_cqes(struct nvme_queue *nvmeq, u16 start, u16 end)static inline void nvme_update_cq_head (struct nvme_queue *nvmeq) { -if (++nvmeq->cq_head == nvmeq->q_depth) { +if (nvmeq->cq_head == nvmeq->q_depth -1 ) { nvmeq->cq_head =0 ; nvmeq->cq_phase = !nvmeq->cq_phase; + }else { + nvmeq->cq_head++; } }
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 16/28 nvme-multipath: zero out ANA log buffer
In reply to Sasha LevinFrom: Hannes Reinecke <[email protected]>
[ Upstream commit c7055fd15ff46d92eb0dd1c16a4fe010d58224c8 ]
When nvme_init_identify() fails the ANA log buffer is deallocated but _not_ set to NULL. This can cause double free oops when this controller is deleted without ever being reconnected.
--- drivers/nvme/host/multipath.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvme/host/multipath.c +2 -0
@@ -556,6 +556,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)return 0 ; out_free_ana_log_buf:kfree (ctrl->ana_log_buf); + ctrl->ana_log_buf =NULL ; out:return error; }
@@ -563,5 +564,6 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)void nvme_mpath_uninit (struct nvme_ctrl *ctrl) {kfree (ctrl->ana_log_buf); + ctrl->ana_log_buf =NULL ; }
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 17/28 nvme: pad fake subsys NQN vid and ssvid with zeros
In reply to Sasha LevinFrom: Keith Busch <[email protected]>
[ Upstream commit 3da584f57133e51aeb84aaefae5e3d69531a1e4f ]
We need to preserve the leading zeros in the vid and ssvid when generating a unique NQN. Truncating these may lead to naming collisions.
--- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
@@ -2095,7 +2095,7 @@ static void nvme_init_subnqn(struct nvme_subsystem *subsys, struct nvme_ctrl *ct/* Generate a "fake" NQN per Figure 254 in NVMe 1.3 + ECN 001 */ off =snprintf (subsys->subnqn,NVMF_NQN_SIZE , -"nqn.2014.08.org.nvmexpress:%4x%4x" , +"nqn.2014.08.org.nvmexpress:%04x%04x" ,le16_to_cpu (id->vid),le16_to_cpu (id->ssvid));memcpy (subsys->subnqn + off, id->sn,sizeof (id->sn)); off +=sizeof (id->sn);
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 18/28 drm/amdgpu: set WRITE_BURST_LENGTH to 64B to workaround SDMA1 hang
In reply to Sasha LevinFrom: Jim Qu <[email protected]>
[ Upstream commit 0c6c8125582714e1fd3544983eba3d750db0f5b8 ]
effect asics: VEGA10 and VEGA12
--- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +2 -1
@@ -71,7 +71,6 @@ static const struct soc15_reg_golden golden_settings_sdma_4[] = {SOC15_REG_GOLDEN_VALUE (SDMA0 ,0 , mmSDMA0_RLC1_RB_WPTR_POLL_CNTL,0x0000fff0 ,0x00403000 ),SOC15_REG_GOLDEN_VALUE (SDMA0 ,0 , mmSDMA0_UTCL1_PAGE,0x000003ff ,0x000003c0 ),SOC15_REG_GOLDEN_VALUE (SDMA0 ,0 , mmSDMA0_UTCL1_WATERMK,0xfc000000 ,0x00000000 ), -SOC15_REG_GOLDEN_VALUE (SDMA1 ,0 , mmSDMA1_CHICKEN_BITS,0xfe931f07 ,0x02831f07 ),SOC15_REG_GOLDEN_VALUE (SDMA1 ,0 , mmSDMA1_CLK_CTRL,0xffffffff ,0x3f000100 ),SOC15_REG_GOLDEN_VALUE (SDMA1 ,0 , mmSDMA1_GFX_IB_CNTL,0x800f0100 ,0x00000100 ), SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GFX_RB_WPTR_POLL_CNTL, 0x0000fff0, 0x00403000),
@@ -89,6 +88,7 @@ static const struct soc15_reg_golden golden_settings_sdma_4[] = {static const struct soc15_reg_golden golden_settings_sdma_vg10[] = {SOC15_REG_GOLDEN_VALUE (SDMA0 ,0 , mmSDMA0_GB_ADDR_CONFIG,0x0018773f ,0x00104002 ),SOC15_REG_GOLDEN_VALUE (SDMA0 ,0 , mmSDMA0_GB_ADDR_CONFIG_READ,0x0018773f ,0x00104002 ), +SOC15_REG_GOLDEN_VALUE (SDMA1 ,0 , mmSDMA1_CHICKEN_BITS,0xfe931f07 ,0x02831d07 ),SOC15_REG_GOLDEN_VALUE (SDMA1 ,0 , mmSDMA1_GB_ADDR_CONFIG,0x0018773f ,0x00104002 ),SOC15_REG_GOLDEN_VALUE (SDMA1 ,0 , mmSDMA1_GB_ADDR_CONFIG_READ,0x0018773f ,0x00104002 ) };
@@ -96,6 +96,7 @@ static const struct soc15_reg_golden golden_settings_sdma_vg10[] = {static const struct soc15_reg_golden golden_settings_sdma_vg12[] = {SOC15_REG_GOLDEN_VALUE (SDMA0 ,0 , mmSDMA0_GB_ADDR_CONFIG,0x0018773f ,0x00104001 ),SOC15_REG_GOLDEN_VALUE (SDMA0 ,0 , mmSDMA0_GB_ADDR_CONFIG_READ,0x0018773f ,0x00104001 ), +SOC15_REG_GOLDEN_VALUE (SDMA1 ,0 , mmSDMA1_CHICKEN_BITS,0xfe931f07 ,0x02831d07 ),SOC15_REG_GOLDEN_VALUE (SDMA1 ,0 , mmSDMA1_GB_ADDR_CONFIG,0x0018773f ,0x00104001 ),SOC15_REG_GOLDEN_VALUE (SDMA1 ,0 , mmSDMA1_GB_ADDR_CONFIG_READ,0x0018773f ,0x00104001 ) };
Signature · 6 lines
2.19.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Sasha Levin
maintainerPATCH 19/28 ARM: dts: da850-evm: Correct the audio codec regulators
In reply to Sasha LevinFrom: Peter Ujfalusi <[email protected]>
[ Upstream commit 706edaa88835e3d8de8920584ad5da76dd3d6666 ]
Add the board level fixed regulators for 3.3V and 1.8V which is used to power - among other things - the tlv320aic3106 codec.
Apart from removing the following warning during boot:
tlv320aic3x-codec 0-0018: Too high supply voltage(s) AVDD: 5000000, DVDD: 5000000
With the correct voltages the driver can select correct OCMV value to reduce pop noise.
--- arch/arm/boot/dts/da850-evm.dts | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-)
arch/arm/boot/dts/da850-evm.dts +25 -4
@@ -94,6 +94,28 @@ regulator-boot-on; }; + baseboard_3v3: fixedregulator-3v3 { + /* TPS73701DCQ */ + compatible = "regulator-fixed"; + regulator-name = "baseboard_3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vbat>; + regulator-always-on; + regulator-boot-on; + }; + + baseboard_1v8: fixedregulator-1v8 { + /* TPS73701DCQ */ + compatible = "regulator-fixed"; + regulator-name = "baseboard_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&vbat>; + regulator-always-on; + regulator-boot-on; + }; + backlight_lcd: backlight-regulator { compatible = "regulator-fixed"; regulator-name = "lcd_backlight_pwr";
@@ -210,10 +232,9 @@ /* Regulators */ IOVDD-supply = <&vdcdc2_reg>; - /* Derived from VBAT: Baseboard 3.3V / 1.8V */ - AVDD-supply = <&vbat>; - DRVDD-supply = <&vbat>; - DVDD-supply = <&vbat>; + AVDD-supply = <&baseboard_3v3>; + DRVDD-supply = <&baseboard_3v3>; + DVDD-supply = <&baseboard_1v8>; }; tca6416: gpio@20 { compatible = "ti,tca6416";
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 20/28 ARM: dts: da850-evm: Correct the sound card name
In reply to Sasha LevinFrom: Peter Ujfalusi <[email protected]>
[ Upstream commit 7fca69d4e43fa1ae9cb4f652772c132dc5a659c6 ]
To avoid the following error:
asoc-simple-card sound: ASoC: Failed to create card debugfs directory
Which is because the card name contains '/' character, which can not be used in file or directory names.
--- arch/arm/boot/dts/da850-evm.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/da850-evm.dts +1 -1
@@ -127,7 +127,7 @@ sound { compatible = "simple-audio-card"; - simple-audio-card,name = "DA850/OMAP-L138 EVM"; + simple-audio-card,name = "DA850-OMAPL138 EVM"; simple-audio-card,widgets = "Line", "Line In", "Line", "Line Out";
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 21/28 ARM: dts: da850-lcdk: Correct the audio codec regulators
In reply to Sasha LevinFrom: Peter Ujfalusi <[email protected]>
[ Upstream commit bd540ebe68c3017194a1caa38e075bbbc0832749 ]
Add the board level fixed regulators for 3.3V and 1.8V which is used to power - among other things - the tlv320aic3106 codec.
Apart from removing the following warning during boot:
tlv320aic3x-codec 0-0018: Invalid supply voltage(s) AVDD: -22, DVDD: -22
With the correct voltages the driver can select correct OCMV value to reduce pop noise.
--- arch/arm/boot/dts/da850-lcdk.dts | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+)
arch/arm/boot/dts/da850-lcdk.dts +36 -0
@@ -39,6 +39,36 @@ }; }; + vcc_5vd: fixedregulator-vcc_5vd { + compatible = "regulator-fixed"; + regulator-name = "vcc_5vd"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + }; + + vcc_3v3d: fixedregulator-vcc_3v3d { + /* TPS650250 - VDCDC1 */ + compatible = "regulator-fixed"; + regulator-name = "vcc_3v3d"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc_5vd>; + regulator-always-on; + regulator-boot-on; + }; + + vcc_1v8d: fixedregulator-vcc_1v8d { + /* TPS650250 - VDCDC2 */ + compatible = "regulator-fixed"; + regulator-name = "vcc_1v8d"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&vcc_5vd>; + regulator-always-on; + regulator-boot-on; + }; + sound { compatible = "simple-audio-card"; simple-audio-card,name = "DA850/OMAP-L138 LCDK";
@@ -221,6 +251,12 @@ compatible = "ti,tlv320aic3106"; reg = <0x18>; status = "okay"; + + /* Regulators */ + IOVDD-supply = <&vcc_3v3d>; + AVDD-supply = <&vcc_3v3d>; + DRVDD-supply = <&vcc_3v3d>; + DVDD-supply = <&vcc_1v8d>; }; };
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 22/28 ARM: dts: da850-lcdk: Correct the sound card name
In reply to Sasha LevinFrom: Peter Ujfalusi <[email protected]>
[ Upstream commit c25748acc5c20786ecb7518bfeae8fcef93472d6 ]
To avoid the following error:
asoc-simple-card sound: ASoC: Failed to create card debugfs directory
Which is because the card name contains '/' character, which can not be used in file or directory names.
--- arch/arm/boot/dts/da850-lcdk.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/da850-lcdk.dts +1 -1
@@ -71,7 +71,7 @@ sound { compatible = "simple-audio-card"; - simple-audio-card,name = "DA850/OMAP-L138 LCDK"; + simple-audio-card,name = "DA850-OMAPL138 LCDK"; simple-audio-card,widgets = "Line", "Line In", "Line", "Line Out";
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 23/28 ARM: dts: kirkwood: Fix polarity of GPIO fan lines
In reply to Sasha LevinFrom: Linus Walleij <[email protected]>
[ Upstream commit b5f034845e70916fd33e172fad5ad530a29c10ab ]
These two lines are active high, not active low. The bug was found when we changed the kernel to respect the polarity defined in the device tree.
--- arch/arm/boot/dts/kirkwood-dnskw.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/kirkwood-dnskw.dtsi +2 -2
@@ -36,8 +36,8 @@ compatible = "gpio-fan"; pinctrl-0 = <&pmx_fan_high_speed &pmx_fan_low_speed>; pinctrl-names = "default"; - gpios = <&gpio1 14 GPIO_ACTIVE_LOW - &gpio1 13 GPIO_ACTIVE_LOW>; + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH + &gpio1 13 GPIO_ACTIVE_HIGH>; gpio-fan,speed-map = <0 0 3000 1 6000 2>;
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 25/28 drm/nouveau: Don't disable polling in fallback mode
In reply to Sasha LevinFrom: Takashi Iwai <[email protected]>
[ Upstream commit 118780066e30c34de3d9349710b51780bfa0ba83 ]
When a fan is controlled via linear fallback without cstate, we shouldn't stop polling. Otherwise it won't be adjusted again and keeps running at an initial crazy pace.
Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1103356
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107447
--- drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +4 -3
@@ -132,11 +132,12 @@ nvkm_therm_update(struct nvkm_therm *therm, int mode) duty =nvkm_therm_update_linear (therm);break ;case NVBIOS_THERM_FAN_OTHER : -if (therm->cstate) +if (therm->cstate) { duty = therm->cstate; -else + poll = false; + }else { duty =nvkm_therm_update_linear_fallback (therm); - poll = false; + }break ; } immd = false;
Signature · 6 lines
2.19.1 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
Sasha Levin
maintainerPATCH 26/28 drm/nouveau/falcon: avoid touching registers if engine is off
In reply to Sasha LevinFrom: Ilia Mirkin <[email protected]>
[ Upstream commit a5176a4cb85bb6213daadf691097cf411da35df2 ]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108980
--- drivers/gpu/drm/nouveau/nvkm/engine/falcon.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/falcon.c +5 -2
@@ -22,6 +22,7 @@#include <engine/falcon.h> #include <core/gpuobj.h> +#include <subdev/mc.h> #include <subdev/timer.h> #include <engine/fifo.h>
@@ -107,8 +108,10 @@ nvkm_falcon_fini(struct nvkm_engine *engine, bool suspend) } } -nvkm_mask (device, base +0x048 ,0x00000003 ,0x00000000 ); -nvkm_wr32 (device, base +0x014 ,0xffffffff ); +if (nvkm_mc_enabled (device, engine->subdev.index)) { +nvkm_mask (device, base +0x048 ,0x00000003 ,0x00000000 ); +nvkm_wr32 (device, base +0x014 ,0xffffffff ); + }return 0 ; }
Signature · 6 lines
2.19.1 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
Sasha Levin
maintainerPATCH 27/28 cifs: Limit memory used by lock request calls to a page
In reply to Sasha LevinFrom: Ross Lagerwall <[email protected]>
[ Upstream commit 92a8109e4d3a34fb6b115c9098b51767dc933444 ]
The code tries to allocate a contiguous buffer with a size supplied by the server (maxBuf). This could fail if memory is fragmented since it results in high order allocations for commonly used server implementations. It is also wasteful since there are probably few locks in the usual case. Limit the buffer to be no larger than a page to avoid memory allocation failures due to fragmentation.
--- fs/cifs/file.c | 8 ++++++++ fs/cifs/smb2file.c | 4 ++++ 2 files changed, 12 insertions(+)
fs/cifs/file.c +8 -0
@@ -1128,6 +1128,10 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)return -EINVAL ; } +BUILD_BUG_ON (sizeof (struct smb_hdr ) +sizeof (LOCKING_ANDX_RANGE ) > +PAGE_SIZE ); + max_buf = min_t(unsigned int, max_buf - sizeof(struct smb_hdr), +PAGE_SIZE ); max_num = (max_buf -sizeof (struct smb_hdr )) /sizeof (LOCKING_ANDX_RANGE ); buf =kcalloc (max_num,sizeof (LOCKING_ANDX_RANGE ),GFP_KERNEL );
@@ -1466,6 +1470,10 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,if (max_buf < (sizeof (struct smb_hdr ) +sizeof (LOCKING_ANDX_RANGE )))return -EINVAL ; +BUILD_BUG_ON (sizeof (struct smb_hdr ) +sizeof (LOCKING_ANDX_RANGE ) > +PAGE_SIZE ); + max_buf = min_t(unsigned int, max_buf - sizeof(struct smb_hdr), +PAGE_SIZE ); max_num = (max_buf -sizeof (struct smb_hdr )) /sizeof (LOCKING_ANDX_RANGE ); buf =kcalloc (max_num,sizeof (LOCKING_ANDX_RANGE ),GFP_KERNEL );
fs/cifs/smb2file.c +4 -0
@@ -128,6 +128,8 @@ smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,if (max_buf <sizeof (struct smb2_lock_element ))return -EINVAL ; +BUILD_BUG_ON (sizeof (struct smb2_lock_element ) >PAGE_SIZE ); + max_buf = min_t(unsigned int, max_buf, PAGE_SIZE); max_num = max_buf /sizeof (struct smb2_lock_element ); buf =kcalloc (max_num,sizeof (struct smb2_lock_element ),GFP_KERNEL );if (!buf)
@@ -264,6 +266,8 @@ smb2_push_mandatory_locks(struct cifsFileInfo *cfile)return -EINVAL ; } +BUILD_BUG_ON (sizeof (struct smb2_lock_element ) >PAGE_SIZE ); + max_buf = min_t(unsigned int, max_buf, PAGE_SIZE); max_num = max_buf /sizeof (struct smb2_lock_element ); buf =kcalloc (max_num,sizeof (struct smb2_lock_element ),GFP_KERNEL );if (!buf) {
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 28/28 kvm: sev: Fail KVM_SEV_INIT if already initialized
In reply to Sasha LevinFrom: David Rientjes <[email protected]>
[ Upstream commit 3f14a89d1132dcae3c8ce6721c6ef51f6e6d9b5f ]
By code inspection, it was found that multiple calls to KVM_SEV_INIT could deplete asid bits and overwrite kvm_sev_info's regions_list.
Multiple calls to KVM_SVM_INIT is not likely to occur with QEMU, but this should likely be fixed anyway.
This code is serialized by kvm->lock.
--- arch/x86/kvm/svm.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kvm/svm.c +3 -0
@@ -6249,6 +6249,9 @@ static int sev_guest_init(struct kvm *kvm, struct kvm_sev_cmd *argp)int asid, ret; ret = -EBUSY ; +if (unlikely (sev->active)) +return ret; + asid =sev_asid_new ();if (asid <0 )return ret;
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 4/28 perf test shell: Use a fallback to get the pathname in vfs_getname
In reply to Sasha LevinFrom: Arnaldo Carvalho de Melo <[email protected]>
[ Upstream commit 03fa483821c0b4db7c2b1453d3332f397d82313f ]
Some kernels, like 4.19.13-300.fc29.x86_64 in fedora 29, fail with the existing probe definition asking for the contents of result->name, working when we ask for the 'filename' variable instead, so add a fallback to that.
Now those tests are back working on fedora 29 systems with that kernel:
# perf test vfs_getname 65: Use vfs_getname probe to get syscall args filenames : Ok 66: Add vfs_getname probe to get syscall args filenames : Ok 67: Check open filename arg using perf trace + vfs_getname: Ok #
--- tools/perf/tests/shell/lib/probe_vfs_getname.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/tests/shell/lib/probe_vfs_getname.sh +2 -1
@@ -13,7 +13,8 @@ add_probe_vfs_getname() { local verbose=$1 if [ $had_vfs_getname -eq 1 ] ; then line=$(perf probe -L getname_flags 2>&1 | egrep 'result.*=.*filename;' | sed -r 's/[[:space:]]+([[:digit:]]+)[[:space:]]+result->uptr.*/\1/') - perf probe $verbose "vfs_getname=getname_flags:${line} pathname=result->name:string" + perf probe -q "vfs_getname=getname_flags:${line} pathname=result->name:string" || \ + perf probe $verbose "vfs_getname=getname_flags:${line} pathname=filename:string" fi }
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 3/28 perf report: Fix wrong iteration count in --branch-history
In reply to Sasha LevinFrom: Jin Yao <[email protected]>
[ Upstream commit a3366db06bb656cef2e03f30f780d93059bcc594 ]
By calculating the removed loops, we can get the iteration count.
But the iteration count could be reported incorrectly, reporting impossibly high counts.
That's because previous code uses the number of removed LBR entries for the iteration count. That's not good. Fix this by increasing the iteration count when a loop is detected.
When matching the chain, the iteration count would be added up, finally we need to compute the average value when printing out.
For example,
$ perf report --branch-history --stdio --no-children
Before:
---f2 +0
|
|--33.62%--f1 +9 (cycles:1)
| f1 +0
| main +22 (cycles:1)
| main +17
| main +38 (cycles:1)
| main +27
| f1 +26 (cycles:1)
| f1 +24
| f2 +27 (cycles:7)
| f2 +0
| f1 +19 (cycles:1)
| f1 +14
| f2 +27 (cycles:11)
| f2 +0
| f1 +9 (cycles:1 iter:2968 avg_cycles:3)
| f1 +0
| main +22 (cycles:1 iter:2968 avg_cycles:3)
| main +17
| main +38 (cycles:1 iter:2968 avg_cycles:3)2968 is an impossible high iteration count and avg_cycles is too small.
After:
---f2 +0
|
|--33.62%--f1 +9 (cycles:1)
| f1 +0
| main +22 (cycles:1)
| main +17
| main +38 (cycles:1)
| main +27
| f1 +26 (cycles:1)
| f1 +24
| f2 +27 (cycles:7)
| f2 +0
| f1 +19 (cycles:1)
| f1 +14
| f2 +27 (cycles:11)
| f2 +0
| f1 +9 (cycles:1 iter:1 avg_cycles:23)
| f1 +0
| main +22 (cycles:1 iter:1 avg_cycles:23)
| main +17
| main +38 (cycles:1 iter:1 avg_cycles:23)avg_cycles:23 is the average cycles of this iteration.
--- tools/perf/util/callchain.c | 32 ++++++++++++++++++++------------ tools/perf/util/callchain.h | 1 + tools/perf/util/machine.c | 2 +- 3 files changed, 22 insertions(+), 13 deletions(-)
tools/perf/util/callchain.c +20 -12
@@ -766,6 +766,7 @@ static enum match_result match_chain(struct callchain_cursor_node *node, cnode->cycles_count += node->branch_flags.cycles; cnode->iter_count += node->nr_loop_iter; cnode->iter_cycles += node->iter_cycles; + cnode->from_count++; } }
@@ -1345,10 +1346,10 @@ static int branch_to_str(char *bf, int bfsize,static int branch_from_str (char *bf,int bfsize,u64 branch_count,u64 cycles_count,u64 iter_count, -u64 iter_cycles) +u64 iter_cycles,u64 from_count) {int printed =0 , i =0 ; -u64 cycles; +u64 cycles, v =0 ; cycles = cycles_count / branch_count;if (cycles) {
@@ -1357,14 +1358,16 @@ static int branch_from_str(char *bf, int bfsize, bf + printed, bfsize - printed); } -if (iter_count) { - printed +=count_pri64_printf (i++,"iter" , - iter_count, - bf + printed, bfsize - printed); +if (iter_count && from_count) { + v = iter_count / from_count; +if (v) { + printed +=count_pri64_printf (i++,"iter" , + v, bf + printed, bfsize - printed); - printed +=count_pri64_printf (i++,"avg_cycles" , - iter_cycles / iter_count, - bf + printed, bfsize - printed); + printed +=count_pri64_printf (i++,"avg_cycles" , + iter_cycles / iter_count, + bf + printed, bfsize - printed); + } }if (i)
@@ -1377,6 +1380,7 @@ static int counts_str_build(char *bf, int bfsize, u64 branch_count, u64 predicted_count, u64 abort_count, u64 cycles_count, u64 iter_count, u64 iter_cycles, + u64 from_count, struct branch_type_stat *brtype_stat) { int printed;
@@ -1389,7 +1393,8 @@ static int counts_str_build(char *bf, int bfsize, predicted_count, abort_count, brtype_stat); }else { printed =branch_from_str (bf, bfsize, branch_count, - cycles_count, iter_count, iter_cycles); + cycles_count, iter_count, iter_cycles, + from_count); }if (!printed)
@@ -1402,13 +1407,14 @@ static int callchain_counts_printf(FILE *fp, char *bf, int bfsize, u64 branch_count, u64 predicted_count, u64 abort_count, u64 cycles_count, u64 iter_count, u64 iter_cycles, + u64 from_count, struct branch_type_stat *brtype_stat) { char str[256];counts_str_build (str,sizeof (str), branch_count, predicted_count, abort_count, cycles_count, - iter_count, iter_cycles, brtype_stat); + iter_count, iter_cycles, from_count, brtype_stat);if (fp)return fprintf (fp,"%s" , str);
@@ -1422,6 +1428,7 @@ int callchain_list_counts__printf_value(struct callchain_list *clist,u64 branch_count, predicted_count;u64 abort_count, cycles_count;u64 iter_count, iter_cycles; +u64 from_count; branch_count = clist->branch_count; predicted_count = clist->predicted_count;
@@ -1429,11 +1436,12 @@ int callchain_list_counts__printf_value(struct callchain_list *clist, cycles_count = clist->cycles_count; iter_count = clist->iter_count; iter_cycles = clist->iter_cycles; + from_count = clist->from_count;return callchain_counts_printf (fp, bf, bfsize, branch_count, predicted_count, abort_count, cycles_count, iter_count, iter_cycles, - &clist->brtype_stat); + from_count, &clist->brtype_stat); }static void free_callchain_node (struct callchain_node *node)
tools/perf/util/callchain.h +1 -0
@@ -118,6 +118,7 @@ struct callchain_list {bool has_children; };u64 branch_count; +u64 from_count;u64 predicted_count;u64 abort_count;u64 cycles_count;
tools/perf/util/machine.c +1 -1
@@ -1988,7 +1988,7 @@ static void save_iterations(struct iterations *iter, {int i; - iter->nr_loop_iter = nr; + iter->nr_loop_iter++; iter->cycles =0 ;for (i =0 ; i < nr; i++)
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 8/28 drm/bridge: tc358767: add bus flags
In reply to Sasha LevinFrom: Tomi Valkeinen <[email protected]>
[ Upstream commit 4842379cbe6e851de914a7132f76f4e200b9a98b ]
tc358767 driver does not set DRM bus_flags, even if it does configures the polarity settings into its registers. This means that the DPI source can't configure the polarities correctly.
Add sync flags accordingly.
--- drivers/gpu/drm/bridge/tc358767.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/bridge/tc358767.c +4 -0
@@ -1195,6 +1195,10 @@ static int tc_bridge_attach(struct drm_bridge *bridge)drm_display_info_set_bus_formats (&tc->connector.display_info, &bus_format,1 ); + tc->connector.display_info.bus_flags = +DRM_BUS_FLAG_DE_HIGH | +DRM_BUS_FLAG_PIXDATA_NEGEDGE | +DRM_BUS_FLAG_SYNC_NEGEDGE ;drm_connector_attach_encoder (&tc->connector, tc->bridge.encoder);return 0 ;
Signature · 6 lines
2.19.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 5/28 tools uapi: fix RISC-V 64-bit support
In reply to Sasha LevinFrom: Aurelien Jarno <[email protected]>
[ Upstream commit d0df00e30e4bf9bc27ddbd092ad683ff6121b360 ]
The BPF library is not built on 64-bit RISC-V, as the BPF feature is not detected. Looking more in details, feature/test-bpf.c fails to build with the following error:
| In file included from /tmp/linux-4.19.12/tools/include/uapi/asm/bitsperlong.h:17, | from /tmp/linux-4.19.12/tools/include/uapi/asm-generic/unistd.h:2, | from /usr/include/riscv64-linux-gnu/asm/unistd.h:1, | from test-bpf.c:2: | /tmp/linux-4.19.12/tools/include/asm-generic/bitsperlong.h:14:2: error: #error Inconsistent word size. Check asm/bitsperlong.h | #error Inconsistent word size. Check asm/bitsperlong.h | ^~~~~
The UAPI from the tools directory is missing RISC-V support, therefore bitsperlong.h from asm-generic is used, defaulting to 32 bits.
Fix that by adding tools/arch/riscv/include/uapi/asm/bitsperlong.h as a copy of arch/riscv/include/uapi/asm/bitsperlong.h and by updating tools/include/uapi/asm/bitsperlong.h.
--- .../arch/riscv/include/uapi/asm/bitsperlong.h | 25 +++++++++++++++++++ tools/include/uapi/asm/bitsperlong.h | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 tools/arch/riscv/include/uapi/asm/bitsperlong.h
tools/arch/riscv/include/uapi/asm/bitsperlong.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* Copyright (C) 2012 ARM Ltd. +* Copyright (C) 2015 Regents of the University of California +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef _UAPI_ASM_RISCV_BITSPERLONG_H +#define _UAPI_ASM_RISCV_BITSPERLONG_H + +#define __BITS_PER_LONG (__SIZEOF_POINTER__ * 8) + +#include <asm-generic/bitsperlong.h> + +#endif /* _UAPI_ASM_RISCV_BITSPERLONG_H */
tools/include/uapi/asm/bitsperlong.h +2 -0
@@ -13,6 +13,8 @@#include "../../arch/mips/include/uapi/asm/bitsperlong.h" #elif defined(__ia64__)#include "../../arch/ia64/include/uapi/asm/bitsperlong.h" +#elif defined(__riscv) +#include "../../arch/riscv/include/uapi/asm/bitsperlong.h" #else #include <asm-generic/bitsperlong.h> #endif
Signature · 7 lines
2.19.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Sasha Levin
maintainerPATCH 10/28 drm/bridge: tc358767: fix single lane configuration
In reply to Sasha LevinFrom: Tomi Valkeinen <[email protected]>
[ Upstream commit 4d9d54a730434cc068dd3515ba6116697196f77b ]
PHY_2LANE bit is always set in DP_PHY_CTRL, breaking 1 lane use.
Set PHY_2LANE only when 2 lanes are used.
--- drivers/gpu/drm/bridge/tc358767.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/tc358767.c +8 -2
@@ -543,6 +543,7 @@ static int tc_aux_link_setup(struct tc_data *tc)unsigned long rate;u32 value;int ret; +u32 dp_phy_ctrl; rate =clk_get_rate (tc->refclk);switch (rate) {
@@ -567,7 +568,10 @@ static int tc_aux_link_setup(struct tc_data *tc) value |=SYSCLK_SEL_LSCLK |LSCLK_DIV_2 ;tc_write (SYS_PLLPARAM , value); -tc_write (DP_PHY_CTRL ,BGREN |PWR_SW_EN |PHY_2LANE |PHY_A0_EN ); + dp_phy_ctrl =BGREN |PWR_SW_EN |PHY_A0_EN ; +if (tc->link.base.num_lanes ==2 ) + dp_phy_ctrl |=PHY_2LANE ; +tc_write (DP_PHY_CTRL , dp_phy_ctrl);/* * Initially PLLs are in bypass. Force PLL parameter update,
@@ -860,7 +864,9 @@ static int tc_main_link_setup(struct tc_data *tc)tc_write (SYS_PLLPARAM , value);/* Setup Main Link */ - dp_phy_ctrl =BGREN |PWR_SW_EN |PHY_2LANE |PHY_A0_EN |PHY_M0_EN ; + dp_phy_ctrl =BGREN |PWR_SW_EN |PHY_A0_EN |PHY_M0_EN ; +if (tc->link.base.num_lanes ==2 ) + dp_phy_ctrl |=PHY_2LANE ;tc_write (DP_PHY_CTRL , dp_phy_ctrl);msleep (100 );
Signature · 6 lines
2.19.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 6/28 riscv: fix trace_sys_exit hook
In reply to Sasha LevinFrom: David Abdurachmanov <[email protected]>
[ Upstream commit 775800b0f1d7303d4fd8ce0e0d9eca4ff2f338f2 ]
Fix compilation error.
--- arch/riscv/kernel/ptrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/ptrace.c +1 -1
@@ -120,6 +120,6 @@ void do_syscall_trace_exit(struct pt_regs *regs)#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS if (test_thread_flag (TIF_SYSCALL_TRACEPOINT )) -trace_sys_exit (regs, regs->regs[0 ]); +trace_sys_exit (regs,regs_return_value (regs));#endif }
Signature · 7 lines
2.19.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Sasha Levin
maintainerPATCH 11/28 drm/bridge: tc358767: fix initial DP0/1_SRCCTRL value
In reply to Sasha LevinFrom: Tomi Valkeinen <[email protected]>
[ Upstream commit 9a63bd6fe1b5590ffa42ae2ed22ee21363293e31 ]
Initially DP0_SRCCTRL is set to a static value which includes DP0_SRCCTRL_LANES_2 and DP0_SRCCTRL_BW27, even when only 1 lane of 1.62Gbps speed is used. DP1_SRCCTRL is configured to a magic number.
This patch changes the configuration as follows:
Configure DP0_SRCCTRL by using tc_srcctrl() which provides the correct value.
DP1_SRCCTRL needs two bits to be set to the same value as DP0_SRCCTRL:
SSCG and BW27. All other bits can be zero.
--- drivers/gpu/drm/bridge/tc358767.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/bridge/tc358767.c +5 -6
@@ -836,12 +836,11 @@ static int tc_main_link_setup(struct tc_data *tc)if (!tc->mode)return -EINVAL ; -/* from excel file - DP0_SrcCtrl */ -tc_write (DP0_SRCCTRL ,DP0_SRCCTRL_SCRMBLDIS |DP0_SRCCTRL_EN810B | -DP0_SRCCTRL_LANESKEW |DP0_SRCCTRL_LANES_2 | -DP0_SRCCTRL_BW27 |DP0_SRCCTRL_AUTOCORRECT ); -/* from excel file - DP1_SrcCtrl */ -tc_write (DP1_SRCCTRL ,0x00003083 ); +tc_write (DP0_SRCCTRL ,tc_srcctrl (tc)); +/* SSCG and BW27 on DP1 must be set to the same as on DP0 */ +tc_write (DP1_SRCCTRL , + (tc->link.spread ?DP0_SRCCTRL_SSCG :0 ) | + ((tc->link.base.rate !=162000 ) ?DP0_SRCCTRL_BW27 :0 )); rate =clk_get_rate (tc->refclk);switch (rate) {
Signature · 6 lines
2.19.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 12/28 drm/bridge: tc358767: reject modes which require too much BW
In reply to Sasha LevinFrom: Tomi Valkeinen <[email protected]>
[ Upstream commit 51b9e62eb6950c762162ab7eb8390990179be067 ]
The current driver accepts any videomode with pclk < 154MHz. This is not correct, as with 1 lane and/or 1.62Mbps speed not all videomodes can be supported.
Add code to reject modes that require more bandwidth that is available.
--- drivers/gpu/drm/bridge/tc358767.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/bridge/tc358767.c +10 -0
@@ -1114,10 +1114,20 @@ static bool tc_bridge_mode_fixup(struct drm_bridge *bridge,static enum drm_mode_status tc_connector_mode_valid (struct drm_connector *connector,struct drm_display_mode *mode) { +struct tc_data *tc =connector_to_tc (connector); +u32 req, avail; +u32 bits_per_pixel =24 ; +/* DPI interface clock limitation: upto 154 MHz */ if (mode->clock >154000 )return MODE_CLOCK_HIGH ; + req = mode->clock * bits_per_pixel /8 ; + avail = tc->link.base.num_lanes * tc->link.base.rate; + +if (req > avail) +return MODE_BAD ; +return MODE_OK ; }
Signature · 6 lines
2.19.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 13/28 drm/bridge: tc358767: fix output H/V syncs
In reply to Sasha LevinFrom: Tomi Valkeinen <[email protected]>
[ Upstream commit 7923e09c7a766e2d58de7fc395bb84c18e5bc625 ]
The H and V syncs of the DP output are always set to active high. This patch fixes the syncs by configuring them according to the videomode.
--- drivers/gpu/drm/bridge/tc358767.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/tc358767.c +5 -1
@@ -98,6 +98,8 @@#define DP0_STARTVAL 0x064c#define DP0_ACTIVEVAL 0x0650#define DP0_SYNCVAL 0x0654 +#define SYNCVAL_HS_POL_ACTIVE_LOW (1 << 15) +#define SYNCVAL_VS_POL_ACTIVE_LOW (1 << 31)#define DP0_MISC 0x0658#define TU_SIZE_RECOMMENDED (63)/* LSCLK cycles per TU */ #define BPC_6 (0 << 5)
@@ -726,7 +728,9 @@ static int tc_set_video_mode(struct tc_data *tc, struct drm_display_mode *mode)tc_write (DP0_ACTIVEVAL , (mode->vdisplay <<16 ) | (mode->hdisplay)); -tc_write (DP0_SYNCVAL , (vsync_len <<16 ) | (hsync_len <<0 )); +tc_write (DP0_SYNCVAL , (vsync_len <<16 ) | (hsync_len <<0 ) | + ((mode->flags &DRM_MODE_FLAG_NHSYNC ) ?SYNCVAL_HS_POL_ACTIVE_LOW :0 ) | + ((mode->flags &DRM_MODE_FLAG_NVSYNC ) ?SYNCVAL_VS_POL_ACTIVE_LOW :0 ));tc_write (DPIPXLFMT ,VS_POL_ACTIVE_LOW |HS_POL_ACTIVE_LOW |DE_POL_ACTIVE_HIGH |SUB_CFG_TYPE_CONFIG1 |DPI_BPP_RGB888 );
Signature · 6 lines
2.19.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 24/28 gpio: pl061: handle failed allocations
In reply to Sasha LevinFrom: Nicholas Mc Guire <[email protected]>
[ Upstream commit df209c43a0e8258e096fb722dfbdae4f0dd13fde ]
devm_kzalloc(), devm_kstrdup() and devm_kasprintf() all can fail internal allocation and return NULL. Using any of the assigned objects without checking is not safe. As this is early in the boot phase and these allocations really should not fail, any failure here is probably an indication of a more serious issue so it makes little sense to try and rollback the previous allocated resources or try to continue; but rather the probe function is simply exited with -ENOMEM.
--- arch/arm/mach-integrator/impd1.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm/mach-integrator/impd1.c +5 -1
@@ -393,7 +393,11 @@ static int __ref impd1_probe(struct lm_device *dev)sizeof (*lookup) +3 *sizeof (struct gpiod_lookup ), GFP_KERNEL); chipname =devm_kstrdup (&dev->dev, devname,GFP_KERNEL ); - mmciname =kasprintf (GFP_KERNEL ,"lm%x:00700" , dev->id); + mmciname =devm_kasprintf (&dev->dev,GFP_KERNEL , +"lm%x:00700" , dev->id); +if (!lookup || !chipname || !mmciname) +return -ENOMEM ; + lookup->dev_id = mmciname;/* * Offsets on GPIO block 1:
Signature · 1 line
2.19.1